소스 검색

地图审核信息完成

sujunling 2 년 전
부모
커밋
eb4ad0283d
5개의 변경된 파일104개의 추가작업 그리고 33개의 파일을 삭제
  1. 12 4
      src/api/resource/plat.ts
  2. 12 3
      src/utils/eventBus.ts
  3. 10 8
      src/views/resource/plat/index.vue
  4. 61 13
      src/views/resource/plat/item/EmpowerInfo.vue
  5. 9 5
      src/views/resource/plat/item/MapData.vue

+ 12 - 4
src/api/resource/plat.ts

@@ -153,14 +153,22 @@ export function platList(text) {
     return new Promise<void>((resolve, reject) => {
         defHttp.post({ url: Api.CallProvider, params: f, ...interfaceType })
             .then((r) => {
+                var oldList = [
+                    { count: 0, keywords: '', type: "MR", typeName: "地图", items: [] },
+                    { count: 0, keywords: '', type: "ER", typeName: "场景", items: [] },
+                    { count: 0, keywords: '', type: "DR", typeName: "数据", items: [] },
+                ]
                 var list = r.result ? JSON.parse(r.result) : false;
                 console.log("资源中心列表:", list)
                 if (list?.length) {
-                    resolve(list);
-                    // session.setItem("zyCenter", JSON.parse(JSON.stringify(list)).map(i => { i.items = [], i.count = 0; return i }));
+                    if (list.length == 3) {
+                        resolve(list);
+                    } else {
+                        oldList.forEach(i => { const item = list.find(j => i.type === j.type); if (item) Object.assign(i, item) });
+                        resolve(oldList);
+                    }
                 } else {
-                    // resolve(session.getItem("zyCenter"));
-                    resolve([])
+                    resolve(oldList);
                 }
             }).catch((e) => {
                 reject(e);

+ 12 - 3
src/utils/eventBus.ts

@@ -10,6 +10,7 @@
 type eventBusClass = {
   emit: (name: string) => void;
   on: (name: string, callback: Function) => void;
+  one: (name: string, callback: Function) => void;
 };
 
 type ParamsKey = string | number | symbol;
@@ -28,9 +29,13 @@ class EventBus implements eventBusClass {
   emit(name: string, ...args: Array<any>) {
     let eventName: Array<Function> = this.list[name];
     try {
-      eventName.forEach((fn) => {
-        fn.apply(this, args);
-      });
+      if (eventName instanceof Array) {
+        eventName.forEach((fn) => {
+          fn.apply(this, args);
+        });
+      } else if (eventName) {
+        eventName.apply(this, args);
+      }
     } catch (error) {
       console.log(error);
     }
@@ -41,5 +46,9 @@ class EventBus implements eventBusClass {
     fn.push(callback);
     this.list[name] = fn;
   }
+
+  one(name: string, callback: Function) {
+    this.list[name] = callback;
+  }
 }
 export default new EventBus();

+ 10 - 8
src/views/resource/plat/index.vue

@@ -65,17 +65,19 @@ export default defineComponent({
       if (currentTreeNodeKeys.value.length && currentTreeNodeKeys.value[0] === selectedKey[0]) {
         selectedKeys.value = [];
         currentTreeNodeKeys.value = [];
-        paramsObj.keywords = null;
-        eventBus.emit("tagChangeTag");
-        eventBus.emit('platListCenter', paramsObj, true)
-        return;
-      }
-      currentTreeNodeKeys.value[0] = selectedKey[0]
-      if (selectedKey.length) {
         paramsObj.keywords = null;
         activeKey.value = 'MR';
         eventBus.emit("tagChangeTag");
         eventBus.emit('platListCenter', paramsObj, true)
+        return;
+      } else {
+        currentTreeNodeKeys.value[0] = selectedKey[0]
+        if (selectedKey.length) {
+          paramsObj.keywords = null;
+          activeKey.value = 'MR';
+          eventBus.emit("tagChangeTag");
+          eventBus.emit('platListCenter', paramsObj, true)
+        }
       }
     }
 
@@ -97,7 +99,7 @@ export default defineComponent({
     });
 
     var paramsObj = {};
-    eventBus.on('platListCenter', (o, idTyep) => {
+    eventBus.one('platListCenter', (o, idTyep) => {
       var type = null;
       if (o && o.type) type = o.type == 'MAP' ? 'MR' : o.type == 'SCENE' ? 'ER' : 'DR';
       let params = o ? JSON.parse(JSON.stringify(o)) : {};

+ 61 - 13
src/views/resource/plat/item/EmpowerInfo.vue

@@ -1,8 +1,13 @@
 <template>
-    <a-modal v-model:visible="show" @cancel="() => show = false" :title="props.title" :footer="null">
-        <p>Some contents...</p>
-        <p>Some contents...</p>
-        <p>Some contents...</p>
+    <a-modal v-model:visible="show" :width="900" @cancel="() => show = false" :title="props.title" :footer="null">
+        <ul class="info">
+            <li>
+                <span>审核结果:{{ info?.shzt }}</span><span>审核意见:{{ shyjInfo }}</span>
+            </li>
+            <li>
+                <p>访问地址:{{ info?.resInfo?.MAPINGURL }}</p>
+            </li>
+        </ul>
     </a-modal>
 </template>
 
@@ -12,7 +17,7 @@ import { message } from 'ant-design-vue';
 import { session } from '/@/utils/Memory';
 import moment from 'moment';
 import { setHtmlImg } from '/@/views/minWidgets/CommonWay.js';
-import { getResViewInfo, queryServiceTags } from '/@/api/resource/plat';
+import { getResInCar, getResViewInfo, queryServiceTags } from '/@/api/resource/plat';
 import { getAllTags } from '/@/api/sys/tag';
 
 
@@ -20,24 +25,67 @@ export default defineComponent({
     name: 'EmpowerInfo',
     components: {},
     props: {
-        show: {
-            type: Boolean,
-            default: false
-        },
         title: {
             type: String,
-            default: ''
+            default: '资源申请信息'
         }
     },
     setup(props, { emit }) {
         const show = ref(false);
-        onMounted(() => show.value = props.show);
-        watch(() => props.show, (val) => show.value = val);
+        const info = ref({});
+        const shyjInfo = ref("");
+
+
+        function showInfo(e) {
+            show.value = !show.value;
+            if (e) getInfo(e);
+        }
+
+        function getInfo(e) {
+            console.log("1111:", e);
+            getResInCar({
+                keyword: e.SERVICENAME,
+                userId: session.getItem('userId')
+            }).then(r => {
+                if (r?.resp_code == 0 && r?.datas?.length) {
+                    var a = r.datas.find(i => i.resInfo.SERVICEID == e.SERVICEID);
+                    if (a) {
+                        var shyj = [];
+                        if (a?.shlc?.length > 1) {
+                            a.shlc.map((i, index) => {
+                                if (index != 0 && index != a.shlc.length - 1) {
+                                    shyj.push(i.USER_NAME + ":" + i.CHECKINFO)
+                                }
+                            })
+                        }
+                        shyjInfo.value = shyj.join(";");
+                        info.value = a;
+                    }
+                }
+            })
+        }
 
         return {
+            shyjInfo,
+            info,
+            showInfo,
             show,
             props,
         };
     },
 });
-</script>
+</script>
+<style lang="less">
+.info {
+    padding: 20px;
+}
+
+.info li span {
+    display: inline-block;
+    width: 50%;
+}
+
+.info li {
+    margin-bottom: 20px;
+}
+</style>

+ 9 - 5
src/views/resource/plat/item/MapData.vue

@@ -44,8 +44,7 @@
                 </a>
               </div>
               <div class="operation-item" v-else-if="i.SFJRSQK === '审核通过'"
-                style="background-color: #05B069;color: #ffffff;cursor: pointer;"
-                @click="() => showEmpowerInfo = !showEmpowerInfo">
+                style="background-color: #05B069;color: #ffffff;cursor: pointer;" @click="showEmpowerInfo(i)">
                 已申请信息
               </div>
               <div class="operation-item" v-else style="cursor: not-allowed;background-color: #e8e8e8;">
@@ -60,7 +59,7 @@
     </div>
     <MyPage :total="total"></MyPage>
     <DetailModal v-if="showResDeatil" :type="'MAP'" @closeModal="showResDeatil = false" :resId="detailResId" />
-    <EmpowerInfo title="地图资源申请信息" v-if="showEmpowerInfo" :show="showEmpowerInfo"></EmpowerInfo>
+    <EmpowerInfo title="地图资源申请信息" ref="infoRef"></EmpowerInfo>
   </div>
 </template>
 <script>
@@ -118,7 +117,8 @@ export default defineComponent({
       if (i.length) {
         tagAjax().then(r => {
           var name = r.filter(j => i.includes(j.code)).map(j => j.name).toString();
-          document.querySelector(`#${id}`).innerHTML = name;
+          var dom = document.querySelector(`#${id}`);
+          if (dom) dom.innerHTML = name;
         })
       } else {
         return ''
@@ -167,10 +167,14 @@ export default defineComponent({
     }
 
     //申请信息查看
-    const showEmpowerInfo = ref(false);
+    const infoRef = ref(null);
+    function showEmpowerInfo(i) {
+      infoRef?.value?.showInfo(i);
+    }
 
 
     return {
+      infoRef,
       showEmpowerInfo,
       setHtmlImg,
       getTag,