| | |
| | | return { |
| | | title: '', |
| | | width: 500, |
| | | visible: false |
| | | visible: false, |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleProductAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | /** |
| | | * 添加产品 |
| | | */ |
| | | handleProductAdd() { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | handleProductEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | |
| | | /** |
| | | * 编辑产品信息 |
| | | */ |
| | | handleProductEdit() { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | this.$refs.realForm.edit({ id: this.currentTreeNodeInfo.id, ...this.currentTreeNodeInfo.entity }) |
| | | }) |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.$emit('submitSuccess') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | if (this[methodName]) { |
| | | this[methodName](modalTitle) |
| | | this.title = modalTitle |
| | | } |
| | | } |
| | | } |
| | | } |