From 2e092feceaf8907fe4b6fda847b02bc8bbd1324a Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期三, 09 十月 2024 15:44:38 +0800
Subject: [PATCH] 新增查询条件

---
 src/views/data/ind/item/DerIndDefineForm.vue |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/views/data/ind/item/DerIndDefineForm.vue b/src/views/data/ind/item/DerIndDefineForm.vue
index f16a4ea..9b97465 100644
--- a/src/views/data/ind/item/DerIndDefineForm.vue
+++ b/src/views/data/ind/item/DerIndDefineForm.vue
@@ -7,14 +7,14 @@
       :rules="formRules" label-width="100px">
       <el-row>
         <el-col :span="12">
-          <el-form-item label="原子指标" prop="atomItem.id">
-            <el-select v-model="selected" clearable placeholder="请选择原子指标"
+          <el-form-item label="原子指标" prop="atomItem.itemId">
+            <el-select v-model="formData.atomItem.itemId" clearable placeholder="请选择原子指标"
                        @change="handleChange($event)">
               <el-option
                 v-for="item in atomItemList"
                 :key="item.id"
                 :label="item.itemNo"
-                :value="item.id"
+                :value="item.id + ''"
               />
             </el-select>
           </el-form-item>
@@ -187,6 +187,7 @@
     timeGranularity: '',
     atomItem: {
       id: '',
+      itemId: '',
       itemNo: '',
       itemName: '',
     },
@@ -198,9 +199,6 @@
       timeEnd: '',
       dimension: ''
     }
-  })
-  const queryParams = ref({
-    itemType: 'ATOM'
   })
 
   const validateAsNumber = (rule, value, callback) => {
@@ -218,9 +216,7 @@
     /*"atomItem.id": [{required: true, message: '原子指标不能为空', trigger: 'blur'}]*/
   })
   const formRef = ref() // 表单 Ref
-  const dataSourceList = ref([] as DataSourceConfigApi.DataSourceConfigVO[])
   const atomItemList = ref([] as ItemApi.ItemVO[])
-  const selected = ref(null)
   const showTimeChange = ref(false)
   const dataCategoryList = ref([] as CategoryApi.IndItemCategoryVO[])
   const dataSetFieldList = ref([] as DataSetFieldApi.DataSetFieldVO[])
@@ -233,13 +229,17 @@
     resetForm()
     // 加载数据源列表
     dataCategoryList.value = await CategoryApi.getCategoryListAllSimple()
+    const queryParams = reactive({
+      itemType: 'ATOM'
+    })
     atomItemList.value = await ItemApi.getItemList(queryParams)
-    selected.value = null
     // 修改时,设置数据
     if (id) {
       formLoading.value = true
       try {
         formData.value = await ItemApi.getItem(id)
+        formData.value.derItem.dimension = formData.value.derItem.dimension.split(',')
+        await handleChange(formData.value.atomItem.itemId)
       } finally {
         formLoading.value = false
       }
@@ -316,6 +316,7 @@
       const itemData = await ItemApi.getItem(event)
       formData.value.atomItem.itemName = itemData.itemName
       formData.value.atomItem.id = itemData.atomItem.id
+      formData.value.atomItem.itemId = itemData.id
       const queryParams = reactive({
         dataSetId: itemData.atomItem.dataSet,
       })

--
Gitblit v1.9.3