DetailModal.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <a-modal :visible="true" :width="width" :maskClosable="false" :destroyOnClose="true" centered :title="title"
  3. :footer="null" wrapClassName="modal-wrap" @cancel="onClose">
  4. <div class="action-content">
  5. <div class="top-header">
  6. <div class="img-container">
  7. <img :src="baseInfo?.thumbnail2 || './static/img/default-dr3.jpg'" alt="">
  8. </div>
  9. <div class="res-title">
  10. <div class="title">{{ baseInfo.servicename }}</div>
  11. <div class="describle">描述:{{ baseInfo.description }}</div>
  12. <div class="small-mark">
  13. <div class="update-time">更新时间:{{ baseInfo.updatedate }}</div>
  14. <div class="service-type">服务类型:{{ baseInfo.servicetype }}</div>
  15. </div>
  16. <div class="look" v-if="seeShow">
  17. <a target="_blank" :href="`./mapview.html?${baseInfo.serviceid}`">
  18. <span>浏览</span>
  19. </a>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="base-info info-item">
  24. <div class="info-title">基本信息</div>
  25. <div class="form-box">
  26. <a-row>
  27. <a-col :span="3" class="form-item-title form-title">资源地址</a-col>
  28. <a-col :span="21" class="form-item-value form-title">{{ '' }}</a-col>
  29. </a-row>
  30. <a-row>
  31. <a-col :span="12">
  32. <a-row>
  33. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">资源名称</a-col>
  34. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  35. baseInfo.servicename }}</a-col>
  36. </a-row>
  37. </a-col>
  38. <a-col :span="12">
  39. <a-row>
  40. <a-col :span="6" class="form-item-title form-title"
  41. style="border-top: none;border-left: none;">资源别名</a-col>
  42. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  43. baseInfo.servicealiasname }}</a-col>
  44. </a-row>
  45. </a-col>
  46. </a-row>
  47. <a-row>
  48. <a-col :span="3" class="form-item-title form-title" style="border-top: none;">缩略图</a-col>
  49. <a-col :span="21" class="form-item-value form-title" style="border-top: none;"
  50. :title="baseInfo.thumbnail">{{ baseInfo.thumbnail }}</a-col>
  51. </a-row>
  52. <a-row>
  53. <a-col :span="3" class="form-item-title form-title" style="border-top: none;">资源描述</a-col>
  54. <a-col :span="21" class="form-item-value form-title" style="border-top: none;">{{
  55. baseInfo.description }}</a-col>
  56. </a-row>
  57. </div>
  58. </div>
  59. <div class="meta-info info-item">
  60. <div class="info-title">描述信息</div>
  61. <div class="form-box">
  62. <!-- 系统标签,资源类型 -->
  63. <a-row>
  64. <a-col :span="12">
  65. <a-row>
  66. <a-col :span="6" class="form-item-title form-title">系统标签</a-col>
  67. <a-col :span="18" class="form-item-value form-title">{{ metaInfo.serviceTags }}</a-col>
  68. </a-row>
  69. </a-col>
  70. <a-col :span="12">
  71. <a-row>
  72. <a-col :span="6" class="form-item-title form-title" style="border-left: none;">资源类型</a-col>
  73. <a-col :span="18" class="form-item-value form-title">{{ baseInfo.servicetype }}</a-col>
  74. </a-row>
  75. </a-col>
  76. </a-row>
  77. <!-- 数据类型,数据范围 -->
  78. <a-row>
  79. <a-col :span="12">
  80. <a-row>
  81. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">数据类型</a-col>
  82. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  83. metaInfo.dataType === '2' ? '二维' : metaInfo.dataType === '3' ? '三维' : '' }}</a-col>
  84. </a-row>
  85. </a-col>
  86. <a-col :span="12">
  87. <a-row>
  88. <a-col :span="6" class="form-item-title form-title"
  89. style="border-top: none;border-left: none;">数据范围</a-col>
  90. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  91. metaInfo.dataScope }}</a-col>
  92. </a-row>
  93. </a-col>
  94. </a-row>
  95. <!-- 更新方式,数据来源 -->
  96. <a-row>
  97. <a-col :span="12">
  98. <a-row>
  99. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">更新方式</a-col>
  100. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  101. metaInfo.updateType }}</a-col>
  102. </a-row>
  103. </a-col>
  104. <a-col :span="12">
  105. <a-row>
  106. <a-col :span="6" class="form-item-title form-title"
  107. style="border-top: none;border-left: none;">数据来源</a-col>
  108. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  109. metaInfo.source }}</a-col>
  110. </a-row>
  111. </a-col>
  112. </a-row>
  113. <!-- 管理部门,责任科室 -->
  114. <a-row>
  115. <a-col :span="12">
  116. <a-row>
  117. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">管理部门</a-col>
  118. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  119. metaInfo.keepingunit }}</a-col>
  120. </a-row>
  121. </a-col>
  122. <a-col :span="12">
  123. <a-row>
  124. <a-col :span="6" class="form-item-title form-title"
  125. style="border-top: none;border-left: none;">责任科室</a-col>
  126. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  127. metaInfo.rboffice }}</a-col>
  128. </a-row>
  129. </a-col>
  130. </a-row>
  131. <!-- 密级,坐标系 -->
  132. <a-row>
  133. <a-col :span="12">
  134. <a-row>
  135. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">密级</a-col>
  136. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  137. metaInfo.secretlevel }}</a-col>
  138. </a-row>
  139. </a-col>
  140. <a-col :span="12">
  141. <a-row>
  142. <a-col :span="6" class="form-item-title form-title"
  143. style="border-top: none;border-left: none;">坐标系</a-col>
  144. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  145. metaInfo.crs }}</a-col>
  146. </a-row>
  147. </a-col>
  148. </a-row>
  149. <!-- EPSG code,运行状态 -->
  150. <a-row>
  151. <a-col :span="12">
  152. <a-row>
  153. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">EPSG
  154. code</a-col>
  155. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  156. metaInfo.epsgCode }}</a-col>
  157. </a-row>
  158. </a-col>
  159. <a-col :span="12">
  160. <a-row>
  161. <a-col :span="6" class="form-item-title form-title"
  162. style="border-top: none;border-left: none;">运行状态</a-col>
  163. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  164. baseInfo.runtimestatus ? '启用' : '禁用' }}</a-col>
  165. </a-row>
  166. </a-col>
  167. </a-row>
  168. <!-- 是否为历史版本,适合申请流程 -->
  169. <a-row>
  170. <a-col :span="12">
  171. <a-row>
  172. <a-col :span="6" class="form-item-title form-title"
  173. style="border-top: none;">是否为历史版本</a-col>
  174. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  175. Boolean(Number(metaInfo.ishistory)) ? '是' : '否' }}</a-col>
  176. </a-row>
  177. </a-col>
  178. <a-col :span="12">
  179. <a-row>
  180. <a-col :span="6" class="form-item-title form-title"
  181. style="border-top: none;border-left: none;">适合申请流程</a-col>
  182. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  183. metaInfo.shsqlc }}</a-col>
  184. </a-row>
  185. </a-col>
  186. </a-row>
  187. <!-- 备注 -->
  188. <a-row>
  189. <a-col :span="3" class="form-item-title form-title" style="border-top: none;">备注</a-col>
  190. <a-col :span="21" class="form-item-value form-title" style="border-top: none;">{{
  191. metaInfo.bz }}</a-col>
  192. </a-row>
  193. </div>
  194. </div>
  195. <div class="public-set info-item">
  196. <div class="info-title">共享设置</div>
  197. <div class="form-box">
  198. <!-- 是否公开,是否共享 -->
  199. <a-row>
  200. <a-col :span="12">
  201. <a-row>
  202. <a-col :span="6" class="form-item-title form-title">是否公开</a-col>
  203. <a-col :span="18" class="form-item-value form-title">{{ baseInfo.ispublic === '1' ? '是' :
  204. '否'
  205. }}</a-col>
  206. </a-row>
  207. </a-col>
  208. <a-col :span="12">
  209. <a-row>
  210. <a-col :span="6" class="form-item-title form-title" style="border-left: none;">是否共享</a-col>
  211. <a-col :span="18" class="form-item-value form-title">{{ metaInfo.searched === '1' ? '是' :
  212. '否'
  213. }}</a-col>
  214. </a-row>
  215. </a-col>
  216. </a-row>
  217. <!-- 外部申请,是否展示 -->
  218. <a-row>
  219. <a-col :span="12">
  220. <a-row>
  221. <a-col :span="6" class="form-item-title form-title" style="border-top: none;">外部申请</a-col>
  222. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  223. baseInfo.externalApply === '1' ? '是' : '否' }}</a-col>
  224. </a-row>
  225. </a-col>
  226. <a-col :span="12">
  227. <a-row>
  228. <a-col :span="6" class="form-item-title form-title"
  229. style="border-top: none;border-left: none;">是否展示</a-col>
  230. <a-col :span="18" class="form-item-value form-title" style="border-top: none;">{{
  231. metaInfo.isShow === '1' ? '是' : '否' }}</a-col>
  232. </a-row>
  233. </a-col>
  234. </a-row>
  235. </div>
  236. </div>
  237. </div>
  238. </a-modal>
  239. </template>
  240. <script>
  241. import { defineComponent, reactive, ref, onMounted, watch, toRefs } from 'vue';
  242. import { message } from 'ant-design-vue';
  243. import { session } from '/@/utils/Memory';
  244. import moment from 'moment';
  245. import { setHtmlImg } from '/@/views/minWidgets/CommonWay.js';
  246. import { getResViewInfo, queryServiceTags } from '/@/api/resource/plat';
  247. import { getAllTags } from '/@/api/sys/tag';
  248. const props = {
  249. resId: {
  250. type: String,
  251. default: ''
  252. }
  253. }
  254. export default defineComponent({
  255. name: 'modal',
  256. components: {},
  257. props,
  258. setup(props, { emit }) {
  259. const data = reactive({
  260. width: '1200px',
  261. title: '资源详情',
  262. })
  263. // 关闭请求弹窗
  264. const onClose = (e) => {
  265. emit('closeModal')
  266. }
  267. const baseInfo = ref({})
  268. const metaInfo = ref({})
  269. const seeShow = ref(false);
  270. //初始化请求所需数据
  271. onMounted(async () => {
  272. console.log(props.resId);
  273. let res = await getResViewInfo(props.resId)
  274. console.log(res);
  275. seeShow.value = res.type == 'DR' ? false : true;
  276. baseInfo.value = res.servicebase;
  277. baseInfo.value.thumbnail = res.metadata.thumbnail
  278. session.getItem('thumbnail2') && (baseInfo.value.thumbnail2 = session.getItem('thumbnail2'));
  279. baseInfo.value.updatedate = moment(baseInfo.value.updatedate).format('YYYY-MM-DD HH:mm:ss');
  280. metaInfo.value = res.metadata
  281. //所有标签
  282. let param = {
  283. 1: session.getItem('tokenV2')
  284. }
  285. let allTags = await getAllTags(param)
  286. if (allTags.status === '0' && allTags.result) {
  287. let allTagArr = JSON.parse(allTags.result)
  288. let keepingUnitObj = {}
  289. let rbOfficeObj = {}
  290. let secretLevelObj = {}
  291. let epsgCodeObj = {}
  292. let serviceTagsObj = {}
  293. allTagArr.forEach(item => {
  294. //管理部门
  295. item.type === '管理部门' && (keepingUnitObj[item.code] = item.name)
  296. //责任科室
  297. item.type === '责任科室' && (rbOfficeObj[item.code] = item.name)
  298. //密级
  299. item.type === '密级' && (secretLevelObj[item.code] = item.name)
  300. //EPSG code
  301. item.type === 'EPSG code' && (epsgCodeObj[item.code] = item.name)
  302. //资源标签
  303. serviceTagsObj[item.code] = item.name
  304. if (metaInfo.value.keywords) {
  305. let tags = metaInfo.value.keywords.indexOf('[') > -1 ? JSON.parse(metaInfo.value.keywords) : [metaInfo.value.keywords];
  306. let resStr = ''
  307. tags.forEach(tag => {
  308. serviceTagsObj[tag] ? resStr += serviceTagsObj[tag] + ',' : resStr += ''
  309. })
  310. metaInfo.value.serviceTags = resStr.slice(0, -1)
  311. }
  312. })
  313. metaInfo.value.keepingunit = keepingUnitObj[metaInfo.value.keepingunit]
  314. metaInfo.value.rboffice = rbOfficeObj[metaInfo.value.rboffice]
  315. metaInfo.value.secretlevel = secretLevelObj[metaInfo.value.secretlevel]
  316. metaInfo.value.epsgCode = epsgCodeObj[metaInfo.value.epsgCode]
  317. }
  318. })
  319. return {
  320. seeShow,
  321. // setHtmlImg,
  322. baseInfo,
  323. metaInfo,
  324. // formRef,
  325. ...toRefs(data),
  326. onClose
  327. };
  328. },
  329. });
  330. </script>
  331. <style lang="less" scoped>
  332. .modal-wrap {
  333. .action-content {
  334. padding: 20px;
  335. max-height: 800px;
  336. overflow: auto;
  337. .top-header {
  338. margin-left: 20px;
  339. display: flex;
  340. align-items: center;
  341. .img-container {
  342. width: 260px;
  343. height: 200px;
  344. // border: 1px solid blue;
  345. box-sizing: border-box;
  346. img {
  347. width: 100%;
  348. height: 100%;
  349. }
  350. }
  351. .res-title {
  352. flex-grow: 1;
  353. margin-left: 30px;
  354. .title {
  355. font-size: 26px;
  356. font-weight: 700;
  357. }
  358. .describle {
  359. margin: 10px 0;
  360. }
  361. .small-mark {
  362. width: 100%;
  363. padding-bottom: 10px;
  364. display: flex;
  365. border-bottom: 1px solid rgb(220, 220, 220);
  366. .update-time {
  367. margin-right: 50px;
  368. }
  369. }
  370. .look {
  371. margin-top: 20px;
  372. margin-left: 10px;
  373. width: 100px;
  374. height: 35px;
  375. line-height: 32px;
  376. text-align: center;
  377. border: 2px solid blue;
  378. box-sizing: border-box;
  379. color: blue;
  380. font-size: 16px;
  381. font-weight: 700;
  382. cursor: pointer;
  383. user-select: none;
  384. border-radius: 4px;
  385. }
  386. }
  387. }
  388. .info-item {
  389. margin-top: 20px;
  390. .info-title {
  391. margin: 10px 0;
  392. padding-left: 10px;
  393. border-left: 3px solid blue;
  394. }
  395. .form-box {
  396. width: 100%;
  397. .form-title {
  398. border: 1px solid rgb(230, 230, 230);
  399. box-sizing: border-box;
  400. height: 30px;
  401. line-height: 27px;
  402. padding-left: 5px;
  403. white-space: nowrap;
  404. overflow: hidden;
  405. text-overflow: ellipsis;
  406. }
  407. .form-item-title {
  408. background-color: rgb(249, 249, 249);
  409. }
  410. .form-item-value {
  411. border-left: none;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. </style>