Browse Source

管理首页调整

zuy 2 năm trước cách đây
mục cha
commit
288134dce1

+ 154 - 157
admin-web/src/views/admin/account/detail.vue

@@ -2,176 +2,173 @@
 
 </style>
 <template>
-    <div class="system-dialog-container">
-        <el-drawer
-                :title="state.dialog.title"
-                v-model="state.dialog.isShowDialog"
-                width="820px"
-                append-to-body
-                destroy-on-close
-                :close-on-click-modal="false"
-                >
-            <el-form
-                    :model="state.form"
-                    :rules="rules"
-                    :label-position="labelPosition"
-                    ref="formRef"
-                    size="default"
-                    label-width="100px"
-                    class="mt5">
-                                    <el-input
-                            v-model="state.formQuery.avatar"
-                            placeholder="头像"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                        <el-input
-                            v-model="state.formQuery.companyId"
-                            placeholder="公司id"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                                                                <el-input
-                            v-model="state.formQuery.lastLoginTime"
-                            placeholder="最后登录时间"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                        <el-input
-                            v-model="state.formQuery.mobilePhone"
-                            placeholder="手机号"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                        <el-input
-                            v-model="state.formQuery.nickname"
-                            placeholder="昵称"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                        <el-input
-                            v-model="state.formQuery.password"
-                            placeholder="密码"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                        <el-input
-                            v-model="state.formQuery.status"
-                            placeholder="0:禁用 1:启用"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                                                            <el-input
-                            v-model="state.formQuery.username"
-                            placeholder="用户名"
-                            clearable
-                            style="width: 100%">
-                    </el-input>
-                                </el-form>
+  <div class="system-dialog-container">
+    <el-drawer
+        :title="state.dialog.title"
+        v-model="state.dialog.isShowDialog"
+        width="820px"
+        append-to-body
+        destroy-on-close
+        :close-on-click-modal="false"
+    >
+      <el-form
+          :model="state.form"
+          :rules="rules"
+          label-position="left"
+          ref="formRef"
+          size="default"
+          label-width="100px"
+          class="mt5">
+        <el-input
+            v-model="state.formQuery.avatar"
+            placeholder="头像"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.companyId"
+            placeholder="公司id"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.lastLoginTime"
+            placeholder="最后登录时间"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.mobilePhone"
+            placeholder="手机号"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.nickname"
+            placeholder="昵称"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.password"
+            placeholder="密码"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.status"
+            placeholder="0:禁用 1:启用"
+            clearable
+            style="width: 100%">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.username"
+            placeholder="用户名"
+            clearable
+            style="width: 100%">
+        </el-input>
+      </el-form>
 
-            <template #footer>
-				<div class="dialog-footer">
-					<el-button @click="onCancel" size="default">取 消</el-button>
-					<el-button :loading="state.btnLoading" type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button>
-				</div>
-            </template>
-        </el-drawer>
-    </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="onCancel" size="default">取 消</el-button>
+          <el-button :loading="state.btnLoading" type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button>
+        </div>
+      </template>
+    </el-drawer>
+  </div>
 </template>
 
 <script setup lang="ts" name="AdminUserDialog">
-    import {defineAsyncComponent, reactive, onMounted, ref} from 'vue';
-    import {Msg} from "/@/utils/message";
-    import {$body, $get} from "/@/utils/request";
-    import u from '/@/utils/u'
-    import type {FormInstance, FormRules} from 'element-plus';
+import {defineAsyncComponent, reactive, onMounted, ref} from 'vue';
+import {Msg} from "/@/utils/message";
+import {$body, $get} from "/@/utils/request";
+import u from '/@/utils/u'
+import type {FormInstance, FormRules} from 'element-plus';
 
-    // 引入组件
-    const ExtDetailForm = defineAsyncComponent(() => import('/@/components/form/ExtDetailForm.vue'));
+// 定义子组件向父组件传值/事件
+const emit = defineEmits(['refresh']);
+const formRef = ref();
+//定义初始变量,重置使用
+const initState = () => ({
+  ruleForm: {
+    id: 0
+  },
+  btnLoading: false,
+  dialog: {
+    isShowDialog: false,
+    type: '',
+    title: '',
+    submitTxt: '',
+  },
+  rules: {},
+})
 
-    // 定义子组件向父组件传值/事件
-    const emit = defineEmits(['refresh']);
-    const formRef = ref();
-    //定义初始变量,重置使用
-    const initState = ()=>({
-        ruleForm: {
-            id:0
-        },
-        btnLoading: false,
-        dialog: {
-            isShowDialog: false,
-            type: '',
-            title: '',
-            submitTxt: '',
-        },
-        rules: {},
-    })
+// 定义变量内容
+const state = reactive(initState());
 
-    // 定义变量内容
-    const state = reactive(initState());
 
-
-    // 打开弹窗
-    const open = (action: string='add', row: any) => {
-        state.dialog.title = u.dialog.actions[action].title +"『用户表』"
-        state.dialog.submitTxt = u.dialog.actions[action].btn +"『用户表』"
-        state.dialog.isShowDialog = true;
-        if (action !=='add') {
-            loadData(row.id);
-        }
-    };
-    // 关闭弹窗
-    const onClose = () => {
-        state.dialog.isShowDialog = false;
-        Object.assign(state,initState())
-    };
-    // 取消
-    const onCancel = () => {
+// 打开弹窗
+const open = (action: string = 'add', row: any) => {
+  state.dialog.title = u.dialog.actions[action].title + "『用户表』"
+  state.dialog.submitTxt = u.dialog.actions[action].btn + "『用户表』"
+  state.dialog.isShowDialog = true;
+  if (action !== 'add') {
+    loadData(row.id);
+  }
+};
+// 关闭弹窗
+const onClose = () => {
+  state.dialog.isShowDialog = false;
+  Object.assign(state, initState())
+};
+// 取消
+const onCancel = () => {
+  onClose();
+};
+// 提交
+const onSubmit = () => {
+  formRef.value.validate((valid, fields) => {
+    // console.log('basic checkForm!', valid,fields)
+    if (valid) {
+      state.btnLoading = true;
+      const url = state.ruleForm.id > 0 ? "adminUser/modify" : "adminUser/add"
+      $body(url, state.ruleForm).then(() => {
+        state.btnLoading = false;
+        Msg.message('操作成功');
+        console.log('submit!')
         onClose();
-    };
-    // 提交
-    const onSubmit = () => {
-        formRef.value.validate((valid, fields) => {
-            // console.log('basic checkForm!', valid,fields)
-            if (valid) {
-                state.btnLoading = true;
-                const url = state.ruleForm.id > 0 ? "adminUser/modify" : "adminUser/add"
-                    $body(url, state.ruleForm).then(() => {
-                    state.btnLoading = false;
-                    Msg.message('操作成功');
-                    console.log('submit!')
-                    onClose();
-                    emit('refresh');
-                })
-            } else {
-                state.btnLoading = false;
-                Msg.message('表单校验失败', 'error');
-            }
-        })
+        emit('refresh');
+      })
+    } else {
+      state.btnLoading = false;
+      Msg.message('表单校验失败', 'error');
+    }
+  })
 
-        // formRef.value.checkForm().then(() => {
-        //
-        // }).catch(() => {
-        //     state.btnLoading = false;
-        //     Msg.message('表单校验失败', 'error');
-        // })
-    };
+  // formRef.value.checkForm().then(() => {
+  //
+  // }).catch(() => {
+  //     state.btnLoading = false;
+  //     Msg.message('表单校验失败', 'error');
+  // })
+};
 
-    const handleFormChange = (formData: any) => {
-        console.log(formData)
-    }
+const handleFormChange = (formData: any) => {
+  console.log(formData)
+}
 
-    // 初始化表格数据
-    const loadData = (id: number) => {
-            $get(`adminUser/detail/${id}`).then((res: any) => {
-            state.ruleForm = res;
-        })
-    }
+// 初始化表格数据
+const loadData = (id: number) => {
+  $get(`adminUser/detail/${id}`).then((res: any) => {
+    state.ruleForm = res;
+  })
+}
 
-    // 暴露变量
-    defineExpose({
-        open
-    });
+// 暴露变量
+defineExpose({
+  open
+});
 
 
 </script>

+ 2 - 2
admin-web/src/views/admin/index.vue

@@ -15,7 +15,7 @@
           <div class="flex-margin flex w100" :class="` home-one-animation${k}`">
             <div class="flex-auto">
               <span class="font30">{{ v.num1 }}</span>
-              <span class="ml5 font16" :style="{ color: v.color1 }">{{ v.num2 }}%</span>
+<!--              <span class="ml5 font16" :style="{ color: v.color1 }">{{ v.num2 }}%</span>-->
               <div class="mt10">{{ v.num3 }}</div>
             </div>
 <!--            <div class="home-card-item-icon flex" :style="{ background: `var(${v.color2})` }">-->
@@ -490,7 +490,7 @@ const loadCurrentEquipmentStatus = ()=>{
 
 
 const loadStationStat = ()=>{
-  $get(`stat/stationStat`,{startTime:state.dateRange[0],endTime:state.dateRange[1],type:'day'}).then((res:any)=>{
+  $get(`stat/stationStat`,{startTime:state.dateRange[0],endTime:state.dateRange[1],type:'day',pageSize:31}).then((res:any)=>{
     console.log(res)
     initLineChart(res.list);
   })

+ 2 - 2
admin-web/src/views/admin/role/index.vue

@@ -89,7 +89,7 @@
 <!--      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>-->
     </el-card>
   </div>
-  <RoleDialog ref="roleDialogRef" @refresh="loadData(true)"/>
+<!--  <RoleDialog ref="roleDialogRef" @refresh="loadData(true)"/>-->
 </template>
 
 <script setup lang="ts" name="RoleList">
@@ -102,7 +102,7 @@ import ExtPage from '/@/components/form/ExtPage.vue'
 
 import mittBus from '/@/utils/mitt';
 
-const RoleDialog = defineAsyncComponent(() => import("/@/views/page/RoleDialog.vue"));
+// const RoleDialog = defineAsyncComponent(() => import("/@/views/page/RoleDialog.vue"));
 
 //定义引用
 const queryRef = ref();

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

@@ -97,7 +97,7 @@
 <!--      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>-->
     </el-card>
   </div>
-  <StationDialog ref="stationDialogRef" @refresh="loadData(true)"/>
+<!--  <StationDialog ref="stationDialogRef" @refresh="loadData(true)"/>-->
 </template>
 
 <script setup lang="ts" name="StationList">
@@ -111,7 +111,7 @@ 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 StationDialog = defineAsyncComponent(() => import("/@/views/page/StationDialog.vue"));
 
 //定义引用
 const queryRef = ref();

+ 2 - 2
admin-web/src/views/admin/user/index.vue

@@ -121,7 +121,7 @@
       <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
     </el-card>
   </div>
-  <AdminUserDialog ref="adminUserDialogRef" @refresh="loadData(true)"/>
+<!--  <AdminUserDialog ref="adminUserDialogRef" @refresh="loadData(true)"/>-->
 </template>
 
 <script setup lang="ts" name="AdminUserList">
@@ -136,7 +136,7 @@ import mittBus from '/@/utils/mitt';
 import ExtDSelect from "/@/components/form/ExtDSelect.vue";
 import ExtDLabel from "/@/components/form/ExtDLabel.vue";
 
-const AdminUserDialog = defineAsyncComponent(() => import("/@/views/page/AdminUserDialog.vue"));
+// const AdminUserDialog = defineAsyncComponent(() => import("/@/views/page/AdminUserDialog.vue"));
 
 //定义引用
 const queryRef = ref();

+ 0 - 2
admin-web/src/views/login/index.vue

@@ -53,8 +53,6 @@ import loginBg from '/@/assets/login-bg.svg';
 
 // 引入组件
 const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
-const Ldap = defineAsyncComponent(() => import('/@/views/login/component/ldap.vue'));
-const Scan = defineAsyncComponent(() => import('/@/views/login/component/scan.vue'));
 
 // 定义变量内容
 const storesThemeConfig = useThemeConfig();