Browse Source

Merge branch 'lwx_v9'

# Conflicts:
#	src/types/components.d.ts
#	src/views/sysworkflow/lowcodepage/pageDesignes.vue
lwx_v10
超级管理员 1 year ago
parent
commit
06e3e3ad68
  1. BIN
      src/assets/paintboard.png
  2. 631
      src/components/DesignForm/assembly/index.ts
  3. 309
      src/components/DesignForm/formControlAttr.vue
  4. 145
      src/components/DesignForm/public/form/form.vue
  5. 8
      src/types/components.d.ts
  6. 7
      src/views/sysworkflow/lowcodepage/pageDesignes.vue
  7. 23
      src/widget/writingboard/vueSignature.vue

BIN
src/assets/paintboard.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 13 KiB

631
src/components/DesignForm/assembly/index.ts

@ -21,15 +21,14 @@ const selectOption: any = [
title: '基础字段', title: '基础字段',
children: [ children: [
{ {
type: 'input', type: 'title',
label: '单行文本', label: '标题',
icon: 'input', icon: 'title',
iconFont: 'fa-text-width', iconFont: 'fa-header',
control: { control: {
// 组件所有属性 modelValue: '标题'
modelValue: ''
}, },
config: {}, // 其他配置信息 config: {},
styles: { styles: {
divStyle: {}, divStyle: {},
labelStyle: {}, labelStyle: {},
@ -60,6 +59,23 @@ const selectOption: any = [
inputStyle: {} inputStyle: {}
} }
}, },
{
type: 'input',
label: '单行文本',
icon: 'input',
iconFont: 'fa-text-width',
control: {
// 组件所有属性
modelValue: ''
},
config: {}, // 其他配置信息
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {}
}
},
{ {
type: 'textarea', type: 'textarea',
label: '多行文本', label: '多行文本',
@ -83,6 +99,8 @@ const selectOption: any = [
control: { control: {
modelValue: '', modelValue: '',
glxxsz: [], glxxsz: [],
optionsValue3Formid:'',
optionsValue3Field:'',
}, },
options: selectOption, // 下拉选项数据集合 options: selectOption, // 下拉选项数据集合
config: config, config: config,
@ -100,6 +118,8 @@ const selectOption: any = [
control: { control: {
modelValue: [], modelValue: [],
glxxszForCheckBox: [], glxxszForCheckBox: [],
optionsValue3Formid:'',
optionsValue3Field:'',
}, },
options: selectOption, options: selectOption,
config: config, config: config,
@ -118,6 +138,8 @@ const selectOption: any = [
modelValue: '', modelValue: '',
appendToBody: true, appendToBody: true,
glxxsz: [], glxxsz: [],
optionsValue3Formid:'',
optionsValue3Field:'',
}, },
options: selectOption, options: selectOption,
config: config, config: config,
@ -127,6 +149,22 @@ const selectOption: any = [
inputStyle: {} inputStyle: {}
} }
}, },
{
type: 'cascader',
label: '级联选择器',
icon: 'cascader',
iconFont: 'fa-sitemap',
control: {
modelValue: []
},
options: [],
config: config,
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {}
}
},
{ {
type: 'datePicker', type: 'datePicker',
label: '日期选择器', label: '日期选择器',
@ -159,12 +197,12 @@ const selectOption: any = [
} }
}, },
{ {
type: 'switch', type: 'txt',
label: '开关', label: '文字描述',
icon: 'switch', icon: 'text',
iconFont: 'fa-toggle-on', iconFont: 'fa-file-word-o',
control: { control: {
modelValue: false modelValue: ''
}, },
config: {}, config: {},
styles: { styles: {
@ -174,12 +212,11 @@ const selectOption: any = [
} }
}, },
{ {
type: 'inputNumber', type: 'organization',
label: '计数器', label: '联系地址',
icon: 'number', icon: 'marker',
iconFont: 'fa-sort-numeric-asc', iconFont: 'fa-map-marker',
control: { control: {
modelValue: 0
}, },
config: {}, config: {},
styles: { styles: {
@ -189,43 +226,24 @@ const selectOption: any = [
} }
}, },
{ {
type: 'cascader', type: 'switch',
label: '级联选择器', label: '开关',
icon: 'cascader', icon: 'switch',
iconFont: 'fa-sitemap', iconFont: 'fa-toggle-on',
control: { control: {
modelValue: [] modelValue: "",
}, glxxszSwitch: [
options: [],
config: config,
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
},
{ {
type: 'rate', conditionField: '',
label: '评分', openValue: "",
icon: 'rate', showFields: []
iconFont: 'fa-star-o',
control: {
modelValue: 0
},
config: {},
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
}, },
{ {
type: 'slider', conditionField: '',
label: '滑块', offValue: "",
icon: 'slider', showFields: []
iconFont: 'fa-sliders', },
control: { ]
modelValue: 0
}, },
config: {}, config: {},
styles: { styles: {
@ -235,18 +253,14 @@ const selectOption: any = [
} }
}, },
{ {
type: 'treeSelect', type: 'button',
label: '树形控件', label: '按钮',
icon: 'tree2', icon: 'button',
iconFont: '', iconFont: 'fa-square-o',
control: { control: {
modelValue: '', label: '保存'
data: [],
renderAfterExpand: false
},
config: {
optionsType: 0
}, },
config: {},
styles: { styles: {
divStyle: {}, divStyle: {},
labelStyle: {}, labelStyle: {},
@ -254,12 +268,12 @@ const selectOption: any = [
} }
}, },
{ {
type: 'txt', type: 'inputNumber',
label: '文字', label: '计数器',
icon: 'text', icon: 'number',
iconFont: 'fa-file-word-o', iconFont: 'fa-sort-numeric-asc',
control: { control: {
modelValue: '' modelValue: 0
}, },
config: {}, config: {},
styles: { styles: {
@ -268,14 +282,42 @@ const selectOption: any = [
inputStyle: {} inputStyle: {}
} }
}, },
]
},
{ {
type: 'title', title: '布局字段',
label: '标题', children: [
icon: 'title', {
iconFont: 'fa-header', type: 'grid',
control: { label: '格栅布局',
modelValue: '标题' icon: 'grid',
iconFont: 'fa-th-large',
columns: [
// 格栅列数据
{
attr: { span: 12 },
list: []
}, },
{
attr: { span: 12 },
list: []
}
],
control: {},
config: {}, config: {},
styles: { styles: {
divStyle: {}, divStyle: {},
@ -284,14 +326,14 @@ const selectOption: any = [
} }
}, },
{ {
type: 'button', type: 'card',
label: '按钮', label: '卡片布局',
icon: 'button', icon: 'card',
iconFont: 'fa-square-o', iconFont: 'fa-credit-card',
control: { list: [],
label: '保存' control: {},
},
config: {}, config: {},
item: {}, // label标题相关
styles: { styles: {
divStyle: {}, divStyle: {},
labelStyle: {}, labelStyle: {},
@ -299,14 +341,15 @@ const selectOption: any = [
} }
}, },
{ {
type: 'serialNumber', type: 'flex',
label: '编码', label: '弹性布局',
icon: 'number', icon: 'flex',
iconFont: 'fa-list-ol', iconFont: 'fa-file-text-o',
control: { list: [],
}, tableData: [], // 值集合
control: {},
config: { config: {
automatic:false addBtnText: '添加一行'
}, },
styles: { styles: {
divStyle: {}, divStyle: {},
@ -315,13 +358,13 @@ const selectOption: any = [
} }
}, },
{ {
type: 'urllink', type: 'div',
label: '链接', label: '容器',
icon: 'link', icon: 'div',
iconFont: 'fa-link', iconFont: '',
control: { control: {},
},
config: {}, config: {},
list: [],
styles: { styles: {
divStyle: {}, divStyle: {},
labelStyle: {}, labelStyle: {},
@ -329,26 +372,17 @@ const selectOption: any = [
} }
}, },
{ {
type: 'organization', type: 'tabs',
label: '联系地址', label: '标签页',
icon: 'marker', icon: 'tabs',
iconFont: 'fa-map-marker', iconFont: 'fa-folder-o',
control: { columns: [
},
config: {},
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
},
{ {
type: 'baidumap', label: 'Tab1',
label: '地图', list: []
icon: 'map', }
iconFont: 'fa-map-o', ],
control: { control: {},
},
config: {}, config: {},
styles: { styles: {
divStyle: {}, divStyle: {},
@ -356,15 +390,13 @@ const selectOption: any = [
inputStyle: {} inputStyle: {}
} }
}, },
{
type: 'colorPicker', {
label: '取色器', type: 'divider',
icon: 'color', label: '分割线',
icon: 'divider',
iconFont: '', iconFont: '',
control: { control: {},
modelValue: ''
},
config: {}, config: {},
styles: { styles: {
divStyle: {}, divStyle: {},
@ -372,12 +404,73 @@ const selectOption: any = [
inputStyle: {} inputStyle: {}
} }
}, },
{
type: 'orgCentent', ]
label: '行政组织', },
icon: 'sliders',
iconFont: 'fa-sliders', {
control: { title: '高级控件',
children: [
{
type: 'lowcodeImage',
label: '图片',
icon: '',
iconFont: 'fa-photo',
control: {
modelValue: '',
uploadFlag: false,
imgId: '',
imgUrl: '',
link: '',
fit: 1,
radius: false,
radiusNum: 5,
boderAndShadow: false,
showMode: '自定义像素值',
pxWidth: 448,
pxHeight: 252,
widthPercent: 90,
heightPercent: 90,
mt: 0,
mb: 0,
ml: 0,
mr: 0,
pt: 0,
pb: 0,
pl: 0,
pr: 0,
floatFlag: false,
floatValue: 'left',
},
config: {}
},
{
type: 'videoUpAndPlay',
label: '视频',
icon: '',
iconFont: 'fa-play-circle',
control: {
modelValue: '',
videoMsg: [{
CreatedAt: '',
UpdatedAt: '',
fileSize: "0n",
id: "0n",
key: '',
name: '',
physicspath: '',
size: '',
tag: '',
type: 0,
url: '',
videoReady: false,
videoHeight: 400,
videoWidth: 700,
videoAutoPlay: false,
attrId: '',
poster: '',
loop: false
}]
}, },
config: {}, config: {},
styles: { styles: {
@ -387,11 +480,13 @@ const selectOption: any = [
} }
}, },
{ {
type: 'signaturemap',
label: '签名板', type: 'upload',
icon: 'faedit', label: '文件',
iconFont: 'fa-edit', icon: 'image',
iconFont: 'fa-file-image-o',
control: { control: {
modelValue: '' // 也可以是[{name:'',url:''}]形式
}, },
config: {}, config: {},
styles: { styles: {
@ -399,12 +494,22 @@ const selectOption: any = [
labelStyle: {}, labelStyle: {},
inputStyle: {} inputStyle: {}
} }
}
]
}, },
{ {
title: '高级字段', type: 'urllink',
children: [ label: '链接',
icon: 'link',
iconFont: 'fa-link',
control: {
},
config: {},
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {}
}
},
{ {
type: 'table', type: 'table',
label: '子表', label: '子表',
@ -425,12 +530,11 @@ const selectOption: any = [
} }
}, },
{ {
type: 'component', type: 'baidumap',
label: '自定义组件', label: '地图',
icon: 'component', icon: 'map',
iconFont: 'fa-cubes', iconFont: 'fa-map-o',
control: { control: {
modelValue: ''
}, },
config: {}, config: {},
styles: { styles: {
@ -438,17 +542,14 @@ const selectOption: any = [
labelStyle: {}, labelStyle: {},
inputStyle: {} inputStyle: {}
} }
/*template: '', //
component: '' // 根据template注入的组件*/
}, },
{ {
type: 'slider',
type: 'upload', label: '滑块',
label: '图片/文件', icon: 'slider',
icon: 'image', iconFont: 'fa-sliders',
iconFont: 'fa-file-image-o',
control: { control: {
modelValue: '' // 也可以是[{name:'',url:''}]形式 modelValue: 0
}, },
config: {}, config: {},
styles: { styles: {
@ -456,15 +557,14 @@ const selectOption: any = [
labelStyle: {}, labelStyle: {},
inputStyle: {} inputStyle: {}
} }
}, },
{ {
type: 'tinymce', type: 'rate',
label: '富文本', label: '评分',
icon: 'tinymce', icon: 'rate',
iconFont: '', iconFont: 'fa-star-o',
control: { control: {
modelValue: '' modelValue: 0
}, },
config: {}, config: {},
styles: { styles: {
@ -474,32 +574,12 @@ const selectOption: any = [
} }
}, },
{ {
type: 'videoUpAndPlay', type: 'tinymce',
label: '视频', label: '富文本',
icon: '', icon: 'tinymce',//
iconFont: 'fa-play-circle', iconFont: 'fa-list-alt',
control: { control: {
modelValue: '', modelValue: ''
videoMsg:[{
CreatedAt: '',
UpdatedAt: '',
fileSize: "0n",
id: "0n",
key: '',
name: '',
physicspath: '',
size: '',
tag: '',
type: 0,
url: '',
videoReady: false,
videoHeight:400,
videoWidth:700,
videoAutoPlay: false,
attrId: '',
poster:'',
loop: false
}]
}, },
config: {}, config: {},
styles: { styles: {
@ -536,6 +616,21 @@ const selectOption: any = [
inputStyle: {} inputStyle: {}
} }
}, },
{
type: 'signaturemap',
label: '签名板',
icon: 'faedit',
iconFont: 'fa-edit',
control: {
},
config: {},
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {}
}
},
{ {
type: 'lowcodeTransfer', type: 'lowcodeTransfer',
label: '穿梭框', label: '穿梭框',
@ -564,37 +659,39 @@ const selectOption: any = [
} }
}, },
{ {
type: 'lowcodeImage',
label: '图片', type: 'colorPicker',
icon: '', label: '取色器',
iconFont: 'fa-photo', icon: 'color',
iconFont: '',
control: {
modelValue: ''
},
config: {},
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {}
}
},
{
type: 'treeSelect',
label: '树形控件',
icon: 'tree2',
iconFont: '',
control: { control: {
modelValue: '', modelValue: '',
uploadFlag:false, data: [],
imgId:'', renderAfterExpand: false
imgUrl: '',
link: '',
fit:1,
radius:false,
radiusNum:5,
boderAndShadow:false,
showMode:'自定义像素值',
pxWidth:448,
pxHeight:252,
widthPercent:90,
heightPercent:90,
mt:0,
mb:0,
ml:0,
mr:0,
pt:0,
pb:0,
pl:0,
pr:0,
floatFlag:false,
floatValue:'left',
}, },
config: {} config: {
optionsType: 0
},
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {}
}
}, },
{ {
type: 'associatedForms', type: 'associatedForms',
@ -609,6 +706,7 @@ const selectOption: any = [
dataRangeConditionHtml: '', dataRangeConditionHtml: '',
dataRangeConditionHtmlCopy: '', dataRangeConditionHtmlCopy: '',
saveFlag: false, saveFlag: false,
asfasfLabel:'',
fillRoles: [ fillRoles: [
{ {
leftValue: '', leftValue: '',
@ -618,120 +716,54 @@ const selectOption: any = [
], ],
}, },
config: {} config: {}
}
]
}, },
{ {
title: '布局字段', type: 'component',
children: [ label: '自定义组件',
{ icon: 'component',
type: 'grid', iconFont: 'fa-cubes',
label: '格栅布局', control: {
icon: 'grid', modelValue: ''
iconFont: 'fa-th-large',
columns: [
// 格栅列数据
{
attr: { span: 12 },
list: []
}, },
{
attr: { span: 12 },
list: []
}
],
control: {},
config: {}, config: {},
styles: { styles: {
divStyle: {}, divStyle: {},
labelStyle: {}, labelStyle: {},
inputStyle: {} inputStyle: {}
} }
/*template: '', //
component: '' // 根据template注入的组件*/
}, },
{
type: 'tabs',
label: '标签页',
icon: 'tabs',
iconFont: 'fa-folder-o',
columns: [
{
label: 'Tab1',
list: [] ]
}
],
control: {},
config: {},
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
}, },
{ {
type: 'card', title: '系统控件',//扩展组件
label: '卡片布局', children: [
icon: 'card',
iconFont: 'fa-credit-card',
list: [],
control: {},
config: {},
item: {}, // label标题相关
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
},
{ {
type: 'flex', type: 'serialNumber',
label: '弹性布局', label: '编码',
icon: 'flex', icon: 'number',
iconFont: 'fa-file-text-o', iconFont: 'fa-list-ol',
list: [], control: {
tableData: [], // 值集合
control: {},
config: {
addBtnText: '添加一行'
},
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
}, },
{ config: {
type: 'divider', automatic: false
label: '分割线',
icon: 'divider',
iconFont: '',
control: {},
config: {},
styles:{
divStyle:{},
labelStyle:{},
inputStyle:{}
}
}, },
{
type: 'div',
label: '容器',
icon: 'div',
iconFont: '',
control: {},
config: {},
list: [],
styles: { styles: {
divStyle: {}, divStyle: {},
labelStyle: {}, labelStyle: {},
inputStyle: {} inputStyle: {}
} }
}
]
}, },
{
title: '扩展组件',
children: [
{ {
type: 'expand-user', type: 'expand-user',
label: '选择用户', label: '选择用户',
@ -750,7 +782,7 @@ const selectOption: any = [
}, },
{ {
type: 'orgCentent', type: 'orgCentent',
label: '行政组织', label: '选择组织',
icon: 'sliders', icon: 'sliders',
iconFont: 'fa-sliders', iconFont: 'fa-sliders',
control: { control: {
@ -763,6 +795,9 @@ const selectOption: any = [
} }
} }
] ]
},
{
title: '扩展组件',//
chileren: []
} }
] ]

309
src/components/DesignForm/formControlAttr.vue

@ -620,18 +620,18 @@
vShow: ['component'] vShow: ['component']
}, },
{ {
label: '隐藏条件', label: '关联表单',
value: config.associatedForms, value: config.associatedForms,
path: 'config.associatedForms', path: 'config.associatedForms',
type: 'associatedForms_hide', type: 'associatedForms_form',
vIf: state.isSearch, vIf: state.isSearch,
vShow: ['associatedForms'] vShow: ['associatedForms']
}, },
{ {
label: '关联表单', label: '隐藏条件',
value: config.associatedForms, value: config.associatedForms,
path: 'config.associatedForms', path: 'config.associatedForms',
type: 'associatedForms_form', type: 'associatedForms_hide',
vIf: state.isSearch, vIf: state.isSearch,
vShow: ['associatedForms'] vShow: ['associatedForms']
}, },
@ -1609,7 +1609,8 @@
let currentUploadImgid = ""; let currentUploadImgid = "";
//,imgiddesignForm.activeKey,,controlData.value.type=='lowcodeCarsusel',imgid=''uuid //,imgiddesignForm.activeKey,,controlData.value.type=='lowcodeCarsusel',imgid=''uuid
watch(()=>store.activeKey, () => { watch(()=>store.activeKey, (newVal) => {
//
if(controlData.value.type==='lowcodeCarsusel'){ if(controlData.value.type==='lowcodeCarsusel'){
const carsuselConfigData:CarsuselConfig[] = controlData.value.control.carsuselConfigArr const carsuselConfigData:CarsuselConfig[] = controlData.value.control.carsuselConfigArr
carsuselConfigData.forEach(element => { carsuselConfigData.forEach(element => {
@ -1623,6 +1624,35 @@
}else if(controlData.value.type==='associatedForms'){ }else if(controlData.value.type==='associatedForms'){
controlData.value.control.fillRoles[0].id = uuidv4().replaceAll('-','').toString(); 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)
if(getAssociatedFormsCurrentFieldTreeData.treeAttrs!=undefined){
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){ function carouselImgUploadSuccess(response: any, uploadFile: UploadFile, uploadFiles: UploadFiles){
@ -1876,9 +1906,22 @@ function getAsfasfFieldTree() {
}); });
} }
function getAsfasfFieldTreeOptionsValue3() {
return request({
url: '/javasys/lowCode/AssociatedForms/getFieldTree',
method: 'post',
data: {
//cfid:'13'
cfid:controlData.value.control.optionsValue3Formid
},
});
}
//
const asfasfFieldTree = ref<Tree[]>() const asfasfFieldTree = ref<Tree[]>()
const asfasfFieldTreeOptionsValue3 = ref<Tree[]>()
function formidChanged(){ function formidChanged(){
if(controlData.value.control.formid===''){ if(controlData.value.control.formid===''){
@ -1898,14 +1941,85 @@ function formidChanged(){
treeAttrs: data.treeAttrs, treeAttrs: data.treeAttrs,
}] }]
} }
controlData.value.control.asfasfLabel = data.label
});
}
}
function formidChangedOptionsValue3(){
if(controlData.value.control.optionsValue3Formid===''){
}else{
getAsfasfFieldTreeOptionsValue3().then(({ data }) => {
if(data.id==="cfid为空"){
//alert("cfid")
}else{
if(data.treeAttrs.onlyToShowTableId==""){//
let resData = ref(data.children)
//let rootid_ = data.value.label
asfasfFieldTreeOptionsValue3.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...resData.value],
treeAttrs: data.treeAttrs,
}]
}else{//
let resData = ref(data.children)
resData.value = resData.value.filter((item: { children: null }) => item.children != null)
let arr = JSON.parse(JSON.stringify(resData.value));
arr = arr.filter( (item: { label: any }) => item.label == data.treeAttrs.onlyToShowTableId )
arr = arr[0].children
//console.log(arr)
asfasfFieldTreeOptionsValue3.value = [{
id: 'rootid_'+data.label,
label: '关联的表单-'+data.label,
children: [...arr],
treeAttrs: data.treeAttrs,
}]
}
let optionsValue3Formid = controlData.value.control.optionsValue3Formid
let str_optionsValue3Formid = optionsValue3Formid.split(":")[0]
let optionsValue3Field = controlData.value.control.optionsValue3Field
let str_optionsValue3Field = optionsValue3Field.split(":")[1]
//alert(str_optionsValue3Field)
if(typeof(str_optionsValue3Field)!='undefined'){
if(str_optionsValue3Formid!=str_optionsValue3Field){
controlData.value.control.optionsValue3Field = ""
}else{
if(optionsValue3Formid.includes(":zibiaoid-")){
let zibiaoid = optionsValue3Formid.split(":zibiaoid-")[1]
if(!optionsValue3Field.includes(zibiaoid)){
controlData.value.control.optionsValue3Field = ""
}
}
}
}
}
}); });
} }
} }
const associatedFormsCurrentFormFieldTree = ref<Tree[]>() const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>() const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
let resDataForGlxxszExceptself1: any[] = []
let getAssociatedFormsCurrentFieldTreeData:any
getAssociatedFormsCurrentFieldTree().then(({ data }) => { getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//console.log(data)
getAssociatedFormsCurrentFieldTreeData = JSON.parse(JSON.stringify(data))
//console.log(getAssociatedFormsCurrentFieldTreeData)
if(data.id==="cfid为空"){ if(data.id==="cfid为空"){
//alert("cfid") //alert("cfid")
}else{ }else{
@ -1921,6 +2035,11 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
let resDataForGlxxsz = ref(data.children.slice(8)) let resDataForGlxxsz = ref(data.children.slice(8))
resDataForGlxxszExceptself = JSON.parse(JSON.stringify(resDataForGlxxsz.value));
//console.log(resDataForGlxxszExceptself)
associatedFormsCurrentFormFieldTreeForGlxxsz.value = [{ associatedFormsCurrentFormFieldTreeForGlxxsz.value = [{
id: 'rootid_'+data.label, id: 'rootid_'+data.label,
@ -1929,6 +2048,15 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
children: [...resDataForGlxxsz.value], children: [...resDataForGlxxsz.value],
treeAttrs: data.treeAttrs, treeAttrs: data.treeAttrs,
}] }]
associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf.value = [{
id: 'rootid_'+data.label,
//label: '',
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataForGlxxsz.value],
treeAttrs: data.treeAttrs,//getAssociatedFormsCurrentFieldTreeData
}]
} }
}); });
@ -2191,6 +2319,11 @@ watch(()=>store.activeKey, () => {
setTimeout(() => { setTimeout(() => {
formidChanged() formidChanged()
}, 800); }, 800);
}else if(controlData.value.type==='radio'||controlData.value.type==='select'||controlData.value.type==='checkbox'){
setTimeout(() => {
formidChangedOptionsValue3()
}, 800);
} }
}) })
@ -2213,6 +2346,14 @@ function delRole(id:String){
} }
} }
} }
const associatedFormsChooseDialogFlag = ref(false)
function chooseAssociatedForm(){
associatedFormsChooseDialogFlag.value = true
}
function handleDetermineAssociatedFormsChooseDialog(){
associatedFormsChooseDialogFlag.value = false
}
//liwenxuan20240403 associatedForms end //liwenxuan20240403 associatedForms end
@ -2222,6 +2363,14 @@ function delRole(id:String){
const glxxszDialogFlag = ref(false) const glxxszDialogFlag = ref(false)
const glxxszDialogFlagCheckBox = ref(false) const glxxszDialogFlagCheckBox = ref(false)
const glxxszDialogFlagSwitch = ref(false)
function handelGlxxszDialogSwitch(){
if(controlData.value.control.activeValue==undefined||controlData.value.control.inactiveValue==undefined){
alert("请先设置开关状态打开/关闭时的值")
}else{
glxxszDialogFlagSwitch.value = true
}
}
function handelGlxxszDialog(){ function handelGlxxszDialog(){
if(controlData.value.options.length===0){ if(controlData.value.options.length===0){
alert("无可配置选项,请先添加。") alert("无可配置选项,请先添加。")
@ -2237,9 +2386,27 @@ function handelGlxxszDialogCheckbox(){
function handleDetermineGlxxszDialog(){ function handleDetermineGlxxszDialog(){
glxxszDialogFlag.value = false glxxszDialogFlag.value = false
} }
function handleDetermineGlxxszDialogSwitch(){
glxxszDialogFlagSwitch.value = false
}
function handleDetermineGlxxszDialogCheckBox(){ function handleDetermineGlxxszDialogCheckBox(){
glxxszDialogFlagCheckBox.value = false glxxszDialogFlagCheckBox.value = false
} }
//
watch(()=>controlData.value.control,(newVal) => {
if(typeof(newVal)!="undefined"){
if(typeof(newVal.glxxszSwitch)!="undefined"){
if(typeof(controlData.value.control.activeValue)!="undefined"){
controlData.value.control.glxxszSwitch[0].openValue = controlData.value.control.activeValue
controlData.value.control.glxxszSwitch[0].conditionField = controlData.value.name
}
if(typeof(controlData.value.control.inactiveValue)!="undefined"){
controlData.value.control.glxxszSwitch[1].offValue = controlData.value.control.inactiveValue
controlData.value.control.glxxszSwitch[1].conditionField = controlData.value.name
}
}
}
},{ deep: true })
@ -2295,8 +2462,17 @@ function createRowForGlxxsz(){
function deleteRowForGlxxsz(row: { id: any }){ function deleteRowForGlxxsz(row: { id: any }){
controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id) controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id)
} }
/* */
const optionsValue3SettingDialogOpenFlag = ref(false)
function optionsValue3Setting(){
optionsValue3SettingDialogOpenFlag.value = true
}
function handleDetermineoptionsValue3(){
optionsValue3SettingDialogOpenFlag.value = false
}
//bug:
//liwenxuan20240426 end //liwenxuan20240426 end
@ -2765,18 +2941,8 @@ const loadNextPage = () => {
<el-row v-else-if="item.type === 'associatedForms_form'"> <el-row v-else-if="item.type === 'associatedForms_form'">
<div style="margin-top: 25px;margin-left: -60px;"> <el-button type="primary" link style="display:block;cursor: pointer;" @click="chooseAssociatedForm">{{ controlData.control.asfasfLabel==''?'选择关联表单':controlData.control.asfasfLabel }}</el-button>
<el-tree-select
v-model="controlData.control.formid"
style="width: 260px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
filterable
@change="formidChanged"
/>
</div>
<!-- <div v-html="controlData.control.formid"></div> -->
</el-row> </el-row>
<el-row v-else-if="item.type === 'associatedForms_dataRange'"> <el-row v-else-if="item.type === 'associatedForms_dataRange'">
@ -2920,6 +3086,9 @@ const loadNextPage = () => {
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div v-if="showHide(['switch'],true)">
<el-button @click="handelGlxxszDialogSwitch">关联选项设置</el-button>
</div>
<div v-if="showHide(['radio','select',],true)"> <div v-if="showHide(['radio','select',],true)">
<el-button @click="handelGlxxszDialog">关联选项设置</el-button> <el-button @click="handelGlxxszDialog">关联选项设置</el-button>
</div> </div>
@ -2955,6 +3124,7 @@ const loadNextPage = () => {
@change="controlData.config.optionsFun = ''" @change="controlData.config.optionsFun = ''"
> >
<el-option :value="0" label="固定选项" /> <el-option :value="0" label="固定选项" />
<el-option :value="3" label="系统表单字段"/>
<el-option :value="1" label="数据源" /> <el-option :value="1" label="数据源" />
<el-option :value="2" label="接口字典" /> <el-option :value="2" label="接口字典" />
</el-select> </el-select>
@ -2984,6 +3154,10 @@ const loadNextPage = () => {
<el-button @click="addSelectOption">{{ controlData.type === 'cascader' ? '编辑' : '新增' }}</el-button> <el-button @click="addSelectOption">{{ controlData.type === 'cascader' ? '编辑' : '新增' }}</el-button>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="controlData.config.optionsType === 3">
<el-button type="primary" style="margin-bottom:10px;margin-left:11px" plain @click="optionsValue3Setting">选择系统表单字段</el-button>
<!-- <el-button style="padding-top: 5px;" type="primary" link append-to-body="true" modal="true" @click="optionsValue3Setting" >选择系统表单字段</el-button> -->
</template>
<template v-else> <template v-else>
<el-form-item class="form_cont"> <el-form-item class="form_cont">
<el-input <el-input
@ -3502,6 +3676,32 @@ const loadNextPage = () => {
<el-dialog v-model="associatedFormsChooseDialogFlag" class="glxxsztc" top="150px" :close-on-click-modal="false" title="选择关联表单" :show-close="false" style="margin-top:70px;" width="50%" >
<template v-if="controlData.type=='associatedForms'">
<div style="display:flex;margin-bottom: 2px;margin-top:28px"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">请选择表单</span>
<el-tree-select
v-model="controlData.control.formid"
style="width: 390px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
filterable
@change="formidChanged"
/>
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleDetermineAssociatedFormsChooseDialog">
确定
</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="associatedFormsHideDialogFlag" title="隐藏条件" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 500px" width="50%" > <el-dialog v-model="associatedFormsHideDialogFlag" title="隐藏条件" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 500px" width="50%" >
<template v-if="controlData.type=='associatedForms'"> <template v-if="controlData.type=='associatedForms'">
@ -3749,8 +3949,8 @@ const loadNextPage = () => {
<!-- 关联表单设置弹窗 liwenxuan 20240402 end --> <!-- 关联表单设置弹窗 liwenxuan 20240402 end -->
<!-- 关联选项设置弹窗 liwenxuan 20240426 start --> <!-- 关联选项设置弹窗 liwenxuan 20240426 start --> <!-- :title="`关联选项设置--`+controlData.item.label+`--`+controlData.name" -->
<el-dialog v-model="glxxszDialogFlag" class="glxxsztc" top="150px" :close-on-click-modal="false" title="关联选项设置" :show-close="false" style="margin-top:70px;" width="50%" > <el-dialog v-model="glxxszDialogFlag" class="glxxsztc" top="150px" :close-on-click-modal="false" :title="`关联选项设置--`+controlData.name" :show-close="false" style="margin-top:70px;" width="50%" >
@ -3770,7 +3970,7 @@ const loadNextPage = () => {
<el-table-column fixed="right" label="显示以下组件" > <el-table-column fixed="right" label="显示以下组件" >
<template #default="fieldScope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -3785,7 +3985,7 @@ const loadNextPage = () => {
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="glxxszDialogFlagCheckBox" class="glxxsztc" top="150px" :close-on-click-modal="false" title="关联选项设置" :show-close="false" style="margin-top:70px;" width="50%" > <el-dialog v-model="glxxszDialogFlagCheckBox" class="glxxsztc" top="150px" :close-on-click-modal="false" :title="`关联选项设置--`+controlData.name" :show-close="false" style="margin-top:70px;" width="50%" >
@ -3803,7 +4003,7 @@ const loadNextPage = () => {
<el-table-column fixed="right" label="显示以下组件" > <el-table-column fixed="right" label="显示以下组件" >
<template #default="fieldScope"> <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> </template>
</el-table-column> </el-table-column>
@ -3831,7 +4031,68 @@ const loadNextPage = () => {
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="glxxszDialogFlagSwitch" class="glxxsztc" top="150px" :close-on-click-modal="false" :title="`关联选项设置--`+controlData.name" :show-close="false" style="margin-top:70px;" width="50%" >
<template v-if="controlData.type=='switch'">
<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="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>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleDetermineGlxxszDialogSwitch">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 关联选项设置弹窗 liwenxuan 20240426 end --> <!-- 关联选项设置弹窗 liwenxuan 20240426 end -->
<!-- 单选下拉多选选项来源value3--系统表单字段 start-->
<el-dialog v-model="optionsValue3SettingDialogOpenFlag" class="glxxsztc" top="150px" :close-on-click-modal="false" title="选择表单字段" :show-close="false" style="margin-top:70px;" width="50%" >
<template v-if="controlData.type=='radio'||controlData.type=='select'||controlData.type=='checkbox'">
<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.optionsValue3Formid"
style="width: 390px;"
:data="customerFormTree[0].children"
check-strictly
:render-after-expand="false"
filterable
@change="formidChangedOptionsValue3"
/>
</div>
<div style="display:flex" v-if="typeof(controlData.control.optionsValue3Formid)!='undefined' && typeof(asfasfFieldTreeOptionsValue3)!='undefined' && controlData.control.optionsValue3Formid!=''"><span style="font-size: larger;margin-left: 35px;margin-right: 15px;">请选择字段</span>
<!--
-->
<el-tree-select v-model="controlData.control.optionsValue3Field" style="width: 390px;" :data="asfasfFieldTreeOptionsValue3[0].children" />
</div>
</template>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleDetermineoptionsValue3">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 单选下拉多选选项来源value3--系统表单字段 end-->
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>

145
src/components/DesignForm/public/form/form.vue

@ -164,7 +164,9 @@ const forEachGetFormModel = (list: FormList[], obj: any) => {
}) })
} else if (['card', 'div'].includes(item.type)) { } else if (['card', 'div'].includes(item.type)) {
forEachGetFormModel(item.list, obj) forEachGetFormModel(item.list, obj)
} else { } /* else if(['switch'].includes(item.type)){
console.log(item)
} */else {
const excludeType = ['title', 'divider', 'txt', 'button'] const excludeType = ['title', 'divider', 'txt', 'button']
if (excludeType.indexOf(item.type) === -1) { if (excludeType.indexOf(item.type) === -1) {
obj[item.name] = jsonParseStringify(item.control.modelValue) obj[item.name] = jsonParseStringify(item.control.modelValue)
@ -219,6 +221,9 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
/* console.log("modelKeyArr^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^") /* console.log("modelKeyArr^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
console.log(modelKeyArr) */ console.log(modelKeyArr) */
//console.log("-------------------")
//console.log(model.value)
// //
@ -295,7 +300,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
console.log(conditionFieldValue) */ console.log(conditionFieldValue) */
for(let n = 0; n< modelKeyArr.length;n++){ for(let n = 0; n< modelKeyArr.length;n++){
if(modelKeyArr[n]==conditionField){ if(modelKeyArr[n]==conditionField){
let count_1 = 0; //let count_1 = 0;
let trueValue = model.value[modelKeyArr[n]] let trueValue = model.value[modelKeyArr[n]]
if(trueValue.length>0&&arrayEqual(trueValue,conditionFieldValueArr)){ if(trueValue.length>0&&arrayEqual(trueValue,conditionFieldValueArr)){
//,conditionField.,x. //,conditionField.,x.
@ -304,7 +309,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
console.log(toshow) */ console.log(toshow) */
let flag = false//., let flag = false//.,
//conditionField,x++ //conditionField,x++
for(let a = 0;a<hideFieldConditionArr.length;a++){ /* for(let a = 0;a<hideFieldConditionArr.length;a++){
if(hideFieldConditionArr[a].toShow==conditionField){//conditions.length>1,=1. if(hideFieldConditionArr[a].toShow==conditionField){//conditions.length>1,=1.
for(let b = 0;b<hideFieldConditionArr[a].conditions.length;b++){ for(let b = 0;b<hideFieldConditionArr[a].conditions.length;b++){
for(let c = 0;c<hideFieldConditionArr[a].conditions[b].condition.length;c++){ for(let c = 0;c<hideFieldConditionArr[a].conditions[b].condition.length;c++){
@ -315,7 +320,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
} }
} }
} }
} } */
if(flag==false){ if(flag==false){
x++ x++
hideFieldsFromCheckbox.push(toshow) hideFieldsFromCheckbox.push(toshow)
@ -332,7 +337,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
//console.log(conditionFieldValue) //console.log(conditionFieldValue)
for(let n = 0; n< modelKeyArr.length;n++){ for(let n = 0; n< modelKeyArr.length;n++){
if(modelKeyArr[n]==conditionField){ if(modelKeyArr[n]==conditionField){
let count_1 = 0; //let count_1 = 0;
let trueValue = model.value[modelKeyArr[n]] let trueValue = model.value[modelKeyArr[n]]
//console.log(modelKeyArr[n]) //console.log(modelKeyArr[n])
//console.log(trueValue) //console.log(trueValue)
@ -371,6 +376,9 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st
model.value[hideFieldArr[i]] = "" model.value[hideFieldArr[i]] = ""
}else if( model.value[hideFieldArr[i]] instanceof Array){ }else if( model.value[hideFieldArr[i]] instanceof Array){
model.value[hideFieldArr[i]] = [] model.value[hideFieldArr[i]] = []
}else if(typeof model.value[hideFieldArr[i]] == "boolean"){
model.value[hideFieldArr[i]] = false
} }
} }
// //
@ -473,6 +481,39 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
} }
// }) // })
showOrHide()
if (typeof props.changeKeyVal === 'function') {
props.changeKeyVal(key, value,type,attribute)
}
if (key) {
if (!tProp) {
// change
model.value[key] = value
}
// 线AB
if (props.formData.events?.change) {
model.value = props.formData.events.change(key, model.value)
}
const onFormChange = props.formData.events?.change
if (onFormChange) {
if (typeof onFormChange === 'function') {
model.value = onFormChange(key, model.value)
} else {
model.value = formChangeValue(key, model.value, onFormChange)
}
}
// tProps
emits('change', { key, value, model: model.value, data, tProp })
}
/*
*/
})
function showOrHide (){
//liwenxuan start //liwenxuan start
/* console.log("-1-constControlChange-->",props.formData) /* console.log("-1-constControlChange-->",props.formData)
console.log("监听表单-2-constControlChange-->",key) console.log("监听表单-2-constControlChange-->",key)
@ -492,13 +533,14 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
//radio,checkbox,select //radio,checkbox,select,switch
const radioSelectShowConfigArr = [] const radioSelectShowConfigArr = []
const checkboxShowConfigArr = [] const checkboxShowConfigArr = []
const switchShowConfigArr = []
//showFieldskey,optionValuevalue,radioselectArr2---- //showFieldskey,optionValuevalue,radioselectArr2----
const radioSelectArr2:any[] = [] const radioSelectArr2:any[] = []
for(let i = 0;i<props.formData.list.length;i++){ for(let i = 0;i<props.formData.list.length;i++){
if(props.formData.list[i].type=="radio"||props.formData.list[i].type=="select"||props.formData.list[i].type=="checkbox"){ if(props.formData.list[i].type=="radio"||props.formData.list[i].type=="select"||props.formData.list[i].type=="checkbox"||props.formData.list[i].type=="switch"){
props.formData.config.hideField = []; props.formData.config.hideField = [];
} }
//console.log(props.formData.list[i].type) //console.log(props.formData.list[i].type)
@ -508,15 +550,18 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
}else if(props.formData.list[i].type=="checkbox"){ }else if(props.formData.list[i].type=="checkbox"){
checkboxShowConfigArr.push(props.formData.list[i].control.glxxszForCheckBox) checkboxShowConfigArr.push(props.formData.list[i].control.glxxszForCheckBox)
}else if(props.formData.list[i].type=="switch"){
switchShowConfigArr.push(props.formData.list[i].control.glxxszSwitch)
} }
} }
// //
const radioSelectShowConfigArr2 = JSON.parse(JSON.stringify(radioSelectShowConfigArr)); const radioSelectShowConfigArr2 = JSON.parse(JSON.stringify(radioSelectShowConfigArr));
const checkboxShowConfigArr2 = JSON.parse(JSON.stringify(checkboxShowConfigArr)); const checkboxShowConfigArr2 = JSON.parse(JSON.stringify(checkboxShowConfigArr));
const switchShowConfigArr2 = JSON.parse(JSON.stringify(switchShowConfigArr));
/* console.log(radioSelectShowConfigArr2) /* console.log(radioSelectShowConfigArr2)
console.log(checkboxShowConfigArr2) */ console.log(checkboxShowConfigArr2) */
//console.log("fodijafkjlsdhoidnfoidshojhfeknsidjfoiewhofnosdifhjeonoidufeinkdsaofhe")
//console.log(switchShowConfigArr2)
if(radioSelectShowConfigArr2.length>0){ if(radioSelectShowConfigArr2.length>0){
for(let i = 0;i<radioSelectShowConfigArr2.length;i++){ for(let i = 0;i<radioSelectShowConfigArr2.length;i++){
@ -565,7 +610,28 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
} }
} }
//radioSelectArr2,radioSelectArr2
if(switchShowConfigArr2.length>0){
for(let i = 0;i<switchShowConfigArr2.length;i++){
if(switchShowConfigArr2[i].length>0){
for(let j = 0; j<switchShowConfigArr2[i].length;j++){
if(switchShowConfigArr2[i][j].showFields.length>0){
for(let n = 0; n<switchShowConfigArr2[i][j].showFields.length;n++){
//console.log("99999999999999999999------"+switchShowConfigArr2[i][j].showFields[n])
let fieldKeyArr = switchShowConfigArr2[i][j].showFields[n].split(":")
let fieldKeyStr = fieldKeyArr[fieldKeyArr.length-1]
//console.log(fieldKeyStr)
radioSelectArr2.push({
toShowFieldKey:fieldKeyStr,
})
}
}
}
}
}
}
//console.log("radioSelectArr2radioSelectArr2radioSelectArr2radioSelectArr2radioSelectArr2=======")
//console.log(radioSelectArr2)
//showFieldskey,optionValuevalue,radioselectArr3 --- //showFieldskey,optionValuevalue,radioselectArr3 ---
const radioSelectArr3:any[] = [] const radioSelectArr3:any[] = []
@ -645,9 +711,35 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
} }
} }
} }
//console.log(radioSelectArr3)
//radioSelectArr3
if(switchShowConfigArr2.length>0){
for(let i = 0;i<switchShowConfigArr2.length;i++){
if(switchShowConfigArr2[i].length>0){
for(let j = 0;j<switchShowConfigArr2[i].length;j++){
//
const jArr = JSON.parse(JSON.stringify(switchShowConfigArr2[i][j]));
//console.log("111111111111111111111-----------"+JSON.stringify(switchShowConfigArr2[i][j]))
if(jArr.showFields!=undefined&&jArr.showFields.length>0){
const optionValueJArr = typeof(jArr.openValue)=="undefined"?jArr.offValue:jArr.openValue
let arr1 = []
for(let n = 0;n<jArr.showFields.length;n++){
let fieldKeyArr = jArr.showFields[n].split(":")
let fieldKeyStr = fieldKeyArr[fieldKeyArr.length-1]
//console.log(fieldKeyStr)
arr1.push(fieldKeyStr)
}
radioSelectArr3.push({
conditionFieldKey:jArr.conditionField,
conditionFieldValue:optionValueJArr,
toShowFieldKey:arr1,
})
}
}
}
}
}
//console.log(radioSelectArr3)
//使props.formData.config.hideField //使props.formData.config.hideField
let hideFieldArr: any[] = []; let hideFieldArr: any[] = [];
@ -679,36 +771,8 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
//props.formData.config?.hideField?.push("nin2yuan4yi4wei4wo3menda3fen1ma101939") //props.formData.config?.hideField?.push("nin2yuan4yi4wei4wo3menda3fen1ma101939")
//console.log("--constControlChange-->",key, value, data, tProp,type,attribute)//liwenxuan //console.log("--constControlChange-->",key, value, data, tProp,type,attribute)//liwenxuan
if (typeof props.changeKeyVal === 'function') {
props.changeKeyVal(key, value,type,attribute)
} }
if (key) {
if (!tProp) {
// change
model.value[key] = value
}
// 线AB
if (props.formData.events?.change) {
model.value = props.formData.events.change(key, model.value)
}
const onFormChange = props.formData.events?.change
if (onFormChange) {
if (typeof onFormChange === 'function') {
model.value = onFormChange(key, model.value)
} else {
model.value = formChangeValue(key, model.value, onFormChange)
}
}
// tProps
emits('change', { key, value, model: model.value, data, tProp })
}
/*
*/
})
const dictForm = computed(() => { const dictForm = computed(() => {
const storage = window.localStorage.getItem('akFormDict') const storage = window.localStorage.getItem('akFormDict')
let storageDict = {} let storageDict = {}
@ -1162,6 +1226,7 @@ onMounted(() => {
nextTick(() => { nextTick(() => {
appendRemoveStyle(true) appendRemoveStyle(true)
}) })
showOrHide()
}) })
onUnmounted(() => { onUnmounted(() => {
if (eventName) { if (eventName) {

8
src/types/components.d.ts

@ -118,8 +118,16 @@ declare module '@vue/runtime-core' {
IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default'] IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
IEpClose: typeof import('~icons/ep/close')['default'] IEpClose: typeof import('~icons/ep/close')['default']
<<<<<<< HEAD
IEpEdit: typeof import('~icons/ep/edit')['default'] IEpEdit: typeof import('~icons/ep/edit')['default']
IEpMessageBox: typeof import('~icons/ep/message-box')['default'] IEpMessageBox: typeof import('~icons/ep/message-box')['default']
=======
IEpDelete: typeof import('~icons/ep/delete')['default']
IEpEdit: typeof import('~icons/ep/edit')['default']
IEpMessageBox: typeof import('~icons/ep/message-box')['default']
IEpOperation: typeof import('~icons/ep/operation')['default']
IEpPlus: typeof import('~icons/ep/plus')['default']
>>>>>>> lwx_v9
IEpRefresh: typeof import('~icons/ep/refresh')['default'] IEpRefresh: typeof import('~icons/ep/refresh')['default']
IEpSearch: typeof import('~icons/ep/search')['default'] IEpSearch: typeof import('~icons/ep/search')['default']
IEpSetting: typeof import('~icons/ep/setting')['default'] IEpSetting: typeof import('~icons/ep/setting')['default']

7
src/views/sysworkflow/lowcodepage/pageDesignes.vue

@ -569,9 +569,16 @@ onMounted(() => {
getInitData() getInitData()
}) })
// //
<<<<<<< HEAD
watch(() =>versionId.value ,(val:string)=>{ watch(() =>versionId.value ,(val:string)=>{
emits('update:formVersion', val) emits('update:formVersion', val)
}) })
=======
// watch(() =>versionId.value ,(val:string)=>{
// emits('update:formVersion', val)
// })
>>>>>>> lwx_v9
/** /**
@ 作者: 秦东 @ 作者: 秦东
@ 时间: 2024-05-09 14:29:06 @ 时间: 2024-05-09 14:29:06

23
src/widget/writingboard/vueSignature.vue

@ -102,8 +102,10 @@
const getSizeRatio = () => { const getSizeRatio = () => {
return !props.fullScreen && props.backIsCenter return !props.fullScreen && props.backIsCenter
} }
const setCanvasImageBack = (status: any) => { const setCanvasImageBack = (status: any,canvas:any) => {
const canvas = canvasRef.value as HTMLCanvasElement //const canvas = canvasRef.value as HTMLCanvasElement
//console.log(canvas)
if(typeof(canvas)!="undefined"&&typeof(canvas.width)!="undefined"){
let pat = canvasTxt.value?.createPattern(canvasBackDom.value, (props.isRepeat || "no-repeat")); let pat = canvasTxt.value?.createPattern(canvasBackDom.value, (props.isRepeat || "no-repeat"));
canvasTxt.value?.rect(0,0,canvas.width ,canvas.height) canvasTxt.value?.rect(0,0,canvas.width ,canvas.height)
canvasTxt!.value!.fillStyle = (pat as any); canvasTxt!.value!.fillStyle = (pat as any);
@ -112,10 +114,12 @@
autoDraw(null, null) autoDraw(null, null)
} }
} }
const setCanvasBack = (status: any) => {
const canvas = canvasRef.value as HTMLCanvasElement }
const setCanvasBack = (status: any,canvas:any) => {
//const canvas = canvasRef.value as HTMLCanvasElement
if (props.canvasBack && canvasBackDom.value && isImgaes(props.canvasBack)) { if (props.canvasBack && canvasBackDom.value && isImgaes(props.canvasBack)) {
setCanvasImageBack(status) setCanvasImageBack(status,canvas)//liwenxuan
} else { } else {
canvas.style.background = canvasBackground.value canvas.style.background = canvasBackground.value
} }
@ -145,12 +149,19 @@
canvasTxt.value?.scale(1 * sratio.value, 1 * sratio.value) canvasTxt.value?.scale(1 * sratio.value, 1 * sratio.value)
sratio.value = realw / (domPatams.width ? domPatams.width : props.fullScreen ? screenPatams.width : props.width) sratio.value = realw / (domPatams.width ? domPatams.width : props.fullScreen ? screenPatams.width : props.width)
canvasTxt.value?.scale(1 / sratio.value, 1 / sratio.value) canvasTxt.value?.scale(1 / sratio.value, 1 / sratio.value)
if (props.canvasBack) { if (props.canvasBack) {
let IntervaId = setInterval(() => { let IntervaId = setInterval(() => {
//console.log("111111111111111111111111111111111111111111111111111111")
//console.log(canvas)
if(typeof(canvas)!="undefined"){
//console.log(canvas)
if ((canvasBackDom.value && isLoad.value) || !isImgaes(props.canvasBack)) { if ((canvasBackDom.value && isLoad.value) || !isImgaes(props.canvasBack)) {
setCanvasBack(status) setCanvasBack(status,canvas)//liwenxuan
clearInterval(IntervaId) clearInterval(IntervaId)
} }
}
}, 100) }, 100)
} else { } else {
if (status) { if (status) {

Loading…
Cancel
Save