813788fb by renchao@pashanhoo.com

style:系统通知

1 parent 6f68f042
<template>
<dialogBox :title="title" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%"
@closeDialog="closeDialog" v-model="value" :isButton="isButtonFlag">
<el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules">
<el-row>
<el-col :span="24">
......@@ -42,8 +40,11 @@
<div slot="tip" class="el-upload__tip">文件大小不超过20MB</div>
</el-upload>
</div>
<el-form-item v-if="formData.isButtonFlag" class="text-center">
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="submitForm" plain>确定</el-button>
</el-form-item>
</el-form>
</dialogBox>
</template>
<script>
import { addSysNotice, updateSysNotice } from "@/api/system.js";
......@@ -51,9 +52,10 @@ import { upload } from "@/api/system.js";
import { quillEditor } from "vue-quill-editor";
export default {
props: {
value: { type: Boolean, default: false },
isButtonFlag: { type: Boolean, default: true },
title: { type: String, default: '新增系统通知' }
formData: {
type: Object,
default: () => { }
}
},
components: { quillEditor },
data () {
......@@ -113,10 +115,7 @@ export default {
}
};
},
watch: {
value (val) {
if (val) {
let that = this
mounted () {
this.$nextTick(() => {
//创建富文本粘贴事件监听
let quill = this.$refs.myQuillEditor.quill;
......@@ -139,12 +138,12 @@ export default {
}
},
false
);
});
}
)
})
if (this.formData) {
this.getDetailInfo(this.formData)
}
},
mounted () { },
methods: {
submitForm () {
let that = this;
......@@ -156,14 +155,13 @@ export default {
that.addNotice();
}
} else {
// console.log('error submit!!');
return false;
}
});
},
//关闭窗口
closeDialog () {
this.$emit("input", false);
this.$popupCacel()
this.resetRuleForm();
},
//新增通知
......@@ -171,7 +169,7 @@ export default {
addSysNotice(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message.success("保存成功");
this.$emit("input", false);
this.$popupCacel()
this.resetRuleForm();
this.$parent.queryClick();
} else {
......@@ -184,7 +182,7 @@ export default {
updateSysNotice(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message.success("编辑成功");
this.$emit("input", false);
this.$popupCacel()
this.resetRuleForm();
this.$parent.queryClick();
} else {
......@@ -201,7 +199,6 @@ export default {
noticeSource: "",
noticeType: "1"
}
this.isButtonFlag = true;
},
beforeUpload (file) {
return true;
......@@ -239,7 +236,6 @@ export default {
quill.insertEmbed(length, "image", res.message);
// 调整光标到最后
quill.setSelection(length + 1);
//that.quillUpdateImg = false;
});
},
onSubmit () {
......@@ -267,6 +263,7 @@ export default {
</script>
<style scoped lang="scss">
@import "~@/styles/dialogBoxheader.scss";
.quill-editor {
padding: 0;
}
......
......@@ -86,16 +86,10 @@ export default {
//打开新增弹窗
openDialog (item) {
if (item) {
this.$nextTick(() => {
this.isButtonFlag = false;
this.$refs.addDialog.getDetailInfo(item);
this.dialogTitle = '系统通知详情'
})
this.$popupDialog("系统通知详情", "system/xttz/components/addDialog", { ...item, "isButtonFlag": false }, "50%")
} else {
this.isButtonFlag = true;
this.dialogTitle = '新增系统通知'
this.$popupDialog("新增系统通知", "system/xttz/components/addDialog", { "isButtonFlag": true }, "50%")
}
this.isDialog = true;
},
//删除
delNotice (item) {
......