Browse Source

1.穿梭框已删除元素列表展示优化

2.穿锁扣历史记录展示优化id为label
han_v2
liwenxuan 5 months ago
parent
commit
0eeb704487
  1. 13
      src/components/DesignForm/app/index.vue
  2. 82
      src/components/DesignForm/tableListPage/formPageCont.vue
  3. 40
      src/components/DesignForm/tableListPage/index.vue
  4. 4
      src/widget/lowcodetransfer/lowcodeTransfer.vue

13
src/components/DesignForm/app/index.vue

@ -1087,7 +1087,7 @@ function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] {
treeNodes.forEach(root => traverse(root));
//console.log(ids)
// idlabel
return ids.map(id => idToLabelMap[id]);
return ids.map(id => idToLabelMap[id] || "已删除的节点(id):"+id);
}
const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => {
@ -1862,8 +1862,9 @@ const readerColumnSun = (column: any) => {
>
<template #default="scope">
<el-button-group>
<el-tooltip
v-if="scope.row.flowIsOpen == 1 && scope.row.taskStatus == 1"
v-if="scope.row.flowIsOpens == 1 && scope.row.taskStatus == 1"
class="box-item"
effect="dark"
content="提交审批"
@ -1878,7 +1879,7 @@ const readerColumnSun = (column: any) => {
</el-tooltip>
<el-tooltip
v-if="scope.row.flowIsOpen == 1 && scope.row.taskStatus == 2"
v-if="scope.row.flowIsOpens == 1 && scope.row.taskStatus == 2"
class="box-item"
effect="dark"
content="重新申请"
@ -1923,7 +1924,7 @@ const readerColumnSun = (column: any) => {
</template>
</el-popconfirm>
<el-popconfirm
v-if="scope.row.flowIsOpen == 1 && scope.row.isRetract"
v-if="scope.row.flowIsOpens == 1 && scope.row.isRetract"
confirm-button-text="确定"
cancel-button-text="取消"
:icon="QuestionFilled"
@ -1937,7 +1938,7 @@ const readerColumnSun = (column: any) => {
</template>
</el-popconfirm>
<el-tooltip
v-if="scope.row.flowIsOpen == 2"
v-if="scope.row.flowIsOpens == 2"
class="box-item"
effect="dark"
content="编辑"
@ -1966,7 +1967,7 @@ const readerColumnSun = (column: any) => {
</el-popconfirm>
<el-tooltip
v-if="scope.row.flowIsOpen == 1 && scope.row.taskStatus == 4"
v-if="scope.row.flowIsOpens == 1 && scope.row.taskStatus == 4"
class="box-item"
effect="dark"
content="申请修改"

82
src/components/DesignForm/tableListPage/formPageCont.vue

@ -80,6 +80,8 @@ const formProps = inject(constFormProps, {}) as any;
let getFieldRecordPromises: any[] = [];
let objMastesform: any;
let transferDetails:any = [];
/**
@ 作者: 秦东
@ 时间: 2024-04-03 14:09:24
@ -157,10 +159,54 @@ watch(
});
})
.finally(() => {
//console.log(objMastesform.list)
transferDetails = objMastesform.list.filter((item: any) => {
return item.type == "lowcodeTransfer";
});
formLoading.value = false;
//alert(props.pageInfo.masters_key)
gainEditDataLog({ id: props.pageInfo.masters_key }).then(({ data }) => {
// console.log("-1111-->",data)
//console.log(formState.formData.list)
//console.log("-1111-->",data)
transferDetails.forEach((element: any) => {
//console.log(element)
data.forEach((obj: any) => {
//console.log(obj.masterdata)
obj.masterdata.forEach((item: any) => {
if(item.field==element.name){
//console.log(element.control.fixedOptions)
//console.log(item)
for (const key in item) {
const value = item[key];
//
if (Object.prototype.hasOwnProperty.call(item, key)) {
if(key=="value"){
// /使JSON
const formattedValue =
(Array.isArray(value) || (typeof value === 'object' && value !== null))
? JSON.stringify(value, null, 2)
: value;
//console.log(`${key}: ${formattedValue}`);
if(item[key]&&item[key].length>0){
item[key] = mapIdsToLabels(element.control.fixedOptions,item[key])
}
}
}
}
}
});
});
});
pageLog.value = data;
});
});
@ -169,6 +215,38 @@ watch(
}
}
);
interface TreeNode {
id: string;
label: string;
disabled: boolean;
children: TreeNode[];
}
function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] {
/* console.log(treeNodes)
console.log(ids1) */
const ids: string[] = JSON.parse(ids1);
// idlabel
const idToLabelMap: Record<string, string> = {};
//
function traverse(node: TreeNode) {
idToLabelMap[node.id] = node.label; //
node.children.forEach(child => traverse(child)); //
}
//
treeNodes.forEach(root => traverse(root));
//console.log(ids)
// idlabel
return ids.map(id => idToLabelMap[id]);
}
/**
@ 作者: 秦东
@ 时间: 2024-04-03 14:25:15
@ -194,6 +272,8 @@ const pageLog = ref<any[]>([]);
let gainTaskFormInfoData: customerFormVersionCont;
let gainTaskFormInfoPromise: any[] = [];
/**
@ 作者: 秦东
@ 时间: 2024-04-03 14:33:15

40
src/components/DesignForm/tableListPage/index.vue

@ -1020,25 +1020,25 @@ const getPageData = () => {
data.data.list.forEach((obj: any) => {
//console.log(obj)
for (const key in obj) {
//
if (Object.prototype.hasOwnProperty.call(obj, key)) {
const value = obj[key];
// /使JSON
const formattedValue =
(Array.isArray(value) || (typeof value === 'object' && value !== null))
? JSON.stringify(value, null, 2)
: value;
//console.log(`${key}: ${formattedValue}`);
if(key==element.field){
//console.log(key)
/* console.log(element.control.fixedOptions)
console.log(obj[key]) */
obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key])
}
}
}
//
if (Object.prototype.hasOwnProperty.call(obj, key)) {
const value = obj[key];
// /使JSON
const formattedValue =
(Array.isArray(value) || (typeof value === 'object' && value !== null))
? JSON.stringify(value, null, 2)
: value;
//console.log(`${key}: ${formattedValue}`);
if(key==element.field){
//console.log(key)
/* console.log(element.control.fixedOptions)
console.log(obj[key]) */
obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key])
}
}
}
});
});
@ -1085,7 +1085,7 @@ function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] {
treeNodes.forEach(root => traverse(root));
//console.log(ids)
// idlabel
return ids.map(id => idToLabelMap[id]);
return ids.map(id => idToLabelMap[id] || "已删除的节点( id : "+id+") ");
}
const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => {

4
src/widget/lowcodetransfer/lowcodeTransfer.vue

@ -450,11 +450,11 @@ watch(keyword, (newVal) => {
console.log(fuzzyTreeSearch(userList.value,newVal))
//console.log(fuzzyTreeSearch(userList.value,newVal))
userList1.value = fuzzyTreeSearch(userList.value,newVal)
console.log(userList1.value)
//console.log(userList1.value)
//treeRef.value.data = fuzzyTreeSearch(treeRefValueData,newVal)
watchCount++
isShowMore()

Loading…
Cancel
Save