diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 7cb684f3..1b0d68c1 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -124,9 +124,9 @@ export default { this.Quill = new Quill(editor, this.options); // 取消自动聚焦 start this.$nextTick(() => { - this.Quill.blur(); + this.Quill?.blur(); if (!this.readOnly) { - this.Quill.enable(); + this.Quill?.enable(); } }); // 如果设置了上传地址则自定义图片上传事件 diff --git a/src/views/equipment/base/alarm/Record/AddOrUpdate.vue b/src/views/equipment/base/alarm/Record/AddOrUpdate.vue index 0be0cc0a..660f3aa4 100644 --- a/src/views/equipment/base/alarm/Record/AddOrUpdate.vue +++ b/src/views/equipment/base/alarm/Record/AddOrUpdate.vue @@ -7,27 +7,30 @@ --> @@ -43,6 +46,7 @@ export default { components: { SmallTitle, DialogForm, Editor }, data() { return { + loading: false, orderForm: { id: null, equipment: null, @@ -82,6 +86,9 @@ export default { label: '处理人', prop: 'hander', url: '/base/core-worker/listAll', + bind: { + multiple: true, + }, rules: [ { required: true, message: '类型名称不能为空', trigger: 'blur' }, ], @@ -122,9 +129,14 @@ export default { }; }, mounted() { - this.getDict().then(() => { - this.init(); - }); + this.loading = true; + this.getDict() + .then(() => { + this.init(); + }) + .catch((err) => { + this.loading = false; + }); }, methods: { /** @@ -139,8 +151,9 @@ export default { * 初始化 */ async init() { - this.initTop(); - this.initDown(); + await this.initTop(); + await this.initDown(); + this.loading = false; }, /** @@ -172,16 +185,19 @@ export default { this.$msgError('缺少报警日志id'); this.$emit('close'); } - const url = '/base/equipment-alarm-hand/get'; + const url = '/base/equipment-alarm-hand/page'; // 经沟通,此处采用page接口的第一个返回值 const { data, code } = await this.$axios({ url: url, method: 'get', params: { - id: this.logId, + logId: this.logId, }, }); if (code == 0) { - this.handleMethodForm = data; + this.handleMethodForm = { + ...data.list[0], + hander: data.list[0]?.hander?.split(',') || '', + }; } }, @@ -213,7 +229,11 @@ export default { const { code, data } = await this.$axios({ url: url + (this.handleMethodForm.id ? '/update' : '/create'), method: this.handleMethodForm.id ? 'put' : 'post', - data: { ...this.handleMethodForm, logId: this.logId }, + data: { + ...this.handleMethodForm, + hander: this.handleMethodForm.hander?.join(',') || '', + logId: this.logId, + }, }); if (code == 0) { return true;