Эх сурвалжийг харах

现场部署一系列适配提交

wanger 5 сар өмнө
parent
commit
e5e214e3bb

+ 31 - 115
website/src/components/ghcgscygl/ghcgsb/xxgh/czgh/Qxyh/czghcgDialog.vue

@@ -1,34 +1,13 @@
 <template>
-  <el-dialog
-    title="村庄规划成果上传"
-    v-model="ghcgscDialog"
-    @close="closeDialog"
-    width="600px"
-  >
-    <el-form
-      :model="formData"
-      ref="ruleForm"
-      label-width="150px"
-      :rules="rules"
-    >
+  <el-dialog title="村庄规划成果上传" v-model="ghcgscDialog" @close="closeDialog" width="600px">
+    <el-form :model="formData" ref="ruleForm" label-width="150px" :rules="rules">
       <el-row>
         <el-col>
-          <el-form-item
-            label="选择成果包:"
-            prop="file"
-            style="position: relative; font-weight: 600"
-          >
+          <el-form-item label="选择成果包:" prop="file" style="position: relative; font-weight: 600">
             <el-input style="width: 90%" autocomplete="off" readonly></el-input>
-            <el-upload
-              action="#"
-              :http-request="addFileToFormData"
-              v-model:file-list="fileList"
-              :before-upload="beforeUpload"
-            >
-              <el-button
-                slot="trigger"
-                type="primary"
-                style="
+            <el-upload action="#" :http-request="addFileToFormData" v-model:file-list="fileList"
+              :before-upload="beforeUpload">
+              <el-button slot="trigger" type="primary" style="
                   height: 90%;
                   padding: 0;
                   position: absolute;
@@ -36,13 +15,9 @@
                   right: 45px;
                   background-color: #fff;
                   color: #169bd5;
-                  border: none; // 去掉边框
-                  outline: none; // 去掉点击按钮后的边框
-                "
-                @click="upload"
-                >选择</el-button
-              ></el-upload
-            >
+                  border: none;
+                  outline: none; 
+                " @click="upload">选择</el-button></el-upload>
           </el-form-item>
         </el-col>
         <span slot="tip" class="el-upload__tip" style="margin: 0 auto">
@@ -50,71 +25,26 @@
         </span>
         <el-col>
           <el-form-item label="村庄名称:">
-            <el-cascader
-              :options="xzoptions"
-              :props="{
-                ...props,
-                checkStrictly: true,
-                expandTrigger: 'hover',
-              }"
-              v-model="formData.xzqCode"
-              clearable
-              ref="cascader"
-              class="cascader-style"
-              style="width: 90%"
-              popper-class="popper-cascader"
-              :filterable="true"
-              @change="setXzqdm"
-              :show-all-levels="false"
-            ></el-cascader> </el-form-item
-        ></el-col>
+            <el-cascader :options="xzoptions" :props="{
+              ...props,
+              checkStrictly: true,
+              expandTrigger: 'hover',
+            }" v-model="formData.xzqCode" clearable ref="cascader" class="cascader-style" style="width: 90%"
+              popper-class="popper-cascader" :filterable="true" @change="setXzqdm"
+              :show-all-levels="false"></el-cascader> </el-form-item></el-col>
         <el-col style="padding-top: 20px">
-          <el-form-item
-            label="规划成果时间:"
-            prop="year"
-            style="font-weight: bold"
-          >
-            <el-select
-              v-model="yearLx"
-              placeholder="请选择时间类型"
-              style="width: 30%; margin-right: 10%"
-              @change="changeLx"
-            >
+          <el-form-item label="规划成果时间:" prop="year" style="font-weight: bold">
+            <el-select v-model="yearLx" placeholder="请选择时间类型" style="width: 30%; margin-right: 10%" @change="changeLx">
               <el-option label="年月日" value="年月日"> </el-option>
               <el-option label="年月" value="年月"> </el-option>
               <el-option label="年" value="年"> </el-option>
             </el-select>
-            <el-date-picker
-              style="width: 50%"
-              v-if="yearLx == '年月日'"
-              v-model="formData.year"
-              type="date"
-              placeholder="请选择时间"
-              size="default"
-              class="picker"
-              value-format="YYYY-MM-DD"
-            />
-            <el-date-picker
-              style="width: 50%"
-              v-if="yearLx == '年月'"
-              v-model="formData.year"
-              type="month"
-              placeholder="请选择时间"
-              size="default"
-              class="picker"
-              value-format="YYYY-MM"
-            />
-            <el-date-picker
-              style="width: 50%"
-              v-if="yearLx == '年'"
-              v-model="formData.year"
-              type="year"
-              placeholder="请选择时间"
-              size="default"
-              class="picker"
-              format="YYYY"
-              value-format="YYYY"
-            />
+            <el-date-picker style="width: 50%" v-if="yearLx == '年月日'" v-model="formData.year" type="date"
+              placeholder="请选择时间" size="default" class="picker" value-format="YYYY-MM-DD" />
+            <el-date-picker style="width: 50%" v-if="yearLx == '年月'" v-model="formData.year" type="month"
+              placeholder="请选择时间" size="default" class="picker" value-format="YYYY-MM" />
+            <el-date-picker style="width: 50%" v-if="yearLx == '年'" v-model="formData.year" type="year"
+              placeholder="请选择时间" size="default" class="picker" format="YYYY" value-format="YYYY" />
           </el-form-item>
         </el-col>
         <!-- <el-col style="padding-top: 20px">
@@ -132,13 +62,8 @@
         ></el-col> -->
         <el-col style="padding-top: 20px">
           <el-form-item label="流程主键:" v-show="formData.instid != ''">
-            <el-input
-              v-model="formData.instid"
-              placeholder="补正流程需要(自动填充)"
-              style="width: 90%"
-              disabled
-            ></el-input> </el-form-item
-        ></el-col>
+            <el-input v-model="formData.instid" placeholder="补正流程需要(自动填充)" style="width: 90%" disabled></el-input>
+          </el-form-item></el-col>
       </el-row>
     </el-form>
     <template #footer>
@@ -150,19 +75,9 @@
     <el-card class="box-card" style="margin-top: 10px" v-if="uploadError">
       <div class="clearfix">
         <span style="color: red; white-space: pre-wrap">{{ errormsg }}</span>
-        <el-button
-          style="float: right; padding: 3px 0; font-size: 22px"
-          type="text"
-          @click="closeDi()"
-          >×</el-button
-        >
+        <el-button style="float: right; padding: 3px 0; font-size: 22px" type="text" @click="closeDi()">×</el-button>
       </div>
-      <div
-        v-for="msg in errorlist"
-        :key="msg"
-        class="text item"
-        style="white-space: initial"
-      >
+      <div v-for="msg in errorlist" :key="msg" class="text item" style="white-space: initial">
         {{ msg }}
       </div>
     </el-card>
@@ -297,8 +212,9 @@ export default {
               addDialog.errorlist = res.data;
               addDialog.loading.close(); //关闭文件上传状态loading
             } else {
-              addDialog.formData.filePath = res.msg;
-              addDialog.formData.fileName = files.file.name;
+              let msglist = res.msg.split("******");
+              addDialog.formData.filePath = msglist[0];
+              addDialog.formData.fileName = msglist[1] || files.file.name;
               addDialog.loading.close(); //关闭文件上传状态loading
             }
           })

+ 40 - 6
website/src/permission.js

@@ -13,7 +13,7 @@ import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
 import { getToken } from '@/utils/auth'
 import { isHttp } from '@/utils/validate'
-import { checkToken, currentUserInfo } from "@/api/login";
+import { checkToken, currentUserInfo, validateTicket, SsoLogout } from "@/api/login";
 
 
 NProgress.configure({ showSpinner: false });
@@ -61,17 +61,50 @@ router.beforeEach((to, from, next) => {
                         })
                         .catch((e) => {
                             console.log('认证登录失败:');
-                            next(`/login?redirect=/`) // 否则全部重定向到登录页
+                            next(SSOExitUrl) // 否则全部重定向到登录页
                         });
                 })
                 .catch((e) => {
                     console.log('用户信息获取失败');
-                    next(`/login?redirect=/`) // 否则全部重定向到登录页
+                    next(SSOExitUrl) // 否则全部重定向到登录页
                 });
         }).catch(e => {
             console.log('Token过期,请重新登录!');
-            next(`/login?redirect=/`) // 否则全部重定向到登录页
+            next(SSOExitUrl) // 否则全部重定向到登录页
         })
+    } else if (to.query && to.query.ticket) { //TODO wanger 对接基础信息平台
+        // 通过ticket获取登录用户信息
+        validateTicket(to.query.ticket).then(res => {
+                console.log('用户信息获取成功:' + JSON.stringify(res.data));
+                // 获取username
+                let username = res.data.account;
+                // 调用action的登录方法,进行自动认证登录
+                console.log('开始自动认证登录');
+                store.dispatch("LoginNew", username)
+                    .then(() => {
+                        store.commit("SET_SUPERUSER", username);
+                        next("/")
+                    })
+                    .catch((e) => {
+                        console.log('认证登录失败:');
+                        next(SSOExitUrl) // 否则全部重定向到登录页
+                    });
+            })
+            .catch((e) => {
+                console.log('用户信息获取失败');
+                next(SSOExitUrl) // 否则全部重定向到登录页
+            });
+    } else if (to.query && to.query.logout) { //TODO wanger 对接基础信息平台
+        store.dispatch("LogOut").then(() => {});
+        // 获取Token对应登录用户信息
+        SsoLogout().then(res => {
+                console.log('单点登录退出成功');
+                next(SSOUrl) // 否则全部重定向到登录页
+            })
+            .catch((e) => {
+                console.log('单点登录退出失败');
+                next(SSOExitUrl) // 否则全部重定向到登录页
+            });
     } else {
         if (getToken()) {
 
@@ -120,7 +153,7 @@ router.beforeEach((to, from, next) => {
                             console.log('Token过期,请重新登录!');
                             store.commit("SET_SUPERUSER", "");
                             store.commit("SET_SUPERTOKEN", "");
-                            next(`/login?redirect=/`) // 否则全部重定向到登录页
+                            next(SSOExitUrl) // 否则全部重定向到登录页
                             return
                         })
                     } else {
@@ -140,7 +173,8 @@ router.beforeEach((to, from, next) => {
                 // 在免登录白名单,直接进入
                 next()
             } else {
-                next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
+                window.location = JcptSSOExitUrl;
+                // next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
                 NProgress.done()
             }
         }

+ 1 - 1
website/src/views/ghcgscygl/ghcgsb/Qxxb.vue

@@ -484,7 +484,7 @@ export default {
 .dialog-footer {
   width: 100%;
   text-align: center;
-  position: absolute;
+  // position: absolute;
   bottom: 30px;
 }
 </style>

+ 1 - 1
website/src/views/ghcgscygl/ghcgsb/Search.vue

@@ -608,7 +608,7 @@ export default {
 .dialog-footer {
   width: 100%;
   text-align: center;
-  position: absolute;
+  //position: absolute;
   bottom: 30px;
 }
 </style>

+ 3 - 2
website/src/views/ghcgscygl/ghcgsb/xxgh/Czgh.vue

@@ -1,6 +1,7 @@
 <template>
-  <Sjyh v-if="$store.getters.roles.indexOf('shiji') > -1"></Sjyh>
-  <Qxyh v-else></Qxyh>
+  <!-- <Sjyh v-if="$store.getters.roles.indexOf('shiji') > -1"></Sjyh>
+  <Qxyh v-else></Qxyh> -->
+  <Qxyh></Qxyh>
 </template>
 
 <script>

+ 1 - 0
website/src/views/ghcgscygl/ghcgsb/xxgh/Czgh/Qxyh.vue

@@ -590,6 +590,7 @@ export default {
       },
       // 获取列表数据
       getlist() {
+        qxyh.formInline.xzq_code = qxyh.formInline.xzqCode
         Getlist(qxyh.formInline).then((res) => {
           qxyh.tableData = res.data;
           qxyh.formInline.total = res.recordstotal;