Browse Source

细节更改,升级Echarts版本

zouzs 2 weeks ago
parent
commit
fa0db83740

+ 1 - 1
package.json

@@ -58,7 +58,7 @@
     "axios": "^1.11.0",
     "crypto-js": "^4.2.0",
     "dayjs": "^1.11.13",
-    "echarts": "^5.6.0",
+    "echarts": "^6.0.0",
     "element-plus": "^2.11.3",
     "js-cookie": "^3.0.5",
     "js-md5": "^0.8.3",

+ 2 - 62
src/layout/components/lay-notice/data.ts

@@ -25,73 +25,13 @@ export const noticesData: TabItem[] = [
   {
     key: "2",
     name: "消息",
-    list: [
-      {
-        avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile1.svg",
-        title: "小铭 评论了你",
-        description: "诚在于心,信在于行,诚信在于心行合一。",
-        datetime: "今天",
-        type: "2"
-      },
-      {
-        avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile2.svg",
-        title: "李白 回复了你",
-        description: "长风破浪会有时,直挂云帆济沧海。",
-        datetime: "昨天",
-        type: "2"
-      },
-      {
-        avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile5.svg",
-        title: "标题",
-        description:
-          "请将鼠标移动到此处,以便测试超长的消息在此处将如何处理。本例中设置的描述最大行数为2,超过2行的描述内容将被省略并且可以通过tooltip查看完整内容",
-        datetime: "时间",
-        type: "2"
-      }
-    ],
+    list: [],
     emptyText: "暂无消息"
   },
   {
     key: "3",
     name: "待办",
-    list: [
-      {
-        avatar: "",
-        title: "第三方紧急代码变更",
-        description:
-          "小林提交于 2024-05-10,需在 2024-05-11 前完成代码变更任务",
-        datetime: "",
-        extra: "马上到期",
-        status: "danger",
-        type: "3"
-      },
-      {
-        avatar: "",
-        title: "版本发布",
-        description: "指派小铭于 2024-06-18 前完成更新并发布",
-        datetime: "",
-        extra: "已耗时 8 天",
-        status: "warning",
-        type: "3"
-      },
-      {
-        avatar: "",
-        title: "新功能开发",
-        description: "开发多租户管理",
-        datetime: "",
-        extra: "进行中",
-        type: "3"
-      },
-      {
-        avatar: "",
-        title: "任务名称",
-        description: "任务需要在 2030-10-30 10:00 前启动",
-        datetime: "",
-        extra: "未开始",
-        status: "info",
-        type: "3"
-      }
-    ],
+    list: [],
     emptyText: "暂无待办"
   }
 ];

+ 18 - 10
src/views/system/dept/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div>
     <PlusPage
+      v-if="refreshTable"
       ref="plusPageInstance"
       :columns="tableConfig"
       :request="getList"
@@ -14,7 +15,8 @@
         actionBar: { buttons, type: 'link', width: 140 },
         adaptive: { offsetBottom: 50 },
         treeProps: { children: 'children' },
-        rowKey: 'deptId'
+        rowKey: 'deptId',
+        defaultExpandAll: defaultExpandAll
       }"
       :pagination="false"
     >
@@ -23,6 +25,9 @@
           <el-button size="default" type="success" @click="handleCreate">
             新增
           </el-button>
+          <el-button size="default" type="default" @click="toggleExpandAll">
+            展开/折叠
+          </el-button>
         </el-row>
       </template>
     </PlusPage>
@@ -47,7 +52,7 @@
 </template>
 
 <script lang="ts" setup>
-import { computed, defineOptions, reactive, ref, toRefs } from "vue";
+import { computed, defineOptions, nextTick, reactive, ref, toRefs } from "vue";
 import type { FormRules } from "element-plus";
 import { ElMessage } from "element-plus";
 import {
@@ -71,13 +76,8 @@ defineOptions({
   name: "Dept"
 });
 
-interface TableRow {
-  id: number;
-  name: string;
-  status: string;
-  tag: string;
-  time: Date;
-}
+const refreshTable = ref(true);
+const defaultExpandAll = ref(false);
 
 // 菜单列表
 const deptList = ref([]);
@@ -127,9 +127,17 @@ const handleBeforeSearch = (values: any) => {
   return cloneDeep(values);
 };
 
+const toggleExpandAll = () => {
+  refreshTable.value = false;
+  defaultExpandAll.value = !defaultExpandAll.value;
+  nextTick(() => {
+    refreshTable.value = true;
+  });
+};
+
 const dialogTitle = computed(() => (state.isCreate ? "新增" : "编辑"));
 
-const { buttons } = useTable<TableRow[]>();
+const { buttons } = useTable();
 
 // 表格数据
 const tableConfig: PlusColumn[] = [

+ 1 - 4
src/views/system/logininfor/index.vue

@@ -89,10 +89,7 @@ const tableConfig: PlusColumn[] = [
     prop: "accessTime",
     valueType: "date-picker",
     fieldProps: {
-      type: "datetime",
-      rangeSeparator: "至",
-      startPlaceholder: "开始时间",
-      endPlaceholder: "结束时间",
+      type: "daterange",
       valueFormat: "YYYY-MM-DD HH:mm:ss"
     }
   }

+ 21 - 4
src/views/system/menu/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div>
     <PlusPage
+      v-if="refreshTable"
       ref="plusPageInstance"
       :columns="tableConfig"
       :request="getList"
@@ -14,15 +15,19 @@
         actionBar: { buttons, type: 'link', width: 140 },
         adaptive: { offsetBottom: 50 },
         treeProps: { children: 'children' },
-        rowKey: 'menuId'
+        rowKey: 'menuId',
+        defaultExpandAll: defaultExpandAll
       }"
       :pagination="false"
     >
       <template #table-title>
         <el-row class="button-row">
-          <el-button size="default" type="success" @click="handleCreate"
-            >新增</el-button
-          >
+          <el-button size="default" type="success" @click="handleCreate">
+            新增
+          </el-button>
+          <el-button size="default" type="default" @click="toggleExpandAll">
+            展开/折叠
+          </el-button>
         </el-row>
       </template>
     </PlusPage>
@@ -51,6 +56,7 @@ import {
   computed,
   defineOptions,
   h,
+  nextTick,
   onMounted,
   reactive,
   ref,
@@ -88,6 +94,9 @@ onMounted(async () => {
 const menuList = ref([]);
 const plusPageInstance = ref<PlusPageInstance | null>(null);
 
+const refreshTable = ref(true);
+const defaultExpandAll = ref(false);
+
 const getList = async (query: Record<string, any>) => {
   let res = await getSystemMenuList(query);
   let list = listToTree(res.data);
@@ -238,6 +247,14 @@ const tableConfig: PlusColumn[] = [
   }
 ];
 
+const toggleExpandAll = () => {
+  refreshTable.value = false;
+  defaultExpandAll.value = !defaultExpandAll.value;
+  nextTick(() => {
+    refreshTable.value = true;
+  });
+};
+
 /*--------------------表单--------------------*/
 
 // 表单实例

+ 1 - 5
src/views/system/operlog/index.vue

@@ -1,7 +1,6 @@
 <script setup lang="ts">
 import {
   type PlusColumn,
-  type OptionsRow,
   PlusPage,
   PlusDialog,
   PlusDescriptions,
@@ -116,10 +115,7 @@ const tableConfig: PlusColumn[] = [
     prop: "operTime",
     valueType: "date-picker",
     fieldProps: {
-      type: "datetime",
-      rangeSeparator: "至",
-      startPlaceholder: "开始时间",
-      endPlaceholder: "结束时间",
+      type: "daterange",
       valueFormat: "YYYY-MM-DD HH:mm:ss"
     }
   },