FileData.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <Search 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"
  12. :src="(i.info && i.info.length && i.info[0].thumbnail) || './static/img/default-dr3.jpg'" 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">关键字:<span>测试数据</span></div>
  23. <div class="item-msg-val">服务类型:<span>{{ i.TYPENAME }}</span></div>
  24. </div>
  25. </div>
  26. <div class="operation-box">
  27. <div class="left">
  28. <div class="operation-item browse-item-btn browse-item-MR00001936">
  29. <a target="_blank"
  30. :href="(i.info && i.info.length && i.info[0].thumbnail) || './static/img/default-dr3.jpg'">
  31. <span>浏览</span>
  32. </a>
  33. </div>
  34. <div class="operation-item" @click="handleQuery(i)">
  35. <a href="javascript:void(0)" class="">
  36. <span>详细</span>
  37. </a>
  38. </div>
  39. </div>
  40. <div class="right">
  41. <div class="operation-item" v-if="i.SFJRSQK === '未加入'" @click="applyWay(i)">
  42. <a href="javascript:void(0)" class="">
  43. <span>加入申请库</span>
  44. </a>
  45. </div>
  46. <div class="operation-item" v-else style="cursor: not-allowed;background-color: #e8e8e8;">
  47. <a href="javascript:void(0)" class="" style="cursor: not-allowed;">
  48. <span>已加入</span>
  49. </a>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- 弹出框 -->
  57. <DetailModal v-if="showResDeatil" @closeModal="showResDeatil = false" :resId="detailResId" />
  58. </div>
  59. </template>
  60. <script>
  61. import { defineComponent, nextTick, onMounted, ref, defineProps, watch } from 'vue';
  62. // 导入子页面【详情】
  63. import DetailModal from './child/DetailModal.vue';
  64. import Search from './child/Search.vue';
  65. import { platList, img, apply } from '/@/api/resource/plat';
  66. import { session } from '/@/utils/Memory';
  67. import { message } from 'ant-design-vue';
  68. const props = {
  69. listData: {
  70. type: Array,
  71. default: () => [],
  72. }
  73. }
  74. export default defineComponent({
  75. name: 'SmsLog',
  76. components: { Search, DetailModal },
  77. props,
  78. setup(props, { emit }) {
  79. const showResDeatil = ref(false)
  80. const searchRef = ref(null)
  81. const list = ref([]);
  82. const detailResId = ref('')
  83. onMounted(() => {
  84. console.log("传进来的文件资源:", props.listData)
  85. list.value = props.listData
  86. list.value.map(async (i) => i.info = await img(i.SERVICEID))
  87. });
  88. watch(
  89. () => props.listData,
  90. (val) => {
  91. list.value = JSON.parse(JSON.stringify(val))
  92. list.value.map(async (i) => i.info = await img(i.SERVICEID))
  93. },
  94. {
  95. deep: true,
  96. immediate: true
  97. }
  98. )
  99. function applyWay(i) {
  100. console.log(i)
  101. apply({
  102. addRes: [{
  103. resDataType: "2",
  104. resId: i.SERVICEID,
  105. resName: `${i.SERVICENAME}(${i.CRS})`,
  106. resType: 0,
  107. workflowType: "FILE",
  108. }],
  109. userId: session.getItem('userId'),
  110. }).then((r) => {
  111. if (r.datas && r.resp_code == 0) {
  112. message.success('申请成功');
  113. // searchRef.value.getResData();
  114. eventBus.emit('addResToCarEventBus')
  115. emit('resAddToCar')
  116. }
  117. })
  118. }
  119. function handleQuery(record) {
  120. //打开详情弹窗
  121. detailResId.value = record.SERVICEID
  122. showResDeatil.value = true
  123. }
  124. return {
  125. showResDeatil,
  126. detailResId,
  127. searchRef,
  128. list,
  129. applyWay,
  130. handleQuery,
  131. };
  132. },
  133. });
  134. </script>
  135. <style scoped>
  136. .datacenter-right .resource_list .item-title .r_name {
  137. color: #5e5d5e;
  138. display: inline-block;
  139. width: 190px;
  140. overflow: hidden;
  141. text-overflow: ellipsis;
  142. white-space: nowrap;
  143. font-family: Source Han Sans CN;
  144. font-size: 16px;
  145. font-weight: bold;
  146. line-height: 16.38px;
  147. letter-spacing: 0px;
  148. color: #333333;
  149. }
  150. .datacenter-right .resource_list {
  151. box-sizing: border-box;
  152. width: 100%;
  153. float: left;
  154. clear: both;
  155. display: flex;
  156. flex-wrap: wrap;
  157. align-items: center;
  158. }
  159. .datacenter-right .resource_list>div:not(:nth-of-type(4n + 4)) {
  160. margin-right: 7px;
  161. }
  162. .resource_item {
  163. height: 318px;
  164. width: 224px;
  165. margin-bottom: 14px;
  166. border: 2px dashed transparent;
  167. width: 386px;
  168. height: 402px;
  169. border-radius: 4px;
  170. opacity: 1;
  171. background: #FFFFFF;
  172. border: 1px solid #DEDEDE;
  173. }
  174. .mapItem-top-box {
  175. height: 350px;
  176. }
  177. .datacenter-right .resource_list .operation-box {
  178. height: 42px;
  179. display: flex;
  180. margin-bottom: 10px;
  181. /* margin-left: 20px; */
  182. justify-content: space-between;
  183. padding: 0 24px;
  184. .left {
  185. display: flex;
  186. .operation-item {
  187. display: flex;
  188. align-items: center;
  189. justify-content: center;
  190. min-width: 50px;
  191. height: 34px;
  192. opacity: 1;
  193. margin-right: 22px;
  194. padding: 0 10px;
  195. background: #E8E8E8;
  196. a {
  197. font-size: 12px;
  198. width: 100%;
  199. text-align: center;
  200. color: #333333;
  201. }
  202. }
  203. }
  204. .right {
  205. .operation-item {
  206. display: flex;
  207. align-items: center;
  208. justify-content: center;
  209. min-width: 50px;
  210. height: 34px;
  211. opacity: 1;
  212. padding: 0 10px;
  213. background: #0671DD;
  214. a {
  215. font-size: 12px;
  216. width: 100%;
  217. text-align: center;
  218. color: #fff;
  219. }
  220. }
  221. }
  222. }
  223. .datacenter-right .resource_list .item-top {
  224. padding: 10px 16px 10px;
  225. }
  226. .datacenter-right .resource_list .item-top img {
  227. width: 360px;
  228. height: 190px;
  229. border: solid 1px #eeebeb;
  230. }
  231. .datacenter-right .resource_list .item-title {
  232. font-size: 14px;
  233. font-family: PingFang SC;
  234. font-weight: bold;
  235. color: #5e5d5e;
  236. line-height: 16px;
  237. padding: 0 0 0 14px;
  238. overflow: hidden;
  239. text-overflow: ellipsis;
  240. white-space: nowrap;
  241. }
  242. .datacenter-right .resource_list .item-msg {
  243. padding: 0 13px 13px;
  244. }
  245. .img_container {
  246. text-align: center;
  247. }
  248. .img_container {
  249. width: 100%;
  250. height: 100%;
  251. background: #b7bed3;
  252. border-radius: 4px;
  253. }
  254. .datacenter-right .resource_list .item-msg-val {
  255. font-size: 12px;
  256. font-family: PingFang SC;
  257. font-weight: bold;
  258. color: #888888;
  259. line-height: 26px;
  260. /* opacity: 0.5; */
  261. overflow: hidden;
  262. text-overflow: ellipsis;
  263. white-space: nowrap;
  264. }
  265. .item-msg-val>span {
  266. font-family: Source Han Sans CN;
  267. font-size: 14px;
  268. font-weight: normal;
  269. line-height: 16.38px;
  270. letter-spacing: 0px;
  271. color: #333333;
  272. }
  273. </style>