SceneData.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <Search :tag="tag" :type="'SCENE'" ref="searchRef"></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, n) in list" v-if="list.length" :key="n" data-permission="true" class="resource_item"
  7. data-checking="false" data-searching="1" data-ispub="1">
  8. <div class="mapItem-top-box">
  9. <div class="item-top">
  10. <div class="img_container" data-num="1">
  11. <img class="tab-list-icon-img-MR00001936 img_mr MR00001936" :id="i.SERVICEID + n" :src="setHtmlImg(i, n)"
  12. alt="场景预览图">
  13. </div>
  14. </div>
  15. <div class="item-title">
  16. <span class="r_name">{{ i.SERVICENAME }}</span>
  17. <!-- <span class="r-number" data-num="1" title="编目1次">1</span> -->
  18. </div>
  19. <div class="item-msg">
  20. <div class="item-msg-val">坐标系:<span>{{ i.CRS }}</span></div>
  21. <div class="item-msg-val">适用流程:<span>国家秘密和工作秘密数据成果申请,</span></div>
  22. <div class="item-msg-val">关键字:
  23. <span :id="'KEYWORDS' + i.SERVICEID + n">{{ getTag(i.KEYWORDS, `KEYWORDS${i.SERVICEID}${n}`) }}</span>
  24. </div>
  25. <div class="item-msg-val">服务类型:<span>{{ i.TYPENAME }}</span></div>
  26. </div>
  27. </div>
  28. <div class="operation-box">
  29. <div class="left">
  30. <div class="operation-item browse-item-btn browse-item-MR00001936">
  31. <a target="_blank" :href="`./sceneview.html?${i.SERVICEID}`">
  32. <span>浏览</span>
  33. </a>
  34. </div>
  35. <div class="operation-item" @click="handleQuery(i, n)">
  36. <a href="javascript:void(0)" class="">
  37. <span>详细</span>
  38. </a>
  39. </div>
  40. </div>
  41. <div class="right">
  42. <div class="operation-item" v-if="i.SFJRSQK === '未加入'" @click="applyWay(i)">
  43. <a href="javascript:void(0)" class="">
  44. <span>加入申请库</span>
  45. </a>
  46. </div>
  47. <div class="operation-item" v-else style="cursor: not-allowed;background-color: #e8e8e8;">
  48. <a href="javascript:void(0)" style="cursor: not-allowed;color:#656363;">
  49. <span>{{ i.SFJRSQK == '已加入' ? '已加入申请库' : i.SFJRSQK }}</span>
  50. </a>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <MyPage :total="total"></MyPage>
  58. <!-- 弹出框 -->
  59. <DetailModal v-if="showResDeatil" :type="'SCENE'" @closeModal="showResDeatil = false" :resId="detailResId" />
  60. </div>
  61. </template>
  62. <script>
  63. import { defineComponent, nextTick, onMounted, ref, defineProps, watch } from 'vue';
  64. import { BasicTable, useTable, TableAction } from '/@/components/Table';
  65. import { Popconfirm, Tooltip } from 'ant-design-vue';
  66. import { Authority } from '/@/components/Authority';
  67. // 加载自定义侧边弹出框 组件
  68. import { useDrawer } from '/@/components/Drawer';
  69. // 导入子页面【新增、修改】
  70. import SceneDrawer from './SceneDrawer.vue';
  71. import Search from './child/Search.vue';
  72. import { platList, img, apply, tagAjax } from '/@/api/resource/plat';
  73. import { session } from '/@/utils/Memory';
  74. import { message } from 'ant-design-vue';
  75. import MyPage from './child/MyPage.vue';
  76. import DetailModal from './child/DetailModal.vue';
  77. import { setHtmlImg } from '/@/views/minWidgets/CommonWay.js';
  78. const props = {
  79. listData: {
  80. type: Object,
  81. default: () => {},
  82. }
  83. }
  84. export default defineComponent({
  85. name: 'SceneData',
  86. components: { BasicTable, TableAction, Search, DetailModal, Authority, Popconfirm, Tooltip, SceneDrawer, MyPage },
  87. props,
  88. emits:['resAddToCar'],
  89. setup(props, { emit }) {
  90. const showResDeatil = ref(false)
  91. const detailResId = ref('')
  92. const searchRef = ref(null)
  93. const [registerModal, { openDrawer }] = useDrawer(); //使用右侧弹出框
  94. const list = ref([]);
  95. const total = ref(0);
  96. onMounted(() => getList(props.listData));
  97. const tag = ref('');
  98. async function getList(res) {
  99. console.log("场景传进来的文件资源:", res)
  100. total.value = res.count;
  101. tag.value = res.keywords;
  102. var res = res.items;
  103. var val = JSON.parse(JSON.stringify(res))
  104. list.value = val;
  105. }
  106. //获取资源标签
  107. function getTag(i, id) {
  108. //判断是不是数组
  109. i = i.indexOf('[') > -1 ? JSON.parse(i) : [i];
  110. if (i.length) {
  111. tagAjax().then(r => {
  112. var name = r.filter(j => i.includes(j.code)).map(j => j.name).toString();
  113. document.querySelector(`#${id}`).innerHTML = name;
  114. })
  115. } else {
  116. return ''
  117. }
  118. }
  119. watch(() => props.listData, (val) => getList(val), {
  120. deep: true,
  121. immediate: true
  122. })
  123. function handleQuery(record, n) {
  124. console.log("11111:", record)
  125. // openDrawer(true, {
  126. // record,
  127. // });
  128. //打开详情弹窗
  129. session.setItem('thumbnail2', document.getElementById(record.SERVICEID + n).src);
  130. detailResId.value = record.SERVICEID
  131. showResDeatil.value = true
  132. }
  133. function applyWay(i) {
  134. console.log(i)
  135. apply({
  136. addRes: [{
  137. resDataType: "1",
  138. resId: i.SERVICEID,
  139. resName: `${i.SERVICENAME}(${i.CRS})`,
  140. resType: 0,
  141. workflowType: "SCENE",
  142. }],
  143. userId: session.getItem('userId'),
  144. }).then((r) => {
  145. if (r.datas && r.resp_code == 0) {
  146. message.success('申请成功');
  147. // searchRef.value.getResData();
  148. eventBus.emit('addResToCarEventBus')
  149. emit('resAddToCar')
  150. }
  151. })
  152. }
  153. return {
  154. setHtmlImg,
  155. getTag,
  156. detailResId,
  157. showResDeatil,
  158. tag,
  159. total,
  160. searchRef,
  161. // getDataList,
  162. registerModal,
  163. applyWay,
  164. list,
  165. handleQuery,
  166. };
  167. },
  168. });
  169. </script>
  170. <style scoped>
  171. .datacenter-right .resource_list .item-title .r_name {
  172. color: #5e5d5e;
  173. display: inline-block;
  174. width: 190px;
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. white-space: nowrap;
  178. font-family: Source Han Sans CN;
  179. font-size: 16px;
  180. font-weight: bold;
  181. line-height: 16.38px;
  182. letter-spacing: 0px;
  183. color: #333333;
  184. }
  185. .datacenter-right .resource_list {
  186. box-sizing: border-box;
  187. width: 100%;
  188. float: left;
  189. clear: both;
  190. display: flex;
  191. flex-wrap: wrap;
  192. align-items: center;
  193. }
  194. .datacenter-right .resource_list>div:not(:nth-of-type(4n + 4)) {
  195. margin-right: 7px;
  196. }
  197. .resource_item {
  198. height: 318px;
  199. width: 224px;
  200. margin-bottom: 14px;
  201. border: 2px dashed transparent;
  202. width: 386px;
  203. height: 402px;
  204. border-radius: 4px;
  205. opacity: 1;
  206. background: #FFFFFF;
  207. border: 1px solid #DEDEDE;
  208. }
  209. .mapItem-top-box {
  210. height: 350px;
  211. }
  212. .datacenter-right .resource_list .operation-box {
  213. height: 42px;
  214. display: flex;
  215. margin-bottom: 10px;
  216. /* margin-left: 20px; */
  217. justify-content: space-between;
  218. padding: 0 24px;
  219. .left {
  220. display: flex;
  221. .operation-item {
  222. display: flex;
  223. align-items: center;
  224. justify-content: center;
  225. min-width: 50px;
  226. height: 34px;
  227. opacity: 1;
  228. margin-right: 22px;
  229. padding: 0 10px;
  230. background: #E8E8E8;
  231. a {
  232. font-size: 12px;
  233. width: 100%;
  234. text-align: center;
  235. color: #333333;
  236. }
  237. }
  238. }
  239. .right {
  240. .operation-item {
  241. display: flex;
  242. align-items: center;
  243. justify-content: center;
  244. min-width: 50px;
  245. height: 34px;
  246. opacity: 1;
  247. padding: 0 10px;
  248. background: #0671DD;
  249. a {
  250. font-size: 12px;
  251. width: 100%;
  252. text-align: center;
  253. color: #fff;
  254. }
  255. }
  256. }
  257. }
  258. .datacenter-right .resource_list .item-top {
  259. padding: 10px 16px 10px;
  260. }
  261. .datacenter-right .resource_list .item-top img {
  262. width: 360px;
  263. height: 190px;
  264. border: solid 1px #eeebeb;
  265. }
  266. .datacenter-right .resource_list .item-title {
  267. font-size: 14px;
  268. font-family: PingFang SC;
  269. font-weight: bold;
  270. color: #5e5d5e;
  271. line-height: 16px;
  272. padding: 0 0 0 14px;
  273. overflow: hidden;
  274. text-overflow: ellipsis;
  275. white-space: nowrap;
  276. }
  277. .datacenter-right .resource_list .item-msg {
  278. padding: 0 13px 13px;
  279. }
  280. .img_container {
  281. text-align: center;
  282. }
  283. .img_container {
  284. width: 100%;
  285. height: 100%;
  286. background: #b7bed3;
  287. border-radius: 4px;
  288. }
  289. .datacenter-right .resource_list .item-msg-val {
  290. font-size: 12px;
  291. font-family: PingFang SC;
  292. font-weight: bold;
  293. color: #888888;
  294. line-height: 26px;
  295. /* opacity: 0.5; */
  296. overflow: hidden;
  297. text-overflow: ellipsis;
  298. white-space: nowrap;
  299. }
  300. .item-msg-val>span {
  301. font-family: Source Han Sans CN;
  302. font-size: 14px;
  303. font-weight: normal;
  304. line-height: 16.38px;
  305. letter-spacing: 0px;
  306. color: #333333;
  307. }
  308. </style>