Browse Source

完善页面

tianyabing 2 năm trước cách đây
mục cha
commit
686260d22a

+ 5 - 0
src/api/data/AuthInfo.js

@@ -1,6 +1,10 @@
 import request from "@/utils/request";
 import constant from "@/utils/constant";
 
+// 查询所有用户信息
+const getUserList = (params) => {
+    return request.postForm(constant.oauthProxy + '/user/getAllUser', params)
+}
 // 查询当前系统普通角色
 const getRoleList = (params) => {
     return request.postForm(constant.oauthProxy + '/role/getRoleByServiceId', params);
@@ -15,6 +19,7 @@ const updateRoleAuth = (params) =>{
 }
 
 export default {
+    getUserList,
     getRoleList,
     getAuthList,
     updateRoleAuth,

+ 4 - 1
src/api/data/ImportData.js

@@ -1,10 +1,13 @@
 import request from "@/utils/request";
 import constant from "@/utils/constant";
+import {ElMessage} from "element-plus";
 
 // 导入二维数据-Shape
 const importTwoDData = (params, type) => {
     if (type==='Shape') {
-        return request.postForm(constant.dtbserverProxy + '/latlon/addDataForShapeZip', params)
+        return request.postWithFile(constant.dtbserverProxy + '/latlon/addDataForShapeZip', params)
+    } else {
+        return request.postWithFile(constant.dtbserverProxy + '/latlon/addDataForShapeZip', params)
     }
 }
 

+ 15 - 2
src/components/dataManage/ImportData.vue

@@ -194,7 +194,7 @@ export default {
     },
     submit() {
       let app = this;
-      this.$refs.importForm.validate(valid => {
+      this.$refs.importForm.validate((valid, obj) => {
         if (valid) {
           let params = JSON.parse(JSON.stringify(app.importForm));
           delete params.tableData;
@@ -202,8 +202,21 @@ export default {
           delete params.dataType;
           delete params.importType;
           params['userName'] = app.$store.state.userInfo.username;
-          api.importTwoDData(params, app.importForm.importType)
+          params['file'] = app.importForm.file;
+          params['menuNameOne'] = '二维数据'
+          app.$util.loading.handleLoading(true);
+          api.importTwoDData(params, app.importForm.importType).then(res=>{
+            res = res.data;
+            if (res.code===200) {
+              app.$message({message: '导入成功', type: 'success'})
+            }
+            app.$util.loading.handleLoading(false);
+          }).catch(err=>{
+            app.$util.loading.handleLoading(false);
+            app.$message({message: err.message, type: 'error'})
+          })
         } else {
+          app.$util.loading.handleLoading(false);
           app.$message({message: '请先检查并完善信息', type: 'warning'})
         }
       })

+ 0 - 1
src/components/dataManage/dataShow/ModelData.vue

@@ -207,7 +207,6 @@ export default {
     editData(item) {
       let app = this;
       app.currRow = JSON.parse(JSON.stringify(item))
-      console.log(app.currRow)
       if (app.currRow.menuId) {
         app.currRow.menuId = Number(app.currRow.menuId)
       }

+ 0 - 1
src/components/dataManage/dataShow/ThreeDimensionalData.vue

@@ -207,7 +207,6 @@ export default {
     editData(item) {
       let app = this;
       app.currRow = JSON.parse(JSON.stringify(item))
-      console.log(app.currRow)
       if (app.currRow.menuId) {
         app.currRow.menuId = Number(app.currRow.menuId)
       }

+ 2 - 2
src/components/dataManage/dataShow/TwoDimensionalData.vue

@@ -18,9 +18,9 @@
                 :border="true" :stripe="true" :height="440" style="width: 100%;margin-bottom: 15px;"
                 @selection-change="handleTableSelect">
         <el-table-column type="selection" width="55"/>
-        <el-table-column prop="id" label="ID" width="100" :show-overflow-tooltip="true">
+        <el-table-column prop="id" label="ID" width="100" :show-overflow-tooltip="true" style="direction: rtl">
           <template #default="scope">
-            <span style="cursor: pointer" @click="$util.clipboard.copyText(scope.row.id)"> {{ scope.row.id }} </span>
+            <span style="cursor: pointer;" @click="$util.clipboard.copyText(scope.row.id)"> {{ scope.row.id }} </span>
           </template>
         </el-table-column>
         <el-table-column prop="title" label="标题" width="200"/>

+ 46 - 33
src/components/home/HomeIndex.vue

@@ -41,24 +41,26 @@
             </div>
           </template>
           <div>
-            <el-scrollbar :style="cardBodyStyle">
-              <el-row>
-                <el-col :span="10">
-                  <el-carousel height="150px">
-                    <el-carousel-item v-for="item in 2" :key="item">
-                      <h3 class="small justify-center" text="2xl">{{ item }}</h3>
-                    </el-carousel-item>
-                  </el-carousel>
-                </el-col>
-                <el-col :span="1"></el-col>
-                <el-col :span="13">
-                  <el-link>专项介绍内容1</el-link><br/>
-                  <el-link>专项介绍内容2</el-link><br/>
-                  <el-link>专项介绍内容3</el-link><br/>
-                  <el-link>专项介绍内容4</el-link><br/>
-                  <el-link>专项介绍内容5</el-link><br/>
-                </el-col>
-              </el-row>
+            <div class="specialIntroduceLeft" style="width: 40%">
+              <el-carousel :height="cardBodyStyle.height">
+                <el-carousel-item v-for="item in 2" :key="item">
+                  <h3 class="small justify-center" text="2xl">{{ item }}</h3>
+                </el-carousel-item>
+              </el-carousel>
+            </div>
+            <el-scrollbar :style="cardBodyStyle" style="display: inline-block; width: 55%;padding: 0px 2%">
+              <div class="specialIntroduceRight">
+                <el-link>专项介绍内容1</el-link><br/>
+                <el-link>专项介绍内容2</el-link><br/>
+                <el-link>专项介绍内容3</el-link><br/>
+                <el-link>专项介绍内容4</el-link><br/>
+                <el-link>专项介绍内容5</el-link><br/>
+                <el-link>专项介绍内容6</el-link><br/>
+                <el-link>专项介绍内容7</el-link><br/>
+                <el-link>专项介绍内容8</el-link><br/>
+                <el-link>专项介绍内容9</el-link><br/>
+                <el-link>专项介绍内容10</el-link><br/>
+              </div>
             </el-scrollbar>
           </div>
         </el-card>
@@ -78,15 +80,16 @@
           </template>
           <div>
             <el-scrollbar :style="cardBodyStyle">
-              <el-row>
-                <el-col :span="6" >
-                  <div>数据占比:</div>
-                  <div id="system-overview-data-percent" style="width: 100%;height: 100px"></div>
-                </el-col>
-                <el-col :span="6" >123</el-col>
-                <el-col :span="6" >123</el-col>
-                <el-col :span="6" >123</el-col>
-              </el-row>
+              数据统计
+              <!--<el-row>-->
+              <!--  <el-col :span="6" >-->
+              <!--    <div>数据占比:</div>-->
+              <!--    <div id="system-overview-data-percent" style="width: 100%;height: 100px"></div>-->
+              <!--  </el-col>-->
+              <!--  <el-col :span="6" >123</el-col>-->
+              <!--  <el-col :span="6" >123</el-col>-->
+              <!--  <el-col :span="6" >123</el-col>-->
+              <!--</el-row>-->
             </el-scrollbar>
           </div>
         </el-card>
@@ -102,7 +105,7 @@
               <span class="cardDesc">Data Details</span>
             </div>
           </template>
-          <div>数据明细内容</div>
+          <div>数据明细图表</div>
         </el-card>
       </el-col>
     </el-row>
@@ -127,7 +130,7 @@ export default {
         height: 200+'px'
       },
       cardBodyStyle: {
-        height: 150+'px'
+        height: ''
       },
       systemOverviewOptions: {
         dataPercent :{
@@ -176,12 +179,12 @@ export default {
   },
   mounted() {
     let container = document.getElementById("HomeContainer")
+    let height= 200;
     if (container && container.clientHeight>=500) {
-      this.cardStyle.height = container.clientHeight*0.4+'px';
-    } else {
-      this.cardStyle.height = 200+'px';
+      height = container.clientHeight*0.4;
     }
-    this.cardBodyStyle.height = this.cardStyle.height*0.7;
+    this.cardStyle.height = height+'px';
+    this.cardBodyStyle.height = height*0.6 + 'px';
     // let mycharts = this.$echarts.init(document.getElementById('system-overview-data-percent'))
     // mycharts.setOption(this.systemOverviewOptions.dataPercent)
   },
@@ -247,4 +250,14 @@ export default {
 .el-carousel__item:nth-child(2n + 1) {
   background-color: #d3dce6;
 }
+
+.specialIntroduceLeft {
+  width: 40%;
+  display: inline-block;
+}
+.specialIntroduceRight {
+  width: 50%;
+  display: inline-block;
+  vertical-align: top;
+}
 </style>

+ 12 - 10
src/components/home/SystemManage.vue

@@ -3,18 +3,18 @@
     <br/>
     <div v-if="auth" class="left">
       <el-scrollbar>
-        <el-menu default-active="2" class="SystemMgr-menu" @select="handleSelect">
-          <!--<el-menu-item index="1">-->
-          <!--  <el-icon>-->
-          <!--    <IconPark-peoples-two />-->
-          <!--  </el-icon>-->
-          <!--  <span>用户管理</span>-->
-          <!--</el-menu-item>-->
+        <el-menu default-active="1" class="SystemMgr-menu" @select="handleSelect">
+          <el-menu-item index="1">
+            <el-icon>
+              <IconPark-peoples-two />
+            </el-icon>
+            <span>用户信息</span>
+          </el-menu-item>
           <el-menu-item index="2">
             <el-icon>
               <IconPark-permissions />
             </el-icon>
-            <span>权限管理</span>
+            <span>权限信息</span>
           </el-menu-item>
           <el-menu-item index="3">
             <el-icon>
@@ -27,6 +27,7 @@
     </div>
 
     <div v-if="auth" class="content">
+      <UserManage v-if="activeIndex=='1'" />
       <AuthManage v-if="activeIndex=='2'" />
       <SystemLogs v-if="activeIndex=='3'" />
     </div>
@@ -42,12 +43,13 @@ export default {
   data() {
     return {
       auth: false,
-      activeIndex: '2'
+      activeIndex: '1'
     }
   },
   components: {
-    SystemLogs: defineAsyncComponent(() => import("@/components/systemManage/SystemLogs")),
+    UserManage: defineAsyncComponent(() => import("@/components/systemManage/UserManage")),
     AuthManage: defineAsyncComponent(() => import("@/components/systemManage/AuthManage")),
+    SystemLogs: defineAsyncComponent(() => import("@/components/systemManage/SystemLogs")),
   },
   created() {
     let userInfo = this.$store.state.userInfo;

+ 2 - 0
src/main.js

@@ -41,4 +41,6 @@ app.config.globalProperties.$constant = constant
 
 app.mount('#app');
 
+export default app
+
 

+ 39 - 7
src/utils/request.js

@@ -1,6 +1,6 @@
 import axios from 'axios'
 import qs from 'qs'
-import { ElMessage, ElMessageBox } from 'element-plus'
+import context from '@/main'
 
 import store from '@/store/index'
 
@@ -24,13 +24,17 @@ const noDataCodes = [202, 205] // 无数据
 service.interceptors.response.use(response => {
     let code = response.data.code
     if (code && loginFailCodes.indexOf(code) > -1) {
-        ElMessage({ message: '登录失效,请重新登录', type: 'error' })
+        context.config.globalProperties.$message({ message: '登录失效,请重新登录', type: 'error' })
+        store.commit('resetState', {});
+        setTimeout(function () {
+            context.config.globalProperties.judgeLogin();
+        },100)
     } else if (code && userFailCodes.indexOf(code) > -1) {
-        ElMessage({ message: '用户状态失效,请联系管理员', type: 'error' })
+        context.config.globalProperties.$message({ message: '用户状态失效,请联系管理员', type: 'error' })
     } else if (code && noDataCodes.indexOf(code) > -1) {
-        ElMessage({ message: '未查询到相关数据', type: 'warning' })
+        context.config.globalProperties.$message({ message: '未查询到相关数据', type: 'warning' })
     } else if (code !== 200) {
-        ElMessage({ message: response.data.content || '请求出错', type: 'error' })
+        context.config.globalProperties.$message({ message: response.data.content || '请求出错', type: 'error' })
     }
     return response
 })
@@ -98,9 +102,37 @@ export default {
         return formReq('DELETE', url, params)
     },
     getFile(url, params) {
-
+        return new Promise((resolve, reject) => {
+            service({
+                method: 'GET',
+                url,
+                params: params,
+                contentType: false,
+                processData: false,
+                responseType: 'blob'
+            }).then(res => {
+                resolve(res)
+            }).catch(err => {
+                reject(err)
+            })
+        })
     },
     postWithFile(url, params) {
-
+        return new Promise((resolve, reject) => {
+            service({
+                method: 'POST',
+                url,
+                data: params,
+                contentType: false,
+                processData: false,
+                headers: {
+                    'Content-Type': 'multipart/form-data',
+                }
+            }).then(res => {
+                resolve(res)
+            }).catch(err => {
+                reject(err)
+            })
+        })
     }
 }

+ 1 - 1
src/views/HomeView.vue

@@ -88,7 +88,7 @@ export default {
     }
   },
   created() {
-
+    this.$root.$.appContext.config.globalProperties.judgeLogin = this.judgeLogin;
   },
   mounted() {
     this.judgeLogin();