b3da6486 by 任超

style:通知

1 parent 4521af90
...@@ -4,13 +4,23 @@ ...@@ -4,13 +4,23 @@
4 aria-modal="true" :aria-label="title || 'dialog'"> 4 aria-modal="true" :aria-label="title || 'dialog'">
5 <div class="el-message-box" :class="[customClass, center && 'el-message-box--center']"> 5 <div class="el-message-box" :class="[customClass, center && 'el-message-box--center']">
6 <div class="el-message-box__content"> 6 <div class="el-message-box__content">
7 <div class="el-message-box__container">
8 <p v-if="title !== null">{{ title }}</p>
9 <div class="el-message-box__message" v-if="message !== ''">
7 <slot> 10 <slot>
8 <p>{{ message }}</p> 11 <p v-html="message"></p>
9 </slot> 12 </slot>
10 </div> 13 </div>
14 <div class="postscript">
15
16 <el-button type="text">下载</el-button>
17 </div>
18 </div>
19 </div>
11 <div class="el-message-box__btns"> 20 <div class="el-message-box__btns">
12 <el-button :loading="cancelButtonLoading" :class="[cancelButtonClasses]" :round="roundButton" size="small" 21 <el-button :loading="cancelButtonLoading" :class="[cancelButtonClasses]" v-if="showCancelButton"
13 @click.native="handleAction('cancel')" @keydown.enter="handleAction('cancel')"> 22 :round="roundButton" size="small" @click.native="handleAction('cancel')"
23 @keydown.enter="handleAction('cancel')">
14 {{ cancelButtonText || t('el.messagebox.cancel') }} 24 {{ cancelButtonText || t('el.messagebox.cancel') }}
15 </el-button> 25 </el-button>
16 </div> 26 </div>
...@@ -22,6 +32,8 @@ ...@@ -22,6 +32,8 @@
22 <script type="text/babel"> 32 <script type="text/babel">
23 import Popup from 'element-ui/src/utils/popup'; 33 import Popup from 'element-ui/src/utils/popup';
24 import Locale from 'element-ui/src/mixins/locale'; 34 import Locale from 'element-ui/src/mixins/locale';
35 import ElInput from 'element-ui/packages/input';
36 import ElButton from 'element-ui/packages/button';
25 import { addClass, removeClass } from 'element-ui/src/utils/dom'; 37 import { addClass, removeClass } from 'element-ui/src/utils/dom';
26 import { t } from 'element-ui/src/locale'; 38 import { t } from 'element-ui/src/locale';
27 import Dialog from 'element-ui/src/utils/aria-dialog'; 39 import Dialog from 'element-ui/src/utils/aria-dialog';
...@@ -36,6 +48,7 @@ let typeMap = { ...@@ -36,6 +48,7 @@ let typeMap = {
36 48
37 export default { 49 export default {
38 mixins: [Popup, Locale], 50 mixins: [Popup, Locale],
51
39 props: { 52 props: {
40 modal: { 53 modal: {
41 default: true 54 default: true
...@@ -65,6 +78,12 @@ export default { ...@@ -65,6 +78,12 @@ export default {
65 type: Boolean 78 type: Boolean
66 } 79 }
67 }, 80 },
81
82 components: {
83 ElInput,
84 ElButton
85 },
86
68 computed: { 87 computed: {
69 icon () { 88 icon () {
70 const { type, iconClass } = this; 89 const { type, iconClass } = this;
...@@ -186,6 +205,11 @@ export default { ...@@ -186,6 +205,11 @@ export default {
186 visible (val) { 205 visible (val) {
187 if (val) { 206 if (val) {
188 this.uid++; 207 this.uid++;
208 if (this.$type === 'alert' || this.$type === 'confirm') {
209 this.$nextTick(() => {
210 this.$refs.confirm.$el.focus();
211 });
212 }
189 this.focusAfterClosed = document.activeElement; 213 this.focusAfterClosed = document.activeElement;
190 messageBox = new Dialog(this.$el, this.focusAfterClosed, this.getFirstFocus()); 214 messageBox = new Dialog(this.$el, this.focusAfterClosed, this.getFirstFocus());
191 } 215 }
...@@ -257,17 +281,3 @@ export default { ...@@ -257,17 +281,3 @@ export default {
257 } 281 }
258 }; 282 };
259 </script> 283 </script>
260 <style scoped lang="scss">
261 .el-message-box__wrapper {
262 background: none;
263 }
264
265 .el-message-box {
266 border: none;
267 }
268
269 .el-message-box__content {
270 min-height: 150px;
271 padding-top: 30px;
272 }
273 </style>
......
...@@ -325,8 +325,7 @@ aside { ...@@ -325,8 +325,7 @@ aside {
325 } 325 }
326 326
327 .allow, 327 .allow,
328 .prohibit 328 .prohibit .suspend {
329 .suspend {
330 position: relative; 329 position: relative;
331 margin: 0 auto; 330 margin: 0 auto;
332 text-align: left; 331 text-align: left;
...@@ -380,6 +379,7 @@ aside { ...@@ -380,6 +379,7 @@ aside {
380 height: 5px; 379 height: 5px;
381 border-radius: 50%; 380 border-radius: 50%;
382 } 381 }
382
383 //错误日志样式 后期超优化 383 //错误日志样式 后期超优化
384 .item-cwnr { 384 .item-cwnr {
385 white-space: pre-wrap; 385 white-space: pre-wrap;
...@@ -390,3 +390,7 @@ aside { ...@@ -390,3 +390,7 @@ aside {
390 -webkit-line-clamp: 3; 390 -webkit-line-clamp: 3;
391 -webkit-box-orient: vertical; 391 -webkit-box-orient: vertical;
392 } 392 }
393
394 .item-cwnr img {
395 height: 30px;
396 }
...\ No newline at end of file ...\ No newline at end of file
......
1 <template> 1 <template>
2 <dialogBox 2 <dialogBox title="新增系统通知" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%"
3 title="新增系统通知" 3 @closeDialog="closeDialog" v-model="value">
4 @submitForm="submitForm"
5 saveButton="保存"
6 :isFullscreen="false"
7 width="60%"
8 @closeDialog="closeDialog"
9 v-model="value"
10 >
11 <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules"> 4 <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules">
12 <el-row> 5 <el-row>
13 <el-col :span="12"> 6 <el-col :span="24">
14 <el-form-item label="通知标题:" prop="noticeTitle"> 7 <el-form-item label="通知标题:" prop="noticeTitle">
15 <el-input v-model="ruleForm.noticeTitle"></el-input> 8 <el-input v-model="ruleForm.noticeTitle" class="width100"></el-input>
16 </el-form-item> 9 </el-form-item>
17 </el-col> 10 </el-col>
18 </el-row> 11 </el-row>
19 <el-row> 12 <el-row>
20 <el-col :span="12"> 13 <el-col :span="24">
21 <el-form-item label="通知来源:" prop="noticeSource"> 14 <el-form-item label="通知来源:" prop="noticeSource">
22 <el-input v-model="ruleForm.noticeSource"></el-input> 15 <el-input v-model="ruleForm.noticeSource" class="width100"></el-input>
23 </el-form-item> 16 </el-form-item>
24 </el-col> 17 </el-col>
25 </el-row> 18 </el-row>
26 <el-row> 19 <el-row>
27 <el-col :span="24">
28 <el-form-item label="通知内容:" prop="noticeContent"> 20 <el-form-item label="通知内容:" prop="noticeContent">
29 <quill-editor 21 <quill-editor v-model="ruleForm.noticeContent" class="editor ql-editor" ref="myQuillEditor"
30 v-model="ruleForm.noticeContent" 22 :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
31 class="editor ql-editor" 23 @change="onEditorChange($event)" @ready="onEditorReady($event)"></quill-editor>
32 ref="myQuillEditor"
33 :options="editorOption"
34 @blur="onEditorBlur($event)"
35 @focus="onEditorFocus($event)"
36 @change="onEditorChange($event)"
37 @ready="onEditorReady($event)"
38 ></quill-editor>
39 <!-- <el-input v-model="ruleForm.noticeContent" type="textarea" :rows="16"></el-input> -->
40 </el-form-item> 24 </el-form-item>
41 </el-col>
42 </el-row> 25 </el-row>
43 <el-row> 26 <el-row>
44 <el-col :span="8"> 27 <el-col :span="8">
45 <el-form-item label="附件:" prop="noticeFileUrl"> 28 <el-form-item label="附件:" prop="noticeFileUrl">
46 <el-upload 29 <el-upload action multiple :auto-upload="false" :limit="1" :on-change="handleChange"
47 action 30 :before-upload="beforeUpload">
48 multiple
49 :auto-upload="false"
50 :limit="1"
51 :on-change="handleChange"
52 :before-upload="beforeUpload"
53 >
54 <el-button icon="el-icon-upload" type="primary">上传</el-button> 31 <el-button icon="el-icon-upload" type="primary">上传</el-button>
55 <div slot="tip" class="el-upload__tip">文件大小不超过20MB</div> 32 <div slot="tip" class="el-upload__tip">文件大小不超过20MB</div>
56 </el-upload> 33 </el-upload>
...@@ -58,14 +35,8 @@ ...@@ -58,14 +35,8 @@
58 </el-col> 35 </el-col>
59 </el-row> 36 </el-row>
60 <div v-show="false"> 37 <div v-show="false">
61 <el-upload 38 <el-upload action multiple :auto-upload="false" :on-change="RichTexthandleChange" :before-upload="beforeUpload"
62 action 39 class="richUpload">
63 multiple
64 :auto-upload="false"
65 :on-change="RichTexthandleChange"
66 :before-upload="beforeUpload"
67 class="richUpload"
68 >
69 <el-button icon="el-icon-upload" type="primary">上传</el-button> 40 <el-button icon="el-icon-upload" type="primary">上传</el-button>
70 <div slot="tip" class="el-upload__tip">文件大小不超过20MB</div> 41 <div slot="tip" class="el-upload__tip">文件大小不超过20MB</div>
71 </el-upload> 42 </el-upload>
...@@ -83,7 +54,7 @@ export default { ...@@ -83,7 +54,7 @@ export default {
83 value: { type: Boolean, default: false } 54 value: { type: Boolean, default: false }
84 }, 55 },
85 components: { quillEditor }, 56 components: { quillEditor },
86 data() { 57 data () {
87 return { 58 return {
88 ruleForm: { 59 ruleForm: {
89 noticeTitle: "", 60 noticeTitle: "",
...@@ -125,7 +96,7 @@ export default { ...@@ -125,7 +96,7 @@ export default {
125 ["image", "video"] // 链接、图片、视频 96 ["image", "video"] // 链接、图片、视频
126 ], 97 ],
127 handlers: { 98 handlers: {
128 image: function(value) { 99 image: function (value) {
129 if (value) { 100 if (value) {
130 // 用upload的点击事件代替文本编辑器的图片上传事件 101 // 用upload的点击事件代替文本编辑器的图片上传事件
131 document.querySelector(".richUpload input").click(); 102 document.querySelector(".richUpload input").click();
...@@ -141,7 +112,7 @@ export default { ...@@ -141,7 +112,7 @@ export default {
141 }; 112 };
142 }, 113 },
143 watch: { 114 watch: {
144 value(val) { 115 value (val) {
145 if (val) { 116 if (val) {
146 let that = this 117 let that = this
147 this.$nextTick(() => { 118 this.$nextTick(() => {
...@@ -170,9 +141,9 @@ export default { ...@@ -170,9 +141,9 @@ export default {
170 } 141 }
171 } 142 }
172 }, 143 },
173 mounted() {}, 144 mounted () { },
174 methods: { 145 methods: {
175 submitForm() { 146 submitForm () {
176 let that = this; 147 let that = this;
177 that.$refs.ruleForm.validate(valid => { 148 that.$refs.ruleForm.validate(valid => {
178 if (valid) { 149 if (valid) {
...@@ -193,20 +164,20 @@ export default { ...@@ -193,20 +164,20 @@ export default {
193 }); 164 });
194 }, 165 },
195 //关闭窗口 166 //关闭窗口
196 closeDialog() { 167 closeDialog () {
197 this.$emit("input", false); 168 this.$emit("input", false);
198 this.resetRuleForm(); 169 this.resetRuleForm();
199 }, 170 },
200 // 171 //
201 resetRuleForm() { 172 resetRuleForm () {
202 this.$refs["ruleForm"].resetFields(); 173 this.$refs["ruleForm"].resetFields();
203 this.ruleForm.noticeType = "1"; 174 this.ruleForm.noticeType = "1";
204 }, 175 },
205 beforeUpload(file) { 176 beforeUpload (file) {
206 return true; 177 return true;
207 }, 178 },
208 //附件上传事件 179 //附件上传事件
209 async handleChange(file) { 180 async handleChange (file) {
210 var formdata = new FormData(); 181 var formdata = new FormData();
211 formdata.append("file", file.raw); 182 formdata.append("file", file.raw);
212 upload(formdata).then(res => { 183 upload(formdata).then(res => {
...@@ -214,14 +185,14 @@ export default { ...@@ -214,14 +185,14 @@ export default {
214 }); 185 });
215 }, 186 },
216 //富文本图片上传事件 187 //富文本图片上传事件
217 RichTexthandleChange(file) { 188 RichTexthandleChange (file) {
218 this.uploadPicture(file.raw) 189 this.uploadPicture(file.raw)
219 }, 190 },
220 //图片粘贴事件 191 //图片粘贴事件
221 clipboardPictureChange(file) { 192 clipboardPictureChange (file) {
222 this.uploadPicture(file) 193 this.uploadPicture(file)
223 }, 194 },
224 uploadPicture(file){ 195 uploadPicture (file) {
225 let that = this; 196 let that = this;
226 var formdata = new FormData(); 197 var formdata = new FormData();
227 formdata.append("file", file); 198 formdata.append("file", file);
...@@ -238,23 +209,23 @@ export default { ...@@ -238,23 +209,23 @@ export default {
238 //that.quillUpdateImg = false; 209 //that.quillUpdateImg = false;
239 }); 210 });
240 }, 211 },
241 onSubmit() { 212 onSubmit () {
242 //console.log("submit!"); 213 //console.log("submit!");
243 }, 214 },
244 // 失去焦点事件 215 // 失去焦点事件
245 onEditorBlur(quill) { 216 onEditorBlur (quill) {
246 //console.log("editor blur!", quill); 217 //console.log("editor blur!", quill);
247 }, 218 },
248 // 获得焦点事件 219 // 获得焦点事件
249 onEditorFocus(quill) { 220 onEditorFocus (quill) {
250 //console.log("editor focus!", quill); 221 //console.log("editor focus!", quill);
251 }, 222 },
252 // 准备富文本编辑器 223 // 准备富文本编辑器
253 onEditorReady(quill) { 224 onEditorReady (quill) {
254 //console.log("editor ready!", quill); 225 //console.log("editor ready!", quill);
255 }, 226 },
256 // 内容改变事件 227 // 内容改变事件
257 onEditorChange({ quill, html, text }) { 228 onEditorChange ({ quill, html, text }) {
258 //console.log("editor change!", quill, html, text); 229 //console.log("editor change!", quill, html, text);
259 //this.content = html; 230 //this.content = html;
260 } 231 }
...@@ -262,11 +233,18 @@ export default { ...@@ -262,11 +233,18 @@ export default {
262 }; 233 };
263 </script> 234 </script>
264 <style scoped lang="scss"> 235 <style scoped lang="scss">
265 // .ql-editor{ 236 .quill-editor {
266 // height:500px; 237 padding: 0;
267 // } 238 }
268 /deep/.ql-editor { 239
269 padding: 0px; 240 .ql-editor {
270 height: 500px; 241 height: auto !important;
242 }
243
244 /deep/.ql-container {
245 padding: 0;
246 max-height: 400px;
247 min-height: 160px;
248 overflow-y: scroll;
271 } 249 }
272 </style> 250 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -9,14 +9,9 @@ ...@@ -9,14 +9,9 @@
9 <el-row :gutter="8"> 9 <el-row :gutter="8">
10 <el-col :span="24" class="margin-top-middle"> 10 <el-col :span="24" class="margin-top-middle">
11 通知内容: 11 通知内容:
12 <!-- <span v-html="formData.item.noticeContent"></span> --> 12 <quill-editor class="ql-editor" v-model="formData.item.noticeContent" ref="myQuillEditor"
13 <quill-editor class="ql-editor" 13 :options="editorOption">
14 v-model="formData.item.noticeContent"
15 ref="myQuillEditor"
16 :options="editorOption"
17 >
18 </quill-editor> 14 </quill-editor>
19 <!-- <el-input type="textarea" :rows="20" v-model="formData.item.noticeContent"></el-input> -->
20 </el-col> 15 </el-col>
21 </el-row> 16 </el-row>
22 <el-row :gutter="8"> 17 <el-row :gutter="8">
...@@ -63,6 +58,7 @@ export default { ...@@ -63,6 +58,7 @@ export default {
63 .margin-top-middle { 58 .margin-top-middle {
64 margin-top: 10px 59 margin-top: 10px
65 } 60 }
61
66 /deep/.ql-editor { 62 /deep/.ql-editor {
67 padding: 0px; 63 padding: 0px;
68 } 64 }
......
...@@ -53,6 +53,7 @@ export default { ...@@ -53,6 +53,7 @@ export default {
53 return { 53 return {
54 isDialog: false, 54 isDialog: false,
55 viewDialog: false, 55 viewDialog: false,
56
56 ruleForm: { 57 ruleForm: {
57 noticeTitle: '', 58 noticeTitle: '',
58 noticeStatus: '' 59 noticeStatus: ''
......
...@@ -28,7 +28,7 @@ class data extends filter { ...@@ -28,7 +28,7 @@ class data extends filter {
28 { 28 {
29 label: "通知内容", 29 label: "通知内容",
30 render: (h, scope) => { 30 render: (h, scope) => {
31 return <div class="item-cwnr">{scope.row.noticeContent}</div> 31 return <div class="item-cwnr" domPropsInnerHTML={scope.row.noticeContent}></div>
32 } 32 }
33 }, 33 },
34 { 34 {
......