From 669c42795a04709f1be52a45f04a144bb3b85a02 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 3 Oct 2020 17:47:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=9E=8B=E7=BB=84=E4=BB=B6=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/assets/icons/svg/button.svg | 1 + ruoyi-ui/src/utils/generator/config.js | 15 +++++++++++++++ ruoyi-ui/src/utils/generator/html.js | 21 +++++++++++++++++++++ ruoyi-ui/src/utils/generator/render.js | 5 +++++ 4 files changed, 42 insertions(+) create mode 100644 ruoyi-ui/src/assets/icons/svg/button.svg diff --git a/ruoyi-ui/src/assets/icons/svg/button.svg b/ruoyi-ui/src/assets/icons/svg/button.svg new file mode 100644 index 000000000..904fddc85 --- /dev/null +++ b/ruoyi-ui/src/assets/icons/svg/button.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ruoyi-ui/src/utils/generator/config.js b/ruoyi-ui/src/utils/generator/config.js index 471f83879..005140a8f 100644 --- a/ruoyi-ui/src/utils/generator/config.js +++ b/ruoyi-ui/src/utils/generator/config.js @@ -406,6 +406,21 @@ export const layoutComponents = [ layoutTree: true, children: [], document: 'https://element.eleme.cn/#/zh-CN/component/layout' + }, + { + layout: 'colFormItem', + label: '按钮', + changeTag: true, + labelWidth: null, + tag: 'el-button', + tagIcon: 'button', + span: 24, + default: '主要按钮', + type: 'primary', + icon: 'el-icon-search', + size: 'medium', + disabled: false, + document: 'https://element.eleme.cn/#/zh-CN/component/button' } ] diff --git a/ruoyi-ui/src/utils/generator/html.js b/ruoyi-ui/src/utils/generator/html.js index 8362ae4af..340dfb439 100644 --- a/ruoyi-ui/src/utils/generator/html.js +++ b/ruoyi-ui/src/utils/generator/html.js @@ -107,6 +107,18 @@ const layouts = { } const tags = { + 'el-button': el => { + const { + tag, disabled + } = attrBuilder(el) + const type = el.type ? `type="${el.type}"` : '' + const icon = el.icon ? `icon="${el.icon}"` : '' + const size = el.size ? `size="${el.size}"` : '' + let child = buildElButtonChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}` + }, 'el-input': el => { const { disabled, vModel, clearable, placeholder, width @@ -272,6 +284,15 @@ function attrBuilder(el) { } } +// el-buttin 子级 +function buildElButtonChild(conf) { + const children = [] + if (conf.default) { + children.push(conf.default) + } + return children.join('\n') +} + // el-input innerHTML function buildElInputChild(conf) { const children = [] diff --git a/ruoyi-ui/src/utils/generator/render.js b/ruoyi-ui/src/utils/generator/render.js index 42cd6646d..f187029d2 100644 --- a/ruoyi-ui/src/utils/generator/render.js +++ b/ruoyi-ui/src/utils/generator/render.js @@ -26,6 +26,11 @@ function vModel(self, dataObject, defaultValue) { } const componentChild = { + 'el-button': { + default(h, conf, key) { + return conf[key] + }, + }, 'el-input': { prepend(h, conf, key) { return From c19fec2cf8f23b132c292bb783ff7c309b5c5a96 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 3 Oct 2020 20:05:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/system/user/index.vue | 328 +++++++++++++++-------- 1 file changed, 223 insertions(+), 105 deletions(-) diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index f4174e0ab..9a9abc57b 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -4,28 +4,77 @@
- +
- +
- + - + - - + + - + 搜索 @@ -35,19 +84,51 @@ - 新增 + 新增 - 修改 + 修改 - 删除 + 删除 - 导入 + 导入 - 导出 + 导出 @@ -61,7 +142,12 @@ @@ -69,16 +155,46 @@ {{ parseTime(scope.row.createTime) }} - + - + @@ -125,14 +241,23 @@ - + - {{dict.dictLabel}} + {{dict.dictLabel}} @@ -141,14 +266,26 @@ - + - + @@ -169,7 +306,18 @@ - +
将文件拖到此处,或 @@ -190,17 +338,7 @@ \ No newline at end of file From ae4290bdda94767281c1aab0e4a6b5a24e9c89a4 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 3 Oct 2020 20:05:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=89=80=E6=9C=89=E5=9B=BA=E5=AE=9A=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E8=B7=AF=E7=94=B1=E4=B8=8D=E5=88=B7=E6=96=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/layout/components/TagsView/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/layout/components/TagsView/index.vue b/ruoyi-ui/src/layout/components/TagsView/index.vue index 529090a74..dce967cfb 100644 --- a/ruoyi-ui/src/layout/components/TagsView/index.vue +++ b/ruoyi-ui/src/layout/components/TagsView/index.vue @@ -160,7 +160,7 @@ export default { }, closeAllTags(view) { this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { - if (this.affixTags.some(tag => tag.path === view.path)) { + if (this.affixTags.some(tag => tag.path === this.$route.path)) { return } this.toLastView(visitedViews, view)