添加分类功能

This commit is contained in:
zhal 2022-07-12 14:48:13 +08:00
parent 8158242fde
commit 8517d004b3

View File

@ -1,11 +1,11 @@
<template> <template>
<el-container id="repositoryMain" style="overflow: hidden;"> <el-container id="repositoryMain" style="overflow: hidden;">
<el-header v-if="!havingWritePerm || havingCreatePerm" :height="headerHeight2"> <el-header v-if="!havingWritePerm" :height="headerHeight2">
</el-header> </el-header>
<el-header v-if="havingWritePerm || havingCreatePerm" :height="headerHeight1"> <el-header v-if="havingWritePerm" :height="headerHeight1">
<div style="margin: 12px 0px 10px;text-align: center;"> <div style="margin: 12px 0px 10px;text-align: center;">
<el-popover <el-popover
v-if="havingWritePerm || havingCreatePerm" v-if="havingWritePerm"
placement="bottom" placement="bottom"
width="280" width="280"
trigger="click" trigger="click"
@ -74,7 +74,7 @@
</awsui-button> </awsui-button>
</el-popover> </el-popover>
</div> </div>
<div v-if="havingWritePerm || havingCreatePerm" style="width: 100%;border-bottom: 1px solid #F2F2F2;"></div> <div v-if="havingWritePerm" style="width: 100%;border-bottom: 1px solid #F2F2F2;"></div>
</el-header> </el-header>
<el-main class="main-tree" :style="{'overflow': 'auto', 'height': treeHeight}"> <el-main class="main-tree" :style="{'overflow': 'auto', 'height': treeHeight}">
<el-tree <el-tree
@ -91,7 +91,7 @@
<span slot-scope="{node, data}"> <span slot-scope="{node, data}">
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" <i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}"
v-html="node.data.icon.icon"></i> v-html="node.data.icon.icon"></i>
<span :style="{'font-weight': data.id.length < 36 ? '600' : ''}">{{node.label}}</span> <span :style="{'font-weight': data.id.length < 36 ? '600' : ''}">{{node.label}}</span>
</span> </span>
</el-tree> </el-tree>
</el-main> </el-main>
@ -132,7 +132,6 @@
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;" > <div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;" >
<awsui-form :model="ModelsetUpDialog.systemForm" :rules="ModelsetUpDialog.rules" ref="systemForm" <awsui-form :model="ModelsetUpDialog.systemForm" :rules="ModelsetUpDialog.rules" ref="systemForm"
label-position="top"> label-position="top">
<awsui-form-item label="当前选定路径"> <awsui-form-item label="当前选定路径">
<awsui-input v-model="ModelsetUpDialog.systemForm.repositoryPathData" disabled></awsui-input> <awsui-input v-model="ModelsetUpDialog.systemForm.repositoryPathData" disabled></awsui-input>
</awsui-form-item> </awsui-form-item>
@ -140,9 +139,9 @@
<awsui-input v-model="ModelsetUpDialog.systemForm.name"></awsui-input> <awsui-input v-model="ModelsetUpDialog.systemForm.name"></awsui-input>
</awsui-form-item> </awsui-form-item>
<template v-if="ModelsetUpDialog.systemForm.method=='control.policy'"> <template v-if="ModelsetUpDialog.systemForm.method=='control.policy'">
<awsui-form-item label="制度类型" > <awsui-form-item label="制度类型" >
<awsui-select v-model="ModelsetUpDialog.systemForm.systemType" :options="ModelsetUpDialog.systemForm.SystemTypeOptions" placeholder="请选择制度类型"></awsui-select> <awsui-select v-model="ModelsetUpDialog.systemForm.systemType" :options="ModelsetUpDialog.systemForm.SystemTypeOptions" placeholder="请选择制度类型"></awsui-select>
</awsui-form-item> </awsui-form-item>
</template> </template>
</awsui-form> </awsui-form>
@ -197,7 +196,7 @@
dis: false, dis: false,
headerHeight1: '60px', headerHeight1: '60px',
headerHeight2: '10px', headerHeight2: '10px',
treeHeight: (parseInt(this.$store.getters.getTopMainHeightFn)) - (this.havingWritePerm || this.havingCreatePerm ? parseInt(this.headerHeight1) : parseInt(this.headerHeight2)) + 'px', treeHeight: (parseInt(this.$store.getters.getTopMainHeightFn)) - (this.havingWritePerm ? parseInt(this.headerHeight1) : parseInt(this.headerHeight2)) + 'px',
fileMethodList: [], fileMethodList: [],
folderMethodList: [], folderMethodList: [],
createDesignerVisible: false, createDesignerVisible: false,
@ -228,7 +227,7 @@
loading: false, loading: false,
dialogVisible: false, dialogVisible: false,
systemMethod: 'default',// defaultcustom systemMethod: 'default',// defaultcustom
systemTitle: '名称录入',// systemTitle: '模型新建',//
systemForm: { systemForm: {
name: '', name: '',
uuid:"", uuid:"",
@ -264,9 +263,6 @@
havingRemovePerm: false, havingRemovePerm: false,
havingVersionManagePerm: false, havingVersionManagePerm: false,
validUserPermDataCount: 0, validUserPermDataCount: 0,
isOlderVersion:true,
havingCreatePerm:false,
havingBatchPerm:false,
isHighSecurity: false, isHighSecurity: false,
securityList: {}, securityList: {},
securityVisible: false, securityVisible: false,
@ -315,15 +311,11 @@
that.validUserPermDataCount = ro.data.validUserPermDataCount; that.validUserPermDataCount = ro.data.validUserPermDataCount;
if (that.validUserPermDataCount > 0) { if (that.validUserPermDataCount > 0) {
that.havingWritePerm = ro.data.havingWritePerm; that.havingWritePerm = ro.data.havingWritePerm;
that.havingCreatePerm = ro.data.havingCreatePerm
} else { } else {
that.havingWritePerm = false; that.havingWritePerm = false;
that.havingCreatePerm = false;
} }
that.havingRemovePerm = ro.data.havingRemovePerm; that.havingRemovePerm = ro.data.havingRemovePerm;
that.havingVersionManagePerm = ro.data.havingVersionManagePerm; that.havingVersionManagePerm = ro.data.havingVersionManagePerm;
that.havingBatchPerm = ro.data.havingBatchPerm;
that.isOlderVersion = ro.data.isOlderVersion;
that.initTreeHeight(); that.initTreeHeight();
}).catch(error => { }).catch(error => {
console.log(error); console.log(error);
@ -363,10 +355,16 @@
} }
}, },
openNode(obj, node, tree) {// openNode(obj, node, tree) {//
this.closeCreatePopover(); if(obj.folder==false){
this.openRepositoryList(node.data.currId); window.open(node.data.url, '_blank'); //
this.transferTreeNode(obj) }else{
this.closeCreatePopover();
this.openRepositoryList(node.data.currId);
this.transferTreeNode(obj)
}
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
const that = this; const that = this;
const data = { const data = {
@ -385,6 +383,7 @@
} }
// //
awsuiAxios.post(data).then(function (ro) { awsuiAxios.post(data).then(function (ro) {
resolve(ro.data); resolve(ro.data);
if (node.level == 0 && ro.data.length > 0) { if (node.level == 0 && ro.data.length > 0) {
const tree = that.$refs.tree; const tree = that.$refs.tree;
@ -469,6 +468,7 @@
}; };
// //
awsuiAxios.post(data).then(function (ro) { awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') { if (ro.result == 'ok') {
const fileMethodList = ro.data.fileMethodList;// const fileMethodList = ro.data.fileMethodList;//
for (let i = 0; i < fileMethodList.length; i++) { for (let i = 0; i < fileMethodList.length; i++) {
@ -560,7 +560,7 @@
createModelsetUp(method) {// createModelsetUp(method) {//
this.ModelsetUpDialog.systemMethod = method; this.ModelsetUpDialog.systemMethod = method;
this.ModelsetUpDialog.systemForm.method = method; this.ModelsetUpDialog.systemForm.method = method;
this.ModelsetUpDialog.systemTitle = '名称录入'; this.ModelsetUpDialog.systemTitle = '新建模型';
this.ModelsetUpDialog.dialogVisible = true; this.ModelsetUpDialog.dialogVisible = true;
this.closeCreatePopover(); this.closeCreatePopover();
}, },
@ -615,92 +615,90 @@
createSystemSave(formName) {// createSystemSave(formName) {//
const that = this; const that = this;
that.$refs[formName].validate((valid) => { that.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
const checkdata = { const checkdata = {
url:'jd', url:'jd',
data:{ data:{
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_checkname', cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_checkname',
title: that.ModelsetUpDialog.systemForm.name, title: that.ModelsetUpDialog.systemForm.name,
method:that.ModelsetUpDialog.systemForm.method, method:that.ModelsetUpDialog.systemForm.method,
} }
}; };
// //
awsuiAxios.post(checkdata).then(function (ro) { awsuiAxios.post(checkdata).then(function (ro) {
if (ro.data.result == 'ok') { if (ro.data.result == 'ok') {
const nodeData = that.$refs.tree.getCurrentNode(); const nodeData = that.$refs.tree.getCurrentNode();
const parentId = nodeData.id; const parentId = nodeData.id;
const wsId = that.$store.getters.getWsIdFn; const wsId = that.$store.getters.getWsIdFn;
const teamId = that.$store.getters.getTeamIdFn; const teamId = that.$store.getters.getTeamIdFn;
const data = { const data = {
url: 'jd', url: 'jd',
data: { data: {
cmd: 'com.actionsoft.apps.coe.pal_processlevel_repository_create_save_Designer', cmd: 'com.actionsoft.apps.coe.pal_processlevel_repository_create_save_Designer',
wsId: wsId, wsId: wsId,
teamId: teamId, teamId: teamId,
category: that.ModelsetUpDialog.systemForm.category, category: that.ModelsetUpDialog.systemForm.category,
method: that.ModelsetUpDialog.systemForm.method, method: that.ModelsetUpDialog.systemForm.method,
parentId: parentId, parentId: parentId,
container: '_blank',// container: '_blank',//
name:that.ModelsetUpDialog.systemForm.name name:that.ModelsetUpDialog.systemForm.name
} }
}; };
// //
awsuiAxios.post(data).then(function (ro) { awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') { if (ro.result == 'ok') {
that.ModelsetUpDialog.systemForm.uuid=ro.data.id; that.ModelsetUpDialog.systemForm.uuid=ro.data.id;
that.ModelsetUpDialog.systemForm.parentId=parentId; that.ModelsetUpDialog.systemForm.parentId=parentId;
const data = { const data = {
url:'jd', url:'jd',
data:{ data:{
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType', cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType',
title: that.ModelsetUpDialog.systemForm.name, title: that.ModelsetUpDialog.systemForm.name,
type: that.ModelsetUpDialog.systemForm.systemType, type: that.ModelsetUpDialog.systemForm.systemType,
method:that.ModelsetUpDialog.systemForm.method, method:that.ModelsetUpDialog.systemForm.method,
uuid:that.ModelsetUpDialog.systemForm.uuid, uuid:that.ModelsetUpDialog.systemForm.uuid,
parentId:that.ModelsetUpDialog.systemForm.parentId parentId:that.ModelsetUpDialog.systemForm.parentId
} }
}; };
// //
awsuiAxios.post(data).then(function (ro) { awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') { if (ro.result == 'ok') {
that.ModelsetUpDialog.dialogVisible = false; that.ModelsetUpDialog.dialogVisible = false;
that.openRepositoryList(that.ModelsetUpDialog.systemForm.parentId); that.openRepositoryList(that.ModelsetUpDialog.systemForm.parentId);
// id // id
openDesigner(that.$store.getters.getTeamIdFn, that.ModelsetUpDialog.systemForm.uuid, that.$store.state.sessionId); openDesigner(that.$store.getters.getTeamIdFn, that.ModelsetUpDialog.systemForm.uuid, that.$store.state.sessionId);
// //
that.$refs['systemForm'].resetFields(); that.$refs['systemForm'].resetFields();
} else { } else {
that.$message.error(ro.msg); that.$message.error(ro.msg);
} }
}).catch(error=>{ }).catch(error=>{
console.log(error); console.log(error);
}) })
} }
}).catch(error => { }).catch(error => {
console.log(error); console.log(error);
}) })
} else { } else {
that.$message({message: that.ModelsetUpDialog.systemForm.name+'名称重复,请重新输入!!!', type: 'warning'}); that.$message({message: that.ModelsetUpDialog.systemForm.name+'名称重复,请重新输入!!!', type: 'warning'});
return; return;
} }
}).catch(error=>{ }).catch(error=>{
console.log(error); console.log(error);
}) })
}else { }else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
} }
}); });
@ -736,6 +734,7 @@
awsuiAxios.post(data).then(function (ro) { awsuiAxios.post(data).then(function (ro) {
// id // id
that.ModelsetUpDialog.systemForm.category=category;
that.ModelsetUpDialog.systemForm.repositoryPathData = ro.data.repositoryPathData; that.ModelsetUpDialog.systemForm.repositoryPathData = ro.data.repositoryPathData;
that.ModelsetUpDialog.systemForm.parentId = parentId; that.ModelsetUpDialog.systemForm.parentId = parentId;
that.createModelsetUp(method); that.createModelsetUp(method);
@ -835,7 +834,7 @@
}, },
initTreeHeight() { initTreeHeight() {
this.treeHeight = (parseInt(this.$store.getters.getTopMainHeightFn)) - (this.havingWritePerm || this.havingCreatePerm ? parseInt(this.headerHeight1) : parseInt(this.headerHeight2)) + 'px'; this.treeHeight = (parseInt(this.$store.getters.getTopMainHeightFn)) - (this.havingWritePerm ? parseInt(this.headerHeight1) : parseInt(this.headerHeight2)) + 'px';
}, },
getIsHighSecurity(){ getIsHighSecurity(){
return this.isHighSecurity; return this.isHighSecurity;