rev:strucForm

This commit is contained in:
2024-05-11 15:19:48 +08:00
parent 4e8913ce81
commit 1600224344
6 changed files with 118 additions and 16 deletions

View File

@@ -7,16 +7,49 @@
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="自动执行" prop="passNode">
<el-form-item label="自动执行" prop="pass">
<el-switch
v-model="formData.passNode"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item label="表达式" prop="skipExpression">
<el-form-item label="任务类型" prop="category">
<el-select clearable v-model="formData.category" placeholder="请选择" style="width: 370px;">
<el-option
v-for="item in taskTypes"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-if="formData.category === 'class' || formData.category === 'expression'" label="表达式" prop="skipExpression">
<el-input v-model="formData.skipExpression"></el-input>
</el-form-item>
<el-form-item v-else-if="formData.category === 'mapping'" label="表达式" prop="skipExpression">
<el-input type="textarea" v-model="formData.skipExpression"></el-input>
</el-form-item>
<el-form-item v-else-if="formData.category === 'decision'" label="表达式" prop="skipExpression">
<el-select clearable v-model="formData.skipExpression" multiple placeholder="请选择" style="width: 370px;">
<el-option
v-for="item in strategyList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="单据类型" prop="form_type">
<el-select clearable v-model="formData.form_type" placeholder="请选择" style="width: 370px;">
<el-option
v-for="item in formTypes"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="描述" prop="documentation">
<el-input v-model="formData.documentation"></el-input>
</el-form-item>
@@ -27,6 +60,8 @@
</div>
</template>
<script>
import curdActDeModel from "../../act/model/curdActDeModel";
export default {
name: '',
props: {
@@ -47,16 +82,24 @@ export default {
if (!this.formData.id) {
this.formData.id = this.generateUniqueId();
}
this.getTypes()
this.getTaskTypes()
this.getStrategyList()
},
data() {
return {
text: '',
formTypes: [],
taskTypes: [],
strategyList: [],
formData: {
id: '',
name: '',
category: '',
skipExpression: '',
documentation: '',
passNode: true
form_type: '',
passNode: true,
documentation: ''
},
rules: {
id: [
@@ -65,9 +108,12 @@ export default {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
],
passNode: [
pass: [
{required: true, message: '自动执行不能为空', trigger: 'blur'}
],
category: [
{required: true, message: '任务类型不能为空', trigger: 'blur'}
],
}
}
},
@@ -75,23 +121,36 @@ export default {
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
const {id} = this.$props.nodeData
this.$props.lf.setProperties(id, {
...this.$data.formData
});
const {id} = this.$props.nodeData;
this.$props.lf.updateText(id, this.$data.formData.name);
this.$props.lf.setProperties(id, {...this.formData});
this.$notify({
title: '保存成功',
message: '请点击上方保存数据按钮,进行持久化!',
type: 'success',
offset: 100
});
this.$emit('onClose')
this.$emit('onClose'); // 关闭对话框或完成后续操作
}
});
},
generateUniqueId() {
return `id_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
},
getTypes() {
curdActDeModel.getTypes().then(res => {
this.formTypes = res
})
},
getTaskTypes() {
curdActDeModel.getTaskTypes().then(res => {
this.taskTypes = res
})
},
getStrategyList() {
curdActDeModel.getStrategyList().then(res => {
this.strategyList = res
})
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -60,7 +60,19 @@ class ResizableRectView extends RectResize.view {
[
h("path", {
fill: style.stroke,
d: 'M913.660512 443.297039L474.753353 70.480459 35.846194 443.297039l-35.549944-40.397665L474.753353-0.026932l474.457104 403.007101zM190.515386 551.481984H136.193993v-258.545053h54.321393v258.545053z m633.13913 0h-54.321393v-258.545053h54.321393v258.545053zM507.313871 962.083846h-149.821472v-53.297985h149.821472v53.297985z m309.44611 0h-133.904792v-53.297985h79.583399V570.549682H84.835095v338.236179h91.945085v53.297985h-146.239546V517.224765h786.219347v444.859081z m-546.71506 61.943086a121.354584 121.354584 0 1 1 123.616854-121.192994 122.620378 122.620378 0 0 1-123.643785 121.112198z m0-189.330388A68.029667 68.029667 0 1 0 339.340382 902.537689a68.729893 68.729893 0 0 0-69.322392-67.92194z m324.096997 189.330388a121.354584 121.354584 0 1 1 123.616853-121.192994 122.620378 122.620378 0 0 1-123.643785 121.112198z m0-189.330388a68.029667 68.029667 0 1 0 69.29546 67.841145 68.729893 68.729893 0 0 0-69.322392-67.92194z m416.688443 189.330388a121.354584 121.354584 0 1 1 123.616854-121.192994 122.620378 122.620378 0 0 1-123.643785 121.112198z m0-189.330388a68.029667 68.029667 0 1 0 69.295461 67.841145 68.729893 68.729893 0 0 0-69.322392-67.92194z m254.828468 96.631214h-135.816948v-53.405713h81.468623v-106.622902h-108.615854V584.742728h-325.874493v-53.324917H1156.989112v186.583346h108.642785v213.218874z m-380.222818 0h-108.642786v-53.405713h108.642786v53.297986z m-172.040188-469.340067h-54.321392v-156.042712h54.321392v156.042712z m-88.309294 1.346589h-130.349798V304.652254h130.349798v158.73589z m-76.001473-53.297985h21.707012v-52.112987h-21.733944v52.112987z m-93.668718 51.978328h-54.348325v-156.069644h54.321393v156.042712z m-88.309295 1.346589H236.703382V304.652254h130.349798v158.73589z m-76.028404-53.297985h21.707011v-52.139919h-21.760875v52.112987z',
d: 'M749.381818 923.927273H204.8c-74.472727 0-137.309091-62.836364-137.309091-134.981818V249.018182c0-74.472727 60.509091-134.981818 137.309091-134.981818h337.454545c18.618182 0 34.909091 16.290909 34.909091 34.909091s-16.290909 34.909091-34.909091 34.90909H204.8c-37.236364 0-69.818182 30.254545-69.818182 67.49091V791.272727c0 34.909091 32.581818 67.490909 69.818182 67.490909h542.254545c37.236364 0 69.818182-30.254545 69.818182-67.490909V381.672727c0-18.618182 16.290909-34.909091 34.909091-34.909091s34.909091 16.290909 34.909091 34.909091v407.272728c-2.327273 74.472727-62.836364 134.981818-137.309091 134.981818z'
}),
h("path", {
fill: style.stroke,
d: 'M716.8 781.963636H242.036364c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.90909h474.763636c18.618182 0 34.909091 16.290909 34.909091 34.90909s-16.290909 34.909091-34.909091 34.909091zM781.963636 325.818182l-162.909091-160.581818 90.763637-90.763637c44.218182-44.218182 118.690909-44.218182 162.909091 0 23.272727 20.945455 34.909091 48.872727 34.909091 79.127273 0 30.254545-11.636364 58.181818-34.909091 81.454545L781.963636 325.818182z m-65.163636-162.909091l65.163636 65.163636L826.181818 186.181818c6.981818-9.309091 11.636364-18.618182 11.636364-32.581818s-4.654545-23.272727-13.963637-32.581818c-18.618182-18.618182-48.872727-18.618182-67.490909 0L716.8 162.909091z'
}),
h("path", {
fill: style.stroke,
d: 'M342.109091 665.6c-18.618182 0-34.909091-6.981818-46.545455-20.945455-16.290909-16.290909-23.272727-41.890909-16.290909-62.836363l23.272728-90.763637c2.327273-6.981818 6.981818-18.618182 16.290909-27.927272L667.927273 116.363636l162.909091 160.581819-351.418182 349.090909c-9.309091 9.309091-18.618182 13.963636-27.927273 16.290909h-2.327273l-90.763636 20.945454c-6.981818 2.327273-11.636364 2.327273-16.290909 2.327273z m23.272727-153.6l-20.945454 86.109091 88.436363-20.945455 302.545455-297.890909-65.163637-65.163636L365.381818 512z'
}),
h("path", {
fill: style.stroke,
d: 'M393.309091 458.472727l93.090909 90.763637-41.890909 39.563636-93.090909-90.763636z'
})
]
);

View File

@@ -63,7 +63,19 @@ class ResizableRectView extends RectResize.view {
[
h("path", {
fill: style.stroke,
d: 'M913.660512 443.297039L474.753353 70.480459 35.846194 443.297039l-35.549944-40.397665L474.753353-0.026932l474.457104 403.007101zM190.515386 551.481984H136.193993v-258.545053h54.321393v258.545053z m633.13913 0h-54.321393v-258.545053h54.321393v258.545053zM507.313871 962.083846h-149.821472v-53.297985h149.821472v53.297985z m309.44611 0h-133.904792v-53.297985h79.583399V570.549682H84.835095v338.236179h91.945085v53.297985h-146.239546V517.224765h786.219347v444.859081z m-546.71506 61.943086a121.354584 121.354584 0 1 1 123.616854-121.192994 122.620378 122.620378 0 0 1-123.643785 121.112198z m0-189.330388A68.029667 68.029667 0 1 0 339.340382 902.537689a68.729893 68.729893 0 0 0-69.322392-67.92194z m324.096997 189.330388a121.354584 121.354584 0 1 1 123.616853-121.192994 122.620378 122.620378 0 0 1-123.643785 121.112198z m0-189.330388a68.029667 68.029667 0 1 0 69.29546 67.841145 68.729893 68.729893 0 0 0-69.322392-67.92194z m416.688443 189.330388a121.354584 121.354584 0 1 1 123.616854-121.192994 122.620378 122.620378 0 0 1-123.643785 121.112198z m0-189.330388a68.029667 68.029667 0 1 0 69.295461 67.841145 68.729893 68.729893 0 0 0-69.322392-67.92194z m254.828468 96.631214h-135.816948v-53.405713h81.468623v-106.622902h-108.615854V584.742728h-325.874493v-53.324917H1156.989112v186.583346h108.642785v213.218874z m-380.222818 0h-108.642786v-53.405713h108.642786v53.297986z m-172.040188-469.340067h-54.321392v-156.042712h54.321392v156.042712z m-88.309294 1.346589h-130.349798V304.652254h130.349798v158.73589z m-76.001473-53.297985h21.707012v-52.112987h-21.733944v52.112987z m-93.668718 51.978328h-54.348325v-156.069644h54.321393v156.042712z m-88.309295 1.346589H236.703382V304.652254h130.349798v158.73589z m-76.028404-53.297985h21.707011v-52.139919h-21.760875v52.112987z',
d: 'M749.381818 923.927273H204.8c-74.472727 0-137.309091-62.836364-137.309091-134.981818V249.018182c0-74.472727 60.509091-134.981818 137.309091-134.981818h337.454545c18.618182 0 34.909091 16.290909 34.909091 34.909091s-16.290909 34.909091-34.909091 34.90909H204.8c-37.236364 0-69.818182 30.254545-69.818182 67.49091V791.272727c0 34.909091 32.581818 67.490909 69.818182 67.490909h542.254545c37.236364 0 69.818182-30.254545 69.818182-67.490909V381.672727c0-18.618182 16.290909-34.909091 34.909091-34.909091s34.909091 16.290909 34.909091 34.909091v407.272728c-2.327273 74.472727-62.836364 134.981818-137.309091 134.981818z'
}),
h("path", {
fill: style.stroke,
d: 'M716.8 781.963636H242.036364c-18.618182 0-34.909091-16.290909-34.909091-34.909091s16.290909-34.909091 34.909091-34.90909h474.763636c18.618182 0 34.909091 16.290909 34.909091 34.90909s-16.290909 34.909091-34.909091 34.909091zM781.963636 325.818182l-162.909091-160.581818 90.763637-90.763637c44.218182-44.218182 118.690909-44.218182 162.909091 0 23.272727 20.945455 34.909091 48.872727 34.909091 79.127273 0 30.254545-11.636364 58.181818-34.909091 81.454545L781.963636 325.818182z m-65.163636-162.909091l65.163636 65.163636L826.181818 186.181818c6.981818-9.309091 11.636364-18.618182 11.636364-32.581818s-4.654545-23.272727-13.963637-32.581818c-18.618182-18.618182-48.872727-18.618182-67.490909 0L716.8 162.909091z'
}),
h("path", {
fill: style.stroke,
d: 'M342.109091 665.6c-18.618182 0-34.909091-6.981818-46.545455-20.945455-16.290909-16.290909-23.272727-41.890909-16.290909-62.836363l23.272728-90.763637c2.327273-6.981818 6.981818-18.618182 16.290909-27.927272L667.927273 116.363636l162.909091 160.581819-351.418182 349.090909c-9.309091 9.309091-18.618182 13.963636-27.927273 16.290909h-2.327273l-90.763636 20.945454c-6.981818 2.327273-11.636364 2.327273-16.290909 2.327273z m23.272727-153.6l-20.945454 86.109091 88.436363-20.945455 302.545455-297.890909-65.163637-65.163636L365.381818 512z'
}),
h("path", {
fill: style.stroke,
d: 'M393.309091 458.472727l93.090909 90.763637-41.890909 39.563636-93.090909-90.763636z'
})
]
);