zuy пре 2 година
родитељ
комит
a5fb7e341f

+ 2 - 2
admin-web/src/App.vue

@@ -98,7 +98,7 @@ onMounted(() => {
 });
 
 const refreshEnv = ()=>{
-  $get("/dict/dictList", {}).then((res: any) => {
+/*  $get("/dict/dictList", {}).then((res: any) => {
     Session.set("dicts", res);
   })
 
@@ -111,7 +111,7 @@ const refreshEnv = ()=>{
 
   }).catch(err => {
     Session.clear();
-  });
+  });*/
 }
 
 // 页面销毁时,关闭监听布局配置/i18n监听

+ 15 - 1
admin-web/src/router/frontEnd.ts

@@ -59,12 +59,26 @@ export async function setAddRoute() {
  * @returns 返回替换后的路由数组
  */
 export function setFilterRouteEnd() {
-
+/*
 	let filterRouteEnd: any = formatTwoStageRoutes(formatFlatteningRoutes(adminRoutes));
 	// notFoundAndNoPower 防止 404、401 不在 layout 布局中,不设置的话,404、401 界面将全屏显示
 	// 关联问题 No match found for location with path 'xxx'
 	filterRouteEnd[0].children = [...setFilterRoute(filterRouteEnd[0].children), ...notFoundAndNoPower];
+	return filterRouteEnd;*/
+	debugger
+	let filterRouteEnd: any =[];
+	filterRouteEnd.push(adminRoutes[0])
+	let  adminRouteList: Array<RouteRecordRaw> = adminRoutes[0].children;
+	adminRouteList.forEach((item:RouteRecordRaw)=>{
+		filterRouteEnd.push(item)
+		if(item.children&&item.children.length>0){
+			item.children.forEach((childItem:RouteRecordRaw)=>{
+				filterRouteEnd.push(childItem)
+			})
+		}
+	})
 	return filterRouteEnd;
+
 }
 
 /**

+ 7 - 0
admin-web/src/theme/app.scss

@@ -295,6 +295,13 @@ body,
 	color: var(--el-color-info);
 }
 
+//固定宽度
+@for $i from 0 through 30 {
+	.w#{$i*5} {
+		width: #{$i*5}px !important;
+	}
+}
+
 /* 字体大小全局样式
 ------------------------------- */
 @for $i from 10 through 32 {

+ 163 - 191
admin-web/src/views/admin/account/index.vue

@@ -4,6 +4,7 @@
   :deep(.el-card__body) {
     display: flex;
     flex-direction: column;
+    justify-content: space-between;
     flex: 1;
     overflow: auto;
 
@@ -26,191 +27,174 @@
 <template>
   <div class="system-container layout-padding">
     <el-card shadow="hover" class="layout-padding-auto">
+
+
       <el-form
-          :model="state.queryForm"
+          :model="state.formQuery"
           ref="formRulesOneRef"
           size="default" label-width="0px" class="mt5">
-
+        <el-input
+            v-model="state.formQuery.avatar"
+            placeholder="头像"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.companyId"
+            placeholder="公司id"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.lastLoginTime"
+            placeholder="最后登录时间"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.mobilePhone"
+            placeholder="手机号"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.nickname"
+            placeholder="昵称"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.password"
+            placeholder="密码"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.status"
+            placeholder="0:禁用 1:启用"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.updateTime"
+            placeholder=""
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.username"
+            placeholder="用户名"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+
+        <el-row class="flex-warp mt5">
+          <div>
+            <el-button  plain size="default" type="success" @click="loadData(true)">
+              <SvgIcon name="ele-Search"/>
+              查询
+            </el-button>
+          </div>
+        </el-row>
       </el-form>
 
-      <ext-query-form
-          class="page-search"
-          ref="queryRef"
-          v-model="state.formQuery"
-          :columns="state.columns"
-          :import-config="state.importConfig"
-          :export-config="state.exportConfig"
-          @on-change="loadData(true)"
-          @imported="loadData(true)">
-        <!--  <template #extraQuery></template>
-          <template #extraLeft></template>
-          <template #extraRight></template>-->
-        <template #extraLeft>
-          <ext-button name="创建"
-                      auth="'department.add'" icon="ele-FolderAdd"
-                      size="default" type="success"
-                      class="ml10" @click="onRowClick('add',null)"/>
+      <el-table
+          border
+          stripe="stripe"
+          :height="state.tableData.height"
+          highlight-current-row
+          current-row-key="id"
+          row-key="id"
+          :data="state.tableData.data"
+          v-loading="state.tableData.loading"
+          @selection-change="handleTableSelectionChange"
+          @sort-change="handleTableSortChange">
+        <template #empty>
+          <el-empty></el-empty>
         </template>
-      </ext-query-form>
-
-      <el-row :gutter="20">
-
-        <el-col :span="24">
-          <ext-table
-              class="page-content"
-              :height="state.tableHeight"
-              :data-list="state.tableData.data"
-              :columns="state.columns"
-              :border="true"
-              :selectable="true"
-              :loading="state.tableData.loading">
-          </ext-table>
-
-          <!--          <el-affix position="bottom" :offset="48">-->
-          <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
-          <!--          </el-affix>-->
-        </el-col>
-      </el-row>
-
+        <el-table-column type="selection" align="center" width="55" fixed="left"/>
+        <el-table-column
+            v-for="field in state.tableData.columns"
+            :key="field.prop"
+            :label="field.label"
+            :column-key="field.prop"
+            :width="field.width"
+            :min-width="field.minWidth"
+            :fixed="field.fixed"
+            :sortable="field.sortable"
+            :show-overflow-tooltip="!field.fixed&&field.width>150"
+        >
+          <template #default="{row}">
+            <template v-if="field.prop==='expand'">
+              <p style="padding-left: 2em;" v-html="row[field.prop]"></p>
+            </template>
+            <template v-else>
+              <div>row[field.prop]</div>
+            </template>
+
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
     </el-card>
   </div>
-  <UserDialog ref="userDialogRef" @refresh="loadData(true)"/>
+  <AdminUserDialog ref="adminUserDialogRef" @refresh="loadData(true)"/>
 </template>
 
-<script setup lang="ts" name="UserList">
-import {watch, defineAsyncComponent, getCurrentInstance, nextTick, onBeforeMount, onMounted, reactive, ref} from 'vue';
-import {$body, $get} from "/@/utils/request";
-import u from '/@/utils/u'
+<script setup lang="ts" name="AdminUserList">
+import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
+import {$body,$get} from "/@/utils/request";
 import {Msg} from "/@/utils/message";
-import {Session} from "/@/utils/storage";
-import ExtButton from '/@/components/form/ExtButton.vue'
-import ExtPage from '/@/components/form/ExtPage.vue'
-import ExtQueryForm from "/@/components/form/ExtQueryForm.vue";
-import ExtTable from "/@/components/form/ExtTable.vue";
 
-import {ElButton, ElTree, ElTag} from 'element-plus'
 
-const {proxy}: any = getCurrentInstance();
+import ExtPage from '/@/components/form/ExtPage.vue'
 
+import mittBus from '/@/utils/mitt';
 
-const UserDialog = defineAsyncComponent(() => import("/@/views/admin/user/dialog.vue"));
+const AdminUserDialog = defineAsyncComponent(() => import("/@/views/page/AdminUserDialog.vue"));
 
 //定义引用
 const queryRef = ref();
-const userDialogRef = ref();
-const treeRef = ref<InstanceType<typeof ElTree>>()
+const adminUserDialogRef = ref();
+
 //定义变量
 const state = reactive({
-  treeData: [],
-  filterText: null,
-  formQuery: {
-    departmentId: null
-  },
+  formQuery: {},
   pageQuery: {
-    pageIndex: 1,
+    pageNumber: 1,
     pageSize: 10,
     total: 0
   },
   tableData: {
-    data: [] as Array<any>,
-    loading: false
-  },
-  importConfig: {},
-  exportConfig: {},
-  columns: [
-    {label: '头像', prop: 'avatar', query: false, type: 'avatar', resizable: true},
-    {
-      label: '用户名', prop: 'userName', query: true, type: "text", resizable: true,
-      render: (h: any, row: any) => {
-        return h('div', null, [
-          h('div', {
-            style: {
-              cursor: 'pointer',
-              color: 'var(--el-color-primary-light-1)'
-            },
-            onClick: () => {
-              onRowClick('view', row)
-            }
-          }, row.userName)])
+    height: 500,
+    data: [] as Array < any >,
+    loading: false,
+    columns: [
+      {type: 'selection', width: 60, align: 'center', fixed: 'left'},
+      {label: '头像', prop: 'avatar', resizable: true},
+      {label: '', prop: 'createTime', sortable: 'custom', resizable: true},
+      {label: '最后登录时间', prop: 'lastLoginTime', sortable: 'custom', resizable: true},
+      {label: '手机号', prop: 'mobilePhone', resizable: true},
+      {label: '昵称', prop: 'nickname', resizable: true},
+      {label: '密码', prop: 'password', resizable: true},
+      {label: '0:禁用 1:启用', prop: 'status', sortable: 'custom', align: 'center'},
+      {label: '', prop: 'updateTime', sortable: 'custom', resizable: true},
+      {label: '用户名', prop: 'username', resizable: true},
+      {
+        label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
       }
-    },
-    {label: '姓名', prop: 'name', query: true, type: 'text', resizable: true},
-    {label: '手机号', prop: 'mobile', query: true, type: 'text', resizable: true},
-    {label: '邮箱', prop: 'email', query: true, type: 'text', resizable: true},
-    {
-      label: '部门', prop: 'departmentId', query: true, type: 'dept', resizable: true,
-      render: (h: any, row: any) => {
-        return h('div', null,
-            row.deptList?row.deptList.map((k: any) => h(ElTag, {
-              type: 'primary'
-            }, k.name)):'')
-      }
-    },
-    {
-      label: '角色', prop: 'roleId', query: true, type: 'select', resizable: true, conf: {url: 'entity/list', query: {entity: 'role'}},
-      render: (h: any, row: any) => {
-        return h('div', null,
-            row.roleList?row.roleList.map((k: any) => h(ElTag, {
-              type: 'success'
-            }, k.name)):'')
-      }
-    },
-    {
-      label: '岗位', prop: 'postId', query: true, type: 'text', resizable: true, conf: {url: 'entity/list', query: {entity: 'post'}},
-      render: (h: any, row: any) => {
-        return h('div', null,
-            row.postList ? row.postList.map((k: any) => h(ElTag, {
-              type: 'danger'
-            }, k.name)) : '')
-      }
-    },
-
-    {label: '工号', prop: 'code', width: 150, query: true, type: 'text', resizable: true},
-    {label: '是否删除', prop: 'deleted', query: true, type: 'bool'},
-    {label: '登录ip', prop: 'ip', width: 150, query: false, type: 'text', resizable: true},
-    {label: '职业信息', prop: 'job', query: false, type: 'text', resizable: true},
-    {label: '上次登录时间', prop: 'lastLoginAt', width: 180, query: true, type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDateTime(val)}},
-    {label: '用户状态', prop: 'status', width: 150, sortable: 'custom', align: 'center', query: true, type: 'dict', conf: {dict: 'User.status'}},
-    {label: '创建时间', prop: 'createAt', query: true, type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
-    {label: '更新时间', prop: 'updateAt', query: true, type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
-    {
-      label: '操作', prop: 'action', width: 180, type: 'render', align: 'center', fixed: 'right',
-      render: (h: any, row: any) => {
-        return (
-            h('div', null, [
-              (proxy.$auth('user.modify')) ?
-                  h(ElButton, {
-                    type: 'warning',
-                    size: 'default',
-                    text: true,
-                    onClick: () => {
-                      onRowClick('edit', row)
-                    }
-                  }, () => '编辑') : '',
-              (proxy.$auth('user.remove')) ?
-                  h(ElButton, {
-                    type: 'danger',
-                    text: true,
-                    onClick() {
-                      onRowDel(row)
-                    }
-                  }, () => '重置密码') : '',
-            ])
-        )
-
-      }
-    }
-  ],
-  tableHeight: 500
-})
-
-
-interface Tree {
-  [key: string]: any
-}
-
-watch(() => state.filterText, (val) => {
-  treeRef.value!.filter(val)
+    ],
+  },
 })
 
 
@@ -224,20 +208,24 @@ watch(() => state.filterText, (val) => {
 
 //生命周期钩子
 onBeforeMount(() => {
-  let token = Session.get("token")
-  let encodeToken = encodeURIComponent(token)
-
 })
 
 onMounted(() => {
   loadData();
-  loadTreeData()
 
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableHeight = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 220
   })
+
+  mittBus.on("adminUser.refresh", () => {
+    loadData();
+  })
+});
+
+onBeforeUnmount(() => {
+  mittBus.off("adminUser.refresh")
 })
 
 
@@ -245,10 +233,10 @@ onMounted(() => {
 // 初始化表格数据
 const loadData = (refresh: boolean = false) => {
   if (refresh) {
-    state.pageQuery.pageIndex = 1;
+    state.pageQuery.pageNumber = 1;
   }
   state.tableData.loading = true;
-  $body(`/user/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+  $body(`/adminUser/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
     let {list, count} = res;
     state.tableData.data = list;
     state.pageQuery.total = count;
@@ -261,12 +249,13 @@ const loadData = (refresh: boolean = false) => {
 
 // 打开修改用户弹窗
 const onRowClick = (type: string, row: any) => {
-  userDialogRef.value.open(type, row);
+  adminUserDialogRef.value.open(type, row);
 };
+
 // 删除用户
 const onRowDel = (row: any) => {
   Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
-    $get(`/user/delete/${row.id}`).then(() => {
+    $get(`/adminUser/delete/${row.id}`).then(() => {
       Msg.message("删除成功", 'success')
     }).catch(() => {
       Msg.message("删除失败", 'error')
@@ -274,33 +263,16 @@ const onRowDel = (row: any) => {
   });
 };
 
-
-const filterNode = (value: string, data: Tree) => {
-  if (!value) return true
-  return data.name.includes(value)
+const handleTableSelectionChange = (selection: any) => {
+  console.log("handleTableSelectionChange>>", selection)
+  // emit("on-check-change", selection)
 }
 
-const handleNodeClick = (data: any) => {
-  console.log(data)
-  if (data) {
-    if (state.formQuery.departmentId === data.id) {
-      state.formQuery.departmentId = null;
-      treeRef.value?.setCurrentKey(null)
-    } else {
-      state.formQuery.departmentId = data.id;
-    }
-  }
-  loadData();
+const handleTableSortChange = (column, prop, order) => {
+  console.log("handleTableSortChange>>", column, prop, order)
+  // emit("on-sort-change", column)
 }
 
-const loadTreeData = () => {
-  state.tableData.loading = true;
-  state.tableData.data = [];
-  $body(`/department/tree`).then((res: any) => {
-    state.treeData = res;
-  })
-};
-
 
 //endregion
 

+ 277 - 6
admin-web/src/views/admin/ordering/index.vue

@@ -1,13 +1,284 @@
+<style scoped lang="scss">
+.system-container {
+
+  :deep(.el-card__body) {
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    flex: 1;
+    overflow: auto;
+
+    .el-table {
+      flex: 1;
+    }
+
+  }
+}
+
+.page-content {
+  margin-bottom: 20px;
+}
+
+.page-pager {
+  background-color: #fff;
+  height: 24px;
+}
+</style>
 <template>
+  <div class="system-container layout-padding">
+    <el-card shadow="hover" class="layout-padding-auto">
+
 
+      <el-form
+          :model="state.formQuery"
+          ref="formRulesOneRef"
+          size="default" label-width="0px" class="mt5">
+        <el-input
+            v-model="state.formQuery.avatar"
+            placeholder="头像"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.companyId"
+            placeholder="公司id"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.lastLoginTime"
+            placeholder="最后登录时间"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.mobilePhone"
+            placeholder="手机号"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.nickname"
+            placeholder="昵称"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.password"
+            placeholder="密码"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.status"
+            placeholder="0:禁用 1:启用"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.updateTime"
+            placeholder=""
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.username"
+            placeholder="用户名"
+            clearable
+            @blur="loadData(true)"
+            class="w150 mr10">
+        </el-input>
+
+        <el-row class="flex-warp mt5">
+          <div>
+            <el-button  plain size="default" type="success" @click="loadData(true)">
+              <SvgIcon name="ele-Search"/>
+              查询
+            </el-button>
+          </div>
+        </el-row>
+      </el-form>
+
+      <el-table
+          border
+          stripe="stripe"
+          :height="state.tableData.height"
+          highlight-current-row
+          current-row-key="id"
+          row-key="id"
+          :data="state.tableData.data"
+          v-loading="state.tableData.loading"
+          @selection-change="handleTableSelectionChange"
+          @sort-change="handleTableSortChange">
+        <template #empty>
+          <el-empty></el-empty>
+        </template>
+        <el-table-column type="selection" align="center" width="55" fixed="left"/>
+        <el-table-column
+            v-for="field in state.tableData.columns"
+            :key="field.prop"
+            :label="field.label"
+            :column-key="field.prop"
+            :width="field.width"
+            :min-width="field.minWidth"
+            :fixed="field.fixed"
+            :sortable="field.sortable"
+            :show-overflow-tooltip="!field.fixed&&field.width>150"
+        >
+          <template #default="{row}">
+            <template v-if="field.prop==='expand'">
+              <p style="padding-left: 2em;" v-html="row[field.prop]"></p>
+            </template>
+            <template v-else>
+              <div>row[field.prop]</div>
+            </template>
+
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
+    </el-card>
+  </div>
+  <AdminUserDialog ref="adminUserDialogRef" @refresh="loadData(true)"/>
 </template>
 
-<script>
-export default {
-  name: "index"
+<script setup lang="ts" name="AdminUserList">
+import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
+import {$body,$get} from "/@/utils/request";
+import {Msg} from "/@/utils/message";
+
+
+import ExtPage from '/@/components/form/ExtPage.vue'
+
+import mittBus from '/@/utils/mitt';
+
+const AdminUserDialog = defineAsyncComponent(() => import("/@/views/page/AdminUserDialog.vue"));
+
+//定义引用
+const queryRef = ref();
+const adminUserDialogRef = ref();
+
+//定义变量
+const state = reactive({
+  formQuery: {},
+  pageQuery: {
+    pageNumber: 1,
+    pageSize: 10,
+    total: 0
+  },
+  tableData: {
+    height: 500,
+    data: [] as Array < any >,
+    loading: false,
+    columns: [
+      {type: 'selection', width: 60, align: 'center', fixed: 'left'},
+      {label: '头像', prop: 'avatar', resizable: true},
+      {label: '', prop: 'createTime', sortable: 'custom', resizable: true},
+      {label: '最后登录时间', prop: 'lastLoginTime', sortable: 'custom', resizable: true},
+      {label: '手机号', prop: 'mobilePhone', resizable: true},
+      {label: '昵称', prop: 'nickname', resizable: true},
+      {label: '密码', prop: 'password', resizable: true},
+      {label: '0:禁用 1:启用', prop: 'status', sortable: 'custom', align: 'center'},
+      {label: '', prop: 'updateTime', sortable: 'custom', resizable: true},
+      {label: '用户名', prop: 'username', resizable: true},
+      {
+        label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
+      }
+    ],
+  },
+})
+
+
+// 监听双向绑定 modelValue 的变化
+// watch(
+//         () => state.pageIndex,
+//         () => {
+//
+//         }
+// );
+
+//生命周期钩子
+onBeforeMount(() => {
+})
+
+onMounted(() => {
+  loadData();
+
+  nextTick(() => {
+    let bodyHeight = document.body.clientHeight;
+    let queryHeight = queryRef.value.$el.clientHeight;
+    state.tableData.height = bodyHeight - queryHeight - 220
+  })
+
+  mittBus.on("adminUser.refresh", () => {
+    loadData();
+  })
+});
+
+onBeforeUnmount(() => {
+  mittBus.off("adminUser.refresh")
+})
+
+
+//region 方法区
+// 初始化表格数据
+const loadData = (refresh: boolean = false) => {
+  if (refresh) {
+    state.pageQuery.pageNumber = 1;
+  }
+  state.tableData.loading = true;
+  $body(`/adminUser/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    let {list, count} = res;
+    state.tableData.data = list;
+    state.pageQuery.total = count;
+    state.tableData.loading = false;
+  }).catch(e => {
+    console.error(e)
+    state.tableData.loading = false;
+  })
+};
+
+// 打开修改用户弹窗
+const onRowClick = (type: string, row: any) => {
+  adminUserDialogRef.value.open(type, row);
+};
+
+// 删除用户
+const onRowDel = (row: any) => {
+  Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
+    $get(`/adminUser/delete/${row.id}`).then(() => {
+      Msg.message("删除成功", 'success')
+    }).catch(() => {
+      Msg.message("删除失败", 'error')
+    })
+  });
+};
+
+const handleTableSelectionChange = (selection: any) => {
+  console.log("handleTableSelectionChange>>", selection)
+  // emit("on-check-change", selection)
 }
-</script>
 
-<style scoped>
+const handleTableSortChange = (column, prop, order) => {
+  console.log("handleTableSortChange>>", column, prop, order)
+  // emit("on-sort-change", column)
+}
+
+
+//endregion
+
 
-</style>
+// 暴露变量
+// defineExpose({
+//     loadData,
+// });
+</script>

+ 1 - 0
admin-web/src/views/login/component/account.vue

@@ -155,6 +155,7 @@ const onSignIn = async () => {
     console.log(res)
     if (satoken) {
       // 存储 token 到浏览器缓存
+      debugger
       Session.set('token', satoken);
       Cookies.set('userId', id);
 

+ 0 - 202
admin-web/src/views/login/component/ldap.vue

@@ -1,202 +0,0 @@
-<template>
-	<el-form size="large" class="login-content-form">
-		<el-form-item class="login-animation1">
-			<el-input text placeholder="请输入AD域账号" v-model="state.ruleForm.name" clearable autocomplete="off">
-				<template #prefix>
-					<i class="iconfont icon-dianhua el-input__icon"></i>
-				</template>
-			</el-input>
-		</el-form-item>
-		<el-form-item class="login-animation2">
-			<el-col :span="24">
-				<el-input text maxlength="4" placeholder="请输入密码" v-model="state.ruleForm.pwd" clearable autocomplete="off">
-					<template #prefix>
-						<el-icon class="el-input__icon"><ele-Position /></el-icon>
-					</template>
-				</el-input>
-			</el-col>
-<!--			<el-col :span="1"></el-col>
-			<el-col :span="8">
-				<el-button v-waves class="login-content-code">{{ $t('message.mobile.codeText') }}</el-button>
-			</el-col>-->
-		</el-form-item>
-		<el-form-item class="login-animation3">
-			<el-button round type="primary" v-waves class="login-content-submit" :loading="state.loading" @click="handleLogin">
-				<span>{{ $t('message.mobile.btnText') }}</span>
-			</el-button>
-		</el-form-item>
-		<div class="font12 mt30 login-animation4 login-msg">{{ $t('message.mobile.msgText') }}</div>
-	</el-form>
-</template>
-
-<script setup lang="ts" name="loginMobile">
-import {reactive} from 'vue';
-import {useRoute, useRouter} from 'vue-router';
-import {ElMessage, ElNotification} from 'element-plus';
-import {useI18n} from 'vue-i18n';
-import Cookies from 'js-cookie';
-import {storeToRefs} from 'pinia';
-import {useThemeConfig} from '/@/stores/themeConfig';
-import {Session} from '/@/utils/storage';
-import {NextLoading} from '/@/utils/loading';
-import {$body, $get} from '/@/utils/request'
-import {useUserInfo} from "/@/stores/userInfo";
-
-import { JSEncrypt } from 'jsencrypt'
-
-// 定义变量内容
-const {t} = useI18n();
-const storesThemeConfig = useThemeConfig();
-const {themeConfig} = storeToRefs(storesThemeConfig);
-const storesUserInfo = useUserInfo();
-const route = useRoute();
-const router = useRouter();
-
-// 定义变量内容
-const state = reactive({
-	ruleForm: {
-		name: '',
-		pwd: '',
-	},
-  loading:false
-});
-
-const encryptData = (str:string)=>{
-  let encryptor = new JSEncrypt()
-  // 设置公钥 (这是后端直接给我的,看你们项目情况是需要调接口获得,还是程序中直接写死)
-  let publicKey = import.meta.env.VITE_PUBLIC_KEY
-  encryptor.setPublicKey(publicKey) // publicKey为公钥
-  // 加密数据
-  return encryptor.encrypt(str)
-}
-
-const handleLogin = ()=>{
-  state.loading = true;
-  let temp = {
-    userName:state.ruleForm.name,
-    pwd:encryptData(state.ruleForm.pwd)
-  }
-  $body(`/user/loginByLdap`, temp).then((res: any) => {
-    console.log(res)
-    if (res.token) {
-      // 存储 token 到浏览器缓存
-      Session.set('token', res.token);
-      Cookies.set('userName', res.userName);
-
-      initData();
-      refreshLogin();
-      state.loading = false;
-
-      //检验登录权限
-      if (!themeConfig.value.isRequestRoutes) {
-        // 前端控制路由,2、请注意执行顺序
-        // const isNoPower = await initFrontEndControlRoutes();
-        signInSuccess(false);
-      } else {
-        // 模拟后端控制路由,isRequestRoutes 为 true,则开启后端控制路由
-        // 添加完动态路由,再进行 router 跳转,否则可能报错 No match found for location with path "/"
-        // const isNoPower = await initBackEndControlRoutes();
-        // 执行完 initBackEndControlRoutes,再执行 signInSuccess
-        signInSuccess(false);
-      }
-    } else {
-      ElMessage.error(res.msg);
-      state.loading = false;
-    }
-  }).catch(e => {
-    state.loading = false;
-    console.error(e)
-  });
-
-}
-
-// 登录成功后的跳转
-const signInSuccess = (isNoPower: boolean | undefined) => {
-  if (isNoPower) {
-    ElMessage.warning('抱歉,您没有登录权限');
-    Session.clear();
-  } else {
-    // 初始化登录成功时间问候语
-    // 登录成功,跳到转首页
-    // 如果是复制粘贴的路径,非首页/登录页,那么登录成功后重定向到对应的路径中
-    if (route.query?.redirect) {
-      router.push({
-        path: <string>route.query?.redirect,
-        query: Object.keys(<string>route.query?.params).length > 0 ? JSON.parse(<string>route.query?.params) : '',
-      });
-    } else {
-      router.push('/');
-    }
-    // 登录成功提示
-    const signInText = t('message.signInText');
-    ElMessage.success(`${signInText}`);
-    // 添加 loading,防止第一次进入界面时出现短暂空白
-    NextLoading.start();
-  }
-  state.loading = false;
-};
-
-const initData = () => {
-  $get("/dict/dictList", {}).then((res: any) => {
-    Session.set("dicts", res);
-  });
-
-  $get("/user/profile").then((obj: any) => {
-    if (obj) {
-      let {user, permissionList} = obj;
-      let userInfo = {...user, permList: permissionList}
-      /*     app.user = user;
-           app.userId = user.id;
-           app.permissions = permissionList;
-           app.departmentMemberList = departmentMemberList;*/
-      storesUserInfo.setUserInfos(userInfo);
-      state.loading = false;
-      ElNotification.success({
-        title: 'Success',
-        message: "欢迎," + user.name,
-        offset: 100,
-      })
-    }
-  }).catch(() => {
-    ElMessage.error("登录状态失效,请重新登录管理控制台");
-    Session.clear();
-    state.loading = false;
-  });
-}
-
-const refreshLogin = () => {
-  setInterval(() => {
-    $get(`user/refresh`);
-  }, 1600 * 1000)
-}
-
-
-</script>
-
-<style scoped lang="scss">
-.login-content-form {
-	margin-top: 20px;
-	@for $i from 1 through 4 {
-		.login-animation#{$i} {
-			opacity: 0;
-			animation-name: error-num;
-			animation-duration: 0.5s;
-			animation-fill-mode: forwards;
-			animation-delay: calc($i/10) + s;
-		}
-	}
-	.login-content-code {
-		width: 100%;
-		padding: 0;
-	}
-	.login-content-submit {
-		width: 100%;
-		letter-spacing: 2px;
-		font-weight: 300;
-		margin-top: 15px;
-	}
-	.login-msg {
-		color: var(--el-text-color-placeholder);
-	}
-}
-</style>

+ 0 - 63
admin-web/src/views/login/component/scan.vue

@@ -1,63 +0,0 @@
-emplate>
-	<div class="login-scan-container">
-		<div ref="qrcodeRef"></div>
-		<div class="font12 mt20 login-msg">
-			<i class="iconfont icon-saoyisao mr5"></i>
-			<span>{{ $t('message.scan.text') }}</span>
-		</div>
-	</div>
-</template>
-
-<script setup lang="ts" name="loginScan">
-import { ref, onMounted, nextTick } from 'vue';
-import QRCode from 'qrcodejs2-fixes';
-
-// 定义变量内容
-const qrcodeRef = ref<HTMLElement | null>(null);
-
-// 初始化生成二维码
-const initQrcode = () => {
-	nextTick(() => {
-		(<HTMLElement>qrcodeRef.value).innerHTML = '';
-		new QRCode(qrcodeRef.value, {
-			text: `https://qm.qq.com/cgi-bin/qm/qr?k=RdUY97Vx0T0vZ_1OOu-X1yFNkWgDwbjC&jump_from=webapi`,
-			width: 260,
-			height: 260,
-			colorDark: '#000000',
-			colorLight: '#ffffff',
-		});
-	});
-};
-// 页面加载时
-onMounted(() => {
-	initQrcode();
-});
-</script>
-
-<style scoped lang="scss">
-.login-scan-animation {
-	opacity: 0;
-	animation-name: error-num;
-	animation-duration: 0.5s;
-	animation-fill-mode: forwards;
-}
-.login-scan-container {
-	padding: 0 20px 20px;
-	display: flex;
-	flex-direction: column;
-	text-align: center;
-	@extend .login-scan-animation;
-	animation-delay: 0.1s;
-	:deep(img) {
-		margin: auto;
-	}
-	.login-msg {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		color: var(--el-text-color-placeholder);
-		@extend .login-scan-animation;
-		animation-delay: 0.2s;
-	}
-}
-</style>