|
|
|
@ -510,6 +510,16 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
);
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "relation-flow":
|
|
|
|
case "relation-flow":
|
|
|
|
|
|
|
|
if (!this.flows[info.name]) {
|
|
|
|
|
|
|
|
flowList('all', {
|
|
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
|
|
|
custom_model_id: info.stub
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
this.$set(this.flows, info.name, res.data.data)
|
|
|
|
|
|
|
|
console.log(this.flows)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
formItem = h(
|
|
|
|
formItem = h(
|
|
|
|
formBuilderMap(device).get(info.type),
|
|
|
|
formBuilderMap(device).get(info.type),
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -533,27 +543,10 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
row
|
|
|
|
row
|
|
|
|
? this.$set(row, info.name, e.toString())
|
|
|
|
? this.$set(row, info.name, e.toString())
|
|
|
|
: this.$set(this.form, info.name, e.toString());
|
|
|
|
: this.$set(this.form, info.name, e.toString());
|
|
|
|
},
|
|
|
|
|
|
|
|
['visible-change']:e => {
|
|
|
|
|
|
|
|
if (e) {
|
|
|
|
|
|
|
|
if (this.nowSelectId === info.stub && this.flows.length > 0) return
|
|
|
|
|
|
|
|
this.flowSelectLoading = true
|
|
|
|
|
|
|
|
flowList('all', {
|
|
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
|
|
|
custom_model_id: info.stub
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
this.nowSelectId = info.stub
|
|
|
|
|
|
|
|
this.flows = res.data.data
|
|
|
|
|
|
|
|
this.flowSelectLoading = false
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
this.flowSelectLoading = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
this.flows.map((option) =>
|
|
|
|
this.flows[info.name]?.map((option) =>
|
|
|
|
h("el-option", {
|
|
|
|
h("el-option", {
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
label: option.title,
|
|
|
|
label: option.title,
|
|
|
|
@ -787,6 +780,16 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
);
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "relation-flow":
|
|
|
|
case "relation-flow":
|
|
|
|
|
|
|
|
if (!this.flows[info.name]) {
|
|
|
|
|
|
|
|
flowList('all', {
|
|
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
|
|
|
custom_model_id: info.stub
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
this.$set(this.flows, info.name, res.data.data)
|
|
|
|
|
|
|
|
console.log(this.flows)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
formItem = h(
|
|
|
|
formItem = h(
|
|
|
|
"span",
|
|
|
|
"span",
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -795,7 +798,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
this.form[info.name]?.toString()?.split(',').map(j => {
|
|
|
|
this.form[info.name]?.toString()?.split(',').map(j => {
|
|
|
|
return this.flows.find((i) =>
|
|
|
|
return this.flows[info.name]?.find((i) =>
|
|
|
|
i.id == j
|
|
|
|
i.id == j
|
|
|
|
)?.title;
|
|
|
|
)?.title;
|
|
|
|
})?.toString()
|
|
|
|
})?.toString()
|
|
|
|
@ -895,9 +898,34 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (formItem) {
|
|
|
|
if (formItem) {
|
|
|
|
this.logs.forEach(log => {
|
|
|
|
let jointlySignContent = []
|
|
|
|
if(!log.is_jointly_sign) return
|
|
|
|
this.jointlySignLog.forEach(log => {
|
|
|
|
|
|
|
|
const data = JSON.parse(log.data)
|
|
|
|
|
|
|
|
Object.entries(data).forEach(([key, value]) => {
|
|
|
|
|
|
|
|
if (value.hasOwnProperty('custom_field_id') && (value['custom_field_id'] === info.id)) {
|
|
|
|
|
|
|
|
jointlySignContent.push(h('div',[
|
|
|
|
|
|
|
|
h('span', value.value),
|
|
|
|
|
|
|
|
h('br'),
|
|
|
|
|
|
|
|
info.is_sign ? h('el-image',{
|
|
|
|
|
|
|
|
style: {
|
|
|
|
|
|
|
|
'max-height': '80px',
|
|
|
|
|
|
|
|
'max-width': '120px'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
|
|
|
|
src: log.user?.sign_file?.url,
|
|
|
|
|
|
|
|
fit: 'contain',
|
|
|
|
|
|
|
|
alt: log.user?.name
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
attrs: {
|
|
|
|
|
|
|
|
src: log.user?.sign_file?.url,
|
|
|
|
|
|
|
|
alt: log.user?.name
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}) : '',
|
|
|
|
|
|
|
|
h('br'),
|
|
|
|
|
|
|
|
h('span', log.updated_at ? this.$moment(log.updated_at).format('YYYY年MM月DD') : '')
|
|
|
|
|
|
|
|
]))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return row
|
|
|
|
return row
|
|
|
|
? formItem
|
|
|
|
? formItem
|
|
|
|
@ -916,29 +944,30 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
"grid-row-end": info.gs_y + 1 + (info.name === 'flow_title' ? 0 : 1) + info.gs_height,
|
|
|
|
"grid-row-end": info.gs_y + 1 + (info.name === 'flow_title' ? 0 : 1) + info.gs_height,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[formItem,(() => {
|
|
|
|
[(/\/detail/.test(this.$route.path) && this.$route.query.flow_id && jointlySignContent.length > 0) ? '' : formItem,(() => {
|
|
|
|
if (info.is_sign) {
|
|
|
|
if (info.is_sign && !(/\/detail/.test(this.$route.path) && this.$route.query.flow_id && jointlySignContent.length > 0)) {
|
|
|
|
let log = this.logs.find(log => log.node?.fields?.findIndex(field => field?.field?.name === info.name) !== -1) && (row ? row[info.name] : this.form[info.name])
|
|
|
|
let log = this.logs.find(log => log.node?.fields?.findIndex(field => field?.field?.name === info.name) !== -1) && (row ? row[info.name] : this.form[info.name])
|
|
|
|
if (log && log.user) {
|
|
|
|
if (log && log.user) {
|
|
|
|
return h('div',[
|
|
|
|
return h('div',[
|
|
|
|
h('el-image',{
|
|
|
|
h('el-image',{
|
|
|
|
style: {
|
|
|
|
style: {
|
|
|
|
'max-height': '80px'
|
|
|
|
'max-height': '80px',
|
|
|
|
|
|
|
|
'max-width': '120px'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
src: log.user?.sign_file?.url,
|
|
|
|
src: log.user?.sign_file?.url,
|
|
|
|
fit: 'contain',
|
|
|
|
fit: 'contain',
|
|
|
|
alt: log.user?.sign_id
|
|
|
|
alt: log.user?.name
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attrs: {
|
|
|
|
attrs: {
|
|
|
|
src: log.user?.sign_file?.url,
|
|
|
|
src: log.user?.sign_file?.url,
|
|
|
|
alt: log.user?.sign_id
|
|
|
|
alt: log.user?.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
])
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})()]
|
|
|
|
})(),jointlySignContent]
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -953,7 +982,8 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
value: row ? row[info.name] : this.form[info.name],
|
|
|
|
value: row ? row[info.name] : this.form[info.name],
|
|
|
|
clearable: true,
|
|
|
|
clearable: true,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attrs: {
|
|
|
|
attrs: {
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
@ -976,7 +1006,8 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
value: row ? row[info.name] : this.form[info.name],
|
|
|
|
value: row ? row[info.name] : this.form[info.name],
|
|
|
|
clearable: true,
|
|
|
|
clearable: true,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attrs: {
|
|
|
|
attrs: {
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
@ -1000,7 +1031,8 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
value: row ? row[info.name] : this.form[info.name],
|
|
|
|
value: row ? row[info.name] : this.form[info.name],
|
|
|
|
clearable: true,
|
|
|
|
clearable: true,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attrs: {
|
|
|
|
attrs: {
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
@ -1015,7 +1047,6 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "datetime":
|
|
|
|
case "datetime":
|
|
|
|
console.log(3345, this.rules[info.name])
|
|
|
|
|
|
|
|
formItem = h("van-field", {
|
|
|
|
formItem = h("van-field", {
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
readonly: true,
|
|
|
|
readonly: true,
|
|
|
|
@ -1052,7 +1083,8 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
value: typeof findSelect === "object" ? findSelect.name : findSelect,
|
|
|
|
value: typeof findSelect === "object" ? findSelect.name : findSelect,
|
|
|
|
clearable: true,
|
|
|
|
clearable: true,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
on: {
|
|
|
|
on: {
|
|
|
|
click: (_) => {
|
|
|
|
click: (_) => {
|
|
|
|
@ -1083,12 +1115,14 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
value: (findChoice instanceof Array) ? (findChoice.map(i => typeof i === "object" ? i.name : i).toString()) : (typeof findChoice === "object" ? findChoice.name : findChoice),
|
|
|
|
value: (findChoice instanceof Array) ? (findChoice.map(i => typeof i === "object" ? i.name : i).toString()) : (typeof findChoice === "object" ? findChoice.name : findChoice),
|
|
|
|
clearable: true,
|
|
|
|
clearable: true,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
on: {
|
|
|
|
on: {
|
|
|
|
click: (_) => {
|
|
|
|
click: (_) => {
|
|
|
|
this.multipleSelectOption.forFormName = info.name;
|
|
|
|
this.multipleSelectOption.forFormName = info.name;
|
|
|
|
this.multipleSelectOption.originalObj = row;
|
|
|
|
this.multipleSelectOption.originalObj = row;
|
|
|
|
|
|
|
|
this.multipleSelectOption.outputType = 'array';
|
|
|
|
this.$set(this.multipleSelectOption, "columns", options);
|
|
|
|
this.$set(this.multipleSelectOption, "columns", options);
|
|
|
|
this.$set(this.multipleSelectOption, "options", {
|
|
|
|
this.$set(this.multipleSelectOption, "options", {
|
|
|
|
label: 'name',
|
|
|
|
label: 'name',
|
|
|
|
@ -1104,7 +1138,8 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
formItem = h('van-cell',{
|
|
|
|
formItem = h('van-cell',{
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
title: info.label,
|
|
|
|
title: info.label,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},[
|
|
|
|
},[
|
|
|
|
h(
|
|
|
|
h(
|
|
|
|
@ -1235,27 +1270,42 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
|
|
|
|
])
|
|
|
|
])
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'relation-flow':
|
|
|
|
case 'relation-flow':
|
|
|
|
let findFlow = options?.find((i) =>
|
|
|
|
if (!this.flows[info.name]) {
|
|
|
|
typeof i === "object"
|
|
|
|
flowList('all', {
|
|
|
|
? i.id === (row ? row[info.name] : this.form[info.name])
|
|
|
|
page: 1,
|
|
|
|
: i === (row ? row[info.name] : this.form[info.name])
|
|
|
|
page_size: 9999,
|
|
|
|
);
|
|
|
|
custom_model_id: info.stub
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
this.$set(this.flows, info.name, res.data.data)
|
|
|
|
|
|
|
|
console.log(this.flows)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
formItem = h("van-field", {
|
|
|
|
formItem = h("van-field", {
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
readonly: true,
|
|
|
|
readonly: true,
|
|
|
|
clickable: true,
|
|
|
|
clickable: true,
|
|
|
|
name: info.name,
|
|
|
|
name: info.name,
|
|
|
|
label: info.label,
|
|
|
|
label: info.label,
|
|
|
|
value: typeof findFlow === "object" ? (findFlow.name || findFlow.title) : findFlow,
|
|
|
|
value: row ? row[info.name]?.toString()?.split(',').map(j => {
|
|
|
|
|
|
|
|
return this.flows[info.name]?.find((i) =>
|
|
|
|
|
|
|
|
i.id == j
|
|
|
|
|
|
|
|
)?.title;
|
|
|
|
|
|
|
|
})?.toString() : this.form[info.name]?.toString()?.split(',').map(j => {
|
|
|
|
|
|
|
|
return this.flows[info.name]?.find((i) =>
|
|
|
|
|
|
|
|
i.id == j
|
|
|
|
|
|
|
|
)?.title;
|
|
|
|
|
|
|
|
})?.toString(),
|
|
|
|
clearable: true,
|
|
|
|
clearable: true,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
placeholder: info.help_text,
|
|
|
|
rules: this.rules[info.name]
|
|
|
|
rules: this.rules[info.name],
|
|
|
|
|
|
|
|
required: !!this.rules[info.name]?.find(j => j.required)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
on: {
|
|
|
|
on: {
|
|
|
|
click: (_) => {
|
|
|
|
click: (_) => {
|
|
|
|
this.multipleSelectOption.forFormName = info.name;
|
|
|
|
this.multipleSelectOption.forFormName = info.name;
|
|
|
|
this.multipleSelectOption.originalObj = row;
|
|
|
|
this.multipleSelectOption.originalObj = row;
|
|
|
|
this.$set(this.multipleSelectOption, "columns", this.flows);
|
|
|
|
this.multipleSelectOption.outputType = 'string';
|
|
|
|
|
|
|
|
this.$set(this.multipleSelectOption, "columns", this.flows[info.name]);
|
|
|
|
this.$set(this.multipleSelectOption, "options", {
|
|
|
|
this.$set(this.multipleSelectOption, "options", {
|
|
|
|
label: 'title',
|
|
|
|
label: 'title',
|
|
|
|
value: 'id'
|
|
|
|
value: 'id'
|
|
|
|
|