| | |
| | | :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> |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="时间限定" prop="timeLimit"> |
| | | <el-select v-model="formData.timeLimit" placeholder="请选择" |
| | | <el-select v-model="formData.derItem.timeLimit" placeholder="请选择" |
| | | @change="handleTimeLimitChange($event)"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.IND_TIME_LIMIT)" |
| | |
| | | timeGranularity: '', |
| | | atomItem: { |
| | | id: '', |
| | | itemId: '', |
| | | itemNo: '', |
| | | itemName: '', |
| | | }, |
| | |
| | | timeEnd: '', |
| | | dimension: '' |
| | | } |
| | | }) |
| | | const queryParams = ref({ |
| | | itemType: 'ATOM' |
| | | }) |
| | | |
| | | const validateAsNumber = (rule, value, callback) => { |
| | |
| | | /*"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[]) |
| | |
| | | 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) |
| | | if(formData.value.derItem.dimension.length > 0){ |
| | | formData.value.derItem.dimension = formData.value.derItem.dimension.split(',') |
| | | }else { |
| | | formData.value.derItem.dimension = "" |
| | | } |
| | | await handleChange(formData.value.derItem.atomItemId) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | |
| | | formLoading.value = true |
| | | try { |
| | | formData.value.itemType = 'DER' |
| | | formData.value.derItem.atomItemId = formData.value.atomItem.id |
| | | formData.value.derItem.atomItemId = formData.value.atomItem.itemId |
| | | if(formData.value.derItem.dimension.length > 0){ |
| | | let dimension = '' |
| | | for (let index in formData.value.derItem.dimension){ |
| | | dimension = dimension + formData.value.derItem.dimension[index] + ',' |
| | | } |
| | | formData.value.derItem.dimension = dimension.substring(0, dimension.length - 1) |
| | | }else{ |
| | | formData.value.derItem.dimension = '' |
| | | } |
| | | const data = formData.value as ItemApi.ItemVO |
| | | if (formType.value === 'create') { |
| | |
| | | async function handleChange(event) { |
| | | if (event !== null && event !== undefined) { |
| | | const itemData = await ItemApi.getItem(event) |
| | | let a = itemData.atomItem.id |
| | | formData.value.atomItem.id = a |
| | | formData.value.atomItem.itemName = itemData.itemName |
| | | formData.value.atomItem.id = itemData.atomItem.id |
| | | formData.value.atomItem.itemId = itemData.atomItem.itemId |
| | | const queryParams = reactive({ |
| | | dataSetId: itemData.atomItem.dataSet, |
| | | }) |