From befcbe0b052a2d9a4a0c4ac5d96226e8dadf0e62 Mon Sep 17 00:00:00 2001
From: dengfuchuan <389068019@qq.com>
Date: Sun, 4 Apr 2021 14:24:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=88=97?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/sys_attach/api/index.js | 5 +-
src/permission.js | 11 +-
src/utils/request.js | 172 ++--
.../hidden_check/components/create/index.vue | 699 +++++++-------
.../components/edit_form/index.vue | 699 +++++++-------
src/views/hidden_check/index.vue | 696 +++++++-------
.../hidden_reform/components/create/index.vue | 699 +++++++-------
.../components/edit_form/index.vue | 759 +++++++--------
src/views/hidden_reform/index.vue | 654 ++++++-------
.../hidden_review/components/create/index.vue | 699 +++++++-------
.../components/edit_form/index.vue | 867 +++++++++---------
src/views/hidden_review/index.vue | 594 ++++++------
12 files changed, 3310 insertions(+), 3244 deletions(-)
diff --git a/src/components/sys_attach/api/index.js b/src/components/sys_attach/api/index.js
index c05ab670..a73a4a9f 100644
--- a/src/components/sys_attach/api/index.js
+++ b/src/components/sys_attach/api/index.js
@@ -30,10 +30,11 @@ export default {
}).then(response => response.data)
},
downLoad(keys) {
+ const timestamp = new Date().getTime()
return request({
- url: `fileAction.do?funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=`,
+ url: `fileAction.do?funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}`,
method: 'post',
- data: `funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=`
+ data: `funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}`
}).then(response => response.data)
}
}
diff --git a/src/permission.js b/src/permission.js
index e758b5db..2110e931 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -28,14 +28,7 @@ router.beforeEach(async(to, from, next) => {
// determine whether the user has obtained his permission roles through getInfo
const hasRoles = store.getters.roles && store.getters.roles.length > 0
const sessionRoles = sessionStorage.getItem('ROLES')
- if (hasRoles) {
- // generate accessible routes map based on roles
- const accessRoutes = await store.dispatch('permission/generateRoutes', store.getters.roles)
-
- // dynamically add accessible routes
- router.addRoutes(accessRoutes)
- next()
- } else if (sessionRoles) {
+ if (!hasRoles && sessionRoles) {
// generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', sessionRoles)
@@ -45,6 +38,8 @@ router.beforeEach(async(to, from, next) => {
// 刷新页面获取当前账号权限
store.dispatch('user/getRoles', sessionRoles)
next()
+ } else if (hasRoles) {
+ next()
} else {
try {
// get user info
diff --git a/src/utils/request.js b/src/utils/request.js
index 0aa50490..79e60dcc 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -1,84 +1,88 @@
-import axios from 'axios'
-import { MessageBox, Message } from 'element-ui'
-import store from '@/store'
-import { getToken } from '@/utils/auth'
-
-// create an axios instance
-const service = axios.create({
- baseURL: '/bwhse', // url = base url + request url
- // withCredentials: true, // send cookies when cross-domain requests
- timeout: 5000 // request timeout
-})
-
-// request interceptor
-service.interceptors.request.use(
- config => {
- // do something before request is sent
-
- if (store.getters.token) {
- // let each request carry token
- // ['X-Token'] is a custom headers key
- // please modify it according to the actual situation
- config.headers['X-Token'] = getToken()
- }
- return config
- },
- error => {
- // do something with request error
- console.log(error) // for debug
- return Promise.reject(error)
- }
-)
-
-// response interceptor
-service.interceptors.response.use(
- /**
- * If you want to get http information such as headers or status
- * Please return response => response
- */
-
- /**
- * Determine the request status by custom code
- * Here is just an example
- * You can also judge the status by HTTP Status Code
- */
- response => {
- const res = response
- // if the custom code is not 20000, it is judged as an error.
- if (res.status !== 200) {
- Message({
- message: res.message || 'Error',
- type: 'error',
- duration: 5 * 1000
- })
-
- // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
- if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
- // to re-login
- MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
- confirmButtonText: 'Re-Login',
- cancelButtonText: 'Cancel',
- type: 'warning'
- }).then(() => {
- store.dispatch('user/resetToken').then(() => {
- location.reload()
- })
- })
- }
- return Promise.reject(new Error(res.message || 'Error'))
- } else {
- return res
- }
- },
- error => {
- console.log('err' + error) // for debug
- Message({
- message: error.message,
- type: 'error',
- duration: 5 * 1000
- })
- return Promise.reject(error)
- }
-)
-
-export default service
+import axios from 'axios'
+import { MessageBox, Message } from 'element-ui'
+import store from '@/store'
+import { getToken } from '@/utils/auth'
+
+// create an axios instance
+const service = axios.create({
+ baseURL: '/bwhse', // url = base url + request url
+ // withCredentials: true, // send cookies when cross-domain requests
+ timeout: 5000 // request timeout
+})
+
+// request interceptor
+service.interceptors.request.use(
+ config => {
+ // do something before request is sent
+
+ if (store.getters.token) {
+ // let each request carry token
+ // ['X-Token'] is a custom headers key
+ // please modify it according to the actual situation
+ config.headers['X-Token'] = getToken()
+ }
+ return config
+ },
+ error => {
+ // do something with request error
+ console.log(error) // for debug
+ return Promise.reject(error)
+ }
+)
+
+// response interceptor
+service.interceptors.response.use(
+ /**
+ * If you want to get http information such as headers or status
+ * Please return response => response
+ */
+
+ /**
+ * Determine the request status by custom code
+ * Here is just an example
+ * You can also judge the status by HTTP Status Code
+ */
+ response => {
+ const res = response
+ // if the custom code is not 20000, it is judged as an error.
+ if (res.status !== 200) {
+ Message({
+ message: res.message || 'Error',
+ type: 'error',
+ duration: 5 * 1000
+ })
+
+ // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
+ if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
+ // to re-login
+ MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
+ confirmButtonText: 'Re-Login',
+ cancelButtonText: 'Cancel',
+ type: 'warning'
+ }).then(() => {
+ store.dispatch('user/resetToken').then(() => {
+ location.reload()
+ })
+ })
+ }
+ return Promise.reject(new Error(res.message || 'Error'))
+ } else {
+ if (res.data.message === '当前用户没有登录!') {
+ // store.dispatch('user/logout')
+ this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+ }
+ return res
+ }
+ },
+ error => {
+ console.log('err' + error) // for debug
+ Message({
+ message: error.message,
+ type: 'error',
+ duration: 5 * 1000
+ })
+ return Promise.reject(error)
+ }
+)
+
+export default service
diff --git a/src/views/hidden_check/components/create/index.vue b/src/views/hidden_check/components/create/index.vue
index 7a9c183c..647b2bb0 100644
--- a/src/views/hidden_check/components/create/index.vue
+++ b/src/views/hidden_check/components/create/index.vue
@@ -1,344 +1,355 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 返回列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_check/components/edit_form/index.vue b/src/views/hidden_check/components/edit_form/index.vue
index f0b9d348..3ba73025 100644
--- a/src/views/hidden_check/components/edit_form/index.vue
+++ b/src/views/hidden_check/components/edit_form/index.vue
@@ -1,344 +1,355 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 返回列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_check/index.vue b/src/views/hidden_check/index.vue
index 5588b1c2..79a6b187 100644
--- a/src/views/hidden_check/index.vue
+++ b/src/views/hidden_check/index.vue
@@ -1,348 +1,348 @@
-
-
-
-
-
-
-
-
-
-
- {{
- scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
- }}
-
-
- {{ parseDay(scope.row.hidden_danger__check_date) }}
-
-
-
-
-
-
- {{ scope.row[d.prop] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{
+ scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
+ }}
+
+
+ {{ parseDay(scope.row.hidden_danger__check_date) }}
+
+
+
+
+
+
+ {{ scope.row[d.prop] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_reform/components/create/index.vue b/src/views/hidden_reform/components/create/index.vue
index 7a9c183c..b6a055ab 100644
--- a/src/views/hidden_reform/components/create/index.vue
+++ b/src/views/hidden_reform/components/create/index.vue
@@ -1,344 +1,355 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 返回列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_reform/components/edit_form/index.vue b/src/views/hidden_reform/components/edit_form/index.vue
index 6ed37f62..498b9c82 100644
--- a/src/views/hidden_reform/components/edit_form/index.vue
+++ b/src/views/hidden_reform/components/edit_form/index.vue
@@ -1,374 +1,385 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 返回列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_reform/index.vue b/src/views/hidden_reform/index.vue
index 0ddada7a..e4dceb30 100644
--- a/src/views/hidden_reform/index.vue
+++ b/src/views/hidden_reform/index.vue
@@ -1,327 +1,327 @@
-
-
-
-
-
-
-
-
-
-
- {{
- scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
- }}
- {{
- scope.row.hidden_danger__hidden_state == 3 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
- }}
-
-
- {{ parseDay(scope.row.hidden_danger__check_date) }}
-
-
- {{ parseDay(scope.row.hidden_danger__reform_limit) }}
-
-
-
-
-
-
- {{ scope.row[d.prop] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{
+ scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
+ }}
+ {{
+ scope.row.hidden_danger__hidden_state == 3 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
+ }}
+
+
+ {{ parseDay(scope.row.hidden_danger__check_date) }}
+
+
+ {{ parseDay(scope.row.hidden_danger__reform_limit) }}
+
+
+
+
+
+
+ {{ scope.row[d.prop] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_review/components/create/index.vue b/src/views/hidden_review/components/create/index.vue
index 7a9c183c..ce462bc9 100644
--- a/src/views/hidden_review/components/create/index.vue
+++ b/src/views/hidden_review/components/create/index.vue
@@ -1,344 +1,355 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 返回列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_review/components/edit_form/index.vue b/src/views/hidden_review/components/edit_form/index.vue
index 89903c99..70cad97f 100644
--- a/src/views/hidden_review/components/edit_form/index.vue
+++ b/src/views/hidden_review/components/edit_form/index.vue
@@ -1,428 +1,439 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
- 取 消
- 确 定
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 返回列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+ 取 消
+ 确 定
+
+
+
+
+
+
+
+
diff --git a/src/views/hidden_review/index.vue b/src/views/hidden_review/index.vue
index eeed0937..be56d298 100644
--- a/src/views/hidden_review/index.vue
+++ b/src/views/hidden_review/index.vue
@@ -1,297 +1,297 @@
-
-
-
-
-
-
-
-
-
-
- {{
- scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
- }}
- {{
- scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
- }}
-
-
- {{ parseDay(scope.row.hidden_danger__check_date) }}
-
-
- {{ parseDay(scope.row.hidden_danger__reform_limit) }}
-
-
-
-
-
-
- {{ scope.row[d.prop] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{
+ scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
+ }}
+ {{
+ scope.row.hidden_danger__hidden_state == 1 ? '排查中' : scope.row.hidden_danger__hidden_state == 2 ? '待整改' :scope.row.hidden_danger__hidden_state == 3 ? '整改中' :scope.row.hidden_danger__hidden_state == 4 ? '待验收' : '已验收'
+ }}
+
+
+ {{ parseDay(scope.row.hidden_danger__check_date) }}
+
+
+ {{ parseDay(scope.row.hidden_danger__reform_limit) }}
+
+
+
+
+
+
+ {{ scope.row[d.prop] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+