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 @@ - - - - - 连接 - 发送 - 关闭 - - 返回内容 - {{ responseTxt }} - - - - 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 @@ + + + 何时使用 + + 触发提交/执行某个操作 + 页面内主、次操作之间需要明确的视觉层级(primary/secondary/normal/text) + 在使用过程中有任何问题,咨询 @Odboy(前端) + + 基础用法 + + 默认按钮 + 主要按钮 + 次要按钮 + 普通按钮 + 文字按钮 + + 禁用状态 + + 默认按钮 + 主要按钮 + 次要按钮 + 普通按钮 + 文字按钮 + + Loading状态 + + 默认按钮 + 主要按钮 + 次要按钮 + 普通按钮 + 文字按钮 + + API + + + + + + + + + + + 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 @@ + + + 何时使用 + + 文字链接等 + 需要另起页面,不在当前页面打开 + 在使用过程中有任何问题,咨询 @Odboy(前端) + + 基础用法 + + + + 禁用状态 + + + + API + + + + + + + + + + + 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 @@ + + + 何时使用 + + 不离开当前场景完成增删改操作 + 需要确认用户的操作,明确操作会产生的结果,提醒告知用户 + 作为配置型功能及信息的容器 + 在使用过程中有任何问题,咨询 @Odboy(前端)@Odboy(设计) + + 基础用法 + + 删除确认框 + 删除确认框(自定义提示) + 确认内容消息框 + 数据输入对话框 + + 快捷调用 + + + + + + + + + + + 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 @@ + + + 何时使用 + + 当需要向用户展示操作结果时,如成功、失败、警告等状态反馈 + 系统级公告,全局类警示提示,模块类状态反馈(成功、警告、错误等) + 在使用过程中有任何问题,咨询 @Odboy(前端) + + 基础用法 + + Info 提示 + Warning 提示 + Success 提示 + Error 提示 + + 快捷调用 + + + + + + + + + + + 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 @@ + + + 何时使用 + 在系统四个角显示通知提醒信息。经常用于以下情况 + + 较为复杂的通知内容 + 带有交互的通知,给出用户下一步的行动点 + 系统主动推送 + 当需要向用户展示重要信息但又不希望打断用户当前操作时 + 当需要同时展示多个不同类型的通知信息时 + 在使用过程中有任何问题,咨询 @Odboy(前端) + + 基础用法 + + Info 通知 + Warning 通知 + Success 通知 + Error 通知 + + 快捷调用 + + + + + + + + + + + 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 @@ + + + 何时使用 + + 实时与服务器进行数据交互 + 服务器主动推送数据给客户端 + 在使用过程中有任何问题,咨询 @Odboy(前端) @Odboy(设计) @Odboy(后端) + + 基础用法 + + + 连接 + + 发送 + 关闭 + + 返回内容 + {{ responseTxt }} + + 快捷调用 + + + + + + + + + + +