Commit fdc3ae9a authored by 曾沂轮's avatar 曾沂轮

Merge branch 'master' of http://172.16.10.197/svi/Templates/smart-web-tabs

# Conflicts:
#	template/vue.config.js
parents b155d6de 9b4fd18a
<template>
<div
v-if="reportDatas && !loading"
style="height:100%">
<smart-report
ref="reporting"
:baseUrl="baseUrl"
:data="reportDatas">
</smart-report>
</div>
</template>
<script>
import Api from '@charts/api';
import { baseUrl } from '@config/http.config';
import { getQueryString } from './utils';
export default {
name: 'App',
data() {
return {
pageId: '',
baseUrl: baseUrl + '/charts',
reportDatas: null,
loading: false
};
},
created() {
this.pageId = getQueryString('pageId');
},
mounted() {
this.initDatas();
},
methods: {
initDatas() {
if (!this.pageId) return;
this.loading = true;
Api.getChartViewById(this.pageId).then(res => {
this.loading = false;
const { status, data } = res;
if (status === 0) {
if (data.pageData !== null) {
data.pageData = JSON.parse(data.pageData);
}
this.reportDatas = data;
return false;
} else {
this.$message.warning(res.message || '系统异常!');
}
}).catch(err => {
this.loading = false;
this.$message.error(err.message || '系统故障!');
});
}
}
};
</script>
<style>
html, body {
min-height: 100%;
}
</style>
import config from '@config/config';
const Api = {
...config,
/**
* 获取图表信息
* @param {String} rid
*/
getChartViewById(rid) {
return config.doGetPromise('/charts/chartsView/getChartViewById', {rid: rid});
}
};
export default Api;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="shortcut icon" type="image/ico" href="<%= BASE_URL %>favicon.ico">
<title>图表渲染 - Smart Web</title>
<!-- <link rel="stylesheet" href="<%= BASE_URL %>iconfont/iconfont.css"> -->
<style type="text/css">
.maskbox {
border: 2px solid #ff0000;
background: #f8ecda;
opacity: 0.1;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
}
</style>
</head>
<body>
<div id="chartsapp"></div>
<!-- built files will be auto injected -->
</body>
</html>
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import ElemetUI from 'element-ui';
import 'element-ui/packages/theme-chalk/lib/index.css';
import SmartCharts from 'smart-charts';
import 'smart-charts/lib/smart-report/smartReport.css';
// import scss
Vue.config.productionTip = false;
Vue.use(ElemetUI, {
size: 'medium',
zIndex: 4000
});
Vue.use(SmartCharts);
/* eslint-disable no-new */
new Vue({
el: '#chartsapp',
components: {
App
},
template: '<App/>'
});
blockquote,body,button,dd,dl,dt,fieldset,form,h1,h2,h3,h4,h5,h6,hr,html,iframe,input,legend,li,ol,p,pre,td,textarea,th,ul{
margin:0;
padding:0;
}
html, body {
width: 100%;
}
body {
min-width: 1200px;
font-size: 1rem;
font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;
color: #606266;
overflow: auto;
}
iframe {
width: 100%;
height: 100%;
border: 0;
outline: none;
}
a {
color: #0a6fe2;
text-decoration: none;
}
ul, ol, li {
list-style: none;
}
* {
scrollbar-base-color: #cecece;
scrollbar-3dlight-color: #eee;
scrollbar-highlight-color: #eee;
scrollbar-track-color: #f1f1f1;
// scrollbar-arrow-color: #000;
scrollbar-shadow-color: #eee;
// scrollbar-dark-shadow-color: #eee;
box-sizing: border-box;
}
*::-webkit-scrollbar {
width: 6px;
height: 6px;
}
*::-webkit-scrollbar-button {
display: none;
}
*::-webkit-scrollbar-track-piece {
background-color: #f2f2f2;
}
*::-webkit-scrollbar-thumb {
background-color: #C1C1C1;
border-radius: 6px;
}
textarea {
font-family: 'Microsoft YaHei', Arial, Helvetica, sans-serif !important;
}
\ No newline at end of file
/**
* 获取URL参数
* @param {string} name 参数名
*/
export function getQueryString(name) {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = window.location.search.substr(1).match(reg);
if (r !== null) return unescape(r[2]);
return null;
}
import Vue from 'vue'; import Vue from 'vue';
import axios from 'axios'; import axios from 'axios';
import qs from 'qs'; import qs from 'qs';
import './loginInterceptor'; import store from '@/store';
import * as HTTP from '@config/http.config'; import * as _config from '@config/http.config';
import { Message } from 'element-ui';
// 携带cookie信息 // 携带cookie信息
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
// 设置全局的请求次数,请求的间隙 // 设置全局的请求次数,请求的间隙
axios.defaults.retry = 0; axios.defaults.retry = 1;
axios.defaults.retryDelay = 1000; axios.defaults.retryDelay = 1000;
// 设置defaults.baseURL
axios.defaults.baseURL = _config.baseUrl;
// 请求超时拦截,重新请求 // 请求超时拦截,重新请求
axios.interceptors.response.use(undefined, function axiosRetryInterceptor(err) { axios.interceptors.response.use(function(response) {
const status = response.status;
// const data = response.data;
if (status !== 200) {
Message({
type: 'error',
message: '请求服务好像出错了,' + status
});
return Promise.reject(response);
}/* else if (data.status === 2) {
Message({
type: 'error',
message: '请求服务后台处理出现了错误'
});
} else if (data.status === 1) {
Message({
type: 'warning',
message: '请求服务处理出现了异常,' + data.message
});
} */
return Promise.resolve(response);
}, function axiosRetryInterceptor(err) {
const config = err.config; const config = err.config;
// If config does not exist or the retry option is not set, reject // If config does not exist or the retry option is not set, reject
if (!config || !config.retry) return Promise.reject(err); if (!config || !config.retry) return Promise.reject(err);
...@@ -21,6 +47,11 @@ axios.interceptors.response.use(undefined, function axiosRetryInterceptor(err) { ...@@ -21,6 +47,11 @@ axios.interceptors.response.use(undefined, function axiosRetryInterceptor(err) {
// Check if we've maxed out the total number of retries // Check if we've maxed out the total number of retries
if (config.__retryCount >= config.retry) { if (config.__retryCount >= config.retry) {
const status = err.response.status;
Message({
type: 'error',
message: `请求服务好像出错了,状态码:${status}`
});
// Reject with the error // Reject with the error
return Promise.reject(err); return Promise.reject(err);
} }
...@@ -41,18 +72,10 @@ axios.interceptors.response.use(undefined, function axiosRetryInterceptor(err) { ...@@ -41,18 +72,10 @@ axios.interceptors.response.use(undefined, function axiosRetryInterceptor(err) {
}); });
}); });
// 为Vue注册$http
Vue.prototype.$http = axios;
const CancelToken = axios.CancelToken; const CancelToken = axios.CancelToken;
let cancel; let cancel;
const baseUrl = HTTP.baseUrl;
window.baseUrl = baseUrl;
const config = { const config = {
baseUrl,
/** /**
* get获取数据,通用方法 * get获取数据,通用方法
* @param {String} url * @param {String} url
...@@ -61,30 +84,25 @@ const config = { ...@@ -61,30 +84,25 @@ const config = {
*/ */
doGetPromise(url, params, options = {}) { doGetPromise(url, params, options = {}) {
const { timeout = 30000, ...arg } = options; const { timeout = 30000, ...arg } = options;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios.get(url, {
.get(url, { timeout: timeout,
timeout: timeout, ...arg,
...arg, params: {
params: { systemId: store.state.platformInfo.systemId, // 全面接口添加systemId字段
...params, ...params,
t: new Date().getTime() // 解决IE上get请求缓存问题 t: new Date().getTime() // 解决IE上get请求缓存问题
}, },
cancelToken: new CancelToken(function executor(c) { cancelToken: new CancelToken(function executor(c) {
cancel = c; cancel = c;
})
}) })
.then(response => { }).then(response => {
resolve(response.data); resolve(response.data);
}) }).catch(response => {
.catch(response => { reject(response);
console.error('ajax error:', response); });
reject(response);
});
}); });
}, },
/** /**
* FormData数据上传,文件上传必用 * FormData数据上传,文件上传必用
* @param {String} url * @param {String} url
...@@ -92,73 +110,72 @@ const config = { ...@@ -92,73 +110,72 @@ const config = {
*/ */
doPostPromiseForm(url, formData) { doPostPromiseForm(url, formData) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios // 全面接口添加systemId字段
.post(url, formData, { if (formData.has) { // ie FormData没有has方法
headers: { if (formData.has('systemId')) formData.append('systemId', store.state.platformInfo.systemId);
'Content-type': 'multipart/form-data' }
}, axios.post(url, formData, {
emulateJSON: false, headers: {
emulateHTTP: false, 'Content-type': 'multipart/form-data'
cancelToken: new CancelToken(function executor(c) { },
cancel = c; emulateJSON: false,
}) emulateHTTP: false,
cancelToken: new CancelToken(function executor(c) {
cancel = c;
}) })
.then(res => { }).then(res => {
resolve(res.data); resolve(res.data);
}) }).catch(res => {
.catch(res => { reject(res);
reject(res); });
});
}); });
}, },
/** /**
* 默认方式提交from表单数据json * 默认方式提交from表单数据
* @param {String} url * @param {String} url
* @param {Object} data * @param {Object} data
*/ */
doPostPromise(url, data) { doPostPromise(url, data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios // 全面接口添加systemId字段
.post(url, qs.stringify(data), { if (!data.hasOwnProperty('systemId')) data.systemId = store.state.platformInfo.systemId;
headers: { axios.post(url, qs.stringify(data), {
'Content-type': 'application/x-www-form-urlencoded' headers: {
}, 'Content-type': 'application/x-www-form-urlencoded'
cancelToken: new CancelToken(function executor(c) { },
cancel = c; cancelToken: new CancelToken(function executor(c) {
}) cancel = c;
})
.then(res => {
resolve(res.data);
}) })
.catch(res => { }).then(res => {
reject(res); resolve(res.data);
}); }).catch(res => {
reject(res);
});
}); });
}, },
/** /**
* 提交application/json方式 * 默认方式提交json数据
* @param {String} url * @param {String} url
* @param {Object} data * @param {Object} data
*/ */
doPostPromiseJson(url, data) { doPostPromiseJson(url, data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios // 全面接口添加systemId字段
.post(url, data, { if (!data.hasOwnProperty('systemId')) data.systemId = store.state.platformInfo.systemId;
headers: { axios.post(url, data, {
'Content-type': 'application/json' headers: {
}, 'Content-type': 'application/json'
cancelToken: new CancelToken(function executor(c) { },
cancel = c; cancelToken: new CancelToken(function executor(c) {
}) cancel = c;
})
.then(res => {
resolve(res.data);
}) })
.catch(res => { }).then(res => {
reject(res); resolve(res.data);
}); }).catch(res => {
reject(res);
});
}); });
} }
}; };
......
...@@ -6,7 +6,7 @@ const serviceUrl = process.env.VUE_APP_SERVICE_APP; ...@@ -6,7 +6,7 @@ const serviceUrl = process.env.VUE_APP_SERVICE_APP;
if (typeof window !== 'undefined') window.baseUrl = baseUrl; if (typeof window !== 'undefined') window.baseUrl = baseUrl;
export { export {
baseUrl, baseUrl,
serviceUrl serviceUrl
}; };
import axios from 'axios'; import axios from 'axios';
import store from '@/store'; import store from '@/store';
import router from '@/router'; import router from '@/router';
import MessageBox from 'element-ui/lib/message-box';
/* const filters = ['webgisService'] /* const filters = ['webgisService']
const handleFilter = (key) => { const handleFilter = (key) => {
if (Array.isArray(filters)) { if (Array.isArray(filters)) {
filters.map(item => { filters.forEach(item => {
if (item === key) {} if (item === key) {}
}) })
} }
...@@ -15,20 +16,44 @@ const handleFilter = (key) => { ...@@ -15,20 +16,44 @@ const handleFilter = (key) => {
/** /**
* 登录判断失效 * 登录判断失效
* 在所有经过axios请求中,拦截到登录失效 * 在所有经过axios请求中,拦截到登录失效
* *
* @param {Object} response * @param {Object} response
*/ */
let isOtherLogin = false;
function loginInterceptor(response) { function loginInterceptor(response) {
// console.log(response) // 9: 此账号在其他地方登陆
// 通过状态码判断登录已经失效 // 8: 账号登录已经失效
if (response.data && response.data.status === 9) { if (response.data && response.data.status === 8) {
store.dispatch('setUserInfo', {}); if (!isOtherLogin) {
router.replace({ store.dispatch('setUserInfo', {});
name: 'Logindialog' router.replace({
}); name: 'LoginDialog',
// response.data = null query: router.currentRoute.query
});
isOtherLogin = false;
// response.data = null
}
return response; return response;
} else { } else if (response.data && response.data.status === 9) {
if (!isOtherLogin) {
isOtherLogin = true;
store.dispatch('setUserInfo', {});
MessageBox.alert('该账号在别的地方登录了,请重新登录', '提示', {
type: 'warning',
confirmButtonText: '登录',
callback: action => {
isOtherLogin = false;
if (action === 'confirm') {
router.replace({
name: 'LoginDialog',
query: router.currentRoute.query
});
}
}
});
}
return response;
} else {
return response; return response;
} }
} }
......
import config from './config'; import config from '@config/config';
const baseUrl = config.baseUrl;
const Api = { const Api = {
...config, ...config,
login(data) { login(data) {
return config.doPostPromise(baseUrl + '/index/login', data); return config.doPostPromise('/index/login', data);
}, },
checkLogin() { checkLogin() {
return config.doGetPromise(baseUrl + '/index/checkLogin', {}, { retry: 0 }); return config.doGetPromise('/index/checkLogin', {}, { retry: 0 });
}, },
logout() { logout() {
return config.doGetPromise(baseUrl + '/index/logout', {}); return config.doGetPromise('/index/logout', {});
}, },
/** /**
* *
* @param {*} businessDefinitionId
* @param {*} taskId * @param {*} taskId
* @param {*} linkId
* @param {*} linkKey
*/ */
getBusinessStartForm(businessDefinitionId) { getBusinessStartForm(businessDefinitionId, taskId) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/v1.1.0/workflow/workflowForm/getBusinessStartForm', '/v1.1.0/workflow/workflowForm/getBusinessStartForm',
{ {
businessDefinitionId businessDefinitionId,
taskId
} }
); );
}, },
...@@ -40,7 +38,7 @@ const Api = { ...@@ -40,7 +38,7 @@ const Api = {
*/ */
renderFormByTaskId(taskId, linkId, linkKey) { renderFormByTaskId(taskId, linkId, linkKey) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/v1.1.0/workflow/workflowForm/renderFormByTaskId', '/v1.1.0/workflow/workflowForm/renderFormByTaskId',
{ {
taskId: taskId, taskId: taskId,
linkInstanceId: linkId, linkInstanceId: linkId,
...@@ -55,7 +53,7 @@ const Api = { ...@@ -55,7 +53,7 @@ const Api = {
*/ */
renderFinishForm(processId) { renderFinishForm(processId) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/v1.1.0/workflow/workflowForm/renderFinishForm', '/v1.1.0/workflow/workflowForm/renderFinishForm',
{ {
historyProcessInstanceId: processId historyProcessInstanceId: processId
} }
...@@ -67,14 +65,14 @@ const Api = { ...@@ -67,14 +65,14 @@ const Api = {
* @param {string} formid 表单ID * @param {string} formid 表单ID
*/ */
getForm(formid) { getForm(formid) {
return config.doGetPromise(baseUrl + '/v1.1.0/form/getForm', { return config.doGetPromise('/v1.1.0/form/getForm', {
rid: formid rid: formid
}); });
}, },
getAdminDivisionTree() { getAdminDivisionTree() {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/administrativeDivisions/getAdministrativeDivisionTree' '/administrativeDivisions/getAdministrativeDivisionTree'
); );
}, },
...@@ -84,7 +82,7 @@ const Api = { ...@@ -84,7 +82,7 @@ const Api = {
*/ */
getSystemAllModules(id) { getSystemAllModules(id) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/systemModule/privilege/getUserModulesTreeBySystemId', '/systemModule/privilege/getUserModulesTreeBySystemId',
{ systemId: id } { systemId: id }
); );
}, },
...@@ -95,7 +93,7 @@ const Api = { ...@@ -95,7 +93,7 @@ const Api = {
* @param {Number} valid 是否可用, -1:审核中 1:可用(第一次登录,需要修改密码) 2:可用(非第一次登录,不需要修改密码) * @param {Number} valid 是否可用, -1:审核中 1:可用(第一次登录,需要修改密码) 2:可用(非第一次登录,不需要修改密码)
*/ */
getOrganTree(type, valid) { getOrganTree(type, valid) {
return config.doGetPromise(baseUrl + '/organization/manager/getOrganTree', { return config.doGetPromise('/organization/manager/getOrganTree', {
type: type, type: type,
valid: valid valid: valid
}); });
...@@ -104,7 +102,7 @@ const Api = { ...@@ -104,7 +102,7 @@ const Api = {
// 获取代码字典 // 获取代码字典
getChildItemByRootCode(data) { getChildItemByRootCode(data) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/codeDict/getChildItemByRootCode', '/codeDict/getChildItemByRootCode',
data data
); );
}, },
...@@ -115,11 +113,8 @@ const Api = { ...@@ -115,11 +113,8 @@ const Api = {
* @param {FormData} data 表单数据 * @param {FormData} data 表单数据
*/ */
checkAndSubmitTaskByFormData(taskId, data) { checkAndSubmitTaskByFormData(taskId, data) {
return config.doPostPromiseForm( return config.doPostPromiseForm('/v1.1.0/workflow/workflowForm/checkAndSubmitTaskByFormData/' +
baseUrl + taskId, data
'/v1.1.0/workflow/workflowForm/checkAndSubmitTaskByFormData/' +
taskId,
data
); );
}, },
...@@ -128,8 +123,7 @@ const Api = { ...@@ -128,8 +123,7 @@ const Api = {
* @param {string} taskId 流程ID * @param {string} taskId 流程ID
*/ */
getTranformUser(taskId) { getTranformUser(taskId) {
return config.doGetPromise( return config.doGetPromise('/workflow/linkInstance/findLinkInstanceByTaskIdPassto',
baseUrl + '/workflow/linkInstance/findLinkInstanceByTaskIdPassto',
{ {
taskId: taskId taskId: taskId
} }
...@@ -144,7 +138,7 @@ const Api = { ...@@ -144,7 +138,7 @@ const Api = {
*/ */
getRerunPeople(currentTaskId, processDefinitionId, nextLinkKey) { getRerunPeople(currentTaskId, processDefinitionId, nextLinkKey) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/workflow/workflowForm/getRerunPeople', '/workflow/workflowForm/getRerunPeople',
{ {
currentTaskId, currentTaskId,
processDefinitionId, processDefinitionId,
...@@ -158,7 +152,7 @@ const Api = { ...@@ -158,7 +152,7 @@ const Api = {
*/ */
findExecutionIdByTaskId(taskId) { findExecutionIdByTaskId(taskId) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/workflow/execution/findExecutionIdByTaskId', '/workflow/execution/findExecutionIdByTaskId',
{ {
taskId taskId
} }
...@@ -183,7 +177,7 @@ const Api = { ...@@ -183,7 +177,7 @@ const Api = {
anotherAssignee anotherAssignee
) { ) {
return config.doGetPromise( return config.doGetPromise(
baseUrl + '/v1.1.0/workflow/workflowForm/sendback', '/v1.1.0/workflow/workflowForm/sendback',
{ {
executionId, executionId,
linkDefinitionKey, linkDefinitionKey,
......
import config from '../api/config';
const url = config.baseUrl;
export default [ export default [
{ {
name: 'guidance', name: 'guidance',
text: '办理指南', text: '办理指南',
icon: 'el-icon-info', icon: 'el-icon-info',
api: url + '/workflowWebService/getProcessManagementGuide' api: '/workflowWebService/getProcessManagementGuide'
}, },
{ {
name: 'save', name: 'save',
text: '保存', text: '保存',
icon: 'el-icon-tickets', icon: 'el-icon-tickets',
api: url + '/v1.1.0/workflow/workflowForm/saveFormData' api: '/v1.1.0/workflow/workflowForm/saveFormData'
}, },
{ {
name: 'sign', name: 'sign',
text: '接办', text: '接办',
icon: 'el-icon-tickets', icon: 'el-icon-tickets',
api: url + '/workflow/workflowForm/receiveTasks' api: '/workflow/workflowForm/receiveTasks'
// api: url + '/workflowWebService/claimTask' // api: '/workflowWebService/claimTask'
}, },
{ {
name: 'forceSign', name: 'forceSign',
text: '强制接办', text: '强制接办',
icon: 'el-icon-tickets', icon: 'el-icon-tickets',
api: url + '/workflowWebService/forceClaimForm' api: '/workflowWebService/forceClaimForm'
}, },
{ {
name: 'submit', name: 'submit',
text: '提交', text: '提交',
icon: 'el-icon-check', icon: 'el-icon-check',
api: url + '/v1.1.0/workflow/workflowForm/submitTaskOnDialog' api: '/v1.1.0/workflow/workflowForm/submitTaskOnDialog'
}, },
{ {
name: 'isSendBack', name: 'isSendBack',
text: '提交退回', text: '提交退回',
icon: 'el-icon-check', icon: 'el-icon-check',
api: url + '/v1.1.0/workflow/workflowForm/submitSendbackTask/' api: '/v1.1.0/workflow/workflowForm/submitTaskOnDialog'
// api: '/v1.1.0/workflow/workflowForm/submitSendbackTask/'
}, },
/* { /* {
id: 'backSend', id: 'backSend',
...@@ -51,61 +48,61 @@ export default [ ...@@ -51,61 +48,61 @@ export default [
name: 'finish', name: 'finish',
text: '结档', text: '结档',
icon: 'el-icon-edit-outline', icon: 'el-icon-edit-outline',
api: url + '/workflowWebService/finishProcessInstanceByTaskId' api: '/workflowWebService/finishProcessInstanceByTaskId'
}, },
{ {
name: 'refund', name: 'refund',
text: '退件', text: '退件',
icon: 'el-icon-back', icon: 'el-icon-back',
api: url + '/workflow/workflowForm/refundTasks' api: '/workflow/workflowForm/refundTasks'
}, },
{ {
name: 'urge', name: 'urge',
text: '催办', text: '催办',
icon: 'el-icon-share', icon: 'el-icon-share',
api: url + '/workflow/workflowForm/remindTasks' api: '/workflow/workflowForm/remindTasks'
}, },
{ {
name: 'turn', name: 'turn',
text: '转办', text: '转办',
icon: 'el-icon-refresh', icon: 'el-icon-refresh',
api: url + '/workflow/workflowForm/passTasksToSb' api: '/workflow/workflowForm/passTasksToSb'
}, },
{ {
name: 'unsign', name: 'unsign',
text: '撤办', text: '撤办',
icon: 'el-icon-remove-outline', icon: 'el-icon-remove-outline',
api: url + '/workflow/workflowForm/unclaimTasks' api: '/workflow/workflowForm/unclaimTasks'
}, },
{ {
name: 'apply', name: 'apply',
text: '申请挂起', text: '申请挂起',
icon: 'el-icon-document', icon: 'el-icon-document',
api: url + '/workflow/workflowForm/applySuspendTasks' api: '/workflow/workflowForm/applySuspendTasks'
}, },
{ {
name: 'suspend', name: 'suspend',
text: '挂起', text: '挂起',
icon: 'el-icon-goods', icon: 'el-icon-goods',
api: url + '/workflow/workflowForm/suspendProcesses' api: '/workflow/workflowForm/suspendProcesses'
}, },
{ {
name: 'activeSuspend', name: 'activeSuspend',
text: '解除挂起', text: '解除挂起',
icon: 'el-icon-sold-out', icon: 'el-icon-sold-out',
api: url + '/workflow/workflowForm/activateProcesses' api: '/workflow/workflowForm/activateProcesses'
}, },
{ {
name: 'withdraw', name: 'withdraw',
text: '收回', text: '收回',
icon: 'el-icon-arrow-left', icon: 'el-icon-arrow-left',
api: url + '/workflow/workflowForm/withdrawTasks' api: '/workflow/workflowForm/withdrawTasks'
}, },
{ {
name: 'rerun', name: 'rerun',
text: '退回', text: '退回',
icon: 'el-icon-d-arrow-left', icon: 'el-icon-d-arrow-left',
api: url + '/workflowWebService/prepareJumpTo' api: '/workflowWebService/prepareJumpTo'
}, },
{ {
name: 'getdraw', name: 'getdraw',
...@@ -116,6 +113,6 @@ export default [ ...@@ -116,6 +113,6 @@ export default [
name: 'isBRule', name: 'isBRule',
text: '查看限制消息', text: '查看限制消息',
icon: 'el-icon-view', icon: 'el-icon-view',
api: url + '/workflowWebService/getBusinessRuleResults' api: '/workflowWebService/getBusinessRuleResults'
} }
]; ];
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</el-tree> </el-tree>
</div> </div>
</div> </div>
<div class="submit-reason"> <div class="submit-reason">
<span>提交原因:</span> <span>提交原因:</span>
<div> <div>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
</div> </div>
</div> </div>
</div> </div>
<div slot="footer" class="submit-dialog__footer"> <div slot="footer" class="submit-dialog__footer">
<el-checkbox v-model="isUrgent" style="margin-right: 15px;">紧急</el-checkbox> <el-checkbox v-model="isUrgent" style="margin-right: 15px;">紧急</el-checkbox>
<el-button type="primary" :disabled="checkedLink.length === 0" :loading="isSubmiting" @click="saveTask">保存</el-button> <el-button type="primary" :disabled="checkedLink.length === 0" :loading="isSubmiting" @click="saveTask">保存</el-button>
...@@ -169,7 +169,7 @@ export default { ...@@ -169,7 +169,7 @@ export default {
this.currentLink.masterMen.forEach(user => { this.currentLink.masterMen.forEach(user => {
this.$set(user, 'checked', true); this.$set(user, 'checked', true);
// 如果提交所有人,禁止状态,不能改变选中 // 如果提交所有人,禁止状态,不能改变选中
if (val.completingToAll) this.$set(user, 'disabled', true) ; if (val.completingToAll) this.$set(user, 'disabled', true);
this.mainCheckedKeys.push(user.organInfo.rid); this.mainCheckedKeys.push(user.organInfo.rid);
}); });
this.currentLink.normalMen.forEach(user => { this.currentLink.normalMen.forEach(user => {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
ref="submitTask" ref="submitTask"
:nextLinks="submitData.subTask" :nextLinks="submitData.subTask"
:nextLinkUsers="submitData.userInfos" :nextLinkUsers="submitData.userInfos"
@closed="submitTaskDialogVisible = false" @closed="handleSubmitTaskClose"
@save="handleSubmitTaskSave" @save="handleSubmitTaskSave"
></submit-task> ></submit-task>
<!-- 转办 --> <!-- 转办 -->
...@@ -125,7 +125,8 @@ export default { ...@@ -125,7 +125,8 @@ export default {
submitTaskDialogVisible: false, // 提交dialog submitTaskDialogVisible: false, // 提交dialog
submitData: {}, submitData: {},
transformDialogVisible: false, // 转办dialog transformDialogVisible: false, // 转办dialog
returnTaskVisible: false // 退回dialog returnTaskVisible: false, // 退回dialog
createTaskId: '' // 新建工作后保存时的taskId
}; };
}, },
...@@ -159,9 +160,9 @@ export default { ...@@ -159,9 +160,9 @@ export default {
} }
}, },
fetch() { fetch(tId) {
let taskId = getTaskId() || this.childrenData.taskId; let taskId = getTaskId() || this.childrenData.taskId;
const linkId = getLinkId() || this.childrenData.linkId; const linkId = tId ? tId : getLinkId() || this.childrenData.linkId || '';
const linkKey = getLinkKey() || this.childrenData.linkKey; const linkKey = getLinkKey() || this.childrenData.linkKey;
// console.log(taskId, linkId, linkKey) // console.log(taskId, linkId, linkKey)
let apiFn = 'renderFormByTaskId'; let apiFn = 'renderFormByTaskId';
...@@ -177,9 +178,7 @@ export default { ...@@ -177,9 +178,7 @@ export default {
taskId = getFinishForm(); taskId = getFinishForm();
apiFn = 'renderFinishForm'; apiFn = 'renderFinishForm';
} }
this.isLoading = true; this.isLoading = true;
Api[apiFn](taskId, linkId, linkKey) Api[apiFn](taskId, linkId, linkKey)
.then(res => { .then(res => {
this.isLoading = false; this.isLoading = false;
...@@ -420,7 +419,13 @@ export default { ...@@ -420,7 +419,13 @@ export default {
// console.log(res) // console.log(res)
if (res.status === 0) { if (res.status === 0) {
notification('success', '保存成功!'); notification('success', '保存成功!');
this.refresh(); if (!res.data.taskId) {
this.refresh();
return false;
};
// 携带taskId刷新当前iframe页
this.createTaskId = res.data.taskId;
this.fetch(res.data.taskId);
} else { } else {
notification('warning', res.message || '保存失败,请重试!'); notification('warning', res.message || '保存失败,请重试!');
} }
...@@ -480,7 +485,7 @@ export default { ...@@ -480,7 +485,7 @@ export default {
if (this.$refs['submitTask']) { if (this.$refs['submitTask']) {
this.$refs['submitTask'].$data.isSubmiting = false; this.$refs['submitTask'].$data.isSubmiting = false;
} }
if (res.status === 0) { if (res.status === 0) {
this.submitTaskDialogVisible = false; this.submitTaskDialogVisible = false;
// 关闭标签 // 关闭标签
...@@ -501,7 +506,7 @@ export default { ...@@ -501,7 +506,7 @@ export default {
if (this.$refs['submitTask']) { if (this.$refs['submitTask']) {
this.$refs['submitTask'].$data.isSubmiting = false; this.$refs['submitTask'].$data.isSubmiting = false;
} }
notification('error', err.message || '提交错误'); notification('error', err.message || '提交错误');
}); });
}, },
...@@ -736,7 +741,19 @@ export default { ...@@ -736,7 +741,19 @@ export default {
this.isLoading = false; this.isLoading = false;
// console.log('receiveTasks', res) // console.log('receiveTasks', res)
if (res.status === 0) { if (res.status === 0) {
this.handleDataReturnErr(res.data, '收回成功'); // 关闭和刷新标签页
setTimeout(() => {
refreshTab();
closeTab();
outerNotice({
type: 'success',
title: '收回成功!',
message: res.message
});
const component = {id: 'doingWork', name: '在办工作', componentName: 'doingWork'};
openTab(component);
}, 150);
// this.handleDataReturnErr(res.data, '收回成功');
} else { } else {
notification('warning', res.message || '收回失败,请重试'); notification('warning', res.message || '收回失败,请重试');
} }
...@@ -777,6 +794,12 @@ export default { ...@@ -777,6 +794,12 @@ export default {
/* eslint-disable no-eval */ /* eslint-disable no-eval */
eval(item.operation); eval(item.operation);
} }
},
// 关闭提交后的对话框事件
handleSubmitTaskClose() {
this.submitTaskDialogVisible = false;
this.fetch(this.createTaskId);
} }
} }
}; };
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* smart-page * smart-page
*/ */
import { getQueryString } from '@form/utils/form'; import { getQueryString } from '@form/utils/form';
import config from '@form/api/config'; import config from '@config/config';
export default { export default {
name: 'PageView', name: 'PageView',
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
this.loadError = true; this.loadError = true;
}); });
}, },
// 获取模块权限,赋值到pageInfo // 获取模块权限,赋值到pageInfo
getAuthories() { getAuthories() {
const systemInfo = window.$ ? window.$.system.getSystemInfo() : null; const systemInfo = window.$ ? window.$.system.getSystemInfo() : null;
......
{ {
"name": "{{name}}", "name": "",
"description": "{{description}}", "description": "{{description}}",
"version": "1.0.0", "version": "1.0.0",
"author": "zengyl@southzn.com", "author": "zengyl@southzn.com",
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
}, },
"dependencies": { "dependencies": {
"core-js": "^2.6.5", "core-js": "^2.6.5",
"smart-charts": "^1.0.0-alpha",
"smart-web": "^2.2.3", "smart-web": "^2.2.3",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-progressbar": "^0.7.5", "vue-progressbar": "^0.7.5",
......
...@@ -104,7 +104,7 @@ const config = { ...@@ -104,7 +104,7 @@ const config = {
}); });
}); });
}, },
/** /**
* FormData数据上传,文件上传必用 * FormData数据上传,文件上传必用
* @param {String} url * @param {String} url
...@@ -182,7 +182,7 @@ const config = { ...@@ -182,7 +182,7 @@ const config = {
} }
}; };
// 切换页面强行中断请求 router.beforeEach中用到 // 切换页面强行中断请求 router.beforeEach中用到
Vue.prototype.$cancelAjax = function(msg) { Vue.prototype.$cancelAjax = function(msg) {
if (cancel) { if (cancel) {
cancel(msg || '手动中断请求'); cancel(msg || '手动中断请求');
......
...@@ -16,12 +16,12 @@ const handleFilter = (key) => { ...@@ -16,12 +16,12 @@ const handleFilter = (key) => {
/** /**
* 登录判断失效 * 登录判断失效
* 在所有经过axios请求中,拦截到登录失效 * 在所有经过axios请求中,拦截到登录失效
* *
* @param {Object} response * @param {Object} response
*/ */
let isOtherLogin = false; let isOtherLogin = false;
function loginInterceptor(response) { function loginInterceptor(response) {
// 9: 此账号在其他地方登陆 // 9: 此账号在其他地方登陆
// 8: 账号登录已经失效 // 8: 账号登录已经失效
if (response.data && response.data.status === 8) { if (response.data && response.data.status === 8) {
if (!isOtherLogin) { if (!isOtherLogin) {
...@@ -53,7 +53,7 @@ function loginInterceptor(response) { ...@@ -53,7 +53,7 @@ function loginInterceptor(response) {
}); });
} }
return response; return response;
} else { } else {
return response; return response;
} }
} }
......
...@@ -201,7 +201,7 @@ export default { ...@@ -201,7 +201,7 @@ export default {
const navSize = this.$refs.nav[`offset${ firstUpperCase(this.sizeName) }`]; const navSize = this.$refs.nav[`offset${ firstUpperCase(this.sizeName) }`];
const containerSize = this.$refs.navScroll[`offset${ firstUpperCase(this.sizeName) }`]; const containerSize = this.$refs.navScroll[`offset${ firstUpperCase(this.sizeName) }`];
const currentOffset = this.navOffset; const currentOffset = this.navOffset;
let newOffset = 0; let newOffset = 0;
if (delta < 0) { if (delta < 0) {
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
? currentOffset - containerSize ? currentOffset - containerSize
: 0; : 0;
} }
this.navOffset = newOffset; this.navOffset = newOffset;
}, },
...@@ -251,7 +251,7 @@ export default { ...@@ -251,7 +251,7 @@ export default {
const node = document.createElement('ul'); const node = document.createElement('ul');
node.className = 's-tabs__contextmenu'; node.className = 's-tabs__contextmenu';
node.id = 'sTabsContextmenu'; node.id = 'sTabsContextmenu';
const list = ['关闭该标签页', '关闭其他标签页', '关闭全部']; const list = ['关闭该标签页', '关闭其他标签页', '关闭全部'];
list.forEach(item => { list.forEach(item => {
const liNode = document.createElement('li'); const liNode = document.createElement('li');
......
import { cb } from '../extend'; import { cb } from '../extend';
export default { export default {
businessConfiguration: () => import('@/views/businessConfig/businessConfiguration').then(cb) businessConfiguration: () => import('@/views/businessConfig/businessConfiguration').then(cb)
}; };
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
const packageConfig = require('../../../package.json'); const packageConfig = require('./../../package.json');
Vue.use(Vuex); Vue.use(Vuex);
......
...@@ -2,8 +2,10 @@ import Vue from 'vue'; ...@@ -2,8 +2,10 @@ import Vue from 'vue';
import store from '@/store'; import store from '@/store';
import Utils from '@/utils'; import Utils from '@/utils';
import { getTheme, changeTheme } from '@/utils/global'; import { getTheme, changeTheme } from '@/utils/global';
import MyWebSocket from '@/utils/webSocket';
const vm = new Vue(); const vm = new Vue();
let webSocket = null;
/** /**
* 应用初始化的一个配置操作 * 应用初始化的一个配置操作
* 比如检查登录、获取皮肤配置,其他配置等 * 比如检查登录、获取皮肤配置,其他配置等
...@@ -22,8 +24,13 @@ if (localStorage.getItem('themeValue')) { ...@@ -22,8 +24,13 @@ if (localStorage.getItem('themeValue')) {
vm.$watch(function() { vm.$watch(function() {
return store.state.userInfo; return store.state.userInfo;
}, function(val) { }, function(val) {
if (!webSocket) webSocket = new MyWebSocket(store.state.userInfo);
if (!Utils.isEmptyData(val)) { if (!Utils.isEmptyData(val)) {
// 获取皮肤 // 获取皮肤
getTheme(); getTheme();
webSocket.init();
} else {
webSocket.closeWebSocketConnection();
webSocket = null;
} }
}); });
...@@ -71,9 +71,9 @@ export default { ...@@ -71,9 +71,9 @@ export default {
* @param {Boolean|String} only 布尔值为true时,是固定使用externalLinkTab---1打开页面,当是string字符串时,自定义打开固定标签页 * @param {Boolean|String} only 布尔值为true时,是固定使用externalLinkTab---1打开页面,当是string字符串时,自定义打开固定标签页
*/ */
openExternalLinkTab(name, url, only) { openExternalLinkTab(name, url, only) {
const id = (typeof only === 'boolean' && only) const id = (typeof only === 'boolean' && only)
? 'externalLinkTab---1' ? 'externalLinkTab---1'
: (typeof only === 'string' && only) : (typeof only === 'string' && only)
? only : ''; ? only : '';
this.openTab({ this.openTab({
id, id,
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
}, },
/** /**
* 刷新标签页 * 刷新标签页
* @param {String} id tab标签的唯一标识 * @param {String} id tab标签的唯一标识
*/ */
refreshTab(id) { refreshTab(id) {
store.state.navigationList.forEach(item => { store.state.navigationList.forEach(item => {
......
...@@ -14,21 +14,21 @@ export default { ...@@ -14,21 +14,21 @@ export default {
return store.state.userInfo || null; return store.state.userInfo || null;
}, },
/** /**
* 获取用户身份 * 获取用户身份
* @returns {String} * @returns {String}
*/ */
getUserName() { getUserName() {
return store.state.userInfo ? store.state.userInfo.RealName : ''; return store.state.userInfo ? store.state.userInfo.RealName : '';
}, },
/** /**
* 获取系统信息 * 获取系统信息
* @returns {Object} * @returns {Object}
*/ */
getSystemInfo() { getSystemInfo() {
return store.state.platformInfo || null; return store.state.platformInfo || null;
}, },
/** /**
* 获取用户身份 * 获取用户身份
* @returns {String} admin | none * @returns {String} admin | none
*/ */
getUserIdentity() { getUserIdentity() {
...@@ -45,13 +45,13 @@ export default { ...@@ -45,13 +45,13 @@ export default {
position = 'bottom-right', position = 'bottom-right',
...opts ...opts
} = options; } = options;
const _opts = { const _opts = {
customClass, customClass,
position, position,
...opts ...opts
}; };
Notification(_opts); Notification(_opts);
} }
}; };
...@@ -43,11 +43,11 @@ export function getSystemInfo(sysCode) { ...@@ -43,11 +43,11 @@ export function getSystemInfo(sysCode) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
Api.getSystemInfo(sysCode).then(res => { Api.getSystemInfo(sysCode).then(res => {
removeLoading(); removeLoading();
if (res.status === 0) { if (res.status === 0) {
store.state.platformInfo.systemId = res.data.systemId; store.state.platformInfo.systemId = res.data.systemId;
store.state.platformInfo.name = res.data.sysMainTitle; store.state.platformInfo.name = res.data.sysMainTitle;
resolve(); resolve();
} else { } else {
reject(res); reject(res);
...@@ -88,7 +88,7 @@ export const removeTab = $.menu.removeTab; ...@@ -88,7 +88,7 @@ export const removeTab = $.menu.removeTab;
/** /**
* 刷新tab页 * 刷新tab页
* @param {String} id tab标签的唯一标识 * @param {String} id tab标签的唯一标识
*/ */
export const refreshTab = $.menu.refreshTab; export const refreshTab = $.menu.refreshTab;
......
...@@ -19,14 +19,14 @@ const utils = { ...@@ -19,14 +19,14 @@ const utils = {
/** /**
* 深拷贝 * 深拷贝
* @param {Object|Array} p * @param {Object|Array} p
* @param {Object|Array} c [] or {} * @param {Object|Array} c [] or {}
*/ */
deepCopy(p, c) { deepCopy(p, c) {
c = c || {}; c = c || {};
for (const i in p) { for (const i in p) {
if (typeof p[i] === 'object') { if (typeof p[i] === 'object') {
c[i] = p[i] c[i] = p[i]
? (p[i] && p[i].constructor === Array) ? [] : {} ? (p[i] && p[i].constructor === Array) ? [] : {}
: p[i]; : p[i];
this.deepCopy(p[i], c[i]); this.deepCopy(p[i], c[i]);
...@@ -39,7 +39,7 @@ const utils = { ...@@ -39,7 +39,7 @@ const utils = {
/** /**
* 随机生成唯一 ID * 随机生成唯一 ID
* @param {Number} * @param {Number}
*/ */
generateId(len = 4) { generateId(len = 4) {
return Number(Math.random().toString().substr(3, len) + Date.now()).toString(36); return Number(Math.random().toString().substr(3, len) + Date.now()).toString(36);
...@@ -47,7 +47,7 @@ const utils = { ...@@ -47,7 +47,7 @@ const utils = {
/** /**
* 优化遍历,数组去重 * 优化遍历,数组去重
* @param {Array} array * @param {Array} array
*/ */
uniq(array, key) { uniq(array, key) {
const temp = []; const temp = [];
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
* 一些模块的控件过滤 * 一些模块的控件过滤
* 例如:没有存在的菜单的项的路由组件,不作权限控件 * 例如:没有存在的菜单的项的路由组件,不作权限控件
*/ */
if (this.$SMTab && if (this.$SMTab &&
[].indexOf(this.$SMTab.componentName) >= 0 [].indexOf(this.$SMTab.componentName) >= 0
) { ) {
return; return;
......
/**
* 单独消息模块
*/
import { Notification } from 'element-ui';
import { baseUrl } from '@config/http.config';
import { openTab } from '@/utils/global';
import store from '@/store';
import Vue from 'vue';
const vm = new Vue();
function webSocket(userInfo) {
this.instantce = null;
this.userInfo = userInfo;
this.$store = store;
this.messageType = [{
id: 'doingWork',
name: '在办工作',
status: [100, 101, 102, 103, 104, 105, 106, 109, 113, 112]
},
{
id: 'returnBox',
name: '退件箱',
status: [108]
},
{
id: 'suspendWork',
name: '已挂工作',
status: [110, 111]
},
{
id: 'finishedWork',
name: '办结工作',
status: [107]
}]; // 消息类型
}
webSocket.prototype = {
/**
* 初始化webSocket
*/
init() {
if (window.WebSocket && this.userInfo && this.userInfo.userId) {
const that = this;
this.instantce = new WebSocket(`ws:${baseUrl}/MessageWebsocket?userId=${this.userInfo.userId}`);
this.instantce.onopen = function(event) {
};
this.instantce.onclose = function(event) {
};
this.instantce.onmessage = function(event) {
if (event.data) that.handleReceiveMessage(event.data);
};
this.instantce.onerror = function(event) {
};
}
},
/**
* 接受消息后的处理
*/
handleReceiveMessage(data) {
data = JSON.parse(data);
this.$store.dispatch('setUnreadMessage', data.count);
if (parseInt(data.count, 10) === 0) return false;
const type = data.content ? this.handleMessageType(data.content.businessType) : 9999;
const h = vm.$createElement;
Notification({
title: data.content ? data.content.title : this.convertTypeToObjectInfo(type).name,
position: 'bottom-right',
type: 'info',
dangerouslyUseHTMLString: true,
duration: 5000,
message: h('div', {
style: {
display: 'flex',
alignItems: 'center'
}
}, [
h('span', null
, data.content ? data.content.content : '您有新的处理任务,请及时处理!'),
h('el-button', {
style: {
marginLeft: '5px'
},
attrs: {
size: 'small',
type: 'text'
},
on: {
click: () => { this.handleLinkToTargetTab(type);}
}
}, '查看')
])
});
},
/**
* 跳转链接
*/
handleLinkToTargetTab(type) {
const that = this;
openTab({
id: that.convertTypeToObjectInfo(type).id,
name: that.convertTypeToObjectInfo(type).name,
componentName: that.convertTypeToObjectInfo(type).id
});
},
/**
* 转换成路由消息数据
*/
convertTypeToObjectInfo(type) {
return this.messageType[type] || { id: 'appMessage', name: '我的消息'};
},
/**
* 处理消息类型
*/
handleMessageType(type) {
type = parseInt(type, 10) || 9999;
let flag = false;
// 找到对应的路由消息下标
for (let i = 0; i < this.messageType.length; i++) {
if (this.messageType[i].status.indexOf(type) >= 0) {
type = i;
flag = true;
}
if (flag) break;
}
return type;
},
/**
* 关闭webSocket
*/
closeWebSocketConnection() {
window.WebSocket && this.instantce && this.instantce.close();
this.instantce = null;
}
};
export default webSocket;
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
} }
if (!flag) return; if (!flag) return;
let index = 0; let index = 0;
this.tabsData.forEach((tab, idx) => { this.tabsData.forEach((tab, idx) => {
if (!Utils.isEmptyData(oldVal) && oldVal.id === tab.id) { if (!Utils.isEmptyData(oldVal) && oldVal.id === tab.id) {
...@@ -119,20 +119,14 @@ export default { ...@@ -119,20 +119,14 @@ export default {
} else { } else {
this.tabsData.splice(index + 1, 0, newVal); this.tabsData.splice(index + 1, 0, newVal);
} }
this.currentTab = newVal.id; this.currentTab = newVal.id;
// 新打开tab // 新打开tab
this.$Progress.start(); this.$Progress.start();
} }
}, },
navigationList(newVal) {
if (newVal.length > 0) {
}
},
currentTab() { currentTab() {
const len = this.tabsData.length; const len = this.tabsData.length;
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
...@@ -181,7 +175,7 @@ export default { ...@@ -181,7 +175,7 @@ export default {
} }
} }
} }
this.currentTab = activeName; this.currentTab = activeName;
this.tabsData = tabs.filter(tab => tab.id !== targetName); this.tabsData = tabs.filter(tab => tab.id !== targetName);
this.$store.dispatch('removeNavigation', targetName); this.$store.dispatch('removeNavigation', targetName);
...@@ -198,7 +192,7 @@ export default { ...@@ -198,7 +192,7 @@ export default {
this.visiableDialog = true; this.visiableDialog = true;
} }
}, },
// 修改密码框显示事件 // 修改密码框显示事件
handlePasswordDialogEvent(visiable) { handlePasswordDialogEvent(visiable) {
this.visiableDialog = !!visiable; this.visiableDialog = !!visiable;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
export default { export default {
name: 'ConfigurePage', name: 'ConfigurePage',
data() { data() {
return { return {
url: '' url: ''
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
<span>表单设计器</span> <span>表单设计器</span>
</a> </a>
</div> </div>
<el-badge :value="unreadMessage" <el-badge :value="unreadMessage"
:hidden="unreadMessage === 0 || unreadMessage === '0'" :hidden="unreadMessage === 0 || unreadMessage === '0'"
style="margin-right: 10px;cursor: pointer;" style="margin-right: 10px;cursor: pointer;"
:max="99" :max="99"
@click.native="handleMessage"> @click.native="handleMessage">
<i class="iconfont icon-tongzhi"></i> <i class="iconfont icon-tongzhi"></i>
</el-badge> </el-badge>
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
<span v-if="userInfo.RealName" @click="handleUserClick">{{ userInfo.RealName }}</span> <span v-if="userInfo.RealName" @click="handleUserClick">{{ userInfo.RealName }}</span>
<span v-else @click="handleRelogin">登录</span> <span v-else @click="handleRelogin">登录</span>
</a> </a>
<!-- <a href="javascript:;" class="quit-user gutter" @click="logout">
<i class="iconfont icon-tuichu"></i>
<span>退出</span>
</a> -->
<el-button v-if="userInfo.RealName" class="quit-user gutter" type="text" <el-button v-if="userInfo.RealName" class="quit-user gutter" type="text"
size="small" icon="iconfont icon-tuichu" :loading="isLoadingout" @click="logout"> size="small" icon="iconfont icon-tuichu" :loading="isLoadingout" @click="logout">
退出 退出
...@@ -45,7 +41,7 @@ ...@@ -45,7 +41,7 @@
<script> <script>
import Api from '@/api'; import Api from '@/api';
import { baseUrl, serviceUrl } from '@config/http.config'; import { serviceUrl } from '@config/http.config';
import Logo from './Logo.vue'; import Logo from './Logo.vue';
import { openTab } from '@/utils/global'; import { openTab } from '@/utils/global';
...@@ -77,46 +73,11 @@ export default { ...@@ -77,46 +73,11 @@ export default {
data() { data() {
return { return {
serviceUrl, serviceUrl,
isLoadingout: false, isLoadingout: false
websocket: null
}; };
}, },
watch: {
userInfo(val) {
if (val) {
this.init();
} else {
window.WebSocket && this.websocket && this.websocket.close();
}
}
},
mounted() {
this.init();
},
beforeDestroy() {
window.WebSocket && this.websocket && this.websocket.close();
},
methods: { methods: {
init() {
if (this.userInfo && this.userInfo.userId && window.WebSocket) {
this.websocket = new WebSocket(`ws:${baseUrl}/MessageWebsocket?userId=${this.userInfo.userId}`);
this.websocket.onopen = function(event) {
};
this.websocket.onclose = function(event) {
};
this.websocket.onmessage = (event) => {
// state.unreadMessage = event.data
// this.unreadMessage = event.data;
this.$store.dispatch('setUnreadMessage', event.data);
};
this.websocket.onerror = function(event) {
};
}
},
/** /**
* 查看消息 * 查看消息
*/ */
......
...@@ -20,11 +20,11 @@ export default { ...@@ -20,11 +20,11 @@ export default {
if (this.theme.format === 'top-bottom') return { fontSize: '22px' }; if (this.theme.format === 'top-bottom') return { fontSize: '22px' };
let fontSize = '20px'; let fontSize = '20px';
const getStrLen = (str) => { const getStrLen = (str) => {
if (str == null) return 0; if (str == null) return 0;
if (typeof str !== 'string') { if (typeof str !== 'string') {
str += ''; str += '';
} }
/* eslint-disable */ /* eslint-disable */
return str.replace(/[^\x00-\xff]/g, '01').length return str.replace(/[^\x00-\xff]/g, '01').length
......
...@@ -33,14 +33,14 @@ import Api from '@/api'; ...@@ -33,14 +33,14 @@ import Api from '@/api';
import { getUser } from '@/utils/global'; import { getUser } from '@/utils/global';
export default { export default {
name: 'PasswordDialog', name: 'PasswordDialog',
props: { props: {
visiableDialog: { visiableDialog: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
computed: { computed: {
dialogVisiable() { dialogVisiable() {
return this.visiableDialog; return this.visiableDialog;
...@@ -137,7 +137,6 @@ export default { ...@@ -137,7 +137,6 @@ export default {
}); });
this.passSubmiting = false; this.passSubmiting = false;
}, 3000); }, 3000);
} else { } else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
......
<template> <template>
<sw-message <sw-message
:user-info="userInfo" :user-info="userInfo"
@unread-message-change="handleUnreadMessageChange"> @unread-message-change="handleUnreadMessageChange">
</sw-message> </sw-message>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<login-form @submit="handleSubmited"></login-form> <login-form @submit="handleSubmited"></login-form>
</div> </div>
</template> </template>
<script> <script>
import LoginForm from './LoginForm.vue'; import LoginForm from './LoginForm.vue';
......
...@@ -5,32 +5,32 @@ ...@@ -5,32 +5,32 @@
<span style="line-height: 36px;font-size:20px;">登录</span> <span style="line-height: 36px;font-size:20px;">登录</span>
<span v-if="showClose" class="login-form__close" @click.stop="handleClose"><i class="el-icon-close"></i></span> <span v-if="showClose" class="login-form__close" @click.stop="handleClose"><i class="el-icon-close"></i></span>
</div> </div>
<el-form <el-form
ref="loginForm" ref="loginForm"
:model="loginForm" :model="loginForm"
:rules="rules" :rules="rules"
label-width="100px" label-width="100px"
@submit.native.prevent> @submit.native.prevent>
<el-form-item label="账户:" prop="name"> <el-form-item label="账户:" prop="name">
<el-input v-model="loginForm.name" placeholder="输入登录用户名" autofocus @change="handleInputChange"></el-input> <el-input v-model="loginForm.name" placeholder="输入登录用户名" autofocus @change="handleInputChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码:" prop="password"> <el-form-item label="密码:" prop="password">
<el-input type="password" <el-input type="password"
v-model="loginForm.password" v-model="loginForm.password"
placeholder="请输入密码" placeholder="请输入密码"
@keyup.native.enter="onSubmit('loginForm')" @keyup.native.enter="onSubmit('loginForm')"
@change="handleInputChange"></el-input> @change="handleInputChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-checkbox label="记住账户" v-model="loginForm.remember"></el-checkbox> <el-checkbox label="记住账户" v-model="loginForm.remember"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item class="buttons"> <el-form-item class="buttons">
<el-button <el-button
type="primary" type="primary"
size="large" size="large"
class="submitBtn" class="submitBtn"
:loading="loginForm.loading" :loading="loginForm.loading"
@click="onSubmit()" > @click="onSubmit()" >
{{ loginForm.submitText }} {{ loginForm.submitText }}
</el-button> </el-button>
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
message: message, message: message,
type: 'success' type: 'success'
}); });
this.$emit('submit', userState); this.$emit('submit', userState);
this.$router.replace({ this.$router.replace({
path: '/', path: '/',
......
<template> <template>
<sw-catalog-management></sw-catalog-management> <sw-catalog-management></sw-catalog-management>
</template> </template>
<script> <script>
......
<template> <template>
<sw-check-process <sw-check-process
:user-authority="userAuthories" :user-authority="userAuthories"
:process-instance-id="processInstanceId"> :process-instance-id="processInstanceId">
</sw-check-process> </sw-check-process>
......
<template> <template>
<sw-create-work <sw-create-work
ref="createWork" ref="createWork"
:user-authority="userAuthories" :user-authority="userAuthories"
@open-work="handleOpenWork" @open-work="handleOpenWork"
......
<template> <template>
<sw-interface <sw-interface
:theme="theme" :theme="theme"
@theme-change="handleThemeChange"></sw-interface> @theme-change="handleThemeChange"></sw-interface>
</template> </template>
......
...@@ -21,6 +21,12 @@ const pages = { ...@@ -21,6 +21,12 @@ const pages = {
template: 'form/form.html', template: 'form/form.html',
filename: 'form.html', filename: 'form.html',
chunks: ['chunk-vendors', 'chunk-commons', 'element-ui', 'smart-form', 'form'] chunks: ['chunk-vendors', 'chunk-commons', 'element-ui', 'smart-form', 'form']
},
charts: {
entry: 'charts/main.js',
template: 'charts/charts.html',
filename: 'charts.html',
chunks: ['chunk-vendors', 'element-ui', 'smart-charts', 'charts']
} }
}; };
...@@ -55,7 +61,13 @@ module.exports = { ...@@ -55,7 +61,13 @@ module.exports = {
name: 'smart-form', // 单独将拆包 name: 'smart-form', // 单独将拆包
priority: 21, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app priority: 21, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
test: /[\\/]node_modules[\\/]smart-form[\\/]/ test: /[\\/]node_modules[\\/]smart-form[\\/]/
}/* , },
smartCharts: {
name: 'smart-charts', // 单独将拆包
priority: 21, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
test: /[\\/]node_modules[\\/]smart-charts[\\/]/
}
/*
commons: { commons: {
name: 'chunk-comomns', name: 'chunk-comomns',
test: resolve('src/components'), // 可自定义拓展你的规则 test: resolve('src/components'), // 可自定义拓展你的规则
...@@ -74,6 +86,7 @@ module.exports = { ...@@ -74,6 +86,7 @@ module.exports = {
config.resolve.alias config.resolve.alias
.set('@', resolve('src')) .set('@', resolve('src'))
.set('@form', resolve('form')) .set('@form', resolve('form'))
.set('@charts', resolve('charts'))
.set('@config', resolve('config')); .set('@config', resolve('config'));
const arr = ['app', 'form']; const arr = ['app', 'form'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment