Browse Source

实现关联表单设置可选字段中没有当前字段效果

lwx_v9
liwenxuan 2 years ago
parent
commit
a3337c98e0
  1. 64
      src/components/DesignForm/formControlAttr.vue
  2. 2
      src/widget/writingboard/vueSignature.vue

64
src/components/DesignForm/formControlAttr.vue

@ -1609,7 +1609,8 @@
let currentUploadImgid = "";
//,imgiddesignForm.activeKey,,controlData.value.type=='lowcodeCarsusel',imgid=''uuid
watch(()=>store.activeKey, () => {
watch(()=>store.activeKey, (newVal) => {
//
if(controlData.value.type==='lowcodeCarsusel'){
const carsuselConfigData:CarsuselConfig[] = controlData.value.control.carsuselConfigArr
carsuselConfigData.forEach(element => {
@ -1623,6 +1624,32 @@
}else if(controlData.value.type==='associatedForms'){
controlData.value.control.fillRoles[0].id = uuidv4().replaceAll('-','').toString();
}
// start
//console.log(controlData.value.name)
resDataForGlxxszExceptself1 = JSON.parse(JSON.stringify(resDataForGlxxszExceptself));
//console.log(resDataForGlxxszExceptself1)
for(let i = 0;i<resDataForGlxxszExceptself1.length;i++){
let strArr:[string] = resDataForGlxxszExceptself1[i].id.split(":")
//console.log(strArr)
let str = strArr[strArr.length-1]
//console.log(str)
if(str==newVal){
resDataForGlxxszExceptself1.splice(i, 1); // 使1
i--; //
}
}
//console.log(resDataForGlxxszExceptself1)
associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value = [{
id: 'rootid_'+getAssociatedFormsCurrentFieldTreeData.label,
//label: '',
label: '当前表单-'+getAssociatedFormsCurrentFieldTreeData.treeAttrs.show,
children: resDataForGlxxszExceptself1,
treeAttrs: getAssociatedFormsCurrentFieldTreeData.treeAttrs,//
}]
//associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value.children = [...resDataForGlxxszExceptself1]
// end
})
//
function carouselImgUploadSuccess(response: any, uploadFile: UploadFile, uploadFiles: UploadFiles){
@ -1904,8 +1931,14 @@ function formidChanged(){
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
let resDataForGlxxszExceptself1: any[] = []
let getAssociatedFormsCurrentFieldTreeData:any
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//console.log(data)
getAssociatedFormsCurrentFieldTreeData = JSON.parse(JSON.stringify(data))
//console.log(getAssociatedFormsCurrentFieldTreeData)
if(data.id==="cfid为空"){
//alert("cfid")
}else{
@ -1921,6 +1954,11 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
let resDataForGlxxsz = ref(data.children.slice(8))
resDataForGlxxszExceptself = JSON.parse(JSON.stringify(resDataForGlxxsz.value));
//console.log(resDataForGlxxszExceptself)
associatedFormsCurrentFormFieldTreeForGlxxsz.value = [{
id: 'rootid_'+data.label,
@ -1929,6 +1967,15 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
children: [...resDataForGlxxsz.value],
treeAttrs: data.treeAttrs,
}]
associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value = [{
id: 'rootid_'+data.label,
//label: '',
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataForGlxxsz.value],
treeAttrs: data.treeAttrs,//getAssociatedFormsCurrentFieldTreeData
}]
}
});
@ -2324,6 +2371,7 @@ function deleteRowForGlxxsz(row: { id: any }){
/* */
//liwenxuan20240426 end
@ -3799,7 +3847,7 @@ const loadNextPage = () => {
<el-table-column fixed="right" label="显示以下组件" >
<template #default="fieldScope">
<el-tree-select v-model="controlData.control.glxxsz[fieldScope.$index].showFields" style="width: 100%" :data="associatedFormsCurrentFormFieldTreeForGlxxsz[0].children" multiple />
<el-tree-select v-model="controlData.control.glxxsz[fieldScope.$index].showFields" style="width: 100%" :data="associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf[0].children" multiple />
</template>
</el-table-column>
</el-table>
@ -3832,7 +3880,7 @@ const loadNextPage = () => {
<el-table-column fixed="right" label="显示以下组件" >
<template #default="fieldScope">
<el-tree-select v-model="controlData.control.glxxszForCheckBox[fieldScope.$index].showFields" style="width: 100%" :data="associatedFormsCurrentFormFieldTreeForGlxxsz[0].children" multiple />
<el-tree-select v-model="controlData.control.glxxszForCheckBox[fieldScope.$index].showFields" style="width: 100%" :data="associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf[0].children" multiple />
</template>
</el-table-column>
@ -3869,11 +3917,11 @@ const loadNextPage = () => {
<template v-if="controlData.type=='switch'">
<div style="border:#13ce66 1px solid">当开关打开时显示:
<el-tree-select v-model="controlData.control.glxxszSwitch[0].showFields" style="width: 100%" :data="associatedFormsCurrentFormFieldTreeForGlxxsz[0].children" multiple />
<div style="display:flex;margin-bottom: 20px;margin-top:20px"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">当开关打开时显示</span>
<el-tree-select v-model="controlData.control.glxxszSwitch[0].showFields" style="width: 60%" :data="associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf[0].children" multiple />
</div>
<div style="border:red 1px solid">当开关关闭时显示:
<el-tree-select v-model="controlData.control.glxxszSwitch[1].showFields" style="width: 100%" :data="associatedFormsCurrentFormFieldTreeForGlxxsz[0].children" multiple />
<div style="display:flex"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">当开关关闭时显示</span>
<el-tree-select v-model="controlData.control.glxxszSwitch[1].showFields" style="width: 60%" :data="associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf[0].children" multiple />
</div>
<!-- <el-table

2
src/widget/writingboard/vueSignature.vue

@ -155,7 +155,7 @@
//console.log("111111111111111111111111111111111111111111111111111111")
//console.log(canvas)
if(typeof(canvas)!="undefined"){
console.log(canvas)
//console.log(canvas)
if ((canvasBackDom.value && isLoad.value) || !isImgaes(props.canvasBack)) {
setCanvasBack(status,canvas)//liwenxuan
clearInterval(IntervaId)

Loading…
Cancel
Save