This commit is contained in:
宋伟佳
2021-07-05 11:13:39 +08:00
9 changed files with 515 additions and 408 deletions
+6 -1
View File
@@ -3,7 +3,12 @@
* @author: xx
* @date: 2018-09-01 15:11:57
*/
/deep/.el-tree-node:focus > .el-tree-node__content {
color: #409EFF !important;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
color: #409EFF !important;
}
.ellipsis () {
overflow: hidden;
white-space: nowrap;
+1 -1
View File
@@ -385,7 +385,7 @@ export default {
{
title: '我的板块',
path: '/plate',
menuId: '971d576ef9bce3bddd6f0d6bcc55d184'
menuId: 'e4a94f03223df6f4ad70732b96f07221'
}
// {
// title: '个人信息',
@@ -13,7 +13,9 @@
:props="defaultProps"
default-expand-all
:filter-node-method="filterNode"
highlight-current
ref="tree"
:expand-on-click-node="false"
@node-click="handleNodeClick">
</el-tree>
</div>
@@ -109,8 +111,10 @@
:props="props"
:data="postList"
:default-checked-keys="nodeList"
highlight-current
check-strictly
default-expand-all
:expand-on-click-node="false"
show-checkbox>
</el-tree>
<div id="roleFormButton" class="demo-drawer-footer">
@@ -7,6 +7,8 @@
:data="treeData"
:props="defaultProps"
default-expand-all
:expand-on-click-node="false"
highlight-current
ref="tree"
@node-contextmenu="rightHandleNodeClick"
@node-click="handleNodeClick">
@@ -105,9 +105,11 @@
v-if="modalRole"
:props="props"
:data="roleList"
highlight-current
:default-checked-keys="nodeList"
check-strictly
default-expand-all
:expand-on-click-node="false"
show-checkbox>
</el-tree>
<div id="roleFormButton" class="demo-drawer-footer">
+242 -4
View File
@@ -13,6 +13,8 @@
:data="treeData"
:props="defaultProps"
default-expand-all
:expand-on-click-node="false"
highlight-current
:filter-node-method="filterNode"
ref="tree"
@node-click="handleNodeClick">
@@ -35,6 +37,10 @@
class="common-button-primary add-button"
@click="roleAddData"
size="mini">配置数据权限</el-button>
<el-button type="primary"
class="common-button-primary add-button"
@click="RolesAdd(1)"
size="mini">新增角色</el-button>
</div>
<div class="content">
<el-table
@@ -57,7 +63,7 @@
label="角色描述">
</el-table-column>
<el-table-column
prop="phone"
prop="parent"
label="上级角色"
width="170px">
</el-table-column>
@@ -72,10 +78,25 @@
width="140px">
</el-table-column>
<el-table-column
prop="operateTime.data"
prop="operateTime"
width="160px"
label="操作时间">
</el-table-column>
<el-table-column
label="操作"
width="50px">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '编辑']">编辑</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="Loading">加载中...</loading>
@@ -95,7 +116,9 @@
:data="treeData2"
:props="defaultProps2"
:default-checked-keys="nodeList"
:expand-on-click-node="false"
default-expand-all
highlight-current
show-checkbox
check-strictly
ref="tree2">
@@ -121,6 +144,8 @@
:props="defaultProps3"
:default-checked-keys="nodeList2"
default-expand-all
highlight-current
:expand-on-click-node="false"
show-checkbox
check-strictly
ref="tree3">
@@ -131,6 +156,77 @@
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="confirmDialogData">确定</el-button>
</div>
</el-dialog>
<el-dialog
:title="addRoleTitle"
:visible.sync="addModel"
:wrapperClosable="false"
@close="AddRoleCancel"
size="800px">
<div class="myDialog">
<el-form
ref="addForm"
:model="addForm"
:rules="addFormRules"
class="label-input-form"
>
<el-form-item label="角色名称" prop="name" label-width="80px" class="add-form-item">
<el-input v-model="addForm.name"
placeholder="请输入角色名称"
clearable></el-input>
</el-form-item>
<el-form-item label="上级角色" prop="parentId" label-width="80px" class="add-form-item">
<el-input v-model="addForm.parentId" style="display: none;"
clearable></el-input>
<el-input v-model="addForm.parent"
placeholder="请选择上级角色"
@click.native="SuperiorRole"
clearable></el-input>
</el-form-item>
<el-form-item label="角色描述" prop="remarks" label-width="80px" class="add-form-item">
<el-input v-model="addForm.remarks"
placeholder="请输入上级描述"
clearable></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="AddRoleCancel">取消</el-button>
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="AddRoleOk">确定</el-button>
</div>
</el-dialog>
<el-drawer
title="选择上级角色"
:visible.sync="SuperiorRoleModel"
:wrapperClosable="false"
@close="SuperiorRoleCancle"
size="800px"
>
<el-tree
v-if="SuperiorRoleModel"
class="filter-tree1"
:data="treeData"
:props="defaultProps"
default-expand-all
check-strictly
node-key="id"
:default-checked-keys="nodeList3"
show-checkbox
highlight-current
@check="drawerCheck"
:expand-on-click-node="false"
ref="tree4">
</el-tree>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button
size="mini"
class="common-button-primary"
icon="el-icon-check"
type="primary"
@click="SuperiorRoleOk"
>确定</el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="SuperiorRoleCancle">取消</el-button>
</div>
</el-drawer>
</div>
</template>
@@ -139,10 +235,28 @@ export default {
name: 'role-manage',
data () {
return {
type: '', // 新增/编辑状态
addRoleTitle: '',
SuperiorRoleData: {},
nodeList3: [],
SuperiorRoleModel: false,
addFormRules: {
name: [
{ required: true, message: '请输入角色名称', trigger: 'blur' }
]
},
addForm: {
name: '', // 角色名称
parentId: '', // 上级ID
remarks: '', // 角色描述
parent: '',
id: ''
},
addModel: false,
treeData3: [],
defaultProps3: {
children: 'children',
label: 'name'
label: 'menuName'
},
nodeList2: [],
modalflag: false,
@@ -167,6 +281,119 @@ export default {
}
},
methods: {
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.RolesAdd(0, command[0])
break
case '删除':
this.deleteRole(command[0])
break
}
},
deleteRole (row) { // 删除角色
this.$confirm('此操作将永久删除该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('sarRole/role', {
roleId: row.id
}, {}, res => {
if (res.ok) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getTree()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
drawerCheck (data) {
var getlist = this.$refs.tree4.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
if(getlist.length == 1) {
}else {
this.$refs.tree4.setCheckedKeys([data.id]);
}
this.SuperiorRoleData = data
},
SuperiorRoleOk () { // 上级角色确定
this.addForm.parentId = this.SuperiorRoleData.id
this.addForm.parent = this.SuperiorRoleData.name
this.nodeList3 = []
this.nodeList3.push(this.addForm.parentId)
this.SuperiorRoleModel = false
},
SuperiorRoleCancle () { // 上级角色取消
this.SuperiorRoleModel = false
},
AddRoleCancel () { // 新增角色取消
this.$refs['addForm'].resetFields();
this.addModel = false
},
AddRoleOk () { // 新增角色确定
this.$refs['addForm'].validate((valid) => {
if (valid) {
if (this.type === 1) { // 新增
this.$http.postData('sarRole/role',this.addForm , {}, res=> {
if (res.ok) {
this.$message.success('新增角色成功')
this.addModel = false
this.getTree()
} else {
this.$message.warning(res.message)
this.addModel = false
}
})
} else { // 编辑
this.$http.putData('sarRole/role',this.addForm , {}, res=> {
if (res.ok) {
this.$message.success('修改角色信息成功')
this.addModel = false
this.getTree()
} else {
this.$message.warning(res.message)
this.addModel = false
}
})
}
}
})
this.addModel = false
},
SuperiorRole () { // 点击选择上级角色按钮
this.SuperiorRoleModel = true
},
RolesAdd (type, row) { // 新增/编辑角色按钮
this.type = type
if (type === 1) {
this.addRoleTitle = '新增角色'
this.addForm.name = ''
this.addForm.remarks = ''
this.addForm.parentId = ''
this.addForm.parent = ''
this.addForm.id = ''
} else {
this.addRoleTitle = '编辑角色'
this.addForm.name = row.name
this.addForm.remarks = row.remarks
this.addForm.parentId = row.parentId
this.addForm.parent = row.parent
this.addForm.id = row.id
this.nodeList3 = []
this.nodeList3.push(this.addForm.parentId)
}
this.$watch('newForm', (newVal, oldVal) => {
console.log(newVal, oldVal);
})
this.addModel = true
},
getTree3 () {
this.$http.get('sarResource/ts-resource', {}, {}, res=> {
if (res.ok) {
@@ -269,7 +496,12 @@ export default {
this.$refs.tree.filter(val);
}
},
mounted () {
computed:{
newForm() {
return JSON.parse(JSON.stringify(this.addForm))
}
},
mounted () {
this.getTree()
this.getTree2()
this.getTree3()
@@ -282,6 +514,12 @@ export default {
.role-manage {
display: flex;
height: 100%;
/deep/.el-form-item__content {
width: 100%;
}
.filter-tree1 {
height: 100%;
}
.tree-close{
.tree{
left: -200px !important;
@@ -14,6 +14,7 @@
<el-form
ref="qbkwForm"
:model="form"
:rules="formRules"
class="label-input-form"
label-width="210px"
>
@@ -30,10 +31,10 @@
clearable
></el-input>
</el-form-item>
<el-form-item label="完成时间" prop="year" class="add-form-item form-item-disabled">
<el-form-item label="完成时间" prop="date" class="add-form-item form-item-disabled">
<el-date-picker
v-model="form.year"
type="year"
v-model="form.date"
type="date"
placeholder="请选择完成时间">
</el-date-picker>
</el-form-item>
@@ -56,99 +57,86 @@
</el-form>
</div>
<div>
<el-collapse accordion>
<el-collapse-item title="调研描述">
<div style="margin: 10px 0;">
<el-input
type="textarea"
:rows="3"
resize="none"
placeholder="请输入调研描述"
v-model="textarea">
</el-input>
</div>
</el-collapse-item>
</el-collapse>
<!-- <el-collapse accordion>-->
<!-- <el-collapse-item title="调研描述">-->
<!-- <div style="margin: 10px 0;">-->
<!-- <el-input-->
<!-- type="textarea"-->
<!-- :rows="3"-->
<!-- resize="none"-->
<!-- placeholder="请输入调研描述"-->
<!-- v-model="textarea">-->
<!-- </el-input>-->
<!-- </div>-->
<!-- </el-collapse-item>-->
<!-- </el-collapse>-->
</div>
</div>
<div class="content" v-if="active === '2'">
<div class="block" style="padding-top: 20px;">
<el-timeline>
<el-timeline-item timestamp="发起流程" placement="top" :color="user1 ? '#66b1ff' : ''">
<el-card>
<h4>流程发起人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user1" placeholder="流程发起人"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择责任人" placement="top" :color="user2 ? '#66b1ff' : ''">
<el-card>
<h4>责任对接人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user2" placeholder="选择责任人">
</el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传调研结果" placement="top" :color="user3 ? '#66b1ff' : ''">
<el-card>
<h4>责任人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user3" placeholder="选择责任人"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="审批" placement="top" :color="user4 ? '#66b1ff' : ''">
<el-card>
<h4>责任对接人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user5" placeholder="选择责任对接人"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="调研汇总" placement="top" :color="user5 ? '#66b1ff' : ''">
<el-card>
<h4>标准法规工程师</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user4" placeholder="选择标准法规工程师"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="会签审核" placement="top" :color="user6 ? '#66b1ff' : ''">
<el-card>
<h4>责任人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user5" placeholder="选择责任人"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="会签审核" placement="top" :color="user7 ? '#66b1ff' : ''">
<el-card>
<h4>责任部门领导与标准法规部部</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user5" placeholder="选择责任部门领导与标准法规部部长"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="审定" placement="top" :color="user8 ? '#66b1ff' : ''">
<el-card>
<h4>技术管理中心负责人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user5" placeholder="选择技术管理中心负责人"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="批准" placement="top" :color="user9 ? '#66b1ff' : ''">
<el-card>
<h4>标准法规业务院级领导</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="user5" placeholder="选择标准法规业务院级领导"></el-input>
</div>
</el-card>
</el-timeline-item>
<el-form
ref="Form"
:model="roleForm"
:rules="roleFormRules"
class="label-input-form">
<el-timeline-item timestamp="发起流程" placement="top" :color="roleForm.startUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="startUserName" style="margin-bottom: 0">
<h4>流程发起人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.startUser" style="display: none;"></el-input>
<el-input v-model="roleForm.startUserName" placeholder="流程发起人"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择部门责任人" placement="top" :color="roleForm.dockUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="dockUserName" style="margin-bottom: 0">
<h4>责任部门对接人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.dockUser" style="display: none;"></el-input>
<el-input v-model="roleForm.dockUserName" placeholder="选择责任人" @click.native="choiceZRR('dockUser', '选择责任人', roleForm.dockUser)">
</el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="审批" placement="top" :color="roleForm.ministerUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="ministerUserName" style="margin-bottom: 0">
<h4>标准法规部部长</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.ministerUser" style="display: none;"></el-input>
<el-input v-model="roleForm.ministerUserName" placeholder="选择标准法规部部长" @click.native="choiceZRR('ministerUser', '选择标准法规部部长', roleForm.ministerUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="审定" placement="top" :color="roleForm.directorUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="directorUserName" style="margin-bottom: 0">
<h4>技术管理中心主任</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.directorUser" style="display: none;"></el-input>
<el-input v-model="roleForm.directorUserName" placeholder="选择技术管理中心主任" @click.native="choiceZRR('directorUser', '选择技术管理中心主任', roleForm.directorUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="批准人" placement="top" :color="roleForm.presidentUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="presidentUserName" style="margin-bottom: 0">
<h4>工程研究总院院</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.presidentUser" style="display: none;"></el-input>
<el-input v-model="roleForm.presidentUserName" placeholder="选择工程研究总院院长" @click.native="choiceZRR('presidentUser', '选择工程研究总院院长', roleForm.presidentUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
</el-form>
</el-timeline>
</div>
</div>
@@ -161,7 +149,32 @@
@submit="handleSubmit"
>
</ProcessFooter>
<el-drawer
:title="drawerTitle"
:visible.sync="modalshowflag"
:wrapperClosable="false"
size="800px">
<el-tree
v-if="modalshowflag"
style="height: 100%;"
node-key="id"
class="filter-tree"
:data="treeData"
:props="defaultProps"
:default-checked-keys="nodeList"
highlight-current
check-strictly
@check="drawerCheck"
default-expand-all
:expand-on-click-node="false"
show-checkbox
ref="tree">
</el-tree>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="saveUserInfo">确定</el-button>
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="cancleUserInfo">取消</el-button>
</div>
</el-drawer>
</div>
</template>
@@ -174,6 +187,16 @@ export default {
name: "bzdyStep1",
data() {
return {
roleRow: {},
nodeList: [],
type: '',
defaultProps: {
children: 'children',
label: 'name'
},
treeData: [], // 人员数据
modalshowflag: false, // drawer开关
drawerTitle: '', //drawer标题
textarea: '', // 意见
title: '', // 新增编辑抽屉标题
ListModel: false, // 新增编辑抽屉开关
@@ -182,20 +205,47 @@ export default {
saveLoading: false,
form: {
title: '', // 调研标题
year: '', // 完成时间
date: '', // 完成时间
model: '', // 上传模板
},
formRules: {
title: [
{ required: true, message: '请输入调研标题', trigger: 'blur' },
],
date: [
{ type: 'date', required: true, message: '请选择完成时间', trigger: 'change' }
]
},
data: [], // 标准列表数据
ListForm: {}, // 新增数据
user1: '',
user2: '',
user3: '',
user4: '',
user5: '',
user6: '',
user7: '',
user8: '',
user9: '',
roleForm: {
startUserName: this.$store.getters.userInfo.account,
startUser: this.$store.getters.userInfo.id,
dockUser: '',
responUserList: '',
ministerUser: '',
directorUser: '',
presidentUser: '',
dockUserName: '',
responUserListName: '',
ministerUserName: '',
directorUserName: '',
presidentUserName: ''
},
roleFormRules: {
dockUserName: [
{ required: true, message: '请输入调研标题', trigger: 'blur' },
],
ministerUserName: [
{ required: true, message: '请输入调研标题', trigger: 'blur' },
],
directorUserName: [
{ required: true, message: '请输入调研标题', trigger: 'blur' },
],
presidentUserName: [
{ required: true, message: '请输入调研标题', trigger: 'blur' },
]
}
}
},
components: {
@@ -204,6 +254,46 @@ export default {
ProcessTitle
},
methods: {
saveUserInfo () {
if (this.type === 'dockUser') {
this.roleForm.dockUser = this.roleRow.id
this.roleForm.dockUserName = this.roleRow.name
} else if (this.type === 'ministerUser') {
this.roleForm.ministerUser = this.roleRow.id
this.roleForm.ministerUserName = this.roleRow.name
} else if (this.type === 'directorUser') {
this.roleForm.directorUser = this.roleRow.id
this.roleForm.directorUserName = this.roleRow.name
} else if (this.type === 'presidentUser') {
this.roleForm.presidentUser = this.roleRow.id
this.roleForm.presidentUserName = this.roleRow.name
}
this.modalshowflag = false
},
cancleUserInfo () {
this.modalshowflag = false
},
drawerCheck (data) {
var getlist = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
if(getlist.length == 1) {
this.roleRow = getlist[0]
}else {
this.$refs.tree.setCheckedKeys([data.id]);
this.roleRow = this.$refs.tree.getCheckedNodes()[0]
}
},
choiceZRR (type, title, id) {
this.nodeList = []
this.nodeList.push(id)
this.type = type
this.drawerTitle = title
this.modalshowflag = true
},
getTree () {
this.$http.get('SarInstitution/institution/institutionAndUser', {}, {}, res=> {
this.treeData = res.data
})
},
closeDrawer() {
this.ListModel = false
},
@@ -223,9 +313,17 @@ export default {
},
handleSave() {},
handleSubmit() {
this.$refs['Form'].validate((valid) => {
if (valid) {
alert('submit!');
} else {
return false;
}
})
}
},
mounted () {
this.getTree()
}
}
</script>
@@ -3,26 +3,17 @@
<div id="domesticStandardDatabase" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class">
<div class="tree-content" :class="{ 'tree-closed': sideClose }">
<div class="tree">
<laws-tree :zNodes="zNodes"
ref="domesticTree"
treeDivId="domesticTree"
showRMenu
deptSelect
autoSelect
add-id="Q8SLTYESAL"
edit-id="94V5KRZUJF"
remove-id="5F7U4B2Q24"
:drag="hasPermissionDrag"
drag-bind=".drag-table"
drag-dom="drag-row"
:hideRMenuNode="['gxhbq', 'wdsc']"
@treeAdd="(treeId, treeNode) => clickDropMenu('newMenu', treeNode)"
@treeEdit="(treeId, treeNode) => clickDropMenu('editMenu', treeNode)"
@treeClick="(treeId, treeNode) => treeClick(treeNode)"
@treeRightClick="(treeId, treeNode) => treeRightClick(treeNode)"
@treeRemove="(treeId, treeNode) => clickDropMenu('deleteMenu', treeNode)"
@drag="drag"
></laws-tree>
<el-tree
ref="tree"
node-key="id"
class="filter-tree"
:props="props"
:data="treeList"
highlight-current
@node-click="treeClick"
default-expand-all
:expand-on-click-node="false">
</el-tree>
</div>
<div class="tree-collapse" @click="treeCollapse" :class="{ 'tree-close': sideClose }">
<!--切换折叠样式-->
@@ -961,6 +952,11 @@ export default {
},
data () {
return {
props: {
label: 'menuName',
children: 'children'
},
treeList: [],
visibleOrgTable: false,
orgTableVal: '',
orgTableValName: '',
@@ -1693,104 +1689,12 @@ export default {
})
}
},
// 二级菜单新建,编辑,删除
clickDropMenu (name, treeNode) {
this.selectSarMenu = JSON.parse(JSON.stringify(treeNode))
if (undefined !== this.selectSarMenu.id) { // 当前有选中节点
if (name === 'newMenu') {
this.menuModalTitle = '新增目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 1
this.sarMenu = {
id: '',
parentId: '',
menuName: '',
sorDivide: 'INLAND_STAND',
displaySeq: '',
parentIds: '',
remarks: ''
}
} else if (name === 'editMenu') {
this.menuModalTitle = '编辑目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 2
this.sarMenu.id = treeNode.id
this.sarMenu.parentId = treeNode.pId
this.sarMenu.menuName = treeNode.oldname || treeNode.name
this.sarMenu.displaySeq = treeNode.displaySeq
if (treeNode.remarks == null || treeNode.remarks === '' || treeNode.remarks === 'null') {
this.sarMenu.remarks = ''
} else {
this.sarMenu.remarks = treeNode.remarks
}
} else {
if (this.selectSarMenu.parentId == null) { // 如果父id为null 说明是根目录
this.$message({
title: '提示',
content: '根目录不可删除!'
})
} else {
// deleteMenu 删除二级菜单,先判断是否选中,选中项目,然后调用删除方法
// 先判断目录下是否有菜单
this.$http.post('lawss/sarMenu/judgequeryMenuByPid', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
if (res.data) {
// this.deleteMenuModal = true
this.$confirm('该节点下有记录,确定删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: false
}).then(() => {
this.$http.post('lawss/sarMenu/deleteMenuAndChildren', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
this.selectMenu() // 删除成功后,更新二级菜单
// 获取下一个节点
let currentNode = this.$refs.domesticTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.domesticTree.selectRootNode()
} else {
nodeId = currentNode.id
}
this.getDomesticStandardTable(nodeId)
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
} else {
this.sureDeleteSarMenu()
}
}, e => {
})
}
}
} else {
this.$Modal.info({
title: '提示',
content: '请选择节点!'
})
}
},
treeClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.standCommonlySearch.menuId = treeNode.id
this.sarStandardsSearch.menuId = treeNode.id // 将当前二级菜单的id传回后台做标准的条件查询
this.sarStandardsSearch.page = 1
this.standCommonlySearch.page = 1
this.getDomesticStandardTable(this.tableFlag) // 根据选中的二级菜单查询对应的标准列表
},
treeRightClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.standCommonlySearch.menuId = treeNode.id
this.sarStandardsSearch.menuId = treeNode.id
this.getDomesticStandardTable(this.tableFlag)
},
// 点击搜索按钮
searchBtnClick (standCommonlySearch) {
@@ -1906,43 +1810,12 @@ export default {
},
// 查询二级菜单
selectMenu () {
return new Promise((resolve, reject) => {
this.$http.get('lawss/sarMenu/selectMenuByRole', {sorDivide: 'INLAND_STAND'}, {
_this: this
}, res => {
let treeNode = []
this.parentNode = {}
if (res.data == null) {
res.data = []
}
res.data.map((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'parentId') {
treeItem.pId = item[key]
treeItem.parentId = item[key]
} else if (key === 'menuName') {
treeItem.name = item[key]
} else {
treeItem[key] = item[key]
}
if (this.initZNode === '' && item.id === '64df1d5522bb49c09af2') { this.initZNode = treeItem }
}
treeNode[index] = treeItem
// 记录最外层父节点
if (treeItem.parentId === '' || treeItem.parentId == null) {
this.parentNode = treeItem
}
})
this.zNodes = treeNode
// 查完左侧目录后,如果没有选中的,设置最外层选中
if (JSON.stringify(this.selectSarMenu) === '{}' || !this.selectSarMenu) {
this.selectSarMenu = JSON.parse(JSON.stringify(this.parentNode))
}
resolve(res)
}, e => {
reject(e)
})
this.$http.get('sarResource/ts-resource', {
sorDivide: 'INLAND_STAND'
}, {}, res => {
if (res.ok) {
this.treeList = res.data
}
})
},
// 树-删除
@@ -2446,7 +2319,12 @@ export default {
}
// this.sarStandardsSearch.menuId = this.selectSarMenu.id
const formData = {...data}
formData.menuId = this.selectSarMenu.id
if (!item) {
formData.menuId = this.sarStandardsSearch.menuId
} else {
formData.menuId = this.selectSarMenu.id
}
// 排序
formData.orderBy = this.orderBy
// 处理我的收藏和个性化标签传参
@@ -3,27 +3,17 @@
<div id="foreignStandardsAndRegulations" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class">
<div class="tree-content" :class="{ 'tree-closed': sideClose }">
<div class="tree">
<laws-tree :zNodes="zNodes"
ref="domesticTree"
treeDivId="domesticTree"
showRMenu
deptSelect
autoSelect
add-id="QE4VD4BUQY"
edit-id="NR9VRJ3VY3"
remove-id="NTUFYC8TCC"
:drag="hasPermissionDrag"
drag-bind=".drag-table"
drag-dom="drag-row"
:hideRMenuNode="['gxhbq', 'wdsc']"
:loading="menuTreeLoading"
@treeAdd="(treeId, treeNode) => clickDropMenu('newMenu', treeNode)"
@treeEdit="(treeId, treeNode) => clickDropMenu('editMenu', treeNode)"
@treeClick="(treeId, treeNode) => treeClick(treeNode)"
@treeRightClick="(treeId, treeNode) => treeRightClick(treeNode)"
@treeRemove="(treeId, treeNode) => clickDropMenu('deleteMenu', treeNode)"
@drag="drag"
></laws-tree>
<el-tree
ref="tree"
node-key="id"
class="filter-tree"
:props="props"
:data="treeList"
highlight-current
@node-click="treeClick"
default-expand-all
:expand-on-click-node="false">
</el-tree>
</div>
<div class="tree-collapse" @click="treeCollapse" :class="{ 'tree-close': sideClose }">
<!--切换折叠样式-->
@@ -934,6 +924,11 @@ export default {
},
data () {
return {
treeList: [],
props: {
label: 'menuName',
children: 'children'
},
menuTreeLoading: true,
orderBy:'',
nowOrder:'',
@@ -1644,101 +1639,11 @@ export default {
})
})
},
// 二级菜单新建,编辑,删除
clickDropMenu (name, treeNode) {
this.selectSarMenu = JSON.parse(JSON.stringify(treeNode))
if (undefined !== this.selectSarMenu.id) { // 当前有选中节点
if (name === 'newMenu') {
this.menuModalTitle = '新增目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 1
this.sarMenu = {
id: '',
parentId: '',
menuName: '',
sorDivide: 'FOREIGN_STAND',
displaySeq: '',
parentIds: '',
remarks: ''
}
} else if (name === 'editMenu') {
this.menuModalTitle = '编辑目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 2
this.sarMenu.id = treeNode.id
this.sarMenu.parentId = treeNode.pId
this.sarMenu.menuName = treeNode.oldname || treeNode.name
this.sarMenu.displaySeq = treeNode.displaySeq
if (treeNode.remarks == null || treeNode.remarks === '' || treeNode.remarks === 'null') {
this.sarMenu.remarks = ''
} else {
this.sarMenu.remarks = treeNode.remarks
}
} else {
if (this.selectSarMenu.parentId == null) { // 如果父id为null 说明是根目录
this.$message({
title: '提示',
content: '根目录不可删除!'
})
} else {
// deleteMenu 删除二级菜单,先判断是否选中,选中项目,然后调用删除方法
// 先判断目录下是否有菜单
this.$http.post('lawss/sarMenu/judgequeryMenuByPid', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
if (res.data) {
// this.deleteMenuModal = true
this.$confirm('该节点下有记录,确定删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: false
}).then(() => {
this.$http.post('lawss/sarMenu/deleteMenuAndChildren', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
this.selectMenu() // 删除成功后,更新二级菜单
// 获取下一个节点
let currentNode = this.$refs.domesticTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.domesticTree.selectRootNode()
} else {
nodeId = currentNode.id
}
this.getDomesticStandardTable()
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
} else {
this.sureDeleteSarMenu()
}
}, e => {
})
}
}
} else {
this.$Modal.info({
title: '提示',
content: '请选择节点!'
})
}
},
treeClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.selectSarMenu = treeNode
this.standCommonlySearch.menuId = treeNode.id
this.standCommonlySearch.page = 1
this.getDomesticStandardTable() // 根据选中的二级菜单查询对应的标准列表
},
treeRightClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.standCommonlySearch.menuId = treeNode.id
this.getDomesticStandardTable()
},
// 点击搜索按钮
searchBtnClick () {
@@ -1828,40 +1733,12 @@ export default {
},
// 查询二级菜单
selectMenu () {
return new Promise((resolve, reject) => {
this.$http.get('lawss/sarMenu/selectMenuByRole', {sorDivide: 'FOREIGN_STAND'}, {
_this: this
}, res => {
let treeNode = []
this.parentNode = {}
res.data.forEach((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'parentId') {
treeItem.pId = item[key]
treeItem.parentId = item[key]
} else if (key === 'menuName') {
treeItem.name = item[key]
} else {
treeItem[key] = item[key]
}
if (this.initZNode === '' && item.id === '64df1d5522bb49c09af2') { this.initZNode = treeItem }
}
treeNode[index] = treeItem
// 记录最外层父节点
if (treeItem.parentId === '' || treeItem.parentId == null) {
this.parentNode = treeItem
}
})
this.zNodes = treeNode
// 查完左侧目录后,如果没有选中的,设置最外层选中
if (JSON.stringify(this.selectSarMenu) === '{}' || !this.selectSarMenu) {
this.selectSarMenu = JSON.parse(JSON.stringify(this.parentNode))
}
resolve(res)
}, e => {
reject(e)
})
this.$http.get('sarResource/ts-resource', {
sorDivide: 'FOREIGN_STAND'
}, {}, res => {
if (res.ok) {
this.treeList = res.data
}
})
},
// 树-删除
@@ -2416,7 +2293,11 @@ export default {
data.sarStandardsSearch = ''
}
const formData = {...data}
formData.menuId = this.selectSarMenu.id
if (!item) {
formData.menuId = this.selectSarMenu.id
} else {
formData.menuId = this.standCommonlySearch.menuId
}
formData.nowOrderBy = this.nowOrder ? this.orderBy : ''
formData.nowOrder = this.nowOrder
// 处理我的收藏和个性化标签传参
@@ -2437,7 +2318,6 @@ export default {
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', formData, {
_this: this, loading: 'loading'
}, res => {
console.log('2441',formData);
this.isAdvancedSearch = false
if (res.ok) {
for (let i = 0; i < res.data.list.length; i++) {