Browse Source

修改文轩组件BUG

qin_s5
herenshan112 2 weeks ago
parent
commit
94f29ed40f
  1. 2
      src/components/DesignForm/formControlAttr.vue
  2. 2
      src/components/DesignForm/formControlPropertiNew.vue
  3. 3
      src/components/DesignForm/public/expand/lowcodeImage.vue
  4. 6
      src/components/DesignForm/public/form/formItem.vue
  5. 6
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFormNew.vue
  6. 455
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue

2
src/components/DesignForm/formControlAttr.vue

@ -1832,7 +1832,7 @@ const append = (data: Tree) => {
};
const remove = (node: Node, data: Tree) => {
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!");
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!3333");
if (really) {
const parent = node.parent;
const children: Tree[] = parent.data.children || parent.data;

2
src/components/DesignForm/formControlPropertiNew.vue

@ -2328,7 +2328,7 @@ const append = (data: Tree) => {
};
const remove = (node: Node, data: Tree) => {
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!");
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!2222");
if (really) {
const parent = node.parent;
const children: Tree[] = parent.data.children || parent.data;

3
src/components/DesignForm/public/expand/lowcodeImage.vue

@ -7,7 +7,7 @@
import {
AnalysisCss,
AnalysisInputCss,
} from "@/components/DesignForm/public/form/calculate/cssInfo.ts";
} from "@/components/DesignForm/public/form/calculate/cssInfo";
import errimg from "@/assets/404_images/imgNotFound.png";
import { uploadUrl, getRequest } from "@/api/DesignForm";
import { ref,useAttrs } from 'vue'
@ -309,6 +309,7 @@ const fit = computed(()=>{
})
</script>
<template>
<el-image
v-if="(!hasELCard(ancestors))&&props.data.control.useDefaultImg&&props.type==5"
:src="value"

6
src/components/DesignForm/public/form/formItem.vue

@ -25,9 +25,9 @@ import OrgCentent from "@/components/DesignForm/public/expand/org.vue";
import LokOrgCentent from "@/widget/org/cont.vue";
import DigitpagePage from "@/components/DesignForm/public/expand/digitpage.vue";
import LowcodeImagePage from "@/components/DesignForm/public/expand/lowcodeImage.vue";
// import LowcodeImagePage from "@/components/DesignForm/public/expand/lowcodeImage.vue";
// import LowcodeImagePage from '@/widget/lowcodeimage/index.vue'
import LowcodeImagePage from '@/widget/lowcodeimage/index.vue'
import UploadPage from "@/components/DesignForm/public/expand/uploadPage.vue";
import UploadPageList from "@/components/DesignForm/public/expand/uploadPageList.vue";
@ -1118,7 +1118,7 @@ const diGuiJilian = (val: any, options: any[]) => {
</script>
<template>
{{ data.type }}
<BaiduMap
v-if="judgeIsShow(data.name) && data.type === 'baidumap' && type != 4"
:data="data"

6
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFormNew.vue

@ -394,6 +394,11 @@ const editAppFormTable = () => {
editAppPageInfo(sendData)
.then((data: any) => {
state.value.loading = false;
if(data.code == 0){
ElMessage.success(data.msg)
}else{
ElMessage.error("编辑App自定义表单失败")
}
// console.log("App--->",data)
emits("update:formVersion", versionId.value.toString());
gainTableForm();
@ -429,6 +434,7 @@ const saveAppFormData = () => {
// console.log("App--->",data)
// appPageKey.value = data.data.customerFormCont.id
// appPageKey.set(data.data.customerFormCont.id.toString())
ElMessage.success(data.msg)
versionId.value = data.data.formVersion.id.toString();
emits("update:formVersion", data.data.formVersion.id.toString());
emits("update:appPageKey", data.data.customerFormCont.id.toString());

455
src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue

@ -7,7 +7,7 @@
import validateConfig from "@/components/DesignForm/validate";
import { useDesignFormStore } from "@/store/DesignForm/designForm";
import { getRequest, uploadUrl } from "@/api/DesignForm";
import { validateTextConfig, type ValidateTextTypes } from "@/components/DesignForm/validateText";
import { validateTextConfig, type ValidateTextTypes,scanTypes,transferDataSourceOptions } from "@/components/DesignForm/validateText";
import validateInt from "@/components/DesignForm/validateInt";
import { CarsuselConfig, formStruct, PublicAtrr, VideoMsg } from "@/api/DesignForm/types";
import { formatNumber } from "@/api/DesignForm/utils";
@ -1991,6 +1991,7 @@ const lowcodeImageUploadSuccess = (
const preFillDialogFlag = ref(false)
const preFillDialogShow = () => {
preFillDialogFlag.value = true
console.log("子表预填充设置----->",preFillDialogFlag.value)
}
const preFillDialogDetermine = () => {
@ -2003,6 +2004,7 @@ const preFillDialogDetermine = () => {
*/
const selectOrgConnectUserDialogFlag = ref(false)
const showSelectOrgConnectUser = () => {
console.log("showSelectOrgConnectUser--------->",selectOrgConnectUserDialogFlag.value)
selectOrgConnectUserDialogFlag.value = true
}
@ -3782,8 +3784,16 @@ const changeLabel = (node: TreeNode, data: Tree) => {
const setNodeEnable = (node: TreeNode, data: Tree) => {
const parent = node.parent;
const children: Tree[] = parent.data.children || [parent.data];
console.log("设为可选/不可选------->",children)
const index = children.findIndex((d) => d.id === data.id);
children[index].disabled = !children[index].disabled;
if(children[index].disabled){
children[index].disabled = !children[index].disabled;
}
dataSource.value = [...dataSource.value];
};
/**
@ -3792,7 +3802,7 @@ const setNodeEnable = (node: TreeNode, data: Tree) => {
@ 功能: 删除节点
*/
const remove = (node: TreeNode, data: Tree) => {
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!");
let really = confirm("确认删除吗?\n将删除本节点与本节点的所有子孙节点!1111");
if (really) {
const parent = node.parent;
const children: Tree[] = parent.data.children || [parent.data];
@ -4935,14 +4945,14 @@ const expandUserNames = computed(()=>{
})
function findExpandUserNames(data:any) {
function findExpandUserNames(data) {
//console.log(data)
const result: never[][] = [];
const result = [];
//
const layoutTypes = ['tabs', 'grid', 'card', 'div']; // flex
function traverse(node:any, ancestors:any[]) {
function traverse(node, ancestors = []) {
// _custom
if (node && node._custom && node._custom.value) {
node = node._custom.value;
@ -4974,6 +4984,7 @@ function findExpandUserNames(data:any) {
//
if (layoutTypes.includes(node.type)) {
// 使
console.log("ancestors----------------------->",ancestors)
const newAncestors = [...ancestors, node.type];
switch (node.type) {
@ -5590,6 +5601,425 @@ function getAfterLastColon(str:string) {
// +1
return str.slice(lastColonIndex + 1);
}
const xTree = computed(()=>{
if(datapropsformList&&datapropsformList.length==0){
datapropsformList = JSON.parse(JSON.stringify(props.formList))
}
if(associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value && associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value[0].children && associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value[0].children.length>0){
let datab = JSON.parse(JSON.stringify(associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value[0].children))
let currentCompId = controlData.value.name
//console.log(currentCompId)
const treeC = mergeAndFilterAssociatedForms(datapropsformList, datab);
return treeC
}else{
return []
}
})
/**
* 合并两个组件树仅保留type为table内的type为associatedForms的节点
* @param {Array} treeA - 组件树a包含表单结构信息
* @param {Array} treeB - 组件树b包含字段数据信息
* @returns {Array} - 合并后仅包含table内的associatedForms节点的组件树c
*/
function mergeAndFilterAssociatedForms(treeA, treeB) {
// bkeynameidvalueb
const bMap = new Map();
// bparentIdparentId
let commonParentId = null;
// idnameformField:30540:upload1765154030446 -> upload1765154030446
treeB.forEach(node => {
const id = node.id;
if (id) {
const parts = id.split(':');
const name = parts[parts.length - 1]; // name
bMap.set(name, node);
// parentId
if (node.parentId && !commonParentId) {
commonParentId = node.parentId;
}
}
});
// parentId使
if (!commonParentId) {
commonParentId = "formField:30540";
}
//
let tableCount = 0;
let gridCount = 0;
let tabsCount = 0;
let divCount = 0;
let cardCount = 0;
// atableassociatedForms
function processANode(node, parentId = commonParentId, isInTable = false) {
// nametype
const nodeName = node.name;
const nodeType = node.type;
// table
if (nodeType === 'table') {
tableCount++;
// b
let bNode = null;
if (nodeName && bMap.has(nodeName)) {
bNode = bMap.get(nodeName);
bMap.delete(nodeName);
}
let cNode;
const tableLabel = `子表${node.item?.label || nodeName || tableCount}`;
if (bNode) {
// b
cNode = { ...bNode };
// children
if (!cNode.children) {
cNode.children = [];
}
// 使bparentId
cNode.parentId = bNode.parentId || parentId;
// label
cNode.label = tableLabel;
// treeAttrs.show
if (cNode.treeAttrs) {
cNode.treeAttrs.show = tableLabel;
} else {
cNode.treeAttrs = { show: tableLabel };
}
// treeAname
cNode.name = nodeName;
} else {
// b
const id = nodeName ? `${commonParentId}:${nodeName}` : null;
cNode = {
id: id,
name: nodeName, // treeAname
label: tableLabel,
parentId: parentId,
children: [],
value: id,
treeAttrs: {
show: tableLabel
},
disabled: false, // table使
type: 'table'
};
}
// tableassociatedForms
let hasAssociatedForms = false;
if (node.list && Array.isArray(node.list)) {
const childNodes = [];
node.list.forEach(child => {
const processedChild = processANode(child, cNode.id, true); // isInTable=true
if (processedChild) {
childNodes.push(processedChild);
hasAssociatedForms = true;
}
});
cNode.children = childNodes;
}
// tableassociatedFormstable
if (!hasAssociatedForms) {
return null;
}
return cNode;
}
// associatedFormstable
if (nodeType === 'associatedForms' && isInTable) {
// b
let bNode = null;
if (nodeName && bMap.has(nodeName)) {
bNode = bMap.get(nodeName);
bMap.delete(nodeName); // map使
}
let cNode;
if (bNode) {
// b
cNode = { ...bNode };
// children
if (!cNode.children) {
cNode.children = [];
}
// 使bparentId
cNode.parentId = bNode.parentId || parentId;
// treeAname
cNode.name = nodeName;
// a
if (node.options && Array.isArray(node.options)) {
cNode.options = node.options;
}
if (node.control) {
if (!cNode.control) {
cNode.control = {};
}
// control
if (node.control.glxxsz) {
cNode.control.glxxsz = node.control.glxxsz;
}
if (node.control.modelValue !== undefined) {
cNode.control.modelValue = node.control.modelValue;
}
}
if (node.config) {
cNode.config = node.config;
}
} else {
// b
const label = node.item?.label || nodeName || 'associatedForms';
const id = nodeName ? `${commonParentId}:${nodeName}` : null;
cNode = {
id: id,
name: nodeName, // treeAname
label: label,
parentId: parentId,
children: [],
value: id,
treeAttrs: {
show: label
},
disabled: false, // associatedFormsdisabledfalse
type: 'associatedForms'
};
// a
if (node.options && Array.isArray(node.options)) {
cNode.options = node.options;
}
if (node.control) {
cNode.control = { ...node.control };
}
if (node.config) {
cNode.config = { ...node.config };
}
}
return cNode;
}
//
const containerTypes = ['card', 'flex', 'div', 'grid', 'tabs'];
if (containerTypes.includes(nodeType)) {
//
let containerId;
let containerLabel;
// idlabel
switch(nodeType) {
case 'grid':
gridCount++;
containerId = `格栅布局${gridCount}`;
containerLabel = containerId;
break;
case 'tabs':
tabsCount++;
containerId = `标签页${tabsCount}`;
containerLabel = containerId;
break;
case 'div':
divCount++;
containerId = `容器${divCount}`;
containerLabel = containerId;
break;
case 'card':
cardCount++;
containerId = `卡片${cardCount}`;
containerLabel = containerId;
break;
case 'flex':
// flexb
let bNode = null;
if (nodeName && bMap.has(nodeName)) {
bNode = bMap.get(nodeName);
bMap.delete(nodeName);
}
if (bNode) {
containerId = bNode.id || `${commonParentId}:${nodeName}`;
containerLabel = `弹性布局${bNode.label || nodeName}`;
} else {
containerId = `${commonParentId}:${nodeName}`;
containerLabel = `弹性布局${node.item?.label || nodeName}`;
}
break;
default:
containerId = `${commonParentId}:${nodeName}`;
containerLabel = node.item?.label || nodeName || nodeType;
}
//
const containerNode = {
id: containerId,
name: nodeName, // treeAname
label: containerLabel,
parentId: parentId,
children: [],
value: containerId,
treeAttrs: {
show: containerLabel
},
disabled: null, //
type: nodeType
};
//
let hasValidChildren = false;
if (nodeType === 'card' || nodeType === 'flex' || nodeType === 'div') {
// list
if (node.list && Array.isArray(node.list)) {
const childNodes = [];
node.list.forEach(child => {
const processedChild = processANode(child, containerId, false);
if (processedChild) {
childNodes.push(processedChild);
hasValidChildren = true;
}
});
containerNode.children = childNodes;
}
} else if (nodeType === 'grid' || nodeType === 'tabs') {
// columns.list
if (node.columns && Array.isArray(node.columns)) {
// tabscolumn
if (nodeType === 'tabs') {
const tabNodes = [];
node.columns.forEach((column, index) => {
// column
const columnId = `${containerId}:${column.label}`;
const columnNode = {
id: columnId,
name: column.label || `Tab${index + 1}`, // 使column.labelname
label: column.label || `Tab${index + 1}`,
parentId: containerId,
children: [],
value: columnId,
treeAttrs: {
show: column.label || `Tab${index + 1}`
},
disabled: null, //
type: 'tab'
};
// column
let columnHasValidChildren = false;
if (column.list && Array.isArray(column.list)) {
const childNodes = [];
column.list.forEach(child => {
const processedChild = processANode(child, columnId, false);
if (processedChild) {
childNodes.push(processedChild);
columnHasValidChildren = true;
hasValidChildren = true;
}
});
columnNode.children = childNodes;
}
// columntabs
if (columnHasValidChildren) {
tabNodes.push(columnNode);
}
});
containerNode.children = tabNodes;
} else {
// gridcolumns
const childNodes = [];
node.columns.forEach(column => {
if (column.list && Array.isArray(column.list)) {
column.list.forEach(child => {
const processedChild = processANode(child, containerId, false);
if (processedChild) {
childNodes.push(processedChild);
hasValidChildren = true;
}
});
}
});
containerNode.children = childNodes;
}
}
}
// null
if (!hasValidChildren) {
// flex使
if (nodeType === 'flex') {
containerNode.disabled = false;
return containerNode;
}
return null;
}
// disabled
// flex使disabledfalse
if (nodeType === 'flex') {
containerNode.disabled = false;
} else {
// nulltrue
containerNode.disabled = null;
}
return containerNode;
}
// null
return null;
}
// a
const cTree = [];
treeA.forEach(rootNode => {
const processedNode = processANode(rootNode);
if (processedNode) {
cTree.push(processedNode);
}
});
// bassociatedFormsac
// associatedFormstabletable
// bMapassociatedForms
bMap.forEach((bNode, nodeName) => {
if (bNode.type === 'associatedForms') {
// b
const newNode = { ...bNode };
// children
if (!newNode.children) {
newNode.children = [];
}
// disabledfalse
newNode.disabled = false;
// name
newNode.name = nodeName;
cTree.push(newNode);
}
});
return cTree;
}
const asfsCurrentTable = computed(()=>{
let currentTable: any[] = []
let count = 0
@ -6020,6 +6450,7 @@ const updataBase = (val: any) => {
/>
</el-row>
<el-row v-else-if="item.type === 'transfer_options_datasource'">
<!-- <span style="display:inline-block;width:78px">选项数据源</span> -->
<el-select
v-model="controlData.config.transferDataSource"
@ -6535,7 +6966,7 @@ const updataBase = (val: any) => {
<el-button size="small" style="margin-right: 12px;" @click="openDialog">
批量导入
</el-button>
<!-- <div style="width:100%; position: relative; top: 6px; display: flex;">
<div style="width:100%; position: relative; top: 6px; display: flex;">
<div v-if="showHide(['switch'], true)">
<el-button style="position: relative; top: -1px" @click="handelGlxxszDialogSwitch" >关联选项设置</el-button>
</div>
@ -6556,7 +6987,7 @@ const updataBase = (val: any) => {
>
<el-button style="position: relative; top: -1px;right:-12px" @click="handelZdtcszDialog">矩阵填充设置</el-button>
</div>
</div> -->
</div>
</el-form-item>
</template>
<template v-else-if="controlData.config.optionsType === 3">
@ -8081,7 +8512,7 @@ const updataBase = (val: any) => {
:title="`矩阵填充设置--` + controlData.name"
:show-close="false"
style="margin-top: 70px"
width="50%"
width="700"
>
<div v-if="ZdtcszDialogFlag" style="width: 100%; display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; padding: 8px 0;">
<!-- 标题行文本 -->
@ -8200,7 +8631,7 @@ const updataBase = (val: any) => {
top="150px"
style="margin-top: 70px"
>
<!-- {{ expandUserComponentsTree }} -->
<el-tree-select
v-if="controlData.type == 'orgCentent'"
ref="treeSelectRef"
@ -8262,7 +8693,7 @@ const updataBase = (val: any) => {
>
<div style="display: flex; margin-bottom: 20px; margin-top: 20px;width: 100%;">
<span style="font-size: larger; margin-left: 35px; margin-right: 15px">选择关联表单</span>
<el-tree-select
<el-tree-select
v-model="controlData.control.preFill.asf"
style="width: 60%"
:data="asfsCurrentTable"
@ -8276,7 +8707,7 @@ const updataBase = (val: any) => {
style="width: 60%"
@value-changed="tablePreFillValueChanged"
:data="asfPropsData"
:ids = controlData.control.preFill.ids
:ids = "controlData.control.preFill?.ids?controlData.control.preFill.ids:[]"
/>
</div>
<template #footer>

Loading…
Cancel
Save