Ver Fonte

用户列表

zuy há 2 anos atrás
pai
commit
5b0db5a777

+ 14 - 6
admin-web/src/components/form/ExtDLabel.vue

@@ -117,7 +117,14 @@ const props = defineProps({
 const state = reactive({
   text: '' as string,
   style: {color: '#000000'},
-  color:'#fff'
+  color:'#fff',
+  colorList:["#FFB800","#009688","#1E9FFF","#00C7D2","#599CDE","#FF5722","#eb2f96","#4a5055"],
+  dicts:{
+    'User.status':[
+        {label:'有效',value:1},
+        {label:'无效',value:0},
+    ]
+  }
 })
 const setupColorStyle = (hex: string = "#000000") => {
   let hexToRgb = u.hexToRgb(hex);
@@ -138,19 +145,20 @@ onMounted(() => {
       state.style = setupColorStyle(color);
     }
   } else {
-    const sessionDicts = Session.get("dicts");
+   /* const sessionDicts = Session.get("dicts");
     if (u.isEmptyOrNull(sessionDicts)) {
       return '--'
-    }
-    let dicts = sessionDicts[`${props.type}`]
+    }*/
+    let dicts =state.dicts[`${props.type}`]
     if(u.isEmptyOrNull(dicts)){
-      return;
+      return "-";
     }
+    console.log(props.modelValue)
     let dict = (<Dicts>dicts).find(k => k.value == props.modelValue);
 
     if (dict) {
       state.text = dict.label;
-      state.style = setupColorStyle(dict.color);
+      state.style = setupColorStyle(state.colorList[dict.value%8]);
     }
   }
 

+ 13 - 6
admin-web/src/components/form/ExtDSelect.vue

@@ -18,7 +18,7 @@
         :key="idx"
         :label="item.label"
         :value="item.value">
-      <span class="option-item" style="float: left"><i :style="setupColorStyle(item.color)">{{  item.label }}</i></span>
+      <span class="option-item" style="float: left"><i :style="setupColorStyle(state.colorList[item.value%8])">{{  item.label }}</i></span>
       <!--        :style="setupColorStyle(item.color)"-->
     </el-option>
   </el-select>
@@ -65,8 +65,15 @@ const props = defineProps({
 })
 
 const state = reactive({
-  dicts: [] as Array<any>,
-  dataVal:null as any
+  dicts:[],
+  dataVal:null as any,
+  colorList:["#FFB800","#009688","#1E9FFF","#00C7D2","#599CDE","#FF5722","#eb2f96","#4a5055"],
+  dictList:{
+    'User.status':[
+      {label:'有效',value:1},
+      {label:'无效',value:0},
+    ]
+  }
 })
 
 const emit = defineEmits(['update:modelValue','on-change']);
@@ -100,11 +107,11 @@ onMounted(() => {
   if (!u.isEmptyOrNull(props.dataRange)) {
     state.dicts = props.dataRange;
   } else {
-    const dicts = Session.get("dicts");
+   /* const dicts = Session.get("dicts");
     if (u.isEmptyOrNull(dicts)) {
       return '--'
-    }
-    state.dicts = dicts[props.type]
+    }*/
+    state.dicts =state. dictList[props.type]
     console.table(state.dicts)
   }
 

+ 4 - 4
admin-web/src/components/form/ExtPage.vue

@@ -2,7 +2,7 @@
   <el-row style="margin-top: 8px;">
     <el-col :span="24">
       <el-pagination
-          :current-page="state.page.pageIndex"
+          :current-page="state.page.pageNum"
           :page-size="state.page.pageSize"
           :page-sizes="[10, 20, 50, 100]"
           :small="true"
@@ -32,7 +32,7 @@ const props = defineProps({
 
 const state = reactive({
   page: {
-    pageIndex: 1,
+    pageNum: 1,
     pageSize: 20,
     total: 0
   } as IPage
@@ -55,7 +55,7 @@ onMounted(() => {
 
 const setupPage = () => {
   if (props.value) {
-    state.page.pageIndex = props.value.pageIndex;
+    state.page.pageNum = props.value.pageIndex;
     state.page.pageSize = props.value.pageSize;
     state.page.total = props.value.total;
   }
@@ -68,7 +68,7 @@ const handleSizeChange = (val: number) => {
   console.log(`${val} items per page`)
 }
 const handleCurrentChange = (val: number) => {
-  state.page.pageIndex = val;
+  state.page.pageNum = val;
   emit("update:value", state.page)
   emit("change", state.page)
   console.log(`current page: ${val}`)

+ 15 - 18
admin-web/src/layout/navBars/breadcrumb/toolbar.vue

@@ -2,7 +2,8 @@
   <div class="layout-navbars-breadcrumb-user pr15" :style="{ flex: layoutUserFlexNum }">
     <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onComponentSizeChange">
       <div class="layout-navbars-breadcrumb-user-icon">
-        <i class="iconfont icon-ziti" :title="$t('message.user.title0')"></i>
+<!--        <i class="iconfont icon-ziti" :title="$t('message.user.title0')"></i>-->
+        <el-icon class="el-icon--right"><ele-Switch /></el-icon>
       </div>
       <template #dropdown>
         <el-dropdown-menu>
@@ -13,7 +14,7 @@
       </template>
     </el-dropdown>
 
-    <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
+<!--    <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
       <div class="layout-navbars-breadcrumb-user-icon">
         <i
             class="iconfont"
@@ -28,22 +29,17 @@
           <el-dropdown-item command="zh-tw" :disabled="state.disabledI18n === 'zh-tw'">繁體中文</el-dropdown-item>
         </el-dropdown-menu>
       </template>
-    </el-dropdown>
+    </el-dropdown>-->
 
-    <div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
+<!--    <div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
       <el-icon :title="$t('message.user.title2')">
         <ele-Search/>
       </el-icon>
-    </div>
+    </div>-->
 
     <template v-if="admin">
       <div class="layout-navbars-breadcrumb-user-icon" @click="onLayoutSetingClick">
-        <i class="icon-skin iconfont" :title="$t('message.user.title3')"></i>
-      </div>
-    </template>
-    <template v-else>
-      <div class="layout-navbars-breadcrumb-user-icon" @click="onSwitchTheme">
-        <i class="icon-skin iconfont" :title="$t('message.user.title3')"></i>
+        <el-icon class="el-icon--right"><ele-Tools /></el-icon>
       </div>
     </template>
 
@@ -64,11 +60,12 @@
     </div>
 
     <div class="layout-navbars-breadcrumb-user-icon mr10" @click="onScreenfullClick">
-      <i
+      <el-icon class="el-icon--right"><ele-FullScreen /></el-icon>
+<!--      <i
           class="iconfont"
           :title="state.isScreenfull ? $t('message.user.title6') : $t('message.user.title5')"
           :class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"
-      ></i>
+      ></i>-->
     </div>
 
     <el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
@@ -76,18 +73,18 @@
         <el-avatar :src="u.fmt.fmtImg(userInfos.avatar)" :size="35">
           <SvgIcon name="ele-User"/>
         </el-avatar>
-				{{ userInfos.name }}
+				{{ userInfos.username }}
 				<el-icon class="el-icon--right">
 					<ele-ArrowDown/>
 				</el-icon>
 			</span>
       <template #dropdown>
         <el-dropdown-menu>
-          <el-dropdown-item>
+<!--          <el-dropdown-item>
             <RouterLink target="_blank" to="/admin?oid=">
               <el-link type="primary">管理设置</el-link>
             </RouterLink>
-          </el-dropdown-item>
+          </el-dropdown-item>-->
           <!--					<el-dropdown-item command="/admin/home">{{ $t('message.user.dropdown1') }}</el-dropdown-item>-->
           <!--					<el-dropdown-item command="wareHouse">{{ $t('message.user.dropdown6') }}</el-dropdown-item>-->
           <el-dropdown-item command="/personal">{{ $t('message.user.dropdown2') }}</el-dropdown-item>
@@ -127,7 +124,7 @@ const Search = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/s
 // 定义变量内容
 const {locale, t} = useI18n();
 const router = useRouter();
-const stores = useUserInfo();
+const storesUserInfo = useUserInfo();
 const storesThemeConfig = useThemeConfig();
 
 const {themeConfig} = storeToRefs(storesThemeConfig);
@@ -157,7 +154,7 @@ const onSwitchTheme = ()=>{
 }
 
 const userInfos = computed(() => {
-  let user = Session.get('userInfo');
+  let user = storesUserInfo.userInfos
   console.error(user)
   return user || {};
 })

+ 1 - 0
admin-web/src/layout/routerView/parent.vue

@@ -102,6 +102,7 @@ watch(
 	() => route.fullPath,
 	() => {
 		state.refreshRouterViewKey = decodeURI(route.fullPath);
+    console.error(route.fullPath,	state.refreshRouterViewKey)
 	},
 	{
 		immediate: true,

+ 2 - 1
admin-web/src/router/backEnd.ts

@@ -30,7 +30,7 @@ const dynamicViewsModules: Record<string, Function> = Object.assign({}, { ...lay
  * @method useRequestOldRoutes().setRequestOldRoutes() 存储接口原始路由(未处理component),根据需求选择使用
  * @method setAddRoute 添加动态路由
  * @method setFilterMenuAndCacheTagsViewRoutes 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
- */
+ *!/
 export async function initBackEndControlRoutes() {
 	// 界面 loading 动画开始执行
 	// if (window.nextLoading === undefined) NextLoading.start();
@@ -53,6 +53,7 @@ export async function initBackEndControlRoutes() {
 	// 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
 	await setFilterMenuAndCacheTagsViewRoutes();
 }
+ */
 
 /**
  * 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组

+ 4 - 4
admin-web/src/router/frontEnd.ts

@@ -32,7 +32,7 @@ export async function initFrontEndControlRoutes() {
 	// if (useUserInfo().userInfos.roles.length <= 0) return Promise.resolve(true);
 	// 添加动态路由
 
-	await setAddRoute();
+	// await setAddRoute();
 
 	// 设置递归过滤有权限的路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
 	await setFilterMenuAndCacheTagsViewRoutes();
@@ -45,9 +45,9 @@ export async function initFrontEndControlRoutes() {
  * @link 参考:https://next.router.vuejs.org/zh/api/#addroute
  */
 export async function setAddRoute() {
-	console.log("添加路由",adminRoutes)
+	// console.log("添加路由",adminRoutes)
 	await setFilterRouteEnd().forEach((route: RouteRecordRaw) => {
-		console.log("添加路由:",route)
+		// console.log("添加路由:",route)
 		router.addRoute(route);
 	});
 }
@@ -167,7 +167,7 @@ export function setFilterHasPermsMenu(routes: any, permList:Array<string>) {
 		const item = { ...route };
 		if (hasMenuPermission(permList, item)) {
 			if (item.children) item.children = setFilterHasPermsMenu(item.children, permList);
-			console.log(item)
+			// console.log(item)
 			menuList.push(item);
 		}
 	});

+ 1 - 1
admin-web/src/router/index.ts

@@ -112,7 +112,7 @@ export function formatTwoStageRoutes(arr: any) {
 // 路由加载前
 router.beforeEach(async (to, from, next) => {
 
-    console.log("route>>>:", to, router)
+    console.log("route>>>:", from.path,to.path)
     NProgress.configure({showSpinner: true});
     if (to.meta.title) NProgress.start();
     const token = Session.get('token');

+ 22 - 24
admin-web/src/router/route.ts

@@ -80,14 +80,14 @@ export const adminRoutes: Array<RouteRecordRaw> = [
         path: '/',
         name: 'admin',
         component: () => import('/@/layout/index.vue'),
-        redirect: '/admin/home',
+        redirect: '/home',
         meta: {
             isKeepAlive: true,
             title: '管理后台'
         },
         children: [
             {
-                path: '/admin/home',
+                path: '/home',
                 name: 'adminHome1',
                 component: () => import('/@/views/admin/index.vue'),
                 meta: {
@@ -98,14 +98,14 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isAffix: false,
                     isIframe: false,
 
-                    icon: 'iconfont icon-zidingyibuju',
+                    icon: 'ele-Monitor',
                     color: 'yellow'
                     // perm:'admin'
                 }
             },
 
             {
-                path: '/admin/station',
+                path: '/station',
                 name: 'adminStation',
                 component: () => import('/@/layout/routerView/parent.vue'),
                 redirect: '/admin/station/list',
@@ -116,12 +116,11 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
-                    icon: 'ele-Menu',
-                    color: 'yellow'
+                    icon: 'ele-MapLocation',
                 },
                 children: [
                     {
-                        path: '/admin/station/list',
+                        path: '/station/list',
                         name: 'adminStationList',
                         component: () => import('/@/views/admin/station/list/index.vue'),
                         meta: {
@@ -136,7 +135,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                         },
                     },
                     {
-                        path: '/admin/station/endpoint',
+                        path: '/station/endpoint',
                         name: 'adminStationEndpoint',
                         component: () => import('/@/views/admin/station/endpoint/index.vue'),
                         meta: {
@@ -151,7 +150,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                         },
                     },
                     {
-                        path: '/admin/station/stat',
+                        path: '/station/stat',
                         name: 'adminStationStat',
                         component: () => import('/@/views/admin/station/stat/index.vue'),
                         meta: {
@@ -168,7 +167,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                 ]
             },
             {
-                path: '/admin/marketing',
+                path: '/marketing',
                 name: 'adminMarketing',
                 component: () => import('/@/views/admin/marketing/index.vue'),
                 meta: {
@@ -178,11 +177,11 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
-                    icon: 'ele-ChatRound',
+                    icon: 'ele-PieChart',
                 }
             },
             {
-                path: '/admin/ordering',
+                path: '/ordering',
                 name: 'adminOrdering',
                 component: () => import('/@/views/admin/ordering/index.vue'),
                 meta: {
@@ -192,11 +191,11 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
-                    icon: 'ele-ChatRound',
+                    icon: 'ele-Money',
                 }
             },
             {
-                path: '/admin/account',
+                path: '/account',
                 name: 'adminAccount',
                 component: () => import('/@/views/admin/account/index.vue'),
                 meta: {
@@ -206,11 +205,11 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
-                    icon: 'ele-ChatRound',
+                    icon: 'ele-User',
                 }
             },
             {
-                path: '/admin/finance',
+                path: '/finance',
                 name: 'adminFinance',
                 component: () => import('/@/views/admin/finance/index.vue'),
                 meta: {
@@ -220,11 +219,11 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
-                    icon: 'ele-ChatRound',
+                    icon: 'ele-Wallet',
                 }
             },
             {
-                path: '/admin/org',
+                path: '/org',
                 name: 'adminOrg',
                 component: () => import('/@/layout/routerView/parent.vue'),
                 redirect: '/admin/org/department',
@@ -235,12 +234,11 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
-                    icon: 'ele-Menu',
-                    color: 'yellow'
+                    icon: 'ele-Tools',
                 },
                 children: [
                     {
-                        path: '/admin/org/user',
+                        path: '/org/user',
                         name: 'orgUser',
                         component: () => import('/@/views/admin/user/index.vue'),
                         meta: {
@@ -255,7 +253,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                         },
                     },
                     {
-                        path: '/admin/org/role',
+                        path: '/org/role',
                         name: 'orgRole',
                         component: () => import('/@/views/admin/role/index.vue'),
                         meta: {
@@ -272,7 +270,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                 ]
             },
             {
-                path: '/admin/optList',
+                path: '/optList',
                 name: 'adminOptList',
                 component: () => import('/@/views/admin/log/opt/index.vue'),
                 meta: {
@@ -283,7 +281,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     isAffix: false,
                     isIframe: false,
 
-                    icon: 'ele-ChatRound',
+                    icon: 'ele-Cpu',
 
                 }
             },

+ 2 - 2
admin-web/src/stores/themeConfig.ts

@@ -105,7 +105,7 @@ export const useThemeConfig = defineStore('themeConfig', {
 			// 是否开启水印
 			isWartermark: true,
 			// 水印文案
-			wartermarkText: '充电小程序',
+			wartermarkText: 'K7充电',
 
 			/**
 			 * 其它设置
@@ -138,7 +138,7 @@ export const useThemeConfig = defineStore('themeConfig', {
 			 * 全局网站标题 / 副标题
 			 */
 			// 网站主标题(菜单导航、浏览器当前网页标题)
-			globalTitle: '充电小程序应用平台',
+			globalTitle: 'K7充电',
 			// 网站副标题(登录页顶部文字)
 			globalViceTitle: 'Lower Easier Business',
 			// 网站副标题(登录页顶部文字)

+ 1 - 1
admin-web/src/theme/app.scss

@@ -297,7 +297,7 @@ body,
 
 //固定宽度
 @for $i from 0 through 30 {
-	.w#{$i*5} {
+	.wd#{$i*5} {
 		width: #{$i*5}px !important;
 	}
 }

+ 1 - 1
admin-web/src/types/field.d.ts

@@ -15,7 +15,7 @@ declare type QueryFields<T extends QueryField = any> = T[];
 
 
 type IPage = {
-    pageIndex: number,
+    pageNum: number,
     pageSize: number,
     total?: number
 }

+ 2 - 2
admin-web/src/utils/loading.ts

@@ -9,7 +9,7 @@ import '/@/theme/loading.scss';
 export const NextLoading = {
 	// 创建 loading
 	start: () => {
-	/*	const bodys: Element = document.body;
+		const bodys: Element = document.body;
 		const div = <HTMLElement>document.createElement('div');
 		div.setAttribute('class', 'loading-next');
 		const htmls = `
@@ -29,7 +29,7 @@ export const NextLoading = {
 		`;
 		div.innerHTML = htmls;
 		bodys.insertBefore(div, bodys.childNodes[0]);
-		window.nextLoading = true;*/
+		window.nextLoading = true;
 	},
 	// 移除 loading
 	done: (time: number = 0) => {

+ 6 - 0
admin-web/src/utils/u.ts

@@ -500,6 +500,12 @@ const u = {
         tel: {type: 'string', pattern: /^[-\d]*$/, message: "电话只能包含数字和-"},
     },
     fmt: {
+        fmtMoney:function (money:number) {
+            if(!money){
+                return "0.00";
+            }
+            return ( money/100).toFixed(2);
+        },
         fmtUrl: function (v: string) {
             let token = Session.get('token')
             if(!v){

+ 41 - 81
admin-web/src/views/admin/account/index.vue

@@ -32,79 +32,34 @@
       <el-form
           :model="state.formQuery"
           ref="queryRef"
-          size="default" label-width="0px" class="mt5">
+          size="default" label-width="0px" class="mt5 mb5">
         <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="最后登录时间"
+            v-model="state.formQuery.username"
+            placeholder="用户名"
             clearable
             @blur="loadData(true)"
-            class="w150 mr10">
+            class="wd150 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">
+            class="wd150 mr10">
         </el-input>
-        <el-input
-            v-model="state.formQuery.password"
-            placeholder="密码"
-            clearable
-            @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
-        <el-input
+        <ext-d-select
             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="用户名"
+            placeholder="状态"
+            type="User.status"
             clearable
-            @blur="loadData(true)"
-            class="w150 mr10">
-        </el-input>
+            @on-change="loadData(true)"
+            class="wd150 mr10"/>
+
+        <el-button class="ml10"  plain size="default" type="success" @click="loadData(true)">
+          <SvgIcon name="ele-Search"/>
+          查询
+        </el-button>
 
-        <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
@@ -121,7 +76,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"
@@ -134,11 +88,14 @@
             :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 v-if="['rechargeAmount','totalMoney'].includes(field.prop)">
+              {{ u.fmt.fmtMoney(row[field.prop]) }}
+            </template>
+            <template v-else-if="'status'===field.prop">
+             <ext-d-label type="User.status" v-model="row[field.prop]"/>
             </template>
             <template v-else>
-              <div>row[field.prop]</div>
+              <div>{{ row[field.prop] }}</div>
             </template>
 
           </template>
@@ -153,13 +110,16 @@
 
 <script setup lang="ts" name="AdminUserList">
 import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
-import {$body,$get} from "/@/utils/request";
+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 ExtDLabel from "/@/components/form/ExtDLabel.vue";
+import ExtDSelect from "/@/components/form/ExtDSelect.vue";
 
 const AdminUserDialog = defineAsyncComponent(() => import("/@/views/admin/account/detail.vue"));
 
@@ -171,25 +131,24 @@ const adminUserDialogRef = ref();
 const state = reactive({
   formQuery: {},
   pageQuery: {
-    pageNumber: 1,
+    pageNum: 1,
     pageSize: 10,
     total: 0
   },
   tableData: {
     height: 500,
-    data: [] as Array < any >,
+    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: 'userName', resizable: true, fixed: 'left'},
+      {label: '手机号', width: 150, prop: 'mobilePhone', resizable: true, fixed: 'left'},
+      {label: '状态', width: 120, prop: 'status', align: 'center'},
+      {label: '注册时间', width: 180, prop: 'registerTime', resizable: true},
+      {label: '充值次数', width: 150, prop: 'rechargeTimes', resizable: true},
+      {label: '充值金额', width: 150, prop: 'rechargeAmount', resizable: true},
+      {label: '充电次数', width: 150, prop: 'chargeTimes', resizable: true},
+      {label: '总电量', width: 150, prop: 'totalPower', resizable: true},
+      {label: '总金额', width: 150, prop: 'totalMoney', resizable: true},
       {
         label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
       }
@@ -233,13 +192,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/listUser`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    console.log(res)
+    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)

+ 0 - 1
admin-web/src/views/admin/index.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="home-container layout-pd">
-    XXXXXXXXXXX
     <el-row :gutter="15" class="home-card-one mb15">
       <el-col
           :xs="24"

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

@@ -192,6 +192,7 @@ const signInSuccess = (isNoPower: boolean | undefined) => {
     } else {
       router.push('/');
     }
+    // router.replace('/');
     // 登录成功提示
     const signInText = t('message.signInText');
     ElMessage.success(`${currentTimeInfo},${signInText}`);

+ 1 - 0
entity/src/main/java/com/kym/entity/admin/vo/CustomUserVo.java

@@ -13,6 +13,7 @@ import java.time.LocalDateTime;
 @Data
 public class CustomUserVo {
     private Long userId;
+    private String userName;
     private String mobilePhone;
     private Integer status;
     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

+ 5 - 1
mapper/src/main/resources/mappers/miniapp/UserMapper.xml

@@ -21,6 +21,7 @@
 
     <resultMap id="CustomUserMap" type="com.kym.entity.admin.vo.CustomUserVo">
         <id column="user_id" property="userId"/>
+        <id column="user_name" property="userName"/>
         <result column="mobile_phone" property="mobilePhone"/>
         <result column="status" property="status"/>
         <result column="register_time" property="registerTime"/>
@@ -42,6 +43,7 @@
         <if test="userId!=null">
             SELECT
             t1.`id` user_id,
+            t1.`username` user_name,
             t1.`mobile_phone`,
             t1.`status`,
             t1.`create_time` register_time,
@@ -78,7 +80,9 @@
         </if>
         <if test="userId==null">
 
-            SELECT user.`id` user_id,
+            SELECT
+            user.`id` user_id,
+            user.`username` user_name,
             user.`mobile_phone`,
             user.`status`,
             user.`create_time` register_time,