| | |
| | | data() { |
| | | const validateMessageContent = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(new Error('请输入短信内容')); |
| | | callback(new Error('请输入短信内容')) |
| | | } else { |
| | | this.$refs.user.clearValidate('body'); |
| | | callback(); |
| | | } |
| | | } |
| | | return { |
| | |
| | | colList: [{ id: 1, columnName: "验证码模板"}, {id: 2, columnName: "活动模板"}], |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.$refs.edit.editor.txt.html(this.role.body) |
| | | }, |
| | | created() { |
| | | if (this.tableRowData) { |
| | | this.role = deepClone(this.tableRowData); |
| | |
| | | // 新建/保存消息(1:新建,0保存消息) |
| | | handleSubmit() { |
| | | this.role.body = this.$refs.edit.editor.txt.html(); |
| | | this.$refs.user.validate(valid => { |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | if (this.dialogType === 'create') { |
| | | SMS.addNewSMSTemplate(this.role) |
| | |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | } |
| | | |
| | | } else { |
| | | this.$message({ type: 'warning', message: '请检查必填项' }); |
| | | } |