This commit is contained in:
lb
2023-11-28 15:46:50 +08:00
parent 57deff3875
commit 7201c26792
12 changed files with 760 additions and 275 deletions

View File

@@ -62,6 +62,16 @@
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
<el-row slot="footer">
<el-button size="small" @click="cancel">取消</el-button>
<el-button
type="primary"
size="small"
@click="submitForm"
:loading="btnLoading">
确定
</el-button>
</el-row>
</base-dialog>
</section>
</template>
@@ -102,7 +112,9 @@ export default {
input: true,
label: '工序名称',
prop: 'name',
rules: [{ required: true, message: '工序名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '工序名称不能为空', trigger: 'blur' },
],
},
],
[
@@ -111,7 +123,9 @@ export default {
label: '工段',
prop: 'sectionId',
url: '/base/core-workshop-section/listAll',
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '工段不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@@ -139,6 +153,7 @@ export default {
},
currentDet: null,
currentNode: null,
btnLoading: false
};
},
watch: {
@@ -221,7 +236,7 @@ export default {
node.attr('container/stroke', '#0b58ff');
const { detId, detName, detDesc, processId, sectionId, sectionName } =
node.attrs;
console.log('node clicked!', node)
console.log('node clicked!', node);
this.currentDet = {};
this.$set(this.currentDet, 'detId', detId?.text);
this.$set(this.currentDet, 'sectionId', sectionId?.text);
@@ -354,6 +369,7 @@ export default {
},
handleEdit() {
console.log('edit: ', this.currentDet);
this.form.name = this.currentDet.detName;
this.form.sectionId = this.currentDet.sectionId;
this.form.remark = this.currentDet.detDesc;
@@ -379,6 +395,7 @@ export default {
if (!valid) {
return;
}
this.btnLoading = true;
// 修改的提交
if (this.form.id != null) {
this.updateProcess()
@@ -392,9 +409,20 @@ export default {
sectionName: { text: sectionName },
detDesc: { text: remark },
});
// 修改currentDet
this.currentDet = {
...this.currentDet,
detName: name,
sectionId: sectionId,
sectionName: sectionName,
detDesc: remark,
};
this.btnLoading = false;
});
})
.catch((err) => {});
.catch((err) => {
this.btnLoading = false;
});
return;
}
@@ -412,11 +440,14 @@ export default {
.then((node) => {
if (!node) {
this.$modal.msgError('创建节点失败');
this.btnLoading = false;
return;
}
this.btnLoading = false;
this.graph.addNode(node);
})
.catch((err) => {
this.btnLoading = false;
return;
});
});