| | |
| | | </el-form-item> |
| | | <!-- 消息内容 --> |
| | | <el-form-item class="optionItem" label="消息内容:" prop="body"> |
| | | <MyEditor ref="edit" @getMyBody="getMyBody"></MyEditor> |
| | | <MyEditor ref="edit"></MyEditor> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <div class="optionBtn"> |
| | | <el-button messageType="primary" @click.native.prevent="handleSubmit(1)" class="btn submit">发布</el-button> |
| | | <el-button type="primary" @click.native.prevent="handleSubmit(1)" class="btn submit">发布</el-button> |
| | | <el-button class="btn cancel" @click.native.prevent="handleReset">重置</el-button> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | callback(); |
| | | } |
| | | } |
| | | |
| | | return { |
| | | role: { |
| | | messageType: '', |
| | |
| | | targetTo: '', |
| | | targetFrom: null, |
| | | body: '', |
| | | channelCode: '03' |
| | | channelCode: '02' |
| | | }, |
| | | rules: { |
| | | messageType: [ |
| | |
| | | }, |
| | | // 新建/保存消息(1:新建,0保存消息) |
| | | handleSubmit(mystatus) { |
| | | this.$refs.user.validate((valid) => { |
| | | this.role.body = this.$refs.edit.editor.txt.html(); |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | const params = Object.assign({}, this.role); |
| | | params.targetTo = this.checkedList.join(','); |
| | |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | } else { |
| | | return false; |
| | | this.$message.warning('请检查必填项'); |
| | | } |
| | | }) |
| | | }, |
| | | // 获得消息体 |
| | | getMyBody(obj) { |
| | | this.role.body = obj; |
| | | }, |
| | | // 重置表单 |
| | | handleReset() { |
| | |
| | | this.role.targetFrom = res.data.userId |
| | | this.sendUser = res.data.username |
| | | }) |
| | | }, |
| | | // 消息预览 |
| | | handleView() { |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | this.dialogView = true; |
| | | this.info = { |
| | | messageType: this.getColText(role.messageType), |
| | | body: this.role.body, |
| | | head: this.role.head, |
| | | targetTo: this.tempNameArr, |
| | | targetFrom: this.sendUser |
| | | }; |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | // 获得栏目消息 |
| | | getColText(id){ |
| | | const {colList} = this |
| | | let str = '' |
| | | colList.forEach(item=>{ |
| | | item.id === id ? str = item.columnName : '' |
| | | }) |
| | | return str |
| | | } |
| | | }, |
| | | props: ['closeMyDialog'] |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |