Browse Source

站点、订单、用户列表

zuy 2 years ago
parent
commit
e80f56b30e

+ 13 - 8
admin-web/src/components/form/ExtDLabel.vue

@@ -145,19 +145,24 @@ onMounted(() => {
       state.style = setupColorStyle(color);
     }
   } else {
-   /* const sessionDicts = Session.get("dicts");
-    if (u.isEmptyOrNull(sessionDicts)) {
-      return '--'
-    }*/
-    let dicts =state.dicts[`${props.type}`]
-    if(u.isEmptyOrNull(dicts)){
-      return "-";
+    let dicts = [];
+    const sessionDicts = Session.get("dicts");
+    if (!u.isEmptyOrNull(sessionDicts)) {
+      dicts =sessionDicts[`${props.type}`]
+      if(u.isEmptyOrNull(dicts)){
+        return "-";
+      }
+    }else{
+      dicts =state.dicts[`${props.type}`]
+      if(u.isEmptyOrNull(dicts)){
+        return "-";
+      }
     }
     console.log(props.modelValue)
     let dict = (<Dicts>dicts).find(k => k.value == props.modelValue);
 
     if (dict) {
-      state.text = dict.label;
+      state.text = dict.name||dict.label;
       state.style = setupColorStyle(state.colorList[dict.value%8]);
     }
   }

+ 10 - 8
admin-web/src/components/form/ExtDSelect.vue

@@ -16,9 +16,9 @@
     <el-option
         v-for="(item,idx) in state.dicts"
         :key="idx"
-        :label="item.label"
+        :label="item.name||item.label"
         :value="item.value">
-      <span class="option-item" style="float: left"><i :style="setupColorStyle(state.colorList[item.value%8])">{{  item.label }}</i></span>
+      <span class="option-item" style="float: left"><i :style="setupColorStyle(state.colorList[item.value%8])">{{  item.name||item.label }}</i></span>
       <!--        :style="setupColorStyle(item.color)"-->
     </el-option>
   </el-select>
@@ -107,12 +107,14 @@ onMounted(() => {
   if (!u.isEmptyOrNull(props.dataRange)) {
     state.dicts = props.dataRange;
   } else {
-   /* const dicts = Session.get("dicts");
-    if (u.isEmptyOrNull(dicts)) {
-      return '--'
-    }*/
-    state.dicts =state. dictList[props.type]
-    console.table(state.dicts)
+    const dicts = Session.get("dicts");
+    if (!u.isEmptyOrNull(dicts)) {
+      state.dicts = dicts[props.type];
+    }else{
+      state.dicts =state. dictList[props.type]
+      console.table(state.dicts)
+    }
+
   }
 
 });

+ 114 - 73
admin-web/src/views/admin/ordering/index.vue

@@ -31,80 +31,90 @@
 
       <el-form
           :model="state.formQuery"
-          ref="formRulesOneRef"
-          size="default" label-width="0px" class="mt5">
+          ref="queryRef"
+          size="default" label-width="0px" class="mt5 mb5">
         <el-input
-            v-model="state.formQuery.avatar"
-            placeholder="头像"
+            v-model="state.formQuery.userId"
+            placeholder="用户ID"
             clearable
             @blur="loadData(true)"
-            class="w150 mr10">
+            class="wd150 mr10">
         </el-input>
         <el-input
-            v-model="state.formQuery.companyId"
-            placeholder="公司id"
+            v-model="state.formQuery.stationId"
+            placeholder="站点ID"
             clearable
             @blur="loadData(true)"
-            class="w150 mr10">
+            class="wd150 mr10">
         </el-input>
         <el-input
-            v-model="state.formQuery.lastLoginTime"
-            placeholder="最后登录时间"
+            v-model="state.formQuery.startChargeSeq"
+            placeholder="充电订单号(EN+)"
             clearable
             @blur="loadData(true)"
-            class="w150 mr10">
+            class="wd150 mr10">
         </el-input>
         <el-input
-            v-model="state.formQuery.mobilePhone"
-            placeholder="手机号"
+            v-model="state.formQuery.connectorId"
+            placeholder="充电设备接口编码(EN+)"
             clearable
             @blur="loadData(true)"
-            class="w150 mr10">
+            class="wd150 mr10">
         </el-input>
-        <el-input
-            v-model="state.formQuery.nickname"
-            placeholder="昵称"
+        <el-date-picker
+            v-model="state.formQuery.startTime"
+            placeholder="充电开始时间"
             clearable
+            type="date"
             @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
-        <el-input
-            v-model="state.formQuery.password"
-            placeholder="密码"
+            class="wd150 mr10">
+        </el-date-picker>
+        <ext-date-picker
+            v-model="state.formQuery.endTime"
+            placeholder="充电结束时间"
             clearable
+            type="date"
             @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
-        <el-input
-            v-model="state.formQuery.status"
-            placeholder="0:禁用 1:启用"
+            class="wd150 mr10">
+        </ext-date-picker>
+        <ext-d-select
+            v-model="state.formQuery.orderStatus"
+            type="ChargeOrder.orderStatus"
+            placeholder="订单状态"
             clearable
             @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
-        <el-input
-            v-model="state.formQuery.updateTime"
-            placeholder=""
+            class="wd150 mr10">
+        </ext-d-select>
+        <ext-d-select
+            v-model="state.formQuery.chargeStatus"
+            placeholder="充电状态"
             clearable
+            type="ChargeOrder.chargeStatus"
             @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
-        <el-input
-            v-model="state.formQuery.username"
-            placeholder="用户名"
+            class="wd150 mr10">
+        </ext-d-select>
+        <ext-d-select
+            v-model="state.formQuery.stopReason"
+            placeholder="充电停止原因"
             clearable
+            type="ChargeOrder.stopReason"
             @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
+            class="wd150 mr10">
+        </ext-d-select>
+        <ext-d-select
+            v-model="state.formQuery.invoiceStatus"
+            placeholder="发票状态"
+            clearable
+            type="ChargeOrder.invoiceStatus"
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </ext-d-select>
+
 
-        <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-button class="ml10"  plain size="default" type="success" @click="loadData(true)">
+          <SvgIcon name="ele-Search"/>
+          查询
+        </el-button>
       </el-form>
 
       <el-table
@@ -121,7 +131,6 @@
         <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"
@@ -137,8 +146,30 @@
             <template v-if="field.prop==='expand'">
               <p style="padding-left: 2em;" v-html="row[field.prop]"></p>
             </template>
+            <template v-else-if="'totalMoney'===field.prop">
+              {{u.fmt.fmtMoney(row[field.prop])}}
+            </template>
+            <template v-else-if="'elecMoney'===field.prop">
+              {{u.fmt.fmtMoney(row[field.prop])}}
+            </template>
+            <template v-else-if="'serviceMoney'===field.prop">
+              {{u.fmt.fmtMoney(row[field.prop])}}
+            </template>
+            <template v-else-if="'orderStatus'===field.prop">
+              <ext-d-label type="ChargeOrder.orderStatus" v-model="row[field.prop]"/>
+            </template>
+            <template v-else-if="'chargeStatus'===field.prop">
+              <ext-d-label type="ChargeOrder.chargeStatus" v-model="row[field.prop]"/>
+            </template>
+            <template v-else-if="'stopReason'===field.prop">
+              <ext-d-label type="ChargeOrder.stopReason" v-model="row[field.prop]"/>
+            </template>
+          <template v-else-if="'invoiceStatus'===field.prop">
+              <ext-d-label type="ChargeOrder.invoiceStatus" v-model="row[field.prop]"/>
+            </template>
+
             <template v-else>
-              <div>row[field.prop]</div>
+              <div>{{row[field.prop]}}</div>
             </template>
 
           </template>
@@ -148,30 +179,33 @@
       <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
     </el-card>
   </div>
-  <AdminUserDialog ref="adminUserDialogRef" @refresh="loadData(true)"/>
+<!--  <ChargeOrderDialog ref="chargeOrderDialogRef" @refresh="loadData(true)"/>-->
 </template>
 
-<script setup lang="ts" name="AdminUserList">
+<script setup lang="ts" name="ChargeOrderList">
 import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
 import {$body,$get} from "/@/utils/request";
 import {Msg} from "/@/utils/message";
-
+import u from "/@/utils/u"
 
 import ExtPage from '/@/components/form/ExtPage.vue'
 
 import mittBus from '/@/utils/mitt';
+import ExtDatePicker from "/@/components/form/ExtDatePicker.vue";
+import ExtDSelect from "/@/components/form/ExtDSelect.vue";
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
 
-const AdminUserDialog = defineAsyncComponent(() => import("/@/views/page/AdminUserDialog.vue"));
+// const ChargeOrderDialog = defineAsyncComponent(() => import("/@/views/page/ChargeOrderDialog.vue"));
 
 //定义引用
 const queryRef = ref();
-const adminUserDialogRef = ref();
+const chargeOrderDialogRef = ref();
 
 //定义变量
 const state = reactive({
   formQuery: {},
   pageQuery: {
-    pageNumber: 1,
+    pageNum: 1,
     pageSize: 10,
     total: 0
   },
@@ -180,16 +214,22 @@ const state = reactive({
     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: '站点ID', prop: 'stationId',width:130, resizable: true, fixed: 'left'},
+      {label: '充电订单号(EN+)', prop: 'startChargeSeq', width:300, resizable: true, fixed: 'left'},
+      {label: '充电设备接口编码(EN+)', prop: 'connectorId', width:200, resizable: true},
+      {label: '充电开始时间', prop: 'startTime', sortable: 'custom', width:180, resizable: true},
+      {label: '充电结束时间', prop: 'endTime', sortable: 'custom',width:180,  resizable: true},
+      {label: '累积总金额(元)', prop: 'totalMoney', width:150, resizable: true},
+      {label: '累积电费(元)', prop: 'elecMoney', width:150, resizable: true},
+      {label: '累积服务费(元)', prop: 'serviceMoney', width:150, resizable: true},
+      // {label: '时段数:0~32', prop: 'sumPeriod', width:150, resizable: true},
+      // {label: '充电明细信息', prop: 'chargeDetail', width:150, resizable: true},
+      {label: '订单状态', prop: 'orderStatus', width:150, resizable: true},
+      {label: '充电状态', prop: 'chargeStatus', width:150, resizable: true},
+      {label: '充电停止原因', prop: 'stopReason', width:150, resizable: true},
+      {label: '发票状态', prop: 'invoiceStatus', width:150, resizable: true},
+      // {label: '创建时间', prop: 'createTime', sortable: 'custom', width:150, resizable: true},
+      // {label: '更新时间', prop: 'updateTime', sortable: 'custom',width:150,  resizable: true},
       {
         label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
       }
@@ -219,13 +259,13 @@ onMounted(() => {
     state.tableData.height = bodyHeight - queryHeight - 220
   })
 
-  mittBus.on("adminUser.refresh", () => {
+  mittBus.on("chargeOrder.refresh", () => {
     loadData();
   })
 });
 
 onBeforeUnmount(() => {
-  mittBus.off("adminUser.refresh")
+  mittBus.off("chargeOrder.refresh")
 })
 
 
@@ -233,13 +273,14 @@ onBeforeUnmount(() => {
 // 初始化表格数据
 const loadData = (refresh: boolean = false) => {
   if (refresh) {
-    state.pageQuery.pageNumber = 1;
+    state.pageQuery.pageNum = 1;
   }
   state.tableData.loading = true;
-  $body(`/adminUser/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
-    let {list, count} = res;
+  $get(`/custom/listChargeOrders`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    let {list, total} = res;
+    console.log(list)
     state.tableData.data = list;
-    state.pageQuery.total = count;
+    state.pageQuery.total = total;
     state.tableData.loading = false;
   }).catch(e => {
     console.error(e)
@@ -249,13 +290,13 @@ const loadData = (refresh: boolean = false) => {
 
 // 打开修改用户弹窗
 const onRowClick = (type: string, row: any) => {
-  adminUserDialogRef.value.open(type, row);
+  chargeOrderDialogRef.value.open(type, row);
 };
 
 // 删除用户
 const onRowDel = (row: any) => {
   Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
-    $get(`/adminUser/delete/${row.id}`).then(() => {
+    $get(`/chargeOrder/delete/${row.id}`).then(() => {
       Msg.message("删除成功", 'success')
     }).catch(() => {
       Msg.message("删除失败", 'error')

+ 206 - 283
admin-web/src/views/admin/role/index.vue

@@ -1,333 +1,256 @@
+<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-role-container layout-padding">
-    <div class="system-role-padding layout-padding-auto layout-padding-view">
-      <div class="system-user-search mb15">
-        <el-input v-model="state.formQuery.roleAlias" @input="loadData" clearable size="default"
-                  placeholder="请输入角色名称" style="max-width: 180px"></el-input>
-
-        <ext-button icon="ele-Search" type="primary" plain class="ml10" @click="loadData"  name="查询"/>
-<!--        <el-button size="default" type="primary" class="ml10">-->
-<!--          <el-icon>-->
-<!--            <ele-Search/>-->
-<!--          </el-icon>-->
-<!--          查询-->
-<!--        </el-button>-->
-        <el-button size="default" type="success" class="ml10" @click="handleOpenDialog(0,false)">
-          <el-icon>
-            <ele-FolderAdd/>
-          </el-icon>
-          新增角色
-        </el-button>
-        <el-button v-if="state.changed" size="default" type="success" class="ml10" @click="handleSaveRolePermission">
-          <SvgIcon name="ele-Printer"/>
-          保存设置
+  <div class="system-container layout-padding">
+    <el-card shadow="hover" class="layout-padding-auto">
+
+
+      <el-form
+          :model="state.formQuery"
+          ref="queryRef"
+          size="default" label-width="0px" class="mt5 mb5">
+        <el-input
+            v-model="state.formQuery.companyId"
+            placeholder="公司id"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.parentId"
+            placeholder="父角色id"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.roleName"
+            placeholder="角色名"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.roleDesc"
+            placeholder="角色描述"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.permissions"
+            placeholder="角色列表"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.updateTime"
+            placeholder="更新时间"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+
+
+        <el-button class="ml10"  plain size="default" type="success" @click="loadData(true)">
+          <SvgIcon name="ele-Search"/>
+          查询
         </el-button>
-      </div>
+      </el-form>
+
       <el-table
-          ref="tableRef"
-          :data="state.tableData.data"
-          v-loading="state.tableData.loading"
           border
+          stripe="stripe"
+          :height="state.tableData.height"
+          highlight-current-row
+          current-row-key="id"
           row-key="id"
-          :tree-props="{children:'children'}"
-          @cell-click="handleToggleRoleCheck"
-          style="width: 100%">
+          :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="(col,idx) in state.columns"
-            :key="col.prop"
-            :label="col.label"
-            :width="col.width"
-            :min-width="col.minWidth"
-            show-overflow-tooltip
-            :fixed="col.fixed"
-            :align="col.prop==='permName'?'left':'center'">
-          <template #header>
-            <template v-if="idx>0">
-              <div class="role-header-item">{{ col.label }}
-                <SvgIcon v-if="!state.immutableRoleList.includes(col.prop)" name="ele-Setting"
-                         @click="handleOpenDialog(col.prop.split('_')[1],false)"/>
-              </div>
+            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-if="idx===0">
-              权限
-              <span style="cursor: pointer;font-size: 12px;margin-left: 8px;color:#ccc" @click="handleExpandSwitch">{{state.expandAll?'收起':'展开'}} </span>
+            <template v-else>
+              <div>{{row[field.prop]}}</div>
             </template>
-          </template>
-          <template #default="scope">
-            <template v-if="scope.column.label!=='权限'">
-              <el-icon color="#5FB878" v-if="scope.row[col.prop]">
-                <CircleCheckFilled/>
-              </el-icon>
-              <span v-else>
-                  <SvgIcon name="ele-CircleCheck"></SvgIcon>
-                </span>
-            </template>
-            <template v-else ><span :title="scope.row.perm">{{ scope.row[col.prop] }}</span></template>
+
           </template>
         </el-table-column>
       </el-table>
-    </div>
 
-
-    <RoleDialog ref="roleDialogRef" @refresh="loadData()"/>
+      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
+    </el-card>
   </div>
+  <RoleDialog ref="roleDialogRef" @refresh="loadData(true)"/>
 </template>
 
-<script setup lang="ts" name="systemRole">
-import {defineAsyncComponent, reactive, onMounted, ref,nextTick} from 'vue';
-import {$body} from "/@/utils/request";
-import u from "/@/utils/u";
+<script setup lang="ts" name="RoleList">
+import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
+import {$body,$get} from "/@/utils/request";
 import {Msg} from "/@/utils/message";
-import {CircleCheckFilled} from '@element-plus/icons-vue'
-import ExtButton from "/@/components/form/ExtButton.vue";
 
-// 引入组件
-const RoleDialog = defineAsyncComponent(() => import('/@/views/admin/role/dialog.vue'));
 
-const tableRef = ref();
-// 定义变量内容
+import ExtPage from '/@/components/form/ExtPage.vue'
+
+import mittBus from '/@/utils/mitt';
+
+const RoleDialog = defineAsyncComponent(() => import("/@/views/page/RoleDialog.vue"));
+
+//定义引用
+const queryRef = ref();
 const roleDialogRef = ref();
+
+//定义变量
 const state = reactive({
-  tableData: {
-    data: [] as Array<any>,
-    loading: false,
-  },
+  formQuery: {},
   pageQuery: {
-    pageIndex: 1,
-    pageSize: 20,
+    pageNum: 1,
+    pageSize: 10,
+    total: 0
   },
-  formQuery: {
-    search: null,
+  tableData: {
+    height: 500,
+    data: [] as Array < any >,
+    loading: false,
+    columns: [
+      {type: 'selection', width: 60, align: 'center', fixed: 'left'},
+      {label: '角色名', prop: 'roleName', resizable: true},
+      {label: '角色描述', prop: 'roleDesc', resizable: true},
+      {label: '角色列表', prop: 'permissions', resizable: true},
+      {label: '创建时间', prop: 'createTime', sortable: 'custom', resizable: true},
+      {label: '更新时间', prop: 'updateTime', sortable: 'custom', resizable: true},
+      {
+        label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
+      }
+    ],
   },
-  columns: [{label: '权限', prop: 'permName', width: 200, fixed: 'left'}] as Array<IBaseField>,
-  expandAll: false,
-  immutableRoleList: [] as Array<string>,
-  changed : false
-});
+})
 
-const handleExpandSwitch = ()=>{
-  state.expandAll = !state.expandAll;
-  nextTick(()=>{
-    state.tableData.data.forEach(row=>{
-      tableRef.value.toggleRowExpansion(row,state.expandAll);
-    })
-  })
-}
 
-const loadPermissionList = (roleList: Array<any>) => {
-  $body(`/permission/list`, {pageSize: -1}).then((res: any) => {
-    //构造权限数组
-    let data = [] as Array<any>;
-    var permMap = u.groupByKey(res.list, "pid");
-    // console.log(permMap)
-    let roleMap = new Map();
-    state.immutableRoleList = [] as Array<string>;
-    roleList.forEach(role => {
-      if (role.immutable) {
-
-        state.immutableRoleList.push('role_' + role.id);
-      }
-      state.columns.push({
-        label: role.roleAlias || role.name,
-        prop: 'role_' + role.id,
-        width: (role.roleAlias || role.name).length * 24 + 45,
-      });
-      roleMap.set(role.id, role)
-    });
-    //console.log(state.columns)
-    let topPermissionList = permMap['0']
-    if (u.isEmptyOrNull(topPermissionList)) {
-      Msg.message("没有权限数据", 'error')
-      state.tableData.loading = false;
-      return;
-    }
+// 监听双向绑定 modelValue 的变化
+// watch(
+//         () => state.pageIndex,
+//         () => {
+//
+//         }
+// );
 
-    topPermissionList.forEach((top: any) => {
-      let {id, name, perm} = top;
-      let childrenPermissionList = permMap[id.toString()];
-      let record = {
-        children: [] as Array<any>,
-        permName: name,
-        id: id,
-        perm: perm,
-        // hasChildren: !u.isEmptyOrNull(childrenPermissionList)
-      } as any;
-      roleList.forEach(role => {
-        record['role_' + role.id] = !!(role.perms && role.perms.includes(perm));
-      })
-
-      let children = [] as Array<any>;
-      if (!u.isEmptyOrNull(childrenPermissionList)) {
-        childrenPermissionList.forEach((child: any) => {
-          let childRecord = {
-            permName: child.name,
-            id: child.id,
-            perm: child.perm,
-          } as any;
-          roleList.forEach(role => {
-            childRecord['role_' + role.id] = !!(role.perms && role.perms.includes(child.perm));
-          })
-          children.push(childRecord);
-        });
-        //
-        record.children = children;
-      }
-      data.push(record);
-    })
+//生命周期钩子
+onBeforeMount(() => {
+})
+
+onMounted(() => {
+  loadData();
 
+  nextTick(() => {
+    let bodyHeight = document.body.clientHeight;
+    let queryHeight = queryRef.value.$el.clientHeight;
+    state.tableData.height = bodyHeight - queryHeight - 220
+  })
 
-    state.tableData.data = data;
-    console.log(state.tableData.data)
-    state.tableData.loading = false;
-  }).catch(e => {
-    //console.log(e)
-    state.tableData.loading = false;
+  mittBus.on("role.refresh", () => {
+    loadData();
   })
-}
+});
+
+onBeforeUnmount(() => {
+  mittBus.off("role.refresh")
+})
+
+
+//region 方法区
 // 初始化表格数据
-const loadData = () => {
-  state.columns = [{label: '权限', prop: 'permName', width: 120, fixed: 'left'}];
-  state.tableData.data = [];
+const loadData = (refresh: boolean = false) => {
+  if (refresh) {
+    state.pageQuery.pageNum = 1;
+  }
   state.tableData.loading = true;
-  $body(`/role/list`, {...state.formQuery, immutableSort: 2}).then((res: any) => {
-    let {list} = res;
-    //构造权限数组
-    loadPermissionList(list);
+  $body(`/admin-user/listRole`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    let {list, total} = res;
+    state.tableData.data = list;
+    state.pageQuery.total = total;
+    state.tableData.loading = false;
   }).catch(e => {
     console.error(e)
     state.tableData.loading = false;
   })
 };
-// 打开新增角色弹窗
-const handleOpenDialog = (id: number, readonly: boolean) => {
-  roleDialogRef.value.openDialog(id, readonly);
-};
 
-const handleToggleRoleCheck = (row, column, cell, event) => {
-  state.changed = true;
-  console.log(row, column, cell)
-  if(column.rawColumnKey==='permName'){
-    // tableRef.value
-    return;
-  }
+// 打开修改用户弹窗
+const onRowClick = (type: string, row: any) => {
+  roleDialogRef.value.open(type, row);
+};
 
-  let index = state.tableData.data.findIndex(k => k.id === row.id);
-  if (index >= 0) {
-    let record = state.tableData.data[index];
-    //console.log(record)
-    let bol = !record[column.rawColumnKey];
-    state.tableData.data[index][column.rawColumnKey] = bol;
-    if (!u.isEmptyOrNull(record.children)) {
-      record.children.forEach((r:any)=>{
-        r[column.rawColumnKey]= bol;
-      })
-    }
-  } else {
-    state.tableData.data.forEach(record => {
-      if (!u.isEmptyOrNull(record.children)) {
-        let r = record.children.find((k: any) => k.id === row.id);
-        if (r) {
-          r[column.rawColumnKey] = !r[column.rawColumnKey]
-          return;
-        }
-      }
+// 删除用户
+const onRowDel = (row: any) => {
+  Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
+    $get(`/role/delete/${row.id}`).then(() => {
+      Msg.message("删除成功", 'success')
+    }).catch(() => {
+      Msg.message("删除失败", 'error')
     })
-  }
-}
-
-
-const handleSaveRolePermission = () => {
-  let updateRoles = [] as Array<any>;
-  let map = new Map();
-
-  let keys = Object.keys(state.tableData.data[0])
-  //console.log(state.tableData.data)
-  state.tableData.data.forEach(record => {
-    keys.forEach((k: string) => {
-      if (k.startsWith("role_")) {
-        if (record[k]) {
-          let roleId = k.split("_")[1];
-          let newVar = map.get(roleId);
-          if (!newVar) {
-            map.set(roleId, [record.perm])
-          } else {
-            newVar.push(record.perm);
-            map.set(roleId, newVar);
-          }
-        }
-      }
-      if (!u.isEmptyOrNull(record.children)) {
-        record.children.forEach((child: any) => {
-          if (k.startsWith("role_")) {
-            if (child[k]) {
-              let roleId = k.split("_")[1];
-              let newVar = map.get(roleId);
-              if (!newVar) {
-                map.set(roleId, [child.perm])
-              } else {
-                newVar.push(child.perm);
-                map.set(roleId, newVar);
-              }
-            }
-
-          }
-        })
-      }
-    })
-  })
-
-  //console.log(map)
-  map.forEach((key: string, valList: Array<string>) => {
-    updateRoles.push({
-      id: Number(valList),
-      perms: key
-    });
-  })
+  });
+};
 
-  $body(`/role/modifyPermissions`,updateRoles).then(()=>{
-    Msg.message("更新成功","success");
-    state.changed = false;
-    nextTick(()=>{
-    loadData();
-    })
-  })
+const handleTableSelectionChange = (selection: any) => {
+  console.log("handleTableSelectionChange>>", selection)
+  // emit("on-check-change", selection)
 }
 
-// 页面加载时
-onMounted(() => {
-  loadData();
-});
-</script>
-
-<style scoped lang="scss">
-.role-header-item {
-  display: inline-flex;
-  justify-content: space-around;
-  align-items: center;
-
-  i {
-    margin-left: 3px;
-    cursor: pointer;
-  }
+const handleTableSortChange = (column, prop, order) => {
+  console.log("handleTableSortChange>>", column, prop, order)
+  // emit("on-sort-change", column)
 }
 
-.permission-box {
-}
 
-.system-role-container {
-  .system-role-padding {
-    padding: 15px;
+//endregion
 
-    .el-table {
-      flex: 1;
-    }
-  }
-}
 
-:deep(.el-table thead th.el-table__cell ) {
-  background: var(--el-fill-color-light);
-}
-</style>
+// 暴露变量
+// defineExpose({
+//     loadData,
+// });
+</script>

+ 241 - 6
admin-web/src/views/admin/station/list/index.vue

@@ -1,13 +1,248 @@
+<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="queryRef"
+          size="default" label-width="0px" class="mt5 mb5">
+
+        <el-input
+            v-model="state.formQuery.stationName"
+            placeholder="站点名称"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+
+        <el-button class="ml10"  plain size="default" type="success" @click="loadData(true)">
+          <SvgIcon name="ele-Search"/>
+          查询
+        </el-button>
+      </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
+            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-if="'stationType'===field.prop">
+              <ext-d-label type="Station.type" v-model="row[field.prop]"/>
+            </template>
+            <template v-else-if="'stationStatus'===field.prop">
+              <ext-d-label type="Station.status" v-model="row[field.prop]"/>
+            </template>
+            <template v-else-if="'construction'===field.prop">
+              <ext-d-label type="Station.construction" v-model="row[field.prop]"/>
+            </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>
+  <StationDialog ref="stationDialogRef" @refresh="loadData(true)"/>
 </template>
 
-<script>
-export default {
-  name: "index"
+<script setup lang="ts" name="StationList">
+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';
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
+
+const StationDialog = defineAsyncComponent(() => import("/@/views/page/StationDialog.vue"));
+
+//定义引用
+const queryRef = ref();
+const stationDialogRef = ref();
+
+//定义变量
+const state = reactive({
+  formQuery: {},
+  pageQuery: {
+    pageNum: 1,
+    pageSize: 10,
+    total: 0
+  },
+  tableData: {
+    height: 500,
+    data: [] as Array < any >,
+    loading: false,
+    columns: [
+      {label: 'en+充电站id', prop: 'stationId',width:160, resizable: true,fixed:'left'},
+      // {label: 'en+运营商id', prop: 'operatorId', resizable: true},
+      {label: '所属运营平台', prop: 'equipmentOwnerId', width:160,resizable: true,fixed:'left'},
+      {label: '站点名称', prop: 'stationName',width:160, resizable: true},
+      // {label: '充电中国家代码:CN', prop: 'countryCode', resizable: true},
+      // {label: '充电站省市辖区编码', prop: 'areaCode', resizable: true},
+      {label: '地址', prop: 'address',width:160, resizable: true},
+      {label: '站点电话', prop: 'stationTel', width:120,resizable: true},
+      {label: '服务电话', prop: 'serviceTel', width:140, resizable: true},
+      {label: '站点类型', prop: 'stationType', width:120,resizable: true},
+      {label: '站点状态', prop: 'stationStatus', width:120,resizable: true},
+      {label: '充电车位数量', prop: 'parkingNum',width:160, resizable: true},
+      // {label: '充电桩位置坐标', prop: 'location', resizable: true},
+      // {label: '站点引导', prop: 'siteGuide', resizable: true},
+      {label: '建设场所', prop: 'construction',  width:160, resizable: true},
+      {label: '使用车型描述', prop: 'matchCars', width:160,resizable: true},
+      {label: '车位楼层及数量描述', prop: 'parkInfo',width:160, resizable: true},
+      {label: '营业时间描述', prop: 'businessHours', width:160,resizable: true},
+      {label: '充电费描述', prop: 'electricityFee', width:160, resizable: true},
+      {label: '服务费率描述', prop: 'serviceFee',  width:120,resizable: true},
+      {label: '停车费', prop: 'parkFee', width:120, resizable: true},
+      {label: '支付方式', prop: 'payment',  width:120,resizable: true},
+      {label: '是否支持预约', prop: 'supportOrder',  width:120,resizable: true},
+      {label: '备注', prop: 'remark', width:160,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("station.refresh", () => {
+    loadData();
+  })
+});
+
+onBeforeUnmount(() => {
+  mittBus.off("station.refresh")
+})
+
+
+//region 方法区
+// 初始化表格数据
+const loadData = (refresh: boolean = false) => {
+  if (refresh) {
+    state.pageQuery.pageNumber = 1;
+  }
+  state.tableData.loading = true;
+  $get(`/station/listStation`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    let list= 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) => {
+  stationDialogRef.value.open(type, row);
+};
+
+// 删除用户
+const onRowDel = (row: any) => {
+  Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
+    $get(`/station/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>

+ 140 - 211
admin-web/src/views/admin/user/index.vue

@@ -4,6 +4,7 @@
   :deep(.el-card__body) {
     display: flex;
     flex-direction: column;
+    justify-content: space-between;
     flex: 1;
     overflow: auto;
 
@@ -26,196 +27,145 @@
 <template>
   <div class="system-container layout-padding">
     <el-card shadow="hover" class="layout-padding-auto">
-      <ext-query-form
-          class="page-search"
+
+
+      <el-form
+          :model="state.formQuery"
           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)"/>
+          size="default" label-width="0px" class="mt5 mb5">
+        <el-input
+            v-model="state.formQuery.username"
+            placeholder="用户名"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.nickname"
+            placeholder="昵称"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.mobilePhone"
+            placeholder="手机号"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+
+        <ext-d-select
+            v-model="state.formQuery.status"
+            placeholder="状态"
+            type="AdminUser.status"
+            clearable
+            @on-change="loadData(true)"
+            class="wd150 mr10"/>
+<!--        <el-input-->
+<!--            v-model="state.formQuery.status"-->
+<!--            placeholder="状态"-->
+<!--            clearable-->
+<!--            @blur="loadData(true)"-->
+<!--            class="wd150 mr10">-->
+<!--        </el-input>-->
+
+
+
+        <el-button class="ml10"  plain size="default" type="success" @click="loadData(true)">
+          <SvgIcon name="ele-Search"/>
+          查询
+        </el-button>
+      </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>
-      </ext-query-form>
-
-      <el-row :gutter="20">
-        <el-col :span="6">
-          <el-input size="default" v-model="state.filterText" placeholder="所属部门"/>
-          <el-tree-v2
-              ref="treeRef"
-              class="filter-tree"
-              :data="state.treeData"
-              :props="{  children: 'children',  label: 'name'}"
-              highlight-current
-              :default-expand-all="true"
-              :filter-node-method="filterNode"
-              @node-click="handleNodeClick"
-          />
-        </el-col>
-        <el-col :span="18">
-          <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
+            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-if="'status'===field.prop">
+              <ext-d-label type="AdminUser.status" v-model="row[field.prop]"/>
+            </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';
+import ExtDSelect from "/@/components/form/ExtDSelect.vue";
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
 
-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,
+    pageNum: 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)])
-      }
-    },
-    {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)):'')
+    height: 500,
+    data: [] as Array < any >,
+    loading: false,
+    columns: [
+      {label: '用户名', prop: 'username',width:120, resizable: true, fixed: 'left'},
+      {label: '昵称', prop: 'nickname',width:180, resizable: true},
+      {label: '手机号', prop: 'mobilePhone', width:130,resizable: true},
+      {label: '状态', prop: 'status', sortable: 'custom',  width:130,align: 'center'},
+      {label: '最后登录时间', prop: 'lastLoginTime', width:180,sortable: 'custom', resizable: true},
+      {label: '创建时间', prop: 'createTime', width:180,sortable: 'custom', resizable: true},
+      {
+        label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
       }
-    },
-    {
-      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)
+    ],
+  },
 })
 
 
@@ -229,29 +179,24 @@ watch(() => state.filterText, (val) => {
 
 //生命周期钩子
 onBeforeMount(() => {
-  let token = Session.get("token")
-  let encodeToken = encodeURIComponent(token)
-  let exportUrl = `poi/export?type=user&X-Token=${encodeToken}`
-  //导入导出参数配置
-  state.importConfig = {
-    auths: ['user.add'],
-    url: `poi/import?type=user&X-Token=${encodeToken}`,
-    template: `${exportUrl}&isTemplate=true`
-  }
-
-  state.exportConfig = {url: exportUrl,}
-
 })
 
 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")
 })
 
 
@@ -259,13 +204,13 @@ onMounted(() => {
 // 初始化表格数据
 const loadData = (refresh: boolean = false) => {
   if (refresh) {
-    state.pageQuery.pageIndex = 1;
+    state.pageQuery.pageNum = 1;
   }
   state.tableData.loading = true;
-  $body(`/user/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
-    let {list, count} = res;
+  $get(`/admin-user/listAdminUser`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    let {list, total} = res;
     state.tableData.data = list;
-    state.pageQuery.total = count;
+    state.pageQuery.total = total;
     state.tableData.loading = false;
   }).catch(e => {
     console.error(e)
@@ -275,12 +220,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')
@@ -288,33 +234,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
 

+ 3 - 0
admin/src/main/java/com/kym/admin/controller/DataDictController.java

@@ -2,6 +2,7 @@ package com.kym.admin.controller;
 
 import com.kym.common.IQuery;
 import com.kym.common.R;
+import com.kym.common.annotation.SysLog;
 import com.kym.common.controller.IController;
 import com.kym.entity.miniapp.DataDict;
 import com.kym.service.miniapp.DataDictService;
@@ -38,6 +39,7 @@ public class DataDictController extends IController {
      * @param query
      * @return
      */
+    @SysLog("查询字典列表")
     @PostMapping("list")
     public R<?> list(@RequestBody IQuery<DataDict> query) {
         return resp(() -> dataDictService.list(query));
@@ -50,6 +52,7 @@ public class DataDictController extends IController {
      * @param query
      * @return
      */
+    @SysLog("查询字典列表")
     @PostMapping("listV2")
     public R<?> listV2(@RequestBody IQuery<DataDict> query) {
         return resp(() -> dataDictService.listV2(query));