Ver Fonte

兼容修改

hjianglong há 2 semanas atrás
pai
commit
0d58f32474

+ 9 - 2
src/components/GwSelect.vue

@@ -1,6 +1,7 @@
 <template>
     <div class="filter-item">
         <div class="filter-btn" @click="showPicker = true">
+            <!-- <template>{{ props.value }}</template> -->
             {{ getTypeName(props.value) }}
             <van-icon name="arrow-down" color="#ebecf0" size="1rem" />
         </div>
@@ -29,10 +30,16 @@ const onConfirm = ({ selectedOptions }) => {
     showPicker.value = false;
     emits('update:value', selectedOptions[0].value);
 };
-
 function getTypeName(code) {
     if (!code) return '';
-    return props.columns.find(item => item.value === code)?.text;
+   let foundItem = props.columns.find(function(item) {
+  return item.value === code;
+});
+if (foundItem) {
+  return foundItem.text;
+} else {
+  return undefined;
+}
 }
 </script>
 <style lang="scss" scoped>

+ 3 - 1
src/components/GwSelect02.vue

@@ -36,7 +36,9 @@ const onConfirm = ({selectedOptions}) => {
 function getTypeName(code) {
   if (!code) return '';
   if (props.columns && props.columns.length > 0) {
-    return props.columns.find(item => item.value === code)?.text || code;
+    // return props.columns.find(item => item.value === code)?.text || code;
+    let  foundItem = props.columns.find(function(item) { return item.value === code; });
+    return (foundItem && foundItem.text) ? foundItem.text : code;
   }
   return code;
 }

+ 2 - 1
src/layout/components/BottomNav.vue

@@ -19,7 +19,8 @@ const appStore = useAppStore()
 const menuList = [
   {name: '首页', icon: 'wap-home-o', path: '/home'},
   // { name: '一张图', icon: 'location-o', path: '/map' },
-  {name: appStore.ownApp === "1" ? '督查' : '稽察', icon: 'completed-o', path: '/inspect'},
+//   {name: appStore.ownApp === "1" ? '督查' : '稽察', icon: 'completed-o', path: '/inspect'},
+{name: '督查', icon: 'completed-o', path: '/inspect'},
   {name: '问题', icon: 'orders-o', path: '/problem'},
   {name: '我的', icon: 'user-o', path: '/about'},
 ]

+ 3 - 4
src/views/Inspect/Object/Problem/index.vue

@@ -13,7 +13,7 @@
           </div>
         </template>
         <card01 v-for="pblm in item.pblmList" :key="pblm.pblmId" :title="pblm.pblmNm" icon="question"
-                @onSelect="jumpPage(`/problem/${pblm.id}`)">
+                @click="jumpPage(`/problem/${pblm.id}`)">
           <template #right>
             <van-icon color="#000" name="delete-o" size="1rem" @click="deletePblm(item.id)"/>
           </template>
@@ -43,7 +43,8 @@ import {getBaseByInspectType} from "@/assets/js/base";
 import {renderData} from "@/utils/template";
 import {jumpPage} from "@/utils/page";
 import {deleteTacQuestion} from "@/api/questions";
-
+const vConsole = new VConsole();
+console.log("Hello VConsole!");
 const route = useRoute();
 const activeNames = ref(['1']);
 const list = ref([
@@ -62,7 +63,6 @@ const showAddPopover = ref(false);
 
 const onSelect = (action) => {
   const inspect = list.value.find(item => item.name === action.text + '专业')
-
   jumpPage(`/problemAdd`, {inspectType: inspect.id, rgstrId: object.value.id, objId: object.value.objId});
 };
 
@@ -74,7 +74,6 @@ function getData() {
     loading.value = false;
   })
 }
-
 /**
  * 删除问题
  */

+ 23 - 5
src/views/Inspect/history.vue

@@ -44,12 +44,30 @@ function getInspBase(value, level = 1) {
       return;
     }
     if (level === 2) {
-      twoBatchs.value = res.data?.map(item => ({text: item.prsnTitle, value: item.plnaId}))
-      twoBatch.value = twoBatchs.value[0].value;
-      return;
+      // twoBatchs.value = res.data?.map(item => ({text: item.prsnTitle, value: item.plnaId}))
+      // twoBatch.value = twoBatchs.value[0].value;
+      // return;
+      twoBatchs.value = (res.data || []).map(function(item) {
+  return {
+    text: item.prsnTitle,
+    value: item.plnaId
+  };
+});
+
+twoBatch.value = twoBatchs.value.length > 0 ? twoBatchs.value[0].value : null;
+return;
     }
-    baseBatchs.value = res.data?.map(item => ({text: item.prsnTitle, value: item.plnaId})).reverse();
-    baseBatch.value = baseBatchs.value[0].value;
+    // baseBatchs.value = res.data?.map(item => ({text: item.prsnTitle, value: item.plnaId})).reverse();
+    // baseBatch.value = baseBatchs.value[0].value;
+    baseBatchs.value = (res.data || []).map(function(item) {
+  return {
+    text: item.prsnTitle,
+    value: item.plnaId
+  };
+});
+
+baseBatch.value = baseBatchs.value.length > 0 ? baseBatchs.value[0].value : null;
+return;
   });
 }
 

+ 25 - 6
src/views/Problem/detail/index.vue

@@ -110,13 +110,32 @@ const pblm = ref({});
 const tacObjPblmstb = computed(() => pblm.value.tacObjPblmstb || {});
 const cateObjList = ref([]);
 const objSubjectList = ref([]);
-const objSubjectTypeColumns = computed(() => objSubjectList.value?.map(i => {
-  return {text: i.subName, value: i.id}
-}) || []);
+// const objSubjectTypeColumns = computed(() => objSubjectList.value?.map(i => {
+//   return {text: i.subName, value: i.id}
+// }) || []);
+const objSubjectTypeColumns = computed(function() {
+  let list = objSubjectList.value ? objSubjectList.value : [];
+  let mappedList = list.map(function(i) {
+    return {
+      text: i.subName,
+      value: i.id
+    };
+  });
+  return mappedList || [];
+});
 const objSubjects = ref({});
-const gwComFileList = computed(() => pblm.value.gwComFileList?.map(i => {
-  return {url: process.env.VUE_APP_BASE_HOST + process.env.VUE_APP_BASE_API + i.filePath}
-}) || []);
+// const gwComFileList = computed(() => pblm.value.gwComFileList?.map(i => {
+//   return {url: process.env.VUE_APP_BASE_HOST + process.env.VUE_APP_BASE_API + i.filePath}
+// }) || []);
+const gwComFileList = computed(function() {
+  const fileList = pblm.value && pblm.value.gwComFileList ? pblm.value.gwComFileList : [];
+  const mappedList = fileList.map(function(item) {
+    return {
+      url: process.env.VUE_APP_BASE_HOST + process.env.VUE_APP_BASE_API + item.filePath
+    };
+  });
+  return mappedList || [];
+});
 /**
  * 责任主体
  */