|
|
@@ -23,7 +23,7 @@
|
|
|
配置内容:
|
|
|
<el-card style="width: 400px;margin-left: 10px;" shadow="always">
|
|
|
<div>
|
|
|
- <div v-for="(text, index) in conditionTexts" :key="index"
|
|
|
+ <div v-for="(text, index) in conditionTexts" :key="text + index"
|
|
|
style="display: flex;margin-bottom: 5px;">
|
|
|
<span>{{ text }}</span>
|
|
|
</div>
|
|
|
@@ -40,22 +40,22 @@
|
|
|
</div>
|
|
|
<div style="display: flex; align-items: center;margin: 20px 0px;">
|
|
|
业务节点:
|
|
|
- <el-select v-model="configFormList.effectNode"
|
|
|
- placeholder="请选择" filterable >
|
|
|
- <el-option v-for=" item in getOptions('effect_node')" :key="item.label"
|
|
|
+ <el-select :disabled="layer.disabled" v-model="configFormList.effectNode"
|
|
|
+ placeholder="请选择" filterable @change="handleEffectNode(configFormList.effectNode)">
|
|
|
+ <el-option v-for=" item in getOptions('effect_node')" :key="item.label"
|
|
|
:label="item.label" :value="item.value"></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
<h3 style="margin-top: 20px;">配置列表</h3>
|
|
|
|
|
|
- <div class="flex mt-2" v-for="(item, index) in configFormList.configList">
|
|
|
+ <div class="flex mt-2" v-for="(item, index) in configFormList.configList" :key="`${item}_${index}`">
|
|
|
<div style="display: flex;width: 100%;align-items: center;">
|
|
|
<div class="title" style="width: 60px;">配置项{{ index + 1 }}</div>
|
|
|
<el-select :disabled="layer.disabled" v-model="item.fieldName"
|
|
|
:ref="el => { if (el) configInputRefs[index] = el }" style="width: 180px;margin: 0 10px;"
|
|
|
placeholder="请选择" filterable :class="{ 'is-error': item.error_fieldName }"
|
|
|
@change="clearFieldError(index, 'fieldName')">
|
|
|
- <el-option v-for="(typeCode,typeIndex) in layer.optionsData" :key="typeCode.fieldDesc"
|
|
|
+ <el-option v-for="(typeCode,typeIndex) in configOptions" :key="`${typeCode.fieldName}_${typeIndex}`"
|
|
|
:label="typeCode.fieldDesc" :value="typeCode.fieldName"></el-option>
|
|
|
</el-select>
|
|
|
|
|
|
@@ -152,7 +152,7 @@
|
|
|
import drag from '@/directive/drag/index'
|
|
|
import { camelToSnake } from '@/utils/index.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
- import { riskTemplateView } from '@/api/riskModule.js'
|
|
|
+ import { riskTemplateView, riskGetByNode } from '@/api/riskModule.js'
|
|
|
|
|
|
const props = defineProps({
|
|
|
layer: {
|
|
|
@@ -381,12 +381,32 @@
|
|
|
console.log('2-handleTypeTwo-configVal', configFormList.value.configList[index].configVal)
|
|
|
}
|
|
|
|
|
|
+ // 配置项1列表options
|
|
|
+ const configOptions = ref([])
|
|
|
+ // 业务节点
|
|
|
+ const handleEffectNode = async(val) =>{
|
|
|
+ let res = await riskGetByNode({effectNode: val})
|
|
|
+ configOptions.value = res.data
|
|
|
+ // 切换时重置配置列表
|
|
|
+ let config = {
|
|
|
+ configId: null,
|
|
|
+ configType: null,
|
|
|
+ configVal: null,
|
|
|
+ dictList: null,
|
|
|
+ fieldDesc: null,
|
|
|
+ fieldName: null,
|
|
|
+ multy: null,
|
|
|
+ }
|
|
|
+ configFormList.value.configList = []
|
|
|
+ configFormList.value.configList.push(config)
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// #region 配置内容逻辑
|
|
|
|
|
|
// 获取配置名称
|
|
|
const getFieldDesc = (fieldName) => {
|
|
|
- const item = props.layer.optionsData.find(i => i.fieldName === fieldName);
|
|
|
+ const item = configOptions.value.find(i => i.fieldName === fieldName);
|
|
|
return item ? item.fieldDesc : '';
|
|
|
};
|
|
|
|
|
|
@@ -525,10 +545,13 @@
|
|
|
});
|
|
|
|
|
|
// 编辑时获取回显数据
|
|
|
- watch(() => props.layer.show, (val) => {
|
|
|
+ watch(() => props.layer.show, async(val) => {
|
|
|
+ configOptions.value = [] //重置选项列表
|
|
|
if (val && props.layer.disabled && props.layer.templateId) {
|
|
|
console.log('templateId', props.layer.templateId)
|
|
|
- gettemplateData(props.layer.templateId)
|
|
|
+ await gettemplateData(props.layer.templateId)
|
|
|
+ let res = await riskGetByNode({effectNode: configFormList.value.effectNode})
|
|
|
+ configOptions.value = res.data
|
|
|
}
|
|
|
})
|
|
|
|