From 5ef170f4336f8c0506e18ef3e8ba53d76b1dbb36 Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Wed, 9 Mar 2022 19:39:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=B6=88=E6=81=AF=E8=A7=84?= =?UTF-8?q?=E8=8C=83=20sxm=202022-3-8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/element-ui/index.js | 20 ++++++++----------- .../yieldReport/otherReport/defectList.vue | 6 +----- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/element-ui/index.js b/src/element-ui/index.js index e89d736..4d1b5c5 100644 --- a/src/element-ui/index.js +++ b/src/element-ui/index.js @@ -1,6 +1,7 @@ import Vue from 'vue'; import Element from 'element-ui'; -Vue.use(Element, { size: 'small', zIndex: 1000 }); + +Vue.use(Element, {size: 'small', zIndex: 1000}); import { Pagination, Dialog, @@ -144,14 +145,13 @@ Vue.prototype.$prompt = MessageBox.prompt; Vue.prototype.$notify = Notification; Vue.prototype.$message = Message; -Vue.prototype.$ELEMENT = { size: 'medium' } +Vue.prototype.$ELEMENT = {size: 'medium'} Vue.prototype.$message = function (msg) { - //根据msg对象中的type类型判断消息提示的类型 let msgObj = { message: msg.message ? msg.message : msg, - duration: 3000 + duration: 2000 } let msgType = msg.type || "" switch (msgType) { @@ -169,32 +169,28 @@ Vue.prototype.$message = function (msg) { default: return Message(msgObj); - } } -//分别对success、warning ,error info等样式进行设置 + Vue.prototype.$message.success = function (msg) { return Message.success({ message: msg, duration: 1000 }) } + Vue.prototype.$message.warning = function (msg) { return Message.warning({ message: msg, duration: 1000 }) } + Vue.prototype.$message.error = function (msg) { return Message.error({ message: msg, duration: 1500 }) } -Vue.prototype.$message.info = function (msg) { - return Message.info({ - message: msg, - duration: 1000 - }) -} + diff --git a/src/views/modules/yieldReport/otherReport/defectList.vue b/src/views/modules/yieldReport/otherReport/defectList.vue index 16aa932..e77d9f0 100644 --- a/src/views/modules/yieldReport/otherReport/defectList.vue +++ b/src/views/modules/yieldReport/otherReport/defectList.vue @@ -180,11 +180,7 @@ export default { }).filter( item => item.defectQty>0 ) saveSfdcDefectList(data).then(({data}) =>{ if (data.code==0){ - this.$message.success( - { - message:data.msg, - duration:1000 - }) + this.$message.success(data.msg) this.visible = false this.$emit('getSfdcDefectList') }else{