提交 addef29b 编写于 作者: JEECG低代码平台's avatar JEECG低代码平台

解决bug:解决父菜单下拉不出来问题、解决某些页面js报错问题、解决token失效跳转问题

上级 0dfee2fa
......@@ -49,11 +49,9 @@ router.beforeEach((to, from, next) => {
message: '系统提示',
description: '请求用户信息失败,请重试!'
})
// update-begin- --- author:scott ------ date:20190225 ---- for:Token失效跳转登录逻辑修改----
// store.dispatch('Logout').then(() => {
// next({ path: '/user/login', query: { redirect: to.fullPath } })
// })
// update-end- --- author:scott ------ date:20190225 ---- for:Token失效跳转登录逻辑修改----
store.dispatch('Logout').then(() => {
next({ path: '/user/login', query: { redirect: to.fullPath } })
})
})
} else {
next()
......
......@@ -200,7 +200,7 @@
});
},
setThisExpandedKeys(node){
if(node.children.length>0){
if(node.children && node.children.length>0){
this.iExpandedKeys.push(node.key);
for(let a=0;a<node.children.length;a++){
this.setThisExpandedKeys(node.children[a]);
......@@ -289,7 +289,7 @@
this.selectedKeys = [record.key];
this.model.parentId = record.parentId;
this.$nextTick(() => {
this.form.setFieldsValue(pick(record,'parentId','departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
this.form.setFieldsValue(pick(record,'departName','departOrder','mobile','fax','address','memo'))
});
},
......
......@@ -250,7 +250,7 @@
}
}
</script>
<style>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
......
......@@ -243,7 +243,7 @@
}
}
</script>
<style>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
......
......@@ -236,7 +236,7 @@
}
}
</script>
<style>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
......
......@@ -345,7 +345,7 @@
}
}
</script>
<style>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
......
......@@ -72,12 +72,12 @@
</a-popconfirm>
</a-menu-item>
<a-menu-item v-if="record.sendStatus == 0">
<a-popconfirm title="确定发布该系统公告吗?" @confirm="() => releaseData(record.id)">
<a-popconfirm title="确定发布吗?" @confirm="() => releaseData(record.id)">
<a>发布</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item v-if="record.sendStatus == 1">
<a-popconfirm title="确定撤销该系统公告吗?" @confirm="() => reovkeData(record.id)">
<a-popconfirm title="确定撤销吗?" @confirm="() => reovkeData(record.id)">
<a>撤销</a>
</a-popconfirm>
</a-menu-item>
......@@ -386,7 +386,7 @@
}
}
</script>
<style>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
......
......@@ -479,7 +479,7 @@
}
</script>
<style>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
......
......@@ -34,7 +34,7 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="电话">
<a-input placeholder="请输入电话" v-decorator="['mobile',validatorRules.mobile]" v-model="model.mobile" />
<a-input placeholder="请输入电话" v-decorator="['mobile',validatorRules.mobile]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
......@@ -139,9 +139,9 @@
this.model = Object.assign({}, {});
this.visible = true;
this.loadTreeData();
this.model.parentId = record.toString();
this.model.parentId = record!=null?record.toString():null;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'parentId','departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
this.form.setFieldsValue(pick(this.model,'departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
});
},
close () {
......
<template>
<a-modal
:width="modalWidth"
:visible="visible"
title="部门搜索"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
>
<!--部门树-->
<template>
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
<a-tree
multiple
treeCheckable="tree"
checkable
:checkedKeys="checkedKeys"
allowClear="true"
:checkStrictly="true"
@check="onCheck"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree"
placeholder="请选择上级部门"
>
</a-tree>
</a-form-item>
</a-form>
</template>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { getAction } from '@/api/manage'
import { queryIdTree } from '@/api/api'
import userModal from './UserModal'
export default {
name: "DepartWindow",
components: {
userModal,
},
data () {
return {
checkedKeys:[], // 存储选中的部门id
userId:"", // 存储用户id
model:{}, // 存储SysUserDepartsVO表
userDepartModel:{userId:'',departIdList:[]}, // 存储用户id一对多部门信息的对象
departList:[], // 存储部门信息
modalWidth:400,
departTree:[],
title:"操作",
visible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
headers:{},
form:this.$form.createForm(this),
url: {
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
},
}
},
methods: {
add (checkedDepartKeys,userId) {
this.checkedKeys = checkedDepartKeys;
this.userId = userId;
this.edit({});
},
edit (record) {
this.departList = [];
this.queryDepartTree();
this.form.resetFields();
this.visible = true;
this.model = Object.assign({}, record);
let filedsVal = pick(this.model,'id','userId','departIdList');
this.$nextTick(() => {
this.form.setFieldsValue(filedsVal);
});
},
close () {
this.$emit('close');
this.visible = false;
this.departList = [];
this.checkedKeys = [];
},
handleSubmit () {
const that = this;
// 触发表单验证
this.form.validateFields((err) => {
if (!err) {
that.confirmLoading = true;
if(this.userId == null){
getAction(this.url.userId).then((res)=>{
if(res.success){
that.$message.success(res.message);
let formData = {userId:res.result,
departIdList:this.departList}
console.log(formData)
that.$emit('ok', formData);
}else{
that.$message.warning("添加失败!");
}
}).finally(() => {
that.departList = [];
that.confirmLoading = false;
that.close();
})
}else {
let formData = {userId:this.userId,
departIdList:this.departList}
console.log(formData)
that.departList = [];
that.$emit('ok', formData);
that.confirmLoading = false;
that.close();
}
}
})
},
handleCancel () {
this.close()
},
// 选择部门时作用的API
onCheck(checkedKeys, info){
this.departList = [];
this.checkedKeys = checkedKeys.checked;
let checkedNodes = info.checkedNodes;
for (let i = 0; i < checkedNodes.length; i++) {
let de = checkedNodes[i].data.props;
let depart = {key:"",value:"",title:""};
depart.key = de.value;
depart.value = de.value;
depart.title = de.title;
this.departList.push(depart);
}
console.log('onCheck', checkedKeys, info);
},
queryDepartTree(){
queryIdTree().then((res)=>{
if(res.success){
this.departTree = res.result;
}
})
},
modalFormOk(){
}
},
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td{
padding-top:10px;
padding-bottom:10px;
}
</style>
\ No newline at end of file
......@@ -36,7 +36,7 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="排序值">
<a-input-number :min="1" v-decorator="['sortOrder']"/> 值越小越靠前,支持小数
<a-input-number :min="1" v-decorator="['sortOrder',{'initialValue':1}]"/> 值越小越靠前,支持小数
</a-form-item>
<a-form-item
......@@ -100,7 +100,7 @@
this.model.status = this.status;
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'dictId','itemText','itemValue','description','sortOrder','status'))
this.form.setFieldsValue(pick(this.model,'itemText','itemValue','description','sortOrder'))
});
},
onChose(checked) {
......
......@@ -9,12 +9,12 @@
:okButtonProps="{ props: {disabled: disableSubmit} }"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 85%;overflow-y: hidden">
style="top:5%;height: 95%;">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item label="菜单类型" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-radio-group @change="onChangeMenuType" v-model="localMenuType" v-decorator="['menuType',{'initialValue':1}]">
<a-radio-group @change="onChangeMenuType" v-decorator="['menuType',{'initialValue':1}]">
<a-radio :value="0">一级菜单</a-radio>
<a-radio :value="1">子菜单</a-radio>
<a-radio :value="2">按钮</a-radio>
......@@ -165,9 +165,12 @@
var that = this;
queryTreeList().then((res)=>{
if(res.success){
console.log('----queryTreeList---')
console.log(res)
that.treeData = [];
for(let a=0;a<res.result.length;a++){
let temp = res.result[a];
let treeList = res.result.treeList
for(let a=0;a<treeList.length;a++){
let temp = treeList[a];
temp.isLeaf = temp.leaf;
that.treeData.push(temp);
}
......@@ -202,7 +205,7 @@
this.visible = true;
this.loadTree();
let fieldsVal = pick(this.model,'name','perms','icon','component','url','sortNo','menuType');
let fieldsVal = pick(this.model,'name','perms','component','url','sortNo','menuType');
this.$nextTick(() => {
this.form.setFieldsValue(fieldsVal)
});
......@@ -253,7 +256,8 @@
}
},
onChangeMenuType(e) {
//console.log('radio1 checked', e.target.value)
console.log('localMenuType checked', e.target.value)
this.localMenuType=e.target.value
if(e.target.value == 2){
this.show = false;
this.menuLabel = '按钮名称';
......
......@@ -14,44 +14,32 @@
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="标题"
hasFeedback >
label="标题">
<a-input placeholder="请输入标题" v-decorator="['titile', validatorRules.title]" :readOnly="disableSubmit" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="内容"
hasFeedback >
label="内容">
<!--<a-input placeholder="请输入内容" v-decorator="['msgContent', {}]" />-->
<a-textarea :rows="5" placeholder="..." v-decorator="[ 'msgContent', {} ]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="开始时间"
hasFeedback >
label="开始时间">
<a-date-picker showTime format="YYYY-MM-DD HH:mm:ss" v-decorator="[ 'startTime', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="结束时间"
hasFeedback >
label="结束时间">
<a-date-picker showTime format="YYYY-MM-DD HH:mm:ss" v-decorator="[ 'endTime', {}]" />
</a-form-item>
<!--<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="发布人"
hasFeedback >
<a-input placeholder="请输入发布人" v-decorator="['sender', {}]" />
</a-form-item>-->
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="优先级"
hasFeedback >
label="优先级">
<a-select
v-decorator="[ 'priority', {}]"
placeholder="请选择优先级"
......@@ -64,8 +52,7 @@
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="通告对象类型"
hasFeedback >
label="通告对象类型">
<a-select
v-decorator="[ 'msgType', {}]"
placeholder="请选择通告对象类型"
......@@ -79,7 +66,6 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="指定用户"
hasFeedback
v-if="userType">
<a-input placeholder="请选择用户" v-decorator="['userIds',{}]" @click="selectUserIds" disabled="true" />
</a-form-item>
......@@ -113,6 +99,7 @@
return {
title:"操作",
visible: false,
disableSubmit:false,
model: {},
labelCol: {
xs: { span: 24 },
......@@ -148,12 +135,10 @@
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'titile','msgContent','sender','priority','msgType','sendStatus','delFlag'))
//时间格式化
this.form.setFieldsValue(pick(this.model,'titile','msgContent','priority','msgType'))
//时间格式化
this.form.setFieldsValue({startTime:this.model.startTime?moment(this.model.startTime):null})
this.form.setFieldsValue({endTime:this.model.endTime?moment(this.model.endTime):null})
this.form.setFieldsValue({sendTime:this.model.sendTime?moment(this.model.sendTime):null})
this.form.setFieldsValue({cancelTime:this.model.cancelTime?moment(this.model.cancelTime):null})
});
},
......@@ -180,9 +165,7 @@
//时间格式化
formData.startTime = formData.startTime?formData.startTime.format('YYYY-MM-DD HH:mm:ss'):null;
formData.endTime = formData.endTime?formData.endTime.format('YYYY-MM-DD HH:mm:ss'):null;
formData.sendTime = formData.sendTime?formData.sendTime.format('YYYY-MM-DD HH:mm:ss'):null;
formData.cancelTime = formData.cancelTime?formData.cancelTime.format('YYYY-MM-DD HH:mm:ss'):null;
console.log(formData)
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
......
......@@ -9,7 +9,7 @@
:visible="visible"
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
<a-form :form="form">
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
......
......@@ -98,6 +98,8 @@
import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
import { mapActions } from "vuex"
import { timeFix } from "@/utils/util"
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
export default {
components: {
......@@ -126,6 +128,7 @@
}
},
created () {
Vue.ls.remove(ACCESS_TOKEN)
// update-begin- --- author:scott ------ date:20190225 ---- for:暂时注释,未实现登录验证码功能
// this.$http.get('/auth/2step-code')
// .then(res => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册