hmy 1 éve
szülő
commit
68b975fdd0

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 34 - 41
README.md


+ 0 - 1
src/api/system/dict/type.js

@@ -2,7 +2,6 @@ import request from '@/utils/request'
 
 // 查询字典类型列表
 export function listType(query) {
- 
   return request({
     url: '/system/dict/type/list',
     method: 'get',

+ 0 - 1
src/layout/components/Sidebar/Link.vue

@@ -13,7 +13,6 @@ const props = defineProps({
     required: true
   }
 })
-
 const isExt = computed(() => {
   return isExternal(props.to)
 })

+ 16 - 13
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,10 +1,15 @@
 <template>
   <div v-if="!item.hidden">
-    <template v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
+    <template
+      v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
-          <svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"/>
-          <template #title><span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span></template>
+        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'sub-menu-title-noDropdown': !isNest }">
+          <svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
+          <template #title>
+            <span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">
+              {{ onlyOneChild.meta.title}}
+            </span>
+          </template>
         </el-menu-item>
       </app-link>
     </template>
@@ -15,14 +20,8 @@
         <span class="menu-title" :title="hasTitle(item.meta.title)">{{ item.meta.title }}</span>
       </template>
 
-      <sidebar-item
-        v-for="child in item.children"
-        :key="child.path"
-        :is-nest="true"
-        :item="child"
-        :base-path="resolvePath(child.path)"
-        class="nest-menu"
-      />
+      <sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child"
+        :base-path="resolvePath(child.path)" class="nest-menu" />
     </el-sub-menu>
   </div>
 </template>
@@ -66,12 +65,16 @@ function hasOneShowingChild(children = [], parent) {
 
   // When there is only one child router, the child router is displayed by default
   if (showingChildren.length === 1) {
+    
+    console.log("showingChildren.length === 1:",showingChildren)
+    debugger
     return true
   }
 
   // Show parent if there are no child router to display
   if (showingChildren.length === 0) {
     onlyOneChild.value = { ...parent, path: '', noShowingChildren: true }
+   // console.log("onlyOneChild.value:",onlyOneChild.value)
     return true
   }
 
@@ -92,7 +95,7 @@ function resolvePath(routePath, routeQuery) {
   return getNormalPath(props.basePath + '/' + routePath)
 }
 
-function hasTitle(title){
+function hasTitle(title) {
   if (title.length > 5) {
     return title;
   } else {

+ 12 - 11
src/store/modules/permission.js

@@ -36,16 +36,20 @@ const usePermissionStore = defineStore(
         return new Promise(resolve => {
           // 向后端请求路由数据
           getRouters().then(res => {
-            const sdata = res.data
-            const rdata = res.data
-            const defaultData = res.data
+            const sdata = JSON.parse(JSON.stringify(res.data))
+            //拷贝一个字符串会新辟一个新的存储地址,
+            //这样就切断了引用对象的指针联系,
+            //所以先转成一个字符串,在解析出对象,
+            //这样就可以深拷贝一个对象,换句话说其实就是新开辟个区域,所指向的指针也随之改变成新的指针。
+            const rdata = JSON.parse(JSON.stringify(res.data))
+            const defaultData = JSON.parse(JSON.stringify(res.data))
             const sidebarRoutes = filterAsyncRouter(sdata)
             const rewriteRoutes = filterAsyncRouter(rdata, false, true)
             const defaultRoutes = filterAsyncRouter(defaultData)
-            // const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
-            // asyncRoutes.forEach(route => { router.addRoute(route) })
+            const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
+            asyncRoutes.forEach(route => { router.addRoute(route) })
             this.setRoutes(rewriteRoutes)
-            //todo 这个侧边栏属性
+            //这个是默认的菜单系统
             this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
             this.setDefaultRoutes(sidebarRoutes)
             this.setTopbarRoutes(defaultRoutes)
@@ -57,9 +61,10 @@ const usePermissionStore = defineStore(
   })
 
 // 遍历后台传来的路由字符串,转换为组件对象
+
 function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
+ 
   return asyncRouterMap.filter(route => {
-    debugger
     if (type && route.children) {
       route.children = filterChildren(route.children)
     }
@@ -144,11 +149,7 @@ export const loadView = (view) => {
   //     res = () => modules[path]();
   //   }
   // }
-  
-
-
   if (pathMap.get(view) != null) {
-
     //res = () => modules[pathMap.get(view)]();
     //这里没有必要再加弄成函数
     res = modules[pathMap.get(view)];

+ 0 - 1
src/store/modules/user.js

@@ -19,7 +19,6 @@ const useUserStore = defineStore(
         const password = userInfo.password
         const code = userInfo.code
         const uuid = userInfo.uuid
-        console.log("userInfo:"+JSON.stringify(userInfo))
         return new Promise((resolve, reject) => {
           login(username, password, code, uuid).then(res => {
             setToken(res.token)

+ 0 - 1
src/utils/request.js

@@ -31,7 +31,6 @@ service.interceptors.request.use(config => {
   }
   // get请求映射params参数
   if (config.method === 'get' && config.params) {
-    debugger
     let url = config.url + '?' + tansParams(config.params);
     url = url.slice(0, -1);
     config.params = {};

+ 0 - 1
src/utils/ruoyi.js

@@ -55,7 +55,6 @@ export function resetForm(refName) {
 
 // 添加日期范围
 export function addDateRange(params, dateRange, propName) {
-
   let search = params;
   search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
   dateRange = Array.isArray(dateRange) ? dateRange : [];

+ 1 - 0
src/views/monitor/job/log.vue

@@ -200,6 +200,7 @@ const data = reactive({
 
 const { queryParams, form, rules } = toRefs(data);
 
+
 /** 查询调度日志列表 */
 function getList() {
   loading.value = true;

+ 2 - 2
src/views/system/dict/data.vue

@@ -89,13 +89,13 @@
       <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="字典编码" align="center" prop="dictCode" />
-         <el-table-column label="字典标签" align="center" prop="dictLabel">
+         <el-table-column label="字典标签" align="center" prop="dictLabel" >
             <template #default="scope">
                <span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{ scope.row.dictLabel }}</span>
                <el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass">{{ scope.row.dictLabel }}</el-tag>
             </template>
          </el-table-column>
-         <el-table-column label="字典键值" align="center" prop="dictValue" />
+         <el-table-column label="字典键值" align="center" prop="dictValue"  :show-overflow-tooltip="true"/>
          <el-table-column label="字典排序" align="center" prop="dictSort" />
          <el-table-column label="状态" align="center" prop="status">
             <template #default="scope">

+ 8 - 14
src/views/system/dict/index.vue

@@ -103,7 +103,8 @@
 
       <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
-         <el-table-column label="字典编号" align="center" prop="dictId" />
+         <!-- <el-table-column label="字典编号" align="center" prop="dictId" /> -->
+         <el-table-column label="字典编号" align="center" width="80" type="index"/>
          <el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/>
          <el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
             <template #default="scope">
@@ -125,8 +126,8 @@
          </el-table-column>
          <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
             <template #default="scope">
-               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row.dictId)" v-hasPermi="['system:dict:edit']">修改</el-button>
-               <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row.dictId)" v-hasPermi="['system:dict:remove']">删除</el-button>
+               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
+               <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
             </template>
          </el-table-column>
       </el-table>
@@ -177,6 +178,7 @@ import { listType, getType, delType, addType, updateType, refreshCache } from "@
 
 const { proxy } = getCurrentInstance();
 const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
+
 const typeList = ref([]);
 const open = ref(false);
 const loading = ref(true);
@@ -208,12 +210,7 @@ const { queryParams, form, rules } = toRefs(data);
 /** 查询字典类型列表 */
 function getList() {
   loading.value = true;
-  console.log("dateRange.value"+dateRange.value)
-  //查询所有参数
- var queryData= proxy.addDateRange(queryParams.value, dateRange.value);
- //aoixs
- console.log("queryData:"+queryData)
-  listType(queryData).then(response => {
+  listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
     typeList.value = response.rows;
     total.value = response.total;
     loading.value = false;
@@ -259,11 +256,9 @@ function handleSelectionChange(selection) {
   multiple.value = !selection.length;
 }
 /** 修改按钮操作 */
-function handleUpdate(id) {
-   console.log(id);
+function handleUpdate(row) {
   reset();
-//   const dictId = row.dictId || ids.value;
-const dictId =id;
+  const dictId = row.dictId || ids.value;
   getType(dictId).then(response => {
     form.value = response.data;
     open.value = true;
@@ -302,7 +297,6 @@ function handleDelete(row) {
 }
 /** 导出按钮操作 */
 function handleExport() {
-   debugger
   proxy.download("system/dict/type/export", {
     ...queryParams.value
   }, `dict_${new Date().getTime()}.xlsx`);