MapData.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <Search :tag="tag" :type="'MAP'" 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" :id="i.SERVICEID + n" :src="setHtmlImg(i, n)" alt="图片">
  12. </div>
  13. </div>
  14. <div class="item-title">
  15. <span class="r_name">{{ i.SERVICENAME }}</span>
  16. <!-- <span class="r-number" data-num="1" title="编目1次">1</span> -->
  17. </div>
  18. <div class="item-msg">
  19. <div class="item-msg-val">坐标系:<span>{{ i.CRS }}</span></div>
  20. <!-- <div class="item-msg-val">适用流程:<span>{{ i.SHSQLCMC }}</span></div> -->
  21. <div class="item-msg-val">关键字:
  22. <span :id="'KEYWORDS' + i.SERVICEID + n">{{ getTag(i.KEYWORDS, `KEYWORDS${i.SERVICEID}${n}`) }}</span>
  23. </div>
  24. <div class="item-msg-val">服务类型:<span>{{ i.TYPENAME }}</span></div>
  25. </div>
  26. </div>
  27. <div class="operation-box">
  28. <div class="left">
  29. <div class="operation-item browse-item-btn browse-item-MR00001936"
  30. style="background: #E1EBFB;color: #2D74E7;">
  31. <!-- 小浪底 -->
  32. <!-- <a target="_blank" :href="`./mapview.html?${i.SERVICEID}`" rel="opener"> -->
  33. <!-- 黑龙滩 -->
  34. <a target="_blank" :href="`./sceneview.html?${i.MAPINGURL}`" rel="opener">
  35. <span style="color: #2D74E7;">浏览</span>
  36. </a>
  37. </div>
  38. <div class="operation-item" @click="handleQuery(i, n)" style="background: #E1EBFB;color: #2D74E7;">
  39. <a href="javascript:void(0)" class="">
  40. <span style="color: #2D74E7;">详细</span>
  41. </a>
  42. </div>
  43. </div>
  44. <div class="right">
  45. <div class="operation-item" v-if="i.SFJRSQK === '未加入'" @click="applyWay(i)">
  46. <a href="javascript:void(0)" class="">
  47. <span>加入申请库</span>
  48. </a>
  49. </div>
  50. <div class="operation-item" v-else-if="i.SFJRSQK === '审核通过'"
  51. style="background-color: #05B069;color: #ffffff;cursor: pointer;" @click="showEmpowerInfo(i)">
  52. 已申请信息
  53. </div>
  54. <div class="operation-item" v-else style="cursor: not-allowed;background-color: #e8e8e8;"
  55. :style="{ background: i.SFJRSQK == '已加入' ? '#E8E8E8' : i.SFJRSQK == '审核中' ? '#ED9C23' : i.SFJRSQK == '审核不通过' ? '#FA5151' : '' }">
  56. <a href="javascript:void(0)" class="" style="cursor: not-allowed;color:#656363;">
  57. <span :style="{ color: i.SFJRSQK == '已加入' ? '#999999' : '#ffffff' }">{{ i.SFJRSQK == '已加入' ? '已加入申请库' :
  58. i.SFJRSQK }}</span>
  59. </a>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <a-empty style="margin: 100px auto;" v-else description="暂无数据"></a-empty>
  65. </div>
  66. </div>
  67. <MyPage :total="total"></MyPage>
  68. <!-- <DetailModal v-if="showResDeatil" :type="'MAP'" @closeModal="showResDeatil = false" :resId="detailResId"
  69. :res="detailRes" /> -->
  70. <DetailModal @register="registerModal" :type="'FILE'" @closeModal="showResDeatil = false" :res="detailRes" :resId="detailResId" />
  71. <EmpowerInfo @register="registerModalEM" title="地图资源申请信息" ref="infoRef"></EmpowerInfo>
  72. </div>
  73. </template>
  74. <script>
  75. import { defineComponent, defineEmits, nextTick, onMounted, ref, defineProps, watch } from 'vue';
  76. import { platList, img, apply, tagAjax } from '/@/api/resource/plat';
  77. import { message, Empty } from 'ant-design-vue';
  78. // 导入子页面【详情】
  79. import DetailModal from './child/DetailModal.vue';
  80. import Search from './child/Search.vue';
  81. import { session } from '/@/utils/Memory';
  82. import MyPage from './child/MyPage.vue';
  83. import { setHtmlImg } from '/@/views/minWidgets/CommonWay.js';
  84. import EmpowerInfo from './EmpowerInfo.vue';
  85. import { useModal } from '/@/components/Modal';
  86. export default defineComponent({
  87. name: 'MapData',
  88. components: { Search, DetailModal, MyPage, EmpowerInfo },
  89. emits: ['resAddToCar'],
  90. props: {
  91. listData: {
  92. type: Object,
  93. default: () => { },
  94. }
  95. },
  96. setup(props, { emit }) {
  97. const searchRef = ref(null)
  98. const showResDeatil = ref(false)
  99. const list = ref([]);
  100. const detailResId = ref('')
  101. const total = ref(0);
  102. const tag = ref('');
  103. async function getList(res) {
  104. var res = JSON.parse(JSON.stringify(res))
  105. total.value = res.count;
  106. list.value = res.items;
  107. tag.value = res.keywords;
  108. }
  109. function getImg(i, n) {
  110. img(i.SERVICEID).then(r => {
  111. if (r && r.length) {
  112. var i = r[0];
  113. console.log("122222:", i.thumbnail)
  114. document.querySelector(`#${i.serviceid}${n}`).src = i.thumbnail ? i.thumbnail : './static/img/default-dr3.jpg';
  115. }
  116. })
  117. }
  118. //获取资源标签
  119. function getTag(i, id) {
  120. if (i == "CSSJ") i = '["CSSJ","SJ"]';
  121. //判断是不是数组
  122. i = i.indexOf('[') > -1 ? JSON.parse(i) : [i];
  123. if (i.length) {
  124. tagAjax().then(r => {
  125. var name = r.filter(j => i.includes(j.code)).map(j => j.name).toString();
  126. var dom = document.querySelector(`#${id}`);
  127. if (dom) dom.innerHTML = name;
  128. })
  129. } else {
  130. return ''
  131. }
  132. }
  133. onMounted(() => {
  134. getList(props.listData);
  135. });
  136. watch(
  137. () => props.listData,
  138. (val) => getList(val),
  139. {
  140. deep: true,
  141. immediate: true
  142. }
  143. )
  144. const [registerModal, { openModal }] = useModal();
  145. const detailRes = ref(null);
  146. function handleQuery(record, n) {
  147. //打开详情弹窗
  148. console.log("打开详情弹窗:", record)
  149. session.setItem('thumbnail2', document.getElementById(record.SERVICEID + n).src);
  150. detailResId.value = record.SERVICEID;
  151. detailRes.value = record;
  152. showResDeatil.value = true;
  153. openModal(true);
  154. }
  155. function applyWay(i) {
  156. console.log(i)
  157. apply({
  158. addRes: [{
  159. resDataType: "1",
  160. resId: i.SERVICEID,
  161. resName: `${i.SERVICENAME}(${i.CRS})`,
  162. resType: 0,
  163. workflowType: "MAP",
  164. }],
  165. userId: session.getItem('userId'),
  166. }).then((r) => {
  167. if (r.datas && r.resp_code == 0) {
  168. message.success('申请成功');
  169. // searchRef.value.getResData();
  170. eventBus.emit('addResToCarEventBus')
  171. emit('resAddToCar')
  172. }
  173. })
  174. }
  175. //申请信息查看
  176. const [registerModalEM, { openModal:openModalEM }] = useModal();
  177. const infoRef = ref(null);
  178. function showEmpowerInfo(i) {
  179. infoRef?.value?.showInfo(i);
  180. openModalEM(true)
  181. }
  182. return {
  183. registerModalEM,
  184. registerModal,
  185. infoRef,
  186. showEmpowerInfo,
  187. setHtmlImg,
  188. getTag,
  189. tag,
  190. getImg,
  191. total,
  192. detailRes,
  193. detailResId,
  194. searchRef,
  195. showResDeatil,
  196. applyWay,
  197. list,
  198. handleQuery,
  199. };
  200. },
  201. });
  202. </script>
  203. <style>
  204. .datacenter-right{
  205. height: calc(100vh - 270px);
  206. overflow: auto;
  207. background: #fff;
  208. &::-webkit-scrollbar {
  209. width: 3px;
  210. }
  211. }
  212. </style>
  213. <style scoped>
  214. .operation-item {
  215. border-radius: 3px;
  216. }
  217. .pagination {
  218. float: right;
  219. }
  220. .datacenter-right .resource_list .item-title .r_name {
  221. color: #5e5d5e;
  222. display: inline-block;
  223. width: 190px;
  224. overflow: hidden;
  225. text-overflow: ellipsis;
  226. white-space: nowrap;
  227. font-family: Source Han Sans CN;
  228. font-size: 16px;
  229. font-weight: bold;
  230. line-height: 16.38px;
  231. letter-spacing: 0px;
  232. color: #333333;
  233. }
  234. .datacenter-right .resource_list {
  235. box-sizing: border-box;
  236. width: 100%;
  237. float: left;
  238. clear: both;
  239. display: flex;
  240. flex-wrap: wrap;
  241. align-items: center;
  242. }
  243. .datacenter-right .resource_list>div:not(:nth-of-type(4n + 4)) {
  244. margin-right: 7px;
  245. }
  246. .resource_item {
  247. height: 318px;
  248. width: 224px;
  249. margin-bottom: 14px;
  250. border: 2px dashed transparent;
  251. width: 386px;
  252. height: 402px;
  253. border-radius: 4px;
  254. opacity: 1;
  255. background: #FFFFFF;
  256. border: 1px solid #DEDEDE;
  257. }
  258. .mapItem-top-box {
  259. height: 350px;
  260. }
  261. .datacenter-right .resource_list .operation-box {
  262. height: 42px;
  263. display: flex;
  264. margin-bottom: 10px;
  265. /* margin-left: 20px; */
  266. justify-content: space-between;
  267. padding: 0 24px;
  268. .left {
  269. display: flex;
  270. .operation-item {
  271. display: flex;
  272. align-items: center;
  273. justify-content: center;
  274. min-width: 50px;
  275. height: 34px;
  276. opacity: 1;
  277. margin-right: 22px;
  278. padding: 0 10px;
  279. background: #E8E8E8;
  280. border-radius: 3px;
  281. a {
  282. font-size: 12px;
  283. width: 100%;
  284. text-align: center;
  285. color: #333333;
  286. }
  287. }
  288. }
  289. .right {
  290. .operation-item {
  291. display: flex;
  292. align-items: center;
  293. justify-content: center;
  294. min-width: 50px;
  295. height: 34px;
  296. opacity: 1;
  297. padding: 0 10px;
  298. background: #0671DD;
  299. a {
  300. font-size: 12px;
  301. width: 100%;
  302. text-align: center;
  303. color: #fff;
  304. }
  305. }
  306. }
  307. }
  308. .datacenter-right .resource_list .item-top {
  309. padding: 10px 16px 10px;
  310. margin-bottom: 20px;
  311. }
  312. .datacenter-right .resource_list .item-top img {
  313. width: 360px;
  314. height: 190px;
  315. border: solid 1px #eeebeb;
  316. }
  317. .datacenter-right .resource_list .item-title {
  318. font-size: 14px;
  319. font-family: PingFang SC;
  320. font-weight: bold;
  321. color: #5e5d5e;
  322. line-height: 16px;
  323. padding: 0 0 0 14px;
  324. overflow: hidden;
  325. text-overflow: ellipsis;
  326. white-space: nowrap;
  327. }
  328. .datacenter-right .resource_list .item-msg {
  329. padding: 0 13px 13px;
  330. }
  331. .img_container {
  332. text-align: center;
  333. }
  334. .img_container {
  335. width: 100%;
  336. height: 100%;
  337. background: #b7bed3;
  338. border-radius: 4px;
  339. }
  340. .datacenter-right .resource_list .item-msg-val {
  341. font-size: 12px;
  342. font-family: PingFang SC;
  343. font-weight: bold;
  344. color: #888888;
  345. line-height: 26px;
  346. /* opacity: 0.5; */
  347. overflow: hidden;
  348. text-overflow: ellipsis;
  349. white-space: nowrap;
  350. }
  351. .item-msg-val>span {
  352. font-family: Source Han Sans CN;
  353. font-size: 14px;
  354. font-weight: normal;
  355. line-height: 16.38px;
  356. letter-spacing: 0px;
  357. color: #333333;
  358. }
  359. </style>