34122137 by fanguang Committed by lihua

fix

1 parent 1a5abd37
...@@ -77,40 +77,40 @@ ...@@ -77,40 +77,40 @@
77 <div class="table-form"> 77 <div class="table-form">
78 <div class="table-form-wrapper" v-for="item,index in form.fieldRQVOS" :key="index"> 78 <div class="table-form-wrapper" v-for="item,index in form.fieldRQVOS" :key="index">
79 <div class="table-form-item"> 79 <div class="table-form-item">
80 <el-select v-model="item.fileNameCode" style="width:160px" clearable :disabled="fieldsDisabled"> 80 <el-select v-model="item.fileNameCode" style="width:160px" filterable clearable :disabled="fieldsDisabled || fieldsControlDisabled">
81 <el-option v-for="item in fieldOptions" :label="item.label" :value="item.value" :key="item.value"></el-option> 81 <el-option v-for="item in fieldOptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
82 </el-select> 82 </el-select>
83 </div> 83 </div>
84 <div class="table-form-item"> 84 <div class="table-form-item">
85 <el-select v-model="item.isNotnull" style="width: 96px" placeholder="是否必填" clearable :disabled="fieldsDisabled"> 85 <el-select v-model="item.isNotnull" style="width: 96px" placeholder="是否必填" clearable :disabled="fieldsDisabled || fieldsControlDisabled">
86 <el-option v-for="item in isBooleanOptions" :label="item.label" :value="item.value" :key="item.value"></el-option> 86 <el-option v-for="item in isBooleanOptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
87 </el-select> 87 </el-select>
88 </div> 88 </div>
89 <div class="table-form-item"> 89 <div class="table-form-item">
90 <el-select v-model="item.isDisplay" style="width:96px" placeholder="是否展示" clearable :disabled="fieldsDisabled"> 90 <el-select v-model="item.isDisplay" style="width:96px" placeholder="是否展示" clearable :disabled="fieldsDisabled || fieldsControlDisabled">
91 <el-option v-for="item in isBooleanOptions" :label="item.label" :value="item.value" :key="item.value"></el-option> 91 <el-option v-for="item in isBooleanOptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
92 </el-select> 92 </el-select>
93 </div> 93 </div>
94 <div class="table-form-item"> 94 <div class="table-form-item">
95 <el-select v-model="item.inputTypeCode" style="width:130px" clearable :disabled="fieldsDisabled" 95 <el-select v-model="item.inputTypeCode" style="width:130px" clearable :disabled="fieldsDisabled || fieldsControlDisabled"
96 @change="v => inputTypeChange(v, item)"> 96 @change="v => inputTypeChange(v, item)">
97 <el-option v-for="item in inputOptions" :label="item.label" :value="item.value" :key="item.value"></el-option> 97 <el-option v-for="item in inputOptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
98 </el-select> 98 </el-select>
99 </div> 99 </div>
100 <div class="table-form-item"> 100 <div class="table-form-item">
101 <el-select v-if="item.inputTypeCode == 2" v-model="item.dataTypeCode" style="width:160px" filterable clearable :disabled="fieldsDisabled"> 101 <el-select v-if="item.inputTypeCode == 2" v-model="item.dataTypeCode" style="width:160px" filterable clearable :disabled="fieldsDisabled || fieldsControlDisabled">
102 <el-option v-for="item in allDictOptions" :label="item.dictTypeName" :value="item.dictTypeName" :key="item.guid"></el-option> 102 <el-option v-for="item in allDictOptions" :label="item.dictTypeName" :value="item.dictTypeName" :key="item.guid"></el-option>
103 </el-select> 103 </el-select>
104 <el-input v-else-if="item.inputTypeCode == 3" v-model="item.validateExpression" placeholder="请输入"></el-input> 104 <el-input v-else-if="item.inputTypeCode == 3" v-model="item.validateExpression" placeholder="请输入"></el-input>
105 </div> 105 </div>
106 <div class="table-form-operation" v-if="!fieldsDisabled"> 106 <div class="table-form-operation" v-if="!fieldsDisabled && !fieldsControlDisabled">
107 <!-- <el-icon color="#4fa1a4" @click="() => addTableItem(index)"> 107 <!-- <el-icon color="#4fa1a4" @click="() => addTableItem(index)">
108 <CirclePlus /> 108 <CirclePlus />
109 </el-icon> --> 109 </el-icon> -->
110 <el-icon color="#b2b2b2" @click="() => deleteTableItem(index)" :size="22" class="custom-icon" style="margin-top:3px"><Delete /></el-icon> 110 <el-icon color="#b2b2b2" @click="() => deleteTableItem(index)" :size="22" class="custom-icon" style="margin-top:3px"><Delete /></el-icon>
111 </div> 111 </div>
112 </div> 112 </div>
113 <div class="table-form-add" v-if="!fieldsDisabled"> 113 <div class="table-form-add" v-if="!fieldsDisabled && !fieldsControlDisabled">
114 <el-icon color="#4fa1a4" @click="() => addTableItem(index)" :size="20" class="custom-icon"> 114 <el-icon color="#4fa1a4" @click="() => addTableItem(index)" :size="20" class="custom-icon">
115 <CirclePlus /> 115 <CirclePlus />
116 </el-icon> 116 </el-icon>
...@@ -135,7 +135,10 @@ ...@@ -135,7 +135,10 @@
135 // import { cloneDeep } from 'lodesh-es' 135 // import { cloneDeep } from 'lodesh-es'
136 import { watch } from 'vue' 136 import { watch } from 'vue'
137 import { Search, CirclePlus, Delete } from '@element-plus/icons-vue' 137 import { Search, CirclePlus, Delete } from '@element-plus/icons-vue'
138 import { saveMetaStandard, deleteMetaStandard, updateMetaStandard, getMetaStandardDetail } from '@/api/modules/dataMetaService' 138 import { saveMetaStandard, deleteMetaStandard,
139 updateMetaStandard, getMetaStandardDetail,
140 getMetaStandardTree
141 } from '@/api/modules/dataMetaService'
139 import { 142 import {
140 getParamsList, getDictAllList 143 getParamsList, getDictAllList
141 } from '@/api/modules/dataAsset' 144 } from '@/api/modules/dataAsset'
...@@ -201,6 +204,7 @@ const fieldsDisabled = computed(() => { ...@@ -201,6 +204,7 @@ const fieldsDisabled = computed(() => {
201 return true 204 return true
202 } 205 }
203 }) 206 })
207 const fieldsControlDisabled = ref(true)
204 const treeSelectData = ref([]) 208 const treeSelectData = ref([])
205 209
206 /** 210 /**
...@@ -254,21 +258,35 @@ function parentGuidChange (val) { ...@@ -254,21 +258,35 @@ function parentGuidChange (val) {
254 } 258 }
255 } 259 }
256 function parentGuidCheck (node, {checkedKeys}) { 260 function parentGuidCheck (node, {checkedKeys}) {
261 fieldsControlDisabled.value = false
262 if (node.level == 1) {
257 let fieldRQVOS = null 263 let fieldRQVOS = null
258 if (checkedKeys.length) { 264 if (checkedKeys.length) {
259 fieldRQVOS = [{...tableFormTpl}] 265 fieldRQVOS = [{...tableFormTpl}]
260 } 266 }
261 form.value.fieldRQVOS = fieldRQVOS 267 form.value.fieldRQVOS = fieldRQVOS
262 // 新增状态,上级标准带出标准编号和发布单位 268 return
263 if (props.type === 'add') { 269 }
270
271 // 上级标准带出标准编号和发布单位
272 // loading.value = true
264 getMetaStandardDetail(node.guid).then((res:any) => { 273 getMetaStandardDetail(node.guid).then((res:any) => {
265 if (res.code === proxy.$passCode) { 274 if (res.code === proxy.$passCode) {
266 const data = res.data 275 const data = res.data
276 if (!form.value.standardCode) {
267 form.value.standardCode = data.standardCode 277 form.value.standardCode = data.standardCode
278 }
279 if (!form.value.publishingUnitCode) {
268 form.value.publishingUnitCode = data.publishingUnitCode 280 form.value.publishingUnitCode = data.publishingUnitCode
269 } 281 }
270 }) 282 form.value.fieldRQVOS = data.fieldRSVOS
283 if (data.fieldRSVOS) {
284 fieldsControlDisabled.value = true
285 } else {
286 fieldsControlDisabled.value = false
271 } 287 }
288 }
289 })
272 } 290 }
273 291
274 const tableFormTpl = { 292 const tableFormTpl = {
...@@ -333,17 +351,33 @@ function confirm () { ...@@ -333,17 +351,33 @@ function confirm () {
333 }) 351 })
334 } 352 }
335 353
354 function getTreeSelectOptions () {
355 return getMetaStandardTree().then((res:any) => {
356 if (res.code === proxy.$passCode) {
357 let data = res.data || []
358 data.forEach(item => {
359 item.showEdit = true
360 item.level = 1
361 })
362 treeSelectData.value = data
363 }
364 })
365 }
366
336 watch( 367 watch(
337 () => visible.value, 368 () => visible.value,
338 (v) => { 369 (v) => {
339 if (!v) return 370 if (!v) return
340 // 上级标准:不能选自己,有数据的标准不能选 371 // 上级标准:不能选自己,有数据的标准不能选
341 treeSelectData.value = JSON.parse(JSON.stringify(props.standardOptions)) 372 fieldsControlDisabled.value = true
373 // treeSelectData.value = JSON.parse(JSON.stringify(props.standardOptions))
342 if (props.type === 'edit') { 374 if (props.type === 'edit') {
375 getTreeSelectOptions().then(() => {
343 getDetail().then(() => formatOptions(treeSelectData.value)) 376 getDetail().then(() => formatOptions(treeSelectData.value))
377 })
344 } else { 378 } else {
345 form.value = { ...formTpl } 379 form.value = { ...formTpl }
346 formatOptions(treeSelectData.value) 380 getTreeSelectOptions().then(() => formatOptions(treeSelectData.value))
347 } 381 }
348 setTimeout(() => { 382 setTimeout(() => {
349 formEl.value.clearValidate() 383 formEl.value.clearValidate()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!