AssemblyData.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <Search></Search>
  3. <div style="background-color: #f0f2f5" class="dark:bg-dark-900">
  4. <div class="datacenter-right">
  5. <div class="resource_list" id="map_list">
  6. <div v-for="(i, k) in list" :key="k" class="item">
  7. <div><img :src="interfaceImg" alt="" srcset=""></div>
  8. <div class="itemLetf">
  9. <span>
  10. <h1>{{ i.name }}</h1>
  11. <b>
  12. <span>加入申请库</span>
  13. <span @click="showDrawer(i)" style="cursor: pointer;">查看详情</span>
  14. </b>
  15. </span>
  16. <p class="remark" style="height: 32px;"><span>描述:</span>
  17. <p v-html="i.remark"></p>
  18. </p>
  19. <div class="leftBut">
  20. <p><span>当前版本:</span><span>{{ i.version }}</span></p>
  21. <p><span>调用次数:</span><span>{{ i.is_open || 0 }}</span></p>
  22. <p><span>发布时间:</span><span>{{ i.publishTime }}</span></p>
  23. <p><span>更新时间:</span><span>{{ i.updateTime }}</span></p>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="pagination">
  29. <Pagination v-model:current="current" :page-size-options="pageSizeOptions" :total="total" show-size-changer
  30. :page-size="pageSize" @showSizeChange="onShowSizeChange">
  31. <template #buildOptionText="props">
  32. <span v-if="props.value !== '50'">{{ props.value }}条/页</span>
  33. <span v-else>全部</span>
  34. </template>
  35. </Pagination>
  36. </div>
  37. </div>
  38. <a-drawer title="接口详情" width="700px" placement="right" :closable="false" v-model:visible="visible"
  39. :after-visible-change="afterVisibleChange">
  40. <Details :action="action"></Details>
  41. <div class="footer">
  42. <a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
  43. </div>
  44. </a-drawer>
  45. <AssemblyDrawer @register="registerModal" />
  46. </div>
  47. </template>
  48. <script lang="ts">
  49. import { defineComponent, nextTick, onMounted, ref, defineProps, watch } from 'vue';
  50. import { BasicTable, useTable, TableAction } from '/@/components/Table';
  51. import { columns, searchFormSchema } from './sms.data';
  52. import { Popconfirm, Tooltip, Pagination } from 'ant-design-vue';
  53. import { Authority } from '/@/components/Authority';
  54. import { interfaceList, getGroupId } from '/@/api/interface/interface.ts';
  55. import { message } from 'ant-design-vue';
  56. // 加载自定义侧边弹出框 组件
  57. import { useDrawer } from '/@/components/Drawer';
  58. // 导入子页面【新增、修改】
  59. import AssemblyDrawer from './AssemblyDrawer.vue';
  60. import Search from './child/Search.vue';
  61. import Details from './child/Details.vue';
  62. import { session } from '/@/utils/Memory';
  63. import interfaceImg from '/@/assets/images/count2.png';
  64. export default defineComponent({
  65. name: 'SmsLog',
  66. components: { Pagination, BasicTable, TableAction, Authority, Search, Details, Popconfirm, Tooltip, AssemblyDrawer },
  67. setup() {
  68. const [registerModal, { openDrawer }] = useDrawer(); //使用右侧弹出框
  69. const props = defineProps({
  70. listData: {
  71. type: Array,
  72. default: () => [],
  73. }
  74. })
  75. // setInterval(() => {
  76. // console.log(props)
  77. // }, 2000)
  78. function handleQuery(record: Recordable) {
  79. console.log("11111:", record)
  80. openDrawer(true, {
  81. record,
  82. });
  83. }
  84. // var list = [
  85. // { src: 'http://106.12.170.138:4001/examples/img/Earth.jpg', name: '地图加载', has: false, href: "onlineIde_a1_Hello_World_01" },
  86. // { src: 'http://106.12.170.138:4001/examples/img/Earth.jpg', name: '地图加载', has: false, href: "onlineIde_a1_Hello_World_01" },
  87. // { src: 'http://106.12.170.138:4001/examples/img/Earth.jpg', name: '地图加载', has: false, href: "onlineIde_a1_Hello_World_01" }
  88. // ]
  89. var list = ref([]);
  90. // onMounted(() => getList())
  91. function getList() {
  92. interfaceList({
  93. page: current.value,
  94. rows: pageSize.value,
  95. keyword: keyword.value,
  96. }).then((e) => {
  97. console.log("e:", e)
  98. if (e.records.length) {
  99. eventBus.emit("interfaceNum", e);
  100. total.value = e.total;
  101. list.value = e.records;
  102. }
  103. })
  104. }
  105. const visible = ref<boolean>(false);
  106. const action = ref({});
  107. const afterVisibleChange = (bool: boolean) => {
  108. console.log('visible', bool);
  109. };
  110. const showDrawer = (i) => {
  111. console.log("i", i);
  112. action.value = i;
  113. visible.value = true;
  114. };
  115. const onClose = () => {
  116. visible.value = false;
  117. };
  118. function formatData(e) {
  119. var str = null;
  120. try {
  121. str = JSON.stringify(JSON.parse(action.request_headers), null, 4)
  122. } catch (error) {
  123. str = e;
  124. }
  125. return str;
  126. }
  127. const pageSizeOptions = ref(['10', '20', '30', '40', '50']);
  128. const current = ref(1);
  129. const pageSize = ref(10);
  130. const total = ref(50);
  131. const onShowSizeChange = (current, pageSize) => {
  132. console.log(pageSize);
  133. pageSize.value = pageSize;
  134. getGroupIdList()
  135. };
  136. watch(current, () => {
  137. getGroupIdList();
  138. });
  139. const keyword = ref("");
  140. eventBus.on("interfaceSearch", (e) => { keyword.value = e, getList() });
  141. eventBus.on("groupIdInterface", (e) => { groupId = e; getGroupIdList(groupId) });
  142. var groupId = null;
  143. function getGroupIdList(id) {
  144. getGroupId({
  145. page: current.value,
  146. rows: pageSize.value,
  147. groupId: groupId,
  148. }).then((e) => {
  149. eventBus.emit("interfaceNum", e);
  150. total.value = e.totalNum;
  151. list.value = e.list;
  152. })
  153. }
  154. return {
  155. pageSizeOptions,
  156. current,
  157. pageSize,
  158. total,
  159. onShowSizeChange,
  160. formatData,
  161. visible,
  162. action,
  163. afterVisibleChange,
  164. showDrawer,
  165. onClose,
  166. interfaceImg,
  167. registerModal,
  168. list,
  169. handleQuery,
  170. };
  171. },
  172. });
  173. </script>
  174. <style scoped>
  175. .datacenter-right {
  176. position: relative;
  177. height: auto;
  178. }
  179. .pagination {
  180. width: calc(100% - 320px);
  181. height: 40px;
  182. position: fixed;
  183. z-index: 4;
  184. bottom: 16px;
  185. background: #fff;
  186. }
  187. .pagination>ul {
  188. float: right;
  189. }
  190. .remark span,
  191. .remark p {
  192. display: inline-block;
  193. }
  194. #map_list {
  195. overflow-y: scroll;
  196. height: calc(100vh - 194px);
  197. background: #fff;
  198. }
  199. #map_list::-webkit-scrollbar {
  200. width: 1px;
  201. }
  202. .leftBut>p {
  203. display: inline-block;
  204. font-size: 14px;
  205. font-weight: normal;
  206. line-height: 16.38px;
  207. letter-spacing: 0px;
  208. color: #888888;
  209. width: 25%;
  210. }
  211. .leftBut>p span:last-child {
  212. color: #333;
  213. }
  214. .item b {
  215. font-size: 16px;
  216. font-weight: bold;
  217. display: inline-block;
  218. margin: 10px 0;
  219. }
  220. .item {
  221. width: 100%;
  222. height: 110px;
  223. border-radius: 4px;
  224. background: #FFFFFF;
  225. border: 1px solid #DEDEDE;
  226. padding: 10px;
  227. float: left;
  228. margin: 0px 20px 20px 0px;
  229. }
  230. .item img {
  231. width: 48px;
  232. height: 48px;
  233. }
  234. .item>div:first-child {
  235. float: left;
  236. width: 140px;
  237. height: 90px;
  238. overflow: hidden;
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. border: solid 1px #f1eded;
  243. }
  244. .item>div:last-child {
  245. float: left;
  246. width: calc(100vw - 503px);
  247. margin-left: 20px;
  248. }
  249. .itemLetf>span {
  250. display: block;
  251. height: 24px;
  252. line-height: 24px;
  253. }
  254. .itemLetf>span>h1 {
  255. font-size: 16px;
  256. font-weight: bold;
  257. line-height: 16px;
  258. color: #333333;
  259. float: left;
  260. }
  261. .itemLetf>span>b {
  262. float: right;
  263. margin: 0px;
  264. font-size: 14px;
  265. font-weight: normal;
  266. line-height: 16.38px;
  267. letter-spacing: 0px;
  268. color: #0671DD;
  269. }
  270. .itemLetf>span>b>span:first-child {
  271. border-right: solid 1px #999999;
  272. padding-right: 10px;
  273. }
  274. .itemLetf>span>b>span:last-child {
  275. padding-left: 10px;
  276. }
  277. .itemLetf>p {
  278. text-align: left;
  279. border-bottom: 1px solid #DEDEDE;
  280. padding-bottom: 10px;
  281. }
  282. .itemLetf>p>span {
  283. font-size: 14px;
  284. font-weight: normal;
  285. line-height: 16.38px;
  286. letter-spacing: 0px;
  287. color: #888888;
  288. margin-right: 20px;
  289. }
  290. </style>