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,15 +65,20 @@ body {
}
.form-render {
padding-top: 28px;
padding-top: 44px;
width: 1000px;
margin: 0 auto;
}
.is-required {
.submit-dialog,
.return-work,
.transform-work {
.is-required {
.el-textarea__inner {
border-color: $--color-danger;
}
}
}
.page-view {
......@@ -97,7 +102,7 @@ body {
@include e(wrapper) {
width: 100%;
height: 100%;
max-height: 20vh;
background-color: inherit;
overflow: auto;
......
......@@ -55,3 +55,7 @@ ul, ol, li {
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,7 +100,6 @@ const config = {
}).then(response => {
resolve(response.data);
}).catch(response => {
// console.error('ajax error:', response)
reject(response);
});
});
......@@ -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,7 +176,6 @@ const config = {
}).then(res => {
resolve(res.data);
}).catch(res => {
console.log('post error:', res);
reject(res);
});
});
......
......@@ -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) {}
})
}
......
<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,12 +197,10 @@ 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;
......@@ -222,7 +220,6 @@ export default {
},
onContextmenuClick(pane, type, e) {
// console.log('onclick', pane, e)
switch (type) {
case '关闭该标签页':
this.onTabRemove(pane, e);
......@@ -256,7 +253,7 @@ export default {
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 {
......
......@@ -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;
......@@ -94,7 +93,7 @@ export default {
* @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()
......
......@@ -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,13 +40,11 @@ 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;
......
......@@ -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
};
},
......@@ -103,7 +108,7 @@ 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;
}
......@@ -144,6 +149,8 @@ export default {
// 注册到全局
window.removeTab = this.removeTab;
this.handleUserFirstLogin();
},
methods: {
......@@ -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}">`
......
<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>
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