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/layout/components/TagsView/index.vue b/ruoyi-ui/src/layout/components/TagsView/index.vue index 19a20114e..bc6ce188a 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) 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.tag}>` + }, '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 {conf[key]} diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 939472069..955226f02 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