Przeglądaj źródła

报表管理-新增bug修改-提交

lxh 1 rok temu
rodzic
commit
c0c2cf48bd

+ 1 - 0
src/views/vent/reportManager/comment/DeviceModal.vue

@@ -193,6 +193,7 @@ let save = () => {
 };
 
 watch(() => props.optionLists, (newV, oldV) => {
+  console.log(newV,'777777777777777----------------')
   optionList.value = newV
 }, { immediate: true, deep: true })
 </script>

+ 11 - 16
src/views/vent/reportManager/comment/NormalTable.vue

@@ -38,6 +38,12 @@ import { useListPage } from '/@/hooks/system/useListPage';
 import { getQuery } from '../reportManager.api'
 
 const props = defineProps({
+  moduleList:{
+    type:Array,
+    default:()=>{
+      return []
+    }
+  },
   searchParam: {
     type: Object,
     default: () => {
@@ -92,7 +98,7 @@ const record = reactive({});
 const columnList = getTableHeaderColumns('');
 let visibleUp = ref(0)
 let resetTable = ref(0)
-let optionLists = reactive<any[]>([])
+let optionLists = ref<any[]>([])
 //列表查询参数
 let searchParams = reactive({
   busKind: '',
@@ -146,20 +152,6 @@ function resetUpload() {
   resetTable.value = new Date().getTime()
 }
 
-//获取模板报表列表数据
-async function getQueryList() {
-  let res = await getQuery()
-  console.log(res, '报表模板---------')
-  if (res.length != 0) {
-    optionLists.length = 0
-    res[0].children.forEach(el => {
-      if(el.itemValue!='needQ' && el.itemValue!='majorpath' ){
-        optionLists.push({ label: el.itemText, value: el.itemValue })
-      }
-    })
-  }
-}
-
 /**
  * 新增事件
  */
@@ -168,7 +160,6 @@ function handleAdd() {
   for (let key in record) {
     delete record[key];
   }
-  getQueryList()
   openModal(true);
 }
 
@@ -249,6 +240,10 @@ watch(() => props.searchParam, (newS, oldS) => {
   searchParams.reportType = newS.reportType
 }, { immediate: true, deep: true })
 
+watch(()=>props.moduleList,(newV,oldV)=>{
+  optionLists.value=newV
+},{immediate:true,deep:true})
+
 defineExpose({
   doRequest, onExportXls, onImportXls, reload, getForm
 });

+ 17 - 1
src/views/vent/reportManager/index.vue

@@ -15,7 +15,7 @@
         </fileSystem>
       </div>
       <div class="right-box">
-        <NormalTable :key="dataNow" :searchParam="searchParam" :columns="columns" :deleteById="deleteById"
+        <NormalTable :key="dataNow" :moduleList="moduleList" :searchParam="searchParam" :columns="columns" :deleteById="deleteById"
           :downLoad="downLoad" :list="reportList" designScope="device-tabel" title="报表管理" :showTab="false"
           @saveAdd="saveAdd" />
       </div>
@@ -73,6 +73,9 @@ let selected = reactive<any>({
   isFolder: false,
 });
 
+//报表模板数据
+let moduleList=reactive<any[]>([])
+
 //获取左侧菜单树
 async function getTreeList() {
   const res = await getQuery()
@@ -124,6 +127,19 @@ function treeClick(node) {
     searchParam.modelType = node.ppid
     searchParam.reportType = node.id
   }
+  getModuleList()
+}
+
+//获取报表模板数据
+async function getModuleList(){
+  let res=await reportList({column: 'createTime', ...searchParam})
+  console.log(res,'报表模板---------')
+  if(res.records.length!=0){
+    moduleList.length=0
+    res.records.forEach(el=>{
+      moduleList.push({label:el.fileName,value:el.id})
+    })
+  }
 }
 
 async function saveAdd(params) {