7b1976cb by lihua

解决限定地域以及表格约束值显示中文问题

1 parent b749cf8b
......@@ -376,7 +376,19 @@ const execTableInfo = ref({
{ label: "约束条件", field: "constraintName", width: 120 },
{ label: "约束条件英文名称", field: "constraintEnName", width: 140 },
{ label: "约束条件运算符", field: "constraintOperatorName", width: 140 },
{ label: "约束条件值", field: "constraintValue", width: 150 },
{ label: "约束条件值", field: "constraintValue", width: 150, getName: (scope) => {
let row = scope.row;
if (row.constraintEnName == 'dataField') {
return row.additionValue?.map(a => a.chName)?.join(',');
}
if (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') {
return scope.row.additionValue?.map(a => a.tenantName)?.join(',')
}
if (scope.row.constraintEnName == 'limitedState' || scope.row.constraintEnName == 'areaAddress') {
return scope.row.additionValue?.map(a => a.label)?.join(',');
}
return scope.row['constraintValue'] || '--';
} },
{ label: "检验结果", field: "result", width: 130 },
// { label: "上报时间", field: "reportingTime", width: 170 },
],
......
......@@ -212,7 +212,19 @@ const execContractTableInfo = ref({
{ label: "约束条件", field: "constraintName", width: 120 },
{ label: "约束条件英文名称", field: "constraintEnName", width: 140 },
{ label: "约束条件运算符", field: "constraintOperatorName", width: 140 },
{ label: "约束条件值", field: "constraintValue", width: 150 },
{ label: "约束条件值", field: "constraintValue", width: 150, getName: (scope) => {
let row = scope.row;
if (row.constraintEnName == 'dataField') {
return row.additionValue?.map(a => a.chName)?.join(',');
}
if (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') {
return scope.row.additionValue?.map(a => a.tenantName)?.join(',')
}
if (scope.row.constraintEnName == 'limitedState' || scope.row.constraintEnName == 'areaAddress') {
return scope.row.additionValue?.map(a => a.label)?.join(',');
}
return scope.row['constraintValue'] || '--';
} },
{ label: "执行结果", field: "result", width: 130 },
// { label: "上报时间", field: "reportingTime", width: 170 },
],
......
......@@ -1325,7 +1325,7 @@ const respParamsTableInfo = ref({
</div>
<div class="row-extra-desc">
<div class="per-extra-desc">{{ '是否缓存:' + (detailInfo.isCache == 'Y' ? '是' : '否') }}</div>
<div>{{ '是否加密存储:' + (detailInfo.scenario == 'Y' ? '是' : '否') }}</div>
<div>{{ '是否加密存储:' + (detailInfo.isEncrypField == 'Y' ? '是' : '否') }}</div>
</div>
<!-- </template> -->
<div v-show="detailInfo.rightMainName" class="applicationScenarios">{{ '权利主体:' + detailInfo.rightMainName }}
......
......@@ -197,29 +197,6 @@ const handleProcessDialogBtnClick = (btn) => {
}
}
const execContractTableInfo = ref({
id: "exec-contract-table",
height: '214px',
fields: <any[]>[
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "策略id", field: "strategyId", width: 260 },
{ label: "操作行为", field: "action", width: 120 },
{ label: "操作行为英文名称", field: "actionEnName", width: 140 },
{ label: "约束条件", field: "constraintName", width: 120 },
{ label: "约束条件英文名称", field: "constraintEnName", width: 140 },
{ label: "约束条件运算符", field: "constraintOperatorName", width: 140 },
{ label: "约束条件值", field: "constraintValue", width: 150 },
{ label: "执行结果", field: "result", width: 130 },
// { label: "上报时间", field: "reportingTime", width: 170 },
],
data: [],
showPage: false,
actionInfo: {
show: false
},
loading: false
});
</script>
<template>
......
......@@ -110,7 +110,8 @@
v-model="scope.row['constraintAddressValue']" :props="addressProps" :show-all-levels="true" :clearable="true"
show-checked-strategy="parent" :filterable="true" :collapse-tags="true" :collapse-tags-tooltip="true"
:max-collapse-tags="1" :options="parentAreaData" :disabled="false"
@change="(val) => handleOperatorSelectChange(val, scope, 'constraintAddressValue')" />
@change="(val) => handleOperatorSelectChange(val, scope, 'constraintAddressValue')">
</el-cascader>
<span v-else>{{((scope.row.constraintEnName == 'dataField') ?
scope.row.additionValue?.map(a => a.chName)?.join(',') : ((scope.row.constraintEnName ==
'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') ?
......@@ -359,8 +360,13 @@ const transferValueToNew = (val, isTemplate = false) => {
const init = ref(false);
watch(() => props.value, (val) => {
init.value = true;
//init.value = true;
strategyValueInfo.value = transferValueToNew(val);
if (strategyValueInfo.value.some(s => s.constraintEnName == 'areaAddress' && s.additionValue?.some(a => a.value.split('-')?.length > 2))) {
init.value= true;
} else {
init.value= false;
}
}, {
deep: true,
immediate: true
......@@ -440,6 +446,46 @@ const selectConditionChange = (val, scope) => {
}
}
const removeChildrenWithParentsOptimized = (selectedValues) => {
if (!Array.isArray(selectedValues) || selectedValues.length === 0) {
return []
}
// 1. 按路径长度排序(从短到长)
const sortedValues = [...selectedValues].sort((a, b) => a.length - b.length)
// 2. 使用Map存储所有路径的前缀
const parentMap = new Map()
const result = []
// 3. 处理每个路径
for (const path of sortedValues) {
let isChild = false
// 4. 检查当前路径的每个前缀(不包括自身)是否已经在parentMap中
for (let i = 1; i < path.length; i++) { // 注意:i < path.length,不是 i <= path.length
const prefix = path.slice(0, i)
const prefixKey = prefix.join(',')
if (parentMap.has(prefixKey)) {
// 当前路径是某个已有路径的子节点
isChild = true
break
}
}
// 5. 如果不是任何已有路径的子节点
if (!isChild) {
result.push(path)
// 将当前路径添加到Map中(作为可能的父节点)
const pathKey = path.join(',')
parentMap.set(pathKey, true)
}
}
return result
}
const handleOperatorSelectChange = (val, scope, field) => {
init.value = false;
let index = scope.row.index;
......@@ -451,7 +497,8 @@ const handleOperatorSelectChange = (val, scope, field) => {
return connectorList.value.find(c => c.guid == vv);
})
} else if (field == 'constraintAddressValue') {
svChild.additionValue = val?.map(vv => {
let result: any[] = removeChildrenWithParentsOptimized(val);
svChild.additionValue = result?.map(vv => {
let label = ''
let node: any = {};
vv.forEach((vc, index) => {
......@@ -465,7 +512,8 @@ const handleOperatorSelectChange = (val, scope, field) => {
})
return {
value: vv.join('-'),
label: label
label: label,
targetValue: vv.at(-1)
};
})
}
......
......@@ -407,7 +407,19 @@ const execContractTableInfo = ref({
{ label: "约束条件", field: "constraintName", width: 120 },
{ label: "约束条件英文名称", field: "constraintEnName", width: 140 },
{ label: "约束条件运算符", field: "constraintOperatorName", width: 140 },
{ label: "约束条件值", field: "constraintValue", width: 150 },
{ label: "约束条件值", field: "constraintValue", width: 150, getName: (scope) => {
let row = scope.row;
if (row.constraintEnName == 'dataField') {
return row.additionValue?.map(a => a.chName)?.join(',');
}
if (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') {
return scope.row.additionValue?.map(a => a.tenantName)?.join(',')
}
if (scope.row.constraintEnName == 'limitedState' || scope.row.constraintEnName == 'areaAddress') {
return scope.row.additionValue?.map(a => a.label)?.join(',');
}
return scope.row['constraintValue'] || '--';
} },
{ label: "执行结果", field: "result", width: 130 },
// { label: "上报时间", field: "reportingTime", width: 170 },
],
......
......@@ -495,8 +495,8 @@ const getSubmitInfo = () => {
v.constraintValue = d.constraintConnectorValue?.join(',');
v.additionValue = d.additionValue;
} else if (d.constraintEnName == 'areaAddress' && d.constraintAddressValue?.length) {
v.constraintValue = d.constraintAddressValue?.map(dd => {
return dd.at(-1);
v.constraintValue = d.additionValue?.map(dd => {
return dd.targetValue;
})?.join(',');
v.additionValue = d.additionValue;
}
......
......@@ -153,8 +153,8 @@ const btnHandles = ref({
v.constraintValue = d.constraintConnectorValue?.join(',');
v.additionValue = d.additionValue;
} else if (d.constraintEnName == 'areaAddress' && d.constraintAddressValue?.length) {
v.constraintValue = d.constraintAddressValue?.map(dd => {
return dd.at(-1);
v.constraintValue = d.additionValue?.map(dd => {
return dd.targetValue;
})?.join(',');
v.additionValue = d.additionValue;
}
......@@ -797,7 +797,19 @@ const execContractTableInfo = ref({
{ label: "约束条件", field: "constraintName", width: 120 },
{ label: "约束条件英文名称", field: "constraintEnName", width: 140 },
{ label: "约束条件运算符", field: "constraintOperatorCodeName", width: 140 },
{ label: "约束条件值", field: "constraintValue", width: 150 },
{ label: "约束条件值", field: "constraintValue", width: 150, getName: (scope) => {
let row = scope.row;
if (row.constraintEnName == 'dataField') {
return row.additionValue?.map(a => a.chName)?.join(',');
}
if (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') {
return scope.row.additionValue?.map(a => a.tenantName)?.join(',')
}
if (scope.row.constraintEnName == 'limitedState' || scope.row.constraintEnName == 'areaAddress') {
return scope.row.additionValue?.map(a => a.label)?.join(',');
}
return scope.row['constraintValue'] || '--';
} },
{ label: "执行结果", field: "result", width: 130 },
{ label: "上报时间", field: "reportingTime", width: 170 },
],
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!