diff --git a/cutejava-front/src/utils/elementui/KitMessage.js b/cutejava-front/src/utils/elementui/KitMessage.js index 68710f85..5b64544f 100644 --- a/cutejava-front/src/utils/elementui/KitMessage.js +++ b/cutejava-front/src/utils/elementui/KitMessage.js @@ -3,24 +3,36 @@ import Vue from 'vue' * 消息提示 */ export default { - Info: function(content) { + Info: function(content, duration = 3000) { Vue.prototype.$message({ - message: content, type: 'info' + message: content, + type: 'info', + duration: duration, + showClose: duration <= 0 }) }, - Success: function(content) { + Success: function(content, duration = 3000) { Vue.prototype.$message({ - message: content, type: 'success' + message: content, + type: 'success', + duration: duration, + showClose: duration <= 0 }) }, - Warning: function(content) { + Warning: function(content, duration = 3000) { Vue.prototype.$message({ - message: content, type: 'warning' + message: content, + type: 'warning', + duration: duration, + showClose: duration <= 0 }) }, - Error: function(content) { + Error: function(content, duration = 3000) { Vue.prototype.$message({ - message: content, type: 'error' + message: content, + type: 'error', + duration: duration, + showClose: duration <= 0 }) } } diff --git a/cutejava-front/src/utils/elementui/KitNotification.js b/cutejava-front/src/utils/elementui/KitNotification.js index 0130a44b..73b48e2f 100644 --- a/cutejava-front/src/utils/elementui/KitNotification.js +++ b/cutejava-front/src/utils/elementui/KitNotification.js @@ -4,17 +4,29 @@ import Vue from 'vue' * 通知 */ export default { - Info: function(content) { - Vue.prototype.$notify({ message: content, type: 'info' }) - }, Success: function(content) { - Vue.prototype.$notify({ message: content, type: 'success' }) - }, SuccessDuration: function(content, durationTime) { - Vue.prototype.$notify({ message: content, type: 'success', duration: durationTime }) - }, Warning: function(content) { - Vue.prototype.$notify({ message: content, type: 'warning' }) - }, Error: function(content) { - Vue.prototype.$notify({ message: content, type: 'error' }) - }, ErrorDuration: function(content, durationTime) { - Vue.prototype.$notify({ message: content, type: 'error', duration: durationTime }) + Info: function(content, duration = 3000) { + Vue.prototype.$notify({ + message: content, + type: 'info', + duration: duration + }) + }, Success: function(content, duration = 3000) { + Vue.prototype.$notify({ + message: content, + type: 'success', + duration: duration + }) + }, Warning: function(content, duration = 3000) { + Vue.prototype.$notify({ + message: content, + type: 'warning', + duration: duration + }) + }, Error: function(content, duration = 3000) { + Vue.prototype.$notify({ + message: content, + type: 'error', + duration: duration + }) } } diff --git a/cutejava-front/src/views/components/base/WebSocketDemo.vue b/cutejava-front/src/views/components/base/WebSocketDemo.vue deleted file mode 100644 index 206920ac..00000000 --- a/cutejava-front/src/views/components/base/WebSocketDemo.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/cutejava-front/src/views/components/dev/CuteButton.vue b/cutejava-front/src/views/components/dev/CuteButton.vue index a4e297f5..d4b34080 100644 --- a/cutejava-front/src/views/components/dev/CuteButton.vue +++ b/cutejava-front/src/views/components/dev/CuteButton.vue @@ -24,7 +24,7 @@ export default { props: { type: { type: String, - default: 'primary' + default: 'normal' }, icon: { type: String, @@ -39,40 +39,33 @@ export default { default: false } }, - computed: { - innerType() { - if (this.type) { - if (this.type === 'primary') { - return 'primary' - } - if (this.type === 'secondary') { - return 'primary' - } - if (this.type === 'normal') { - return null - } - if (this.type === 'text') { - return 'text' - } + data() { + return { + innerType: null, + innerPlain: false + } + }, + created() { + if (this.type) { + if (this.type === 'primary') { + this.innerType = 'primary' + this.innerPlain = false + } else if (this.type === 'secondary') { + this.innerType = 'primary' + this.innerPlain = true + } else if (this.type === 'normal') { + this.innerType = null + this.innerPlain = false + } else if (this.type === 'text') { + this.innerType = 'text' + this.innerPlain = false + } else { + this.innerType = null + this.innerPlain = false } - return null - }, - innerPlain() { - if (this.type) { - if (this.type === 'primary') { - return false - } - if (this.type === 'secondary') { - return true - } - if (this.type === 'normal') { - return false - } - if (this.type === 'text') { - return false - } - } - return false + } else { + this.innerType = null + this.innerPlain = false } }, methods: { diff --git a/cutejava-front/src/views/components/dev/CuteLink.vue b/cutejava-front/src/views/components/dev/CuteLink.vue index 25a8253a..aca3807b 100644 --- a/cutejava-front/src/views/components/dev/CuteLink.vue +++ b/cutejava-front/src/views/components/dev/CuteLink.vue @@ -10,6 +10,7 @@ :underline="false" :href="href" target="_blank" + :disabled="disabled" >{{ title }} @@ -27,6 +28,11 @@ export default { type: String, required: true, default: 'https://gitee.com/odboy-tianjun' + }, + disabled: { + type: Boolean, + required: false, + default: false } } } diff --git a/cutejava-front/src/views/componentsDemo/dev/CuteButtonDemo.vue b/cutejava-front/src/views/componentsDemo/dev/CuteButtonDemo.vue new file mode 100644 index 00000000..6d0dc55e --- /dev/null +++ b/cutejava-front/src/views/componentsDemo/dev/CuteButtonDemo.vue @@ -0,0 +1,68 @@ + + + diff --git a/cutejava-front/src/views/componentsDemo/dev/CuteLinkDemo.vue b/cutejava-front/src/views/componentsDemo/dev/CuteLinkDemo.vue new file mode 100644 index 00000000..1382f9e8 --- /dev/null +++ b/cutejava-front/src/views/componentsDemo/dev/CuteLinkDemo.vue @@ -0,0 +1,50 @@ + + + diff --git a/cutejava-front/src/views/componentsDemo/dev/KitDialogDemo.vue b/cutejava-front/src/views/componentsDemo/dev/KitDialogDemo.vue new file mode 100644 index 00000000..bd6c9d57 --- /dev/null +++ b/cutejava-front/src/views/componentsDemo/dev/KitDialogDemo.vue @@ -0,0 +1,79 @@ + + + diff --git a/cutejava-front/src/views/componentsDemo/dev/KitMessageDemo.vue b/cutejava-front/src/views/componentsDemo/dev/KitMessageDemo.vue new file mode 100644 index 00000000..e120b301 --- /dev/null +++ b/cutejava-front/src/views/componentsDemo/dev/KitMessageDemo.vue @@ -0,0 +1,64 @@ + + + diff --git a/cutejava-front/src/views/componentsDemo/dev/KitNotificationDemo.vue b/cutejava-front/src/views/componentsDemo/dev/KitNotificationDemo.vue new file mode 100644 index 00000000..5bb1b9e0 --- /dev/null +++ b/cutejava-front/src/views/componentsDemo/dev/KitNotificationDemo.vue @@ -0,0 +1,68 @@ + + + diff --git a/cutejava-front/src/views/componentsDemo/dev/KitWsClientDemo.vue b/cutejava-front/src/views/componentsDemo/dev/KitWsClientDemo.vue new file mode 100644 index 00000000..46055d67 --- /dev/null +++ b/cutejava-front/src/views/componentsDemo/dev/KitWsClientDemo.vue @@ -0,0 +1,97 @@ + + +