Commit 28093b68 authored by 陈珠河's avatar 陈珠河

Fix: 新表单流程操作问题

parent f0b1100e
......@@ -30,7 +30,7 @@ export default {
mounted() {
document.addEventListener('scroll', () => {
console.log(document.body.scrollTop);
// console.log(document.body.scrollTop);
});
}
};
......
......@@ -107,7 +107,6 @@ const config = {
resolve(res.data);
})
.catch(res => {
console.log('post error:', res);
reject(res);
});
});
......@@ -133,7 +132,6 @@ const config = {
resolve(res.data);
})
.catch(res => {
console.log('post error:', res);
reject(res);
});
});
......@@ -159,7 +157,6 @@ const config = {
resolve(res.data);
})
.catch(res => {
console.log('post error:', res);
reject(res);
});
});
......
......@@ -65,14 +65,19 @@ body {
}
.form-render {
padding-top: 28px;
padding-top: 44px;
width: 1000px;
margin: 0 auto;
}
.is-required {
.el-textarea__inner {
border-color: $--color-danger;
.submit-dialog,
.return-work,
.transform-work {
.is-required {
.el-textarea__inner {
border-color: $--color-danger;
}
}
}
......@@ -97,7 +102,7 @@ body {
@include e(wrapper) {
width: 100%;
height: 100%;
max-height: 20vh;
background-color: inherit;
overflow: auto;
......
......@@ -54,4 +54,8 @@ ul, ol, li {
*::-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
......@@ -116,7 +116,7 @@ export function refreshTab(tabId) {
// 设置高级或某此控件需要【数组】、【对象】类型
// 比如upload_list, sign
const checkObjectJson = data => {
const widgets = ['upload_list', 'sign', 'select'];
const widgets = ['upload_list', 'sign', 'select', 'approval'];
if (widgets.includes(data.type)) {
return data.model;
} else {
......@@ -132,10 +132,10 @@ export const transformFormData = formdata => {
if (!formdata.list) return;
const arr = [];
const fn = data => {
data.map(item => {
data.forEach(item => {
// console.log(item)
if (item.type === 'grid') {
item.columns.map(col => {
item.columns.forEach(col => {
fn(col.list);
});
} else if (item.type !== 'text' && item.type !== 'button') {
......
......@@ -173,7 +173,7 @@ export default {
// 有历史的,可以执行退回
this.dialogVisible = true;
this.linkEntity = [];
res.map(item => {
res.forEach(item => {
this.linkEntity.push(item.linkDefinitionEntity);
});
} else {
......
......@@ -21,7 +21,7 @@
>{{ item.operationName }}</el-button>
</div>
<div class="form-render" v-if="isReRender">
<div class="form-render" v-if="!isLoading">
<smart-form :data="formData" :value="values" ref="generateForm"></smart-form>
</div>
......@@ -112,7 +112,6 @@ export default {
return {
apiFnName: '', // 加载API的方法名
isLoading: false, // 加载过渡
isReRender: true, // 重渲染
headBtnLists: [], // 头部的按钮列表
headCustomBtns: [], // 头部自定义按钮,一般包含表达式
formData: {},
......@@ -238,6 +237,7 @@ export default {
'template'
);
this.formData = JSON.parse(_data) || {};
this.$set(this.formData.config, 'disabled', ourselfOperationShow['sign'] || false);
this.handleModels(
this.handleResultHtml(detailMap['result'], 'values')
);
......@@ -392,7 +392,7 @@ export default {
handleFormData() {
const formData = this.$refs['generateForm'].getData();
const fomrDataSub = new FormData();
Object.keys(formData).map(key => {
Object.keys(formData).forEach(key => {
let value = formData[key];
// 转JSON字符串提交
if (typeof formData[key] === 'object' && formData[key] !== null) {
......@@ -420,6 +420,7 @@ export default {
// console.log(res)
if (res.status === 0) {
notification('success', '保存成功!');
this.refresh();
} else {
notification('warning', res.message || '保存失败,请重试!');
}
......@@ -519,24 +520,18 @@ export default {
];
this.isLoading = true;
this.isReRender = false;
Api.doPostPromiseJson(apiUrl, submitData)
.then(res => {
this.isLoading = false;
this.isReRender = true;
// console.log('signTasks', res)
if (res.status === 0) {
this.handleDataReturnErr(res.data, '接办成功');
// 刷新
this.refresh();
} else {
notification('warning', res.message || '接办失败,请重试');
}
})
.catch(err => {
this.isLoading = false;
this.isReRender = true;
notification('error', err.message || '接办失败!');
});
},
......@@ -596,7 +591,16 @@ export default {
this.isLoading = false;
// console.log('receiveTasks', res)
if (res.status === 0) {
this.handleDataReturnErr(res.data, '退件成功');
// 关闭和刷新标签页
setTimeout(() => {
refreshTab();
closeTab();
outerNotice({
type: 'success',
title: '退件成功!',
message: res.message
});
}, 150);
} else {
notification('warning', res.message || '退件失败,请重试');
}
......
......@@ -37,7 +37,6 @@ export default {
mounted() {
if (!this.id) return;
this.getTemplate();
this.getAuthories();
},
......@@ -74,6 +73,7 @@ export default {
moduleId
}).then(res => {
if (res.status === 0) {
this.getTemplate();
if (!this.pageInfo) this.pageInfo = {};
this.pageInfo.authorities = res.data.sysAuthorizeList;
} else {
......
......@@ -100,12 +100,11 @@ const config = {
}).then(response => {
resolve(response.data);
}).catch(response => {
// console.error('ajax error:', response)
reject(response);
});
});
},
/**
* FormData数据上传,文件上传必用
* @param {String} url
......@@ -129,7 +128,6 @@ const config = {
}).then(res => {
resolve(res.data);
}).catch(res => {
console.log('post error:', res);
reject(res);
});
});
......@@ -154,7 +152,6 @@ const config = {
}).then(res => {
resolve(res.data);
}).catch(res => {
// console.log('post error:', res)
reject(res);
});
});
......@@ -179,14 +176,13 @@ const config = {
}).then(res => {
resolve(res.data);
}).catch(res => {
console.log('post error:', res);
reject(res);
});
});
}
};
// 切换页面强行中断请求 router.beforeEach中用到
// 切换页面强行中断请求 router.beforeEach中用到
Vue.prototype.$cancelAjax = function(msg) {
if (cancel) {
cancel(msg || '手动中断请求');
......
......@@ -93,6 +93,10 @@ const Api = {
return config.doGetPromise('/authorityManage/queryUserSysAuthorizeInfoList', {
moduleId
});
},
// 修改密码
updatePassword(userId, newPassword) {
return config.doGetPromise('/index/updatePassword', {id: userId, newPassword: newPassword});
}
};
......
......@@ -7,7 +7,7 @@ import MessageBox from 'element-ui/lib/message-box';
const handleFilter = (key) => {
if (Array.isArray(filters)) {
filters.map(item => {
filters.forEach(item => {
if (item === key) {}
})
}
......@@ -16,12 +16,12 @@ const handleFilter = (key) => {
/**
* 登录判断失效
* 在所有经过axios请求中,拦截到登录失效
*
*
* @param {Object} response
*/
let isOtherLogin = false;
function loginInterceptor(response) {
// 9: 此账号在其他地方登陆
// 9: 此账号在其他地方登陆
// 8: 账号登录已经失效
if (response.data && response.data.status === 8) {
if (!isOtherLogin) {
......@@ -53,7 +53,7 @@ function loginInterceptor(response) {
});
}
return response;
} else {
} else {
return response;
}
}
......
<script>
import TabBar from './tab-bar';
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
import { addResizeListener, removeResizeListener } from 'smart-web/src/utils/element-ui/resize-event';
function noop() {}
const firstUpperCase = str => {
......@@ -197,13 +197,11 @@ export default {
onMousewheel(e) {
e.stopPropagation();
// console.log('mousewheel', e)
const delta = event.wheelDelta || event.detail;
const navSize = this.$refs.nav[`offset${ firstUpperCase(this.sizeName) }`];
const containerSize = this.$refs.navScroll[`offset${ firstUpperCase(this.sizeName) }`];
const currentOffset = this.navOffset;
// console.log(delta, delta < 0, currentOffset, containerSize, navSize)
let newOffset = 0;
if (delta < 0) {
......@@ -217,12 +215,11 @@ export default {
? currentOffset - containerSize
: 0;
}
this.navOffset = newOffset;
},
onContextmenuClick(pane, type, e) {
// console.log('onclick', pane, e)
switch (type) {
case '关闭该标签页':
this.onTabRemove(pane, e);
......@@ -254,9 +251,9 @@ export default {
const node = document.createElement('ul');
node.className = 's-tabs__contextmenu';
node.id = 'sTabsContextmenu';
const list = ['关闭该标签页', '关闭其他标签页', '关闭全部'];
list.map(item => {
list.forEach(item => {
const liNode = document.createElement('li');
liNode.className = 's-tabs__contextmenu--item';
liNode.addEventListener('click', (e) => {
......
......@@ -87,7 +87,7 @@ export default {
handleTabOtherRemove(pane, ev) {
ev.stopPropagation();
this.panes.map(item => {
this.panes.forEach(item => {
if (item.name !== pane.name && item.isClosable) {
this.handleTabRemove(item, ev);
}
......@@ -97,7 +97,7 @@ export default {
},
handleTabALLRemove(ev) {
this.panes.map(item => {
this.panes.forEach(item => {
if (item.isClosable) {
this.handleTabRemove(item, ev);
} else {
......
......@@ -5,7 +5,7 @@ import App from './App';
import router from './router';
import store from './store';
import ElemetUI from 'element-ui';
import SmartWeb from 'smart-web/lib/main';
import SmartWeb from 'smart-web/src/main.js';
import VueProgressBar from 'vue-progressbar';
import './styles/app.scss';
// import 'smart-web/packages/styles/lib/index.css';
......
......@@ -27,7 +27,7 @@ files.keys().forEach(key => {
});
const install = (Vue, opts = {}) => {
Object.keys(asyncComponents).map(key => {
Object.keys(asyncComponents).forEach(key => {
if (typeof asyncComponents[key] === 'object') {
asyncComponents[key].extends = extend;
}
......
......@@ -10,9 +10,9 @@ export const registComponents = {
Tabpane
};
Object.keys(registComponents).map(key => {
Object.keys(registComponents).forEach(key => {
if (registComponents[key].type === 'prototype') {
Object.keys(registComponents[key]).map(item => {
Object.keys(registComponents[key]).forEach(item => {
Vue.prototype[item] = registComponents[key][item];
});
} else {
......
import { cb } from '../extend';
export default {
export default {
businessConfiguration: () => import('@/views/businessConfig/businessConfiguration').then(cb)
};
......@@ -58,7 +58,7 @@ const store = new Vuex.Store({
setNavigation(state, payload) {
state.currentNavigation = payload;
let flag = true;
state.navigationList.map(item => {
state.navigationList.forEach(item => {
if (item.name === payload.name) {
flag = false;
}
......
......@@ -41,7 +41,6 @@ export default {
const fn = (data) => {
const len = data.length;
for (let i = 0; i < len; i++) {
// console.log(data[i].router, componentName)
if (data[i].router === componentName) {
menu = data[i];
break;
......@@ -72,9 +71,9 @@ export default {
* @param {Boolean|String} only 布尔值为true时,是固定使用externalLinkTab---1打开页面,当是string字符串时,自定义打开固定标签页
*/
openExternalLinkTab(name, url, only) {
const id = (typeof only === 'boolean' && only)
? 'externalLinkTab---1'
: (typeof only === 'string' && only)
const id = (typeof only === 'boolean' && only)
? 'externalLinkTab---1'
: (typeof only === 'string' && only)
? only : '';
this.openTab({
id,
......@@ -91,10 +90,10 @@ export default {
},
/**
* 刷新标签页
* @param {String} id tab标签的唯一标识
* @param {String} id tab标签的唯一标识
*/
refreshTab(id) {
store.state.navigationList.map(item => {
store.state.navigationList.forEach(item => {
if (item.id === id) {
item.param = {
reload: new Date()
......
......@@ -14,21 +14,21 @@ export default {
return store.state.userInfo || null;
},
/**
* 获取用户身份
* 获取用户身份
* @returns {String}
*/
getUserName() {
return store.state.userInfo ? store.state.userInfo.RealName : '';
},
/**
* 获取系统信息
* @returns {Object}
* 获取系统信息
* @returns {Object}
*/
getSystemInfo() {
return store.state.platformInfo || null;
},
/**
* 获取用户身份
* 获取用户身份
* @returns {String} admin | none
*/
getUserIdentity() {
......@@ -45,13 +45,13 @@ export default {
position = 'bottom-right',
...opts
} = options;
const _opts = {
customClass,
position,
...opts
};
Notification(_opts);
}
};
......@@ -10,7 +10,6 @@ export const getQueryString = (name) => {
const r = window.location.search.substr(1).match(reg); // 查询?后面的参数,并匹配正则
if (r != null) return unescape(r[2]);
const param = getHashParameters();
// console.log(param)
if (param[name]) return param[name];
return null;
};
......@@ -41,16 +40,14 @@ export function removeLoading() {
// 获取系统信息
export function getSystemInfo(sysCode) {
sysCode = sysCode || getQueryString('sysCode');
console.log('系统code:', sysCode);
return new Promise((resolve, reject) => {
Api.getSystemInfo(sysCode).then(res => {
removeLoading();
if (res.status === 0) {
// console.log(res.data)
store.state.platformInfo.systemId = res.data.systemId;
store.state.platformInfo.name = res.data.sysMainTitle;
resolve();
} else {
reject(res);
......@@ -91,7 +88,7 @@ export const removeTab = $.menu.removeTab;
/**
* 刷新tab页
* @param {String} id tab标签的唯一标识
* @param {String} id tab标签的唯一标识
*/
export const refreshTab = $.menu.refreshTab;
......
......@@ -19,14 +19,14 @@ const utils = {
/**
* 深拷贝
* @param {Object|Array} p
* @param {Object|Array} p
* @param {Object|Array} c [] or {}
*/
deepCopy(p, c) {
c = c || {};
for (const i in p) {
if (typeof p[i] === 'object') {
c[i] = p[i]
c[i] = p[i]
? (p[i] && p[i].constructor === Array) ? [] : {}
: p[i];
this.deepCopy(p[i], c[i]);
......@@ -39,7 +39,7 @@ const utils = {
/**
* 随机生成唯一 ID
* @param {Number}
* @param {Number}
*/
generateId(len = 4) {
return Number(Math.random().toString().substr(3, len) + Date.now()).toString(36);
......@@ -47,7 +47,7 @@ const utils = {
/**
* 优化遍历,数组去重
* @param {Array} array
* @param {Array} array
*/
uniq(array, key) {
const temp = [];
......
......@@ -64,7 +64,7 @@ export default {
* 一些模块的控件过滤
* 例如:没有存在的菜单的项的路由组件,不作权限控件
*/
if (this.$SMTab &&
if (this.$SMTab &&
[].indexOf(this.$SMTab.componentName) >= 0
) {
return;
......
......@@ -27,21 +27,25 @@
</div>
<router-view></router-view>
<password-dialog :visiableDialog="visiableDialog" @visiable-dialog="handlePasswordDialogEvent"></password-dialog>
</div>
</template>
<script>
import AppHeader from './common/Header';
import AppNavigation from './Navigation';
import passwordDialog from './common/PasswordDialog';
import Utils from '@/utils';
import { changeTheme } from '@/utils/global';
import { changeTheme, getUser } from '@/utils/global';
export default {
name: 'Main',
components: {
AppHeader,
AppNavigation
AppNavigation,
passwordDialog
},
computed: {
......@@ -76,7 +80,8 @@ export default {
style: '',
componentName: 'frameworkManage'
} */
]
],
visiableDialog: false
};
},
......@@ -101,9 +106,9 @@ export default {
}
if (!flag) return;
let index = 0;
this.tabsData.map((tab, idx) => {
this.tabsData.forEach((tab, idx) => {
if (!Utils.isEmptyData(oldVal) && oldVal.id === tab.id) {
index = idx;
}
......@@ -114,9 +119,9 @@ export default {
} else {
this.tabsData.splice(index + 1, 0, newVal);
}
this.currentTab = newVal.id;
// 新打开tab
this.$Progress.start();
}
......@@ -124,7 +129,7 @@ export default {
navigationList(newVal) {
if (newVal.length > 0) {
}
},
......@@ -144,6 +149,8 @@ export default {
// 注册到全局
window.removeTab = this.removeTab;
this.handleUserFirstLogin();
},
methods: {
......@@ -174,7 +181,7 @@ export default {
}
}
}
this.currentTab = activeName;
this.tabsData = tabs.filter(tab => tab.id !== targetName);
this.$store.dispatch('removeNavigation', targetName);
......@@ -182,7 +189,21 @@ export default {
handleComponentMounted() {
this.$Progress.finish();
},
// 处理用户首次登陆时,需要修改密码
handleUserFirstLogin() {
const userInfo = getUser();
if (userInfo && userInfo.Status && userInfo.Status === 1) {
this.visiableDialog = true;
}
},
// 修改密码框显示事件
handlePasswordDialogEvent(visiable) {
this.visiableDialog = !!visiable;
}
}
};
</script>
......@@ -261,7 +261,7 @@ export default {
render (h) {
let menuItem = ''
this.navDatas.map(item => {
this.navDatas.forEach(item => {
if (item.children && item.children.length > 0) {
menuItem += `<el-submenu index="${item.router}">`
......
......@@ -10,7 +10,7 @@
export default {
name: 'ConfigurePage',
data() {
return {
url: ''
......
......@@ -17,11 +17,11 @@
<span>表单设计器</span>
</a>
</div>
<el-badge :value="unreadMessage"
:hidden="unreadMessage === 0 || unreadMessage === '0'"
style="margin-right: 10px;cursor: pointer;"
:max="99"
<el-badge :value="unreadMessage"
:hidden="unreadMessage === 0 || unreadMessage === '0'"
style="margin-right: 10px;cursor: pointer;"
:max="99"
@click.native="handleMessage">
<i class="iconfont icon-tongzhi"></i>
</el-badge>
......
......@@ -20,11 +20,11 @@ export default {
if (this.theme.format === 'top-bottom') return { fontSize: '22px' };
let fontSize = '20px';
const getStrLen = (str) => {
if (str == null) return 0;
if (typeof str !== 'string') {
str += '';
const getStrLen = (str) => {
if (str == null) return 0;
if (typeof str !== 'string') {
str += '';
}
/* eslint-disable */
return str.replace(/[^\x00-\xff]/g, '01').length
......
<template>
<el-dialog title="首次登录,请修改密码"
:visible.sync="dialogVisiable"
width="400px"
:before-close="handleBeforeCloseDialog"
:close-on-click-modal="false"
:close-on-press-escape="false">
<el-form
:rules="passwordRule"
:model="passwordForm"
ref="pswForm">
<el-form-item label="新密码" :label-width="formLabelWidth" prop="password">
<el-input v-model="passwordForm.password" type="password" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认新密码" :label-width="formLabelWidth" prop="comfirmPassword">
<el-input v-model="passwordForm.comfirmPassword" type="password" autocomplete="off"
@keyup.native.enter="handleSubmitPassword"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary"
:loading="passSubmiting"
@click="handleSubmitPassword">
确 定
</el-button>
</div>
</el-dialog>
</template>
<script>
import sha1 from 'js-sha1';
import Api from '@/api';
import { getUser } from '@/utils/global';
export default {
name: 'PasswordDialog',
props: {
visiableDialog: {
type: Boolean,
default: false
}
},
computed: {
dialogVisiable() {
return this.visiableDialog;
}
},
data() {
const password = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
if (this.passwordForm.comfirmPassword !== '') {
this.$refs.pswForm.validateField('comfirmPassword');
}
callback();
}
};
const comfirmPassword = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.passwordForm.password) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
dialogVisible: false,
passSubmiting: false,
formLabelWidth: '100px',
passwordForm: {
password: '',
comfirmPassword: ''
},
passwordRule: {
password: [
{required: true, message: '不能为空', trigger: 'change'},
{validator: password, trigger: 'blur'}
],
comfirmPassword: [
{required: true, message: '不能为空', trigger: 'change'},
{validator: comfirmPassword, trigger: 'blur'}
]
}
};
},
methods: {
handleBeforeCloseDialog() {
this.$message.warning('首次登陆,请修改密码哟!');
this.$emit('visiable-dialog', true);
},
// 提交密码修改
handleSubmitPassword() {
this.$refs['pswForm'].validate(valid => {
if (valid) {
this.passSubmiting = true;
const userPassword = sha1(this.passwordForm.password).toUpperCase();
const userInfo = getUser();
Api.updatePassword(userInfo.userId, userPassword).then(res => {
if (res.status === 0) {
this.modifyPassDialogVisible = false;
this.loginOutAndReturnLogin();
} else {
this.$message({
message: '修改密码出错',
type: 'warning',
duration: 2000
});
}
}).catch(err => {
this.passSubmiting = false;
this.$message({
message: err.message,
type: 'error',
duration: 2000
});
});
}
});
},
// 退出账号并返回到登陆
loginOutAndReturnLogin() {
Api.logout().then(res => {
if (res.status === 0) {
this.$message({
message: '密码修改成功, 系统将在3s后为您跳转到登录页',
type: 'success',
duration: 3000
});
setTimeout(() => {
this.$router.replace({
path: '/login'
});
this.passSubmiting = false;
}, 3000);
} else {
this.$message({
type: 'warning',
message: '密码修改成功,由于' + res.message
});
}
}).catch(err => {
this.passSubmiting = false;
this.$message({
type: 'error',
message: err.message
});
});
}
}
};
</script>
<template>
<sw-message
<sw-message
:user-info="userInfo"
@unread-message-change="handleUnreadMessageChange">
</sw-message>
......
......@@ -7,7 +7,7 @@
<login-form @submit="handleSubmited"></login-form>
</div>
</template>
<script>
import LoginForm from './LoginForm.vue';
......
......@@ -5,32 +5,32 @@
<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>
</div>
<el-form
ref="loginForm"
:model="loginForm"
:rules="rules"
<el-form
ref="loginForm"
:model="loginForm"
:rules="rules"
label-width="100px"
@submit.native.prevent>
<el-form-item label="账户:" prop="name">
<el-input v-model="loginForm.name" placeholder="输入登录用户名" autofocus @change="handleInputChange"></el-input>
</el-form-item>
<el-form-item label="密码:" prop="password">
<el-input type="password"
v-model="loginForm.password"
placeholder="请输入密码"
<el-input type="password"
v-model="loginForm.password"
placeholder="请输入密码"
@keyup.native.enter="onSubmit('loginForm')"
@change="handleInputChange"></el-input>
</el-form-item>
<el-form-item>
<el-checkbox label="记住账户" v-model="loginForm.remember"></el-checkbox>
</el-form-item>
<el-form-item class="buttons">
<el-button
type="primary"
size="large"
class="submitBtn"
:loading="loginForm.loading"
<el-button
type="primary"
size="large"
class="submitBtn"
:loading="loginForm.loading"
@click="onSubmit()" >
{{ loginForm.submitText }}
</el-button>
......@@ -131,7 +131,7 @@ export default {
message: message,
type: 'success'
});
this.$emit('submit', userState);
this.$router.replace({
path: '/',
......
<template>
<sw-catalog-management></sw-catalog-management>
<sw-catalog-management></sw-catalog-management>
</template>
<script>
......
<template>
<sw-check-process
<sw-check-process
:user-authority="userAuthories"
:process-instance-id="processInstanceId">
</sw-check-process>
......
<template>
<sw-create-work
<sw-create-work
ref="createWork"
:user-authority="userAuthories"
@open-work="handleOpenWork"
......
<template>
<sw-interface
<sw-interface
:theme="theme"
@theme-change="handleThemeChange"></sw-interface>
</template>
......
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