| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <template>
- <Search></Search>
- <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
- <div class="datacenter-right">
- <div class="resource_list" id="map_list">
- <div v-for="(i, k) in list" :key="k" class="item">
- <div><img :src="interfaceImg" alt="" srcset=""></div>
- <div class="itemLetf">
- <span>
- <h1>{{ i.name }}</h1>
- <b>
- <span>加入申请库</span>
- <span @click="showDrawer(i)" style="cursor: pointer;">查看详情</span>
- </b>
- </span>
- <p class="remark" style="height: 32px;"><span>描述:</span>
- <p v-html="i.remark"></p>
- </p>
- <div class="leftBut">
- <p><span>当前版本:</span><span>{{ i.version }}</span></p>
- <p><span>调用次数:</span><span>{{ i.is_open || 0 }}</span></p>
- <p><span>发布时间:</span><span>{{ i.publishTime }}</span></p>
- <p><span>更新时间:</span><span>{{ i.updateTime }}</span></p>
- </div>
- </div>
- </div>
- </div>
- <div class="pagination">
- <Pagination v-model:current="current" :page-size-options="pageSizeOptions" :total="total" show-size-changer
- :page-size="pageSize" @showSizeChange="onShowSizeChange">
- <template #buildOptionText="props">
- <span v-if="props.value !== '50'">{{ props.value }}条/页</span>
- <span v-else>全部</span>
- </template>
- </Pagination>
- </div>
- </div>
- <a-drawer title="接口详情" width="700px" placement="right" :closable="false" v-model:visible="visible"
- :after-visible-change="afterVisibleChange">
- <Details :action="action"></Details>
- <div class="footer">
- <a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
- </div>
- </a-drawer>
- <AssemblyDrawer @register="registerModal" />
- </div>
- </template>
- <script lang="ts">
- import { defineComponent, nextTick, onMounted, ref, defineProps, watch } from 'vue';
- import { BasicTable, useTable, TableAction } from '/@/components/Table';
- import { columns, searchFormSchema } from './sms.data';
- import { Popconfirm, Tooltip, Pagination } from 'ant-design-vue';
- import { Authority } from '/@/components/Authority';
- import { interfaceList, getGroupId } from '/@/api/interface/interface.ts';
- import { message } from 'ant-design-vue';
- // 加载自定义侧边弹出框 组件
- import { useDrawer } from '/@/components/Drawer';
- // 导入子页面【新增、修改】
- import AssemblyDrawer from './AssemblyDrawer.vue';
- import Search from './child/Search.vue';
- import Details from './child/Details.vue';
- import { session } from '/@/utils/Memory';
- import interfaceImg from '/@/assets/images/count2.png';
- export default defineComponent({
- name: 'SmsLog',
- components: { Pagination, BasicTable, TableAction, Authority, Search, Details, Popconfirm, Tooltip, AssemblyDrawer },
- setup() {
- const [registerModal, { openDrawer }] = useDrawer(); //使用右侧弹出框
- const props = defineProps({
- listData: {
- type: Array,
- default: () => [],
- }
- })
- // setInterval(() => {
- // console.log(props)
- // }, 2000)
- function handleQuery(record: Recordable) {
- console.log("11111:", record)
- openDrawer(true, {
- record,
- });
- }
- // var list = [
- // { src: 'http://106.12.170.138:4001/examples/img/Earth.jpg', name: '地图加载', has: false, href: "onlineIde_a1_Hello_World_01" },
- // { src: 'http://106.12.170.138:4001/examples/img/Earth.jpg', name: '地图加载', has: false, href: "onlineIde_a1_Hello_World_01" },
- // { src: 'http://106.12.170.138:4001/examples/img/Earth.jpg', name: '地图加载', has: false, href: "onlineIde_a1_Hello_World_01" }
- // ]
- var list = ref([]);
- // onMounted(() => getList())
- function getList() {
- interfaceList({
- page: current.value,
- rows: pageSize.value,
- keyword: keyword.value,
- }).then((e) => {
- console.log("e:", e)
- if (e.records.length) {
- eventBus.emit("interfaceNum", e);
- total.value = e.total;
- list.value = e.records;
- }
- })
- }
- const visible = ref<boolean>(false);
- const action = ref({});
- const afterVisibleChange = (bool: boolean) => {
- console.log('visible', bool);
- };
- const showDrawer = (i) => {
- console.log("i", i);
- action.value = i;
- visible.value = true;
- };
- const onClose = () => {
- visible.value = false;
- };
- function formatData(e) {
- var str = null;
- try {
- str = JSON.stringify(JSON.parse(action.request_headers), null, 4)
- } catch (error) {
- str = e;
- }
- return str;
- }
- const pageSizeOptions = ref(['10', '20', '30', '40', '50']);
- const current = ref(1);
- const pageSize = ref(10);
- const total = ref(50);
- const onShowSizeChange = (current, pageSize) => {
- console.log(pageSize);
- pageSize.value = pageSize;
- getGroupIdList()
- };
- watch(current, () => {
- getGroupIdList();
- });
- const keyword = ref("");
- eventBus.on("interfaceSearch", (e) => { keyword.value = e, getList() });
- eventBus.on("groupIdInterface", (e) => { groupId = e; getGroupIdList(groupId) });
- var groupId = null;
- function getGroupIdList(id) {
- getGroupId({
- page: current.value,
- rows: pageSize.value,
- groupId: groupId,
- }).then((e) => {
- eventBus.emit("interfaceNum", e);
- total.value = e.totalNum;
- list.value = e.list;
- })
- }
- return {
- pageSizeOptions,
- current,
- pageSize,
- total,
- onShowSizeChange,
- formatData,
- visible,
- action,
- afterVisibleChange,
- showDrawer,
- onClose,
- interfaceImg,
- registerModal,
- list,
- handleQuery,
- };
- },
- });
- </script>
- <style scoped>
- .datacenter-right {
- position: relative;
- height: auto;
- }
- .pagination {
- width: calc(100% - 320px);
- height: 40px;
- position: fixed;
- z-index: 4;
- bottom: 16px;
- background: #fff;
- }
- .pagination>ul {
- float: right;
- }
- .remark span,
- .remark p {
- display: inline-block;
- }
- #map_list {
- overflow-y: scroll;
- height: calc(100vh - 194px);
- background: #fff;
- }
- #map_list::-webkit-scrollbar {
- width: 1px;
- }
- .leftBut>p {
- display: inline-block;
- font-size: 14px;
- font-weight: normal;
- line-height: 16.38px;
- letter-spacing: 0px;
- color: #888888;
- width: 25%;
- }
- .leftBut>p span:last-child {
- color: #333;
- }
- .item b {
- font-size: 16px;
- font-weight: bold;
- display: inline-block;
- margin: 10px 0;
- }
- .item {
- width: 100%;
- height: 110px;
- border-radius: 4px;
- background: #FFFFFF;
- border: 1px solid #DEDEDE;
- padding: 10px;
- float: left;
- margin: 0px 20px 20px 0px;
- }
- .item img {
- width: 48px;
- height: 48px;
- }
- .item>div:first-child {
- float: left;
- width: 140px;
- height: 90px;
- overflow: hidden;
- display: flex;
- align-items: center;
- justify-content: center;
- border: solid 1px #f1eded;
- }
- .item>div:last-child {
- float: left;
- width: calc(100vw - 503px);
- margin-left: 20px;
- }
- .itemLetf>span {
- display: block;
- height: 24px;
- line-height: 24px;
- }
- .itemLetf>span>h1 {
- font-size: 16px;
- font-weight: bold;
- line-height: 16px;
- color: #333333;
- float: left;
- }
- .itemLetf>span>b {
- float: right;
- margin: 0px;
- font-size: 14px;
- font-weight: normal;
- line-height: 16.38px;
- letter-spacing: 0px;
- color: #0671DD;
- }
- .itemLetf>span>b>span:first-child {
- border-right: solid 1px #999999;
- padding-right: 10px;
- }
- .itemLetf>span>b>span:last-child {
- padding-left: 10px;
- }
- .itemLetf>p {
- text-align: left;
- border-bottom: 1px solid #DEDEDE;
- padding-bottom: 10px;
- }
- .itemLetf>p>span {
- font-size: 14px;
- font-weight: normal;
- line-height: 16.38px;
- letter-spacing: 0px;
- color: #888888;
- margin-right: 20px;
- }
- </style>
|