29464640 by lihua

二期的策略引用

1 parent 5f0a75ec
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
30 "crypto-js": "^4.2.0", 30 "crypto-js": "^4.2.0",
31 "dayjs": "^1.11.7", 31 "dayjs": "^1.11.7",
32 "echarts": "^5.4.3", 32 "echarts": "^5.4.3",
33 "element-plus": "^2.9.0", 33 "element-plus": "^2.10.5",
34 "eruda": "^3.0.0", 34 "eruda": "^3.0.0",
35 "file-saver": "^2.0.5", 35 "file-saver": "^2.0.5",
36 "hotkeys-js": "^3.10.2", 36 "hotkeys-js": "^3.10.2",
......
...@@ -51,8 +51,8 @@ dependencies: ...@@ -51,8 +51,8 @@ dependencies:
51 specifier: ^5.4.3 51 specifier: ^5.4.3
52 version: 5.5.1 52 version: 5.5.1
53 element-plus: 53 element-plus:
54 specifier: ^2.9.0 54 specifier: ^2.10.5
55 version: 2.9.0(vue@3.5.13) 55 version: 2.10.5(vue@3.5.13)
56 eruda: 56 eruda:
57 specifier: ^3.0.0 57 specifier: ^3.0.0
58 version: 3.4.1 58 version: 3.4.1
...@@ -4066,8 +4066,8 @@ packages: ...@@ -4066,8 +4066,8 @@ packages:
4066 resolution: {integrity: sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ==} 4066 resolution: {integrity: sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ==}
4067 dev: true 4067 dev: true
4068 4068
4069 /element-plus@2.9.0(vue@3.5.13): 4069 /element-plus@2.10.5(vue@3.5.13):
4070 resolution: {integrity: sha512-ccOFXKsauo2dtokAr4OX7gZsb7TuAoVxA2zGRZo5o2yyDDBLBaZxOoFQPoxITSLcHbBfQuNDGK5Iag5hnyKkZA==} 4070 resolution: {integrity: sha512-O9wTDu3Tm51ACVByWrThtBhH4Ygefg1HGY5pyAaxnoIrj8uMN0GtZ4IREwR3Yw/6sM2HyxjrsGI/D46iUVP97A==}
4071 peerDependencies: 4071 peerDependencies:
4072 vue: ^3.2.0 4072 vue: ^3.2.0
4073 dependencies: 4073 dependencies:
......
...@@ -155,8 +155,8 @@ export const getContractDataProduct = (tenantGuid) => request({ ...@@ -155,8 +155,8 @@ export const getContractDataProduct = (tenantGuid) => request({
155 }) 155 })
156 156
157 /** 获取下拉数据产品列表的去重字段 */ 157 /** 获取下拉数据产品列表的去重字段 */
158 export const getDamFieldsByProductGuid = (productGuid, isTds = 'N') => request({ 158 export const getDamFieldsByProductGuid = (productGuid, isTds = 'N', isAnnon = 'N') => request({
159 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/field-by-dam-guid?damGuid=${productGuid}&isTds=${isTds}`, 159 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/field-by-dam-guid?damGuid=${productGuid}&isTds=${isTds}&isAnnon=${isAnnon}`,
160 method: 'get' 160 method: 'get'
161 }) 161 })
162 162
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
3 <div class="h-title">策略信息</div> 3 <div class="h-title">策略信息</div>
4 <el-button v-if="!isLook" plain @click="invokeTemplate" v-preReClick>合约模板调用</el-button> 4 <el-button v-if="!isLook" plain @click="invokeTemplate" v-preReClick>合约模板调用</el-button>
5 </div> 5 </div>
6 <el-table class="strategyTable no-scroll-vertical" ref="strategyTableRef" v-loading="strategyDataLoading" :data="strategyData" 6 <el-table :key="key" class="strategyTable no-scroll-vertical" ref="strategyTableRef" v-loading="strategyDataLoading"
7 :height="(isReport || isLook) ? 'auto' : '250px'" :highlight-current-row="true" stripe tooltip-effect="light" border 7 :data="strategyData" :height="(isReport || isLook) ? 'auto' : '250px'" :highlight-current-row="true" stripe
8 :span-method="arraySpanMethod"> 8 tooltip-effect="light" border :span-method="arraySpanMethod">
9 <el-table-column label="序号" width="56" align="center" fixed="left" :formatter="formatIndex" /> 9 <el-table-column label="序号" width="56" align="center" fixed="left" :formatter="formatIndex" />
10 <el-table-column prop="action" label="行为类型" :width="isLook ? '106px' : (isReport ? 'auto' : '150px')" 10 <el-table-column prop="action" label="行为类型" :width="isLook ? '106px' : (isReport ? 'auto' : '150px')"
11 :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> 11 :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport">
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
76 </template> 76 </template>
77 <template #default="scope"> 77 <template #default="scope">
78 <el-input 78 <el-input
79 v-if="!isLook && !(productFieldList != null && (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector' || scope.row.constraintEnName == 'dataField'))" 79 v-if="!isLook && !(productFieldList != null && (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector' || scope.row.constraintEnName == 'dataField' || scope.row.constraintEnName == 'limitedState' || scope.row.constraintEnName == 'areaAddress'))"
80 v-model="scope.row['constraintValue']" placeholder="请输入" :maxlength="200" 80 v-model="scope.row['constraintValue']" placeholder="请输入" :maxlength="200"
81 @change="(val) => handleOperatorSelectChange(val, scope, 'constraintValue')" clearable></el-input> 81 @change="(val) => handleOperatorSelectChange(val, scope, 'constraintValue')" clearable></el-input>
82 <!-- 限定连接器 --> 82 <!-- 限定连接器 -->
...@@ -84,19 +84,39 @@ ...@@ -84,19 +84,39 @@
84 v-else-if="!isLook && productFieldList != null && (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector')" 84 v-else-if="!isLook && productFieldList != null && (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector')"
85 v-model="scope.row['constraintConnectorValue']" :loading="loading" :remote="true" 85 v-model="scope.row['constraintConnectorValue']" :loading="loading" :remote="true"
86 :remote-method="remoteMethod" :max-collapse-tags="1" :collapse-tags="true" :collapse-tags-tooltip="true" 86 :remote-method="remoteMethod" :max-collapse-tags="1" :collapse-tags="true" :collapse-tags-tooltip="true"
87 multiple filterable clearable :placeholder="scope.row.constraintPlaceholderValue || '请输入关键字搜索'" value-key="guid" @change="(val) => handleOperatorSelectChange(val, scope, 'constraintConnectorValue')"> 87 multiple filterable clearable :placeholder="scope.row.constraintPlaceholderValue || '请输入关键字搜索'"
88 <el-option v-for="opt in connectorList" :key="opt['guid']" :label="opt['tenantName']" 88 value-key="guid" @change="(val) => handleOperatorSelectChange(val, scope, 'constraintConnectorValue')">
89 :value="opt['guid']" /> 89 <el-option v-for="opt in connectorList" :key="opt['guid']" :label="opt['tenantName']" :value="opt['guid']" />
90 </el-select> 90 </el-select>
91 <!-- 加密字段 --> 91 <!-- 限定字段 -->
92 <el-select v-else-if="!isLook && productFieldList != null && scope.row.constraintEnName == 'dataField'" 92 <el-select v-else-if="!isLook && productFieldList != null && scope.row.constraintEnName == 'dataField'"
93 :max-collapse-tags="1" :collapse-tags="true" :collapse-tags-tooltip="true" 93 :max-collapse-tags="1" :collapse-tags="true" :collapse-tags-tooltip="true"
94 v-model="scope.row['constraintFieldValue']" multiple filterable clearable :placeholder="scope.row.constraintPlaceholderValue || '请选择'" 94 v-model="scope.row['constraintFieldValue']" multiple filterable clearable
95 :placeholder="scope.row.constraintPlaceholderValue || '请选择'"
95 @change="(val) => handleOperatorSelectChange(val, scope, 'constraintFieldValue')"> 96 @change="(val) => handleOperatorSelectChange(val, scope, 'constraintFieldValue')">
96 <el-option v-for="opt in productFieldList" :key="opt['enName']" :label="opt['chName']" 97 <el-option v-for="opt in (scope.row.actionEnName == 'anonymize' ? annonFieldsList : productFieldList)"
97 :value="opt['enName']" /> 98 :key="opt['enName']" :label="opt['chName']" :value="opt['enName']" />
98 </el-select> 99 </el-select>
99 <span v-else>{{ (scope.row.constraintEnName == 'dataField' ? scope.row.additionValue?.map(a => a.chName)?.join(',') : ((scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') ? scope.row.additionValue?.map(a => a.tenantName)?.join(',') : scope.row['constraintValue'])) || '--' }}</span> 100 <!-- 限定状态 -->
101 <el-select v-else-if="!isLook && productFieldList != null && scope.row.constraintEnName == 'limitedState'"
102 :max-collapse-tags="1" :collapse-tags="true" :collapse-tags-tooltip="true"
103 v-model="scope.row['constraintStateValue']" :multiple="false" filterable clearable
104 :placeholder="scope.row.constraintPlaceholderValue || '请选择'"
105 @change="(val) => handleOperatorSelectChange(val, scope, 'constraintStateValue')">
106 <el-option v-for="opt in limitStateOptionList" :key="opt['value']" :label="opt['label']"
107 :value="opt['value']" />
108 </el-select>
109 <el-cascader v-else-if="!isLook && productFieldList != null && scope.row.constraintEnName == 'areaAddress'"
110 v-model="scope.row['constraintAddressValue']" :props="addressProps" :show-all-levels="true" :clearable="true"
111 show-checked-strategy="parent" :filterable="true" :collapse-tags="true" :collapse-tags-tooltip="true"
112 :max-collapse-tags="1" :options="parentAreaData" :disabled="false"
113 @change="(val) => handleOperatorSelectChange(val, scope, 'constraintAddressValue')" />
114 <span v-else>{{((scope.row.constraintEnName == 'dataField') ?
115 scope.row.additionValue?.map(a => a.chName)?.join(',') : ((scope.row.constraintEnName ==
116 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector') ?
117 scope.row.additionValue?.map(a => a.tenantName)?.join(',') : (scope.row.constraintEnName == 'limitedState' ||
118 scope.row.constraintEnName == 'areaAddress' ? scope.row.additionValue?.map(a => a.value)?.join(',') :
119 scope.row['constraintValue']))) || '--'}}</span>
100 </template> 120 </template>
101 </el-table-column> 121 </el-table-column>
102 <el-table-column v-if="!isLook" label="操作" width="140px" align="left" fixed="right" show-overflow-tooltip> 122 <el-table-column v-if="!isLook" label="操作" width="140px" align="left" fixed="right" show-overflow-tooltip>
...@@ -120,7 +140,10 @@ import { CirclePlus } from "@element-plus/icons-vue"; ...@@ -120,7 +140,10 @@ import { CirclePlus } from "@element-plus/icons-vue";
120 import { 140 import {
121 getValidContractTemplateList, 141 getValidContractTemplateList,
122 getContractTenantList 142 getContractTenantList
123 } from "@/api/modules/dataSmartContract" 143 } from "@/api/modules/dataSmartContract";
144 import {
145 getAreaData,
146 } from "@/api/modules/queryService";
124 147
125 const { required } = useValidator(); 148 const { required } = useValidator();
126 const { proxy } = getCurrentInstance() as any; 149 const { proxy } = getCurrentInstance() as any;
...@@ -150,10 +173,18 @@ const props = defineProps({ ...@@ -150,10 +173,18 @@ const props = defineProps({
150 type: Array<any>, 173 type: Array<any>,
151 default: [] 174 default: []
152 }, 175 },
176 limitStateOptionList: { //限定状态字典下拉列表
177 type: Array<any>,
178 default: []
179 },
153 productFieldList: { //字段列表 180 productFieldList: { //字段列表
154 type: Array<any>, 181 type: Array<any>,
155 default: null 182 default: null
156 }, 183 },
184 annonFieldsList: { //匿名化选择的字段列表
185 type: Array<any>,
186 default: null
187 },
157 isReport: { 188 isReport: {
158 type: Boolean, 189 type: Boolean,
159 default: false 190 default: false
...@@ -164,6 +195,102 @@ const loading = ref(false); ...@@ -164,6 +195,102 @@ const loading = ref(false);
164 /** 连接器下拉列表,搜索取得 */ 195 /** 连接器下拉列表,搜索取得 */
165 const connectorList: any = ref([]); 196 const connectorList: any = ref([]);
166 197
198 const key = ref(0);
199
200 const getParentAreaPromise: any = ref(null);
201 const getAreaDataPromise: any = ref({});
202 const getAreaDatas: any = ref({});
203 const parentAreaData: any = ref([]);
204
205 const getArea = (node, resolve) => {
206 const { level } = node
207 if (node.data.code == '710000') {
208 resolve([]);
209 return;
210 }
211 let params = {
212 parentGuid: node.value
213 }
214 if (!node.value) {
215 if (getParentAreaPromise.value) {
216 getParentAreaPromise.value.then((res: any) => {
217 resolve(res);
218 })
219 } else {
220 resolve(parentAreaData.value);
221 }
222 return;
223 }
224 if (node.loaded) {
225 resolve([]);
226 return;
227 }
228 if (getAreaDatas.value[node.value]?.length) {
229 resolve(getAreaDatas.value[node.value]);
230 return;
231 }
232 if (!getAreaDataPromise.value[node.value]) {
233 getAreaDataPromise.value[node.value] = getAreaData(params).then((res: any) => {
234 node.loaded = true;
235 getAreaDataPromise.value[node.value] = null;
236 if (res?.code == proxy.$passCode) {
237 const data = res.data ?? []
238 data.map(item => {
239 item.leaf = level >= 2
240 })
241 node.data.children = data;
242 resolve(data)
243 getAreaDatas.value[node.value] = data;
244 nextTick(() => {
245 if (level == 2 && init.value) {
246 key.value++;
247 strategyValueInfo.value = transferValueToNew(props.value);
248 init.value = false;
249 }
250 })
251 return data;
252 }
253 })
254 } else {
255 getAreaDataPromise.value[node.value].then((data) => {
256 getAreaDataPromise.value[node.value] = null;
257 node.loaded = true;
258 data.map(item => {
259 item.leaf = level >= 2
260 })
261 node.data.children = data;
262 resolve(data)
263 nextTick(() => {
264 if (level == 2 && init.value) {
265 key.value++;
266 strategyValueInfo.value = transferValueToNew(props.value);
267 init.value = false;
268 }
269 })
270 })
271 }
272 }
273
274 /** 省市区级联属性配置 */
275 const addressProps = ref({
276 label: 'name',
277 value: 'guid',
278 lazy: true,
279 checkStrictly: true,
280 lazyLoad: getArea,
281 multiple: true,
282 checkOnClickNode: false,
283 })
284
285 onBeforeMount(() => {
286 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
287 if (res?.code == proxy.$passCode) {
288 parentAreaData.value = res.data ?? [];
289 return parentAreaData.value;
290 }
291 })
292 })
293
167 const getActualOperationList = (scope) => { 294 const getActualOperationList = (scope) => {
168 let val = scope.row.constraintName; 295 let val = scope.row.constraintName;
169 let conditionItem = val && props.constraintOptionsList.find(c => c.policyName == val); 296 let conditionItem = val && props.constraintOptionsList.find(c => c.policyName == val);
...@@ -199,11 +326,17 @@ const transferValueToNew = (val, isTemplate = false) => { ...@@ -199,11 +326,17 @@ const transferValueToNew = (val, isTemplate = false) => {
199 if (childInfo.constraintEnName == 'dataField' && childInfo.additionValue?.length) { 326 if (childInfo.constraintEnName == 'dataField' && childInfo.additionValue?.length) {
200 childInfo.constraintFieldValue = childInfo.additionValue.map(a => a.enName); 327 childInfo.constraintFieldValue = childInfo.additionValue.map(a => a.enName);
201 } 328 }
329 if (childInfo.constraintEnName == 'limitedState' && childInfo.additionValue?.length) {
330 childInfo.constraintStateValue = childInfo.additionValue?.[0].value;
331 }
332 if (childInfo.constraintEnName == 'areaAddress' && childInfo.additionValue?.length) {
333 childInfo.constraintAddressValue = childInfo.additionValue.map(a => a.value?.split('-'));
334 }
202 if ((childInfo.constraintEnName == 'limitedDeliveryConnector' || childInfo.constraintEnName == 'limitedUseConnector') && childInfo.additionValue?.length) { 335 if ((childInfo.constraintEnName == 'limitedDeliveryConnector' || childInfo.constraintEnName == 'limitedUseConnector') && childInfo.additionValue?.length) {
203 childInfo.constraintConnectorValue = childInfo.additionValue.map(a => a.guid); 336 childInfo.constraintConnectorValue = childInfo.additionValue.map(a => a.guid);
204 connectorList.value.push(...childInfo.additionValue); 337 connectorList.value.push(...childInfo.additionValue);
205 } 338 }
206 if (isTemplate && (childInfo.constraintEnName == 'dataField' || childInfo.constraintEnName == 'limitedDeliveryConnector' || childInfo.constraintEnName == 'limitedUseConnector')) { 339 if (isTemplate && (childInfo.constraintEnName == 'dataField' || childInfo.constraintEnName == 'limitedState' || childInfo.constraintEnName == 'limitedDeliveryConnector' || childInfo.constraintEnName == 'limitedUseConnector')) {
207 childInfo.constraintPlaceholderValue = childInfo.constraintValue; 340 childInfo.constraintPlaceholderValue = childInfo.constraintValue;
208 } 341 }
209 delete childInfo.children; //删掉冗余信息,否则后续修改会覆盖正确的值 342 delete childInfo.children; //删掉冗余信息,否则后续修改会覆盖正确的值
...@@ -223,7 +356,10 @@ const transferValueToNew = (val, isTemplate = false) => { ...@@ -223,7 +356,10 @@ const transferValueToNew = (val, isTemplate = false) => {
223 return detailPolicyListValue; 356 return detailPolicyListValue;
224 } 357 }
225 358
359 const init = ref(false);
360
226 watch(() => props.value, (val) => { 361 watch(() => props.value, (val) => {
362 init.value = true;
227 strategyValueInfo.value = transferValueToNew(val); 363 strategyValueInfo.value = transferValueToNew(val);
228 }, { 364 }, {
229 deep: true, 365 deep: true,
...@@ -233,7 +369,19 @@ watch(() => props.value, (val) => { ...@@ -233,7 +369,19 @@ watch(() => props.value, (val) => {
233 watch(() => props.productFieldList, (val, oldValue) => { 369 watch(() => props.productFieldList, (val, oldValue) => {
234 strategyValueInfo.value.forEach(s => { 370 strategyValueInfo.value.forEach(s => {
235 s.children?.forEach(sc => { 371 s.children?.forEach(sc => {
236 if (sc.constraintFieldValue?.length) { 372 if (sc.constraintFieldValue?.length && s.actionEnName != 'anonymize') {
373 sc.constraintFieldValue = sc.constraintFieldValue.filter(f => val.some(v => v.enName == f))
374 }
375 })
376 })
377 }, {
378 deep: true
379 })
380
381 watch(() => props.annonFieldsList, (val, oldValue) => {
382 strategyValueInfo.value.forEach(s => {
383 s.children?.forEach(sc => {
384 if (sc.constraintFieldValue?.length && s.actionEnName == 'anonymize') {
237 sc.constraintFieldValue = sc.constraintFieldValue.filter(f => val.some(v => v.enName == f)) 385 sc.constraintFieldValue = sc.constraintFieldValue.filter(f => val.some(v => v.enName == f))
238 } 386 }
239 }) 387 })
...@@ -265,6 +413,7 @@ const strategyData = computed(() => { ...@@ -265,6 +413,7 @@ const strategyData = computed(() => {
265 413
266 /** 操作行为下拉框改变,带出英文名称等信息 */ 414 /** 操作行为下拉框改变,带出英文名称等信息 */
267 const selectOperationChange = (val, scope) => { 415 const selectOperationChange = (val, scope) => {
416 init.value = false;
268 let index = scope.row.index; 417 let index = scope.row.index;
269 let sv = strategyValueInfo.value.find(s => s.index == index); 418 let sv = strategyValueInfo.value.find(s => s.index == index);
270 if (sv) { 419 if (sv) {
...@@ -277,6 +426,7 @@ const selectOperationChange = (val, scope) => { ...@@ -277,6 +426,7 @@ const selectOperationChange = (val, scope) => {
277 426
278 /** 约束条件下拉框改变,带出英文名称 */ 427 /** 约束条件下拉框改变,带出英文名称 */
279 const selectConditionChange = (val, scope) => { 428 const selectConditionChange = (val, scope) => {
429 init.value = false;
280 let index = scope.row.index; 430 let index = scope.row.index;
281 let sv = strategyValueInfo.value.find(s => s.index == index); 431 let sv = strategyValueInfo.value.find(s => s.index == index);
282 let svChild = sv.children?.find(c => c.childIndex == scope.row.childIndex); 432 let svChild = sv.children?.find(c => c.childIndex == scope.row.childIndex);
...@@ -291,6 +441,7 @@ const selectConditionChange = (val, scope) => { ...@@ -291,6 +441,7 @@ const selectConditionChange = (val, scope) => {
291 } 441 }
292 442
293 const handleOperatorSelectChange = (val, scope, field) => { 443 const handleOperatorSelectChange = (val, scope, field) => {
444 init.value = false;
294 let index = scope.row.index; 445 let index = scope.row.index;
295 let sv = strategyValueInfo.value.find(s => s.index == index); 446 let sv = strategyValueInfo.value.find(s => s.index == index);
296 let svChild = sv.children?.find(c => c.childIndex == scope.row.childIndex); 447 let svChild = sv.children?.find(c => c.childIndex == scope.row.childIndex);
...@@ -299,11 +450,30 @@ const handleOperatorSelectChange = (val, scope, field) => { ...@@ -299,11 +450,30 @@ const handleOperatorSelectChange = (val, scope, field) => {
299 svChild.additionValue = val?.map(vv => { 450 svChild.additionValue = val?.map(vv => {
300 return connectorList.value.find(c => c.guid == vv); 451 return connectorList.value.find(c => c.guid == vv);
301 }) 452 })
453 } else if (field == 'constraintAddressValue') {
454 svChild.additionValue = val?.map(vv => {
455 let label = ''
456 let node: any = {};
457 vv.forEach((vc, index) => {
458 if (index == 0) {
459 node = parentAreaData.value.find(p => p.code == vc);
460 label = label + (node?.name || '');
461 } else {
462 node = node.children?.find(p => p.code == vc);
463 label = label + '/' + (node?.name || '');
464 }
465 })
466 return {
467 value: vv.join('-'),
468 label: label
469 };
470 })
302 } 471 }
303 } 472 }
304 473
305 /** 添加策略信息的操作行为行 */ 474 /** 添加策略信息的操作行为行 */
306 const addStrategy = () => { 475 const addStrategy = () => {
476 init.value = false;
307 let len = strategyValueInfo.value.length; 477 let len = strategyValueInfo.value.length;
308 if (len == props.actionOptionsList?.length) { 478 if (len == props.actionOptionsList?.length) {
309 proxy.$ElMessage.warning('暂无可添加的行为类型!'); 479 proxy.$ElMessage.warning('暂无可添加的行为类型!');
...@@ -319,6 +489,7 @@ const addStrategy = () => { ...@@ -319,6 +489,7 @@ const addStrategy = () => {
319 489
320 /** 添加约束条件 */ 490 /** 添加约束条件 */
321 const handleConditionClickAdd = (scope) => { 491 const handleConditionClickAdd = (scope) => {
492 init.value = false;
322 /** 根据index值进行添加删除 */ 493 /** 根据index值进行添加删除 */
323 let index = scope.row.index; 494 let index = scope.row.index;
324 let sv = strategyValueInfo.value.find(s => s.index == index); 495 let sv = strategyValueInfo.value.find(s => s.index == index);
...@@ -500,6 +671,22 @@ const validateValue = () => { ...@@ -500,6 +671,22 @@ const validateValue = () => {
500 return false; 671 return false;
501 } 672 }
502 } 673 }
674 } else if (d.constraintEnName == 'limitedState') {
675 // 如果是模板不需要必填。只有
676 if (props.productFieldList !== null) {
677 if (!d.constraintStateValue) {
678 proxy.$ElMessage.error('字段的约束值必填,请填写完整');
679 return false;
680 }
681 }
682 } else if (d.constraintEnName == 'areaAddress') {
683 // 如果是模板不需要必填。只有
684 if (props.productFieldList !== null) {
685 if (!d.constraintAddressValue?.length) {
686 proxy.$ElMessage.error('字段的约束值必填,请填写完整');
687 return false;
688 }
689 }
503 } else if ((d.constraintEnName == 'limitedDeliveryConnector' || d.constraintEnName == 'limitedUseConnector')) { 690 } else if ((d.constraintEnName == 'limitedDeliveryConnector' || d.constraintEnName == 'limitedUseConnector')) {
504 if (props.productFieldList !== null) { 691 if (props.productFieldList !== null) {
505 if (!d.constraintConnectorValue?.length) { 692 if (!d.constraintConnectorValue?.length) {
......
...@@ -314,12 +314,21 @@ const hanldeTableSelectChange = (val, scope, item) => { ...@@ -314,12 +314,21 @@ const hanldeTableSelectChange = (val, scope, item) => {
314 if (res?.code == proxy.$passCode) { 314 if (res?.code == proxy.$passCode) {
315 productFieldList.value = res.data || initStrategyData.value; 315 productFieldList.value = res.data || initStrategyData.value;
316 } else { 316 } else {
317 productFieldList.value = []; 317 productFieldList.value = initProductFieldValue.value;
318 res?.msg && proxy.$ElMessage.error(res?.msg)
319 }
320 })
321 getDamFieldsByProductGuid(productItem?.productGuid, isDataUse.value ? 'Y' : 'N', 'Y').then((res: any) => {
322 if (res?.code == proxy.$passCode) {
323 annonFieldsList.value = res.data || initProductFieldValue.value;
324 } else {
325 annonFieldsList.value = initProductFieldValue.value;
318 res?.msg && proxy.$ElMessage.error(res?.msg) 326 res?.msg && proxy.$ElMessage.error(res?.msg)
319 } 327 }
320 }) 328 })
321 } else { 329 } else {
322 productFieldList.value = initProductFieldValue.value; 330 productFieldList.value = initProductFieldValue.value;
331 annonFieldsList.value = initProductFieldValue.value;
323 } 332 }
324 // 连接器只能选择数据提供方的产品,不需要切换了 333 // 连接器只能选择数据提供方的产品,不需要切换了
325 // let nodeInfo = nodeInfoFormRef.value.formInline; 334 // let nodeInfo = nodeInfoFormRef.value.formInline;
...@@ -434,9 +443,15 @@ const constraintOptionsList: any = ref([]); ...@@ -434,9 +443,15 @@ const constraintOptionsList: any = ref([]);
434 /** 策略操作行为下拉列表 */ 443 /** 策略操作行为下拉列表 */
435 const actionOptionsList: any = ref([]); 444 const actionOptionsList: any = ref([]);
436 445
446 /** 限定状态字典下拉列表 */
447 const limitedStateOptionsList: any = ref([]);
448
437 /** 根据选择的数据产品显示限定字段下拉列表 */ 449 /** 根据选择的数据产品显示限定字段下拉列表 */
438 const initProductFieldValue: any = ref([]); 450 const initProductFieldValue: any = ref([]);
451 /** 策略中选择的限定字段列表 */
439 const productFieldList: any = ref([]); 452 const productFieldList: any = ref([]);
453 /** 匿名化选择的限定字段列表 */
454 const annonFieldsList: any = ref([]);
440 455
441 /** 初始化的策略值为空数组 */ 456 /** 初始化的策略值为空数组 */
442 const initStrategyData = ref([]); 457 const initStrategyData = ref([]);
...@@ -462,15 +477,28 @@ const getSubmitInfo = () => { ...@@ -462,15 +477,28 @@ const getSubmitInfo = () => {
462 let v = Object.assign({}, d, { orderNum: index + 1, }); 477 let v = Object.assign({}, d, { orderNum: index + 1, });
463 if (d.constraintEnName == 'dataField' && d.constraintFieldValue?.length) { 478 if (d.constraintEnName == 'dataField' && d.constraintFieldValue?.length) {
464 v.constraintValue = d.constraintFieldValue.join(','); 479 v.constraintValue = d.constraintFieldValue.join(',');
480 let fieldList = d.actionEnName == 'anonymize' ? annonFieldsList.value : productFieldList.value;
465 v.additionValue = d.constraintFieldValue?.map(dv => { 481 v.additionValue = d.constraintFieldValue?.map(dv => {
466 return { 482 return {
467 enName: dv, 483 enName: dv,
468 chName: productFieldList?.value.find(p => p.enName == dv)?.chName || dv 484 chName: fieldList.find(p => p.enName == dv)?.chName || dv
469 } 485 }
470 }) 486 })
471 } else if ((d.constraintEnName == 'limitedDeliveryConnector' || d.constraintEnName == 'limitedUseConnector') && d.constraintConnectorValue?.length) { 487 } else if (d.constraintEnName == 'limitedState' && d.constraintStateValue) {
488 v.constraintValue = d.constraintStateValue;
489 v.additionValue = [{
490 value: d.constraintStateValue,
491 label: limitedStateOptionsList.value.find(p => p.value == d.constraintStateValue)?.label || d.constraintStateValue
492 }];
493 }
494 else if ((d.constraintEnName == 'limitedDeliveryConnector' || d.constraintEnName == 'limitedUseConnector') && d.constraintConnectorValue?.length) {
472 v.constraintValue = d.constraintConnectorValue?.join(','); 495 v.constraintValue = d.constraintConnectorValue?.join(',');
473 v.additionValue = d.additionValue; 496 v.additionValue = d.additionValue;
497 } else if (d.constraintEnName == 'areaAddress' && d.constraintAddressValue?.length) {
498 v.constraintValue = d.constraintAddressValue?.map(dd => {
499 return dd.at(-1);
500 })?.join(',');
501 v.additionValue = d.additionValue;
474 } 502 }
475 return v; 503 return v;
476 }) || []; 504 }) || [];
...@@ -710,8 +738,17 @@ onBeforeMount(() => { ...@@ -710,8 +738,17 @@ onBeforeMount(() => {
710 res?.msg && proxy.$ElMessage.error(res?.msg) 738 res?.msg && proxy.$ElMessage.error(res?.msg)
711 } 739 }
712 }) 740 })
741 getDamFieldsByProductGuid(productGuid, isDataUse.value ? 'Y' : 'N', 'Y').then((res: any) => {
742 if (res?.code == proxy.$passCode) {
743 annonFieldsList.value = res.data || initProductFieldValue.value;
744 } else {
745 annonFieldsList.value = initProductFieldValue.value;
746 res?.msg && proxy.$ElMessage.error(res?.msg)
747 }
748 })
713 } else { 749 } else {
714 productFieldList.value = initProductFieldValue.value; 750 productFieldList.value = initProductFieldValue.value;
751 annonFieldsList.value = initProductFieldValue.value;
715 } 752 }
716 } else { 753 } else {
717 res?.msg && proxy.$ElMessage.error(res?.msg) 754 res?.msg && proxy.$ElMessage.error(res?.msg)
...@@ -785,6 +822,14 @@ onBeforeMount(() => { ...@@ -785,6 +822,14 @@ onBeforeMount(() => {
785 res?.msg && proxy.$ElMessage.error(res?.msg); 822 res?.msg && proxy.$ElMessage.error(res?.msg);
786 } 823 }
787 }) 824 })
825 getParamsList({ dictType: '限定状态' }).then((res: any) => {
826 if (res?.code == proxy.$passCode) {
827 const data = res.data || [];
828 limitedStateOptionsList.value = data;
829 } else {
830 res?.msg && proxy.$ElMessage.error(res?.msg);
831 }
832 })
788 getActionPolicyList().then((res: any) => { 833 getActionPolicyList().then((res: any) => {
789 if (res?.code == proxy.$passCode) { 834 if (res?.code == proxy.$passCode) {
790 const data = res.data || []; 835 const data = res.data || [];
...@@ -863,8 +908,8 @@ onActivated(() => { ...@@ -863,8 +908,8 @@ onActivated(() => {
863 <Form ref="nodeInfoFormRef" formId="node-info-form" :itemList="nodeInfoFormItems" :rules="nodeInfoFormRules" 908 <Form ref="nodeInfoFormRef" formId="node-info-form" :itemList="nodeInfoFormItems" :rules="nodeInfoFormRules"
864 @select-change="handleNodeSelectChange" col="col3" /> 909 @select-change="handleNodeSelectChange" col="col3" />
865 <StrategyTable ref="strategyTableRef" :show-title="true" :value="detailInfo.policys || initStrategyData" 910 <StrategyTable ref="strategyTableRef" :show-title="true" :value="detailInfo.policys || initStrategyData"
866 :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" 911 :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :limit-state-option-list="limitedStateOptionsList"
867 :productFieldList="productFieldList" :constraintOptionsList="constraintOptionsList"></StrategyTable> 912 :productFieldList="productFieldList" :annon-fields-list="annonFieldsList" :constraintOptionsList="constraintOptionsList"></StrategyTable>
868 </ContentWrap> 913 </ContentWrap>
869 </div> 914 </div>
870 <div class="tool_btns"> 915 <div class="tool_btns">
......
...@@ -136,15 +136,27 @@ const btnHandles = ref({ ...@@ -136,15 +136,27 @@ const btnHandles = ref({
136 let v = Object.assign({}, d, { orderNum: index + 1, }); 136 let v = Object.assign({}, d, { orderNum: index + 1, });
137 if (d.constraintEnName == 'dataField' && d.constraintFieldValue?.length) { 137 if (d.constraintEnName == 'dataField' && d.constraintFieldValue?.length) {
138 v.constraintValue = d.constraintFieldValue.join(','); 138 v.constraintValue = d.constraintFieldValue.join(',');
139 let fieldList = d.actionEnName == 'anonymize' ? annonFieldsList.value : productFieldList.value;
139 v.additionValue = d.constraintFieldValue?.map(dv => { 140 v.additionValue = d.constraintFieldValue?.map(dv => {
140 return { 141 return {
141 enName: dv, 142 enName: dv,
142 chName: productFieldList?.value.find(p => p.enName == dv)?.chName || dv 143 chName: fieldList.find(p => p.enName == dv)?.chName || dv
143 } 144 }
144 }) 145 })
146 } else if (d.constraintEnName == 'limitedState' && d.constraintStateValue?.length) {
147 v.constraintValue = d.constraintStateValue;
148 v.additionValue = [{
149 value: d.constraintStateValue,
150 label: limitedStateOptionsList.value.find(p => p.value == d.constraintStateValue)?.label || d.constraintStateValue
151 }]
145 } else if ((d.constraintEnName == 'limitedDeliveryConnector' || d.constraintEnName == 'limitedUseConnector') && d.constraintConnectorValue?.length) { 152 } else if ((d.constraintEnName == 'limitedDeliveryConnector' || d.constraintEnName == 'limitedUseConnector') && d.constraintConnectorValue?.length) {
146 v.constraintValue = d.constraintConnectorValue?.join(','); 153 v.constraintValue = d.constraintConnectorValue?.join(',');
147 v.additionValue = d.additionValue; 154 v.additionValue = d.additionValue;
155 } else if (d.constraintEnName == 'areaAddress' && d.constraintAddressValue?.length) {
156 v.constraintValue = d.constraintAddressValue?.map(dd => {
157 return dd.at(-1);
158 })?.join(',');
159 v.additionValue = d.additionValue;
148 } 160 }
149 return v; 161 return v;
150 }) 162 })
...@@ -946,12 +958,15 @@ const constraintOptionsList: any = ref([]); ...@@ -946,12 +958,15 @@ const constraintOptionsList: any = ref([]);
946 /** 策略操作行为下拉列表 */ 958 /** 策略操作行为下拉列表 */
947 const actionOptionsList: any = ref([]); 959 const actionOptionsList: any = ref([]);
948 960
961 /** 限定状态字典下拉列表 */
962 const limitedStateOptionsList: any = ref([]);
963
949 /** 根据选择的数据产品显示限定字段下拉列表 */ 964 /** 根据选择的数据产品显示限定字段下拉列表 */
950 const initProductFieldValue: any = ref([]); 965 const initProductFieldValue: any = ref([]);
951 const productFieldList: any = ref([]); 966 const productFieldList: any = ref([]);
952 967
953 /** 初始化的策略值为空数组 */ 968 /** 匿名化选择的限定字段列表 */
954 const initStrategyData = ref([]); 969 const annonFieldsList: any = ref([]);
955 970
956 /** 获取第二步合约协商信息 */ 971 /** 获取第二步合约协商信息 */
957 const getStepTwoNegotiateInfo = (loading = true) => { 972 const getStepTwoNegotiateInfo = (loading = true) => {
...@@ -1079,8 +1094,17 @@ onBeforeMount(() => { ...@@ -1079,8 +1094,17 @@ onBeforeMount(() => {
1079 res?.msg && proxy.$ElMessage.error(res?.msg) 1094 res?.msg && proxy.$ElMessage.error(res?.msg)
1080 } 1095 }
1081 }) 1096 })
1097 getDamFieldsByProductGuid(productGuid, provider.executionerGuid != userData.tenantGuid ? 'Y' : 'N', 'Y').then((res: any) => {
1098 if (res?.code == proxy.$passCode) {
1099 annonFieldsList.value = res.data || initProductFieldValue.value;
1100 } else {
1101 annonFieldsList.value = initProductFieldValue.value;
1102 res?.msg && proxy.$ElMessage.error(res?.msg)
1103 }
1104 })
1082 } else { 1105 } else {
1083 productFieldList.value = initProductFieldValue.value; 1106 productFieldList.value = initProductFieldValue.value;
1107 annonFieldsList.value = initProductFieldValue.value;
1084 } 1108 }
1085 } else { 1109 } else {
1086 res?.msg && proxy.$ElMessage.error(res?.msg) 1110 res?.msg && proxy.$ElMessage.error(res?.msg)
...@@ -1097,6 +1121,14 @@ onBeforeMount(() => { ...@@ -1097,6 +1121,14 @@ onBeforeMount(() => {
1097 res?.msg && proxy.$ElMessage.error(res?.msg); 1121 res?.msg && proxy.$ElMessage.error(res?.msg);
1098 } 1122 }
1099 }) 1123 })
1124 getParamsList({ dictType: '限定状态' }).then((res: any) => {
1125 if (res?.code == proxy.$passCode) {
1126 const data = res.data || [];
1127 limitedStateOptionsList.value = data;
1128 } else {
1129 res?.msg && proxy.$ElMessage.error(res?.msg);
1130 }
1131 })
1100 getActionPolicyList().then((res: any) => { 1132 getActionPolicyList().then((res: any) => {
1101 if (res?.code == proxy.$passCode) { 1133 if (res?.code == proxy.$passCode) {
1102 const data = res.data || []; 1134 const data = res.data || [];
...@@ -1318,8 +1350,8 @@ onActivated(() => { ...@@ -1318,8 +1350,8 @@ onActivated(() => {
1318 expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)" 1350 expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)"
1319 description=""> 1351 description="">
1320 <StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys" 1352 <StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys"
1321 :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" 1353 :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" :annonFieldsList="annonFieldsList"
1322 :constraintOptionsList="constraintOptionsList"></StrategyTable> 1354 :limit-state-option-list="limitedStateOptionsList" :constraintOptionsList="constraintOptionsList"></StrategyTable>
1323 </ContentWrap> 1355 </ContentWrap>
1324 <ContentWrap v-show="detailType == 'consult' || currentStep == 2" id="history-info-consult" title="协商记录" 1356 <ContentWrap v-show="detailType == 'consult' || currentStep == 2" id="history-info-consult" title="协商记录"
1325 expandSwicth style="margin-top: 15px" :isExpand="expandConsultHistory" 1357 expandSwicth style="margin-top: 15px" :isExpand="expandConsultHistory"
...@@ -1328,7 +1360,7 @@ onActivated(() => { ...@@ -1328,7 +1360,7 @@ onActivated(() => {
1328 <el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.timestamp" 1360 <el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.timestamp"
1329 :hollow="activity.hollow" :type="activity.type" placement="top"> 1361 :hollow="activity.hollow" :type="activity.type" placement="top">
1330 <div v-for="(child, childIndex) of activity.children" class="row-per" 1362 <div v-for="(child, childIndex) of activity.children" class="row-per"
1331 :style="{ 'margin-top': childIndex > 0 ? '8px' : '0px' }"> 1363 :style="{ 'margin-top': <number>childIndex > 0 ? '8px' : '0px' }">
1332 <div 1364 <div
1333 :class="child.negotiateEntityType == '数据提供方' ? 'label' : (child.negotiateEntityType == '数据服务方' ? 'label2' : 'label1')"> 1365 :class="child.negotiateEntityType == '数据提供方' ? 'label' : (child.negotiateEntityType == '数据服务方' ? 'label2' : 'label1')">
1334 {{ child.negotiateEntityType }} 1366 {{ child.negotiateEntityType }}
......
...@@ -241,7 +241,7 @@ const tablePageChange = (info) => { ...@@ -241,7 +241,7 @@ const tablePageChange = (info) => {
241 getTableData(); 241 getTableData();
242 }; 242 };
243 243
244 const defaultValueInfo = ref({ bizStatus: 'Y' }); 244 const defaultValueInfo = ref({ bizStatus: 'Y', constraintOperatorCodes: [], });
245 245
246 const newCreate = () => { 246 const newCreate = () => {
247 drawerInfo.value.visible = true; 247 drawerInfo.value.visible = true;
...@@ -338,7 +338,7 @@ const classEditFormItems: any = ref([{ ...@@ -338,7 +338,7 @@ const classEditFormItems: any = ref([{
338 tagsTooltip: true, 338 tagsTooltip: true,
339 placeholder: '默认全部', 339 placeholder: '默认全部',
340 field: 'constraintOperatorCodes', 340 field: 'constraintOperatorCodes',
341 default: '', 341 default: [],
342 options: operatorOptionList.value, 342 options: operatorOptionList.value,
343 filterable: true, 343 filterable: true,
344 clearable: true, 344 clearable: true,
...@@ -421,6 +421,8 @@ const drawerBtnClick = async (btn, info) => { ...@@ -421,6 +421,8 @@ const drawerBtnClick = async (btn, info) => {
421 }).map(v => { 421 }).map(v => {
422 return v.value; 422 return v.value;
423 }) 423 })
424 } else {
425 info.constraintOperatorCodes = [];
424 } 426 }
425 drawerInfo.value.footer.btns[1].loading = true; 427 drawerInfo.value.footer.btns[1].loading = true;
426 if (drawerInfo.value.type == 'edit') { 428 if (drawerInfo.value.type == 'edit') {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!