|
@@ -35,32 +35,29 @@ const userTypeOption = ref([
|
|
|
|
|
|
const rules = reactive<FormRules<any>>({
|
|
|
name: [
|
|
|
- { required: true, message: "Please input Activity name", trigger: "blur" },
|
|
|
+ { required: true, message: "请输入审核节点名称", trigger: "blur" },
|
|
|
],
|
|
|
- desc: [
|
|
|
+ /*desc: [
|
|
|
{ required: true, message: "Please input activity form", trigger: "blur" },
|
|
|
- ],
|
|
|
+ ],*/
|
|
|
});
|
|
|
|
|
|
-const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
- // if (!formEl) return
|
|
|
- // await formEl.validate((valid, fields) => {
|
|
|
- // if (valid) {
|
|
|
- // console.log('submit!')
|
|
|
- // } else {
|
|
|
- // console.log('error submit!', fields)
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- if (flowRef.value && flowRef.value.updateNodeData && selectedNode.value) {
|
|
|
- selectedNode.value.data.information = JSON.parse(
|
|
|
- JSON.stringify(formData.value)
|
|
|
- );
|
|
|
- flowRef.value.updateNodeData(
|
|
|
- JSON.parse(JSON.stringify(markRaw(selectedNode.value)))
|
|
|
- );
|
|
|
- cancel();
|
|
|
- }
|
|
|
+const submitForm = () => {
|
|
|
+ ruleFormRef.value.validate(async (valid, fields) => {
|
|
|
+ if (valid) {
|
|
|
+ if (flowRef.value && flowRef.value.updateNodeData && selectedNode.value) {
|
|
|
+ selectedNode.value.data.information = JSON.parse(
|
|
|
+ JSON.stringify(formData.value)
|
|
|
+ );
|
|
|
+ flowRef.value.updateNodeData(
|
|
|
+ JSON.parse(JSON.stringify(markRaw(selectedNode.value)))
|
|
|
+ );
|
|
|
+ cancel();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!', fields)
|
|
|
+ }
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
const cancel = () => {
|
|
@@ -165,6 +162,7 @@ const testGetCurrentData = () => {
|
|
|
class="demo-ruleForm"
|
|
|
:size="formSize"
|
|
|
status-icon
|
|
|
+ :rules="rules"
|
|
|
v-show="infoVisible"
|
|
|
>
|
|
|
<el-form-item label="节点名称" prop="name">
|
|
@@ -229,7 +227,7 @@ const testGetCurrentData = () => {
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="submitForm(ruleFormRef)">
|
|
|
+ <el-button type="primary" @click="submitForm">
|
|
|
保存
|
|
|
</el-button>
|
|
|
<el-button @click="cancel">取消</el-button>
|