| | |
| | | components: { |
| | | ProcessModalForm |
| | | }, |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | |
| | | visible: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | /** |
| | | * 创建 |
| | | * @param modalTitle |
| | | */ |
| | | handleComponentAddRelative(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | edit(record) { |
| | | |
| | | handleProcessAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(record) |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | |
| | | handlePartsAddRelative(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | |
| | | handleProcessEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | }) |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |