Browse Source

Merge branch 'dev-20220218' into test

shibei_master
jiangyy 4 years ago
parent
commit
0cf13cd1d6
  1. 2
      .env.production
  2. 2
      .env.production.uat
  3. 4
      public/index.html
  4. 2
      src/App.vue
  5. 2
      src/assets/scss/common.scss
  6. 2
      src/components/ren-process-detail/src/ren-process-detail.vue
  7. 2
      src/i18n/index.js
  8. 472
      src/js/ajax.js
  9. 4
      src/main.js
  10. 2
      src/mixins/view-module.js
  11. 278
      src/router/index.js
  12. 8
      src/utils/request.js
  13. 2
      src/views/components/tinymce/index.vue
  14. 6
      src/views/main-content.vue
  15. 113
      src/views/main-navbar.vue
  16. 6
      src/views/main-shuju/main-content.vue
  17. 35
      src/views/main-shuju/main-navbar.vue
  18. 8
      src/views/main-shuju/main.vue
  19. 111
      src/views/main.vue
  20. 4
      src/views/modules/activiti/model.vue
  21. 2
      src/views/modules/activiti/process-deploy.vue
  22. 2
      src/views/modules/activiti/process-initiation.vue
  23. 2
      src/views/modules/activiti/process.vue
  24. 51
      src/views/modules/base/community/buildTable.vue
  25. 57
      src/views/modules/base/community/communityTable.vue
  26. 32
      src/views/modules/base/community/roomTable.vue
  27. 70
      src/views/modules/base/resi.vue
  28. 69
      src/views/modules/communityParty/elegant/index.vue
  29. 2
      src/views/modules/message/mail-template-add-or-update.vue
  30. 2
      src/views/modules/oss/oss-upload.vue
  31. 12
      src/views/modules/shequ/index.vue
  32. 2
      src/views/modules/sys/news-add-or-update.vue
  33. 8
      src/views/modules/visual/communityGovern/typePieOption.js
  34. 2
      src/views/pages/404.vue
  35. 2
      src/views/pages/index.vue
  36. 2
      src/views/pages/login copy.vue
  37. 4
      src/views/pages/login.vue

2
.env.production

@ -1,4 +1,4 @@
NODE_ENV=production
VUE_APP_API_SERVER = https://epmet-cloud.elinkservice.cn/api
VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api
VUE_APP_NODE_ENV=prod
VUE_APP_PUBLIC_PATH=epmet-oper

2
.env.production.uat

@ -1,4 +1,4 @@
NODE_ENV=production
VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
VUE_APP_API_SERVER = http://120.27.18.76/api
VUE_APP_NODE_ENV=prod:uat
VUE_APP_PUBLIC_PATH=epmet-oper

4
public/index.html

@ -57,13 +57,13 @@
<!-- 验收测试环境 aliyun -->
<% if (process.env.VUE_APP_NODE_ENV==='prod:uat' ) { %>
<script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api'
window.SITE_CONFIG['apiURL'] = 'http://120.27.18.76/api'
</script>
<% } %>
<!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %>
<script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api'
window.SITE_CONFIG['apiURL'] = 'https://epdc-shibei.elinkservice.cn/api'
</script>
<% } %>
</head>

2
src/App.vue

@ -19,7 +19,7 @@ export default {
methods: {
i18nHandle (val, oldVal) {
Cookies.set('language', val)
localStorage.setItem('language', val)
document.querySelector('html').setAttribute('lang', val)
document.title = messages[val].brand.lg
//

2
src/assets/scss/common.scss

@ -9,7 +9,7 @@ body {
font-size: $--font-size-base;
line-height: $base--line-height;
color: $--color-text-primary;
background-color: #fff;
// background-color: #fff;
}
a {
color: mix(#fff, $--color-primary, 20%);

2
src/components/ren-process-detail/src/ren-process-detail.vue

@ -69,7 +69,7 @@ export default {
// (xml/image)url
getResourceURL () {
var params = qs.stringify({
'token': Cookies.get('token'),
'token': localStorage.getItem('token'),
'processInstanceId': this.dataForm.processInstanceId
})
return `${window.SITE_CONFIG['apiURL']}/activiti/his/getInstImage?${params}`

2
src/i18n/index.js

@ -29,6 +29,6 @@ export const messages = {
}
export default new VueI18n({
locale: Cookies.get('language') || 'zh-CN',
locale: localStorage.getItem('language') || 'zh-CN',
messages
})

472
src/js/ajax.js

@ -1,42 +1,40 @@
/* eslint-disable */
import axios from 'axios'
import Cookies from 'js-cookie'
import router from '@/router'
import qs from 'qs'
import { clearLoginInfo } from '@/utils'
import isPlainObject from 'lodash/isPlainObject'
import Vue from 'vue'
import { Loading } from 'element-ui' //引入Loading服务
import axios from "axios";
import Cookies from "js-cookie";
import router from "@/router";
import qs from "qs";
import { clearLoginInfo } from "@/utils";
import isPlainObject from "lodash/isPlainObject";
import Vue from "vue";
import { Loading } from "element-ui"; //引入Loading服务
// 默认超时时间60s
axios.defaults.timeout = 60000
axios.defaults.timeout = 60000;
let timer
let loading
let timer;
let loading;
//请求时间超过300ms 提示加载
function startLoading () {
if (timer) return
function startLoading() {
if (timer) return;
timer = setTimeout(() => {
loading = Loading.service({
lock: true, //是否锁定
text: '正在加载……', //加载中需要显示的文字
background: 'rgba(0,0,0,.7)', //背景颜色
})
}, 300)
text: "正在加载……", //加载中需要显示的文字
background: "rgba(0,0,0,.7)", //背景颜色
});
}, 300);
}
//结束加载动画
function endLoading () {
function endLoading() {
if (timer) {
clearTimeout(timer)
clearTimeout(timer);
}
if (loading) {
loading.close()
loading.close();
}
}
@ -45,71 +43,65 @@ function endLoading () {
*/
axios.interceptors.request.use(
(config) => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || ''
config.headers['Authorization'] = Cookies.get('token') || ''
config.headers["Accept-Language"] =
localStorage.getItem("language") || "zh-CN";
config.headers["token"] = localStorage.getItem("token") || "";
config.headers["Authorization"] = localStorage.getItem("token") || "";
// 默认参数
var defaults = {}
var defaults = {};
// 防止缓存,GET请求默认带_t参数
if (config.method === 'get') {
if (config.method === "get") {
config.params = {
...config.params,
...{ _t: new Date().getTime() },
}
};
}
if (isPlainObject(config.params)) {
config.params = {
...defaults,
...config.params,
}
};
}
if (isPlainObject(config.data)) {
config.data = {
...defaults,
...config.data,
}
};
if (
/^application\/x-www-form-urlencoded/.test(
config.headers['content-type']
config.headers["content-type"]
)
) {
config.data = qs.stringify(config.data)
config.data = qs.stringify(config.data);
}
}
return config
return config;
},
(error) => {
return Promise.reject(error)
return Promise.reject(error);
}
)
);
/**
* 响应拦截
*/
axios.interceptors.response.use(
(response) => {
const code = [10007, 401, 10001, 10005]
if (code.includes(response.data.code) ) {
const code = [10007, 401, 10001, 10005];
if (code.includes(response.data.code)) {
// debugger;
clearLoginInfo()
// localStorage.setItem('userType', 'work')
// let userType = localStorage.getItem("userType");
// if (userType === 'work'){
// router.replace({ name: 'loginWork' })
// }else {
// router.replace({ name: 'login' })
// }
router.replace({ name: 'login' })
clearLoginInfo();
router.replace({ name: "login" });
return Promise.reject(response.data.msg)
return Promise.reject(response.data.msg);
}
return response
return response;
},
(error) => {
console.error(error)
return Promise.reject(error)
console.error(error);
return Promise.reject(error);
}
)
);
const post = (url, params, headers) => {
return new Promise((reslove, reject) => {
@ -119,14 +111,14 @@ const post = (url, params, headers) => {
resolve(res);
})
.catch((err) => {
reject(err)
})
})
}
reject(err);
});
});
};
export const requestPost = async (url = '', params = {}, headers = {}) => {
const ret = await post(url, params, headers)
console.log(url, ret)
export const requestPost = async (url = "", params = {}, headers = {}) => {
const ret = await post(url, params, headers);
console.log(url, ret);
// if (ret.status === 200) {
// var data = res.data
// if (data.code == 0) {
@ -141,7 +133,7 @@ export const requestPost = async (url = '', params = {}, headers = {}) => {
// } else {
// if (typeof cb_err === 'function') cb_err(res)
// }
}
};
/*
* 1后台请求成功均返回业务上的异常也属于请求成功 res.status=200的响应码
@ -153,140 +145,137 @@ export const requestPost = async (url = '', params = {}, headers = {}) => {
*/
export default {
// 并发请求
all (gets, cb) {
all(gets, cb) {
if (gets && gets.length > 0) {
let functions = gets.map((get) => {
return axios.get(processUrl(get.url), {
params: get.params,
})
})
});
});
axios.all(functions).then(
axios.spread((..._results) => {
let results = _results.map((_result) => {
return _result.data.data
})
cb(results)
return _result.data.data;
});
cb(results);
})
)
);
}
},
get (url, params, cb_su, cb_err, headers) {
get(url, params, cb_su, cb_err, headers) {
var p = {
params: params,
}
if (headers && JSON.stringify(headers) != '{}') {
};
if (headers && JSON.stringify(headers) != "{}") {
var h = {
headers: headers,
}
};
p = {
...p,
...h,
}
};
}
url = url + '?r=' + new Date().getTime() //时间戳作为随机码,防止IE从缓存获取数据
url = url + "?r=" + new Date().getTime(); //时间戳作为随机码,防止IE从缓存获取数据
axios
.get(processUrl(url), p)
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
var data = res.data;
if (data.code == 0) {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data.data, data.msg )
if (typeof cb_su === "function") {
cb_su(data.data, data.msg);
}
} else {
//业务失败
if (typeof cb_err === 'function') cb_err(data.msg , data.data)
if (typeof cb_err === "function") cb_err(data.msg, data.data);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
})
.catch((err) => {
if (typeof (cb_err === 'function')) {
cb_err(err)
if (typeof (cb_err === "function")) {
cb_err(err);
}
})
});
},
put (url, data, cb_su, cb_err) {
put(url, data, cb_su, cb_err) {
axios
.put(processUrl(url), data)
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
if (data.sysresultcode === 'success') {
var data = res.data;
if (data.sysresultcode === "success") {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data.data, data.rspMsg)
if (typeof cb_su === "function") {
cb_su(data.data, data.rspMsg);
}
} else if (data.sysresultcode === 'fail') {
} else if (data.sysresultcode === "fail") {
//业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg, data.data)
if (typeof cb_err === "function") cb_err(data.rspMsg, data.data);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
})
.catch((err) => {
if (typeof cb_err === 'function') {
cb_err(err)
if (typeof cb_err === "function") {
cb_err(err);
}
})
});
},
post (url, data, cb_su, cb_err, headers) {
var h = {}
if (headers && JSON.stringify(headers) != '{}') {
post(url, data, cb_su, cb_err, headers) {
var h = {};
if (headers && JSON.stringify(headers) != "{}") {
h = {
headers,
}
};
}
//var data = qs.stringify(paramas);
axios
.post(processUrl(url), data, h)
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
var data = res.data;
if (data.code == 0) {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data.data, data.msg )
if (typeof cb_su === "function") {
cb_su(data.data, data.msg);
}
} else {
//业务失败
if (typeof cb_err === 'function') cb_err(data.msg , data.data)
if (typeof cb_err === "function") cb_err(data.msg, data.data);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
})
.catch((err) => {
if (typeof cb_err === 'function') {
cb_err(err)
if (typeof cb_err === "function") {
cb_err(err);
}
})
});
},
post2 (url, data, cb_su, cb_err, headers) {
var h = {}
if (headers && JSON.stringify(headers) != '{}') {
post2(url, data, cb_su, cb_err, headers) {
var h = {};
if (headers && JSON.stringify(headers) != "{}") {
h = {
headers,
}
};
}
//var data = qs.stringify(paramas);
axios
@ -294,22 +283,22 @@ export default {
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
cb_su(data, data.msg )
var data = res.data;
cb_su(data, data.msg);
} else {
if (typeof cb_err === 'function') cb_err(data.msg , data)
if (typeof cb_err === "function") cb_err(data.msg, data);
}
} else {
if (typeof cb_err === 'function') cb_err(data.msg , data)
if (typeof cb_err === "function") cb_err(data.msg, data);
}
})
.catch((err) => {
if (typeof cb_err === 'function') {
cb_err(err)
if (typeof cb_err === "function") {
cb_err(err);
}
})
});
},
delete (url, params, cb_su, cb_err) {
delete(url, params, cb_su, cb_err) {
axios
.delete(processUrl(url), {
params: params,
@ -317,219 +306,217 @@ export default {
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
if (data.sysresultcode === 'success') {
var data = res.data;
if (data.sysresultcode === "success") {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data.data, data.rspMsg)
if (typeof cb_su === "function") {
cb_su(data.data, data.rspMsg);
}
} else if (data.sysresultcode === 'fail') {
} else if (data.sysresultcode === "fail") {
//业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg, data.data)
if (typeof cb_err === "function") cb_err(data.rspMsg, data.data);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
})
.catch((err) => {
if (typeof cb_err === 'function') {
cb_err(err)
if (typeof cb_err === "function") {
cb_err(err);
}
})
});
},
//导出文件,包括excel,word等
exportFile (url, params, cb_su, cb_err, headers) {
var h = {}
if (headers && JSON.stringify(headers) != '{}') {
h = headers
exportFile(url, params, cb_su, cb_err, headers) {
var h = {};
if (headers && JSON.stringify(headers) != "{}") {
h = headers;
}
var errorMsg = '操作失败'
url = url + '?r=' + new Date().getTime() //时间戳作为随机码,防止IE从缓存获取数据
var errorMsg = "操作失败";
url = url + "?r=" + new Date().getTime(); //时间戳作为随机码,防止IE从缓存获取数据
axios({
method: 'get',
method: "get",
url: processUrl(url),
params: params,
headers: h, //{ tenantCode: "GDYXB" },
responseType: 'blob',
responseType: "blob",
})
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data //直接返回blob
var data = res.data; //直接返回blob
if (data) {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data, '操作成功')
if (typeof cb_su === "function") {
cb_su(data, "操作成功");
}
} else {
//业务失败
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
})
.catch((err) => {
if (typeof (cb_err === 'function')) {
cb_err(errorMsg)
if (typeof (cb_err === "function")) {
cb_err(errorMsg);
}
})
});
},
//导出文件,包括excel,word等
exportFilePost (url, params, cb_su, cb_err) {
exportFilePost(url, params, cb_su, cb_err) {
//var data = qs.stringify(paramas);
// axios
// .post(processUrl(url), data)
axios({
method: 'post',
method: "post",
url: processUrl(url),
data: params,
responseType: 'blob',
responseType: "blob",
})
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data //直接返回blob
var data = res.data; //直接返回blob
// if (data.code == 0) {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data)
}
else {
//业务成功
if (typeof cb_su === "function") {
cb_su(data);
} else {
//业务失败
if (typeof cb_err === 'function') cb_err(errorMsg)
}
// } else {
if (typeof cb_err === "function") cb_err(errorMsg);
}
// } else {
// if (typeof cb_err === 'function') cb_err(errorMsg)
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
})
.catch((err) => {
if (typeof cb_err === 'function') {
cb_err(err)
if (typeof cb_err === "function") {
cb_err(err);
}
})
});
},
//上传文件
importFilePut (url, fileFormData, cb_su, cb_err) {
var errorMsg = '操作失败'
importFilePut(url, fileFormData, cb_su, cb_err) {
var errorMsg = "操作失败";
let requestConfig = {
headers: {
'Content-Type': 'multipart/form-data',
"Content-Type": "multipart/form-data",
// Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
},
}
};
Vue.http
.put(processUrl(url), fileFormData, requestConfig)
.then((res) => {
if (res && res.status === 200) {
var data = res.body //直接返回blob
var data = res.body; //直接返回blob
if (data.sysresultcode === 'fail') {
if (data.sysresultcode === "fail") {
//业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg)
} else if (data.sysresultcode === 'success') {
if (typeof cb_err === "function") cb_err(data.rspMsg);
} else if (data.sysresultcode === "success") {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data, '操作成功')
if (typeof cb_su === "function") {
cb_su(data, "操作成功");
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
})
.catch((err) => {
if (typeof (cb_err === 'function')) {
cb_err(errorMsg)
if (typeof (cb_err === "function")) {
cb_err(errorMsg);
}
})
});
},
//上传文件
importFilePost (url, fileFormData, cb_su, cb_err) {
var errorMsg = '操作失败'
importFilePost(url, fileFormData, cb_su, cb_err) {
var errorMsg = "操作失败";
let requestConfig = {
headers: {
'Content-Type': 'multipart/form-data'
"Content-Type": "multipart/form-data",
// Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
}
}
},
};
Vue.http
.post(processUrl(url), fileFormData, requestConfig)
.then((res) => {
if (res && res.status === 200) {
var data = res.body //直接返回blob
var data = res.body; //直接返回blob
if (data.sysresultcode === 'fail') {
if (data.sysresultcode === "fail") {
//业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg)
} else if (data.sysresultcode === 'success') {
if (typeof cb_err === "function") cb_err(data.rspMsg);
} else if (data.sysresultcode === "success") {
//业务成功
if (typeof cb_su === 'function') {
cb_su(data, '操作成功')
if (typeof cb_su === "function") {
cb_su(data, "操作成功");
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
} else {
if (typeof cb_err === 'function') cb_err(errorMsg)
if (typeof cb_err === "function") cb_err(errorMsg);
}
})
.catch((err) => {
if (typeof (cb_err === 'function')) {
cb_err(errorMsg)
if (typeof (cb_err === "function")) {
cb_err(errorMsg);
}
})
});
},
//登录获取token/刷新token
tokenPost (url, paramas, cb_su, cb_err) {
var data = qs.stringify(paramas)
tokenPost(url, paramas, cb_su, cb_err) {
var data = qs.stringify(paramas);
axios
.post(processUrl(url), data)
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
var data = res.data;
if (data) {
if (typeof cb_su === 'function') {
cb_su(data)
if (typeof cb_su === "function") {
cb_su(data);
}
} else {
if (typeof cb_err === 'function') cb_err('登录验证失败')
if (typeof cb_err === "function") cb_err("登录验证失败");
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
} else {
if (typeof cb_err === 'function') cb_err(res)
if (typeof cb_err === "function") cb_err(res);
}
})
.catch((err) => {
var rspMsg = '登录失败,请重试!'
var rspMsg = "登录失败,请重试!";
if (
err &&
err.response &&
err.response.status === 401 &&
err.response.data &&
err.response.data.error === 'unauthorized'
err.response.data.error === "unauthorized"
) {
// 用户名不存在时: 状态码401
// Response Body:
@ -537,92 +524,91 @@ export default {
// "error": "unauthorized",
// "error_description": null
// }
rspMsg = err.response.data.error_description || '用户名不存在'
rspMsg = err.response.data.error_description || "用户名不存在";
} else if (
err &&
err.response &&
err.response.status === 400 &&
err.response.data &&
err.response.data.error === 'invalid_grant'
err.response.data.error === "invalid_grant"
) {
// 用户名存在,密码错误时:状态码400
// {
// "error": "invalid_grant",
// "error_description": "Bad credentials"
// }
rspMsg = '用户名或密码输入错误'
rspMsg = "用户名或密码输入错误";
}
if (typeof cb_err === 'function') {
cb_err(rspMsg)
if (typeof cb_err === "function") {
cb_err(rspMsg);
}
})
});
},
//通过接口传递的token进行验证登录 lyx 20191210
async interfacetokenPost (url, paramas, cb_su, cb_err) {
var data = qs.stringify(paramas)
async interfacetokenPost(url, paramas, cb_su, cb_err) {
var data = qs.stringify(paramas);
await axios
.post(processUrl(url), data)
.then((res) => {
if (res) {
if (res.status === 200) {
var data = res.data
var data = res.data;
if (data) {
if (typeof cb_su === 'function') {
cb_su(data)
return true
if (typeof cb_su === "function") {
cb_su(data);
return true;
}
} else {
if (typeof cb_err === 'function') {
cb_err('接口验证失败')
return false
if (typeof cb_err === "function") {
cb_err("接口验证失败");
return false;
}
}
} else {
if (typeof cb_err === 'function') {
cb_err(res)
return false
if (typeof cb_err === "function") {
cb_err(res);
return false;
}
}
} else {
if (typeof cb_err === 'function') {
cb_err(res)
return false
if (typeof cb_err === "function") {
cb_err(res);
return false;
}
}
})
.catch((err) => {
var rspMsg = '接口验证失败,请重试!'
var rspMsg = "接口验证失败,请重试!";
if (
err &&
err.response &&
err.response.status === 401 &&
err.response.data &&
err.response.data.error === 'unauthorized'
err.response.data.error === "unauthorized"
) {
rspMsg = '用户名不存在'
rspMsg = "用户名不存在";
} else if (
err &&
err.response &&
err.response.status === 400 &&
err.response.data &&
err.response.data.error === 'invalid_grant'
err.response.data.error === "invalid_grant"
) {
rspMsg = '用户名或密码输入错误'
rspMsg = "用户名或密码输入错误";
}
if (typeof cb_err === 'function') {
cb_err(rspMsg)
return false
if (typeof cb_err === "function") {
cb_err(rspMsg);
return false;
}
})
});
},
}
};
// 添加服务器端URL
function processUrl (url) {
if (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) {
return url
function processUrl(url) {
if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) {
return url;
}
return process.env.VUE_APP_API_SERVER + url
return process.env.VUE_APP_API_SERVER + url;
}

4
src/main.js

@ -33,7 +33,9 @@ import getQueryPara from "dai-js/modules/getQueryPara";
// 兼容token传参登录
if (getQueryPara("token")) {
console.log('token', getQueryPara("token"));
Cookies.set("token", getQueryPara("token"));
localStorage.setItem("token", getQueryPara("token"));
console.log('token222222', localStorage.getItem('token'));
}
window.app = Object.assign(

2
src/mixins/view-module.js

@ -142,7 +142,7 @@ export default {
// 导出
exportHandle () {
var params = qs.stringify({
'token': Cookies.get('token'),
'token': localStorage.getItem('token'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`

278
src/router/index.js

@ -161,179 +161,129 @@ router.beforeEach((to, from, next) => {
const customerId = localStorage.getItem("customerId");
console.log("customerId:", customerId);
// if(customerId==='1e68188b8f7e9ab15658c164bd5b3676'){
// // if(customerId==='45687aa479955f9d06204d415238f7cc'){
// const menuList=[
// {
// children: [],
// createdBy: "a76fc711807ac9827d7611b0f94ec220",
// createdTime: "2020-08-26 16:38",
// delFlag: null,
// icon: "icon-database",
// id: "abe812eb350f6b5eda575e268e50ac1c",
// name: "定制功能配置",
// parentName: null,
// permissions: "",
// pid: "0",
// resourceList: null,
// revision: 0,
// showFlag: 1,
// sort: 2,
// type: 0,
// updatedBy: "a76fc711807ac9827d7611b0f94ec220",
// updatedTime: "2020-09-02 14:49",
// url: "customer/customize/ConfigItem",
// },
// {
// children: [],
// createdBy: "a76fc711807ac9827d7611b0f94ec220",
// createdTime: "2020-08-26 16:38",
// delFlag: null,
// icon: "icon-file-text",
// id: "8e55eba74c920c00c44c125e3bc73ddc",
// name: "居民端首页配置",
// parentName: null,
// permissions: "",
// pid: "0",
// resourceList: null,
// revision: 0,
// showFlag: 1,
// sort: 3,
// type: 0,
// updatedBy: "a76fc711807ac9827d7611b0f94ec220",
// updatedTime: "2020-09-02 14:49",
// url: "customer/customize/MiniHome",
// }
// ]
// window.SITE_CONFIG['menuList'] = menuList
// fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
// // next({ ...to, replace: true })
// next({ ...to, replace: true })
// }else{
// http
// .get("/gov/access/menu/nav")
// .then(({ data: res }) => {
// if (res.code !== 0) {
// // Vue.prototype.$message.error(res.msg)
// return next({
// name: "login",
// });
// }
http
.get("/gov/access/menu/nav")
.then(({ data: res }) => {
if (res.code !== 0) {
// Vue.prototype.$message.error(res.msg)
return next({
name: "login",
});
}
window.SITE_CONFIG["menuShujuList"] = [
// next({
// ...to,
// replace: true,
// });
// })
// .catch(() => {
// next({
// name: "login",
// });
// });
window.SITE_CONFIG["menuShujuList"] = [
{
icon: "icon-setting",
id: "22213213",
name: "基础信息",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
icon: "icon-setting",
id: "22213213",
url: "/visual/basicinfo/basicInfoMain",
name: "基础信息",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/basicinfo/basicInfoMain",
name: "基础信息",
id: "5feawfwaefwa5",
},
{
url: "/visual/basicinfo/personCategory/index",
name: "人员类别分析",
id: "5fwaefwaefawef5",
},
],
id: "5feawfwaefwa5",
},
{
icon: "icon-setting",
id: "3",
name: "人员预警",
url: "visual/warning/index",
url: "/visual/basicinfo/personCategory/index",
name: "人员类别分析",
id: "5fwaefwaefawef5",
},
],
},
{
icon: "icon-setting",
id: "3",
name: "人员预警",
url: "visual/warning/index",
},
{
icon: "icon-setting",
id: "6",
name: "社区治理",
children: [
{
icon: "icon-setting",
id: "6",
name: "社区治理",
children: [
{
url: "visual/communityGovern/processAnalyze",
name: "项目处理分析",
id: "processAnalyze",
},
{
url: "/visual/communityGovern/typeAnalyze",
name: "项目分类分析",
id: "typeAnalyze",
},
{
url: "/visual/communityGovern/resibuzz",
name: "居民热议",
id: "resibuzz",
},
{
url: "/visual/communityGovern/distributionAnalyze",
name: "项目分布分析",
id: "distributionAnalyze",
},
],
url: "visual/communityGovern/processAnalyze",
name: "项目处理分析",
id: "processAnalyze",
},
{
icon: "icon-setting",
id: "2221321001",
name: "社区党建",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/communityParty/party",
name: "党员信息统计",
id: "5feawfwaefwa578",
},
{
url: "/visual/communityParty/community",
name: "区域化党建",
id: "5fwaefwaefawef588",
},
{
url: "/visual/communityParty/elegant",
name: "党员风采",
id: "5fwaefwaefawef589",
}
],
url: "/visual/communityGovern/typeAnalyze",
name: "项目分类分析",
id: "typeAnalyze",
},
{
icon: "icon-setting",
id: "2221321123",
name: "措施清单",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/measure/service",
name: "服务措施分析",
id: "5feawfwaefwa57",
},
{
url: "/visual/measure/volunteer",
name: "志愿者服务分析",
id: "5fwaefwaefawef58",
},
],
url: "/visual/communityGovern/resibuzz",
name: "居民热议",
id: "resibuzz",
},
{
icon: "icon-setting",
id: "2221321fefefaewfa123",
name: "初心互助",
url: "visual/heart/index",
children: [],
url: "/visual/communityGovern/distributionAnalyze",
name: "项目分布分析",
id: "distributionAnalyze",
},
];
fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
// next({ ...to, replace: true })
next({
...to,
replace: true,
});
})
.catch(() => {
next({
name: "login",
});
});
],
},
{
icon: "icon-setting",
id: "2221321001",
name: "社区党建",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/communityParty/party",
name: "党员信息统计",
id: "5feawfwaefwa578",
},
{
url: "/visual/communityParty/community",
name: "区域化党建",
id: "5fwaefwaefawef588",
},
{
url: "/visual/communityParty/elegant",
name: "党员风采",
id: "5fwaefwaefawef589",
},
],
},
{
icon: "icon-setting",
id: "2221321123",
name: "措施清单",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/measure/service",
name: "服务措施分析",
id: "5feawfwaefwa57",
},
{
url: "/visual/measure/volunteer",
name: "志愿者服务分析",
id: "5fwaefwaefawef58",
},
],
},
{
icon: "icon-setting",
id: "2221321fefefaewfa123",
name: "初心互助",
url: "visual/heart/index",
children: [],
},
];
fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
http
.get("/gov/access/menu/nav")
@ -426,9 +376,9 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
},
{
path: "*",
redirect: {
name: "404",
},
// redirect: {
// name: "404",
// },
},
]);
window.SITE_CONFIG["dynamicMenuRoutes"] = routes;
@ -479,9 +429,9 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
},
{
path: "*",
redirect: {
name: "404",
},
// redirect: {
// name: "404",
// },
},
]);
window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes;

8
src/utils/request.js

@ -7,7 +7,7 @@ import isPlainObject from 'lodash/isPlainObject'
const http = axios.create({
baseURL: window.SITE_CONFIG['apiURL'],
timeout: 1000 * 180,
timeout: 1000 * 900,
withCredentials: true
})
@ -15,9 +15,9 @@ const http = axios.create({
* 请求拦截
*/
http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || ''
config.headers['Authorization'] = Cookies.get('token') || ''
config.headers['Accept-Language'] = localStorage.getItem('language') || 'zh-CN'
config.headers['token'] = localStorage.getItem('token') || ''
config.headers['Authorization'] = localStorage.getItem('token') || ''
// 默认参数
var defaults = {}
// 防止缓存,GET请求默认带_t参数

2
src/views/components/tinymce/index.vue

@ -137,7 +137,7 @@ export default {
})
},
getUserToken () {
let token = Cookie.get('token')
let token = localStorage.getItem('token')
// console.log('token', token)
// return this.$store.getters['user/isLogin']
return token

6
src/views/main-content.vue

@ -87,7 +87,7 @@ export default {
// this.$nextTick(() => {
// this.sendMessage()
// })
this.token = Cookie.get("token");
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
},
methods: {
@ -100,7 +100,7 @@ export default {
this.iframeUrl =
url +
"?token=" +
Cookie.get("token") +
localStorage.getItem("token") +
"&customerId=" +
localStorage.getItem("customerId");
return isURL(url);
@ -169,7 +169,7 @@ export default {
console.log("iframe", iframe);
// iframe.postMessage({
// token: Cookie.get('token'),
// token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId')
// }, '*')
iframe.postMessage({ name: "lalalal" }, "*");

113
src/views/main-navbar.vue

@ -46,9 +46,7 @@
mode="horizontal"
class="aui-navbar__menu mr-auto z-div"
>
<el-menu-item
@click="toIndexPage"
>
<el-menu-item @click="toIndexPage">
<span>首页</span>
</el-menu-item>
@ -104,12 +102,11 @@
<i class="el-icon-arrow-down"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@click.native="updatePasswordHandle()"
>{{ $t('updatePassword.title') }}</el-dropdown-item
>
<el-dropdown-item @click.native="updatePasswordHandle()">{{
$t("updatePassword.title")
}}</el-dropdown-item>
<el-dropdown-item @click.native="logoutHandle()">{{
$t('logout')
$t("logout")
}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -127,119 +124,121 @@
</template>
<script>
import { messages } from '@/i18n'
import { mapGetters } from 'vuex'
import screenfull from 'screenfull'
import UpdatePasswordWork from './main-navbar-update-password-work'
import { clearLoginInfo } from '@/utils'
import { messages } from "@/i18n";
import { mapGetters } from "vuex";
import screenfull from "screenfull";
import UpdatePasswordWork from "./main-navbar-update-password-work";
import { clearLoginInfo } from "@/utils";
export default {
inject: ['refresh'],
inject: ["refresh"],
data() {
return {
showHeader: true,
i18nMessages: messages,
updatePassowrdVisible: false,
customerName: localStorage.getItem('customerName')
}
customerName: "",
};
},
components: {
UpdatePasswordWork
UpdatePasswordWork,
},
created() {
let platformToken = localStorage.getItem('showHeader') || ''
let platformToken = localStorage.getItem("showHeader") || "";
if (
typeof platformToken !== 'undefined' &&
platformToken !== 'undefined' &&
platformToken !== ''
typeof platformToken !== "undefined" &&
platformToken !== "undefined" &&
platformToken !== ""
) {
this.showHeader = false
this.showHeader = false;
}
console.log('=============================', this.userType)
this.changeCustomerName();
console.log("=============================", this.userType);
},
computed: {
userType() {
return localStorage.getItem('userType')
}
return localStorage.getItem("userType");
},
},
methods: {
toIndexPage(){
this.$router.replace('/indexWork')
toIndexPage() {
this.$router.replace("/indexWork");
},
// menuId()
gotoRouteHandle(menuId, idx) {
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(
var route = window.SITE_CONFIG["dynamicMenuRoutes"].filter(
(item) => item.meta.menuId === menuId
)[0]
)[0];
if (route) {
this.$router.push({ name: route.name })
this.$router.push({ name: route.name });
}
this.$store.state.LevelOneMenuActiveName = menuId
this.$store.state.LevelOneMenuActiveName = menuId;
this.$store.state.sidebarActiveSubMenuList =
this.$store.state.sidebarMenuList[idx].children || []
this.$store.state.sidebarMenuList[idx].children || [];
},
changeCustomerName(customerName) {
this.customerName = localStorage.getItem('customerName')
this.customerName =
localStorage.getItem("customerName") || "党建引领基层治理互联管理平台";
},
//
fullscreenHandle() {
if (!screenfull.enabled) {
return this.$message({
message: this.$t('fullscreen.prompt'),
type: 'warning',
duration: 500
})
message: this.$t("fullscreen.prompt"),
type: "warning",
duration: 500,
});
}
screenfull.toggle()
screenfull.toggle();
},
//
updatePasswordHandle() {
this.updatePassowrdVisible = true
this.updatePassowrdVisible = true;
this.$nextTick(() => {
this.$refs.updatePassowrd.init()
})
this.$refs.updatePassowrd.init();
});
},
// 退
logoutHandle() {
this.$confirm(
this.$t('prompt.info', { handle: this.$t('logout') }),
this.$t('prompt.title'),
this.$t("prompt.info", { handle: this.$t("logout") }),
this.$t("prompt.title"),
{
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
confirmButtonText: this.$t("confirm"),
cancelButtonText: this.$t("cancel"),
type: "warning",
}
)
.then(() => {
//
// tabs,
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name === 'home'
)
(item) => item.name === "home"
);
this.$http
.post('/auth/login/logout')
.post("/auth/login/logout")
.then(({ data: res }) => {
if (res.code !== 0) {
// 退
if (res.code !== 10007) {
this.$message.error(res.msg)
this.$message.error(res.msg);
}
}
clearLoginInfo()
this.$router.push({ name: 'login' })
clearLoginInfo();
this.$router.push({ name: "login" });
// if (localStorage.getItem('userType') === 'work') {
// this.$router.push({ name: 'loginWork' })
// } else {
// this.$router.push({ name: 'login' })
// }
})
.catch(() => {})
.catch(() => {});
})
.catch(() => {})
}
}
}
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.main-line {

6
src/views/main-shuju/main-content.vue

@ -24,7 +24,7 @@ export default {
// this.$nextTick(() => {
// this.sendMessage()
// })
this.token = Cookie.get('token')
this.token = localStorage.getItem('token')
this.customerId = localStorage.getItem('customerId')
},
methods: {
@ -34,7 +34,7 @@ export default {
// tabs, iframe
tabIsIframe (url) {
// this.appendIframe(url)
this.iframeUrl = url + '?token=' + Cookie.get('token') + '&customerId=' + localStorage.getItem('customerId')
this.iframeUrl = url + '?token=' + localStorage.getItem('token') + '&customerId=' + localStorage.getItem('customerId')
return isURL(url)
},
// tabs, tab
@ -85,7 +85,7 @@ export default {
console.log('iframe', iframe)
// iframe.postMessage({
// token: Cookie.get('token'),
// token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId')
// }, '*')
iframe.postMessage({ name: 'lalalal' }, '*')

35
src/views/main-shuju/main-navbar.vue

@ -3,9 +3,7 @@
<nav v-if="showHeader" class="m-navbar">
<div class="navbar__header">
<h1 class="navbar__brand" @click="$router.push({ name: 'home' })">
<a class="navbar__brand-lg" href="javascript:;">{{
userType === "work" ? customerName : $t("brand.lg")
}}</a>
<a class="navbar__brand-lg" href="javascript:;">{{ customerName }}</a>
<a class="navbar__brand-mini" href="javascript:;">{{
customerName.slice(0, 2)
}}</a>
@ -150,29 +148,25 @@ export default {
showHeader: true,
i18nMessages: messages,
updatePassowrdVisible: false,
customerName: localStorage.getItem("customerName"),
customerName: "",
};
},
components: {
UpdatePasswordWork,
},
created() {
let platformToken = localStorage.getItem("showHeader") || "";
if (
typeof platformToken !== "undefined" &&
platformToken !== "undefined" &&
platformToken !== ""
) {
this.showHeader = false;
}
console.log("=============================", this.userType);
// let platformToken = localStorage.getItem("showHeader") || "";
// if (
// typeof platformToken !== "undefined" &&
// platformToken !== "undefined" &&
// platformToken !== ""
// ) {
// this.showHeader = false;
// }
this.changeCustomerName();
this.$store.state.mainShuju.menuList = window.SITE_CONFIG["menuShujuList"];
},
computed: {
userType() {
return localStorage.getItem("userType");
},
},
computed: {},
methods: {
toIndexPage() {
this.$router.replace("/indexWork");
@ -187,8 +181,9 @@ export default {
this.$store.state.mainShuju.activeName = menuId;
}
},
changeCustomerName(customerName) {
this.customerName = localStorage.getItem("customerName");
changeCustomerName() {
this.customerName =
localStorage.getItem("customerName") || "数据分析可视化平台";
},
//
fullscreenHandle() {

8
src/views/main-shuju/main.vue

@ -108,12 +108,18 @@ export default {
async getWorkUserInfo() {
const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$store.state.user = { ...data };
console.log("user---hahha", this.$store.state.user);
localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id);
if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || "");
}
} else {
this.$message.error(rspMsg);
}
},
},

111
src/views/main.vue

@ -1,22 +1,25 @@
<template>
<div v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="[
<div
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="[
'aui-wrapper',
{ 'aui-sidebar--fold': $store.state.sidebarFold },
{
'aui-sidebar--noside':
$store.state.sidebarActiveSubMenuList.length == 0,
$store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe,
},
{ 'z-iframe': $store.state.inIframe },
]">
]"
>
<template v-if="!loading">
<main-navbar ref="ref_navbar"
v-if="!$store.state.inIframe" />
<main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" />
<main-sidebar v-if="!$store.state.inIframe" />
<div class="aui-content__wrapper">
<main-content v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName" />
<main-content
v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName"
/>
</div>
<main-theme-tools v-if="!$store.state.inIframe" />
</template>
@ -31,12 +34,13 @@ import MainThemeTools from "./main-theme-tools";
import debounce from "lodash/debounce";
import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
export default {
provide () {
provide() {
return {
//
refresh () {
refresh() {
this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false;
@ -44,7 +48,7 @@ export default {
},
};
},
data () {
data() {
return {
loading: true,
userType: localStorage.getItem("userType"),
@ -60,26 +64,23 @@ export default {
watch: {
$route: "routeHandle",
},
async created () {
async created() {
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
console.log(this.$store.state.sidebarMenuList);
this.windowResizeHandle();
this.routeHandle(this.$route);
if (localStorage.getItem("userType") === "work") {
Promise.all([this.getWorkUserInfo()]).then(() => {
this.loading = false;
});
} else {
Promise.all([this.getUserInfo()]).then(() => {
this.loading = false;
});
}
Promise.all([this.getWorkUserInfo()]).then(() => {
this.loading = false;
});
},
computed: {},
methods: {
changeCustomerName (customerName) {
changeCustomerName(customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName);
},
//
windowResizeHandle () {
windowResizeHandle() {
this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener(
@ -91,7 +92,7 @@ export default {
);
},
// ,
routeHandle (route) {
routeHandle(route) {
if (!route.meta.isTab) {
return false;
}
@ -114,7 +115,7 @@ export default {
this.$store.state.contentTabsActiveName = tab.name;
this.syncLevelOneMenuActive(tab.menuId);
},
async syncLevelOneMenuActive (menuId) {
async syncLevelOneMenuActive(menuId) {
await nextTick();
console.log(
"*******************************",
@ -137,54 +138,22 @@ export default {
idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : [];
},
//
getUserInfo () {
const url = "/epmetuser/operuser/queryOperUserDto";
return this.$http
.get(url)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$store.state.user.id = res.data.id;
this.$store.state.user.realName = res.data.realName;
this.$store.state.user.superAdmin = res.data.superAdmin;
this.$store.state.user.gender = data.gender;
localStorage.setItem("customerId", "");
})
.catch(() => { });
},
//
getWorkUserInfo () {
async getWorkUserInfo() {
const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {};
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.$store.state.user = { ...data };
console.log("user---hahha", this.$store.state.user);
// this.$store.state.user.id = data.id
// this.$store.state.user.realName = data.realName
// this.$store.state.user.superAdmin = data.superAdmin
// this.$store.state.user.gender = data.gender
localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id);
// this.$store.state.user.roleList = data.roleList
// this.$store.state.user.customerId = data.customerId
},
(rspMsg, data) => {
this.$message.error(rspMsg);
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$store.state.user = { ...data };
console.log("user---hahha", this.$store.state.user);
localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id);
if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || "");
}
);
// return this.$http.get(url).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// }).catch(() => { })
} else {
this.$message.error(rspMsg);
}
},
},
};

4
src/views/modules/activiti/model.vue

@ -83,7 +83,7 @@ export default {
// 线url
getModelerURL (id) {
var params = qs.stringify({
'token': Cookies.get('token'),
'token': localStorage.getItem('token'),
'modelId': id
})
return `${window.SITE_CONFIG['apiURL']}/activiti/modeler.html?${params}`
@ -91,7 +91,7 @@ export default {
// url
getExportURL (id) {
var params = qs.stringify({
'token': Cookies.get('token')
'token': localStorage.getItem('token')
})
return `${window.SITE_CONFIG['apiURL']}/activiti/model/export/${id}?${params}`
},

2
src/views/modules/activiti/process-deploy.vue

@ -28,7 +28,7 @@ export default {
methods: {
init () {
this.visible = true
this.url = `${window.SITE_CONFIG['apiURL']}/activiti/process/deploy?token=${Cookies.get('token')}`
this.url = `${window.SITE_CONFIG['apiURL']}/activiti/process/deploy?token=${localStorage.getItem('token')}`
this.fileList = []
},
//

2
src/views/modules/activiti/process-initiation.vue

@ -85,7 +85,7 @@ export default {
// (xml/image)url
getResourceURL (id, name) {
var params = qs.stringify({
'token': Cookies.get('token'),
'token': localStorage.getItem('token'),
'deploymentId': id,
'resourceName': name
})

2
src/views/modules/activiti/process.vue

@ -101,7 +101,7 @@ export default {
// (xml/image)url
getResourceURL (id, name) {
var params = qs.stringify({
'token': Cookies.get('token'),
'token': localStorage.getItem('token'),
'deploymentId': id,
'resourceName': name
})

51
src/views/modules/base/community/buildTable.vue

@ -34,15 +34,18 @@
<el-button style="float:left"
type="yellow"
size="small"
icon="el-icon-download"
@click="handleExport">导出</el-button>
<el-button style="float:left"
type="green"
size="small"
icon="el-icon-plus"
@click="handleAdd">新增楼宇</el-button>
<el-button style=";margin-left:10px"
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule('building')">下载楼宇模板</el-button>
<el-upload style=""
@ -55,11 +58,14 @@
:http-request="(()=>{uploadFile( 'building')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importBuildingLoading"
type="red">导入楼宇数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule('room')">下载房屋模板</el-button>
<el-upload style=""
@ -72,6 +78,8 @@
:http-request="(()=>{uploadFile( 'room')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
@ -172,7 +180,8 @@ let loading // 加载动画
export default {
data () {
return {
loading: false,
importBuildingLoading: false,
importRoomLoading: false,
total: 0,
pageSize: 20,
pageNo: 0,
@ -429,10 +438,14 @@ export default {
async uploadFile (type) {
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
this.loading = true
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
//
@ -451,33 +464,37 @@ export default {
this.$refs['upload_building'].clearFiles()
// url = 'http://192.168.51.26:8080/api/gov/org/building/buildingimport'
url = '/gov/org/building/buildingimport'
this.importBuildingLoading = true
} else if (type === 'room') {
this.$refs['upload_room'].clearFiles()
// url = 'http://192.168.51.26:8080/api/gov/org/house/houseimport'
url = '/gov/org/house/houseimport'
this.importRoomLoading = true
}
this.startLoading()
window.app.ajax.post2(url, fileFormData,
(data, rspMsg) => {
this.endLoading()
if (data.code === 0 || data.code > 8000) {
// this.$message({
// type: "success",
// message: ""
// });
// this.$message.success(rspMsg)
// this.$emit('refreshTree')
// this.loadTable()
}
this.showMessage(rspMsg)
this.$emit('refreshTree')
this.loadTable()
if (type === 'building') {
this.importBuildingLoading = false
} else if (type === 'room') {
this.importRoomLoading = false
}
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
if (type === 'building') {
this.importBuildingLoading = false
} else if (type === 'room') {
this.importRoomLoading = false
}
}, { headers: { 'Content-Type': 'multipart/form-data' } })
},

57
src/views/modules/base/community/communityTable.vue

@ -34,16 +34,19 @@
<el-button style=""
type="yellow"
size="small"
icon="el-icon-download"
@click="handleExport">导出</el-button>
<el-button style=""
type="green"
size="small"
icon="el-icon-plus"
@click="handleAdd">新增小区</el-button>
<div class="btn_upload"
v-if="agencyObj.level==='community'||agencyObj.level==='grid'">
<el-button style=""
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule('community')">下载小区模板</el-button>
<el-upload ref="upload_community"
@ -56,12 +59,15 @@
:http-request="(()=>{uploadFile( 'community')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importCommunityLoading"
type="red">导入小区数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule('building')">下载楼宇模板</el-button>
<el-upload style=""
@ -74,11 +80,14 @@
:http-request="(()=>{uploadFile( 'building')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importBuildingLoading"
type="red">导入楼宇数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule('room')">下载房屋模板</el-button>
<el-upload style=""
@ -91,6 +100,8 @@
:http-request="(()=>{uploadFile( 'room')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
@ -192,7 +203,9 @@ let loading // 加载动画
export default {
data () {
return {
loading: false,
importBuildingLoading: false,
importRoomLoading: false,
importCommunityLoading: false,
total: 0,
pageSize: 20,
pageNo: 0,
@ -457,10 +470,16 @@ export default {
async uploadFile (type) {
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
this.loading = true
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
//
let url = ''
@ -471,6 +490,7 @@ export default {
fileFormData.append('orgType', this.agencyObj.level === 'grid' ? 'grid' : 'agency');//filenamefiletest.zip
if (type === 'community') {
this.importCommunityLoading = true
this.$refs['upload_community'].clearFiles()
url = '/gov/org/icneighborhood/neighborhoodimport'
@ -478,27 +498,44 @@ export default {
} else if (type === 'building') {
this.$refs['upload_building'].clearFiles()
url = '/gov/org/building/buildingimport'
this.importBuildingLoading = true
} else if (type === 'room') {
this.$refs['upload_room'].clearFiles()
url = '/gov/org/house/houseimport'
this.importRoomLoading = true
}
this.startLoading()
window.app.ajax.post2(url, fileFormData,
(data, rspMsg) => {
this.endLoading()
if (data.code === 0 || data.code > 8000) {
}
this.$emit('refreshTree')
this.loadTable()
// this.showMessage(rspMsg)
if (type === 'community') {
this.importCommunityLoading = false
} else if (type === 'building') {
this.importBuildingLoading = false
} else if (type === 'room') {
this.importRoomLoading = false
}
this.showMessage(rspMsg)
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
if (type === 'community') {
this.importCommunityLoading = false
} else if (type === 'building') {
this.importBuildingLoading = false
} else if (type === 'room') {
this.importRoomLoading = false
}
// this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })

32
src/views/modules/base/community/roomTable.vue

@ -34,14 +34,17 @@
<el-button style="float:left"
type="yellow"
size="small"
icon="el-icon-download"
@click="handleExport">导出</el-button>
<el-button style="float:left"
type="green"
icon="el-icon-plus"
size="small"
@click="handleAdd">新增房屋</el-button>
<el-button style="float:left"
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload ref="upload"
:multiple='false'
@ -54,6 +57,8 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
@ -165,7 +170,7 @@ let loading // 加载动画
export default {
data () {
return {
loading: false,
importRoomLoading: false,
total: 0,
pageSize: 20,
pageNo: 0,
@ -407,13 +412,19 @@ export default {
},
async uploadFile () {
this.loading = true
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
//
this.$refs['upload'].clearFiles()
@ -424,24 +435,19 @@ export default {
fileFormData.append('orgId', this.agencyObj.id);//filenamefiletest.zip
fileFormData.append('orgType', this.agencyObj.level);//filenamefiletest.zip
this.startLoading()
this.importRoomLoading = true
window.app.ajax.post2(url, fileFormData,
(data, rspMsg) => {
this.endLoading()
if (data.code === 0 || data.code > 8000) {
// this.$message({
// type: "success",
// message: ""
// });
// this.$emit('refreshTree')
// this.loadTable()
}
this.showMessage(rspMsg)
this.$emit('refreshTree')
this.loadTable()
this.importRoomLoading = false
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
this.importRoomLoading = false
}, { headers: { 'Content-Type': 'multipart/form-data' } })

70
src/views/modules/base/resi.vue

@ -457,38 +457,56 @@ export default {
async uploadHttpRequest (file) {
this.importLoading = true
this.importBtnTitle = '正在上传中...'
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) //
await axios({
url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
method: 'post',
data: formData,
timeout: '900000',
responseType: 'blob'
})
.then((res) => {
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob)
var aLink = document.createElement('a')
aLink.style.display = 'none'
aLink.href = url
aLink.setAttribute('download', fileName)
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url) //blob
}
this.getTableData()
})
.catch(err => {
await this.$http
.post('/epmetuser/icresiuser/importExcel', formData).then(res => {
console.log('res-up', res)
if (res.data.code == 0 && res.data.msg == 'success') {
this.$message.success('导入成功')
this.getTableData()
} else this.$message.error(res.data.msg)
}).catch(err => {
console.log('失败', err)
file.onError() //
this.$message.error('导入失败')
})
// await axios({
// url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
// method: 'post',
// data: formData,
// timeout: '300000',
// responseType: 'blob'
// })
// .then((res) => {
// console.log('res-up', res)
// // if (res.headers["content-disposition"]) {
// // let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
// // console.log('filename', fileName)
// // let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
// // var url = window.URL.createObjectURL(blob)
// // var aLink = document.createElement('a')
// // aLink.style.display = 'none'
// // aLink.href = url
// // aLink.setAttribute('download', fileName)
// // document.body.appendChild(aLink)
// // aLink.click()
// // document.body.removeChild(aLink) //
// // window.URL.revokeObjectURL(url) //blob
// // }
// this.getTableData()
// })
// .catch(err => {
// console.log('', err)
// file.onError() //
// this.$message.error('')
// })
this.importLoading = false
this.importBtnTitle = '导入人员数据'
this.$refs.upload.clearFiles()

69
src/views/modules/communityParty/elegant/index.vue

@ -374,36 +374,55 @@ export default {
async uploadHttpRequest(file) {
this.importLoading = true
this.importBtnTitle = '正在上传中...'
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) //
await axios({
url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/import',
method: 'post',
data: formData,
responseType: 'blob'
})
.then((res) => {
// this.importLoading = false
// this.importBtnTitle = ''
// let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
// console.log('filename', fileName)
// let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
// var url = window.URL.createObjectURL(blob)
// var aLink = document.createElement('a')
// aLink.style.display = 'none'
// aLink.href = url
// aLink.setAttribute('download', fileName)
// document.body.appendChild(aLink)
// aLink.click()
// document.body.removeChild(aLink) //
// window.URL.revokeObjectURL(url) //blob
this.getTableData()
})
.catch( err => {
this.$http
.post('/resi/partymember/icpartymemberstyle/import', formData).then(res => {
console.log('res-up', res)
if (res.data.code == 0 && res.data.msg == 'success') {
this.$message.success('导入成功')
this.getTableData()
} else {
this.$message.error(res.data.msg)
}
}).catch(err => {
console.log('失败', err)
file.onError() //
this.$message.error('导入失败')
})
})
// await axios({
// url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/import',
// method: 'post',
// data: formData,
// responseType: 'blob'
// })
// .then((res) => {
// // this.importLoading = false
// // this.importBtnTitle = ''
// // let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
// // console.log('filename', fileName)
// // let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
// // var url = window.URL.createObjectURL(blob)
// // var aLink = document.createElement('a')
// // aLink.style.display = 'none'
// // aLink.href = url
// // aLink.setAttribute('download', fileName)
// // document.body.appendChild(aLink)
// // aLink.click()
// // document.body.removeChild(aLink) //
// // window.URL.revokeObjectURL(url) //blob
// this.getTableData()
// })
// .catch( err => {
// console.log('', err)
// file.onError() //
// this.$message.error('')
// })
this.importLoading = false
this.importBtnTitle = '导入人员数据'
this.$refs.upload.clearFiles()

2
src/views/modules/message/mail-template-add-or-update.vue

@ -108,7 +108,7 @@ export default {
theme: 'snow'
})
// (使element upload)
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${localStorage.getItem('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})

2
src/views/modules/oss/oss-upload.vue

@ -29,7 +29,7 @@ export default {
methods: {
init () {
this.visible = true
this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${localStorage.getItem('token')}`
this.num = 0
this.fileList = []
},

12
src/views/modules/shequ/index.vue

@ -355,7 +355,13 @@
</div>
<!-- 修改弹出框 -->
<div v-show="showedFuncPanel">
<div
v-show="showedFuncPanel"
v-if="
Array.isArray($store.state.sidebarMenuList) &&
$store.state.sidebarMenuList.length > 0
"
>
<div class="m-panel">
<div
class="m-list"
@ -711,6 +717,10 @@ export default {
},
mounted() {
this.getApiData();
console.log(
"dynamicMenuRoutes----------------------------",
this.$store.state.sidebarMenuList
);
},
methods: {
computedWidth(label) {

2
src/views/modules/sys/news-add-or-update.vue

@ -108,7 +108,7 @@ export default {
theme: 'snow'
})
// (使element upload)
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${localStorage.getItem('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})

8
src/views/modules/visual/communityGovern/typePieOption.js

@ -77,7 +77,7 @@ const center= ['50%', '250px']
// height: '80%',
selectedMode: 'single',
left: 'center',
width: 400,
width: 480,
label: {
// show: false,
position: 'outside',
@ -88,14 +88,14 @@ const center= ['50%', '250px']
edgeDistance: 1,
lineHeight: 15,
color: '#fff',
fontSize: 12,
fontSize: 10,
// distanceToLabelLine: -60,
rich: {
name: {
padding: [0, 6, 0, 6]
},
a: {
fontSize: 30,
fontSize: 25,
color: '#fff',
padding: [0, 6, 6, 6]
},
@ -111,7 +111,7 @@ const center= ['50%', '250px']
labelLine: {
show: false,
smooth: 0.2,
length: 30,
length: 50,
length2: 0,
maxSurfaceAngle: 80
},

2
src/views/pages/404.vue

@ -2,7 +2,7 @@
<div class="aui-wrapper aui-page__not-found">
<div class="aui-content__wrapper">
<div class="aui-content">
<h2 class="title">400</h2>
<h2 class="title">404</h2>
<p class="desc" v-html="$t('notFound.desc')"></p>
<div class="btn-bar">
<el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button>

2
src/views/pages/index.vue

@ -73,7 +73,7 @@ export default {
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token)
localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' })
})
.catch(() => {})

2
src/views/pages/login copy.vue

@ -145,7 +145,7 @@ export default {
return this.$message.error(res.msg)
}
localStorage.setItem('userType', 'oper')
Cookies.set('token', res.data.token)
localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => { })
}).catch(() => { })
})

4
src/views/pages/login.vue

@ -243,7 +243,7 @@ export default {
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token)
localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' })
})
.catch(() => { })
@ -271,7 +271,7 @@ export default {
localStorage.setItem('userType', 'work')
Cookies.set('token', res.data.token)
localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'indexWork' }).catch(() => { })
})
.catch(() => { })

Loading…
Cancel
Save