From 605c0bc1841d271dda1c533f86d2ffd913bfb933 Mon Sep 17 00:00:00 2001 From: jlzhou <12020042@qq.com> Date: Tue, 25 Mar 2025 17:06:49 +0800 Subject: [PATCH] update . --- bi-ui/src/components/global/WLogo.vue | 11 +- bi-ui/src/components/global/WTag.vue | 100 ++++++++++++++ bi-ui/src/components/global/WTagSelect.vue | 46 +++++++ bi-ui/src/components/global/WTags.vue | 28 ++++ bi-ui/src/pages/test/components.vue | 127 +++++++++++++++++- bi-ui/src/store/index.js | 1 + bi-ui/src/store/modules/dict.js | 85 ++++++++++++ .../test/java/com/ruoyi/MongoGenerator.java | 11 +- .../src/test/resources/generator/api.js.vm | 33 +++++ .../src/test/resources/generator/api.vm | 30 ++++- .../src/test/resources/generator/index.vue.vm | 3 +- 11 files changed, 459 insertions(+), 16 deletions(-) create mode 100644 bi-ui/src/components/global/WTag.vue create mode 100644 bi-ui/src/components/global/WTagSelect.vue create mode 100644 bi-ui/src/components/global/WTags.vue create mode 100644 bi-ui/src/store/modules/dict.js diff --git a/bi-ui/src/components/global/WLogo.vue b/bi-ui/src/components/global/WLogo.vue index 6b5b732..eb9189a 100644 --- a/bi-ui/src/components/global/WLogo.vue +++ b/bi-ui/src/components/global/WLogo.vue @@ -9,9 +9,10 @@ const poStore = usePoStore() .logo { background-repeat: no-repeat; height: 100%; - width: 30em; - background-size: auto 7.2em; - background-position: 0 1em; + width: 100%; + background-size: auto 7em; + background-position: center; + background-origin: content-box; &.logo0 { @@ -26,14 +27,14 @@ const poStore = usePoStore() background-image: url(@/assets/imgs/logo1.png), url(@/assets/imgs/logo2.png); background-repeat: no-repeat, no-repeat; background-size: auto 4.6em, auto 4.6em; - background-position: 1.5em bottom, 0 top; + background-position: center bottom, center top; } &.logo3 { background-image: url(@/assets/imgs/logo1.png), url(@/assets/imgs/logo2.png); background-repeat: no-repeat, no-repeat; background-size: auto 4.6em, auto 4.6em; - background-position: 1.5em top, 0 bottom; + background-position: center top, center bottom; } diff --git a/bi-ui/src/components/global/WTag.vue b/bi-ui/src/components/global/WTag.vue new file mode 100644 index 0000000..c33cba8 --- /dev/null +++ b/bi-ui/src/components/global/WTag.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/bi-ui/src/components/global/WTagSelect.vue b/bi-ui/src/components/global/WTagSelect.vue new file mode 100644 index 0000000..38030d1 --- /dev/null +++ b/bi-ui/src/components/global/WTagSelect.vue @@ -0,0 +1,46 @@ + + + + + \ No newline at end of file diff --git a/bi-ui/src/components/global/WTags.vue b/bi-ui/src/components/global/WTags.vue new file mode 100644 index 0000000..4a69be2 --- /dev/null +++ b/bi-ui/src/components/global/WTags.vue @@ -0,0 +1,28 @@ + + + diff --git a/bi-ui/src/pages/test/components.vue b/bi-ui/src/pages/test/components.vue index ac20e83..98ea5d1 100644 --- a/bi-ui/src/pages/test/components.vue +++ b/bi-ui/src/pages/test/components.vue @@ -485,6 +485,103 @@ const emRef3 = proxy.$refs.emRef3; + +

字典显示组件: w-tag

+
操作类型(sys_oper_type):
+
其他设置: + + +
+
使用插槽: + + +
+ {{ `
操作类型(sys_oper_type):
+
其他设置: + + +
+
使用插槽: + + +
` }}
+

参数说明

+
    +
  1. name: 必填,字典类型
  2. +
  3. value: 必填,字典值,Number,String
  4. +
  5. border: 是否显示边框
  6. +
  7. --margin: CSS变量,外边距,可以直接使用margin
  8. +
  9. --color: 颜色,优先,可以直接使用color
  10. +
  11. 插槽(default): dict
  12. +
+ +

字典列表显示组件: w-tags

+
操作类型(sys_oper_type):
+
操作类型(sys_oper_type):
+
操作类型(sys_oper_type): + +
+ {{ `
操作类型(sys_oper_type):
+
操作类型(sys_oper_type):
+
操作类型(sys_oper_type): + +
` }}
+ +

参数说明

+
    +
  1. name: 必填,字典类型
  2. +
  3. border: 是否显示边框
  4. +
  5. --margin: CSS变量,需要父元素设定
  6. +
  7. --color: 颜色,优先,需要父元素设定
  8. +
  9. 插槽(default): dict,index
  10. +
+ +

下拉选择组件: w-tag-select

+ {{ tag1 }} + {{ tag2 }} + + {{ ` \{\{ tag1 \}\} + \{\{ tag2 \}\}` }} + +

参数说明

+
    +
  1. name: 必填,字典类型
  2. +
  3. 说明: 本组使用el-select进行简单封装,复杂应用请使用字典数据仓库完成
  4. +
  5. 可以使用的el-select属性:clearable,size,placeholder,disabled
  6. +
+

字典数据仓库

+ {{ ` import { useDictStore } from '@/store'; + const dictStore = useDictStore();` }} + +
获取列表: dictStore.list('sys_oper_type')
+
{{ JSON.stringify(dictStore.list('sys_oper_type'),null,2) }}
+
获取单个: dictStore.get('sys_oper_type',1)
+
{{ JSON.stringify(dictStore.get('sys_oper_type',1),null,2) }}
+
同步获取列表: dictStore.listAsync('sys_oper_type')
+ {{ ` const dictList = ref([]); +onMounted(async() => { + dictList.value = await dictStore.listAsync('sys_oper_type'); +})` }} + +
{{ JSON.stringify(dictList,null,2) }}
+
同步获取单个: dictStore.getAsync('sys_oper_type',1)
+ {{ `const dictOne = ref({}); +onMounted(async() => { + dictOne.value = await dictStore.getAsync('sys_oper_type',1); +})` }} + +
{{ JSON.stringify(dictOne,null,2) }}
+ +

原始请求方法: getDicts(name)

+
@@ -494,8 +591,24 @@ const emRef3 = proxy.$refs.emRef3;