初始化应用
This commit is contained in:
parent
eb92b5f341
commit
9d8f9f0e92
8
com.actionsoft.apps.coe.pal/App.vue
Normal file
8
com.actionsoft.apps.coe.pal/App.vue
Normal file
@ -0,0 +1,8 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
83
com.actionsoft.apps.coe.pal/api/commonFun.js
Normal file
83
com.actionsoft.apps.coe.pal/api/commonFun.js
Normal file
@ -0,0 +1,83 @@
|
||||
// 通用js方法文件
|
||||
|
||||
/**
|
||||
* 打开一个新的窗口,post请求,
|
||||
* @param id id 唯一值,body中创建请求表单的id
|
||||
* @param sid sessionId
|
||||
* @param cmd 请求cmd
|
||||
* @param params 参数列表{param1 : value1,param2 : value2}
|
||||
* @param target 不给定则默认_blank新窗口
|
||||
*/
|
||||
const newPageWin = function (id, sid, cmd, params, target) {
|
||||
if (!params) {
|
||||
params = {};
|
||||
}
|
||||
params.cmd = cmd;
|
||||
params.sid = sid;
|
||||
newWin(id, wHref, params, target);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开一个新的窗口,post请求
|
||||
* @param id 唯一值,body中创建请求表单的id
|
||||
* @param url 例如 ./w,./jd
|
||||
* @param params 这个{param1 : value1,param2 : value2}
|
||||
* @param target 打开窗口方式 _blank,_self
|
||||
*/
|
||||
const newWin = function (id, url, params, target) {
|
||||
// 防止反复添加
|
||||
var dom = document.getElementById(id);
|
||||
if(dom) {
|
||||
document.body.removeChild(dom);
|
||||
}
|
||||
var temp_form = document.createElement("form");
|
||||
temp_form.action = url;
|
||||
temp_form.target = target == undefined ? "_blank" : target;
|
||||
temp_form.method = "get";
|
||||
temp_form.style.display = "none";
|
||||
for (var x in params) {
|
||||
var opt = document.createElement("textarea");
|
||||
opt.name = x;
|
||||
opt.value = params[x];
|
||||
temp_form.appendChild(opt);
|
||||
}
|
||||
temp_form.setAttribute('id', id);
|
||||
document.body.appendChild(temp_form);
|
||||
temp_form.submit();
|
||||
}
|
||||
|
||||
// 打开流程模型文件
|
||||
const openDesigner = function(teamId, id, sid) {
|
||||
newPageWin('palDesigner', sid, 'com.actionsoft.apps.coe.pal_pl_repository_designer', {uuid: id, teamId: teamId});
|
||||
}
|
||||
|
||||
// 退出pal
|
||||
const logout = function(sid) {
|
||||
window.location.replace("./w?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal_user_logout");
|
||||
}
|
||||
|
||||
// 类jquery方法
|
||||
const closest = function(node, targetNodeName) {// 类似jquery closest函数,获得匹配选择器的第一个祖先元素,从当前元素开始沿 DOM 树向上
|
||||
let curr = node;
|
||||
while (curr.nodeName != targetNodeName && curr.nodeName != 'BODY') {
|
||||
curr = curr.parentNode;
|
||||
}
|
||||
if (curr.nodeName == targetNodeName) {
|
||||
return curr;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改PAL网页标题
|
||||
* @param newTitle
|
||||
*/
|
||||
const updateHtmlTitle = function(newTitle) {
|
||||
document.getElementsByTagName("title")[0].innerText = newTitle;
|
||||
}
|
||||
|
||||
export {newWin, newPageWin, openDesigner, logout, closest, updateHtmlTitle}
|
||||
|
||||
|
||||
|
||||
8
com.actionsoft.apps.coe.pal/api/validator/validator.css
Normal file
8
com.actionsoft.apps.coe.pal/api/validator/validator.css
Normal file
@ -0,0 +1,8 @@
|
||||
.is-valid {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.is-invalid {
|
||||
color: #F56C6C !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
109
com.actionsoft.apps.coe.pal/api/validator/validator.js
Normal file
109
com.actionsoft.apps.coe.pal/api/validator/validator.js
Normal file
@ -0,0 +1,109 @@
|
||||
import Vue from "vue";
|
||||
import {extend} from "vee-validate";
|
||||
import {configure} from "vee-validate";
|
||||
import {required, email} from "vee-validate/dist/rules";
|
||||
import {ValidationProvider} from "vee-validate";
|
||||
import {ValidationObserver} from "vee-validate";
|
||||
//import {messages} from "vee-validate/dist/locale/en.json";
|
||||
import {setInteractionMode} from "vee-validate";
|
||||
import "./validator.css";
|
||||
// import "./validator.less";
|
||||
|
||||
const nullMsg = {
|
||||
notNull: "必填",
|
||||
imperfect: "{_field_}信息不完善"
|
||||
};
|
||||
//过滤英文格式双引号
|
||||
extend("not_doubleQuotes", {
|
||||
validate: value => {
|
||||
return value.indexOf("\"") < 0;
|
||||
},
|
||||
message: "{_field_}不能包含字符'\"'"
|
||||
});
|
||||
//过滤英文格式冒号
|
||||
extend("not_colon", {
|
||||
validate: value => {
|
||||
return value.indexOf(":") < 0;
|
||||
},
|
||||
message: "{_field_}不能包含字符':'"
|
||||
});
|
||||
//过滤英文格式单引号
|
||||
extend("not_apostrophe", {
|
||||
validate: value => {
|
||||
return value.indexOf("'") < 0;
|
||||
},
|
||||
message: "{_field_}不能包含字符'"
|
||||
});
|
||||
//判断合法包名加合法类名
|
||||
extend("legal_class_name", {
|
||||
validate: value => {
|
||||
let reg = /^[a-zA-Z]+[0-9a-zA-Z_]*(\.[a-zA-Z]+[0-9a-zA-Z_]*)*\.[a-zA-Z]+[0-9a-zA-Z_]*$/g;
|
||||
return reg.test(value);
|
||||
},
|
||||
message: "java类名不合法"
|
||||
});
|
||||
//不允许为空
|
||||
extend("not_null", {
|
||||
validate: value => {
|
||||
return value !== "" && value.length > 0;
|
||||
},
|
||||
message: "{_field_}信息不完善"
|
||||
});
|
||||
//最大长度
|
||||
extend("maxLength", {
|
||||
validate: (value, {max}) => {
|
||||
return value.length <= max;
|
||||
},
|
||||
params: ["max"],
|
||||
message: "不允许超过{max}个字符"
|
||||
});
|
||||
//数值区间
|
||||
extend("minMax", {
|
||||
validate: (value, {min, max}) => {
|
||||
value = parseInt(value);
|
||||
min = parseInt(min);
|
||||
max = parseInt(max);
|
||||
return min <= value && value <= max;
|
||||
},
|
||||
params: ["min", "max"],
|
||||
message: "{_field_}只能在{min}到{max}之间,且包含{min}和{max}"
|
||||
});
|
||||
//只能是数值
|
||||
extend("is_number", {
|
||||
validate: value => {
|
||||
return new RegExp("^[0-9]*$").test(value);
|
||||
},
|
||||
message: "{_field_}只能是正整数"
|
||||
});
|
||||
//JavaScript语法校验
|
||||
extend("javaScript_required", {
|
||||
validate: value => {
|
||||
let reg = /^function[\n\s]+(.+)[\n\s]*\((.*)\)[\n\s]*{((.|\n)*)}[\n\s]*$/g;
|
||||
return reg.test(value);
|
||||
},
|
||||
message: "{_field_}语法错误,请检查"
|
||||
});
|
||||
extend("required", {
|
||||
...required,
|
||||
message: nullMsg.notNull
|
||||
});
|
||||
|
||||
extend("teamName_formatCheck",{
|
||||
validate: value => {
|
||||
let reg = /^[a-zA-Z0-9_\u4e00-\u9fa5]+$/g;
|
||||
return reg.test(value);
|
||||
},
|
||||
message: "只能输入字母、数字、汉字或下划线"
|
||||
})
|
||||
|
||||
configure({
|
||||
classes: {
|
||||
valid: "is-valid ",
|
||||
invalid: "is-invalid",
|
||||
dirty: ["is-dirty", "is-dirty"] // multiple classes per flag!
|
||||
// ...
|
||||
}
|
||||
});
|
||||
Vue.component("ValidationProvider", ValidationProvider);
|
||||
Vue.component("ValidationObserver", ValidationObserver);
|
||||
|
||||
27
com.actionsoft.apps.coe.pal/api/validator/validator.less
Normal file
27
com.actionsoft.apps.coe.pal/api/validator/validator.less
Normal file
@ -0,0 +1,27 @@
|
||||
.is-invalid {
|
||||
display: block;
|
||||
line-height: 1;
|
||||
color: #F56C6C;
|
||||
font-size: 12px;
|
||||
margin-left: 2px;
|
||||
|
||||
&:last-child {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.awsui-input {
|
||||
//color: #F56C6C !important;
|
||||
//border-color: #F56C6C !important;
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.awsui-border-no-right {
|
||||
border-right: 1px solid red !important;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
//color: #F56C6C !important;
|
||||
//border-color: #F56C6C !important;
|
||||
}
|
||||
|
||||
}
|
||||
609
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.css
Normal file
609
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.css
Normal file
File diff suppressed because one or more lines are too long
BIN
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.eot
Normal file
BIN
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.eot
Normal file
Binary file not shown.
467
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.svg
Normal file
467
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 158 KiB |
BIN
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.ttf
Normal file
BIN
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.ttf
Normal file
Binary file not shown.
BIN
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.woff
Normal file
BIN
com.actionsoft.apps.coe.pal/assets/iconfont/iconfont.woff
Normal file
Binary file not shown.
BIN
com.actionsoft.apps.coe.pal/assets/logo.png
Normal file
BIN
com.actionsoft.apps.coe.pal/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
BIN
com.actionsoft.apps.coe.pal/assets/photo.png
Normal file
BIN
com.actionsoft.apps.coe.pal/assets/photo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 350 B |
109
com.actionsoft.apps.coe.pal/awsuiAxios/index.js
Normal file
109
com.actionsoft.apps.coe.pal/awsuiAxios/index.js
Normal file
@ -0,0 +1,109 @@
|
||||
import axios from 'axios'
|
||||
import store from '../store'
|
||||
// 创建axios请求实例
|
||||
// const request = axios.create({
|
||||
// baseURL: axiosBaseUrl,
|
||||
// timeout: 1000,
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json; charset=utf-8'
|
||||
// }
|
||||
// })
|
||||
axios.defaults.baseURL = typeof axiosBaseUrl == "undefined" ? "" : axiosBaseUrl; // 设置跨域代理接口统一的前置地址
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8';
|
||||
|
||||
// 添加请求拦截器
|
||||
axios.interceptors.request.use(function (request) {
|
||||
// 在发送请求之前做些什么
|
||||
if(request.method == 'post'){
|
||||
request.params = {};
|
||||
}
|
||||
return request
|
||||
}, function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
// 添加响应拦截器
|
||||
axios.interceptors.response.use(function (response) {
|
||||
// 只返回数据
|
||||
return response.data
|
||||
}, function (error) {
|
||||
if(error.response == null){
|
||||
throw error;
|
||||
}
|
||||
const status = error.response.status
|
||||
if (status >= 500) {
|
||||
alert('服务繁忙请稍后再试')
|
||||
} else if (status >= 400) {
|
||||
alert(error.response.data.message)
|
||||
}
|
||||
// 对响应错误做点什么
|
||||
console.dir(error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
function _toChangeData(data){
|
||||
let dataArray = [];
|
||||
for(let key in data){
|
||||
dataArray.push(encodeURIComponent(key)+"="+encodeURIComponent(data[key]));
|
||||
}
|
||||
return dataArray.join("&");
|
||||
}
|
||||
|
||||
//可能需要更改,暂时用不到
|
||||
const get = (params) => {
|
||||
|
||||
return axios({
|
||||
method: "get",
|
||||
url: params.url,
|
||||
params: params.params
|
||||
});
|
||||
}
|
||||
|
||||
const post = (params) => {
|
||||
let postConfig = {
|
||||
method: "post",
|
||||
url: params.url,
|
||||
data: params.data
|
||||
}
|
||||
//从vuex中获取sessionId
|
||||
postConfig.data.sid = store.state.sessionId;
|
||||
postConfig.data = _toChangeData(postConfig.data);
|
||||
return axios(postConfig);
|
||||
}
|
||||
|
||||
const aslp = (params) => {
|
||||
// {
|
||||
// portalUrl : "",
|
||||
// authentication : store.state.sessionId,
|
||||
// sourceAppId : "appid",
|
||||
// aslp : "aslp://XXXX",
|
||||
// params :{
|
||||
// aa:1,
|
||||
// bb:2
|
||||
// }
|
||||
// }
|
||||
let datas = {
|
||||
authentication : store.state.sessionId,
|
||||
sourceAppId : params.sourceAppId,
|
||||
aslp : params.aslp,
|
||||
}
|
||||
Object.assign(datas,params.params)
|
||||
let postConfig = {
|
||||
method: "post",
|
||||
url: params.portalUrl,
|
||||
params: datas
|
||||
}
|
||||
postConfig.data = _toChangeData(postConfig.data);
|
||||
return axios(postConfig);
|
||||
}
|
||||
// const delete = (url, data) => request.delete(url, data)
|
||||
// const head = (url, data) => request.head(url, data)
|
||||
// const options = (url, data) => request.options(url, data)
|
||||
// const put = (url, data) => request.put(url, data)
|
||||
// const patch = (url, data) => request.patch(url, data)
|
||||
export default {
|
||||
get,
|
||||
post,
|
||||
aslp
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
说明:小组新建、修改组件
|
||||
@ -0,0 +1,594 @@
|
||||
<template>
|
||||
<validation-observer ref="newTeam">
|
||||
<awsui-layout id="update">
|
||||
<awsui-dialog
|
||||
v-loading="loading"
|
||||
element-loading-text="加载中"
|
||||
:title=title
|
||||
:visible.sync="dialogVisible"
|
||||
:width="width"
|
||||
:height=height
|
||||
:border=false
|
||||
:close-on-click-modal=false
|
||||
:before-close="handleClose">
|
||||
<!--awsui-dialog标签中的内容都可以自行去控制-->
|
||||
<div>
|
||||
<el-steps :active="stepActive" align-center>
|
||||
<el-step title="小组信息"></el-step>
|
||||
<el-step title="小组管理员"></el-step>
|
||||
<el-step title="小组权限"></el-step>
|
||||
</el-steps>
|
||||
<div style="width: 524px;height: 260px;border: 1px solid #e9e9e9;padding: 10px 10px 10px 15px;">
|
||||
<div v-if="stepActive == 1" style="position: relative;padding: 12px 0;">
|
||||
<awsui-form ref="infoForm" :model="baseInfo.form" :rules="baseInfo.rules" label-width="100px" label-position="top">
|
||||
<div v-if="isloaded">
|
||||
<awsui-icon-picker class="icon-team-div" :defaultOptions="iconPickerOptions" :value="{icon:baseInfo.form.teamLogo.code, color:baseInfo.form.teamLogo.color}" @change="changeIcon"></awsui-icon-picker>
|
||||
</div>
|
||||
<awsui-row>
|
||||
<awsui-col :span="18">
|
||||
<awsui-form-item label="名称" required>
|
||||
<validation-provider rules="required|teamName_formatCheck|maxLength:36"
|
||||
v-slot="{classes,errors}">
|
||||
<awsui-input placeholder="请输入名称" v-model="baseInfo.form.teamName"></awsui-input>
|
||||
<div :class="classes">{{ errors[0] }}</div>
|
||||
</validation-provider>
|
||||
</awsui-form-item>
|
||||
</awsui-col>
|
||||
</awsui-row>
|
||||
<awsui-row>
|
||||
<awsui-col :span="18">
|
||||
<awsui-form-item label="工作网络" required>
|
||||
<validation-provider rules="required|teamName_formatCheck|maxLength:36"
|
||||
v-slot="{classes,errors}">
|
||||
<awsui-select
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请选择/输入工作网络"
|
||||
v-model="baseInfo.form.category"
|
||||
:options="baseInfo.form.categoryOpts"
|
||||
@change="changeCategory"
|
||||
>
|
||||
</awsui-select>
|
||||
<div :class="classes">{{ errors[0] }}</div>
|
||||
</validation-provider>
|
||||
</awsui-form-item>
|
||||
</awsui-col>
|
||||
</awsui-row>
|
||||
<awsui-row>
|
||||
<awsui-col :span="24">
|
||||
<awsui-form-item label="简介">
|
||||
<validation-provider rules="maxLength:255"
|
||||
v-slot="{classes,errors}">
|
||||
<awsui-input v-model="baseInfo.form.teamDesc" type="textarea" placeholder="请输入简介"></awsui-input>
|
||||
<div :class="classes">{{ errors[0] }}</div>
|
||||
</validation-provider>
|
||||
</awsui-form-item>
|
||||
</awsui-col>
|
||||
</awsui-row>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<div v-if="stepActive == 2" v-loading="adminUserInfo.loading">
|
||||
<div style="height: 270px;overflow:auto;">
|
||||
<el-tree
|
||||
key="userTree"
|
||||
ref="userTree"
|
||||
:props="adminUserInfo.treeProps"
|
||||
:default-checked-keys="adminUserInfo.value"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
empty-text=""
|
||||
@node-click="openUserNode"
|
||||
@node-expand="expandUserNode"
|
||||
@node-collapse="closeUserNode"
|
||||
@check-change="checkedUserNode"
|
||||
check-strictly
|
||||
:show-checkbox=true
|
||||
node-key="id"
|
||||
lazy
|
||||
:load="loadUserNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="stepActive == 3" v-loading="permInfo.loading">
|
||||
<el-select
|
||||
style="width: 100%;"
|
||||
v-model="permInfo.ws.value"
|
||||
filterable
|
||||
default-first-option
|
||||
size="small"
|
||||
placeholder="请选择资产库"
|
||||
@change="changeWs">
|
||||
<el-option
|
||||
v-for="item in permInfo.ws.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div style="height: 238px;overflow: auto;">
|
||||
<el-tree v-if="permInfo.ws.value != ''"
|
||||
key="repositoryTree"
|
||||
ref="repositoryTree"
|
||||
:props="permInfo.tree.props"
|
||||
:default-checked-keys="permInfo.tree.value"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
empty-text=""
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
@check-change="checkedNode"
|
||||
check-strictly
|
||||
show-checkbox
|
||||
node-key="versionId"
|
||||
lazy
|
||||
:load="loadNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.data.name}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button v-show="stepActive == 2 || stepActive == 3" class="button-general-color-reverse" @click="function(){stepActive--}">上一步</awsui-button>
|
||||
<awsui-button v-show="stepActive == 1 || stepActive == 2" class="button-general-color" type="primary" @click="next">下一步</awsui-button>
|
||||
<awsui-button v-show="stepActive == 3" class="button-general-color" type="primary" @click="submit">确定</awsui-button>
|
||||
</span>
|
||||
</awsui-dialog>
|
||||
</awsui-layout>
|
||||
</validation-observer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios"
|
||||
export default {
|
||||
name: "CooperationUpdate",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
teamId: {// 小组ID
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
title: {// 标题
|
||||
type: String,
|
||||
default: '新建'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
width: '600px',
|
||||
height: '350px',
|
||||
|
||||
addressType: 'user',
|
||||
baseInfo: {// 基本信息
|
||||
form: {
|
||||
teamName: '',
|
||||
category: '',
|
||||
categoryOpts: [],
|
||||
teamDesc: '',
|
||||
teamLogo: {
|
||||
color: '',
|
||||
code: ''
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
category: [
|
||||
{ required: true, message: '[工作网络]不允许为空', trigger: 'blur' },
|
||||
],
|
||||
teamName: [
|
||||
{ required: true, message: '[名称]不允许为空', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
|
||||
},
|
||||
adminUserInfo: {// 管理员信息
|
||||
value: [],
|
||||
treeProps: {
|
||||
label: 'name',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
loading: false,
|
||||
},
|
||||
permInfo: {// 权限信息
|
||||
loading: false,
|
||||
ws: {
|
||||
value: '',
|
||||
options: []
|
||||
},
|
||||
tree: {
|
||||
props: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
value: []
|
||||
}
|
||||
},
|
||||
stepActive: 1,
|
||||
isloaded: false,
|
||||
iconPickerOptions: {
|
||||
type: "background", //必传,type为"background"时,改变背景颜色,图标颜色固定,type为"icon"时改变图标颜色,背景颜色固定
|
||||
fatherWidth: 70, //非必传,展示区域宽高,type为"background"时代表外层圆形直径,type为"icon"时代表外层正方形宽高,如不传分别默认80px和30px
|
||||
iconFontSize: 52, //非必传,展示区域iconfont字体大小,如不传分别默认30px和16px
|
||||
colorList: ["#dc4f39", "#ff9421", "#009b52", "#3383da", "#009688", "#6600d5", "#0b0e7b", "#666666", "#e6e8ea"], //必传,颜色可选项数组
|
||||
iconfontArray: window.iconfontArray, //必传,iconfont可选项数组
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
changeCategory(val) {// 变更分类
|
||||
this.baseInfo.form.category = val;
|
||||
},
|
||||
initData() {// 初始化查询
|
||||
const that = this;
|
||||
// axios查询,新建返回分类,资产库列表,修改返回所有信息
|
||||
that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_query',
|
||||
teamId: that.teamId
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
const data = ro.data;
|
||||
that.baseInfo.form.teamName = data.teamName;
|
||||
that.baseInfo.form.category = data.category;
|
||||
that.baseInfo.form.categoryOpts = data.categoryArr;
|
||||
that.baseInfo.form.teamDesc = data.teamDesc;
|
||||
that.baseInfo.form.teamLogo = data.teamLogo;
|
||||
that.isloaded = true;
|
||||
that.adminUserInfo.value = data.admins;
|
||||
that.permInfo.ws.value = data.wsId;
|
||||
that.permInfo.ws.options = data.wsArr;
|
||||
that.permInfo.tree.value = data.repositorys;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
that.loading = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
},
|
||||
next() {
|
||||
const that = this;
|
||||
if (this.stepActive == 1) {
|
||||
this.$refs.newTeam.validate().then(valid => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
this.stepActive++;
|
||||
});
|
||||
} else if (this.stepActive == 2) {
|
||||
if (that.adminUserInfo.value.length == 0) {
|
||||
that.$message('未选择任何管理员,保存时默认' + (that.teamId == '' ? '创建' : '修改') + '人为管理员');
|
||||
}
|
||||
this.stepActive++;
|
||||
}
|
||||
},
|
||||
clearAllData() {// 清空数据
|
||||
const that = this;
|
||||
that.baseInfo.form.teamName = '';
|
||||
that.baseInfo.form.category = '';
|
||||
that.baseInfo.form.teamDesc = '';
|
||||
that.baseInfo.form.teamLogo = {};
|
||||
that.adminUserInfo.value = [];
|
||||
that.permInfo.ws.value = '';
|
||||
that.permInfo.ws.options = [];
|
||||
that.permInfo.tree.value = [];
|
||||
that.stepActive = 1;
|
||||
that.isloaded = false;
|
||||
},
|
||||
handleClose(done) {
|
||||
this.closeDlalog('cancel');
|
||||
done();
|
||||
},
|
||||
cancel() {
|
||||
this.closeDlalog('cancel');
|
||||
},
|
||||
submit() {
|
||||
const wsId = this.permInfo.ws.value;
|
||||
if (wsId == '') {
|
||||
this.$message({message: '请先创建资产库再进行小组创建',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
this.closeDlalog('save');
|
||||
},
|
||||
closeDlalog(type) {// 取消/确定之后的关闭
|
||||
const that = this;
|
||||
if (type == 'save') {
|
||||
const teamId = that.teamId;
|
||||
const teamName = that.baseInfo.form.teamName;
|
||||
const category = that.baseInfo.form.category;
|
||||
const teamDesc = that.baseInfo.form.teamDesc;
|
||||
const teamLogo = that.baseInfo.form.teamLogo;
|
||||
const admins = that.adminUserInfo.value;
|
||||
const wsId = that.permInfo.ws.value;
|
||||
const repositorys = that.permInfo.tree.value;
|
||||
const data = {
|
||||
teamId: teamId,
|
||||
teamName: teamName,
|
||||
category: category,
|
||||
teamDesc: teamDesc,
|
||||
teamLogo: teamLogo,
|
||||
admins: admins,
|
||||
wsId: wsId,
|
||||
repositorys: repositorys
|
||||
};
|
||||
// 保存
|
||||
that.loading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_save',
|
||||
data: JSON.stringify(data)
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.loading = false;
|
||||
if (ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.$emit('getResult', 'ok');
|
||||
that.dialogVisible = false;
|
||||
// 清空所有数据
|
||||
that.clearAllData();
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
} else {
|
||||
that.$emit('cancel');
|
||||
that.dialogVisible = false;
|
||||
// 清空所有数据
|
||||
that.clearAllData();
|
||||
}
|
||||
},
|
||||
/**********设置管理员*************/
|
||||
openUserNode(obj, node, tree) {// 打开一只模型文件
|
||||
|
||||
},
|
||||
loadUserNode(node, resolve) {// `动态`加载
|
||||
const that = this;
|
||||
that.adminUserInfo.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal.cooperation_pal_user_tree_subjson',
|
||||
pid: ''
|
||||
}
|
||||
};
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.parentType = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
data.data.parentType = node.data.type;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
// 设置是否可选中
|
||||
const isDept = that.addressType.indexOf('dept') > -1;
|
||||
const isUser = that.addressType.indexOf('user') > -1;
|
||||
const isRole = that.addressType.indexOf('role') > -1;
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
const curr = ro.data[i];
|
||||
if (curr.type == 'company') {
|
||||
curr.disabled = true;
|
||||
} else {
|
||||
if (isDept && curr.type == 'dept') curr.disabled = false;
|
||||
if (!isDept && curr.type == 'dept') curr.disabled = true;
|
||||
if (isUser && curr.type == 'user') curr.disabled = false;
|
||||
if (!isUser && curr.type == 'user') curr.disabled = true;
|
||||
if (curr.type == 'user') {
|
||||
curr.leaf = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
resolve(ro.data);
|
||||
that.adminUserInfo.loading = false;
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.userTree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandUserNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeUserNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
checkedUserNode(data, checked, subChecked) {// 节点选中事件
|
||||
// 获取所有子节点
|
||||
const that = this;
|
||||
const currUserId = data.id;
|
||||
if (checked) {// 选中
|
||||
const userIds = that.adminUserInfo.value;
|
||||
if (userIds.indexOf(currUserId) == -1) {
|
||||
userIds.push(currUserId);
|
||||
}
|
||||
} else {// 取消选中
|
||||
const userIds = that.adminUserInfo.value;
|
||||
const tempArr = [];
|
||||
for (let i = 0; i < userIds.length; i++) {
|
||||
if (userIds[i] != currUserId) {
|
||||
tempArr.push(userIds[i]);
|
||||
}
|
||||
}
|
||||
that.adminUserInfo.value = tempArr;
|
||||
}
|
||||
},
|
||||
/************资产库权限设置**************/
|
||||
changeWs(targetWsId) {// 变更资产库
|
||||
const that = this;
|
||||
that.permInfo.ws.value = '';
|
||||
that.permInfo.tree.value;
|
||||
that.$nextTick(function () {
|
||||
that.permInfo.ws.value = targetWsId;
|
||||
})
|
||||
},
|
||||
openNode(obj, node, tree) {// 点击数
|
||||
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const that = this;
|
||||
that.permInfo.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
}
|
||||
};
|
||||
data.data.wsId = that.permInfo.ws.value;
|
||||
data.data.teamId = '';
|
||||
data.data.cmd = 'com.actionsoft.apps.coe.pal_processlevel_tree_data';
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
// 根节点设置只读
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
if (ro.data[i].id.length < 36) {
|
||||
ro.data[i].disabled = true;
|
||||
}
|
||||
}
|
||||
resolve(ro.data);
|
||||
that.permInfo.loading = false;
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.repositoryTree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
checkedNode(data, checked, subChecked) {// 节点选中事件
|
||||
// 获取所有子节点
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_repository_data_query',
|
||||
wsId: that.permInfo.ws.value,
|
||||
pid: data.id,
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
const childVerIds = ro.data;
|
||||
const currVerId = data.versionId;
|
||||
if (checked) {// 选中
|
||||
const checkedVerIds = that.permInfo.tree.value;
|
||||
if (checkedVerIds.indexOf(currVerId) == -1) {
|
||||
checkedVerIds.push(currVerId);
|
||||
}
|
||||
for (let i = 0; i < childVerIds.length; i++) {
|
||||
if (checkedVerIds.indexOf(childVerIds[i]) == -1) {
|
||||
checkedVerIds.push(childVerIds[i]);
|
||||
}
|
||||
}
|
||||
that.$refs.repositoryTree.setCheckedKeys(checkedVerIds);
|
||||
} else {// 取消选中
|
||||
const checkedVerIds = that.permInfo.tree.value;
|
||||
const tempArr = [];
|
||||
for (let i = 0; i < checkedVerIds.length; i++) {
|
||||
if (checkedVerIds[i] != currVerId && childVerIds.indexOf(checkedVerIds[i]) == -1) {
|
||||
tempArr.push(checkedVerIds[i]);
|
||||
}
|
||||
}
|
||||
that.permInfo.tree.value = tempArr;
|
||||
that.$refs.repositoryTree.setCheckedKeys([]);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
changeIcon(icon) {
|
||||
this.baseInfo.form.teamLogo.code = icon.icon;
|
||||
this.baseInfo.form.teamLogo.color = icon.color;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
if (val) {// 打开
|
||||
this.initData();
|
||||
} else {// 关闭
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#update >>> .el-step__title {
|
||||
font-size: 12px;
|
||||
}
|
||||
#update >>> .awsui-icon-picker-box1 {
|
||||
border-radius: 15%;
|
||||
}
|
||||
.icon-team-div {
|
||||
height: 70px;
|
||||
width: 70px;
|
||||
line-height: 70px;
|
||||
display: inline-block;
|
||||
position:absolute;
|
||||
z-index: 2;
|
||||
right: 30px;
|
||||
top: 50px;
|
||||
}
|
||||
.icon-team {
|
||||
color: white;
|
||||
font-size: 52px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,6 @@
|
||||
import CooperationUpdate from "./component";
|
||||
CooperationUpdate.install = function(Vue) {
|
||||
Vue.component(CooperationUpdate.name, CooperationUpdate);
|
||||
}
|
||||
|
||||
export default CooperationUpdate;
|
||||
@ -0,0 +1 @@
|
||||
说明:调用aws平台的部门、人员、角色组件
|
||||
@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-dialog
|
||||
id="bpmOrgAddress"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
:destroy-on-close=true
|
||||
:width="width"
|
||||
:modal-append-to-body=false
|
||||
:append-to-body=true
|
||||
:close-on-click-modal=false
|
||||
:before-close="handleClose">
|
||||
<template v-if="refresh">
|
||||
<div
|
||||
v-loading="loading"
|
||||
element-loading-text="拼命加载中">
|
||||
<!-- <el-autocomplete-->
|
||||
<!-- v-model="treeSearchKey"-->
|
||||
<!-- size="small"-->
|
||||
<!-- :fetch-suggestions="treeSearch"-->
|
||||
<!-- @select="treeSearchSelect"-->
|
||||
<!-- suffix-icon="el-icon-search"-->
|
||||
<!-- placeholder="快速查询"-->
|
||||
<!-- :trigger-on-focus=false-->
|
||||
<!-- style="width:100%;">-->
|
||||
<!-- <template slot-scope="{ item }">-->
|
||||
<!-- <el-tooltip class="item" placement="bottom">-->
|
||||
<!-- <div slot="content">{{item.pathName}}</div>-->
|
||||
<!-- <span>{{ item.name }}</span>-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-autocomplete>-->
|
||||
<div style="height: 300px;overflow: auto;border: 1px solid #f2f2f2;">
|
||||
<div class="tree">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:props="treeProps"
|
||||
:show-checkbox="multiple"
|
||||
:expand-on-click-node=false
|
||||
:check-strictly=true
|
||||
:highlight-current=true
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
node-key="id"
|
||||
lazy
|
||||
:load="loadNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="submit">确定</awsui-button>
|
||||
<awsui-button @click="cancel">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "BpmOrgAddress",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
addressType: {// 地址簿类型,默认部门地址簿,可进行部门department、用户user、角色role组合,逗号分隔
|
||||
type: String,
|
||||
default: 'department'
|
||||
},
|
||||
multiple: {// 是否多选
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rootDeptId: {// 默认根部门,为空则默认当前人所属单位为根节点
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
highSecurityFilter: {// 地址簿过滤三员用户类型 三员开启模式并且地址簿类型包含用户user时有效,系统管理员sysAdmin、安全保密员secAdmin、安全审计员auditor,逗号分割
|
||||
type: String,
|
||||
default: ''// 例如值为sysAdmin,auditor,则开启三员之后该地址簿不显示系统管理员和安全审计员
|
||||
},
|
||||
title: {// 标题
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
selected: {// 默认选中,比如{'department':[],'user':[],'role':[],'position':[]},不区分单多选,单选只取第一个值
|
||||
type: Object,
|
||||
default: function () {
|
||||
return {'department':[],'user':[],'role':[],'position':[]}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
refresh: false,
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
searchKey: '',
|
||||
treeSearchKey: '',
|
||||
timeout: null,
|
||||
pid: '',
|
||||
width: '500px',
|
||||
treeProps: {
|
||||
label: 'name',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.closeDlalog('cancel');
|
||||
done();
|
||||
},
|
||||
cancel() {
|
||||
this.closeDlalog('cancel');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
submit() {
|
||||
this.closeDlalog('save');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
closeDlalog(type) {// 取消/确定之后的关闭
|
||||
if (type == 'save') {
|
||||
let result = [];
|
||||
if (this.multiple) {// 多选
|
||||
result = this.$refs.tree.getCheckedNodes();
|
||||
} else {// 单选
|
||||
const node = this.$refs.tree.getCurrentNode();
|
||||
if (node != null) {
|
||||
result.push(node);
|
||||
}
|
||||
}
|
||||
this.$emit('getResult', JSON.parse(JSON.stringify(result)));
|
||||
} else {
|
||||
this.$emit('cancel');
|
||||
}
|
||||
// 清空所有数据
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
// console.log(data);
|
||||
},
|
||||
openNode(obj, node, tree) {// 打开一只模型文件
|
||||
|
||||
},
|
||||
treeSearchSelect(item) {
|
||||
this.queryTreeByIdAndPath(item.id, item.path);
|
||||
},
|
||||
treeSearch(key, cb) {
|
||||
const that = this;
|
||||
if (key != undefined && key.trim() != '') {
|
||||
// that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_search',
|
||||
addressType: that.addressType,
|
||||
rootDeptId: that.rootDeptId,
|
||||
name: key
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
if (ro.data.length > 0) {
|
||||
clearTimeout(that.timeout);
|
||||
that.timeout = setTimeout(() => {
|
||||
cb(ro.data);
|
||||
}, 3000 * Math.random());
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
},
|
||||
queryTreeByIdAndPath(id, path) {// 定位展开某节点
|
||||
const that= this;
|
||||
const tree = that.$refs.tree;
|
||||
// 分隔字符串
|
||||
const pathArr = path.split(',');
|
||||
let index = 1;
|
||||
for (let i = 0; i < pathArr.length; i++) {// 依次展开
|
||||
if (i > 0) {
|
||||
if (tree.getNode(pathArr[i-1]) != null) {
|
||||
setTimeout(that._expandNode(tree, pathArr[i-1]), index * 300);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(function() {
|
||||
if (tree.getNode(id) != null) {
|
||||
tree.setCurrentKey(id);
|
||||
}
|
||||
}, index * 300);
|
||||
},
|
||||
_expandNode(tree, id) {
|
||||
return function() {
|
||||
tree.getNode(id).expand();
|
||||
}
|
||||
},
|
||||
loadNode(node, resolve) {// `动态`加载
|
||||
const that = this;
|
||||
that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_bpm_org_address_component_subjson',
|
||||
addressType: that.addressType,
|
||||
pid: '',
|
||||
highSecurityFilter: that.highSecurityFilter
|
||||
}
|
||||
};
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = that.pid;
|
||||
data.data.parentType = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
data.data.parentType = node.data.type;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
// 设置是否可选中
|
||||
if (that.multiple) {// 多选
|
||||
const isDept = that.addressType.indexOf('department') > -1;
|
||||
const isUser = that.addressType.indexOf('user') > -1;
|
||||
const isRole = that.addressType.indexOf('role') > -1;
|
||||
const isPosition = that.addressType.indexOf('position') > -1;
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
const curr = ro.data[i];
|
||||
if (curr.type == 'company' || curr.type == 'roleRoot' || curr.type == 'roleGroup' || curr.type == 'positionRoot' || curr.type == 'positionGroup') {
|
||||
curr.disabled = true;
|
||||
} else {
|
||||
if (isDept && curr.type == 'department') curr.disabled = false;
|
||||
if (!isDept && curr.type == 'department') curr.disabled = true;
|
||||
if (isUser && curr.type == 'user') curr.disabled = false;
|
||||
if (!isUser && curr.type == 'user') curr.disabled = true;
|
||||
if (isRole && curr.type == 'role') curr.disabled = false;
|
||||
if (!isRole && curr.type == 'role') curr.disabled = true;
|
||||
if (isPosition && curr.type == 'position') curr.disabled = false;
|
||||
if (!isPosition && curr.type == 'position') curr.disabled = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
resolve(ro.data);
|
||||
that.loading = false;
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.tree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
refreshNode(id) {// 刷新当前选中节点的子节点,即关闭当前节点后重新打开,会执行loadNode进行自动加载
|
||||
if (id == undefined) {// 未指定节点,默认刷新当前选中
|
||||
const nodeData = this.$refs.tree.getCurrentNode();
|
||||
if (nodeData != null) {
|
||||
if (this.$refs.tree.store.nodesMap[nodeData.id] != undefined) {
|
||||
this.$refs.tree.store.nodesMap[nodeData.id].expanded = false;
|
||||
}
|
||||
const node = this.$refs.tree.getNode(nodeData.id);
|
||||
this.closeNode(null, node, null);
|
||||
node.expand();
|
||||
}
|
||||
} else {// 指定刷新某节点
|
||||
if (this.$refs.tree.store.nodesMap[id] != undefined) {
|
||||
this.$refs.tree.store.nodesMap[id].expanded = false;
|
||||
}
|
||||
const node = this.$refs.tree.getNode(id);
|
||||
if (node != null) {
|
||||
this.closeNode(null, node, null);
|
||||
node.expand();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
if (val) {// 打开
|
||||
if (this.addressType.indexOf('department') > 0) {
|
||||
this.pid = this.rootDeptId;
|
||||
}
|
||||
this.refresh = true;
|
||||
} else {// 关闭
|
||||
this.refresh = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#bpmOrgAddress >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
#bpmOrgAddress >>> .el-input__inner {
|
||||
border-radius: 0px;
|
||||
}
|
||||
#bpmOrgAddress >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #F5F7FA;
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#bpmOrgAddress >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .awsui-iconfont {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
/*#bpmOrgAddress >>> .el-tree .el-tree-node>.el-tree-node__children{*/
|
||||
/* overflow: visible;*/
|
||||
/*}*/
|
||||
.tree{
|
||||
overflow: auto;
|
||||
width:458px;
|
||||
height: 300px;
|
||||
}
|
||||
#bpmOrgAddress >>> .el-tree {
|
||||
min-width: 100%;
|
||||
display:inline-block !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,7 @@
|
||||
import BPMOrgAddress from './component'
|
||||
|
||||
BPMOrgAddress.install = function(Vue) {
|
||||
Vue.component(BPMOrgAddress.name, BPMOrgAddress);
|
||||
}
|
||||
|
||||
export default BPMOrgAddress;
|
||||
@ -0,0 +1 @@
|
||||
说明:PAL模型树组件
|
||||
@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-dialog
|
||||
id="palRepositoryTree"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
:destroy-on-close=true
|
||||
:width="width"
|
||||
:modal-append-to-body=false
|
||||
:append-to-body=true
|
||||
:close-on-click-modal=false
|
||||
:before-close="handleClose">
|
||||
<template v-if="refresh">
|
||||
<div
|
||||
v-loading="loading"
|
||||
element-loading-text="拼命加载中">
|
||||
<el-autocomplete
|
||||
v-model="treeSearchKey"
|
||||
size="small"
|
||||
:fetch-suggestions="treeSearch"
|
||||
@select="treeSearchSelect"
|
||||
suffix-icon="el-icon-search"
|
||||
placeholder="快速查询"
|
||||
:trigger-on-focus=false
|
||||
style="width:100%;"
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<el-tooltip class="item" placement="bottom-start">
|
||||
<div slot="content">{{item.pathName}}</div>
|
||||
<span>{{ item.name }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
<div style="height: 300px;overflow: auto;border: 1px solid #f2f2f2;">
|
||||
<div class="tree">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:props="treeProps"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
:show-checkbox=multiple
|
||||
node-key="id"
|
||||
lazy
|
||||
:load="loadNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="submit">确定</awsui-button>
|
||||
<awsui-button @click="cancel">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "PALRepositoryTree",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
wsId: {// 资产库ID
|
||||
type: String,
|
||||
default: '',
|
||||
required: true
|
||||
},
|
||||
teamId: {// 小组ID
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
categorys: {// 建模大类,多个则逗号分隔
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
rootId: {// 父节点,为空则查询根节点
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
multiple: {// 是否多选
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {// 标题
|
||||
type: String,
|
||||
default: '请选择'
|
||||
},
|
||||
// width: {// 宽度
|
||||
// type: String,
|
||||
// default: '500px'
|
||||
// },
|
||||
selected: {// 默认选中,比如[],不区分单多选,单选只取第一个值
|
||||
type: Array,
|
||||
default: function () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
refresh: false,
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
searchKey: '',
|
||||
treeSearchKey: '',
|
||||
timeout: null,
|
||||
pid: '',
|
||||
width: '500px',
|
||||
treeProps: {
|
||||
label: 'name',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.closeDlalog('cancel');
|
||||
done();
|
||||
},
|
||||
cancel() {
|
||||
this.closeDlalog('cancel');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
submit() {
|
||||
this.closeDlalog('save');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
closeDlalog(type) {// 取消/确定之后的关闭
|
||||
if (type == 'save') {
|
||||
let result = [];
|
||||
if (this.checkbox) {// 多选
|
||||
result = this.$refs.tree.getCheckedNodes();
|
||||
} else {// 单选
|
||||
const node = this.$refs.tree.getCurrentNode();
|
||||
if (node != null) {
|
||||
result.push(node);
|
||||
}
|
||||
}
|
||||
this.$emit('getResult', result);
|
||||
} else {
|
||||
this.$emit('cancel');
|
||||
}
|
||||
// 清空所有数据
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
console.log(data);
|
||||
},
|
||||
openNode(obj, node, tree) {// 打开一只模型文件
|
||||
|
||||
},
|
||||
treeSearchSelect(item) {
|
||||
this.queryTreeByIdAndPath(item.id, item.versionId, item.path);
|
||||
},
|
||||
treeSearch(key, cb) {
|
||||
const that = this;
|
||||
if (key != undefined && key.trim() != '') {
|
||||
// that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_search',
|
||||
wsId: that.wsId,
|
||||
teamId: that.teamId,
|
||||
categorys: that.categorys,
|
||||
rootId: that.rootId,
|
||||
name: key
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
if (ro.data.length > 0) {
|
||||
clearTimeout(that.timeout);
|
||||
that.timeout = setTimeout(() => {
|
||||
cb(ro.data);
|
||||
}, 3000 * Math.random());
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
},
|
||||
queryTreeByIdAndPath(id, versionId, path) {// 定位展开某节点
|
||||
const that= this;
|
||||
const tree = that.$refs.tree;
|
||||
// 分隔字符串
|
||||
const pathArr = path.split(',');
|
||||
let index = 1;
|
||||
for (let i = 0; i < pathArr.length; i++) {// 依次展开
|
||||
if (i > 0) {
|
||||
if (tree.getNode(pathArr[i-1]) != null) {
|
||||
setTimeout(that._expandNode(tree, pathArr[i-1]), index * 300);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(function() {
|
||||
if (tree.getNode(versionId) != null) {
|
||||
tree.setCurrentKey(versionId);
|
||||
}
|
||||
}, index * 300);
|
||||
},
|
||||
_expandNode(tree, versionId) {
|
||||
return function() {
|
||||
tree.getNode(versionId).expand();
|
||||
}
|
||||
},
|
||||
loadNode(node, resolve) {// `动态`加载
|
||||
const that = this;
|
||||
that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_subjson',
|
||||
wsId: that.wsId,
|
||||
teamId: that.teamId,
|
||||
categorys: that.categorys,
|
||||
pid: ''
|
||||
}
|
||||
};
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = that.pid;
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
resolve(ro.data);
|
||||
that.loading = false;
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.tree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
refreshNode(id) {// 刷新当前选中节点的子节点,即关闭当前节点后重新打开,会执行loadNode进行自动加载
|
||||
if (id == undefined) {// 未指定节点,默认刷新当前选中
|
||||
const nodeData = this.$refs.tree.getCurrentNode();
|
||||
if (nodeData != null) {
|
||||
if (this.$refs.tree.store.nodesMap[nodeData.id] != undefined) {
|
||||
this.$refs.tree.store.nodesMap[nodeData.id].expanded = false;
|
||||
}
|
||||
const node = this.$refs.tree.getNode(nodeData.id);
|
||||
this.closeNode(null, node, null);
|
||||
node.expand();
|
||||
}
|
||||
} else {// 指定刷新某节点
|
||||
if (this.$refs.tree.store.nodesMap[id] != undefined) {
|
||||
this.$refs.tree.store.nodesMap[id].expanded = false;
|
||||
}
|
||||
const node = this.$refs.tree.getNode(id);
|
||||
if (node != null) {
|
||||
this.closeNode(null, node, null);
|
||||
node.expand();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
if (val) {// 打开
|
||||
this.pid = this.rootId;
|
||||
this.refresh = true;
|
||||
} else {// 关闭
|
||||
this.refresh = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#palRepositoryTree >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
#palRepositoryTree >>> .el-input__inner {
|
||||
border-radius: 0px;
|
||||
}
|
||||
#palRepositoryTree >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #F5F7FA;
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#palRepositoryTree >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .awsui-iconfont {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
/*#palRepositoryTree >>> .el-tree .el-tree-node>.el-tree-node__children{*/
|
||||
/* overflow: visible;*/
|
||||
/*}*/
|
||||
.tree{
|
||||
overflow: auto;
|
||||
width:458px;
|
||||
height: 300px;
|
||||
}
|
||||
#palRepositoryTree >>> .el-tree {
|
||||
min-width: 100%;
|
||||
display:inline-block !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,7 @@
|
||||
import PALRepositoryTree from './component'
|
||||
|
||||
PALRepositoryTree.install = function(Vue) {
|
||||
Vue.component(PALRepositoryTree.name, PALRepositoryTree);
|
||||
}
|
||||
|
||||
export default PALRepositoryTree;
|
||||
@ -0,0 +1 @@
|
||||
说明:调用pal的组织、数据、控制等关联属性,包括前后置流程
|
||||
@ -0,0 +1,975 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-dialog
|
||||
id="palRelationAddress"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="800px"
|
||||
:modal-append-to-body=false
|
||||
:destroy-on-close=true
|
||||
:append-to-body=true
|
||||
:close-on-click-modal=false
|
||||
:before-close="handleClose">
|
||||
<template>
|
||||
<div v-if="dialogVisible" style="width:100%; height: 400px; border:1px solid #f2f2f2;">
|
||||
<div class="div-left" :style="{'width': (relationType == 'file' ? '373px' : '249px')}">
|
||||
<div style="width: 100%;height: 32px;">
|
||||
<el-autocomplete
|
||||
v-model="treeSearchKey"
|
||||
size="small"
|
||||
:fetch-suggestions="treeSearch"
|
||||
@select="treeSearchSelect"
|
||||
suffix-icon="el-icon-search"
|
||||
placeholder="快速查询"
|
||||
:trigger-on-focus=false
|
||||
:style="{'width': (relationType == 'file' ? '373px' : '249px')}"
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<el-tooltip class="item" placement="bottom-start">
|
||||
<div slot="content">{{item.pathName}}</div>
|
||||
<span>{{ item.name }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</div>
|
||||
<div>
|
||||
<div style="height: 368px;overflow: auto;">
|
||||
<div style="margin: 0px;">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
empty-text="无数据"
|
||||
:expand-on-click-node=false
|
||||
:props="treeProps"
|
||||
:show-checkbox="isTreeCheckbox"
|
||||
:check-strictly=true
|
||||
:highlight-current=true
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
@check-change="handleNodeCheckChange"
|
||||
node-key="id"
|
||||
lazy
|
||||
:load="loadNode"
|
||||
@node-click="handleNodeClick">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="relationType != 'file'" class="div-middle">
|
||||
<div style="width: 100%;height: 32px;">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="快速查询"
|
||||
suffix-icon="el-icon-search"
|
||||
v-model="shapeSearchKey"
|
||||
@input="shapeSearch"
|
||||
width="249px">
|
||||
</el-input>
|
||||
</div>
|
||||
<div>
|
||||
<div style="height: 368px;overflow: auto;">
|
||||
<div style="margin: 0px;">
|
||||
<template v-if="multiple">
|
||||
<el-checkbox-group style="margin: 5px 0px 5px 5px;" v-model="shapeChecked" @change="handleChangeCheckShape">
|
||||
<el-checkbox class="checkbox-item" v-for="item in shapeData" :label="item.id" :key="item.id" :disabled="item.isDisabled">{{item.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-radio-group style="margin: 5px 0px 5px 5px;" v-model="shapeSelected" @change="handleChangeRadioShape">
|
||||
<el-radio class="redio-item" v-for="item in shapeData" :label="item.id" :key="item.id" :disabled="item.isDisabled">{{item.name}}</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-right" :style="{'width': (relationType == 'file' ? '373px' : '249px')}">
|
||||
<div style="height: 100%;">
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:show-header=false
|
||||
empty-text="请在左侧选择数据"
|
||||
size="mini"
|
||||
height="400px"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="操作"
|
||||
width="40">
|
||||
<template slot-scope="scope">
|
||||
<div class="icon-delete-display">
|
||||
<i class="iconfont" style="cursor: pointer;" @click="remove(scope.row.id)"></i>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="submit">确定</awsui-button>
|
||||
<awsui-button @click="cancel">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "PalRelationAddress",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
relationType: {// 关联组件类型,shape/file,关联形状/文件,默认形状
|
||||
type: String,
|
||||
default: 'shape'
|
||||
},
|
||||
multiple: {// 选值类型,单选single,多选multiple,默认单选
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {// 标题
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
selectFileId: {// 选择的文件id,多个以逗号分隔
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
selectShapeId: {// 选择的形状id,多个以逗号分隔
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
wsId: {// 资产库ID
|
||||
type: String,
|
||||
default: '',
|
||||
required: true
|
||||
},
|
||||
teamId: {// 小组ID
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
categorys: {// 建模大类,多个则逗号分隔
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
methods: {// 建模分类,多个则逗号分隔,空值默认可选所有建模方法数据,非空则只能选择范围内的数据,数据显示不控制
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
rootId: {// 指定根节点,为空则查询根节点
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
pid: '',
|
||||
shapeSearchKey: '',
|
||||
shapeChecked: [],
|
||||
shapeSelected: '',
|
||||
shapeRecords: {},
|
||||
treeProps: {
|
||||
label: 'name',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
tableData: [],
|
||||
shapeData: [],
|
||||
shapeTempData: [],
|
||||
treeSearchKey: '',
|
||||
timeout: null,
|
||||
result: [],// [{id:xxx,versionId:xxx,name:xxxx,children:[{shapeId:xxx,name:xxx},{shapeId:xxx,name:xxx}]}]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
computed: {
|
||||
isTreeCheckbox() {
|
||||
if(this.relationType == 'file' && this.multiple) {
|
||||
return true
|
||||
} else if(this.relationType == 'shapeAndFile') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clearAllParam() {
|
||||
this.pid = '';
|
||||
this.shapeSearchKey = '';
|
||||
this.shapeChecked = [];
|
||||
this.shapeSelected = '';
|
||||
this.shapeRecords = {};
|
||||
this.tableData = [];
|
||||
this.shapeData = [];
|
||||
this.shapeTempData = [];
|
||||
this.treeSearchKey = '';
|
||||
this.timeout = null;
|
||||
this.result = [];
|
||||
},
|
||||
shapeSearch() {// 形状搜索
|
||||
if (this.shapeSearchKey && this.shapeSearchKey.trim() != '') {
|
||||
const key = this.shapeSearchKey.trim().toLocaleLowerCase();
|
||||
const shapeData = [];
|
||||
for (let i = 0; i < this.shapeTempData.length; i++) {
|
||||
const shape = this.shapeTempData[i];
|
||||
if (shape.name != '') {
|
||||
let name = (shape.name + '').toLocaleLowerCase();
|
||||
if (name.indexOf(key) != -1) {
|
||||
shapeData.push(JSON.parse(JSON.stringify(shape)));
|
||||
}
|
||||
}
|
||||
}
|
||||
this.shapeData = shapeData;
|
||||
} else {
|
||||
this.shapeData = JSON.parse(JSON.stringify(this.shapeTempData));
|
||||
}
|
||||
},
|
||||
treeSearchSelect(item) {
|
||||
this.queryTreeByIdAndPath(item.id, item.path);
|
||||
},
|
||||
treeSearch(key, cb) {
|
||||
const that = this;
|
||||
if (key != undefined && key.trim() != '') {
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_search',
|
||||
wsId: that.wsId,
|
||||
teamId: that.teamId,
|
||||
categorys: that.categorys,
|
||||
rootId: that.rootId,
|
||||
name: key
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
if (ro.data.length > 0) {
|
||||
clearTimeout(that.timeout);
|
||||
that.timeout = setTimeout(() => {
|
||||
cb(ro.data);
|
||||
}, 3000 * Math.random());
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
clearTimeout(that.timeout);
|
||||
}
|
||||
},
|
||||
queryTreeByIdAndPath(id, path) {// 定位展开某节点
|
||||
const that= this;
|
||||
const tree = that.$refs.tree;
|
||||
// 分隔字符串
|
||||
const pathArr = path.split(',');
|
||||
let index = 1;
|
||||
for (let i = 0; i < pathArr.length; i++) {// 依次展开
|
||||
if (i > 0) {
|
||||
if (tree.getNode(pathArr[i-1]) != null) {
|
||||
setTimeout(that._expandNode(tree, pathArr[i-1]), index * 300);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(function() {
|
||||
if (tree.getNode(id) != null) {
|
||||
tree.setCurrentKey(id);
|
||||
}
|
||||
}, index * 300);
|
||||
},
|
||||
_expandNode(tree, id) {
|
||||
return function() {
|
||||
tree.getNode(id).expand();
|
||||
}
|
||||
},
|
||||
loadNode(node, resolve) {// `动态`加载
|
||||
const that = this;
|
||||
// that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_subjson',
|
||||
wsId: that.wsId,
|
||||
teamId: that.teamId,
|
||||
categorys: that.categorys,
|
||||
pid: ''
|
||||
}
|
||||
};
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = that.pid;
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
if (ro.data[i].id.length < 36) {
|
||||
ro.data[i].disabled = true;
|
||||
} else {
|
||||
if (that.categorys != '' && that.methods != '') {
|
||||
if (that.methods.indexOf(ro.data[i].plMethodId) > -1) {
|
||||
ro.data[i].disabled = false;
|
||||
} else {
|
||||
ro.data[i].disabled = true;
|
||||
}
|
||||
} else if (that.categorys != '') {
|
||||
if (that.categorys.indexOf(ro.data[i].plCategory) > -1) {
|
||||
ro.data[i].disabled = false;
|
||||
} else {
|
||||
ro.data[i].disabled = true;
|
||||
}
|
||||
} else {
|
||||
if (that.methods.indexOf(ro.data[i].plMethodId) > -1) {
|
||||
ro.data[i].disabled = false;
|
||||
} else {
|
||||
ro.data[i].disabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resolve(ro.data);
|
||||
that.initTreeCheck();
|
||||
// that.loading = false;
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.tree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
// 初始化树选中节点
|
||||
initTreeCheck() {
|
||||
const relationType = this.relationType;
|
||||
if (relationType == 'file') {// 文件类型
|
||||
if (this.multiple) {// 多选
|
||||
const result = this.result;
|
||||
const tree = this.$refs.tree;
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (tree.getNode(result[i].id) != null) {
|
||||
tree.setChecked(result[i].id, true);
|
||||
}
|
||||
}
|
||||
} else {// 单选
|
||||
const result = this.result;
|
||||
const tree = this.$refs.tree;
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (tree.getNode(result[i].id) != null) {
|
||||
tree.setCurrentKey(result[i].id);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (relationType == 'shapeAndFile'){
|
||||
const result = this.result;
|
||||
const tree = this.$refs.tree;
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (result[i].children.length == 0 && tree.getNode(result[i].id) != null) {
|
||||
tree.setChecked(result[i].id, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 树节点check file shapeAndFile
|
||||
handleNodeCheckChange(data, isCheck) {
|
||||
if(this.relationType == 'file' || (this.relationType == 'shapeAndFile' && this.multiple)) { // 关联文件 和 关联形状和文件多选
|
||||
if (isCheck) {// 选中
|
||||
const result = this.result;
|
||||
if (!this.isFileExist(result,data.id, data.versionId)) {
|
||||
const tempObj = {};
|
||||
tempObj.id = data.id;
|
||||
tempObj.versionId = data.versionId;
|
||||
tempObj.name = data.name;
|
||||
tempObj.children = [];
|
||||
result.push(tempObj);
|
||||
this.initTableData();
|
||||
}
|
||||
}
|
||||
else {// 取消选中
|
||||
this.remove(data.id);
|
||||
}
|
||||
}
|
||||
else { // 关联形状和文件单选
|
||||
if (isCheck) {
|
||||
const result = this.result;
|
||||
this.shapeSelected = ''
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (result[i].children.length == 0) {
|
||||
this.remove(result[i].id)
|
||||
} else {
|
||||
let children = result[i].children
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
this.remove(children[j].shapeId)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.isFileExist(result,data.id, data.versionId)) {
|
||||
const tempObj = {};
|
||||
tempObj.id = data.id;
|
||||
tempObj.versionId = data.versionId;
|
||||
tempObj.name = data.name;
|
||||
tempObj.children = [];
|
||||
result.push(tempObj);
|
||||
this.initTableData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.remove(data.id);
|
||||
}
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.closeDlalog('cancel');
|
||||
done();
|
||||
},
|
||||
cancel() {
|
||||
this.closeDlalog('cancel');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
submit() {
|
||||
this.closeDlalog('save');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
closeDlalog(type) {// 取消/确定之后的关闭
|
||||
if (type == 'save') {
|
||||
const result = JSON.parse(JSON.stringify(this.result));
|
||||
if (this.relationType == 'file') {
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
delete result[i].children;
|
||||
}
|
||||
}
|
||||
this.$emit('getResult', result);
|
||||
} else {
|
||||
this.$emit('cancel');
|
||||
}
|
||||
// 清空所有数据
|
||||
this.clearAllParam();
|
||||
},
|
||||
// 树节点点击
|
||||
handleNodeClick(data) {
|
||||
const that = this;
|
||||
const relationType = this.relationType;
|
||||
if (relationType == 'file') {// 关联类型是文件
|
||||
if (!this.multiple) {// 单选处理,单选为选中
|
||||
// 判断
|
||||
if (that.categorys != '' && that.methods != '') {
|
||||
if (that.methods.indexOf(data.plMethodId) == -1) {
|
||||
// 不支持
|
||||
that.$message({message: '不支持关联的模型',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
} else if (that.categorys != '') {
|
||||
if (that.categorys.indexOf(data.plCategory) == -1) {
|
||||
that.$message({message: '不支持关联的模型',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (that.methods.indexOf(data.plMethodId) == -1) {
|
||||
that.$message({message: '不支持关联的模型',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.result = [];// 清空
|
||||
const result = this.result;
|
||||
const tempObj = {};
|
||||
tempObj.id = data.id;
|
||||
tempObj.versionId = data.versionId;
|
||||
tempObj.name = data.name;
|
||||
tempObj.children = [];
|
||||
result.push(tempObj);
|
||||
this.initTableData();
|
||||
}
|
||||
}
|
||||
else {// 关联类型是形状
|
||||
// 查询节点列表
|
||||
const that = this;
|
||||
that.shapeSearchKey = '';
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_shapejson',
|
||||
id: data.id
|
||||
}
|
||||
};
|
||||
let isDisabled = true;
|
||||
if (that.categorys != '' && that.methods != '') {
|
||||
if (that.methods.indexOf(data.plMethodId) > -1) {
|
||||
isDisabled = false;
|
||||
} else {
|
||||
isDisabled = true;
|
||||
}
|
||||
} else if (that.categorys != '') {
|
||||
if (that.categorys.indexOf(data.plCategory) > -1) {
|
||||
isDisabled = false;
|
||||
} else {
|
||||
isDisabled = true;
|
||||
}
|
||||
} else {
|
||||
if (that.methods.indexOf(data.plMethodId) > -1) {
|
||||
isDisabled = false;
|
||||
} else {
|
||||
isDisabled = true;
|
||||
}
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
const list = ro.data.list;
|
||||
const tempData = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const obj = {
|
||||
id: list[i].id,
|
||||
name: list[i].name,
|
||||
fileId: list[i].fileId,
|
||||
fileName: list[i].fileName,
|
||||
versionId: list[i].versionId,
|
||||
isDisabled: isDisabled
|
||||
}
|
||||
|
||||
tempData.push(obj);
|
||||
that.shapeRecords[list[i].id] = obj;
|
||||
}
|
||||
that.shapeData = tempData;
|
||||
that.shapeTempData = JSON.parse(JSON.stringify(that.shapeData));// 拷贝一份临时数据
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
// 初始化最右侧表格
|
||||
initTableData() {
|
||||
const relationType = this.relationType;
|
||||
if (relationType == 'file') {
|
||||
const result = this.result;
|
||||
const tempData = [];
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const tempObj = {
|
||||
id: result[i].id,
|
||||
name: result[i].name,
|
||||
versionId: result[i].versionId
|
||||
}
|
||||
tempData.push(tempObj);
|
||||
}
|
||||
this.tableData = tempData;
|
||||
}
|
||||
else if (relationType == 'shapeAndFile') {
|
||||
const result = this.result;
|
||||
const tempData = [];
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const currFile = result[i];
|
||||
const children = currFile.children;
|
||||
if(children.length == 0) {
|
||||
const tempObj = {
|
||||
id: result[i].id,
|
||||
name: result[i].name,
|
||||
versionId: result[i].versionId
|
||||
}
|
||||
tempData.push(tempObj);
|
||||
} else {
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
const currShape = children[j];
|
||||
const tempObj = {
|
||||
id: currShape.shapeId,
|
||||
name: currShape.name,
|
||||
fileId: currFile.id,
|
||||
fileName: currFile.name,
|
||||
versionId: currFile.versionId
|
||||
}
|
||||
tempData.push(tempObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.tableData = tempData;
|
||||
}
|
||||
else {// 关联类型是形状
|
||||
const result = this.result;
|
||||
const tempData = [];
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const currFile = result[i];
|
||||
const children = currFile.children;
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
const currShape = children[j];
|
||||
const tempObj = {
|
||||
id: currShape.shapeId,
|
||||
name: currShape.name,
|
||||
fileId: currFile.id,
|
||||
fileName: currFile.name,
|
||||
versionId: currFile.versionId
|
||||
}
|
||||
tempData.push(tempObj);
|
||||
}
|
||||
}
|
||||
this.tableData = tempData;
|
||||
}
|
||||
},
|
||||
// 文件是否存在于结果中
|
||||
isFileExist(result, fileId, versionId){
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const file = result[i];
|
||||
if (file.versionId == versionId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// 右侧表格删除
|
||||
remove(id) {
|
||||
const relationType = this.relationType;
|
||||
if (relationType == 'file') {
|
||||
const result = this.result;
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const obj = result[i];
|
||||
if (obj.id == id) {
|
||||
result.splice(i, 1);
|
||||
if (this.multiple) {
|
||||
this.$refs.tree.setChecked(id, false);
|
||||
} else {
|
||||
this.$refs.tree.setCurrentKey(null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(relationType == 'shapeAndFile') {
|
||||
const result = this.result;
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const obj = result[i];
|
||||
if (obj.id == id) {
|
||||
this.$refs.tree.setChecked(id, false);
|
||||
result.splice(i, 1);
|
||||
break
|
||||
} else {
|
||||
let data = this.shapeRecords[id]
|
||||
let children = result[i].children
|
||||
if (data && obj.id == data.fileId) {
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
if (children[j].shapeId == id) {
|
||||
children.splice(j, 1);
|
||||
if (children.length == 0) {
|
||||
result.splice(i, 1);
|
||||
}
|
||||
}
|
||||
if(this.multiple) {
|
||||
// 删除选中形状
|
||||
for (let i = 0; i < this.shapeChecked.length; i++) {
|
||||
if (this.shapeChecked[i] == id) {
|
||||
this.shapeChecked.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.shapeSelected = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {// 形状
|
||||
if (this.multiple) {// 多选
|
||||
const data = this.shapeRecords[id];
|
||||
if (data) {
|
||||
const result = this.result;
|
||||
const shapeId = data.id;
|
||||
const name = data.name;
|
||||
const fileId = data.fileId;
|
||||
const fileName = data.fileName;
|
||||
const fileVersionId = data.versionId;
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const file = result[i];
|
||||
if (file.id == fileId) {
|
||||
const children = file.children;
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
if (children[j].shapeId == id) {
|
||||
children.splice(j, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (children.length == 0) {
|
||||
result.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除选中节点
|
||||
for (let i = 0; i < this.shapeChecked.length; i++) {
|
||||
if (this.shapeChecked[i] == id) {
|
||||
this.shapeChecked.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {// 单选
|
||||
this.result = [];
|
||||
this.shapeSelected = '';
|
||||
}
|
||||
}
|
||||
this.initTableData();
|
||||
},
|
||||
// 形状单选变化事件
|
||||
handleChangeRadioShape(id) {
|
||||
const data = this.shapeRecords[id];
|
||||
if (data) {
|
||||
const shapeId = data.id;
|
||||
const name = data.name;
|
||||
const fileId = data.fileId;
|
||||
const fileName = data.fileName;
|
||||
const fileVersionId = data.versionId;
|
||||
if (this.relationType == 'shapeAndFile') {
|
||||
for (let i = 0; i < this.result.length; i++) {
|
||||
if (this.result[i].children.length == 0) {
|
||||
this.remove(this.result[i].id)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.result = [];
|
||||
const result = this.result;
|
||||
const tempObj = {};
|
||||
tempObj.id = fileId;
|
||||
tempObj.versionId = fileVersionId;
|
||||
tempObj.name = fileName;
|
||||
tempObj.children = [];
|
||||
const children = {
|
||||
shapeId: shapeId,
|
||||
name: name
|
||||
};
|
||||
tempObj.children.push(children);
|
||||
result.push(tempObj);
|
||||
this.initTableData();
|
||||
}
|
||||
},
|
||||
// 形状多选变化事件
|
||||
handleChangeCheckShape(ids) {
|
||||
if (this.relationType == 'shapeAndFile') {
|
||||
for (let i = 0; i < this.result.length; i++) {
|
||||
if (this.result[i].children.length > 0) {
|
||||
this.result.splice(i,1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.result = []
|
||||
}
|
||||
const result = this.result;
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
const id = ids[i];
|
||||
const data = this.shapeRecords[id];
|
||||
if (data) {
|
||||
const shapeId = data.id;
|
||||
const name = data.name;
|
||||
const fileId = data.fileId;
|
||||
const fileName = data.fileName;
|
||||
const fileVersionId = data.versionId;
|
||||
let fileExist = false;
|
||||
for (let j = 0; j < result.length; j++) {
|
||||
const file = result[j];
|
||||
if (file.id == fileId) {
|
||||
fileExist = true;
|
||||
const children = {
|
||||
shapeId: shapeId,
|
||||
name: name
|
||||
}
|
||||
if (file.children.findIndex(item => item.shapeId == shapeId) === -1) {
|
||||
file.children.push(children);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (!fileExist) {
|
||||
const tempObj = {};
|
||||
tempObj.id = fileId;
|
||||
tempObj.versionId = fileVersionId;
|
||||
tempObj.name = fileName;
|
||||
tempObj.children = [];
|
||||
const children = {
|
||||
shapeId: shapeId,
|
||||
name: name
|
||||
};
|
||||
tempObj.children.push(children);
|
||||
result.push(tempObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.initTableData();
|
||||
},
|
||||
initData() {// 初始化传递进来的数据
|
||||
// 已选中的数据初始化到result、shapeSelected、shapeChecked里面
|
||||
const that = this;
|
||||
if (that.relationType == 'file') {
|
||||
if (that.selectFileId != '') {
|
||||
// 查询数据
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_file_query',
|
||||
versionIds: that.selectFileId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
const result = [];
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
const currData = ro.data[i];
|
||||
const tempObj = {};
|
||||
tempObj.id = currData.id;
|
||||
tempObj.versionId = currData.versionId;
|
||||
tempObj.name = currData.name;
|
||||
tempObj.children = [];
|
||||
result.push(tempObj);
|
||||
}
|
||||
that.result = result;
|
||||
that.initTableData();
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (that.selectFileId != '' && that.selectShapeId != '') {
|
||||
// 查询数据
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_tree_component_file_shape_query',
|
||||
fileIds: that.selectFileId,
|
||||
shapeIds: that.selectShapeId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
if (ro.data.data.length > 0) {
|
||||
that.shapeRecords = ro.data.shapes;
|
||||
if (that.multiple) {
|
||||
that.result = ro.data.data;
|
||||
for (let i = 0; i < that.result.length; i++) {
|
||||
const children = that.result[i].children;
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
that.shapeChecked.push(children[j].shapeId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
that.result = ro.data.data;
|
||||
for (let i = 0; i < that.result.length; i++) {
|
||||
const children = that.result[i].children;
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
that.shapeSelected = children[j].shapeId;// 取任意一个
|
||||
}
|
||||
}
|
||||
}
|
||||
that.initTableData();
|
||||
}
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
if (val) {// 打开
|
||||
this.clearAllParam();
|
||||
this.pid = this.rootId;
|
||||
this.initData();
|
||||
} else {// 关闭
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#palRelationAddress >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
#palRelationAddress >>> .el-input__inner {
|
||||
border-radius: 0px;
|
||||
}
|
||||
#palRelationAddress >>> .el-tree {
|
||||
min-width: 100%;
|
||||
display:inline-block !important;
|
||||
}
|
||||
.checkbox-item {
|
||||
margin: 10px 0px;
|
||||
display: block;
|
||||
}
|
||||
.redio-item {
|
||||
margin: 10px 0px;
|
||||
display: block;
|
||||
}
|
||||
.div-left {
|
||||
float:left;
|
||||
width:249px;
|
||||
height:400px;
|
||||
border-right: 1px dashed #f2f2f2;
|
||||
}
|
||||
.div-middle {
|
||||
float:left;
|
||||
width: 248px;
|
||||
height:400px;
|
||||
border-right: 1px dashed #f2f2f2;
|
||||
}
|
||||
.div-right {
|
||||
float: right;
|
||||
width: 249px;
|
||||
height:400px;
|
||||
background-color: #2a85a0;
|
||||
}
|
||||
#palRelationAddress >>> .el-table__row .icon-delete-display{
|
||||
display: none;
|
||||
}
|
||||
#palRelationAddress >>> .el-table__row:hover .icon-delete-display{
|
||||
display: inline;
|
||||
}
|
||||
#palRelationAddress >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #F5F7FA;
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#palRelationAddress >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .awsui-iconfont {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,7 @@
|
||||
import PalRelationAddress from './component'
|
||||
|
||||
PalRelationAddress.install = function(Vue) {
|
||||
Vue.component(PalRelationAddress.name, PalRelationAddress);
|
||||
}
|
||||
|
||||
export default PalRelationAddress;
|
||||
85
com.actionsoft.apps.coe.pal/components/common/upload/ajax.js
Normal file
85
com.actionsoft.apps.coe.pal/components/common/upload/ajax.js
Normal file
@ -0,0 +1,85 @@
|
||||
function getError(action, option, xhr) {
|
||||
let msg;
|
||||
if (xhr.response) {
|
||||
msg = `${xhr.response.error || xhr.response}`;
|
||||
} else if (xhr.responseText) {
|
||||
msg = `${xhr.responseText}`;
|
||||
} else {
|
||||
msg = `fail to post ${action} ${xhr.status}`;
|
||||
}
|
||||
|
||||
const err = new Error(msg);
|
||||
err.status = xhr.status;
|
||||
err.method = 'post';
|
||||
err.url = action;
|
||||
return err;
|
||||
}
|
||||
|
||||
function getBody(xhr) {
|
||||
const text = xhr.responseText || xhr.response;
|
||||
if (!text) {
|
||||
return text;
|
||||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(text);
|
||||
} catch (e) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
export default function upload(option) {
|
||||
if (typeof XMLHttpRequest === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
const action = option.action;
|
||||
|
||||
if (xhr.upload) {
|
||||
xhr.upload.onprogress = function progress(e) {
|
||||
if (e.total > 0) {
|
||||
e.percent = e.loaded / e.total * 100;
|
||||
}
|
||||
option.onProgress(e);
|
||||
};
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
if (option.data) {
|
||||
Object.keys(option.data).forEach(key => {
|
||||
formData.append(key, option.data[key]);
|
||||
});
|
||||
}
|
||||
|
||||
formData.append(option.filename, option.file, option.file.name);
|
||||
|
||||
xhr.onerror = function error(e) {
|
||||
option.onError(e);
|
||||
};
|
||||
|
||||
xhr.onload = function onload() {
|
||||
if (xhr.status < 200 || xhr.status >= 300) {
|
||||
return option.onError(getError(action, option, xhr));
|
||||
}
|
||||
|
||||
option.onSuccess(getBody(xhr));
|
||||
};
|
||||
|
||||
xhr.open('post', action, true);
|
||||
|
||||
if (option.withCredentials && 'withCredentials' in xhr) {
|
||||
xhr.withCredentials = true;
|
||||
}
|
||||
|
||||
const headers = option.headers || {};
|
||||
|
||||
for (let item in headers) {
|
||||
if (headers.hasOwnProperty(item) && headers[item] !== null) {
|
||||
xhr.setRequestHeader(item, headers[item]);
|
||||
}
|
||||
}
|
||||
xhr.send(formData);
|
||||
return xhr;
|
||||
}
|
||||
353
com.actionsoft.apps.coe.pal/components/common/upload/index.vue
Normal file
353
com.actionsoft.apps.coe.pal/components/common/upload/index.vue
Normal file
@ -0,0 +1,353 @@
|
||||
<script>
|
||||
import UploadList from './upload-list';
|
||||
import Upload from './upload';
|
||||
import ElProgress from 'element-ui/packages/progress';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
function noop() {}
|
||||
export default {
|
||||
name: 'ElUpload',
|
||||
mixins: [Migrating],
|
||||
components: {
|
||||
ElProgress,
|
||||
UploadList,
|
||||
Upload
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
uploader: this
|
||||
};
|
||||
},
|
||||
inject: {
|
||||
elForm: {
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
action: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
headers: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
data: Object,
|
||||
multiple: Boolean,
|
||||
name: {
|
||||
type: String,
|
||||
default: 'file'
|
||||
},
|
||||
drag: Boolean,
|
||||
dragger: Boolean,
|
||||
withCredentials: Boolean,
|
||||
showFileList: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
accept: String,
|
||||
type: {
|
||||
type: String,
|
||||
default: 'select'
|
||||
},
|
||||
beforeUpload: Function,
|
||||
beforeRemove: Function,
|
||||
onRemove: {
|
||||
type: Function,
|
||||
default: noop
|
||||
},
|
||||
onChange: {
|
||||
type: Function,
|
||||
default: noop
|
||||
},
|
||||
onPreview: {
|
||||
type: Function
|
||||
},
|
||||
onSuccess: {
|
||||
type: Function,
|
||||
default: noop
|
||||
},
|
||||
onProgress: {
|
||||
type: Function,
|
||||
default: noop
|
||||
},
|
||||
onError: {
|
||||
type: Function,
|
||||
default: noop
|
||||
},
|
||||
fileList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
autoUpload: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
listType: {
|
||||
type: String,
|
||||
default: 'text' // text,picture,picture-card
|
||||
},
|
||||
httpRequest: Function,
|
||||
disabled: Boolean,
|
||||
limit: Number,
|
||||
onExceed: {
|
||||
type: Function,
|
||||
default: noop
|
||||
},
|
||||
appId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
repositoryName: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
groupValue: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
fileValue: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
extParam: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uploadFiles: [],
|
||||
dragOver: false,
|
||||
draging: false,
|
||||
tempIndex: 1,
|
||||
sid: this.$store.state.sessionId
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
uploadDisabled() {
|
||||
return this.disabled || (this.elForm || {}).disabled;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listType(type) {
|
||||
if (type === 'picture-card' || type === 'picture') {
|
||||
this.uploadFiles = this.uploadFiles.map(file => {
|
||||
if (!file.url && file.raw) {
|
||||
try {
|
||||
file.url = URL.createObjectURL(file.raw);
|
||||
} catch (err) {
|
||||
console.error('[Element Error][Upload]', err);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
});
|
||||
}
|
||||
},
|
||||
fileList: {
|
||||
immediate: true,
|
||||
handler(fileList) {
|
||||
this.uploadFiles = fileList.map(item => {
|
||||
item.uid = item.uid || (Date.now() + this.tempIndex++);
|
||||
item.status = item.status || 'success';
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleStart(rawFile) {
|
||||
rawFile.uid = Date.now() + this.tempIndex++;
|
||||
let file = {
|
||||
status: 'ready',
|
||||
name: rawFile.name,
|
||||
size: rawFile.size,
|
||||
percentage: 0,
|
||||
uid: rawFile.uid,
|
||||
raw: rawFile
|
||||
};
|
||||
if (this.listType === 'picture-card' || this.listType === 'picture') {
|
||||
try {
|
||||
file.url = URL.createObjectURL(rawFile);
|
||||
} catch (err) {
|
||||
console.error('[Element Error][Upload]', err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.uploadFiles.push(file);
|
||||
this.onChange(file, this.uploadFiles);
|
||||
},
|
||||
handleProgress(ev, rawFile) {
|
||||
const file = this.getFile(rawFile);
|
||||
this.onProgress(ev, file, this.uploadFiles);
|
||||
file.status = 'uploading';
|
||||
file.percentage = ev.percent || 0;
|
||||
},
|
||||
handleSuccess(res, rawFile) {
|
||||
const file = this.getFile(rawFile);
|
||||
if (file) {
|
||||
file.status = 'success';
|
||||
file.response = res;
|
||||
this.onSuccess(res, file, this.uploadFiles);
|
||||
this.onChange(file, this.uploadFiles);
|
||||
}
|
||||
},
|
||||
handleError(err, rawFile) {
|
||||
const file = this.getFile(rawFile);
|
||||
const fileList = this.uploadFiles;
|
||||
file.status = 'fail';
|
||||
fileList.splice(fileList.indexOf(file), 1);
|
||||
this.onError(err, file, this.uploadFiles);
|
||||
this.onChange(file, this.uploadFiles);
|
||||
},
|
||||
handleRemove(file, raw) {
|
||||
if (raw) {
|
||||
file = this.getFile(raw);
|
||||
}
|
||||
let doRemove = () => {
|
||||
this.abort(file);
|
||||
let fileList = this.uploadFiles;
|
||||
fileList.splice(fileList.indexOf(file), 1);
|
||||
this.onRemove(file, fileList);
|
||||
};
|
||||
if (!this.beforeRemove) {
|
||||
doRemove();
|
||||
} else if (typeof this.beforeRemove === 'function') {
|
||||
const before = this.beforeRemove(file, this.uploadFiles);
|
||||
if (before && before.then) {
|
||||
before.then(() => {
|
||||
doRemove();
|
||||
}, noop);
|
||||
} else if (before !== false) {
|
||||
doRemove();
|
||||
}
|
||||
}
|
||||
},
|
||||
getFile(rawFile) {
|
||||
let fileList = this.uploadFiles;
|
||||
let target;
|
||||
fileList.every(item => {
|
||||
target = rawFile.uid === item.uid ? item : null;
|
||||
return !target;
|
||||
});
|
||||
return target;
|
||||
},
|
||||
abort(file) {
|
||||
this.$refs['upload-inner'].abort(file);
|
||||
},
|
||||
clearFiles() {
|
||||
this.uploadFiles = [];
|
||||
},
|
||||
submit() {
|
||||
this.uploadFiles
|
||||
.filter(file => file.status === 'ready')
|
||||
.forEach(file => {
|
||||
this.$refs['upload-inner'].upload(file.raw);
|
||||
});
|
||||
},
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'default-file-list': 'default-file-list is renamed to file-list.',
|
||||
'show-upload-list': 'show-upload-list is renamed to show-file-list.',
|
||||
'thumbnail-mode': 'thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan'
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.uploadFiles.forEach(file => {
|
||||
if (file.url && file.url.indexOf('blob:') === 0) {
|
||||
URL.revokeObjectURL(file.url);
|
||||
}
|
||||
});
|
||||
},
|
||||
render(h) {
|
||||
let uploadList;
|
||||
if (this.showFileList) {
|
||||
uploadList = (
|
||||
<UploadList
|
||||
disabled={this.uploadDisabled}
|
||||
listType={this.listType}
|
||||
files={this.uploadFiles}
|
||||
on-remove={this.handleRemove}
|
||||
handlePreview={this.onPreview}>
|
||||
{
|
||||
(props) => {
|
||||
if (this.$scopedSlots.file) {
|
||||
return this.$scopedSlots.file({
|
||||
file: props.file
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</UploadList>
|
||||
);
|
||||
}
|
||||
const uploadData = {
|
||||
props: {
|
||||
type: this.type,
|
||||
drag: this.drag,
|
||||
action: this.action != undefined && this.action != '' ? this.action : encodeURI(getUploadDestination() + "appId=" + this.appId + "&sid=" + this.sid + "&groupValue=" + this.groupValue + "&fileValue=" + this.fileValue + "&repositoryName=" + this.repositoryName + "&extParam=" + this.extParam),
|
||||
multiple: this.multiple,
|
||||
'before-upload': this.beforeUpload,
|
||||
'with-credentials': this.withCredentials,
|
||||
headers: this.headers,
|
||||
name: this.name,
|
||||
data: this.data,
|
||||
accept: this.accept,
|
||||
fileList: this.uploadFiles,
|
||||
autoUpload: this.autoUpload,
|
||||
listType: this.listType,
|
||||
disabled: this.uploadDisabled,
|
||||
limit: this.limit,
|
||||
'on-exceed': this.onExceed,
|
||||
'on-start': this.handleStart,
|
||||
'on-progress': this.handleProgress,
|
||||
'on-success': this.handleSuccess,
|
||||
'on-error': this.handleError,
|
||||
'on-preview': this.onPreview,
|
||||
'on-remove': this.handleRemove,
|
||||
'http-request': this.httpRequest,
|
||||
appId: this.appId,
|
||||
repositoryName: this.repositoryName,
|
||||
groupValue: this.groupValue,
|
||||
fileValue: this.fileValue,
|
||||
extParam: this.extParam,
|
||||
sid: this.sid
|
||||
},
|
||||
ref: 'upload-inner'
|
||||
};
|
||||
const trigger = this.$slots.trigger || this.$slots.default;
|
||||
const uploadComponent = <upload {...uploadData}>{trigger}</upload>;
|
||||
return (
|
||||
<div>
|
||||
{ this.listType === 'picture-card' ? uploadList : ''}
|
||||
{
|
||||
this.$slots.trigger
|
||||
? [uploadComponent, this.$slots.default]
|
||||
: uploadComponent
|
||||
}
|
||||
{this.$slots.tip}
|
||||
{ this.listType !== 'picture-card' ? uploadList : ''}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
function getUploadDestination() {
|
||||
var url = axiosBaseUrl;
|
||||
var ret = "uf";
|
||||
if (url && url.indexOf("/r/") != -1) {
|
||||
ret = url.substring(0, url.indexOf("/r/")) + "/r/uf";
|
||||
} else if (url && url.indexOf("/apps") > -1) {
|
||||
ret = url.substring(0, url.indexOf("/apps")) + "/r/uf";
|
||||
}
|
||||
var finalUrl = ret + "?";
|
||||
return finalUrl;
|
||||
};
|
||||
|
||||
</script>
|
||||
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div
|
||||
class="el-upload-dragger"
|
||||
:class="{
|
||||
'is-dragover': dragover
|
||||
}"
|
||||
@drop.prevent="onDrop"
|
||||
@dragover.prevent="onDragover"
|
||||
@dragleave.prevent="dragover = false"
|
||||
>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ElUploadDrag',
|
||||
props: {
|
||||
disabled: Boolean
|
||||
},
|
||||
inject: {
|
||||
uploader: {
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dragover: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onDragover() {
|
||||
if (!this.disabled) {
|
||||
this.dragover = true;
|
||||
}
|
||||
},
|
||||
onDrop(e) {
|
||||
if (this.disabled || !this.uploader) return;
|
||||
const accept = this.uploader.accept;
|
||||
this.dragover = false;
|
||||
if (!accept) {
|
||||
this.$emit('file', e.dataTransfer.files);
|
||||
return;
|
||||
}
|
||||
this.$emit('file', [].slice.call(e.dataTransfer.files).filter(file => {
|
||||
const { type, name } = file;
|
||||
const extension = name.indexOf('.') > -1
|
||||
? `.${ name.split('.').pop() }`
|
||||
: '';
|
||||
const baseType = type.replace(/\/.*$/, '');
|
||||
return accept.split(',')
|
||||
.map(type => type.trim())
|
||||
.filter(type => type)
|
||||
.some(acceptedType => {
|
||||
if (/\..+$/.test(acceptedType)) {
|
||||
return extension === acceptedType;
|
||||
}
|
||||
if (/\/\*$/.test(acceptedType)) {
|
||||
return baseType === acceptedType.replace(/\/\*$/, '');
|
||||
}
|
||||
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
|
||||
return type === acceptedType;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<transition-group
|
||||
tag="ul"
|
||||
:class="[
|
||||
'el-upload-list',
|
||||
'el-upload-list--' + listType,
|
||||
{ 'is-disabled': disabled }
|
||||
]"
|
||||
name="el-list"
|
||||
>
|
||||
<li
|
||||
v-for="file in files"
|
||||
:class="['el-upload-list__item', 'is-' + file.status, focusing ? 'focusing' : '']"
|
||||
:key="file.uid"
|
||||
tabindex="0"
|
||||
@keydown.delete="!disabled && $emit('remove', file)"
|
||||
@focus="focusing = true"
|
||||
@blur="focusing = false"
|
||||
@click="focusing = false"
|
||||
>
|
||||
<slot :file="file">
|
||||
<img
|
||||
class="el-upload-list__item-thumbnail"
|
||||
v-if="file.status !== 'uploading' && ['picture-card', 'picture'].indexOf(listType) > -1"
|
||||
:src="file.url" alt=""
|
||||
>
|
||||
<a class="el-upload-list__item-name" @click="handleClick(file)">
|
||||
<i class="el-icon-document"></i>{{file.name}}
|
||||
</a>
|
||||
<label class="el-upload-list__item-status-label">
|
||||
<i :class="{
|
||||
'el-icon-upload-success': true,
|
||||
'el-icon-circle-check': listType === 'text',
|
||||
'el-icon-check': ['picture-card', 'picture'].indexOf(listType) > -1
|
||||
}"></i>
|
||||
</label>
|
||||
<i class="el-icon-close" v-if="!disabled" @click="$emit('remove', file)"></i>
|
||||
<i class="el-icon-close-tip" v-if="!disabled">{{ t('el.upload.deleteTip') }}</i> <!--因为close按钮只在li:focus的时候 display, li blur后就不存在了,所以键盘导航时永远无法 focus到 close按钮上-->
|
||||
<el-progress
|
||||
v-if="file.status === 'uploading'"
|
||||
:type="listType === 'picture-card' ? 'circle' : 'line'"
|
||||
:stroke-width="listType === 'picture-card' ? 6 : 2"
|
||||
:percentage="parsePercentage(file.percentage)">
|
||||
</el-progress>
|
||||
<span class="el-upload-list__item-actions" v-if="listType === 'picture-card'">
|
||||
<span
|
||||
class="el-upload-list__item-preview"
|
||||
v-if="handlePreview && listType === 'picture-card'"
|
||||
@click="handlePreview(file)"
|
||||
>
|
||||
<i class="el-icon-zoom-in"></i>
|
||||
</span>
|
||||
<span
|
||||
v-if="!disabled"
|
||||
class="el-upload-list__item-delete"
|
||||
@click="$emit('remove', file)"
|
||||
>
|
||||
<i class="el-icon-delete"></i>
|
||||
</span>
|
||||
</span>
|
||||
</slot>
|
||||
</li>
|
||||
</transition-group>
|
||||
</template>
|
||||
<script>
|
||||
import Locale from 'element-ui/src/mixins/locale';
|
||||
import ElProgress from 'element-ui/packages/progress';
|
||||
export default {
|
||||
name: 'ElUploadList',
|
||||
mixins: [Locale],
|
||||
data() {
|
||||
return {
|
||||
focusing: false
|
||||
};
|
||||
},
|
||||
components: { ElProgress },
|
||||
props: {
|
||||
files: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
handlePreview: Function,
|
||||
listType: String
|
||||
},
|
||||
methods: {
|
||||
parsePercentage(val) {
|
||||
return parseInt(val, 10);
|
||||
},
|
||||
handleClick(file) {
|
||||
this.handlePreview && this.handlePreview(file);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
200
com.actionsoft.apps.coe.pal/components/common/upload/upload.vue
Normal file
200
com.actionsoft.apps.coe.pal/components/common/upload/upload.vue
Normal file
@ -0,0 +1,200 @@
|
||||
<script>
|
||||
import ajax from './ajax';
|
||||
import UploadDragger from './upload-dragger.vue';
|
||||
export default {
|
||||
inject: ['uploader'],
|
||||
components: {
|
||||
UploadDragger
|
||||
},
|
||||
props: {
|
||||
type: String,
|
||||
action: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: 'file'
|
||||
},
|
||||
data: Object,
|
||||
headers: Object,
|
||||
withCredentials: Boolean,
|
||||
multiple: Boolean,
|
||||
accept: String,
|
||||
onStart: Function,
|
||||
onProgress: Function,
|
||||
onSuccess: Function,
|
||||
onError: Function,
|
||||
beforeUpload: Function,
|
||||
drag: Boolean,
|
||||
onPreview: {
|
||||
type: Function,
|
||||
default: function() {}
|
||||
},
|
||||
onRemove: {
|
||||
type: Function,
|
||||
default: function() {}
|
||||
},
|
||||
fileList: Array,
|
||||
autoUpload: Boolean,
|
||||
listType: String,
|
||||
httpRequest: {
|
||||
type: Function,
|
||||
default: ajax
|
||||
},
|
||||
disabled: Boolean,
|
||||
limit: Number,
|
||||
onExceed: Function
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mouseover: false,
|
||||
reqs: {}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
isImage(str) {
|
||||
return str.indexOf('image') !== -1;
|
||||
},
|
||||
handleChange(ev) {
|
||||
const files = ev.target.files;
|
||||
if (!files) return;
|
||||
this.uploadFiles(files);
|
||||
},
|
||||
uploadFiles(files) {
|
||||
if (this.limit && this.fileList.length + files.length > this.limit) {
|
||||
this.onExceed && this.onExceed(files, this.fileList);
|
||||
return;
|
||||
}
|
||||
let postFiles = Array.prototype.slice.call(files);
|
||||
if (!this.multiple) { postFiles = postFiles.slice(0, 1); }
|
||||
if (postFiles.length === 0) { return; }
|
||||
postFiles.forEach(rawFile => {
|
||||
this.onStart(rawFile);
|
||||
if (this.autoUpload) this.upload(rawFile);
|
||||
});
|
||||
},
|
||||
upload(rawFile) {
|
||||
this.$refs.input.value = null;
|
||||
if (!this.beforeUpload) {
|
||||
return this.post(rawFile);
|
||||
}
|
||||
const before = this.beforeUpload(rawFile);
|
||||
if (before && before.then) {
|
||||
before.then(processedFile => {
|
||||
const fileType = Object.prototype.toString.call(processedFile);
|
||||
if (fileType === '[object File]' || fileType === '[object Blob]') {
|
||||
if (fileType === '[object Blob]') {
|
||||
processedFile = new File([processedFile], rawFile.name, {
|
||||
type: rawFile.type
|
||||
});
|
||||
}
|
||||
for (const p in rawFile) {
|
||||
if (rawFile.hasOwnProperty(p)) {
|
||||
processedFile[p] = rawFile[p];
|
||||
}
|
||||
}
|
||||
this.post(processedFile);
|
||||
} else {
|
||||
this.post(rawFile);
|
||||
}
|
||||
}, () => {
|
||||
this.onRemove(null, rawFile);
|
||||
});
|
||||
} else if (before !== false) {
|
||||
this.post(rawFile);
|
||||
} else {
|
||||
this.onRemove(null, rawFile);
|
||||
}
|
||||
},
|
||||
abort(file) {
|
||||
const { reqs } = this;
|
||||
if (file) {
|
||||
let uid = file;
|
||||
if (file.uid) uid = file.uid;
|
||||
if (reqs[uid]) {
|
||||
reqs[uid].abort();
|
||||
}
|
||||
} else {
|
||||
Object.keys(reqs).forEach((uid) => {
|
||||
if (reqs[uid]) reqs[uid].abort();
|
||||
delete reqs[uid];
|
||||
});
|
||||
}
|
||||
},
|
||||
post(rawFile) {
|
||||
const { uid } = rawFile;
|
||||
const options = {
|
||||
headers: this.headers,
|
||||
withCredentials: this.withCredentials,
|
||||
file: rawFile,
|
||||
data: this.data,
|
||||
filename: this.name,
|
||||
action: this.action,
|
||||
onProgress: e => {
|
||||
this.onProgress(e, rawFile);
|
||||
},
|
||||
onSuccess: res => {
|
||||
this.onSuccess(res, rawFile);
|
||||
delete this.reqs[uid];
|
||||
},
|
||||
onError: err => {
|
||||
this.onError(err, rawFile);
|
||||
delete this.reqs[uid];
|
||||
}
|
||||
};
|
||||
const req = this.httpRequest(options);
|
||||
this.reqs[uid] = req;
|
||||
if (req && req.then) {
|
||||
req.then(options.onSuccess, options.onError);
|
||||
}
|
||||
},
|
||||
handleClick() {
|
||||
if (!this.disabled) {
|
||||
this.$refs.input.value = null;
|
||||
this.$refs.input.click();
|
||||
}
|
||||
},
|
||||
handleKeydown(e) {
|
||||
if (e.target !== e.currentTarget) return;
|
||||
if (e.keyCode === 13 || e.keyCode === 32) {
|
||||
this.handleClick();
|
||||
}
|
||||
}
|
||||
},
|
||||
render(h) {
|
||||
let {
|
||||
handleClick,
|
||||
drag,
|
||||
name,
|
||||
handleChange,
|
||||
multiple,
|
||||
accept,
|
||||
listType,
|
||||
uploadFiles,
|
||||
disabled,
|
||||
handleKeydown
|
||||
} = this;
|
||||
const data = {
|
||||
class: {
|
||||
'el-upload': true
|
||||
},
|
||||
on: {
|
||||
click: handleClick,
|
||||
keydown: handleKeydown
|
||||
}
|
||||
};
|
||||
data.class[`el-upload--${listType}`] = true;
|
||||
return (
|
||||
<div {...data} tabindex="0" >
|
||||
{
|
||||
drag
|
||||
? <upload-dragger disabled={disabled} on-file={uploadFiles}>{this.$slots.default}</upload-dragger>
|
||||
: this.$slots.default
|
||||
}
|
||||
<input class="el-upload__input" type="file" ref="input" name={name} on-change={handleChange} multiple={multiple} accept={accept}></input>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
3
com.actionsoft.apps.coe.pal/eventBus
Normal file
3
com.actionsoft.apps.coe.pal/eventBus
Normal file
@ -0,0 +1,3 @@
|
||||
import Vue from 'Vue'
|
||||
|
||||
export default new Vue;
|
||||
25
com.actionsoft.apps.coe.pal/main.js
Normal file
25
com.actionsoft.apps.coe.pal/main.js
Normal file
@ -0,0 +1,25 @@
|
||||
import Babel from 'babel-polyfill';
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
// awsui-vue lib,已包含element-ui
|
||||
import Awsui from '../lib/awsui-vue.umd.min'
|
||||
import '../lib/awsui-vue.css'
|
||||
import '../static/common/common.css';
|
||||
import '../static/common/theme1.css';// 主题颜色配置
|
||||
import './assets/iconfont/iconfont.css';
|
||||
// 表单验证
|
||||
import './api/validator/validator';
|
||||
|
||||
Vue.use(Babel);
|
||||
Vue.use(Awsui)
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => {
|
||||
return h(App);
|
||||
},
|
||||
}).$mount('#app')
|
||||
123
com.actionsoft.apps.coe.pal/router/index.js
Normal file
123
com.actionsoft.apps.coe.pal/router/index.js
Normal file
@ -0,0 +1,123 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import store from '../store'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/', //页面主路由
|
||||
name: 'main',
|
||||
component: () => import ('@/views/Main.vue'),
|
||||
children: [
|
||||
{// 资产库主页
|
||||
path: '/workspace',
|
||||
name: 'workspace',
|
||||
component: () => import('../views/workspace/Workspace')
|
||||
},
|
||||
{// 用户无任何小组情况下的显示及小组创建
|
||||
path: '/cooperationCreate',
|
||||
name: 'cooperationCreate',
|
||||
component: () => import('../views/cooperation/CooperationCreate')
|
||||
},
|
||||
{
|
||||
path: '/repository',
|
||||
name: 'repository',// 模型
|
||||
component: () => import('../views/repository/Repository')
|
||||
},
|
||||
{
|
||||
path: '/manage',
|
||||
name: '管理中心',
|
||||
component: () => import('../views/manage/Manage'),
|
||||
children: [
|
||||
{
|
||||
path: '/workspaceManage',
|
||||
name: '资产库管理',
|
||||
component: () => import('../views/workspace/WorkspaceManage')
|
||||
},
|
||||
{
|
||||
path: '/cooperationUpdate',
|
||||
name: 'PAL小组更新(管理)',
|
||||
component: () => import('../views/cooperation/CooperationUpdate')
|
||||
},
|
||||
{
|
||||
path: '/palUser',
|
||||
name: 'PAL用户',
|
||||
component: () => import('../views/user/User')
|
||||
},
|
||||
{
|
||||
path: '/bpmOrg',
|
||||
name: 'BPM组织架构',
|
||||
component: () => import('../views/user/BPMOrg')
|
||||
},
|
||||
{
|
||||
path: '/mappingManagement_correlated',
|
||||
name: 'mappingManagement_correlated',
|
||||
component: () => import('../views/mappingManagement/MappingManagement')
|
||||
},
|
||||
{
|
||||
path: '/mappingManagement_palNotCorrelated',
|
||||
name: 'mappingManagement_palNotCorrelated',
|
||||
component: () => import('../views/mappingManagement/MappingManagement')
|
||||
},
|
||||
{
|
||||
path: '/mappingManagement_bpmNotCorrelated',
|
||||
name: 'mappingManagement_bpmNotCorrelated',
|
||||
component: () => import('../views/mappingManagement/MappingManagement')
|
||||
},
|
||||
{
|
||||
path: '/themeStyle',
|
||||
component: () => import('../views/portal/ThemeStyle')
|
||||
},
|
||||
{
|
||||
path: '/commonRepository',
|
||||
component: () => import('../views/portal/CommonRepository')
|
||||
},
|
||||
{
|
||||
path: '/userGroup',
|
||||
component: () => import('../views/portal/UserGroup')
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/devGetSession', //开发时获取session作用
|
||||
name: 'devGetSession',
|
||||
component: () => import('../views/DevGetSession.vue')
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
routes
|
||||
})
|
||||
|
||||
/**
|
||||
*
|
||||
* to 表示将要跳转到的组件 (目标组件)
|
||||
* console.log(from); //(源组件)
|
||||
* next();
|
||||
* next 是一个函数
|
||||
* next() 进入下一个组件的钩子函数
|
||||
* next(false) 阻止跳转 中断导航
|
||||
* next("/login") 进入指定的组件的钩子函数
|
||||
*/
|
||||
// 路由守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (production === false && store.state.sessionId == null && to.path != "/devGetSession") {
|
||||
//进入一个路由获取session,获取session后再进入主入口
|
||||
next("/devGetSession");
|
||||
} else {
|
||||
//跳转前设置title
|
||||
//window.document.title = to.meta.title;
|
||||
next();
|
||||
}
|
||||
//to.matched.some(res=>{res.meta.isLogin}) 能够获取路由配置的参数
|
||||
|
||||
});
|
||||
|
||||
//跳转后设置scroll为原点
|
||||
router.afterEach((to, from, next) => {
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
export default router
|
||||
115
com.actionsoft.apps.coe.pal/store/index.js
Normal file
115
com.actionsoft.apps.coe.pal/store/index.js
Normal file
@ -0,0 +1,115 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
sessionId: settingParam.sessionId,
|
||||
topMainHeight: '',// PAL主页面主体高度,
|
||||
navigationQueryVisible: false, // 导航栏输入框的快速搜索结果显示控制
|
||||
navigationConditionQueryVisible: false, // 导航栏输入框的快速搜索结果显示控制
|
||||
wsId: '',// 资产库id
|
||||
teamId: ''// 小组id
|
||||
},
|
||||
getters: {// 提供获取state相关数据的方法
|
||||
getTopMainHeightFn(state) {// 获取PAL主页面主体高度
|
||||
//console.log('get height ' + state.topMainHeight);
|
||||
return state.topMainHeight;
|
||||
},
|
||||
getNavigationQueryVisibleFn(state) {// 获取PAL导航栏搜索框结果的显示与隐藏
|
||||
return state.navigationQueryVisible;
|
||||
},
|
||||
getNavigationConditionQueryVisibleFn(state) {// 获取PAL导航栏条件搜索框结果的显示与隐藏
|
||||
return state.navigationConditionQueryVisible;
|
||||
},
|
||||
getTeamIdFn(state) {// 获取小组id
|
||||
return state.teamId;
|
||||
},
|
||||
getWsIdFn(state) {// 获取资产库id
|
||||
return state.wsId;
|
||||
}
|
||||
},
|
||||
actions: {// 提供跟后台接口交互的方法,并且调用mutations提供的方法进行更新提交
|
||||
setTopMainHeightFn({commit, state}, height) {// 设置PAL主页面主体高度更新
|
||||
commit("setTopMainHeightFn", height);
|
||||
//console.log('dispatch update height ' + height);
|
||||
},
|
||||
setNavigationQueryVisibleFn({commit, state}, visible) {// 设置PAL导航栏搜索框结果的显示与隐藏
|
||||
commit("setNavigationQueryVisibleFn", visible);
|
||||
},
|
||||
setNavigationConditionQueryVisibleFn({commit, state}, visible) {// 设置PAL导航栏条件搜索框结果的显示与隐藏
|
||||
commit("setNavigationConditionQueryVisibleFn", visible);
|
||||
},
|
||||
setTeamIdFn({commit, state}, teamId) {
|
||||
commit('setTeamIdFn', teamId)
|
||||
},
|
||||
setWsIdFn({commit, state}, wsId) {
|
||||
commit('setWsIdFn', wsId)
|
||||
}
|
||||
},
|
||||
mutations: {// 提供存储设置state数据的方法
|
||||
setTopMainHeightFn(state, height) {// 设置PAL主页面主体高度更新
|
||||
state.topMainHeight = height;
|
||||
},
|
||||
setNavigationQueryVisibleFn(state, visible) {// 设置PAL导航栏搜索框结果的显示与隐藏
|
||||
state.navigationQueryVisible = visible;
|
||||
},
|
||||
setNavigationConditionQueryVisibleFn(state, visible) {// 设置PAL导航栏条件搜索框结果的显示与隐藏
|
||||
state.navigationConditionQueryVisible = visible;
|
||||
},
|
||||
setTeamIdFn(state, teamId) {// 设置资产库小组Id
|
||||
state.teamId = teamId;
|
||||
},
|
||||
setWsIdFn(state, wsId) {// 设置资产库Id
|
||||
state.wsId = wsId;
|
||||
},
|
||||
edit(state, data) {
|
||||
for (let p in data) {
|
||||
state[p] = data[p];
|
||||
}
|
||||
}
|
||||
},
|
||||
modules: {
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
在state中定义数据
|
||||
|
||||
Getter相当于vue中的computed计算属性,getter 的返回值会根据它的依赖被缓存起来,且只有当它的依赖值发生了改变才会被重新计算,Getters 可以用于监听、state中的值的变化,返回计算后的结果
|
||||
|
||||
给action注册事件处理函数,当这个函数被触发时候,将状态提交到mutations中处理。actions里面自定义的函数接收一个context参数和要变化的形参
|
||||
|
||||
mutations是一个对象里。面的方法 都是同步事务,是更改state初始状态的唯一合法方法,具体的用法就是给里面的方法传入参数state或额外的参数
|
||||
|
||||
代码中设置全局存储方法:
|
||||
|
||||
dispatch:含有异步操作,例如向后台提交数据,写法: this.$store.dispatch('action方法名',值)
|
||||
|
||||
commit:同步操作,写法:this.$store.commit('mutations方法名',值)
|
||||
|
||||
代码中取值方法:
|
||||
getters: 写法:this.$store.getters.getTopMainHeightFn
|
||||
*/
|
||||
|
||||
/*
|
||||
多级嵌套组件监听用法
|
||||
父组件:Main.vue
|
||||
某子组件:Child.vue
|
||||
父组件进行变量赋值
|
||||
this.$store.commit('setTopMainHeightFn',this.bodyHeight);// 更新主体高度存储
|
||||
子组件获取并监听父组件设置的变量变化
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
console.log("old " + old);
|
||||
console.log("new " + newd);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
41
com.actionsoft.apps.coe.pal/views/DevGetSession.vue
Normal file
41
com.actionsoft.apps.coe.pal/views/DevGetSession.vue
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- 获取session方法,不可删除 -->
|
||||
<template>
|
||||
<div class="devGetSession">
|
||||
正在获取session
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import router from "../router/index";
|
||||
import awsuiAxios from "../awsuiAxios/index";
|
||||
import store from "../store/index";
|
||||
awsuiAxios
|
||||
.post({
|
||||
url: "jd",
|
||||
data: {
|
||||
userid: devUserInfo.userid,
|
||||
pwd: devUserInfo.pwd,
|
||||
lang: "cn",
|
||||
cmd: "com.actionsoft.apps.getsession.get",
|
||||
deviceType: "pc",
|
||||
},
|
||||
})
|
||||
.then(function (r) {
|
||||
// let r = response.data;
|
||||
if (r.result == "error") {
|
||||
//$.simpleAlert(r.msg, "error");
|
||||
alert("获取session错误:" + r.msg);
|
||||
} else {
|
||||
store.commit("edit", { sessionId: r.data.sid });
|
||||
router.replace("/");
|
||||
}
|
||||
});
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dwList: [], //dw的获取列表
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
265
com.actionsoft.apps.coe.pal/views/Main.vue
Normal file
265
com.actionsoft.apps.coe.pal/views/Main.vue
Normal file
@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<div id="main" @click="clickDomEvent">
|
||||
<el-container>
|
||||
<!-- 导航区域 -->
|
||||
<el-header id="header" height="56px" style="padding: 0px;">
|
||||
<Navigation ref="navigation"></Navigation>
|
||||
</el-header>
|
||||
<el-main :style="{padding:0,height:bodyHeight}" style="position: relative;">
|
||||
<!--展开应用中心-->
|
||||
<div class="main">
|
||||
<awsui-sidebar
|
||||
:visible.sync="drawer"
|
||||
:direction="direction"
|
||||
size="100%"
|
||||
:append-to-body=false
|
||||
:show-close=false
|
||||
:withHeader=false
|
||||
:wrapper-closable=false
|
||||
:modal=false
|
||||
@opened="openAppIframe">
|
||||
<div style="position: relative;width: 100%;height: 100%;">
|
||||
<!-- <div style="cursor:pointer;height: 20px;width: 15px;background-color: #F5F7FA;position: absolute;top: 10px;line-height: 20px;vertical-align: middle;" @click="closeAppDrawer">-->
|
||||
<!-- <i class="iconfont"></i>-->
|
||||
<!-- </div>-->
|
||||
<div id="appContent" v-if="nonAppComponent == ''" key="appContent" style="width: 100%;height: 100%;">
|
||||
</div>
|
||||
<div id="nonAppComponent" v-if="nonAppComponent != ''" key="nonAppComponent" style="width: 100%;height: 100%;">
|
||||
<component ref="component" :is="nonAppComponent" :wsId="wsId"></component>
|
||||
</div>
|
||||
</div>
|
||||
</awsui-sidebar>
|
||||
</div>
|
||||
<!--展开PAL小组管理-->
|
||||
<div class="main">
|
||||
<awsui-sidebar
|
||||
:visible.sync="cooperation.drawer"
|
||||
:direction="direction"
|
||||
size="100%"
|
||||
:append-to-body=false
|
||||
:show-close=false
|
||||
:withHeader=false
|
||||
:wrapper-closable=false
|
||||
:modal=false
|
||||
@opened="openCooperationIframe">
|
||||
<div style="position: relative;width: 100%;height: 100%;">
|
||||
<div style="cursor:pointer;height: 20px;width: 15px;background-color: #F5F7FA;position: absolute;top: 10px;line-height: 20px;vertical-align: middle;" @click="closeCooperationDrawer">
|
||||
<i class="iconfont"></i>
|
||||
</div>
|
||||
<div id="cooperationContent" v-if="nonAppComponent == ''" key="cooperationContent" style="width: 100%;height: 100%;">
|
||||
</div>
|
||||
</div>
|
||||
</awsui-sidebar>
|
||||
</div>
|
||||
<!--修改密码-->
|
||||
<div>
|
||||
<PwdChange ref="pwdChange"></PwdChange>
|
||||
</div>
|
||||
<router-view :key="key"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Navigation from "./system/Navigation";
|
||||
import PwdChange from "./system/PwdChange";
|
||||
import WorkspaceBackup from "./workspace/WorkspaceBackup";
|
||||
import Mark from "./repository/RepositorySecurityMark";
|
||||
import Recycle from "./recycle/Recycle";
|
||||
import Method from "./method/Method";
|
||||
import awsuiAxios from "../awsuiAxios";
|
||||
export default {
|
||||
name: 'Main',
|
||||
components: {PwdChange, Navigation, WorkspaceBackup, Recycle, Method,Mark},
|
||||
data() {
|
||||
return {
|
||||
bodyHeight : (document.documentElement.clientHeight - 56) + 'px',
|
||||
drawer: false,
|
||||
direction: 'rtl',
|
||||
nonAppComponent: '',
|
||||
wsId: '',
|
||||
cooperation: {
|
||||
drawer: false,
|
||||
cooperationContent: '',
|
||||
},
|
||||
mainTimer: null, // 主体内容加载定时器,用于判断Navigation是否加载完成,加载完成wsId不为空或者timeNum为0(10秒钟之后未加载成功)时停止执行
|
||||
mainTimerNum: 200 // 设置定时器执行次数,
|
||||
}
|
||||
},
|
||||
provide: function () {
|
||||
return {
|
||||
openAppDrawer: this.openAppDrawer,
|
||||
closeAppDrawer: this.closeAppDrawer,
|
||||
openPwdConfig: this.openPwdConfig,
|
||||
logout: this.logout,
|
||||
openCooperationDrawer: this.openCooperationDrawer,
|
||||
closeCooperationDrawer: this.closeCooperationDrawer,
|
||||
saveAccessOpLog: this.saveAccessOpLog
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
key() {
|
||||
return new Date() + '';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
// 是否强制修改密码
|
||||
if (forceChangePwd) {
|
||||
this.openPwdConfig();
|
||||
}
|
||||
this.$store.commit('setTopMainHeightFn',this.bodyHeight);// 更新主体高度存储
|
||||
this.resize();
|
||||
// 火狐浏览器拖拽问题
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/****应用中心****/
|
||||
openAppDrawer() {
|
||||
if (document.getElementById("appContent") != undefined) {
|
||||
document.getElementById("appContent").innerHTML = '';
|
||||
}
|
||||
this.drawer = true;
|
||||
},
|
||||
openAppIframe() {
|
||||
this.wsId = this.$store.getters.getWsIdFn;
|
||||
const that = this;
|
||||
let nav = that.$refs.navigation;
|
||||
if (nav.currApp.clazzName == 'method') {// 建模方法
|
||||
that.nonAppComponent = '';
|
||||
that.$nextTick(()=> {
|
||||
that.nonAppComponent = 'Method'
|
||||
});
|
||||
that.saveAccessOpLog('method');
|
||||
} else if (nav.currApp.clazzName == 'backup'){// 备份
|
||||
that.nonAppComponent = '';
|
||||
that.$nextTick(() => {
|
||||
that.nonAppComponent = 'WorkspaceBackup';
|
||||
});
|
||||
that.saveAccessOpLog('backup');
|
||||
} else if (nav.currApp.clazzName == 'recycle') {// 回收站
|
||||
that.nonAppComponent = '';
|
||||
that.$nextTick(()=> {
|
||||
that.nonAppComponent = 'Recycle'
|
||||
});
|
||||
that.saveAccessOpLog('recycle');
|
||||
} else if (nav.currApp.clazzName == 'mark') {//密级标定
|
||||
that.nonAppComponent = '';
|
||||
that.$nextTick(()=> {
|
||||
that.nonAppComponent = 'Mark'
|
||||
});
|
||||
that.saveAccessOpLog('mark');
|
||||
} else {
|
||||
that.nonAppComponent = '';
|
||||
that.$nextTick(() => {
|
||||
document.getElementById("appContent").innerHTML = '';
|
||||
let src = wHref + '?' + "sid=" + that.$store.state.sessionId + "&wsId=" + that.$store.getters.getWsIdFn + "&teamId=" + that.$store.getters.getTeamIdFn + "&clazzName=" + nav.currApp.clazzName + "&cmd=com.actionsoft.apps.coe.pal_app_page";
|
||||
document.getElementById("appContent").innerHTML = '<iframe id="appIframe" width="100%" height="100%" name="appIframe" style="border:0;" src="' + src + '"></iframe>';
|
||||
});
|
||||
}
|
||||
},
|
||||
closeAppDrawer() {
|
||||
this.nonAppComponent = '';
|
||||
this.drawer = false;
|
||||
this.$refs.navigation.showAppDetail = false;
|
||||
},
|
||||
/****PAL小组管理中心****/
|
||||
openCooperationDrawer() {
|
||||
this.wsId = this.$store.getters.getWsIdFn;
|
||||
if (document.getElementById("cooperationContent") != undefined) {
|
||||
document.getElementById("cooperationContent").innerHTML = '';
|
||||
}
|
||||
this.cooperation.drawer = true;
|
||||
},
|
||||
openCooperationIframe() {
|
||||
const that = this;
|
||||
let nav = that.$refs.navigation;
|
||||
that.wsId = nav.wsValue;
|
||||
that.cooperation.cooperationContent = '';
|
||||
that.$nextTick(() => {
|
||||
document.getElementById("cooperationContent").innerHTML = '';
|
||||
let src = wHref + '?' + 'sid=' + this.$store.state.sessionId + '&mainPage=manage&cmd=com.actionsoft.apps.coe.pal.cooperation_main';
|
||||
document.getElementById("cooperationContent").innerHTML = '<iframe id="cooperationIframe" width="100%" height="100%" name="cooperationIframe" style="border:0;" src="' + src + '"></iframe>';
|
||||
});
|
||||
},
|
||||
closeCooperationDrawer() {
|
||||
this.cooperation.cooperationContent = '';
|
||||
this.cooperation.drawer = false;
|
||||
this.$refs.navigation.cooperationDrawer.showCooperationDetail = false;
|
||||
},
|
||||
|
||||
handleClose(done) {
|
||||
done();
|
||||
},
|
||||
/****密码修改****/
|
||||
openPwdConfig() {
|
||||
this.$refs.pwdChange.pwdConfig = true;
|
||||
},
|
||||
/****退出登录****/
|
||||
logout() {
|
||||
const that = this;
|
||||
that.$confirm('确定离开系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const src = wHref + "?sid=" + that.$store.state.sessionId + "&cmd=com.actionsoft.apps.coe.pal_user_logout";
|
||||
window.location.replace(src);
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
resize() {// 窗口监听window.resize
|
||||
const that = this
|
||||
let resizeTimer = null;
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
if (resizeTimer) clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(function(){
|
||||
that.bodyHeight = (document.documentElement.clientHeight - 56) + 'px';
|
||||
that.$store.commit('setTopMainHeightFn',that.bodyHeight);
|
||||
} , 400);
|
||||
})()
|
||||
}
|
||||
},
|
||||
clickDomEvent() {// 点击整个dom的事件,通过vuex进行全局状态管理
|
||||
this.$store.commit('setNavigationQueryVisibleFn',false);// 导航栏输入框快速搜索结果隐藏
|
||||
},
|
||||
saveAccessOpLog(moduleCategory) {// 记录访问各模块的审计日志
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_access_log_save',
|
||||
moduleCategory: moduleCategory
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#main {
|
||||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
/*text-align: center;*/
|
||||
color: #2c3e50;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.main >>> .awsui-sidebar__wrapper {
|
||||
position: static;
|
||||
}
|
||||
</style>
|
||||
60
com.actionsoft.apps.coe.pal/views/batch/create.vue
Normal file
60
com.actionsoft.apps.coe.pal/views/batch/create.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<awsui-dialog
|
||||
title="批量创建"
|
||||
height="700px"
|
||||
width="900px"
|
||||
:visible.sync="dialogVisible"
|
||||
:border="false"
|
||||
:before-close="handleClose"
|
||||
:destroy-on-close=true>
|
||||
<iframe id="batchCreateIframe" style="border: 0px;width: 100%;height: 695px;" name="batchCreateIframe" :src="src"></iframe>
|
||||
</awsui-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "create",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
methodCategory: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
src: wHref + '?' + 'sid=' + this.$store.state.sessionId + '&mainPage=create&cmd=com.actionsoft.apps.coe.pal.batch_main_page&methodCategory=' + this.methodCategory + '&wsId=' + this.$store.getters.getWsIdFn + '&teamId=' + this.$store.getters.getTeamIdFn,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const that = this;
|
||||
// 注册关闭批量创建窗口通用方法
|
||||
window.closeBatchCreateFn = function (params) {
|
||||
that.closeDlalog();
|
||||
that.dialogVisible = false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.closeDlalog();
|
||||
done();
|
||||
},
|
||||
closeDlalog() {// 关闭
|
||||
this.$emit('getResult');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
60
com.actionsoft.apps.coe.pal/views/batch/replace.vue
Normal file
60
com.actionsoft.apps.coe.pal/views/batch/replace.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<awsui-dialog
|
||||
title="批量替换"
|
||||
height="700px"
|
||||
width="900px"
|
||||
:visible.sync="dialogVisible"
|
||||
:border="false"
|
||||
:before-close="handleClose"
|
||||
:destroy-on-close=true>
|
||||
<iframe id="batchRelplaceIframe" style="border: 0px;width: 100%;height: 695px;" name="batchRelplaceIframe" :src="src"></iframe>
|
||||
</awsui-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "replace",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
methodCategory: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
src: wHref + '?' + 'sid=' + this.$store.state.sessionId + '&mainPage=replace&cmd=com.actionsoft.apps.coe.pal.batch_main_page&methodCategory=' + this.methodCategory + '&wsId=' + this.$store.getters.getWsIdFn + '&teamId=' + this.$store.getters.getTeamIdFn,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const that = this;
|
||||
// 注册关闭批量创建窗口通用方法
|
||||
window.closeBatchReplaceFn = function (params) {
|
||||
that.closeDlalog();
|
||||
that.dialogVisible = false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.closeDlalog();
|
||||
done();
|
||||
},
|
||||
closeDlalog() {// 关闭
|
||||
this.$emit('getResult');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div id="cooperation" :style="{'width': '100%', 'height': mainHeight}">
|
||||
<iframe id="coopIframe" width="100%" :height="(parseInt(mainHeight) - 4) + 'px'" name="coopIframe" style="border:0;" :src="src"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "cooperationCreate",
|
||||
data() {
|
||||
return {
|
||||
src: wHref + '?' + 'sid=' + this.$store.state.sessionId + '&mainPage=create&cmd=com.actionsoft.apps.coe.pal.cooperation_main',
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 4) + 'px',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - 4) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div id="cooperationUpdate" :style="{'width': '100%', 'height': mainHeight}">
|
||||
<iframe id="coopIframe" width="100%" :height="(parseInt(mainHeight) - 4) + 'px'" name="coopIframe" style="border:0;" :src="src"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "CooperationUpdate",
|
||||
data() {
|
||||
return {
|
||||
src: wHref + '?' + 'sid=' + this.$store.state.sessionId + '&mainPage=update&cmd=com.actionsoft.apps.coe.pal.cooperation_main',
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 4) + 'px',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - 4) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
168
com.actionsoft.apps.coe.pal/views/manage/Manage.vue
Normal file
168
com.actionsoft.apps.coe.pal/views/manage/Manage.vue
Normal file
@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<el-container :style="{'border': '1px solid #eee', 'width': '100%', 'height': '100%'}" id="manage">
|
||||
<el-aside id="menu" width="200px">
|
||||
<el-menu :default-openeds="defaultOpendMenu"
|
||||
@open="setDefaultOpenMenu"
|
||||
@close="removeDefaultOpenMenu">
|
||||
<template v-if="!isSecAdminUser">
|
||||
<el-menu-item id="workspaceManage" index="workspaceManage" @click="goTo('workspaceManage')">
|
||||
<i class="iconfont icon-zichanliebiao icon"></i>
|
||||
<span slot="title">资产库管理</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="cooperationManage" v-if="isCooperationActive" @click="goTo('cooperationManage')">
|
||||
<i class="iconfont icon-icon-test icon"></i>
|
||||
<span slot="title">小组管理</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
|
||||
|
||||
<el-submenu index="org">
|
||||
<template slot="title">
|
||||
<i class="iconfont icon-zuzhi icon"></i>
|
||||
<span>组织管理</span>
|
||||
</template>
|
||||
<el-menu-item index="palUser" @click="goTo('palUser')">PAL用户</el-menu-item>
|
||||
<el-menu-item v-if="!isSecAdminUser" index="bpmOrg" @click="goTo('bpmOrg')">BPM平台组织架构</el-menu-item>
|
||||
</el-submenu>
|
||||
<template v-if="!isSecAdminUser">
|
||||
<el-submenu index="publisher" v-if="isPublishActive">
|
||||
<template slot="title">
|
||||
<i class="iconfont icon-liuchengmenhu icon"></i>
|
||||
<span>门户设置</span>
|
||||
</template>
|
||||
<el-menu-item index="themeStyle" @click="goTo('themeStyle')">主题风格</el-menu-item>
|
||||
<el-menu-item index="commonRepository" @click="goTo('commonRepository')">常用流程</el-menu-item>
|
||||
<el-menu-item index="userGroup" @click="goTo('userGroup')">浏览用户</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu index="mappingmanagement" v-if="isMappingmanageActive">
|
||||
<template slot="title">
|
||||
<i class="iconfont icon-guanlian icon"></i>
|
||||
<span>关联管理</span>
|
||||
</template>
|
||||
<el-menu-item index="correlated" @click="goTo('correlated')">已关联流程</el-menu-item>
|
||||
<el-menu-item index="palNotCorrelated" @click="goTo('palNotCorrelated')">PAL未关联流程</el-menu-item>
|
||||
<el-menu-item index="bpmNotCorrelated" @click="goTo('bpmNotCorrelated')">BPM未关联流程</el-menu-item>
|
||||
</el-submenu>
|
||||
</template>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
<router-view :key="this.$route.path"></router-view>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import WorkspaceManage from "../workspace/WorkspaceManage";
|
||||
import User from "../user/User";
|
||||
import BPMOrg from "../user/BPMOrg";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import MappingManagement from "../mappingManagement/MappingManagement";
|
||||
export default {
|
||||
name: "Manage",
|
||||
components: {WorkspaceManage, User, BPMOrg, MappingManagement},
|
||||
data() {
|
||||
return {
|
||||
defaultOpendMenu: [],
|
||||
isPublishActive: false,
|
||||
isCooperationActive: false,
|
||||
isMappingmanageActive: false,
|
||||
isSecAdminUser: isSecAdminUser
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {// 初始化侧边栏数据项
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_pl_manage_app_data'
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
let data = ro.data;
|
||||
that.isPublishActive = data.isPublishActive;
|
||||
that.isCooperationActive = data.isCooperationActive;
|
||||
that.isMappingmanageActive = data.isMappingmanageActive;
|
||||
// 默认激活第一个资产库管理
|
||||
document.getElementById("workspaceManage").click();
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
goTo(path) {
|
||||
this.saveAccessOpLog(path);
|
||||
if (path == 'workspaceManage') {
|
||||
this.$router.push({path: 'workspaceManage'});
|
||||
} else if (path == 'cooperationManage') {
|
||||
this.$router.push({path: 'cooperationUpdate'});
|
||||
} else if (path == 'palUser') {
|
||||
this.$router.push({path: 'palUser'})
|
||||
} else if (path == 'bpmOrg') {
|
||||
this.$router.push({path: 'bpmOrg'});
|
||||
} else if (path == 'correlated' || path == 'palNotCorrelated' || path == 'bpmNotCorrelated') {
|
||||
this.$router.push({name: 'mappingManagement_' + path, params: {'dataType': path}});
|
||||
} else if (path == 'themeStyle') {
|
||||
this.$router.push({path: 'themeStyle'});
|
||||
} else if (path == 'commonRepository') {
|
||||
this.$router.push({path: 'commonRepository'});
|
||||
} else if (path == 'userGroup') {
|
||||
this.$router.push({path: 'userGroup'});
|
||||
}
|
||||
},
|
||||
setDefaultOpenMenu(index, path) {// 展开菜单之后设置默认展开,防止点击其他菜单此菜单被自动关闭
|
||||
if (this.defaultOpendMenu.indexOf(index) == -1) {
|
||||
this.defaultOpendMenu.push(index);
|
||||
}
|
||||
},
|
||||
saveAccessOpLog(path) {// 记录访问各模块的审计日志
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_access_log_save',
|
||||
moduleCategory: path
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
removeDefaultOpenMenu(index, path) {//
|
||||
if (this.defaultOpendMenu.indexOf(index) != -1) {// 关闭菜单之后去除默认展开
|
||||
this.defaultOpendMenu.splice(this.defaultOpendMenu.indexOf(index), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-header {
|
||||
background-color: #B3C0D1;
|
||||
color: #333;
|
||||
line-height: 60px;
|
||||
}
|
||||
.el-aside {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
#menu .el-menu{
|
||||
border-right: 0px solid #e6e6e6;
|
||||
}
|
||||
#manage #menu {
|
||||
border-right: 1px solid #e6e6e6;
|
||||
}
|
||||
.icon {
|
||||
margin-right: 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div style="width: 100%;height: 100%;">
|
||||
<iframe id="iframe" width="100%" height="100%" name="iframe" style="border:0;" :src="src"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "MappingManagement",
|
||||
data() {
|
||||
return {
|
||||
src: './w?sid=' + this.$store.state.sessionId + '&cmd=com.actionsoft.apps.coe.pal.mappingmanagement_main_page&dataType=' + this.$route.params.dataType
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
204
com.actionsoft.apps.coe.pal/views/method/Method.vue
Normal file
204
com.actionsoft.apps.coe.pal/views/method/Method.vue
Normal file
@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<el-container id="method" class="text-general-color" v-loading="loading">
|
||||
<el-header :style="{height: headerHeight}">
|
||||
<el-row :style="{height: headerHeight}">
|
||||
<el-col :span="8">
|
||||
<div :style="{height: headerHeight, 'line-height': headerHeight}" style="vertical-align: middle;">
|
||||
<span>建模方法: </span>
|
||||
<el-dropdown
|
||||
placement="bottom-end"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<span class="text-linker-color" style="cursor: pointer;">{{activeMethod.name}}</span>
|
||||
<i class="awsui-iconfont" style="font-size:12px;cursor: pointer;"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" style="min-width: 200px;max-height: 500px;overflow-y: auto;">
|
||||
<template v-for="item in methodData">
|
||||
<el-dropdown-item v-if="item.type=='group'" :disabled=true style="font-size: 12px;color: #000;height: 80%;"><b>{{item.name}}</b></el-dropdown-item>
|
||||
<el-dropdown-item v-else @click.native="changeMethod(item.id, item.name)">{{item.name}}</el-dropdown-item>
|
||||
</template>
|
||||
<el-dropdown-item class="text-linker-color" divided @click.native="createMethod()"><i class="awsui-iconfont" style="font-size: 12px;"></i>新增建模方法</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div :style="{height: headerHeight, 'line-height': headerHeight}" style="text-align: center;vertical-align: middle;">
|
||||
<div :class="{'button-general-color': activeType == 'methodObject', 'text-color-white': activeType == 'methodObject'}"
|
||||
style="display: inline-block;border-radius: 2px;padding: 0 15px;width: 70px;height: 28px;line-height: 28px;vertical-align: middle;cursor: pointer;"
|
||||
@click="changeMethodType('methodObject')">
|
||||
<span>建模对象</span>
|
||||
</div>
|
||||
<div :class="{'button-general-color': activeType == 'methodAttribute', 'text-color-white': activeType == 'methodAttribute'}"
|
||||
style="display: inline-block;border-radius: 2px;margin: 0 20px;width: 70px;padding: 0 15px;height: 28px;line-height: 28px;vertical-align: middle;cursor: pointer;"
|
||||
@click="changeMethodType('methodAttribute')">
|
||||
<span>数据特性</span>
|
||||
</div>
|
||||
<div :class="{'button-general-color': activeType == 'methodLink', 'text-color-white': activeType == 'methodLink'}"
|
||||
style="display: inline-block;border-radius: 2px;padding: 0 15px;width: 70px;height: 28px;line-height: 28px;vertical-align: middle;cursor: pointer;"
|
||||
@click="changeMethodType('methodLink')">
|
||||
<span>连线关系</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div v-if="activeType == 'methodObject'" :style="{height: headerHeight, 'line-height': headerHeight}" style="text-align: right;vertical-align: middle;">
|
||||
<el-input
|
||||
style="width: 300px;"
|
||||
placeholder="请输入形状名称进行检索"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchInput"
|
||||
@input="search()"
|
||||
size="small"
|
||||
clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-if="activeType == 'methodAttribute'" :style="{height: headerHeight, 'line-height': headerHeight}" style="vertical-align: middle;text-align: right;">
|
||||
<el-dropdown
|
||||
placement="bottom-start"
|
||||
trigger="click"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<span class="text-general-color" style="cursor: pointer;">{{methodAttribute.value.name}}</span>
|
||||
<i class="awsui-iconfont" style="font-size:12px;cursor: pointer;"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" style="min-width: 120px;max-height: 500px;overflow-y: auto;">
|
||||
<template v-for="item in methodAttribute.opts">
|
||||
<el-dropdown-item class="el-dropdown-row" @click.native="changeAttrScope(item)"><div style="height: 100%;width: 100%;font-size: 14px;">{{item.name}}</div></el-dropdown-item>
|
||||
</template>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<MethodObject v-if="activeType== 'methodObject'" ref="methodObject" :parentHeaderHeight="headerHeight" :methodId="activeMethod.id" :methodName="activeMethod.name" :searchInput="searchInput"/>
|
||||
<MethodAttribute v-if="activeType== 'methodAttribute'" ref="methodObject" :parentHeaderHeight="headerHeight" :methodId="activeMethod.id" :methodName="activeMethod.name" :searchInput="searchInput" :methodDataType="methodAttribute.value.id"/>
|
||||
<MethodLink v-if="activeType== 'methodLink'" ref="methodLink" :parentHeaderHeight="headerHeight" :methodId="activeMethod.id" :methodName="activeMethod.name" :searchInput="searchInput"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MethodAttribute from "./MethodAttribute";
|
||||
import MethodLink from "./MethodLink";
|
||||
import MethodObject from "./MethodObject";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "Method",
|
||||
components: {MethodObject, MethodLink, MethodAttribute},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
headerHeight: '40px',
|
||||
activeMethod: {
|
||||
id: '',
|
||||
name: ''
|
||||
},
|
||||
methodData: [],
|
||||
activeType: '',
|
||||
searchInput: '',
|
||||
methodAttribute: {
|
||||
value: {id: 'all', name: '全部'},
|
||||
opts: [
|
||||
{id: 'all', name: '全部'},
|
||||
{id: 'file', name: '文件属性'},
|
||||
{id: 'shape', name: '形状属性'}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initPage();
|
||||
},
|
||||
methods: {
|
||||
initPage() {// 初始化页面数据
|
||||
// 建模方法
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_data_query',
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
that.loading = false;
|
||||
if (ro.result == 'ok') {
|
||||
that.methodData = ro.data;
|
||||
that.changeMethodType('methodObject');
|
||||
for (let i = 0; i < that.methodData.length; i++) {
|
||||
if (that.methodData[i].type != 'group') {
|
||||
that.changeMethod(that.methodData[i].id, that.methodData[i].name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
alert('请求响应错误');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
},
|
||||
changeMethod(methodId, name) {
|
||||
this.searchInput = '';
|
||||
this.activeMethod.id = methodId;
|
||||
this.activeMethod.name = name;
|
||||
const temp = this.activeType;
|
||||
this.activeType = '';
|
||||
this.methodAttribute.value = this.methodAttribute.opts[0];
|
||||
this.$nextTick(function(){
|
||||
this.activeType = temp;
|
||||
});
|
||||
},
|
||||
changeMethodType(type) {
|
||||
this.searchInput = '';
|
||||
this.methodAttribute.value = this.methodAttribute.opts[0];
|
||||
this.activeType = type;
|
||||
},
|
||||
search() {
|
||||
if (this.activeType == 'methodObject') {// 模型对象
|
||||
this.$refs.methodObject.search(this.searchInput);
|
||||
} else if (this.activeType == 'methodAttribute') {// 数据属性
|
||||
this.$refs.methodAttribute.search('');// 无搜索
|
||||
} else if (this.activeType == 'methodLink') {// 连线
|
||||
this.$refs.methodLink.search('');// 无搜索
|
||||
}
|
||||
},
|
||||
changeAttrScope(item) {
|
||||
this.methodAttribute.value = item;
|
||||
},
|
||||
createMethod() {// 新建建模方法
|
||||
this.$message('敬请期待');
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
// this.tableHeight = (parseInt(newd)) - parseInt(this.headerHeight) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#method >>> .el-main {
|
||||
padding: 0px;
|
||||
}
|
||||
.text-color-white {
|
||||
color: #ffffff;
|
||||
}
|
||||
.el-dropdown-row {
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
.el-dropdown-row :hover {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
</style>
|
||||
1348
com.actionsoft.apps.coe.pal/views/method/MethodAttribute.vue
Normal file
1348
com.actionsoft.apps.coe.pal/views/method/MethodAttribute.vue
Normal file
File diff suppressed because it is too large
Load Diff
147
com.actionsoft.apps.coe.pal/views/method/MethodLink.vue
Normal file
147
com.actionsoft.apps.coe.pal/views/method/MethodLink.vue
Normal file
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<el-container
|
||||
id="methodObject"
|
||||
v-loading="loading"
|
||||
:element-loading-text="loadingText">
|
||||
<el-main style="padding: 0px 20px;">
|
||||
<el-table
|
||||
ref="table"
|
||||
highlight-current-row
|
||||
:height="tableHeight"
|
||||
:data="tableData"
|
||||
size="small">
|
||||
<el-table-column
|
||||
prop="no"
|
||||
label="序号"
|
||||
width="100"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
label="代码"
|
||||
width="130">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fromShapeId"
|
||||
label="主动名称"
|
||||
width="250">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="toShapeId"
|
||||
label="被动名称"
|
||||
min-width="250">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="outComingName"
|
||||
label="连出范围"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inComingName"
|
||||
label="连入范围"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "MethodLink",
|
||||
props: {
|
||||
parentHeaderHeight: {
|
||||
type: String,
|
||||
default: '0px'
|
||||
},
|
||||
methodId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
methodName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
searchInput: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
loadingText: "加载中",
|
||||
tableHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - parseInt(this.parentHeaderHeight)) + 'px',
|
||||
tableData: [],
|
||||
tableTempData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {// 初始化数据查询
|
||||
const that = this;
|
||||
that.loadingText = '加载中';
|
||||
that.loading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_link_data_query',
|
||||
methodId: that.methodId
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
that.loading = false;
|
||||
if (ro.result == 'ok') {
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
ro.data[i].no = i + 1;
|
||||
that.tableTempData.push(ro.data[i]);
|
||||
}
|
||||
that.search(that.searchInput);
|
||||
} else {
|
||||
alert('请求响应错误');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
},
|
||||
handleDataNo(data) {// 处理数据的序号
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].no = i+1;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
search(searchInput) {
|
||||
if (searchInput && searchInput.trim() != '') {// 根据条件搜索
|
||||
const data = [];
|
||||
for (let i = 0; i < this.tableTempData.length; i++) {
|
||||
if (this.tableTempData[i].fromShapeId.indexOf(searchInput) > -1) {
|
||||
data.push(this.tableTempData[i]);
|
||||
}
|
||||
}
|
||||
this.tableData = this.handleDataNo(data);
|
||||
} else {// 显示全部
|
||||
this.tableData = this.handleDataNo(this.tableTempData);
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.tableHeight = (parseInt(newd)) - parseInt(this.parentHeaderHeight) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
457
com.actionsoft.apps.coe.pal/views/method/MethodObject.vue
Normal file
457
com.actionsoft.apps.coe.pal/views/method/MethodObject.vue
Normal file
@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<el-container
|
||||
id="methodObject"
|
||||
v-loading="loading"
|
||||
:element-loading-text="loadingText">
|
||||
<el-header :style="{'padding': '0px 20px', height: headerHeight}">
|
||||
<div class="header-div">
|
||||
<div :style="{'background-color': icon.color}" class="icon-div-repository">
|
||||
<i class="awsui-iconfont icon-dynamic-repository" v-html="icon.code"></i>
|
||||
</div>
|
||||
<div class="div-repository-title">
|
||||
<span class="text-general-color">
|
||||
{{methodName}}
|
||||
</span>
|
||||
<p class="text-second-color header-method-id">
|
||||
<b>({{methodId}})</b>
|
||||
</p>
|
||||
</div>
|
||||
<div class="header-method-attr-config-icon">
|
||||
<el-tooltip content="文件属性配置" placement="bottom" :hide-after=2000>
|
||||
<i style="cursor: pointer;" class="iconfont" @click="handleFileAttrConfig"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main style="padding: 0px 20px;">
|
||||
<el-table
|
||||
ref="table"
|
||||
@row-click="clickTableRow"
|
||||
highlight-current-row
|
||||
:height="tableHeight"
|
||||
:data="tableData"
|
||||
size="small">
|
||||
<el-table-column
|
||||
prop="no"
|
||||
label="序号"
|
||||
width="80"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="icon"
|
||||
label="图标"
|
||||
width="130">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.icon">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
width="250">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="modelName"
|
||||
label="所属模型"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="modelId"
|
||||
label="模型ID"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
label="类型"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<div class="operate-icon-display" style="text-align: center;height: 30px;line-height: 30px;">
|
||||
<p class="text-second-color">
|
||||
<el-tooltip v-if="scope.row.showShapeConfig" content="数据显示规则配置" placement="bottom" :hide-after=2000>
|
||||
<i style="display: inline-block;cursor: pointer;margin-right: 10px;" class="iconfont" @click="handleShapeAnchorConfig(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="形状属性配置" placement="bottom" :hide-after=2000>
|
||||
<i style="display: inline-block;cursor: pointer;position: relative;font-size: 23px;top: 3px;" class="iconfont" @click="handleShapeAttrConfig(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-main>
|
||||
<awsui-sidebar
|
||||
:title=drawer.title
|
||||
:append-to-body=false
|
||||
:modal-append-to-body=false
|
||||
:destroy-on-close=true
|
||||
:modal=false
|
||||
:visible.sync="drawer.visible"
|
||||
:before-close="handleDrawerClose">
|
||||
<div v-loading="drawer.loading">
|
||||
<div id="drawerBody" style="overflow-y: auto;">
|
||||
<!-- 扩展属性 -->
|
||||
<div v-for="item in drawer.data" class="attr-row" @click="(item.isUse ? item.isUse = false : item.isUse = true)">
|
||||
<span>{{item.name}}<span class="text-second-color" style="font-size=12px;">({{item.id}})</span></span>
|
||||
<i v-if="item.isUse" class="awsui-iconfont" style="float: right;color: #4E7FF9;"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drawer-footer" :style="{'background-color': '#F2F2F2', height: drawer.footerHeight}">
|
||||
<div id="drawerFooter" style="float: right;position: relative;top: 9px;">
|
||||
<awsui-button size="large" style="width: 80px;" class="button-general-color" type="primary" :disabled="drawer.buttonDisabled" @click="saveAttrConfig">保存</awsui-button>
|
||||
<awsui-button size="large" style="width: 80px;" @click="closeDrawer">取消</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</awsui-sidebar>
|
||||
<MethodShapeAnchorDlg
|
||||
ref="methodShapeAnchorDlg"
|
||||
:visible.sync="shapeAnchorConfig.visible"
|
||||
:type="shapeAnchorConfig.type"
|
||||
:methodId="shapeAnchorConfig.methodId"
|
||||
:shapeName="shapeAnchorConfig.shapeName"
|
||||
:wsId="shapeAnchorConfig.wsId"
|
||||
v-on:cancel="shapeAnchorConfig.visible = false"
|
||||
v-on:getResult="handleSaveShapeAnchorConfig"
|
||||
/>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import MethodShapeAnchorDlg from "./MethodShapeAnchorDlg";
|
||||
|
||||
export default {
|
||||
name: "MethodObject",
|
||||
components: {MethodShapeAnchorDlg},
|
||||
props: {
|
||||
parentHeaderHeight: {
|
||||
type: String,
|
||||
default: '0px'
|
||||
},
|
||||
methodId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
methodName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
searchInput: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
loadingText: "加载中",
|
||||
headerHeight: '45px',
|
||||
tableHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 45 - parseInt(this.parentHeaderHeight)) + 'px',
|
||||
tableData: [],
|
||||
tableTempData: [],
|
||||
icon: {
|
||||
code: '',
|
||||
color: ''
|
||||
},
|
||||
drawer: {
|
||||
title: '文件属性配置',
|
||||
visible: false,
|
||||
loading: false,
|
||||
data: [],
|
||||
type: 'file',// shape,file
|
||||
shapeName: '',
|
||||
footerHeight: '50px',
|
||||
buttonDisabled: false
|
||||
},
|
||||
shapeAnchorConfig: {
|
||||
visible: false,
|
||||
type: 'commonShapeConfig',
|
||||
methodId: '',
|
||||
shapeName: '',
|
||||
wsId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {// 初始化数据查询
|
||||
const that = this;
|
||||
that.loadingText = '加载中';
|
||||
that.loading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_shape_definition_data_query',
|
||||
methodId: that.methodId
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
that.loading = false;
|
||||
if (ro.result == 'ok') {
|
||||
for (let i = 0; i < ro.data.data.length; i++) {
|
||||
ro.data.data[i].no = i + 1;
|
||||
that.tableTempData.push(ro.data.data[i]);
|
||||
}
|
||||
that.icon = ro.data.icon;
|
||||
that.search(that.searchInput);
|
||||
} else {
|
||||
alert('请求响应错误');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
},
|
||||
handleDataNo(data) {// 处理数据的序号
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].no = i+1;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
search(searchInput) {
|
||||
if (searchInput && searchInput.trim() != '') {// 根据条件搜索
|
||||
const data = [];
|
||||
for (let i = 0; i < this.tableTempData.length; i++) {
|
||||
if (this.tableTempData[i].name.indexOf(searchInput) > -1) {
|
||||
data.push(this.tableTempData[i]);
|
||||
}
|
||||
}
|
||||
this.tableData = this.handleDataNo(data);
|
||||
} else {// 显示全部
|
||||
this.tableData = this.handleDataNo(this.tableTempData);
|
||||
}
|
||||
},
|
||||
clickTableRow(row, column, event) {
|
||||
this.$refs.table.setCurrentRow(row);
|
||||
},
|
||||
/**********文件/形状属性配置***********/
|
||||
handleShapeAttrConfig(shapeName) {// 形状属性配置
|
||||
const that = this;
|
||||
that.drawer.buttonDisabled = false;
|
||||
that.drawer.data = [];
|
||||
that.drawer.title = '形状属性配置';
|
||||
that.drawer.type = 'shape';
|
||||
that.drawer.shapeName = shapeName;
|
||||
that.drawer.visible = true;
|
||||
that.$nextTick(function(){
|
||||
that.initDrawerBodyHeight();
|
||||
});
|
||||
that.drawer.loading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_shape_more_attr_config_query',
|
||||
methodId: that.methodId,
|
||||
shapeName: shapeName,
|
||||
wsId: that.$store.getters.getWsIdFn
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
that.drawer.loading = false;
|
||||
if (ro.result == 'ok') {
|
||||
that.drawer.data = ro.data;
|
||||
} else {
|
||||
alert('请求响应错误');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.drawer.loading = false;
|
||||
})
|
||||
},
|
||||
handleFileAttrConfig() {
|
||||
const that = this;
|
||||
that.drawer.buttonDisabled = false;
|
||||
that.drawer.data = [];
|
||||
that.drawer.title = '文件属性配置';
|
||||
that.drawer.type = 'file';
|
||||
that.drawer.shapeName = '';
|
||||
that.drawer.visible = true;
|
||||
that.$nextTick(function(){
|
||||
that.initDrawerBodyHeight();
|
||||
});
|
||||
that.drawer.loading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_file_more_attr_config_query',
|
||||
methodId: that.methodId,
|
||||
wsId: that.$store.getters.getWsIdFn
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
that.drawer.loading = false;
|
||||
if (ro.result == 'ok') {
|
||||
that.drawer.data = ro.data.moreAttr;
|
||||
} else {
|
||||
alert('请求响应错误');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.drawer.loading = false;
|
||||
})
|
||||
},
|
||||
saveAttrConfig() {// 保存更多配置
|
||||
const that = this;
|
||||
const type = that.drawer.type;
|
||||
if (that.drawer.data.length == 0) {
|
||||
that.$message({message: '无相关属性进行保存',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
that.drawer.buttonDisabled = true;
|
||||
that.closeDrawer();
|
||||
that.loadingText = '正在更新资产库文件'
|
||||
that.loading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_method_more_attr_config_save',
|
||||
attrData: JSON.stringify(that.drawer.data),
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
type: that.drawer.type,
|
||||
shapeName: that.drawer.shapeName,
|
||||
methodId: that.methodId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.loading = false;
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({message: '更新成功',type: 'success'});
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
closeDrawer() {// 关闭drawer
|
||||
this.drawer.visible = false;
|
||||
},
|
||||
handleDrawerClose(done) {
|
||||
done();
|
||||
},
|
||||
initDrawerBodyHeight() {
|
||||
if (document.getElementById("drawerBody") != null) {
|
||||
document.getElementById("drawerBody").style.height =
|
||||
parseInt(this.tableHeight) + parseInt(this.headerHeight) + parseInt(this.parentHeaderHeight) - 58 - parseInt(this.drawer.footerHeight) + 'px';// 68是drawer标题高度
|
||||
}
|
||||
},
|
||||
/********形状锚点配置*********/
|
||||
handleShapeAnchorConfig(shapeName) {
|
||||
this.shapeAnchorConfig.wsId = this.$store.getters.getWsIdFn;
|
||||
this.shapeAnchorConfig.methodId = this.methodId;
|
||||
this.shapeAnchorConfig.shapeName = shapeName;
|
||||
this.shapeAnchorConfig.visible = true;
|
||||
},
|
||||
handleSaveShapeAnchorConfig(result) {
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_shape_config_save',
|
||||
wsId: result.wsId,
|
||||
methodId: result.methodId,
|
||||
shapeId: result.shapeId,
|
||||
data: JSON.stringify(result.data)
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
if (ro.result == 'ok') {
|
||||
that.shapeAnchorConfig.visible = false;
|
||||
that.$message({showClose: true,message: '保存成功',type: 'success'});
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.tableHeight = (parseInt(newd)) - parseInt(this.headerHeight) - parseInt(this.parentHeaderHeight) + 'px';
|
||||
this.initDrawerBodyHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#methodObject >>> .awsui-sidebar__header {
|
||||
margin-bottom: 0px;
|
||||
padding: 15px 20px 15px 20px;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
font-size: 16px;
|
||||
}
|
||||
.icon-div-repository {
|
||||
border-radius: 50%;
|
||||
margin-left: 15px;
|
||||
display: inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.icon-dynamic-repository {
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
/*position: relative;*/
|
||||
/*top: -1px;*/
|
||||
}
|
||||
.div-repository-title {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: 10px;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.attr-row {
|
||||
padding: 10px 20px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.attr-row:hover {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.header-div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #F5F7FA;
|
||||
line-height: 43px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.header-method-id {
|
||||
display:inline-block;
|
||||
font-size:12px;
|
||||
/*-webkit-transform: scale(0.9);*/
|
||||
position: relative;
|
||||
left: 0px;
|
||||
}
|
||||
.header-method-attr-config-icon {
|
||||
display:inline-block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
vertical-align: middle;
|
||||
position:relative;
|
||||
left:10px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,695 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--main-->
|
||||
<el-dialog
|
||||
id="methodShapeAnchor"
|
||||
title="形状数据显示规则"
|
||||
:visible.sync="dialogVisible"
|
||||
append-to-body
|
||||
:close-on-press-escape=false
|
||||
:close-on-click-modal=false
|
||||
width="800px"
|
||||
:before-close="handleClose">
|
||||
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;">
|
||||
<div style="height: 38px;line-height:38px;vertical-align:middle;border-bottom: 1px solid #e9e9e9;">
|
||||
<span class="text-linker-color" style="cursor: pointer;position: relative;left: 15px;" @click="updateShapeConfig()"><i class="awsui-iconfont" style="font-size: 12px;"></i>添加</span>
|
||||
</div>
|
||||
<div style="height: 350px;overflow-y: auto;">
|
||||
<div v-if="data.length == 0" class="text-second-color" style="text-align: center;position: relative;top: 150px;">
|
||||
<i class="iconfont icon-wushuju" style="font-size: 60px;"></i>
|
||||
<p>无数据</p>
|
||||
</div>
|
||||
<div class="row-div" v-for="item in data">
|
||||
<el-row style="height: 50px;line-height:50px;vertical-align:middle;border-bottom: 1px solid #e9e9e9;">
|
||||
<el-col :span="8">
|
||||
<div>
|
||||
<div style="position: absolute;">水平</div>
|
||||
<div v-if="item.attribute.horizontal == 'mostLeft'" class='loc loc-horizontal-icon' data-loc='mostLeft'><span class="loc-point" style='left: -5px;'></span></div>
|
||||
<div v-if="item.attribute.horizontal == 'left'" class='loc loc-horizontal-icon' data-loc='left'><span class="loc-point" style='left: 0px;'></span></div>
|
||||
<div v-if="item.attribute.horizontal == 'center'" class='loc loc-horizontal-icon' data-loc='center'><span class="loc-point" style='left: 3px;'></span></div>
|
||||
<div v-if="item.attribute.horizontal == 'right'" class='loc loc-horizontal-icon' data-loc='right'><span class="loc-point" style='left: 6px;'></span></div>
|
||||
<div v-if="item.attribute.horizontal == 'mostRight'" class='loc loc-horizontal-icon' data-loc='mostRight'><span class="loc-point" style='left: 11px;'></span></div>
|
||||
<div style="position: absolute; margin-left: 70px;">垂直</div>
|
||||
<div v-if="item.attribute.verity == 'mostTop'" class='loc loc-verity-icon' data-loc='mostTop'><span class="loc-point" style='top: -5px;'></span></div>
|
||||
<div v-if="item.attribute.verity == 'top'" class='loc loc-verity-icon' data-loc='top'><span class="loc-point" style='top: 0px;'></span></div>
|
||||
<div v-if="item.attribute.verity == 'center'" class='loc loc-verity-icon' data-loc='center'><span class="loc-point" style='top: 3px;'></span></div>
|
||||
<div v-if="item.attribute.verity == 'bottom'" class='loc loc-verity-icon' data-loc='bottom'><span class="loc-point" style='top: 6px;'></span></div>
|
||||
<div v-if="item.attribute.verity == 'mostBottom'" class='loc loc-verity-icon' data-loc='mostBottom'><span class="loc-point" style='top: 11px;'></span></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<div style="height: 49px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;line-height: 49px;vertical-align: middle;">
|
||||
<template v-if="item.attribute.showType == 'text'">
|
||||
<span v-html="formatContent(item.attribute.cfgContent)"></span>
|
||||
</template>
|
||||
<template v-if="item.attribute.showType == 'attribute'">
|
||||
<span v-html="'(' + formatContent(item.attribute.attrName) + ')'"></span>
|
||||
</template>
|
||||
<template v-if="item.attribute.showType == 'icon'">
|
||||
<i class="awsui-iconfont" :style="{'font-size': '30px', color: formatIconColor(item.attribute.iconContent)}" v-html=formatIconCode(item.attribute.iconContent)></i>
|
||||
</template>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="row-operate-icon" style="display: none; height: 49px;line-height: 49px;vertical-align: middle;text-align: right;">
|
||||
<i class="awsui-iconfont" style="cursor: pointer;margin-right: 15px;" @click="updateShapeConfig(item)"></i>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="removeShapeConfig(item.id)"></i>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="submit()">确定</awsui-button>
|
||||
<awsui-button @click="cancel()">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--新增、修改形状锚点显示配置dlg-->
|
||||
<el-dialog
|
||||
id="updateShapeAnchor"
|
||||
:title="update.title"
|
||||
:visible.sync="update.visible"
|
||||
append-to-body
|
||||
:close-on-press-escape=false
|
||||
:close-on-click-modal=false
|
||||
width="500px"
|
||||
:before-close="handleUpdateClose">
|
||||
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;height: 250px;overflow-y:auto;">
|
||||
<awsui-form ref="form1" :model="update.form" label-position="top">
|
||||
<awsui-form-item label="显示位置">
|
||||
<awsui-row :gutter="15">
|
||||
<awsui-col :span="3">
|
||||
<div style="text-align: right;"><span style="color: red;">*</span>水平</div>
|
||||
</awsui-col>
|
||||
<awsui-col :span="9">
|
||||
<div>
|
||||
<el-select v-model="update.form.position.horizontal"
|
||||
placeholder="水平位置"
|
||||
size="mini">
|
||||
<el-option
|
||||
v-for="item in update.form.position.horizontalOpts"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
<div v-if="item.value == 'mostLeft'" class='update-loc update-loc-horizontal-icon' data-loc='mostLeft'><span class="loc-point" style='left: -5px;'></span></div>
|
||||
<div v-if="item.value == 'left'" class='update-loc update-loc-horizontal-icon' data-loc='left'><span class="loc-point" style='left: 0px;'></span></div>
|
||||
<div v-if="item.value == 'center'" class='update-loc update-loc-horizontal-icon' data-loc='center'><span class="loc-point" style='left: 3px;'></span></div>
|
||||
<div v-if="item.value == 'right'" class='update-loc update-loc-horizontal-icon' data-loc='right'><span class="loc-point" style='left: 6px;'></span></div>
|
||||
<div v-if="item.value == 'mostRight'" class='update-loc update-loc-horizontal-icon' data-loc='mostRight'><span class="loc-point" style='left: 11px;'></span></div>
|
||||
<span>{{item.label}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</awsui-col>
|
||||
<awsui-col :span="3">
|
||||
<div style="text-align: right;"><span style="color: red;">*</span>垂直</div>
|
||||
</awsui-col>
|
||||
<awsui-col :span="9">
|
||||
<div>
|
||||
<el-select v-model="update.form.position.verity"
|
||||
placeholder="垂直位置"
|
||||
size="mini">
|
||||
<el-option
|
||||
v-for="item in update.form.position.verityOpts"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
<div v-if="item.value == 'mostTop'" class='update-loc update-loc-verity-icon' data-loc='mostTop'><span class="loc-point" style='top: -5px;'></span></div>
|
||||
<div v-if="item.value == 'top'" class='update-loc update-loc-verity-icon' data-loc='top'><span class="loc-point" style='top: 0px;'></span></div>
|
||||
<div v-if="item.value == 'center'" class='update-loc update-loc-verity-icon' data-loc='center'><span class="loc-point" style='top: 3px;'></span></div>
|
||||
<div v-if="item.value == 'bottom'" class='update-loc update-loc-verity-icon' data-loc='bottom'><span class="loc-point" style='top: 6px;'></span></div>
|
||||
<div v-if="item.value == 'mostBottom'" class='update-loc update-loc-verity-icon' data-loc='mostBottom'><span class="loc-point" style='top: 11px;'></span></div>
|
||||
<span>{{item.label}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</awsui-col>
|
||||
</awsui-row>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="显示方式">
|
||||
<awsui-select v-model="update.form.showType.value" :options="update.form.showType.opts" @change="changeShowType"></awsui-select>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item v-show="update.form.showType.value == 'text'" label="文本信息">
|
||||
<awsui-input v-model="update.form.cfgContent" type="textarea" placeholder="请输入不超过200个字符的文本信息"></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item v-show="update.form.showType.value == 'attribute'" label="属性选择">
|
||||
<el-popover
|
||||
ref="attrPopover"
|
||||
placement="bottom"
|
||||
width="413"
|
||||
popperClass="methodShapeAnchorUpdateAttrPopover"
|
||||
:visible-arrow="false"
|
||||
@after-enter="handleInitAttrTree"
|
||||
trigger="click">
|
||||
<div v-loading="attrTreeLoading" style="height: 168px;overflow: auto;">
|
||||
<div style="margin: 0 5px;">
|
||||
<el-tree
|
||||
:data="attrTreeData"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
empty-text="请先配置形状的数据属性"
|
||||
:props="attrTreeProps"
|
||||
@node-click="handleNodeClick">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': data.iconColor}" v-html="node.data.iconCode"></i>
|
||||
<span>{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="reference">
|
||||
<awsui-input v-model="update.form.attrName" readonly placeholder="点击选择需要在该位置显示的属性"></awsui-input>
|
||||
</div>
|
||||
</el-popover>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item v-show="update.form.showType.value == 'icon'" label="图标选择">
|
||||
<el-popover
|
||||
ref="popover"
|
||||
placement="bottom"
|
||||
width="413"
|
||||
popperClass="methodShapeAnchorUpdatePopover"
|
||||
:visible-arrow="false"
|
||||
trigger="click">
|
||||
<div>
|
||||
<div v-for="item in update.form.iconInfo.opts" style="display: inline-block;margin: 0 5px;">
|
||||
<i class="awsui-iconfont" style="font-size: 30px;cursor: pointer;" :style="{color: item.color}" v-html="item.code" @click="handleSetIcon(item)"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="reference" style="height: 36px;line-height: 32px;vertical-align: middle;width: 436px;border: 1px solid #e9e9e9">
|
||||
<div style="display: inline-block;position: relative;top: 2px;margin-left: 5px;">
|
||||
<i class="awsui-iconfont" :style="{'font-size': '30px', color: update.form.iconInfo.value.color}" v-html="update.form.iconInfo.value.code"></i>
|
||||
</div>
|
||||
<i class="el-icon-arrow-down column-arrow-down" style="float: right;"></i>
|
||||
</div>
|
||||
</el-popover>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
<awsui-form v-show="update.form.showType.value == 'attribute'" ref="form2" :model="update.form">
|
||||
<awsui-form-item label="显示属性名">
|
||||
<awsui-row :gutter="15">
|
||||
<awsui-col :span="3" :offset="16">
|
||||
<div>
|
||||
<awsui-switch activeColor="#4E7FF9" v-model="update.form.isShowAttrName"></awsui-switch>
|
||||
</div>
|
||||
</awsui-col>
|
||||
</awsui-row>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="saveUpdateShapeConfig">确定</awsui-button>
|
||||
<awsui-button @click="update.visible=false">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "MethodShapeAnchorDlg",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
methodId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
wsId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shapeName: {// 形状定义的唯一标识,历史原因shapId与shapeName意义相同
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shapeObjId: {// 具体形状id
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
data: [],
|
||||
attrTreeLoading: false,
|
||||
update: {
|
||||
visible: false,
|
||||
title: '添加',
|
||||
id: '',// 行主键,为空则新增,不为空则修改
|
||||
form: {
|
||||
position: {
|
||||
horizontal: '',
|
||||
horizontalOpts: [
|
||||
{
|
||||
label: '左外边',
|
||||
value: 'mostLeft'
|
||||
},
|
||||
{
|
||||
label: '左内边',
|
||||
value: 'left'
|
||||
},
|
||||
{
|
||||
label: '中间',
|
||||
value: 'center'
|
||||
},
|
||||
{
|
||||
label: '右内边',
|
||||
value: 'right'
|
||||
},
|
||||
{
|
||||
label: '右外边',
|
||||
value: 'mostRight'
|
||||
}
|
||||
],
|
||||
verity: '',
|
||||
verityOpts: [
|
||||
{
|
||||
label: '上外边',
|
||||
value: 'mostTop'
|
||||
},
|
||||
{
|
||||
label: '上内边',
|
||||
value: 'top'
|
||||
},
|
||||
{
|
||||
label: '中间',
|
||||
value: 'center'
|
||||
},
|
||||
{
|
||||
label: '下内边',
|
||||
value: 'bottom'
|
||||
},
|
||||
{
|
||||
label: '下外边',
|
||||
value: 'mostBottom'
|
||||
}
|
||||
]
|
||||
},
|
||||
showType: {
|
||||
value: 'text',
|
||||
opts: [
|
||||
{
|
||||
value: 'text',
|
||||
label: '文本信息'
|
||||
},
|
||||
{
|
||||
value: 'attribute',
|
||||
label: '属性信息'
|
||||
},
|
||||
{
|
||||
value: 'icon',
|
||||
label: '图标'
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
cfgContent: '',
|
||||
attrName: '',
|
||||
attrKey: '',
|
||||
isShowAttrName: false,
|
||||
iconInfo: {
|
||||
value: {},
|
||||
opts: [
|
||||
{code: '',color: '#1296DB'},//提示
|
||||
{code: '',color: '#EA9518'},//标签
|
||||
{code: '',color: '#EA9518'},//反对
|
||||
{code: '',color: '#1296DB'},//减少
|
||||
{code: '',color: '#1296DB'},//播放
|
||||
{code: '',color: '#EA9518'},//警告
|
||||
{code: '',color: '#D81E06'},//删除
|
||||
{code: '',color: '#1296DB'},//群组
|
||||
{code: '',color: '#1296DB'},//上传
|
||||
{code: '',color: '#707070'},//提示
|
||||
{code: '',color: '#D81E06'},//停止
|
||||
{code: '',color: '#00c853'},//完成
|
||||
{code: '',color: '#FA8072'},//喜欢
|
||||
{code: '',color: '#00c853'},//下载
|
||||
{code: '',color: '#00c853'},//修改
|
||||
{code: '',color: '#082E54'},//邮件
|
||||
{code: '',color: '#EA9518'},//暂停
|
||||
{code: '',color: '#FA8072'},//赞同
|
||||
{code: '',color: '#00c853'},//增加
|
||||
{code: '',color: '#1296DB'},//上
|
||||
{code: '',color: '#1296DB'},//下
|
||||
{code: '',color: '#1296DB'},//左
|
||||
{code: '',color: '#1296DB'},//右
|
||||
{code: '',color: '#7AA7AA'},//进度1
|
||||
{code: '',color: '#7AA7AA'},//进度2
|
||||
{code: '',color: '#7AA7AA'},//进度3
|
||||
{code: '',color: '#7AA7AA'},//进度4
|
||||
{code: '',color: '#7AA7AA'},//进度5
|
||||
{code: '',color: '#7AA7AA'},//进度6
|
||||
{code: '',color: '#7AA7AA'},//进度7
|
||||
{code: '',color: '#7AA7AA'},//进度8
|
||||
{code: '',color: '#E9433F'},//红旗帜
|
||||
{code: '',color: '#FFAE03'},//橙黄旗帜
|
||||
{code: '',color: '#F4EA2A'},//黄旗帜
|
||||
{code: '',color: '#00C853'},//绿旗帜
|
||||
{code: '',color: '#1296DB'},//蓝旗帜
|
||||
{code: '',color: '#082E54'},//深蓝旗帜
|
||||
{code: '',color: '#88147F'},//紫旗帜
|
||||
{code: '',color: '#7DABB1'},//浅蓝旗帜
|
||||
{code: '',color: '#707070'}//灰旗帜
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
attrTreeData: [],
|
||||
attrTreeProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeShowType(val) {
|
||||
this.update.form.showType.value = val;
|
||||
},
|
||||
initData() {
|
||||
if (this.type == 'commonShapeConfig') {// 通用配置(建模方法通配)
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_shape_config_query',
|
||||
wsId: that.wsId,
|
||||
methodId: that.methodId,
|
||||
shapeId: that.shapeName
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
if (ro.result == 'ok') {
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
ro.data[i].attribute = JSON.parse(ro.data[i].attribute);
|
||||
}
|
||||
that.data = ro.data;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else if (this.type == 'specialShapeConfig') {// 特殊配置(设计器页面针对某形状配置) todo
|
||||
|
||||
}
|
||||
},
|
||||
formatContent(text) {
|
||||
return text.replace(/</g, "<").replace(/>/g, ">")
|
||||
},
|
||||
formatIconCode(text) {
|
||||
return text.split('|')[0];
|
||||
},
|
||||
formatIconColor(text) {
|
||||
return text.split('|')[1];
|
||||
},
|
||||
handleClose(done) {
|
||||
this.closeDlalog('cancel');
|
||||
done();
|
||||
},
|
||||
cancel() {
|
||||
this.closeDlalog('cancel');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
submit() {
|
||||
const that = this;
|
||||
this.closeDlalog('save');
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
closeDlalog(type) {// 取消/确定之后的关闭
|
||||
if (type == 'save') {
|
||||
let result = {
|
||||
data: [],
|
||||
wsId: this.wsId,
|
||||
methodId: this.methodId,
|
||||
shapeId: this.shapeName
|
||||
};
|
||||
for (let i = 0; i < this.data.length; i++) {
|
||||
result.data.push(this.data[i].attribute);
|
||||
}
|
||||
this.$emit('getResult', result);
|
||||
} else {
|
||||
this.$emit('cancel');
|
||||
}
|
||||
},
|
||||
removeShapeConfig(id) {// 删除
|
||||
for (let i = 0; i < this.data.length; i++) {
|
||||
if (this.data[i].id == id) {
|
||||
this.data.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
/********新增、修改********/
|
||||
updateShapeConfig(row) {
|
||||
this.clearUpdateShapeConfig();
|
||||
if (row) {
|
||||
this.update.title = '修改';
|
||||
this.update.id = row.id;
|
||||
this.initUpdateShapeConfigData(row.attribute);
|
||||
} else {
|
||||
this.update.title = '添加';
|
||||
}
|
||||
this.update.visible = true;
|
||||
},
|
||||
initUpdateShapeConfigData(attribute) {// 初始化到修改dlg中
|
||||
this.update.form.showType.value = attribute.showType;
|
||||
this.update.form.position.horizontal = attribute.horizontal;
|
||||
this.update.form.position.verity = attribute.verity;
|
||||
if (attribute.showType == 'text') {// 文本
|
||||
this.update.form.cfgContent = attribute.cfgContent;
|
||||
} else if (attribute.showType == 'attribute') {// 属性
|
||||
this.update.form.attrName = attribute.attrName;
|
||||
this.update.form.attrKey = attribute.key;
|
||||
this.update.form.isShowAttrName = attribute.isShowAttrName;
|
||||
} else if (attribute.showType == 'icon') {// 图标
|
||||
const tempArr = attribute.iconContent.split('|');
|
||||
this.update.form.iconInfo.value = {code: tempArr[0], color: tempArr[1]};
|
||||
}
|
||||
},
|
||||
clearUpdateShapeConfig() {// 清空
|
||||
this.update.id = '';
|
||||
this.update.form.position.horizontal = '';
|
||||
this.update.form.position.verity = '';
|
||||
this.update.form.showType.value = 'text';
|
||||
this.update.form.cfgContent = '';
|
||||
this.update.form.attrName = '';
|
||||
this.update.form.attrKey = '';
|
||||
this.update.form.isShowAttrName = false;
|
||||
this.update.form.iconInfo.value = {};
|
||||
this.attrTreeData = [];
|
||||
},
|
||||
handleUpdateClose(done) {
|
||||
done();
|
||||
},
|
||||
handleSetIcon(icon) {
|
||||
this.update.form.iconInfo.value = icon;
|
||||
this.$refs['popover'].doClose();
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
if (!data.open) {
|
||||
this.update.form.attrName = data.label;
|
||||
this.update.form.attrKey = data.id;
|
||||
this.$refs['attrPopover'].doClose();
|
||||
}
|
||||
},
|
||||
handleInitAttrTree() {
|
||||
this.attrTreeLoading = true;
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_manage_shape_config_attr_tree_query',
|
||||
wsId: that.wsId,
|
||||
methodId: that.methodId,
|
||||
shapeId: that.shapeName
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
that.attrTreeLoading = false;
|
||||
if (ro.result == 'ok') {
|
||||
that.attrTreeData = ro.data;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
saveUpdateShapeConfig() {
|
||||
if (this.update.form.position.horizontal == '') {
|
||||
this.$message({message: '请选择水平位置',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
if (this.update.form.position.verity == '') {
|
||||
this.$message({message: '请选择垂直位置',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < this.data.length; i++) {
|
||||
const attr = this.data[i].attribute;
|
||||
if (((this.update.id != '' && this.update.id != this.data[i].id) || this.update.id == '') && attr.horizontal == this.update.form.position.horizontal && attr.verity == this.update.form.position.verity) {
|
||||
this.$message({message: '此显示位置已被占用,请选择其它位置',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const attribute = {};
|
||||
attribute.horizontal = this.update.form.position.horizontal;
|
||||
attribute.verity = this.update.form.position.verity;
|
||||
// 组成新的attribute
|
||||
const showType = this.update.form.showType.value;
|
||||
attribute.showType = showType;
|
||||
if (showType == 'text') {
|
||||
if (this.update.form.cfgContent.trim() == '') {
|
||||
this.$message({message: '[文本信息]不允许为空',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
if (this.update.form.cfgContent.trim().length >= 200) {
|
||||
this.$message({message: '[文本信息]不允许超过200个字符',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
attribute.cfgContent = this.update.form.cfgContent;
|
||||
} else if (showType == 'attribute') {
|
||||
if (this.update.form.attrKey == '') {
|
||||
this.$message({message: '请选择属性信息',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
attribute.attrName = this.update.form.attrName;
|
||||
attribute.key = this.update.form.attrKey;
|
||||
attribute.isShowAttrName = this.update.form.isShowAttrName;
|
||||
attribute.cfgContent = '';
|
||||
} else if (showType == 'icon') {
|
||||
if (!this.update.form.iconInfo.value.code || this.update.form.iconInfo.value.code == '') {
|
||||
this.$message({message: '请选择图标',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
attribute.iconContent = this.update.form.iconInfo.value.code + '|' + this.update.form.iconInfo.value.color;
|
||||
}
|
||||
if (this.update.id != '') {// 更新
|
||||
for (let i = 0; i < this.data.length; i++) {
|
||||
if (this.data[i].id == this.update.id) {
|
||||
this.data[i].attribute = attribute;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {// 新建
|
||||
const obj = {
|
||||
attribute: attribute,
|
||||
id: 'new' + Math.random(),
|
||||
methodId: this.methodId,
|
||||
shapeId: this.shapeName,
|
||||
wsId: this.wsId,
|
||||
orderIndex: 0
|
||||
}
|
||||
this.data.push(obj);
|
||||
for (let i = 0; i < this.data.length; i++) {
|
||||
this.data[i].orderIndex = i+1;
|
||||
}
|
||||
}
|
||||
this.update.visible = false;
|
||||
return true;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.dialogVisible = val;
|
||||
if (val) {// 打开
|
||||
this.initData();
|
||||
} else {// 关闭
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#methodShapeAnchor >>> .el-dialog__body {
|
||||
padding: 5px 20px;
|
||||
}
|
||||
#updateShapeAnchor >>> .el-dialog__body {
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.row-div :hover {
|
||||
background-color: #F5F7FA;
|
||||
}
|
||||
.row-div :hover .row-operate-icon {
|
||||
display: block !important;
|
||||
}
|
||||
.el-col {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.loc {
|
||||
position: absolute;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
left: 10px;
|
||||
top: 18px;
|
||||
border: 1px solid #333;
|
||||
background: white;
|
||||
}
|
||||
.loc-point {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 5px !important;
|
||||
height: 5px;
|
||||
background: #dd4b39;
|
||||
top: 3px;
|
||||
left: 3px;
|
||||
}
|
||||
.loc-horizontal-icon {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-left: 30px;
|
||||
}
|
||||
.loc-verity-icon {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-left: 60px;
|
||||
}
|
||||
.update-loc {
|
||||
position: absolute;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
border: 1px solid #333;
|
||||
background: white;
|
||||
}
|
||||
.update-loc-horizontal-icon {
|
||||
position: relative;
|
||||
float: left;
|
||||
top: 10px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.update-loc-verity-icon {
|
||||
position: relative;
|
||||
float: left;
|
||||
top: 10px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.column-arrow-down {
|
||||
float: right;
|
||||
font-size: 15px;
|
||||
color: #c0c4cc;
|
||||
position: relative;
|
||||
right: 6px;
|
||||
top: 10px;
|
||||
}
|
||||
.icon-opts :hover {
|
||||
background-color: #F5F7FA;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style>
|
||||
.methodShapeAnchorUpdatePopover {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
.methodShapeAnchorUpdateAttrPopover {
|
||||
margin-top: 1px !important;
|
||||
}
|
||||
</style>
|
||||
482
com.actionsoft.apps.coe.pal/views/portal/CommonRepository.vue
Normal file
482
com.actionsoft.apps.coe.pal/views/portal/CommonRepository.vue
Normal file
@ -0,0 +1,482 @@
|
||||
<template>
|
||||
<el-container id="commonRepository">
|
||||
<el-header :height="headerHeight">
|
||||
<el-col :span="24" style="position: relative;top: 10px;">
|
||||
<div style="display:inline-block;float:left;">
|
||||
<awsui-button style="width: 100px;" class="button-general-color" type="primary" @click="add">添加流程</awsui-button>
|
||||
</div>
|
||||
<div style="display:inline-block;float:right;width:320px;padding-right: 20px;">
|
||||
<el-input
|
||||
placeholder="搜索"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchInput"
|
||||
@input="searchRepository"
|
||||
size="small"
|
||||
clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-loading="dlgLoading"
|
||||
title="添加常用流程"
|
||||
:visible.sync="dialog.visible"
|
||||
:modal-append-to-body=false
|
||||
:close-on-click-modal=false
|
||||
:close-on-press-escape=true
|
||||
:before-close="handleCloseDlg"
|
||||
@close="clearDlgData"
|
||||
width="500px">
|
||||
<div v-loading="loading">
|
||||
<div style="padding:10px;border:1px solid #e9e9e9">
|
||||
<div style="height: 300px;">
|
||||
<el-select
|
||||
style="width: 100%;"
|
||||
v-model="dialog.ws.value"
|
||||
filterable
|
||||
default-first-option
|
||||
size="small"
|
||||
placeholder="请选择资产库"
|
||||
@change="changeWs">
|
||||
<el-option
|
||||
v-for="item in dialog.ws.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div style="height: 268px;overflow: auto;">
|
||||
<el-tree v-if="dialog.ws.value != ''"
|
||||
ref="repositoryTree"
|
||||
:props="dialog.tree.props"
|
||||
:default-checked-keys="dialog.tree.value"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
@check-change="checkedNode"
|
||||
check-strictly
|
||||
show-checkbox
|
||||
node-key="versionId"
|
||||
lazy
|
||||
:load="loadNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.data.name}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="saveCommonData()">确定</awsui-button>
|
||||
<awsui-button @click="closeDlg">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<div id="main" :style="{'cursor': 'move', 'height': mainHeight, 'width': '100%'}">
|
||||
<el-table
|
||||
:height="mainHeight"
|
||||
:data="data"
|
||||
row-key="id"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="move"
|
||||
label=""
|
||||
align="center"
|
||||
width="20">
|
||||
<template slot-scope="scope">
|
||||
<div class="operate-icon-display">
|
||||
<p class="text-second-color">
|
||||
<i style="display: inline-block;cursor: pointer;" class="awsui-iconfont"></i>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
label="排序"
|
||||
align="center"
|
||||
width="80">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
:show-overflow-tooltip=true
|
||||
width="400">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="wsName"
|
||||
label="关联资产库"
|
||||
:show-overflow-tooltip=true>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="opt"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<div class="operate-icon-display">
|
||||
<p class="text-second-color">
|
||||
<i style="display: inline-block;cursor: pointer;" class="awsui-iconfont" @click="deleteCommonData(scope.row.id, scope.row.name)"></i>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs';
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "commonRepository",
|
||||
components: {Sortable},
|
||||
data() {
|
||||
return {
|
||||
headerHeight: '50px',
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 52) + 'px',
|
||||
searchInput: '',
|
||||
data: [],
|
||||
dataTemp: [],
|
||||
checkedData: [],
|
||||
dlgLoading: false,
|
||||
loading: false,
|
||||
dialog: {
|
||||
visible: false,
|
||||
ws: {
|
||||
value: '',
|
||||
options: []
|
||||
},
|
||||
tree: {
|
||||
props: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
value: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 火狐浏览器拖拽问题
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
this.initData();
|
||||
this.rowDrop();
|
||||
},
|
||||
methods: {
|
||||
//行拖拽
|
||||
rowDrop() {
|
||||
const tbody = document.querySelector('.el-table__body-wrapper tbody')
|
||||
const _this = this;
|
||||
Sortable.create(tbody, {
|
||||
onEnd({ newIndex, oldIndex }) {
|
||||
const currRow = _this.data.splice(oldIndex, 1)[0]
|
||||
_this.data.splice(newIndex, 0, currRow);
|
||||
const resourceIds = [];
|
||||
for (let i = 0; i < _this.data.length; i++) {
|
||||
_this.data[i].sort = i+1;
|
||||
resourceIds.push(_this.data[i].versionId);
|
||||
}
|
||||
// 保存
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_common_update_save',
|
||||
resourceIds: JSON.stringify(resourceIds)
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
_this.$message({message: '移动成功',type: 'success'});
|
||||
} else {
|
||||
_this.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
initData() {// 初始化数据查询
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_common_list'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
const data = ro.data.data;
|
||||
that.data = data;
|
||||
that.dataTemp = JSON.parse(JSON.stringify(that.data));
|
||||
that.checkedData = ro.data.checkedData;
|
||||
// 存取
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
searchRepository() {// 搜索
|
||||
if (this.searchInput && this.searchInput.trim() != '') {// 根据条件搜索
|
||||
const data = [];
|
||||
for (let i = 0; i < this.dataTemp.length; i++) {
|
||||
if (this.dataTemp[i].name.indexOf(this.searchInput) > -1
|
||||
|| this.dataTemp[i].wsName.indexOf(this.searchInput) > -1) {
|
||||
data.push(this.dataTemp[i]);
|
||||
}
|
||||
}
|
||||
this.data = data;
|
||||
} else {// 显示全部
|
||||
this.data = this.dataTemp;
|
||||
}
|
||||
},
|
||||
add() {// 新增常用流程
|
||||
this.dialog.visible = true;
|
||||
this.loading = true;
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_create_data_query'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
const data = ro.data;
|
||||
that.dialog.tree.value = (that.checkedData[data.wsId] == undefined ? [] : that.checkedData[data.wsId]);
|
||||
that.dialog.ws.value = data.wsId;
|
||||
that.dialog.ws.options = data.wsArr;
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
that.loading = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
},
|
||||
deleteCommonData(id, name) {// 删除用户组
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_common_data_delete',
|
||||
ids: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
clearDlgData() {// 清除dialog数据
|
||||
this.dialog.ws.value = '';
|
||||
this.dialog.ws.options = [];
|
||||
this.dialog.tree.data = [];
|
||||
this.dialog.tree.value = [];
|
||||
},
|
||||
closeDlg() {// 关闭新建/修改窗口
|
||||
this.dialog.visible = false;
|
||||
},
|
||||
handleCloseDlg(done) {
|
||||
this.closeDlg();
|
||||
done();
|
||||
},
|
||||
saveCommonData() {// 保存drawer结果
|
||||
const that = this;
|
||||
// 数据权限
|
||||
const wsId = that.dialog.ws.value;
|
||||
const repositorys = that.dialog.tree.value;
|
||||
// 保存
|
||||
that.dlgLoading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_common_create_save',
|
||||
wsId: wsId,
|
||||
resourceIds: repositorys.join(",")
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.dlgLoading = false;
|
||||
that.clearDlgData();
|
||||
that.closeDlg();
|
||||
that.$message({
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('保存失败');
|
||||
that.dlgLoading = false;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.dlgLoading = false;
|
||||
})
|
||||
},
|
||||
/******新增常用流程部分*******/
|
||||
changeWs(targetWsId) {// 变更资产库
|
||||
const that = this;
|
||||
that.dialog.ws.value = '';
|
||||
that.dialog.tree.value = (that.checkedData[targetWsId] == undefined ? [] : that.checkedData[targetWsId]);
|
||||
that.$nextTick(function () {
|
||||
that.dialog.ws.value = targetWsId;
|
||||
})
|
||||
},
|
||||
openNode(obj, node, tree) {// 点击数
|
||||
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
}
|
||||
};
|
||||
data.data.wsId = that.dialog.ws.value;
|
||||
data.data.teamId = '';
|
||||
data.data.cmd = 'com.actionsoft.apps.coe.pal_processlevel_tree_data';
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
for (let i = 0; i < ro.data.length; i++) {
|
||||
if (ro.data[i].id.length < 36) {
|
||||
ro.data[i].disabled = true;
|
||||
}
|
||||
}
|
||||
resolve(ro.data);
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.repositoryTree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
checkedNode(data, checked, subChecked) {// 节点选中事件
|
||||
// 获取所有子节点
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_repository_data_query',
|
||||
wsId: that.dialog.ws.value,
|
||||
pid: data.id,
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
const childVerIds = ro.data;
|
||||
const currVerId = data.versionId;
|
||||
if (checked) {// 选中
|
||||
const checkedVerIds = that.dialog.tree.value;
|
||||
if (checkedVerIds.indexOf(currVerId) == -1) {
|
||||
checkedVerIds.push(currVerId);
|
||||
}
|
||||
for (let i = 0; i < childVerIds.length; i++) {
|
||||
if (checkedVerIds.indexOf(childVerIds[i]) == -1) {
|
||||
checkedVerIds.push(childVerIds[i]);
|
||||
}
|
||||
}
|
||||
that.$refs.repositoryTree.setCheckedKeys(checkedVerIds);
|
||||
} else {// 取消选中
|
||||
const checkedVerIds = that.dialog.tree.value;
|
||||
const tempArr = [];
|
||||
for (let i = 0; i < checkedVerIds.length; i++) {
|
||||
if (checkedVerIds[i] != currVerId && childVerIds.indexOf(checkedVerIds[i]) == -1) {
|
||||
tempArr.push(checkedVerIds[i]);
|
||||
}
|
||||
}
|
||||
that.dialog.tree.value = tempArr;
|
||||
that.$refs.repositoryTree.setCheckedKeys([]);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
/********新增常用流程部分*********/
|
||||
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - parseInt(this.headerHeight)) -2 + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#commonRepository >>> .el-dialog__body {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
#commonRepository >>> .el-main {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
#commonRepository >>> .el-footer {
|
||||
padding: 0;
|
||||
}
|
||||
#commonRepository >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#commonRepository >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
262
com.actionsoft.apps.coe.pal/views/portal/ThemeStyle.vue
Normal file
262
com.actionsoft.apps.coe.pal/views/portal/ThemeStyle.vue
Normal file
@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-main id="theme">
|
||||
<div class="text-general-color category-title">
|
||||
<p style="padding-left: 5px;">
|
||||
logo
|
||||
<el-tooltip class="item" content="仅支持png、jpg、jpeg、gif格式的图片文件,文件大小5M内,建议宽高180*30左右" placement="bottom-start">
|
||||
<i style="font-size: 13px;" class="awsui-iconfont"></i>
|
||||
</el-tooltip>
|
||||
</p>
|
||||
</div>
|
||||
<div style="margin: 20px 0 20px 20px;">
|
||||
<div v-if="logoData.src != undefined" class="logo" style="width: 180px;height: 30px;position: relative;">
|
||||
<el-card style="height: 100%;width: 100%;" shadow="never" :body-style="{padding: '0px', height: '100%', width: '100%'}">
|
||||
<img :src=logoData.src class="image">
|
||||
</el-card>
|
||||
<div class="logo-mask"></div>
|
||||
<i class="awsui-iconfont text-general-color logo-del-icon" @click="removeFile('logo')"></i>
|
||||
</div>
|
||||
<div v-else style="width: 180px;height: 30px;" @click="openFileSelect('logo')">
|
||||
<el-card style="height: 100%;width: 100%;border: 1px dashed #ebeef5;cursor: pointer;" shadow="never" :body-style="{padding: '0px',height: '100%', width: '100%', 'text-align': 'center', 'vertical-align': 'middle', 'line-height': '30px'}">
|
||||
<i style="font-size: 15px;position: relative;top: 1px;" class="awsui-iconfont text-linker-color"></i>
|
||||
<span style="font-size: 12px;"> 添加logo</span>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-general-color category-title">
|
||||
<p style="padding-left: 5px;">
|
||||
轮播图
|
||||
<el-tooltip class="item" placement="bottom-start">
|
||||
<span slot="content">默认按照图片名称进行排序,不支持自定义排序<br/>仅支持png、jpg、jpeg、gif格式的图片文件,文件大小5M内,建议宽高1920*440</span>
|
||||
<i style="font-size: 13px;" class="awsui-iconfont"></i>
|
||||
</el-tooltip>
|
||||
</p>
|
||||
</div>
|
||||
<div style="margin: 20px 0 20px 20px;">
|
||||
<template v-for="item in bannerData">
|
||||
<div class="banner" style="width: 280px;height: 60px;margin-right: 20px;display:inline-block;position: relative; margin-bottom :15px;">
|
||||
<el-card style="height: 100%;width: 100%;" shadow="never" :body-style="{padding: '0px', height: '100%', width: '100%'}">
|
||||
<img :src="item.src" class="image">
|
||||
</el-card>
|
||||
<div class="banner-mask"></div>
|
||||
<i class="awsui-iconfont text-general-color banner-del-icon" style="cursor: pointer;float: right;position: relative;top: -38px;left: -5px;" @click="removeFile('banner', item.name)"></i>
|
||||
</div>
|
||||
</template>
|
||||
<div style="width: 280px;height: 60px;display: inline-block;" @click="openFileSelect('banner')">
|
||||
<el-card style="height: 100%;width: 100%;border: 1px dashed #ebeef5;cursor: pointer;" shadow="never" :body-style="{padding: '0px',height: '100%', width: '100%', 'text-align': 'center', 'vertical-align': 'middle', 'line-height': '60px'}">
|
||||
<i style="font-size: 20px;position: relative;top: 2px;" class="awsui-iconfont text-linker-color"></i>
|
||||
<span style="font-size: 12px;"> 添加轮播图</span>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
<PALUpload ref="logoUpload"
|
||||
:appId=appId
|
||||
:repositoryName="repositoryName"
|
||||
:groupValue=groupValue
|
||||
fileValue="logo"
|
||||
:show-file-list=false
|
||||
:on-success="uploadSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
accept=".jpg,.jpeg,.gif,.png"
|
||||
:file-list="fileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button id="selectLogoButton" style="width: 130px;" class="button-general-color" type="primary">文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
<PALUpload ref="bannerUpload"
|
||||
:appId=appId
|
||||
:repositoryName="repositoryName"
|
||||
:groupValue=groupValue
|
||||
fileValue="banner"
|
||||
multiple
|
||||
:show-file-list=false
|
||||
:on-success="uploadSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
accept=".jpg,.jpeg,.gif,.png"
|
||||
:file-list="fileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button id="selectBannerButton" style="width: 130px;" class="button-general-color" type="primary">文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import PALUpload from "@/components/common/upload";
|
||||
export default {
|
||||
name: "ThemeStyle",
|
||||
components: {PALUpload},
|
||||
data() {
|
||||
return {
|
||||
appId: 'com.actionsoft.apps.coe.pal',
|
||||
repositoryName: 'tmp',
|
||||
groupValue:"portal",
|
||||
fileValue:"logo",// logo,banner
|
||||
uploadKey: Math.random() + '',
|
||||
multiple: false,
|
||||
fileList: [],
|
||||
logoData: {},// {'name':'','src':''}
|
||||
bannerData: [] // [{'name':'','src':''}]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {// 初始化
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_theme_data_query'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.logoData = ro.data.logoData;
|
||||
that.bannerData = ro.data.bannerData;
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
openFileSelect(type) {
|
||||
if (type == 'logo') {// logo
|
||||
this.fileValue = 'logo';
|
||||
document.getElementById("selectLogoButton").click();
|
||||
} else {// 轮播图
|
||||
this.fileValue = 'banner';
|
||||
document.getElementById("selectBannerButton").click();
|
||||
}
|
||||
},
|
||||
removeFile(type, fileName) {// 删除图片
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_theme_data_remove',
|
||||
type: type,
|
||||
fileName: fileName
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('删除失败');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
uploadSuccess(response, file, fileList) {// 上传完成后保存
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_theme_data_save',
|
||||
type: that.fileValue,
|
||||
fileName: file.name
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '['+ file.name +']上传成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('['+ file.name +']上传失败');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
beforeUpload(file) {// 单个文件校验,返回false不影响其他文件上传
|
||||
const that = this;
|
||||
if (file.size > 5 * 1024 * 1024) {
|
||||
that.$message('图片[' + file.name + ']不能大于5M,上传失败!')
|
||||
return false;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.category-title {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
vertical-align: center;
|
||||
margin: 10px 10px 5px 0px;
|
||||
border-left: 3px solid #4E7FF9;
|
||||
}
|
||||
.logo:hover .logo-del-icon{
|
||||
display: inline-block;
|
||||
}
|
||||
.logo-mask {
|
||||
display: none;
|
||||
}
|
||||
.logo:hover .logo-mask {
|
||||
display: inline-block;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
left: 1px;
|
||||
top: 1px;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
background-color: rgba(125, 125, 125,0.5);
|
||||
}
|
||||
.logo-del-icon {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
position: relative;
|
||||
top: -23px;
|
||||
left: -5px;
|
||||
display: none;
|
||||
}
|
||||
.banner:hover .banner-del-icon{
|
||||
display: inline-block;
|
||||
}
|
||||
.banner-mask {
|
||||
display: none;
|
||||
}
|
||||
.banner:hover .banner-mask {
|
||||
display: inline-block;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
left: 1px;
|
||||
top: 1px;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
background-color: rgba(125, 125, 125,0.5);
|
||||
}
|
||||
.banner-del-icon {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
748
com.actionsoft.apps.coe.pal/views/portal/UserGroup.vue
Normal file
748
com.actionsoft.apps.coe.pal/views/portal/UserGroup.vue
Normal file
@ -0,0 +1,748 @@
|
||||
<template>
|
||||
<el-container id="userGroup">
|
||||
<el-header :height="headerHeight">
|
||||
<el-col :span="24" style="position: relative;top: 10px;">
|
||||
<div style="display:inline-block;float:left;">
|
||||
<awsui-button style="width: 100px;" class="button-general-color" type="primary" @click="addUserGroup()">新建用户组</awsui-button>
|
||||
</div>
|
||||
<div style="display:inline-block;float:right;width:320px;padding-right: 20px;">
|
||||
<el-input
|
||||
placeholder="搜索"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchInput"
|
||||
@input="searchUserGroup"
|
||||
size="small"
|
||||
clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-loading="dlgLoading"
|
||||
:title="dialog.title"
|
||||
:visible.sync="dialog.visible"
|
||||
:modal-append-to-body=false
|
||||
:close-on-click-modal=false
|
||||
:close-on-press-escape=true
|
||||
:before-close="handleCloseDlg"
|
||||
@close="clearDlgData"
|
||||
destroy-on-close
|
||||
width="700px">
|
||||
<div v-loading="loading">
|
||||
<el-steps :active="dialog.active" align-center>
|
||||
<el-step title="基本信息"></el-step>
|
||||
<el-step title="关联角色"></el-step>
|
||||
<el-step title="数据权限"></el-step>
|
||||
</el-steps>
|
||||
<div style="padding:10px;border:1px solid #e9e9e9">
|
||||
<div style="height: 300px;" v-show="dialog.active == 1">
|
||||
<awsui-form ref="infoForm" :model="dialog.basicInfo.infoForm" :rules="dialog.basicInfo.rules" label-width="100px" label-position="top">
|
||||
<awsui-form-item label="分类" prop="category">
|
||||
<awsui-select
|
||||
:validate-event=false
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请选择/输入分类"
|
||||
v-model="dialog.basicInfo.infoForm.category.value"
|
||||
:options="dialog.basicInfo.infoForm.category.options"
|
||||
@change="changeType"
|
||||
>
|
||||
</awsui-select>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="名称" prop="name">
|
||||
<awsui-input placeholder="请输入名称" :validate-event=false v-model="dialog.basicInfo.infoForm.name"></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="简介" prop="desc">
|
||||
<!-- <el-input type="textarea" v-model="dialog.basicInfo.infoForm.desc" maxlength="255" show-word-limit rows="5"></el-input>-->
|
||||
<awsui-input v-model="dialog.basicInfo.infoForm.desc" type="textarea" placeholder="请输入简介"></awsui-input>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<div style="height: 300px;" v-show="dialog.active == 2">
|
||||
<el-tree
|
||||
ref="roleTree"
|
||||
style="height: 100%;overflow: auto;"
|
||||
:props="dialog.roleConfig.props"
|
||||
:default-checked-keys="dialog.roleConfig.value"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
@node-expand="expandRoleNode"
|
||||
@node-collapse="closeRoleNode"
|
||||
@check-change="checkedRoleNode"
|
||||
check-strictly
|
||||
:load="loadRoleNode"
|
||||
lazy
|
||||
show-checkbox
|
||||
:default-expand-all=false
|
||||
node-key="id">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': data.iconFont.color, 'position': 'relative', 'top': '-1px'}" v-html="data.iconFont.code"></i>
|
||||
<span>{{data.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
<div style="height: 300px;" v-show="dialog.active == 3">
|
||||
<el-select
|
||||
style="width: 100%;"
|
||||
v-model="dialog.repositoryPerm.ws.value"
|
||||
filterable
|
||||
default-first-option
|
||||
size="small"
|
||||
placeholder="请选择资产库"
|
||||
@change="changeWs">
|
||||
<el-option
|
||||
v-for="item in dialog.repositoryPerm.ws.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div style="height: 268px;overflow: auto;">
|
||||
<el-tree v-if="dialog.repositoryPerm.ws.value != ''"
|
||||
ref="repositoryTree"
|
||||
:props="dialog.repositoryPerm.tree.props"
|
||||
:default-checked-keys="dialog.repositoryPerm.tree.value"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
@check-change="checkedNode"
|
||||
check-strictly
|
||||
show-checkbox
|
||||
node-key="versionId"
|
||||
lazy
|
||||
:load="loadNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||
<span>{{node.data.name}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<!-- <awsui-button @click="closeDlg">取消</awsui-button>-->
|
||||
<awsui-button v-show="dialog.active == 2 || dialog.active == 3" class="button-general-color-reverse" @click="function(){dialog.active--}">上一步</awsui-button>
|
||||
<awsui-button v-show="dialog.active == 1 || dialog.active == 2" class="button-general-color" type="primary" @click="next">下一步</awsui-button>
|
||||
<awsui-button v-show="dialog.active == 3" class="button-general-color" type="primary" @click="saveUserGroup(dialog.updateId)">确定</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<div id="main" :style="{'height': mainHeight, 'width': '100%'}">
|
||||
<el-table
|
||||
:height="mainHeight"
|
||||
:data="data"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="no"
|
||||
label="序号"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
:show-overflow-tooltip=true
|
||||
width="250">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="category"
|
||||
label="分类"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="wsName"
|
||||
label="关联资产库"
|
||||
:show-overflow-tooltip=true
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="desc"
|
||||
label="说明">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="opt"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="80">
|
||||
<template slot-scope="scope">
|
||||
<div class="operate-icon-display">
|
||||
<p class="text-second-color">
|
||||
<i style="display: inline-block;cursor: pointer;margin-right: 15px;" class="awsui-iconfont" @click="addUserGroup(scope.row.id)"></i>
|
||||
<i style="display: inline-block;cursor: pointer;" class="awsui-iconfont" @click="deleteUserGroup(scope.row.id, scope.row.name)"></i>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "userGroup",
|
||||
data() {
|
||||
return {
|
||||
headerHeight: '50px',
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 52) + 'px',
|
||||
loading: false,
|
||||
dlgLoading: false,
|
||||
searchInput: '',
|
||||
data: [],
|
||||
dataTemp: [],
|
||||
dialog:{
|
||||
active: 1,
|
||||
visible: false,
|
||||
title: '新建用户组',
|
||||
updateId: '',// 更新信息id,若新建则为空
|
||||
basicInfo: {
|
||||
infoForm: {
|
||||
name: '',
|
||||
category: {
|
||||
value: '',
|
||||
options: []
|
||||
},
|
||||
desc: '',
|
||||
groupCode: ''
|
||||
},
|
||||
rules: {
|
||||
category: [
|
||||
{ required: true, message: '[分类]不允许为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '[名称]不允许为空', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
},
|
||||
roleConfig: {
|
||||
data: [],
|
||||
props: {
|
||||
label: 'label',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
value: []
|
||||
},
|
||||
repositoryPerm: {
|
||||
ws: {
|
||||
value: '',
|
||||
options: []
|
||||
},
|
||||
tree: {
|
||||
props: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
value: []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 火狐浏览器拖拽问题
|
||||
document.body.ondrop = function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {// 初始化数据查询
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_list'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
let data = ro.data;
|
||||
that.data = that.handleDataNo(data);
|
||||
that.dataTemp = JSON.parse(JSON.stringify(that.data));
|
||||
} else {
|
||||
this.$message({message: ro.msg,type: 'warning'});
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
handleDataNo(data) {// 处理数据的序号
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].no = i+1;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
searchUserGroup() {// 搜索
|
||||
if (this.searchInput && this.searchInput.trim() != '') {// 根据条件搜索
|
||||
const data = [];
|
||||
for (let i = 0; i < this.dataTemp.length; i++) {
|
||||
if (this.dataTemp[i].name.indexOf(this.searchInput) > -1
|
||||
|| this.dataTemp[i].category.indexOf(this.searchInput) > -1
|
||||
|| this.dataTemp[i].wsName.indexOf(this.searchInput) > -1
|
||||
|| this.dataTemp[i].desc.indexOf(this.searchInput) > -1) {
|
||||
data.push(this.dataTemp[i]);
|
||||
}
|
||||
}
|
||||
this.data = this.handleDataNo(data);
|
||||
} else {// 显示全部
|
||||
this.data = this.handleDataNo(this.dataTemp);
|
||||
}
|
||||
},
|
||||
addUserGroup(id) {// 新增用户组
|
||||
this.dialog.updateId = '';
|
||||
if (id) {
|
||||
this.dialog.updateId = id;
|
||||
this.dialog.title = '修改用户组';
|
||||
} else {
|
||||
this.dialog.title = '新建用户组';
|
||||
}
|
||||
this.dialog.visible = true;
|
||||
this.loading = true;
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_create_data_query',
|
||||
id: (id == undefined ? '' : id)
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
const data = ro.data;
|
||||
that.dialog.basicInfo.infoForm.name = data.name;
|
||||
that.dialog.basicInfo.infoForm.category.value = data.category;
|
||||
that.dialog.basicInfo.infoForm.category.options = data.categoryArr;
|
||||
that.dialog.basicInfo.infoForm.desc = data.desc;
|
||||
that.dialog.basicInfo.infoForm.groupCode = data.groupCode;
|
||||
that.dialog.roleConfig.value = data.roles;
|
||||
that.dialog.repositoryPerm.ws.value = data.wsId;
|
||||
that.dialog.repositoryPerm.ws.options = data.wsArr;
|
||||
that.dialog.repositoryPerm.tree.value = data.repositorys;
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
that.loading = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.loading = false;
|
||||
})
|
||||
},
|
||||
changeType(val) {
|
||||
this.dialog.basicInfo.infoForm.category.value = val;
|
||||
},
|
||||
deleteUserGroup(id, name) {// 删除用户组
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_delete',
|
||||
id: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
clearDlgData() {// 清除dialog数据
|
||||
this.dialog.active = 1;
|
||||
this.dialog.updateId = '';
|
||||
this.dialog.basicInfo.infoForm.name = '';
|
||||
this.dialog.basicInfo.infoForm.category.value = '';
|
||||
this.dialog.basicInfo.infoForm.category.options = [];
|
||||
this.dialog.basicInfo.infoForm.desc = '';
|
||||
this.dialog.basicInfo.infoForm.groupCode = '';
|
||||
this.$refs.infoForm.resetFields();
|
||||
this.dialog.roleConfig.data = [];
|
||||
this.dialog.roleConfig.value = [];
|
||||
this.dialog.repositoryPerm.ws.value = '';
|
||||
this.dialog.repositoryPerm.ws.options = [];
|
||||
this.dialog.repositoryPerm.tree.data = [];
|
||||
this.dialog.repositoryPerm.tree.value = [];
|
||||
},
|
||||
closeDlg() {// 关闭新建/修改窗口
|
||||
this.dialog.visible = false;
|
||||
},
|
||||
handleCloseDlg(done) {
|
||||
this.closeDlg();
|
||||
done();
|
||||
},
|
||||
handleTabClick(tab, event) {
|
||||
// console.log(tab, event);
|
||||
},
|
||||
next() {
|
||||
const that = this;
|
||||
if (this.dialog.active == 1) {
|
||||
// 基本信息
|
||||
const groupName = that.dialog.basicInfo.infoForm.name;
|
||||
const category = that.dialog.basicInfo.infoForm.category.value;
|
||||
const groupDesc = that.dialog.basicInfo.infoForm.desc;
|
||||
const groupCode = that.dialog.basicInfo.infoForm.groupCode;
|
||||
if (groupCode == "") {
|
||||
that.$message({message: '[代码]不允许为空',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (groupCode.length > 36) {
|
||||
that.$message({message: '[代码]不允许超过36个字符',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (category == "") {
|
||||
that.$message({message: '[分类]不允许为空',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (category.length > 64) {
|
||||
that.$message({message: '[分类]不允许超过64个字符',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (!category.match("^[a-zA-Z0-9_\u4e00-\u9fa5]+$")) {
|
||||
that.$message({message: '[分类]只能输入字母、数字、汉字或下划线',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (groupName == "") {
|
||||
that.$message({message: '[名称]不允许为空',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (groupName.length > 128) {
|
||||
that.$message({message: '[名称]不允许超过128个字符',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (groupDesc.length > 255) {
|
||||
that.$message({message: '[简介]不允许超过255个字符',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.dialog.active++;
|
||||
},
|
||||
saveUserGroup(updateId) {
|
||||
const that = this;
|
||||
const groupName = that.dialog.basicInfo.infoForm.name;
|
||||
const category = that.dialog.basicInfo.infoForm.category.value;
|
||||
const groupDesc = that.dialog.basicInfo.infoForm.desc;
|
||||
const groupCode = that.dialog.basicInfo.infoForm.groupCode;
|
||||
// 角色权限信息
|
||||
const roles = that.dialog.roleConfig.value;
|
||||
// 数据权限
|
||||
const wsId = that.dialog.repositoryPerm.ws.value;
|
||||
const repositorys = that.dialog.repositoryPerm.tree.value;
|
||||
// 保存
|
||||
that.dlgLoading = true;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_create_save',
|
||||
id: updateId == undefined ? '' : updateId,
|
||||
groupName: groupName,
|
||||
groupCode: groupCode,
|
||||
groupDesc: groupDesc,
|
||||
category: category,
|
||||
wsId: wsId,
|
||||
roleIds: roles.join(","),
|
||||
resourceIds: repositorys.join(",")
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.dlgLoading = false;
|
||||
that.clearDlgData();
|
||||
that.closeDlg();
|
||||
that.$message({
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('保存失败');
|
||||
that.dlgLoading = false;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.dlgLoading = false;
|
||||
})
|
||||
|
||||
},
|
||||
/*****数据权限*******/
|
||||
changeWs(targetWsId) {// 变更资产库
|
||||
const that = this;
|
||||
that.dialog.repositoryPerm.ws.value = '';
|
||||
that.dialog.repositoryPerm.tree.value = [];
|
||||
that.$nextTick(function () {
|
||||
that.dialog.repositoryPerm.ws.value = targetWsId;
|
||||
})
|
||||
},
|
||||
openNode(obj, node, tree) {// 点击数
|
||||
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
}
|
||||
};
|
||||
data.data.wsId = that.dialog.repositoryPerm.ws.value;
|
||||
data.data.teamId = '';
|
||||
data.data.cmd = 'com.actionsoft.apps.coe.pal_processlevel_tree_data';
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
resolve(ro.data);
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.repositoryTree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function(){
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
checkedNode(data, checked, subChecked) {// 节点选中事件
|
||||
// 获取所有子节点
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_repository_data_query',
|
||||
wsId: that.dialog.repositoryPerm.ws.value,
|
||||
pid: data.id,
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
const childVerIds = ro.data;
|
||||
const currVerId = data.versionId;
|
||||
if (checked) {// 选中
|
||||
const checkedVerIds = that.dialog.repositoryPerm.tree.value;
|
||||
if (checkedVerIds.indexOf(currVerId) == -1) {
|
||||
checkedVerIds.push(currVerId);
|
||||
}
|
||||
for (let i = 0; i < childVerIds.length; i++) {
|
||||
if (checkedVerIds.indexOf(childVerIds[i]) == -1) {
|
||||
checkedVerIds.push(childVerIds[i]);
|
||||
}
|
||||
}
|
||||
that.$refs.repositoryTree.setCheckedKeys(checkedVerIds);
|
||||
} else {// 取消选中
|
||||
const checkedVerIds = that.dialog.repositoryPerm.tree.value;
|
||||
const tempArr = [];
|
||||
for (let i = 0; i < checkedVerIds.length; i++) {
|
||||
if (checkedVerIds[i] != currVerId && childVerIds.indexOf(checkedVerIds[i]) == -1) {
|
||||
tempArr.push(checkedVerIds[i]);
|
||||
}
|
||||
}
|
||||
that.dialog.repositoryPerm.tree.value = tempArr;
|
||||
that.$refs.repositoryTree.setCheckedKeys([]);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
/*********数据权限************/
|
||||
/*********角色权限***********/
|
||||
loadRoleNode(node, resolve) {
|
||||
const that = this;
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {}
|
||||
};
|
||||
data.data.cmd = 'com.actionsoft.apps.coe.pal_publish_publishgroup_role_tree_data_query';
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
resolve(ro.data);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
that.tableLoading = false;
|
||||
})
|
||||
},
|
||||
expandRoleNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeRoleNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
checkedRoleNode(data, checked, subChecked) {// 角色岗位节点选中事件
|
||||
debugger;
|
||||
// 获取所有子节点
|
||||
const that = this;
|
||||
if (data.type == 'roleGroup') {// 选中角色组,异步查询
|
||||
// 查询子节点
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_publish_publishgroup_role_tree_data_query',
|
||||
pid: data.id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
const roleArr = ro.data;
|
||||
let roleIdArr = [];
|
||||
for (let i = 0; i < roleArr.length; i++) {
|
||||
roleIdArr.push(roleArr[i].id);
|
||||
}
|
||||
const currId = data.id;
|
||||
const checkIds = that.dialog.roleConfig.value;
|
||||
if (checked) {// 选中
|
||||
if (checkIds.indexOf(currId) == -1) {
|
||||
checkIds.push(currId);
|
||||
}
|
||||
for (let i = 0; i < roleIdArr.length; i++) {
|
||||
if (checkIds.indexOf(roleIdArr[i]) == -1) {
|
||||
checkIds.push(roleIdArr[i]);
|
||||
}
|
||||
}
|
||||
} else {// 取消选中
|
||||
const tempArr = [];
|
||||
for (let i = 0; i < checkIds.length; i++) {
|
||||
if (checkIds[i] != currId && roleIdArr.indexOf(checkIds[i]) == -1) {
|
||||
tempArr.push(checkIds[i]);
|
||||
}
|
||||
}
|
||||
that.dialog.roleConfig.value = tempArr;
|
||||
}
|
||||
that.$refs.roleTree.setCheckedKeys(that.dialog.roleConfig.value);
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else if (data.type == 'role') {// 选中角色,无子级,直接设置选中值
|
||||
const checkIds = that.dialog.roleConfig.value;
|
||||
if (checked) {// 选中
|
||||
if (checkIds.indexOf(data.id) == -1) {
|
||||
checkIds.push(data.id);
|
||||
}
|
||||
} else {// 取消选中
|
||||
const tempArr = [];
|
||||
for (let i = 0; i < checkIds.length; i++) {
|
||||
if (checkIds[i] != data.id) {
|
||||
tempArr.push(checkIds[i]);
|
||||
}
|
||||
}
|
||||
that.dialog.roleConfig.value = tempArr;
|
||||
}
|
||||
that.$refs.roleTree.setCheckedKeys(that.dialog.roleConfig.value);
|
||||
}
|
||||
}
|
||||
/*********角色权限***********/
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - parseInt(this.headerHeight)) -2 + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#userGroup >>> .el-main {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
#userGroup >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#userGroup >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
#userGroup >>> .el-dialog__body {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
#userGroup >>> .el-tabs__nav-wrap:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #F2F2F2;
|
||||
z-index: 1;
|
||||
}
|
||||
#userGroup >>> .el-tabs__active-bar {
|
||||
height: 1px;
|
||||
background-color: #4E7FF9;
|
||||
}
|
||||
#userGroup >>> .el-tabs__item.is-active {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#userGroup >>> .el-tabs__item {
|
||||
color: #606266;
|
||||
}
|
||||
#userGroup >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
line-height: 0;
|
||||
}
|
||||
#userGroup >>> .el-form-item {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
#userGroup >>> .el-tree {
|
||||
min-width: 100%;
|
||||
display:inline-block !important;
|
||||
}
|
||||
#userGroup >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #F5F7FA;
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#userGroup >>> .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content .awsui-iconfont {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
#userGroup >>> .el-step__title {
|
||||
font-size: 12px;
|
||||
}
|
||||
#userGroup >>> textarea.awsui-input {
|
||||
height: 130px;
|
||||
}
|
||||
</style>
|
||||
376
com.actionsoft.apps.coe.pal/views/recycle/Recycle.vue
Normal file
376
com.actionsoft.apps.coe.pal/views/recycle/Recycle.vue
Normal file
@ -0,0 +1,376 @@
|
||||
<template>
|
||||
<el-container id="recycle">
|
||||
<el-header :height="headerHeight">
|
||||
<el-row :style="{'line-height': headerHeight}">
|
||||
<el-col :span="24">
|
||||
<div style="display:inline-block;float:left;width: 150px;">
|
||||
<div class="text-general-color" style="padding-left:20px;text-align: left;vertical-align: middle;display: table-cell;width: 100%;height: 36px;">
|
||||
共有
|
||||
<span style="color:red;">{{totalCount}}</span>
|
||||
条数据
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:inline-block;float:right;width:220px;padding-right: 20px;">
|
||||
<el-input
|
||||
placeholder="搜索"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchInput"
|
||||
size="small"
|
||||
@input="searchProcessList"
|
||||
clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-table
|
||||
id="table"
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
size="medium"
|
||||
:height="tableHeight"
|
||||
:cell-class-name="cellClass"
|
||||
@cell-mouse-enter="enterRow"
|
||||
@cell-mouse-leave="leaveRow"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="66"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="文件名称"
|
||||
min-width="250">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="user"
|
||||
label="操作用户"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="删除时间"
|
||||
width="170">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="operate-icon-display" :ref="scope.row.id">
|
||||
<el-tooltip class="item" content="还原" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="recoverFiles(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" content="删除" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="removeFiles(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-main>
|
||||
<el-footer v-show="showFooter" :height="footerHeight">
|
||||
<div>
|
||||
<div style="padding: 8px;">
|
||||
<awsui-button style="width: 100px;" class="button-general-color" type="primary" @click="recoverFiles()">还原</awsui-button>
|
||||
<awsui-button style="width: 100px;" class="button-general-color-reverse2" plain @click="removeFiles()">删除</awsui-button>
|
||||
<awsui-button style="width: 100px;" class="button-general-color-reverse3" plain @click="closeFooter">取消</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import {closest} from "../../api/commonFun";
|
||||
|
||||
export default {
|
||||
name: "Recycle",
|
||||
data() {
|
||||
return {
|
||||
headerHeight: '40px',
|
||||
tableHeight: parseInt(this.$store.getters.getTopMainHeightFn) - 40 + 'px',
|
||||
footerHeight: '45px',
|
||||
totalCount: 0,
|
||||
showFooter: false,
|
||||
searchInput: '',
|
||||
multipleSelection: [],
|
||||
tableData: [],
|
||||
// 分页
|
||||
totalCount : '?',
|
||||
currentPage: 0,
|
||||
pageStep: 0,
|
||||
rowHeight: 45
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
if (this.currentPage == 0) {
|
||||
this.searchProcessList();
|
||||
}
|
||||
this.scorllBottomEvent();
|
||||
},
|
||||
methods: {
|
||||
initPageCount() {// 初始化页面总条数,页码等
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_recycle_header_query',
|
||||
wsId: this.$store.getters.getWsIdFn,
|
||||
teamId: this.$store.getters.getTeamIdFn,
|
||||
searchInput: (this.searchInput ? this.searchInput.trim() : '')
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
if (ro.result == 'ok') {
|
||||
that.totalCount = ro.data;
|
||||
// 页码及每页计算
|
||||
that.currentPage = 0;
|
||||
that.pageStep = Math.ceil(parseInt(that.tableHeight)/that.rowHeight) + 5;
|
||||
that.loadData();
|
||||
} else {
|
||||
// alert('请求响应错误');
|
||||
// debugger;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
loadData() {// 表格数据加载
|
||||
const that = this;
|
||||
if(that.currentPage < Math.ceil(that.totalCount / that.pageStep)) {//当前页数小于总页数就请求
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_recycle_data_query',
|
||||
wsId: this.$store.getters.getWsIdFn,
|
||||
teamId: this.$store.getters.getTeamIdFn,
|
||||
currentPage: that.currentPage,
|
||||
pageStep: that.pageStep,
|
||||
searchInput: (this.searchInput ? this.searchInput.trim() : '')
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {// 查询数据总条数
|
||||
if (ro.result == 'ok') {
|
||||
let roData = ro.data;
|
||||
for (let i = 0; i < roData.length; i++) {
|
||||
roData[i].rowChecked = false;
|
||||
}
|
||||
that.tableData = that.tableData.concat(roData);
|
||||
that.currentPage++;//当前页数自增
|
||||
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
searchProcessList() {// 搜索查询
|
||||
this.$refs.table.bodyWrapper.scrollTop = 0;
|
||||
this.tableData = [];
|
||||
this.multipleSelection = [];
|
||||
this.initPageCount();
|
||||
},
|
||||
initTableHeight() {// 初始化表格高度
|
||||
if (this.showFooter) {
|
||||
this.tableHeight = parseInt(this.$store.getters.getTopMainHeightFn) - parseInt(this.headerHeight) - parseInt(this.footerHeight) + 'px';
|
||||
} else {
|
||||
this.tableHeight = parseInt(this.$store.getters.getTopMainHeightFn) - parseInt(this.headerHeight) + 'px';
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
// 重新记录多选结果
|
||||
this.multipleSelection = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
this.multipleSelection.push(val[i].id);
|
||||
}
|
||||
// 处理多选框的选中、显示、隐藏等
|
||||
if (val.length > 0) {
|
||||
const tmpArr = [];
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
const data = val[i];
|
||||
tmpArr.push(data.id);
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
const id = this.tableData[i].id;
|
||||
if (tmpArr.indexOf(id) == -1) {
|
||||
this.tableData[i].rowChecked = false;
|
||||
this.hideRowCheckbox(this.$refs[id]);
|
||||
} else {
|
||||
this.tableData[i].rowChecked = true;
|
||||
this.showRowCheckbox(this.$refs[id]);
|
||||
}
|
||||
}
|
||||
this.showFooter = true;
|
||||
} else {// 全部取消
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
this.tableData[i].rowChecked = false;
|
||||
this.hideRowCheckbox(this.$refs[this.tableData[i].id]);
|
||||
}
|
||||
this.showFooter = false;
|
||||
}
|
||||
this.initTableHeight();
|
||||
},
|
||||
cellClass(row){
|
||||
if(!row.row.rowChecked && row.columnIndex === 0){
|
||||
return "row-checkbox-hide"
|
||||
}
|
||||
},
|
||||
hideRowCheckbox(rowTdDom) {// 控制表格该行显示多选框
|
||||
const rowTr = closest(rowTdDom, 'TR');
|
||||
const firstTd = rowTr.firstChild;
|
||||
firstTd.classList.add("row-checkbox-hide");
|
||||
},
|
||||
showRowCheckbox(rowTdDom) {// 控制表格该行显示多选框
|
||||
const rowTr = closest(rowTdDom, 'TR');
|
||||
const firstTd = rowTr.firstChild;
|
||||
firstTd.classList.remove("row-checkbox-hide");
|
||||
},
|
||||
enterRow(row, column, cell, event) {// 鼠标进入行事件
|
||||
const rowTr = closest(cell, 'TR');
|
||||
const firstTd = rowTr.firstChild;
|
||||
firstTd.classList.remove("row-checkbox-hide");
|
||||
},
|
||||
leaveRow(row, column, cell, event) {// 鼠标离开行事件
|
||||
if (!row.rowChecked) {
|
||||
const rowTr = closest(cell, 'TR');
|
||||
const firstTd = rowTr.firstChild;
|
||||
firstTd.classList.add("row-checkbox-hide");
|
||||
} else {
|
||||
const rowTr = closest(cell, 'TR');
|
||||
const firstTd = rowTr.firstChild;
|
||||
firstTd.classList.remove("row-checkbox-hide");
|
||||
}
|
||||
},
|
||||
closeFooter() {
|
||||
// 取消全部选择,会自动执行handleSelectionChange进行底部栏关闭
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
recoverFiles(id) {// 还原
|
||||
const that = this;
|
||||
that.$confirm('确定要还原吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let removeIds = [];
|
||||
if (id) {// 单个文件还原
|
||||
removeIds.push("'" + id + "'");
|
||||
} else {// 多个文件还原
|
||||
for (let i = 0; i < that.multipleSelection.length; i++) {
|
||||
removeIds.push("'" + that.multipleSelection[i] + "'");
|
||||
}
|
||||
}
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_recycle_restore',
|
||||
removeIds: removeIds.join(',')
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '还原成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.searchProcessList();
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
removeFiles(id) {// 删除
|
||||
const that = this;
|
||||
that.$confirm('回收站中的数据删除后无法恢复,确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let removeIds = [];
|
||||
if (id) {// 单个文件删除
|
||||
removeIds.push("'" + id + "'");
|
||||
} else {// 多个文件删除
|
||||
for (let i = 0; i < that.multipleSelection.length; i++) {
|
||||
removeIds.push("'" + that.multipleSelection[i] + "'");
|
||||
}
|
||||
}
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_recycle_delete',
|
||||
removeIds: removeIds.join(',')
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.searchProcessList();
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
scorllBottomEvent() {// 滚动到底部懒加载数据
|
||||
const that = this;
|
||||
let dom = document.querySelector(".el-table__body-wrapper");
|
||||
dom.addEventListener("scroll", function() {
|
||||
const scrollDistance =dom.scrollHeight - dom.scrollTop - dom.clientHeight;
|
||||
if(scrollDistance <=0){//等于0证明已经到底,可以请求接口
|
||||
that.loadData();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.tableHeight = (parseInt(newd)) - parseInt(this.headerHeight) + 'px';
|
||||
this.searchProcessList();// 窗口大小变化之后,重新执行搜索
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#recycle >>> .el-main {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
#table >>> .item {
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
#table >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#table >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
#table >>> .row-checkbox-hide .el-checkbox__input {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
115
com.actionsoft.apps.coe.pal/views/repository/Repository.vue
Normal file
115
com.actionsoft.apps.coe.pal/views/repository/Repository.vue
Normal file
@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<el-container id="repository" :style="{'width': '100%', 'height': mainHeight}">
|
||||
<el-aside width="280px" style="overflow: hidden;border-right: 1px solid #F2F2F2">
|
||||
<RepositoryMain v-if="reFresh" ref="repositoryMain" key="repositoryMain"/>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<component ref="component" :is="mainContent" :uuid="uuid" :key="Math.random()" :refreshTreeParentNode="refreshTreeParentNode" :refreshTreeNode="refreshTreeNode" :treeNode="treeNode"></component>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RepositoryMain from "./RepositoryMain";
|
||||
import RepositoryMainList from "./RepositoryMainList";
|
||||
import RepositoryList from "./RepositoryList";
|
||||
export default {
|
||||
name: "Repository",
|
||||
components: {RepositoryMain, RepositoryMainList, RepositoryList},
|
||||
data(){
|
||||
return {
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn)) + 'px',
|
||||
mainContent: '',
|
||||
uuid: '',
|
||||
reFresh: false,
|
||||
treeNode:{},
|
||||
}
|
||||
},
|
||||
provide: function() {
|
||||
return {
|
||||
openRepositoryList: this.openRepositoryList,
|
||||
transferTreeNode: this.transferTreeNode
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getRouteParam(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
getRouteParam(params) {
|
||||
if (JSON.stringify(params) == '{}' || !params.id) {// 无搜索,显示全部树和最近列表
|
||||
this.reFresh = false;
|
||||
this.mainContent = '';
|
||||
this.$nextTick(()=>{
|
||||
this.reFresh = true;
|
||||
this.mainContent = 'RepositoryMainList';
|
||||
});
|
||||
} else {// 有搜索,定位到符合条件的树,并且点击
|
||||
this.$refs.repositoryMain.queryTreeByIdAndPath(params.id, params.versionId, params.path);
|
||||
}
|
||||
},
|
||||
openRepositoryList(id) {
|
||||
this.mainContent = '';
|
||||
this.uuid = id;
|
||||
this.mainContent = 'RepositoryList';
|
||||
},
|
||||
transferTreeNode(obj){
|
||||
this.treeNode = obj;
|
||||
},
|
||||
refreshTreeParentNode(id) {// 刷新当前节点的父节点,即重新加载id节点
|
||||
this.$refs.repositoryMain.refreshParentNode(id);
|
||||
},
|
||||
refreshTreeNode(id) {// 刷新当前节点的子节点,即重新加载id节点(关闭+展开)
|
||||
this.$refs.repositoryMain.refreshNode(id);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
},
|
||||
listenWsId() {
|
||||
return this.$store.getters.getWsIdFn;
|
||||
},
|
||||
listenTeamId() {
|
||||
return this.$store.getters.getTeamIdFn;
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(newd)) + 'px';
|
||||
},
|
||||
listenWsId: function(newd, old) {
|
||||
this.reFresh = false;
|
||||
this.mainContent = '';
|
||||
this.$nextTick(()=>{
|
||||
this.reFresh = true;
|
||||
this.mainContent = 'RepositoryMainList';
|
||||
});
|
||||
},
|
||||
listenTeamId: function(newd, old) {
|
||||
this.reFresh = false;
|
||||
this.mainContent = '';
|
||||
this.$nextTick(()=>{
|
||||
this.reFresh = true;
|
||||
this.mainContent = 'RepositoryMainList';
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeRouteUpdate(to, from, next){
|
||||
this.getRouteParam(to.query);
|
||||
next();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#repository >>> .el-main {
|
||||
display: block;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
-ms-flex-preferred-size: auto;
|
||||
flex-basis: auto;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "RepositoryExport"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,436 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<div v-if="category!='org'" key="dialog2" class="repository-import">
|
||||
<el-dialog
|
||||
title="导入模型"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
:close-on-click-modal=false
|
||||
:before-close="handleClose">
|
||||
<div style="height: 250px;" v-loading="loading" element-loading-text="请稍等">
|
||||
<div style="text-align: center;padding-top: 10px;">
|
||||
<awsui-button style="width: 130px;" class="button-general-color" type="primary" @click="openFileSelect('file')">本地文件上传</awsui-button>
|
||||
</div>
|
||||
<div class="text-second-color" style="font-size: 12px;margin-top: 10px;margin-left: 15px;">请上传export文件,支持多个文件同时导入</div>
|
||||
<div style="height: 180px;margin: 10px 10px;overflow:auto;">
|
||||
<PALUpload ref="palUpload" style="width: 100%;"
|
||||
class="upload-demo"
|
||||
appId="com.actionsoft.apps.coe.pal"
|
||||
repositoryName="tmp"
|
||||
groupValue="_import"
|
||||
fileValue="Normal"
|
||||
:multiple=true
|
||||
:on-preview="handlePreview"
|
||||
:on-success="handleSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:on-error="handleError"
|
||||
:before-remove="beforeRemove"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:on-progress="handleProgress"
|
||||
accept=".export"
|
||||
:file-list="fileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button name="selectFileButton" style="width: 130px;" class="button-general-color" type="primary">本地文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" :disabled="buttonDisabled" type="primary" @click="importSave">确定</awsui-button>
|
||||
<awsui-button @click="cancel">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div v-else="category=='org'" key="dialog1" class="repository-import">
|
||||
<el-dialog
|
||||
title="导入组织模型"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal=false
|
||||
width="500px"
|
||||
:before-close="handleClose">
|
||||
<div v-show="step1" id="step1" style="height: 250px;text-align: center;" v-loading="loading" element-loading-text="请稍等">
|
||||
<div style="position: relative;top:35%;">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<awsui-button style="width: 130px;" class="button-general-color" type="primary" @click="openFileSelect('file')">直接导入</awsui-button>
|
||||
</div>
|
||||
<div>
|
||||
<awsui-button style="width: 130px;" class="button-general-color-reverse" @click="openFileSelect('excel')">模板导入</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="step2" id="step2" style="height: 250px;" v-loading="loading" element-loading-text="请稍等">
|
||||
<div style="text-align: center;padding-top: 10px;">
|
||||
<awsui-button style="width: 130px;" :class="{'button-general-color': type == 'file', 'button-general-color-reverse': type == 'excel'}" :type="type == 'file' ? 'primary' : ''" @click="openFileSelect('file')">直接导入</awsui-button>
|
||||
<awsui-button style="width: 130px;" :class="{'button-general-color': type == 'excel', 'button-general-color-reverse': type == 'file'}" :type="type == 'excel' ? 'primary' : ''" @click="openFileSelect('excel')">模板导入</awsui-button>
|
||||
</div>
|
||||
<div v-if="type == 'file'">
|
||||
<div class="text-second-color" style="font-size: 12px;margin-top: 10px;margin-left: 15px;">请点击"直接导入"按钮上传export文件,支持多个文件同时导入</div>
|
||||
<div style="height: 180px;margin: 10px 10px;overflow:auto;">
|
||||
<PALUpload ref="palUpload" style="width: 100%;"
|
||||
class="upload-demo"
|
||||
appId="com.actionsoft.apps.coe.pal"
|
||||
repositoryName="tmp"
|
||||
groupValue="_import"
|
||||
fileValue="Normal"
|
||||
:multiple=true
|
||||
:on-preview="handlePreview"
|
||||
:on-success="handleSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:on-error="handleError"
|
||||
:before-remove="beforeRemove"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:on-progress="handleProgress"
|
||||
accept=".export"
|
||||
:file-list="fileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button name="selectFileButton" style="width: 130px;" class="button-general-color" type="primary">本地文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="type == 'excel'">
|
||||
<div style="height: 200px;margin: 25px 10px 10px;overflow:auto;">
|
||||
<div style="width: 438px;height: 80px;border: 1px solid #F2F2F2;">
|
||||
<div style="float: left;height: 100%;width: 80px;display: inline-block;background-color: #F5F7FA;text-align: center;line-height: 85px;vertical-align: middle;">
|
||||
<i style="font-size: 40px;" class="iconfont text-second-color"></i>
|
||||
</div>
|
||||
<div style="float: left;height: 100%;">
|
||||
<div style="display: inline-block;height: 100%;margin-left: 15px;margin-top: 9px;">
|
||||
<p class="text-general-color">填写导入组织信息</p>
|
||||
<p class="text-second-color" style="font-size: 12px;padding-top: 4px;padding-bottom: 4px;">请按照说明格式正确填写Excel文件</p>
|
||||
<p style="font-size: 12px;cursor: pointer;" class="text-linker-color" @click="downloadOrgTemplate()">下载模板</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 20px;"></div>
|
||||
<div style="width: 438px;height: 80px;border: 1px solid #F2F2F2;">
|
||||
<div style="float: left;height: 100%;width: 80px;display: inline-block;background-color: #F5F7FA;text-align: center;line-height: 85px;vertical-align: middle;">
|
||||
<i style="font-size: 40px;" class="iconfont text-second-color"></i>
|
||||
</div>
|
||||
<div style="float: left;height: 100%;">
|
||||
<div style="display: inline-block;height: 100%;margin-left: 15px;margin-top: 9px;">
|
||||
<p class="text-general-color">上传填好的组织信息文件</p>
|
||||
<p class="text-second-color" style="font-size: 12px;padding-top: 4px;padding-bottom: 4px;">文件后缀必须为xls或xlsx(即Excel格式)</p>
|
||||
<p v-if="!isOrgUploaded" style="font-size: 12px;cursor: pointer;" class="text-linker-color" @click="uploadOrgExcel">上传文件</p>
|
||||
<p v-else style="font-size: 12px;cursor: pointer;" class="text-linker-color"><label style="display: inline-block;max-width: 300px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{orgUploadFileName}}</label> <i class="iconfont text-important-color" style="font-size: 12px;position: relative;top: -3px;" @click="removeOrgUpload"></i></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<PALUpload ref="orgUpload" style="width: 100%;"
|
||||
class="upload-demo"
|
||||
appId="com.actionsoft.apps.coe.pal"
|
||||
repositoryName="tmp"
|
||||
groupValue="_import"
|
||||
fileValue="Normal"
|
||||
:limit="1"
|
||||
:show-file-list=false
|
||||
:on-success="handleOrgUploadSuccess"
|
||||
accept=".xls,.xlsx"
|
||||
:file-list="orgFileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button name="selectOrgFileButton" style="width: 130px;" class="button-general-color" type="primary">Excel文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" :disabled="buttonDisabled" type="primary" @click="importSave">确定</awsui-button>
|
||||
<awsui-button @click="cancel">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PALUpload from "@/components/common/upload/index.vue";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "RepositoryImport",
|
||||
components: {PALUpload},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
buttonDisabled: false,
|
||||
category: '',
|
||||
obj: null,
|
||||
fileList: [],
|
||||
step1: true,
|
||||
step2: false,
|
||||
type: 'file',
|
||||
orgFileList: [],
|
||||
isOrgUploaded: false,
|
||||
orgUploadFileName: '',
|
||||
parentId: '',
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
inject: ['getIsHighSecurity','setSecurityVisible','securityFileList','setSecurityType'],
|
||||
computed:{
|
||||
isHighSecurity(){
|
||||
return this.getIsHighSecurity();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearParam() {
|
||||
this.category = '';
|
||||
this.obj = null;
|
||||
this.fileList = [];
|
||||
this.orgFileList = [];
|
||||
this.buttonDisabled = false;
|
||||
this.dialogVisible = false;
|
||||
this.step1 = true;
|
||||
this.step2 = false;
|
||||
this.type = '';
|
||||
this.isOrgUploaded = false;
|
||||
this.orgUploadFileName = '';
|
||||
this.parentId = '';
|
||||
this.loading = false;
|
||||
if (this.$refs.palUpload) {
|
||||
this.$refs.palUpload.clearFiles();
|
||||
}
|
||||
if (this.$refs.orgUpload) {
|
||||
this.$refs.orgUpload.clearFiles();
|
||||
}
|
||||
},
|
||||
openImportRepositoryDlg(obj, category, parentId) {
|
||||
const that = this;
|
||||
that.category = category;
|
||||
that.obj = obj;
|
||||
that.parentId = parentId;
|
||||
setTimeout(() => {
|
||||
that.dialogVisible = true;
|
||||
that.$nextTick(() => {
|
||||
if (that.category != 'org') {
|
||||
that.openFileSelect('file');
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
},
|
||||
cancel() {
|
||||
this.clearParam();
|
||||
},
|
||||
importSave() {
|
||||
const that = this;
|
||||
const wsId = that.$store.getters.getWsIdFn;
|
||||
const teamId = that.$store.getters.getTeamIdFn;
|
||||
let fileName = '';
|
||||
if (that.type == 'file') {
|
||||
if (that.fileList.length == 0) {
|
||||
that.$message({message: '请上传需要导入的文件',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
const fileList = [];
|
||||
for (let i = 0; i < that.fileList.length; i++) {
|
||||
fileList.push(that.fileList[i].name);
|
||||
}
|
||||
that.buttonDisabled = true;
|
||||
that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_import',
|
||||
fileList: JSON.stringify(fileList),
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
plCategory: that.category,
|
||||
parentId: that.parentId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
//三员管理,密级标定
|
||||
if(that.isHighSecurity){
|
||||
let securityBindList = ro.data.data.securityBindList;
|
||||
if(undefined !=securityBindList && securityBindList.length>0){
|
||||
for(let i=0;i<securityBindList.length;i++){
|
||||
let securityBind = securityBindList[i];
|
||||
that.securityFileList.push(securityBind);
|
||||
}
|
||||
that.setSecurityType("import")
|
||||
that.setSecurityVisible(true);
|
||||
}
|
||||
}else{
|
||||
that.$message({
|
||||
message: '导入成功',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
// 刷新节点,重新打开
|
||||
that.obj.refreshNode();
|
||||
that.obj.openRepositoryList(that.parentId);
|
||||
that.cancel();
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
that.buttonDisabled = false;
|
||||
that.loading = false;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else if (that.category == 'org' && that.type == 'excel') {// 组织Excel导入
|
||||
if (that.orgFileList.length == 0) {
|
||||
that.$message({message: '请上传需要导入的组织文件',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
fileName = that.orgFileList[0].name;// 组织文件
|
||||
that.loading = true;
|
||||
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_import_org',
|
||||
fileName: fileName,
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
parentId: that.parentId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
//三员管理,密级标定
|
||||
if(that.isHighSecurity){
|
||||
let securityBindList = ro.data.securityBindList;
|
||||
if(undefined !=securityBindList && securityBindList.length>0){
|
||||
for(let i=0;i<securityBindList.length;i++){
|
||||
let securityBind = securityBindList[i];
|
||||
that.securityFileList.push(securityBind);
|
||||
}
|
||||
that.setSecurityType("import")
|
||||
that.setSecurityVisible(true);
|
||||
}
|
||||
}else{
|
||||
that.$message({
|
||||
message: '导入成功',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
// 刷新节点,重新打开
|
||||
that.obj.refreshNode();
|
||||
that.obj.openRepositoryList(that.parentId);
|
||||
that.cancel();
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
that.buttonDisabled = false;
|
||||
that.loading = false;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.clearParam();
|
||||
done();
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
|
||||
handleExceed(files, fileList) {
|
||||
|
||||
},
|
||||
handleError(err, file, fileList) {
|
||||
},
|
||||
beforeUpload(file) {
|
||||
},
|
||||
handleProgress(event, file, fileList) {
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const that = this;
|
||||
that.fileList = [];
|
||||
let hash = {};
|
||||
for (let i = fileList.length-1; i >= 0; i--) {
|
||||
let currFile = fileList[i];
|
||||
if (!hash[currFile.name]) {
|
||||
that.fileList.unshift(currFile);
|
||||
hash[currFile.name] = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
if (file.status == 'success') {
|
||||
// 删除之前,进行服务器文件删除
|
||||
}
|
||||
},
|
||||
openFileSelect(type) {
|
||||
this.type = type;
|
||||
if (this.category != 'org') {
|
||||
this.$nextTick(()=>{
|
||||
document.getElementsByName("selectFileButton")[0].click();
|
||||
});
|
||||
} else {
|
||||
if (type == 'file') {
|
||||
this.step1 = false;
|
||||
this.step2 = true;
|
||||
this.$nextTick(()=>{
|
||||
document.getElementsByName("selectFileButton")[0].click();
|
||||
});
|
||||
} else {
|
||||
this.type = type;
|
||||
this.step1 = false;
|
||||
this.step2 = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
downloadOrgTemplate() {// 下载组织模板
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_repository_import_org_template',
|
||||
category: that.category
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
window.open(ro.url);
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
uploadOrgExcel() {// 上传组织文件
|
||||
if (this.$refs.orgUpload) {
|
||||
this.$refs.orgUpload.clearFiles();
|
||||
}
|
||||
document.getElementsByName("selectOrgFileButton")[0].click();
|
||||
},
|
||||
handleOrgUploadSuccess(response, file, fileList) {
|
||||
this.orgFileList = [];
|
||||
this.orgFileList.push(file);
|
||||
// 赋值
|
||||
this.orgUploadFileName = file.name;
|
||||
this.isOrgUploaded = true;
|
||||
},
|
||||
removeOrgUpload() {
|
||||
this.isOrgUploaded = false;
|
||||
this.orgFileList = [];
|
||||
this.orgUploadFileName = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.repository-import >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.repository-import >>> .el-upload-list__item:first-child {
|
||||
margin-top: 0px;
|
||||
}
|
||||
.repository-import >>> .el-upload {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
137
com.actionsoft.apps.coe.pal/views/repository/RepositoryInfo.vue
Normal file
137
com.actionsoft.apps.coe.pal/views/repository/RepositoryInfo.vue
Normal file
@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<el-container id="repositoryInfo">
|
||||
<awsui-dialog
|
||||
:border="false"
|
||||
:visible.sync="dialogVisible"
|
||||
width="800px"
|
||||
:close-on-click-modal=false
|
||||
:before-close="handleClose">
|
||||
<template>
|
||||
<el-tabs v-model="activeName" @tab-click="changeRepositoryType">
|
||||
<template v-if="this.methodId != 'default'">
|
||||
<el-tab-pane label="文件属性" name="property"></el-tab-pane>
|
||||
<el-tab-pane label="版本管理" name="version"></el-tab-pane>
|
||||
</template>
|
||||
<el-tab-pane label="附件管理" name="upfile"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
<component ref="component" :is="repositoryInfoType" :id="id" :versionId="versionId" :isUse="isUse" :isPublish="isPublish" :isStop="isStop" :isApproval="isApproval" :repositoryRefresh="repositoryRefresh"></component>
|
||||
</awsui-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RepositoryInfoProperty from "./RepositoryInfoProperty";
|
||||
import RepositoryInfoVersion from "./RepositoryInfoVersion";
|
||||
import RepositoryInfoUpfile from "./RepositoryInfoUpfile";
|
||||
export default {
|
||||
name: "RepositoryInfo",
|
||||
components: {RepositoryInfoProperty, RepositoryInfoVersion, RepositoryInfoUpfile},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
id: '',
|
||||
versionId: '',
|
||||
type: '',
|
||||
activeName: '',
|
||||
repositoryInfoType: '',
|
||||
isUse: false,
|
||||
isPublish: false,
|
||||
isStop: false,
|
||||
isApproval: false,
|
||||
methodId: '',
|
||||
parent: undefined
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
clearParam() {
|
||||
this.dialogVisible = false;
|
||||
this.id = '';
|
||||
this.versionId = '';
|
||||
this.type = '';
|
||||
this.repositoryInfoType = '';
|
||||
this.isUse = false;
|
||||
this.isPublish = false;
|
||||
this.isStop = false;
|
||||
this.isApproval = false;
|
||||
this.methodId = '';
|
||||
this.parent = undefined;
|
||||
},
|
||||
openRepositoryInfoDlg(parent, id, versionId, type, isUse, isPublish, isStop, isApproval, methodId) {
|
||||
this.id = id;
|
||||
this.versionId = versionId;
|
||||
this.type = type;
|
||||
this.activeName = type;
|
||||
this.initInfoChildType(type);
|
||||
this.dialogVisible = true;
|
||||
this.isUse = isUse;
|
||||
this.isPublish = isPublish;
|
||||
this.isStop = isStop;
|
||||
this.isApproval = isApproval;
|
||||
this.methodId = methodId;
|
||||
this.parent = parent;
|
||||
},
|
||||
initInfoChildType(type) {
|
||||
if (type == 'property') {
|
||||
this.repositoryInfoType = 'RepositoryInfoProperty';
|
||||
} else if (type == 'version') {
|
||||
this.repositoryInfoType = 'RepositoryInfoVersion';
|
||||
} else if (type == 'upfile') {
|
||||
this.repositoryInfoType = 'RepositoryInfoUpfile'
|
||||
} else {
|
||||
this.repositoryInfoType = '';
|
||||
}
|
||||
},
|
||||
repositoryRefresh(id) {// 版本管理中切换版本后刷新父页面树
|
||||
if (this.parent) {
|
||||
if (this.parent.refreshTreeParentNode) {
|
||||
this.parent.refreshTreeParentNode(id);
|
||||
}
|
||||
this.parent.initData();
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.clearParam();
|
||||
done();
|
||||
},
|
||||
changeRepositoryType(tab, event) {// 切换tab
|
||||
this.initInfoChildType(tab.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#repositoryInfo >>> .awsui-dialog__body {
|
||||
padding: 10px 20px 20px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
#repositoryInfo >>> .awsui-dialog__header {
|
||||
padding: 0;
|
||||
}
|
||||
#repositoryInfo >>> .el-tabs__nav-wrap:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #F2F2F2;
|
||||
z-index: 1;
|
||||
}
|
||||
#repositoryInfo >>> .el-tabs__active-bar {
|
||||
height: 1px;
|
||||
background-color: #4E7FF9;
|
||||
}
|
||||
#repositoryInfo >>> .el-tabs__item.is-active {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#repositoryInfo >>> .el-tabs__item {
|
||||
color: #606266;
|
||||
}
|
||||
#repositoryInfo >>> .awsui-dialog__headerbtn {
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,724 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<div id="repositoryInfoProperty" style="height: 500px;width: 100%;overflow: auto;">
|
||||
<template v-for="(group, i) in propertyData">
|
||||
<div class="property-group"><p style="padding-left: 5px;"><b>{{group.groupPathName}}</b></p></div>
|
||||
<div style="margin: 0 50px 0 30px;">
|
||||
<template v-for="(item, j) in group.data">
|
||||
<!-- 模型名称单独处理 -->
|
||||
<template v-if="item.type=='string' && item.id == 'PLNAME'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" v-model="item.value" @blur="saveRepositoryNameVal(item.value)"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--string类型-->
|
||||
<template v-if="item.type=='string' && item.id != 'PLNAME'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" v-model="item.value" @blur="saveStringPropVal(item.id, item.value, item.attrSource)"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--textarea类型-->
|
||||
<template v-if="item.type=='textarea'">
|
||||
<div class="property-item">
|
||||
<label class="property-label" style="vertical-align: bottom;">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input
|
||||
:size=size
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入内容"
|
||||
v-model="item.value"
|
||||
:disabled="item.readonly"
|
||||
@blur="saveStringPropVal(item.id, item.value, item.attrSource)"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--number类型-->
|
||||
<template v-if="item.type=='number'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input-number @change="saveNumberPropVal(item.id, item.value, item.attrSource)" :size=size style="width: 100%;cursor: pointer;" controls-position="right" :step="1" v-model="item.value" :disabled="item.readonly"></el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--boolean类型-->
|
||||
<template v-if="item.type=='boolean'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<template>
|
||||
<el-select @change="saveSingleSelectVal(item.id, item.value, item.attrSource)" :disabled="item.readonly" clearable :size=size style="width: 100%" v-model="item.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="option in item.options"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--select类型-->
|
||||
<template v-if="item.type=='select'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<template>
|
||||
<el-select @change="saveSingleSelectVal(item.id, item.value, item.attrSource)" :disabled="item.readonly" clearable :size=size style="width: 100%" v-model="item.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="option in item.options"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--select_m类型-->
|
||||
<template v-if="item.type=='select_m'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<template>
|
||||
<el-select @change="saveMultipleSelectVal(item.id, item.value, item.attrSource)" :disabled="item.readonly" :size=size style="width: 100%" multiple v-model="item.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="option in item.options"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--deptAddress类型(平台部门地址簿)-->
|
||||
<template v-if="item.type=='deptAddress'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" readonly @click.native="choiceBpmOrgAddressComponent(group.groupPath, item.type, item.id, item.readonly)" v-model="item.value"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--userAddress类型(平台人员地址簿)-->
|
||||
<template v-if="item.type=='userAddress'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" readonly @click.native="choiceBpmOrgAddressComponent(group.groupPath,item.type, item.id, item.readonly)" v-model="item.value"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--relation-org-shape类型(PAL组织形状调用)-->
|
||||
<template v-if="item.type=='relationOrg'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" readonly v-model="item.value"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--awsorg类型-->
|
||||
<template v-if="item.type=='awsorg'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" readonly @click.native="choiceAwsOrgComponent(item.ref, item.type, item.id, item.label, item.readonly)" v-model="item.value"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--relation类型-->
|
||||
<template v-if="item.type=='relation'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" readonly @click.native="choiceRelationComponent(item.ref, item.type, item.id, item.label, item.readonly, item.fileIds, item.shapeIds)" v-model="item.value"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- link类型 -->
|
||||
<template v-if="item.type=='link' && item.id != 'PLNAME'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" v-model="item.value" @blur="saveStringPropVal(item.id, item.value, item.attrSource)"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- DateTimePicker 类型 -->
|
||||
<template v-if="item.type=='DateTimePicker'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" type="datetime" placeholder="请选择日期时间" @blur="saveStringPropVal(item.id, item.value, item.attrSource)" :disabled="item.readonly" v-model="item.value" ></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- table 类型 -->
|
||||
<template v-if="item.type=='table'">
|
||||
<div class="property-item">
|
||||
<label class="property-label">{{item.label}}</label>
|
||||
<div class="property-value">
|
||||
<el-input :size=size :disabled="item.readonly" v-model="item.value.name">
|
||||
<template slot="suffix">
|
||||
<i style="font-size: 20px;line-height: 36px" class="el-icon-s-grid" @click="openTableDialog(item.id,item.value,item.attrSource)"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<BPMOrgAddress
|
||||
ref="palAwsOrgAddress"
|
||||
:visible.sync="bpmOrgAddress.visible"
|
||||
:addressType="bpmOrgAddress.addressType"
|
||||
v-on:cancel="bpmOrgAddress.visible = false"
|
||||
v-on:getResult="saveBpmOrgAddressResult"
|
||||
multiple
|
||||
:title="title"
|
||||
:multiple="bpmOrgAddress.multiple"
|
||||
/>
|
||||
<pal-relation-address
|
||||
ref="palRelationAddress"
|
||||
:visible.sync="palRelationAddressVisible"
|
||||
v-on:cancel="palRelationAddressVisible = false"
|
||||
v-on:getResult="saveRelationResult"
|
||||
:title="title"
|
||||
:selectFileId="relation.selectFileId"
|
||||
:selectShapeId="relation.selectShapeId"
|
||||
:relationType="relation.relationType"
|
||||
:categorys="relation.category"
|
||||
:methods="relation.method"
|
||||
:wsId="relation.wsId"
|
||||
:teamId="relation.teamId"
|
||||
:multiple = relation.multiple
|
||||
/>
|
||||
<el-container>
|
||||
<el-dialog
|
||||
id="tableDialog"
|
||||
width="500px"
|
||||
:visible.sync="tableDialogVisible"
|
||||
v-if="tableDialogVisible"
|
||||
:modal-append-to-body=true
|
||||
:close-on-click-modal=false
|
||||
:append-to-body=true
|
||||
:show-close=false
|
||||
destroy-on-close
|
||||
>
|
||||
<template slot="title">
|
||||
<el-tooltip placement="top-start">
|
||||
<div slot="content">{{ dialogTableNewValue.name }}</div>
|
||||
<el-input class="titleInput" v-model="dialogTableNewValue.name"/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<div style="height: 300px;overflow: auto;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td style="width: 25%">
|
||||
<el-tooltip placement="top-start">
|
||||
<div slot="content">{{ dialogTableNewValue.table[0].name }}</div>
|
||||
<el-input class="headInput" v-model="dialogTableNewValue.table[0].name" size="mini"/>
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td style="width: 55%">
|
||||
<el-tooltip placement="top-start">
|
||||
<div slot="content">{{ dialogTableNewValue.table[0].name }}</div>
|
||||
<el-input class="headInput" v-model="dialogTableNewValue.table[0].desc" size="mini"/>
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td><span style="font-size: 14px;color: #909399;font-weight: bold;font-family: PingFangSC-Light;">操作</span></td>
|
||||
</tr>
|
||||
<tr v-for="item in dialogTableNewValue.table.slice(1)">
|
||||
<td>
|
||||
<el-tooltip placement="top-start">
|
||||
<div slot="content">{{ item.name }}</div>
|
||||
<el-input class="contentInput" v-model="item.name" size="mini"/>
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td>
|
||||
<el-tooltip placement="top-start">
|
||||
<div slot="content">{{ item.desc }}</div>
|
||||
<el-input class="contentInput" v-model="item.desc" size="mini"/>
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td><span style="color: red;text-decoration: underline" @click="deleteTableTr(item.id)">删除</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<awsui-button style="margin-top: 10px;" class="button-general-color" type="primary" @click="addNewTr">新增</awsui-button>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="confirmTableDialog()">确定</awsui-button>
|
||||
<awsui-button @click="cancelTableDialog">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BPMOrgAddress from "@/components/common/BPMOrgAddress/index.js";// pal平台组织架构地址簿,调用平台部门人员角色
|
||||
import PalRelationAddress from "@/components/common/PalRelationAddress/index.js";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
// pal关联关系地址簿
|
||||
export default {
|
||||
name: "RepositoryInfoProperty",
|
||||
components: {BPMOrgAddress, PalRelationAddress},
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
versionId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
repositoryRefresh: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bpmOrgAddress: {
|
||||
visible: false,
|
||||
addressType: "user",
|
||||
multiple: false
|
||||
},
|
||||
palRelationAddressVisible: false,
|
||||
title: '',
|
||||
relation: {
|
||||
selectFileId: '',
|
||||
selectShapeId: '',
|
||||
relationType: 'shape',
|
||||
category: '',
|
||||
method: '',
|
||||
wsId: this.$store.getters.getWsIdFn,
|
||||
teamId: this.$store.getters.getTeamIdFn,
|
||||
multiple: false
|
||||
},
|
||||
propertyData: [
|
||||
{
|
||||
groupPath: 'basic',
|
||||
groupPathName: '基本属性',
|
||||
data: []
|
||||
}
|
||||
],
|
||||
size: 'medium',
|
||||
currPropertyId: '',
|
||||
currPropertyType: '',
|
||||
currGroup: '',
|
||||
currCategory: '',
|
||||
currMethod: '',
|
||||
currRelationType: '',
|
||||
currPropSource: '',
|
||||
tableDialogVisible: false,
|
||||
dialogTableId: '',
|
||||
dialogTableOldValue: {}, // 弹框表格值副本 刚打开dialog的值 点击取消会把该值保存到数据库
|
||||
dialogTableNewValue: { // 弹框表格值 对表格的更新操作在此进行 点击确定会把该值保存到数据库
|
||||
name: '',
|
||||
table: [
|
||||
{ id: '',name: '',desc: '' },
|
||||
]
|
||||
},
|
||||
dialogTableAttrSource: undefined
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_property_data_query',
|
||||
id: that.id,
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
let propertyData = ro.data.propertyData;
|
||||
// table 类型value默认为空对象 初始赋值
|
||||
propertyData.forEach(item => {
|
||||
item.data.forEach(item1 => {
|
||||
if (item1.type == 'table' && JSON.stringify(item1.value) == '{}') {
|
||||
item1.value = {
|
||||
name: '未命名表单',
|
||||
table: [
|
||||
{ id: 'table_head',name: '命名',desc: '描述'}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
that.propertyData = propertyData;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
openTableDialog(id,value,attrSource) {
|
||||
this.tableDialogVisible = true
|
||||
this.dialogTableId = id
|
||||
this.dialogTableOldValue = JSON.parse(JSON.stringify(value))
|
||||
this.dialogTableNewValue = value
|
||||
this.dialogTableAttrSource = attrSource
|
||||
},
|
||||
addNewTr() {
|
||||
this.dialogTableNewValue.table.push({
|
||||
id: Date.now().toString(36),name: '',desc: ''
|
||||
})
|
||||
},
|
||||
deleteTableTr(id) {
|
||||
let index = this.dialogTableNewValue.table.findIndex(item => {
|
||||
return item.id == id
|
||||
})
|
||||
this.dialogTableNewValue.table.splice(index,1)
|
||||
},
|
||||
confirmTableDialog() {
|
||||
if (this.dialogTableAttrSource && this.dialogTableAttrSource == 'default') {
|
||||
this.saveDefaultpropToDb(this.dialogTableId, JSON.stringify(this.dialogTableNewValue));
|
||||
} else {
|
||||
this.saveCustomPropToDb(this.dialogTableId, JSON.stringify(this.dialogTableNewValue));
|
||||
}
|
||||
this.tableDialogVisible = false
|
||||
},
|
||||
cancelTableDialog() {
|
||||
if (this.dialogTableAttrSource && this.dialogTableAttrSource == 'default') {
|
||||
this.saveDefaultpropToDb(this.dialogTableId, JSON.stringify(this.dialogTableOldValue));
|
||||
} else {
|
||||
this.saveCustomPropToDb(this.dialogTableId, JSON.stringify(this.dialogTableOldValue));
|
||||
}
|
||||
this.tableDialogVisible = false
|
||||
},
|
||||
saveStringPropVal(attrId, value, attrSource) {// 保存文本属性内容
|
||||
if (value == undefined) {
|
||||
value = '';
|
||||
}
|
||||
if (attrSource && attrSource == 'default') {
|
||||
this.saveDefaultpropToDb(attrId, value);
|
||||
} else {
|
||||
this.saveCustomPropToDb(attrId, value);
|
||||
}
|
||||
},
|
||||
saveNumberPropVal(attrId, value, attrSource) {// 保存数字类型内容
|
||||
if (value == undefined) {
|
||||
value = '';
|
||||
}
|
||||
if (attrSource && attrSource == 'default') {
|
||||
this.saveDefaultpropToDb(attrId, value);
|
||||
} else {
|
||||
this.saveCustomPropToDb(attrId, value);
|
||||
}
|
||||
},
|
||||
saveSingleSelectVal(attrId, value, attrSource) {// 保存boolean,单选类型内容
|
||||
if (value == undefined) {
|
||||
value = '';
|
||||
}
|
||||
if (attrSource && attrSource == 'default') {
|
||||
this.saveDefaultpropToDb(attrId, value);
|
||||
} else {
|
||||
this.saveCustomPropToDb(attrId, value);
|
||||
}
|
||||
},
|
||||
saveMultipleSelectVal(attrId, value, attrSource) {// 保存多选类型内容
|
||||
value = value.join(',');
|
||||
if (attrSource && attrSource == 'default') {
|
||||
this.saveDefaultpropToDb(attrId, value);
|
||||
} else {
|
||||
this.saveCustomPropToDb(attrId, value);
|
||||
}
|
||||
},
|
||||
saveDefaultpropToDb(attrId, value) {// 保存固定属性至数据库
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_default_attr_content_save',
|
||||
uuid: that.id,
|
||||
josnKey: attrId,
|
||||
josnContent: value
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
// that.$message({
|
||||
// message: '保存成功',
|
||||
// type: 'success'
|
||||
// });
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
saveCustomPropToDb(attrId, value) {// 保存属性内容至数据库
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_more_attr_content_save',
|
||||
uuid: that.id,
|
||||
josnKey: attrId,
|
||||
josnContent: value
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
// that.$message({
|
||||
// message: '保存成功',
|
||||
// type: 'success'
|
||||
// });
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
choiceRelationComponent(ref, type, id, label, readonly, fileIds, shapeIds) {// PAL模型/形状选择组件
|
||||
if (!readonly) {
|
||||
this.currPropertyId = id;
|
||||
this.currPropertyType = type;
|
||||
const method = ref.method;
|
||||
if (method.indexOf('.') > -1) {
|
||||
this.currCategory = method.substring(0, method.indexOf('.'));
|
||||
this.currMethod = method;
|
||||
} else {
|
||||
this.currCategory = method;
|
||||
this.currMethod = '';
|
||||
}
|
||||
this.currPropSource = 'custom';// 自定义扩展属性
|
||||
this.relation.multiple = true;
|
||||
this.currRelationType = ref.type;
|
||||
this.title = label;
|
||||
this.relation.selectFileId = fileIds;// 已选中文件id
|
||||
this.relation.selectShapeId = shapeIds;// 已选中形状id
|
||||
this.relation.relationType = ref.type;
|
||||
this.relation.category = this.currCategory;
|
||||
this.relation.method = this.currMethod;
|
||||
this.relation.multiple = ref.multiple;
|
||||
this.palRelationAddressVisible = true;
|
||||
}
|
||||
},
|
||||
choiceBpmOrgAddressComponent(group, type, id, readonly) {// 平台地址簿组件(责任部门责任人)
|
||||
if (!readonly) {
|
||||
this.currPropertyId = id;
|
||||
this.currPropertyType = type;
|
||||
if (type == "deptAddress") {// 责任部门
|
||||
this.title = '责任部门';
|
||||
this.bpmOrgAddress.addressType = 'dept';
|
||||
this.bpmOrgAddress.visible = true;
|
||||
} else if (type == "userAddress") {// 责任人
|
||||
this.title = '责任人';
|
||||
this.bpmOrgAddress.addressType = 'user';
|
||||
this.bpmOrgAddress.visible = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
choiceAwsOrgComponent(ref, type, id, label, readonly) {// AWS平台部门/人员/角色组件
|
||||
if (!readonly) {
|
||||
this.currPropertyId = id;
|
||||
this.currPropertyType = type;
|
||||
this.title = label;
|
||||
this.bpmOrgAddress.addressType = ref.scope.join(',');
|
||||
this.bpmOrgAddress.multiple = ref.multiple;
|
||||
this.bpmOrgAddress.visible = true;
|
||||
}
|
||||
},
|
||||
saveBpmOrgAddressResult(data) {
|
||||
this.bpmOrgAddress.visible = false;
|
||||
// 保存
|
||||
const params = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
params.push({name: data[i].name, id: data[i].id, type: data[i].type})
|
||||
}
|
||||
this.saveCustomPropToDb(this.currPropertyId, JSON.stringify(params));
|
||||
},
|
||||
// 调用关联组件保存函数
|
||||
saveRelationResult(data) {
|
||||
// 返回结果
|
||||
const jsonContent = {
|
||||
fileId : this.id,
|
||||
shapeId : "",
|
||||
shapeText : "",
|
||||
attrId : this.currPropertyId,
|
||||
relationFileId : '',
|
||||
relationShapeId : '',
|
||||
relationShapeText : '',
|
||||
groupPath : this.currGroup
|
||||
}
|
||||
const relationType = this.currRelationType;
|
||||
if (relationType == 'file') {
|
||||
const fileIds = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
fileIds.push(data[i].versionId);
|
||||
}
|
||||
jsonContent.relationFileId = fileIds.join(",");
|
||||
}
|
||||
else if (relationType == 'shapeAndFile') {
|
||||
let fileIds = [];
|
||||
let shapeIds = [];
|
||||
let shapeNames = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].children.length == 0) { // 文件
|
||||
fileIds.push(data[i].versionId);
|
||||
shapeNames.push(data[i].name);
|
||||
shapeIds.push(' ') // push 空格
|
||||
}else { // 形状
|
||||
for (let j = 0; j < data[i].children.length; j++) {
|
||||
fileIds.push(data[i].versionId)
|
||||
shapeIds.push(data[i].children[j].shapeId)
|
||||
shapeNames.push(data[i].children[j].name)
|
||||
}
|
||||
}
|
||||
}
|
||||
jsonContent.relationFileId = fileIds.join(",");
|
||||
jsonContent.relationShapeId = shapeIds.join(",");
|
||||
jsonContent.relationShapeText = shapeNames.join(",");
|
||||
}
|
||||
else {// 形状
|
||||
const fileIds = [];
|
||||
const shapeIds = [];
|
||||
const shapeNames = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const currFile = data[i];
|
||||
const children = currFile.children;
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
const currShape = children[j];
|
||||
fileIds.push(currFile.id);
|
||||
shapeIds.push(currShape.shapeId);
|
||||
shapeNames.push(currShape.name);
|
||||
}
|
||||
}
|
||||
jsonContent.relationFileId = fileIds.join(",");
|
||||
jsonContent.relationShapeId = shapeIds.join(",");
|
||||
jsonContent.relationShapeText = shapeNames.join(",");
|
||||
}
|
||||
if (this.currPropSource == 'default') {// 固定属性,责任人、责任部门
|
||||
this.saveDefaultpropToDb(this.currPropertyId, JSON.stringify(jsonContent));
|
||||
} else {// 自定义属性
|
||||
this.saveCustomPropToDb(this.currPropertyId, JSON.stringify(jsonContent));
|
||||
}
|
||||
this.palRelationAddressVisible = false;
|
||||
},
|
||||
saveRepositoryNameVal(name) {// 模型名称保存
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_updatetitle',
|
||||
uuid: that.id,
|
||||
title: name,
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
that.initData();
|
||||
// 父页面左侧树和右侧
|
||||
if (that.repositoryRefresh && that.id) {
|
||||
that.repositoryRefresh(that.id);
|
||||
}
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.property-group {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
vertical-align: center;
|
||||
margin: 30px 30px 15px 20px;
|
||||
border-left: 3px solid #4E7FF9;
|
||||
}
|
||||
.property-item {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.property-label {
|
||||
width: 11%;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
padding-right: 12px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.property-value {
|
||||
display: inline-block;
|
||||
width: 85%;
|
||||
}
|
||||
#tableDialog >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tableDialog >>> .el-input__inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-overflow: ellipsis;
|
||||
cursor: pointer;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
}
|
||||
.table tr td{
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
padding:0 5px;
|
||||
white-space: normal;
|
||||
}
|
||||
.titleInput >>> .el-input__inner {
|
||||
height: 25px;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
border: none;
|
||||
font-size: 18px;
|
||||
font-family: PingFangSC-Light;
|
||||
}
|
||||
.headInput >>> .el-input__inner {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
font-weight: bold;
|
||||
font-family: PingFangSC-Light;
|
||||
}
|
||||
.contentInput >>> .el-input__inner {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-family: PingFangSC-Light;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,450 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<div id="repositoryInfoUpfile" style="height: 500px;width: 100%;">
|
||||
<div v-if="havingWritePerm && !isPublish && !isStop && !isApproval" style="height: 40px;">
|
||||
<el-tooltip class="item" placement="bottom-start" :hide-after=5000>
|
||||
<div slot="content">附件格式支持:<br/>jpg, jpeg, gif, png, bmp, pdf, doc, docx, ppt, pptx, xls, xlsx, txt, mp3, mp4, avi, mpeg, flv, swf, wmv</div>
|
||||
<awsui-button style="width: 130px;" class="button-general-color" type="primary" @click="openFileSelect()" :disabled="isPublish || isStop || isApproval">上传附件</awsui-button>
|
||||
</el-tooltip>
|
||||
<PALUpload ref="orgUpload" style="width: 100%;"
|
||||
class="upload-demo"
|
||||
appId="com.actionsoft.apps.coe.pal"
|
||||
:repositoryName=repositoryName
|
||||
:multiple=true
|
||||
:groupValue=groupValue
|
||||
:fileValue=id
|
||||
:show-file-list=false
|
||||
:on-success="uploadSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
accept=".jpg,.jpeg,.gif,.png,.bmp,.pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.mp3,.mp4,.avi,.mpeg,.flv,.swf,.wmv"
|
||||
:file-list="fileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button id="selectFileButton" style="width: 130px;" class="button-general-color" type="primary">Excel文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
</div>
|
||||
<div style="height: 460px;width: 100%;overflow: auto;">
|
||||
<div>
|
||||
<el-table
|
||||
:show-header=false
|
||||
:data="fileTable"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
min-width="300">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isHighSecurity"
|
||||
prop="securityLevel"
|
||||
label="文件密级"
|
||||
min-width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip v-if="onlineDoc" content="预览" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont operate-icon-display" style="cursor: pointer;" @click="readFile(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="下载" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont operate-icon-display" style="cursor: pointer;padding-left: 15px;" @click="downloadFile(scope.row.url)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="havingRemovePerm && !isPublish && !isStop && !isApproval" content="删除" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont icon-lajitong1 operate-icon-display" style="cursor: pointer;padding-left: 15px;" @click="deleteFile(scope.row.name, scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="height: 25px;line-height: 25px;vertical-align: center;margin: 30px 30px 15px 0px;border-left: 3px solid #4E7FF9;"><p style="padding-left: 5px;"><b>关联附件</b></p></div>
|
||||
<div>
|
||||
<el-table
|
||||
:show-header=false
|
||||
:data="relationFileTable"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称"
|
||||
min-width="300">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isHighSecurity"
|
||||
prop="securityLevel"
|
||||
label="文件密级"
|
||||
min-width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="预览" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont operate-icon-display" style="cursor: pointer;" @click="readFile(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="下载" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont operate-icon-display" style="cursor: pointer;padding-left: 15px;" @click="downloadFile(scope.row.url)"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div >
|
||||
<awsui-dialog
|
||||
title="密级标定"
|
||||
:visible.sync="securityVisible"
|
||||
:border="false"
|
||||
append-to-body
|
||||
width="500px">
|
||||
<div style="max-height:500px;overflow-y: auto">
|
||||
<awsui-form :ref="file.uid" label-width="200px" id="securityDialog" :rules="securityRules" v-for="file in securityFileList" :key="file.uid" :model="file">
|
||||
<awsui-form-item :label="file.name" prop="securityLevel">
|
||||
<awsui-select v-model="file.securityLevel" :options="securityOptions" style="width:70%"></awsui-select>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<awsui-button type="primary" @click="uploadServer">确定</awsui-button>
|
||||
<awsui-button @click="securityVisible = false">取 消</awsui-button>
|
||||
</div>
|
||||
</awsui-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PALUpload from "@/components/common/upload/index.vue";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "RepositoryInfoUpfile",
|
||||
components: {PALUpload},
|
||||
props: ['id', 'versionId', 'isUse', 'isPublish', 'isStop', 'isApproval'],
|
||||
data() {
|
||||
var securityValidate = (rule, value, callback) => {
|
||||
if (value === undefined ) {
|
||||
callback(new Error('请选择文件密级'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
fileTable: [],
|
||||
relationFileTable: [],
|
||||
fileList: [],
|
||||
groupValue: 'file',
|
||||
onlineDoc: true,
|
||||
havingWritePerm: false,
|
||||
havingRemovePerm: false,
|
||||
havingVersionManagePerm: false,
|
||||
isHighSecurity: false,
|
||||
isFileSecurity: false,
|
||||
securityList: {},
|
||||
repositoryName: 'COE_Upfile',
|
||||
securityVisible: false,
|
||||
securityFileList: [],
|
||||
securityOptions:[],
|
||||
securityRules: {
|
||||
securityLevel: [{ required: true, trigger: "change", validator: securityValidate ,type: "number"}],
|
||||
},
|
||||
validateFlag: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
this.initRelationData();
|
||||
},
|
||||
watch: {
|
||||
//密级选择dialogVisible 变为false,清空securityFileList
|
||||
securityVisible(newval, oldval){
|
||||
if(!newval){
|
||||
this.securityFileList.splice(0,this.securityFileList.length);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_upfile_load',
|
||||
pl_uuid: that.id,
|
||||
type: 'file',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.havingWritePerm = ro.data.havingWritePerm;
|
||||
that.havingRemovePerm = ro.data.havingRemovePerm;
|
||||
that.havingVersionManagePerm = ro.data.havingVersionManagePerm;
|
||||
//三员管理
|
||||
that.isHighSecurity = ro.data.isHighSecurity;
|
||||
that.isFileSecurity = ro.data.isFileSecurity;
|
||||
that.securityList = ro.data.securityList;
|
||||
if(ro.data.isHighSecurity){
|
||||
that.repositoryName = 'tmp';
|
||||
}
|
||||
const list = ro.data.list;
|
||||
let fileTable = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const curr = list[i];
|
||||
const tableRow = {
|
||||
id: curr.uuid,
|
||||
name: curr.fileName,
|
||||
url: curr.url,
|
||||
securityLevel: that.isHighSecurity ? ro.data.securityList[curr.securityLevel]: "",
|
||||
};
|
||||
fileTable.push(tableRow);
|
||||
}
|
||||
that.fileTable = fileTable;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
initRelationData() {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_relation_upfile_load',
|
||||
pl_uuid: that.id,
|
||||
type: 'file'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
//三员管理
|
||||
that.isHighSecurity = ro.data.isHighSecurity;
|
||||
that.securityList = ro.data.securityList;
|
||||
if(ro.data.isHighSecurity){
|
||||
that.repositoryName = 'tmp';
|
||||
}
|
||||
const list = ro.data.list;
|
||||
let relationFileTable = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const curr = list[i];
|
||||
const tableRow = {
|
||||
id: curr.uuid,
|
||||
name: curr.fileName,
|
||||
url: curr.url,
|
||||
securityLevel: that.isHighSecurity ? that.securityList[curr.securityLevel] : "",
|
||||
};
|
||||
relationFileTable.push(tableRow);
|
||||
}
|
||||
that.relationFileTable = relationFileTable;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
openFileSelect() {
|
||||
let that = this;
|
||||
// 文件访问权限控制
|
||||
if(that.isHighSecurity && that.isFileSecurity){
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_file_permission_query',
|
||||
uuid: that.id,
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
document.getElementById("selectFileButton").click();
|
||||
}else{
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.$message.error(error.msg);
|
||||
})
|
||||
}else{
|
||||
document.getElementById("selectFileButton").click();
|
||||
}
|
||||
},
|
||||
uploadSuccess(response, file, fileList) {// 上传完成后保存
|
||||
//开启三员管理
|
||||
if(this.isHighSecurity){
|
||||
//开启密级标定dialog
|
||||
if(!this.securityVisible){
|
||||
this.securityVisible = true;
|
||||
}
|
||||
//设置密级options
|
||||
if(this.securityOptions.length == 0){
|
||||
Object.keys(this.securityList).map(key =>{
|
||||
let option= {
|
||||
value: key,
|
||||
label: this.securityList[key]
|
||||
}
|
||||
this.securityOptions.push(option);
|
||||
})
|
||||
}
|
||||
this.securityFileList.push(file);
|
||||
}else{
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_upfile_add',
|
||||
pl_uuid: that.id,
|
||||
shape_uuid: "",
|
||||
type: 'file',
|
||||
fileName: file.name,
|
||||
download: 1 // 全部可下载
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '['+ file.name +']上传成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('['+ file.name +']上传失败');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
uploadServer(){ //三员管理下附件上传
|
||||
this.validateFlag = true;
|
||||
//规则校验
|
||||
for(let i=0;i<this.securityFileList.length;i++){
|
||||
let file = this.securityFileList[i];
|
||||
this.$refs[file.uid][0].validate(valid =>{
|
||||
if(!valid){
|
||||
this.validateFlag = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//文件上传
|
||||
if(this.validateFlag){
|
||||
for(let i=0;i<this.securityFileList.length;i++){
|
||||
let file = this.securityFileList[i];
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_upfile_add',
|
||||
pl_uuid: that.id,
|
||||
shape_uuid: "",
|
||||
type: 'file',
|
||||
fileName: file.name,
|
||||
download: 1 ,// 全部可下载,
|
||||
securityLevel: file.securityLevel == undefined ? "" : file.securityLevel,
|
||||
}
|
||||
};
|
||||
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '['+ file.name +']上传成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('['+ file.name +']上传失败');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
this.securityVisible = false;
|
||||
}
|
||||
|
||||
},
|
||||
beforeUpload(file) {// 单个文件校验,返回false不影响其他文件上传
|
||||
if (file.size > 256 * 1024 * 1024) {
|
||||
this.$message({message: '文件[' + file.name + ']不允许大于256M,上传失败',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
// 校验上传名称是否存在相同,相同则提示上传失败
|
||||
for (let i = 0; i < this.fileTable.length; i++) {
|
||||
const currFile = this.fileTable[i];
|
||||
if (currFile.name == file.name) {
|
||||
this.$message({message: '文件[' + file.name + ']已存在,不允许重复上传',type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
readFile(id) {// 在线预览
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_upfile_read',
|
||||
uuid: id
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
window.open(ro.data.url);
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
downloadFile(url) {
|
||||
window.open(url);
|
||||
},
|
||||
deleteFile(name, id) {
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_upfile_del',
|
||||
uuid: id,
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('删除失败');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#repositoryInfoUpfile >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#repositoryInfoUpfile >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,385 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<div id="repositoryInfoVersion" style="height: 500px;width: 100%;">
|
||||
<el-table
|
||||
v-if="tableData.length > 0"
|
||||
id="table"
|
||||
:data="tableData"
|
||||
header-cell-class-name="header-cell-row"
|
||||
height="500px"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="versionNo"
|
||||
label="版本号"
|
||||
align="center"
|
||||
width="70">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="文件名称"
|
||||
min-width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
align="center"
|
||||
label="创建信息"
|
||||
min-width="160">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createUser}}/{{scope.row.createDate}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="!isCorrelatebpms">
|
||||
<el-table-column
|
||||
prop="state"
|
||||
label="状态"
|
||||
align="center"
|
||||
width="80">
|
||||
<span slot-scope="scope" :style="{'color': scope.row.stateColor}">
|
||||
{{scope.row.state}}
|
||||
</span>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-table-column
|
||||
prop="state"
|
||||
label="PAL状态"
|
||||
align="center"
|
||||
width="80">
|
||||
<span slot-scope="scope" :style="{'color': scope.row.stateColor}">
|
||||
{{scope.row.state}}
|
||||
</span>
|
||||
</el-table-column>
|
||||
<template v-if="isPalManage">
|
||||
<el-table-column
|
||||
prop="state"
|
||||
label="在BPM运行"
|
||||
align="center"
|
||||
width="100">
|
||||
<span slot-scope="scope">
|
||||
{{(scope.row.isCorrelate ? "是" : "否")}}
|
||||
</span>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-table-column
|
||||
prop="state"
|
||||
label="BPM状态"
|
||||
align="center"
|
||||
width="80">
|
||||
<span slot-scope="scope" :style="{'color': scope.row.bpmStateColor}">
|
||||
{{scope.row.bpmState}}
|
||||
</span>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</template>
|
||||
<el-table-column
|
||||
v-if="havingVersionManagePerm && tableData.length > 1"
|
||||
prop="name"
|
||||
label="使用"
|
||||
align="center"
|
||||
width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.isUse"
|
||||
active-color="#4E7FF9"
|
||||
inactive-color="#E2E2E2"
|
||||
@change="changeRepositoryUseStatus(scope.row.id, scope.row.isUse)">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
align="center"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-tooltip content="以当前版本为模版创建新版本文件" placement="bottom" hide-after="3000">-->
|
||||
<i v-if="havingWritePerm" class="iconfont icon-fuzhi operate-icon-display" style="cursor: pointer;" @click="createNewVersion(scope.row.id, scope.row.versionNo)"></i>
|
||||
<!-- </el-tooltip>-->
|
||||
<i v-if="havingRemovePerm && !isCorrelatebpms && !scope.row.isUse && !scope.row.isPublish && !scope.row.isApproval" class="iconfont icon-lajitong1 operate-icon-display" style="cursor: pointer;padding-left: 5px;" @click="deleteRepository(scope.row.id, scope.row.versionNo)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
id="addNewVersionDialog"
|
||||
title="提示"
|
||||
width="500px"
|
||||
:visible.sync="addNewVersionVisible"
|
||||
top="45vh"
|
||||
:modal-append-to-body=true
|
||||
:close-on-click-modal=false
|
||||
:append-to-body=true
|
||||
destroy-on-close
|
||||
>
|
||||
<span>请选择以{{ currentVersion }}版本为模板创建的新文件版本号:</span></br>
|
||||
<el-radio-group style="margin-top: 10px" v-model="isLargeIteration">
|
||||
<el-radio :label=true>大版本</el-radio></br>
|
||||
<el-radio style="margin-top: 5px" :label=false>小版本</el-radio>
|
||||
</el-radio-group>
|
||||
<span slot="footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="confirmAddVersion">确定</awsui-button>
|
||||
<awsui-button @click="cancelAddVersion">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "RepositoryInfoVersion",
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
versionId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
repositoryRefresh: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userId: '',// 使用版本的id
|
||||
tableData: [],
|
||||
isCorrelatebpms: false,
|
||||
processDefId: '',
|
||||
isPalManage: false, // 以PAL为管理中心管控BPM流程,
|
||||
havingWritePerm: false,
|
||||
havingRemovePerm: false,
|
||||
havingVersionManagePerm: false,
|
||||
addNewVersionVisible: false,
|
||||
currentVersion: '',
|
||||
currentId: '',
|
||||
isLargeIteration: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userId = this.id;
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_data',
|
||||
id: that.userId,
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.isCorrelatebpms = ro.data.isCorrelatebpms;
|
||||
that.processDefId = ro.data.processDefId;
|
||||
that.isPalManage = ro.data.isPalManage;
|
||||
that.havingWritePerm = ro.data.havingWritePerm;
|
||||
that.havingRemovePerm = ro.data.havingRemovePerm;
|
||||
that.havingVersionManagePerm = ro.data.havingVersionManagePerm;
|
||||
for (let i = 0; i < ro.data.tableData.length; i++) {
|
||||
if (ro.data.tableData[i].isApproval) {
|
||||
ro.data.tableData[i].stateColor = '#1AA477';
|
||||
ro.data.tableData[i].state = '审批中';
|
||||
ro.data.tableData[i].stateCode = 'approval';
|
||||
} else if (ro.data.tableData[i].isStop) {
|
||||
ro.data.tableData[i].stateColor = '#D9001B';
|
||||
ro.data.tableData[i].state = '已停用';
|
||||
ro.data.tableData[i].stateCode = 'stop';
|
||||
} else if (ro.data.tableData[i].isPublish) {
|
||||
ro.data.tableData[i].stateColor = '#1AA477';
|
||||
ro.data.tableData[i].state = '已发布';
|
||||
ro.data.tableData[i].stateCode = 'publish';
|
||||
} else if (ro.data.tableData[i].isUse) {
|
||||
ro.data.tableData[i].stateColor = '#4E7FF9';
|
||||
ro.data.tableData[i].state = '设计中';
|
||||
ro.data.tableData[i].stateCode = 'use';
|
||||
} else {
|
||||
ro.data.tableData[i].stateColor = '';
|
||||
ro.data.tableData[i].state = '设计';
|
||||
ro.data.tableData[i].stateCode = 'designer';
|
||||
}
|
||||
}
|
||||
that.tableData = ro.data.tableData;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
changeRepositoryUseStatus(id, isUse) {// 使用中状态变更
|
||||
const that = this;
|
||||
if (isUse) {// 由未使用变更为使用中,重新刷新数据即可
|
||||
// 变更使用状态axiox请求,成功后刷新父页面树和右侧
|
||||
let oldId;
|
||||
for (var currRowData in that.tableData) {
|
||||
if (that.tableData[currRowData].isUse && that.tableData[currRowData].id != id) {
|
||||
oldId = that.tableData[currRowData].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 全局遮罩
|
||||
const loading = that.$loading({
|
||||
lock: true,
|
||||
text: '正在切换更新版本...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'hsla(0,0%,100%,.9)'
|
||||
});
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_use',
|
||||
id: id,
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '切换成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.userId = ro.data.id;
|
||||
that.initData();
|
||||
loading.close();
|
||||
// 更新父页面的当前使用模型文件
|
||||
if (that.repositoryRefresh && oldId) {
|
||||
that.repositoryRefresh(oldId);
|
||||
}
|
||||
} else {
|
||||
loading.close();
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {// 由使用中变更为非使用中,必须有一个为使用中
|
||||
for (var currRowData in that.tableData) {
|
||||
if (that.tableData[currRowData].id == id) {
|
||||
that.tableData[currRowData].isUse = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
createNewVersion(id, versionNo) {// 复制/创建新版本
|
||||
this.addNewVersionVisible = true
|
||||
this.currentVersion = versionNo
|
||||
this.currentId = id
|
||||
},
|
||||
confirmAddVersion() {
|
||||
// 全局遮罩
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在创建新版本...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'hsla(0,0%,100%,.9)'
|
||||
});
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_create',
|
||||
id: this.currentId,
|
||||
wsId: this.$store.getters.getWsIdFn,
|
||||
teamId: this.$store.getters.getTeamIdFn,
|
||||
isLargeIteration: this.isLargeIteration
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(ro => {
|
||||
if(ro.result == 'ok') {
|
||||
this.$message({
|
||||
message: '创建成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.initData();
|
||||
loading.close();
|
||||
this.isLargeIteration = true
|
||||
this.addNewVersionVisible = false
|
||||
} else {
|
||||
loading.close();
|
||||
this.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
cancelAddVersion() {
|
||||
this.isLargeIteration = true
|
||||
this.addNewVersionVisible = false
|
||||
},
|
||||
deleteRepository(id, versionNo) {// 删除
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 全局遮罩
|
||||
const loading = that.$loading({
|
||||
lock: true,
|
||||
text: '正在放入回收站...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'hsla(0,0%,100%,.9)'
|
||||
});
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_delete',
|
||||
id: id,
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '已放入回收站',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
loading.close();
|
||||
} else {
|
||||
loading.close();
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#table >>> .header-cell-row {
|
||||
background-color: #F2F2F2 !important;
|
||||
}
|
||||
#table >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#table >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
#addNewVersionDialog >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
1755
com.actionsoft.apps.coe.pal/views/repository/RepositoryList.vue
Normal file
1755
com.actionsoft.apps.coe.pal/views/repository/RepositoryList.vue
Normal file
File diff suppressed because it is too large
Load Diff
957
com.actionsoft.apps.coe.pal/views/repository/RepositoryMain.vue
Normal file
957
com.actionsoft.apps.coe.pal/views/repository/RepositoryMain.vue
Normal file
@ -0,0 +1,957 @@
|
||||
<template>
|
||||
<el-container id="repositoryMain" style="overflow: hidden;">
|
||||
<el-header v-if="!havingWritePerm" :height="headerHeight2">
|
||||
</el-header>
|
||||
<el-header v-if="havingWritePerm" :height="headerHeight1">
|
||||
<div style="margin: 12px 0px 10px;text-align: center;">
|
||||
<el-popover
|
||||
v-if="havingWritePerm"
|
||||
placement="bottom"
|
||||
width="280"
|
||||
trigger="click"
|
||||
:visible-arrow=false
|
||||
v-model="createDesignerVisible"
|
||||
@show="showCreateEvent">
|
||||
<div v-loading="createMethodLoading" element-loading-text="拼命加载中">
|
||||
<div>
|
||||
<ul>
|
||||
<li style="margin-bottom: 7px;" v-for="row in Math.ceil(fileMethodList.length/4)">
|
||||
<template v-for="item in fileMethodList.slice((row-1)*4, row*4)">
|
||||
<div class="new-repository-item"
|
||||
:style="{opacity: item.opacity, filter: item.filter, cursor: item.cursor}"
|
||||
@click="item.clickFlag && createDesigner(item.app,item.category,item.method)">
|
||||
<div style="position: relative;top: 9px;">
|
||||
<div class="icon-div-repository"
|
||||
:style="{'background-color': item.icon.color}">
|
||||
<i class="awsui-iconfont icon-dynamic-repository"
|
||||
v-html="item.icon.code"></i>
|
||||
</div>
|
||||
<div class="item-name text-general-color icon-text">
|
||||
<label :style="{cursor: item.cursor}">{{item.methodName}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </el-tooltip>-->
|
||||
</template>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--分隔线-->
|
||||
<div style="border-bottom: 1px solid #F2F2F2;"></div>
|
||||
<div style="margin-top: 7px;">
|
||||
<ul>
|
||||
<li>
|
||||
<template v-for="item in folderMethodList">
|
||||
<div class="new-repository-item"
|
||||
:style="{opacity: item.opacity, filter: item.filter, cursor: item.cursor}"
|
||||
@click="item.clickFlag && createFolder(item.method, item.methodName)">
|
||||
<div style="position: relative;top: 4px;">
|
||||
<div class="icon-div-repository">
|
||||
<i class="awsui-iconfont icon-fixed-repository" :style="{'color': item.icon.color}" v-html="item.icon.code"></i>
|
||||
</div>
|
||||
<div class="item-name text-general-color fixed-icon-text">
|
||||
<label :style="{cursor: item.cursor}">{{item.methodName}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="new-repository-item" style="cursor: pointer;" @click="importDesigners">
|
||||
<div style="position: relative;top: 4px;">
|
||||
<div class="icon-div-repository">
|
||||
<i class="iconfont text-linker-color icon-fixed-repository"></i>
|
||||
</div>
|
||||
<div class="item-name text-general-color fixed-icon-text">
|
||||
<label style="cursor: pointer;">导入模型</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<awsui-button slot="reference" style="width: 100%;height: 36px;margin: 0;font-size: 14px;"
|
||||
:class="{'button-general-color': !dis}" type="primary" :disabled="dis" >新建
|
||||
</awsui-button>
|
||||
</el-popover>
|
||||
</div>
|
||||
<div v-if="havingWritePerm" style="width: 100%;border-bottom: 1px solid #F2F2F2;"></div>
|
||||
</el-header>
|
||||
<el-main class="main-tree" :style="{'overflow': 'auto', 'height': treeHeight}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:props="treeProps"
|
||||
:expand-on-click-node=false
|
||||
:highlight-current=true
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
node-key="id"
|
||||
lazy
|
||||
:load="loadNode">
|
||||
<span slot-scope="{node, data}">
|
||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}"
|
||||
v-html="node.data.icon.icon"></i>
|
||||
<span :style="{'font-weight': data.id.length < 36 ? '600' : ''}">{{node.label}}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-main>
|
||||
<el-dialog
|
||||
:title="folderDialog.folderTitle"
|
||||
:visible.sync="folderDialog.dialogVisible"
|
||||
:modal-append-queryTreeByIdAndPathto-body=false
|
||||
:close-on-click-modal=false
|
||||
:close-on-press-escape=true
|
||||
:before-close="handleCloseFolder"
|
||||
width="600px">
|
||||
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;">
|
||||
<awsui-form :model="folderDialog.folderForm" :rules="folderDialog.rules" ref="folderForm"
|
||||
label-position="top">
|
||||
<awsui-form-item label="名称" prop="name">
|
||||
<awsui-input v-model="folderDialog.folderForm.name"></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item v-if="folderDialog.folderMethod =='default'" label="描述" prop="desc">
|
||||
<awsui-input type="textarea" v-model="folderDialog.folderForm.desc"></awsui-input>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="createFolderSave('folderForm')">确定</awsui-button>
|
||||
<awsui-button @click="clearFolderDlg">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
:title="ModelsetUpDialog.systemTitle"
|
||||
:visible.sync="ModelsetUpDialog.dialogVisible"
|
||||
:modal-append-queryTreeByIdAndPathto-body=false
|
||||
:close-on-click-modal=false
|
||||
:close-on-press-escape=true
|
||||
:before-close="handleCloseSystem"
|
||||
width="600px">
|
||||
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;">
|
||||
<awsui-form :model="ModelsetUpDialog.systemForm" :rules="ModelsetUpDialog.rules" ref="systemForm"
|
||||
label-position="top">
|
||||
|
||||
<awsui-form-item label="当前选定路径">
|
||||
<awsui-input v-model="ModelsetUpDialog.systemForm.repositoryPathData" disabled></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="名称" prop="name">
|
||||
<awsui-input v-model="ModelsetUpDialog.systemForm.name"></awsui-input>
|
||||
</awsui-form-item>
|
||||
<template v-if="ModelsetUpDialog.systemForm.method=='control.policy'">
|
||||
<awsui-form-item label="制度类型" >
|
||||
<awsui-select v-model="ModelsetUpDialog.systemForm.systemType" :options="ModelsetUpDialog.systemForm.SystemTypeOptions" placeholder="请选择制度类型"></awsui-select>
|
||||
</awsui-form-item>
|
||||
</template>
|
||||
|
||||
</awsui-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="createSystemSave('systemForm')">确定</awsui-button>
|
||||
<awsui-button @click="clearSystemDlg">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<awsui-dialog
|
||||
title="密级标定"
|
||||
:visible.sync="securityVisible"
|
||||
:border="false"
|
||||
append-to-body
|
||||
width="500px">
|
||||
<div style="max-height:500px;overflow-y: auto">
|
||||
<awsui-form :ref="file.uuid" label-width="200px" :rules="securityRules" v-for="file in securityFileList" :key="file.uuid" :model="file">
|
||||
<awsui-form-item :label="file.name" prop="securityLevel">
|
||||
<awsui-select v-model="file.securityLevel" :options="securityOptions" style="width:70%"></awsui-select>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<awsui-button type="primary" @click="uploadServer">确定</awsui-button>
|
||||
<awsui-button @click="securityVisible = false">取 消</awsui-button>
|
||||
</div>
|
||||
</awsui-dialog>
|
||||
<RepositoryImport ref="repositoryImport"></RepositoryImport>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RepositoryImport from "./RepositoryImport";
|
||||
import {openDesigner} from "../../api/commonFun";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import bus from '../../eventBus'
|
||||
|
||||
export default {
|
||||
name: "RepositoryTree",
|
||||
components: {RepositoryImport},
|
||||
data() {
|
||||
let securityValidate = (rule, value, callback) => {
|
||||
if (value === undefined ) {
|
||||
callback(new Error('请选择文件密级'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
dis: false,
|
||||
headerHeight1: '60px',
|
||||
headerHeight2: '10px',
|
||||
treeHeight: (parseInt(this.$store.getters.getTopMainHeightFn)) - (this.havingWritePerm ? parseInt(this.headerHeight1) : parseInt(this.headerHeight2)) + 'px',
|
||||
fileMethodList: [],
|
||||
folderMethodList: [],
|
||||
createDesignerVisible: false,
|
||||
folderDialog: {
|
||||
dialogVisible: false,
|
||||
folderMethod: 'default',// 文件夹类型,default默认文件夹,custom自定义文件夹(扩展的文件夹类型的建模方法)
|
||||
folderTitle: '新建文件夹',// 新建文件夹时自定义标题
|
||||
folderForm: {
|
||||
name: '',
|
||||
desc: ''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '必填', trigger: 'blur'},
|
||||
{min: 1, max: 120, message: '长度在 1 到 120 个字符', trigger: 'blur'}
|
||||
],
|
||||
securityLevel: [
|
||||
{ required: true, trigger: "change", validator: securityValidate ,type: "number"}
|
||||
],
|
||||
desc: [
|
||||
{min: 0, max: 2550, message: '长度在 255 个字符以内', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
//制度弹框
|
||||
ModelsetUpDialog: {
|
||||
dialogVisible: false,
|
||||
systemMethod: 'default',// 文件夹类型,default默认文件夹,custom自定义文件夹(扩展的文件夹类型的建模方法)
|
||||
systemTitle: '名称录入',// 新建文件夹时自定义标题
|
||||
systemForm: {
|
||||
name: '',
|
||||
uuid:"",
|
||||
parentId:"",
|
||||
repositoryPathData:"",
|
||||
method:"",
|
||||
systemType: '1',
|
||||
SystemTypeOptions: [
|
||||
{
|
||||
"label" : '制度',
|
||||
"value" : "1"
|
||||
},
|
||||
{
|
||||
"label" : '操作指导',
|
||||
"value" : "2"
|
||||
}
|
||||
],
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '必填', trigger: 'blur'},
|
||||
{min: 1, max: 120, message: '长度在 1 到 120 个字符', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
},
|
||||
treeProps: {
|
||||
label: 'name',
|
||||
isLeaf: 'leaf'
|
||||
},
|
||||
createMethodLoading: false,
|
||||
havingWritePerm: false,
|
||||
havingRemovePerm: false,
|
||||
havingVersionManagePerm: false,
|
||||
validUserPermDataCount: 0,
|
||||
isHighSecurity: false,
|
||||
securityList: {},
|
||||
securityVisible: false,
|
||||
securityFileList: [],
|
||||
securityOptions: [],
|
||||
securityRules: {
|
||||
securityLevel: [{ required: true, trigger: "change", validator: securityValidate ,type: "number"}],
|
||||
},
|
||||
securityType: "",
|
||||
}
|
||||
},
|
||||
inject: ['openRepositoryList','transferTreeNode'],
|
||||
provide: function(){
|
||||
return{
|
||||
getIsHighSecurity: this.getIsHighSecurity,
|
||||
setSecurityVisible: this.setSecurityVisible,
|
||||
securityFileList: this.securityFileList,
|
||||
setSecurityType: this.setSecurityType,
|
||||
SystemTypeList:this.SystemTypeList
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
mounted() {
|
||||
bus.$on("getisDisabled",data =>{
|
||||
this.dis=data;
|
||||
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
const that = this;
|
||||
if (that.$store.getters.getTeamIdFn && that.$store.getters.getTeamIdFn != '') {
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
cmd: 'com.actionsoft.apps.coe.pal_user_perm_query'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
that.validUserPermDataCount = ro.data.validUserPermDataCount;
|
||||
if (that.validUserPermDataCount > 0) {
|
||||
that.havingWritePerm = ro.data.havingWritePerm;
|
||||
} else {
|
||||
that.havingWritePerm = false;
|
||||
}
|
||||
that.havingRemovePerm = ro.data.havingRemovePerm;
|
||||
that.havingVersionManagePerm = ro.data.havingVersionManagePerm;
|
||||
that.initTreeHeight();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
that.havingWritePerm = true;
|
||||
that.havingRemovePerm = true;
|
||||
that.havingVersionManagePerm = true;
|
||||
}
|
||||
this.initTreeHeight();
|
||||
},
|
||||
|
||||
queryTreeByIdAndPath(id, versionId, path) {// 定位展开某节点
|
||||
const that = this;
|
||||
const tree = that.$refs.tree;
|
||||
// 分隔字符串
|
||||
const pathArr = path.split(',');
|
||||
let index = 1;
|
||||
for (let i = 0; i < pathArr.length; i++) {// 依次展开
|
||||
if (i > 0) {
|
||||
if (tree.getNode(pathArr[i - 1]) != null) {
|
||||
setTimeout(that._expandNode(tree, pathArr[i - 1]), index * 300);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(function () {
|
||||
if (tree.getNode(versionId) != null) {
|
||||
tree.setCurrentKey(versionId);
|
||||
}
|
||||
that.openRepositoryList(id);
|
||||
}, index * 300);
|
||||
},
|
||||
_expandNode(tree, id) {
|
||||
return function () {
|
||||
tree.getNode(id).expand();
|
||||
}
|
||||
},
|
||||
openNode(obj, node, tree) {// 打开一只模型文件
|
||||
this.closeCreatePopover();
|
||||
this.openRepositoryList(node.data.currId);
|
||||
this.transferTreeNode(obj)
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const that = this;
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {}
|
||||
};
|
||||
data.data.wsId = that.$store.getters.getWsIdFn;
|
||||
data.data.teamId = that.$store.getters.getTeamIdFn;
|
||||
data.data.cmd = 'com.actionsoft.apps.coe.pal_processlevel_tree_data';
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = '';
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
resolve(ro.data);
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.tree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function () {
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
that.tableLoading = false;
|
||||
})
|
||||
},
|
||||
expandNode(obj, node, tree) {// 展开节点
|
||||
|
||||
},
|
||||
closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
|
||||
node.childNodes = [];
|
||||
node.loaded = false;
|
||||
},
|
||||
refreshNode(id) {// 刷新当前选中节点的子节点,即关闭当前节点后重新打开,会执行loadNode进行自动加载
|
||||
if (id == undefined) {// 未指定节点,默认刷新当前选中
|
||||
const nodeData = this.$refs.tree.getCurrentNode();
|
||||
if (nodeData != null) {
|
||||
if (this.$refs.tree.store.nodesMap[nodeData.id] != undefined) {
|
||||
this.$refs.tree.store.nodesMap[nodeData.id].expanded = false;
|
||||
}
|
||||
const node = this.$refs.tree.getNode(nodeData.id);
|
||||
this.closeNode(null, node, null);
|
||||
node.expand();
|
||||
}
|
||||
} else {// 指定刷新某节点
|
||||
if (this.$refs.tree.store.nodesMap[id] != undefined) {
|
||||
this.$refs.tree.store.nodesMap[id].expanded = false;
|
||||
}
|
||||
const node = this.$refs.tree.getNode(id);
|
||||
if (node != null) {
|
||||
this.closeNode(null, node, null);
|
||||
node.expand();
|
||||
//刷新后,默认点击当前node
|
||||
this.openNode(node.data,node,null);
|
||||
}
|
||||
}
|
||||
},
|
||||
refreshParentNode(id) {// 刷新当前id节点的父节点,即重新加载id节点
|
||||
let nodeData = null;
|
||||
if (id == undefined) {
|
||||
nodeData = this.$refs.tree.getCurrentNode();
|
||||
} else {
|
||||
nodeData = this.$refs.tree.getNode(id);
|
||||
}
|
||||
if (nodeData != null) {
|
||||
nodeData = this.$refs.tree.getNode(nodeData.data.pid);
|
||||
this.refreshNode(nodeData.data.id);
|
||||
}
|
||||
},
|
||||
showCreateEvent() {
|
||||
const that = this;
|
||||
const node = that.$refs.tree.getCurrentNode();
|
||||
if (node == null) {
|
||||
that.closeCreatePopover();
|
||||
that.$message({
|
||||
message: '请选择新建文件位置',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
that.createMethodLoading = true;
|
||||
const category = that.$refs.tree.getCurrentNode().plCategory;
|
||||
const methodId = that.$refs.tree.getCurrentNode().plMethodId;
|
||||
// 获取所有类型
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_create_method_list',
|
||||
category: category,
|
||||
methodId: methodId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
const fileMethodList = ro.data.fileMethodList;// 文件类建模
|
||||
for (let i = 0; i < fileMethodList.length; i++) {
|
||||
let item = fileMethodList[i];
|
||||
if (item.havingCreatePerm) {
|
||||
item.opacity = 1.0;
|
||||
item.filter = 'alpha(opacity=100)';
|
||||
item.clickFlag = true;
|
||||
item.cursor = 'pointer';
|
||||
} else {
|
||||
item.opacity = 0.4;
|
||||
item.filter = 'alpha(opacity=40)';
|
||||
item.clickFlag = false;
|
||||
item.cursor = 'default';
|
||||
}
|
||||
}
|
||||
that.fileMethodList = fileMethodList;
|
||||
|
||||
const folderMethodList = ro.data.folderMethodList;// 文件夹类型
|
||||
for (let i = 0; i < folderMethodList.length; i++) {
|
||||
let item = folderMethodList[i];
|
||||
if (item.havingCreatePerm) {
|
||||
item.opacity = 1.0;
|
||||
item.filter = 'alpha(opacity=100)';
|
||||
item.clickFlag = true;
|
||||
item.cursor = 'pointer';
|
||||
} else {
|
||||
item.opacity = 0.4;
|
||||
item.filter = 'alpha(opacity=40)';
|
||||
item.clickFlag = false;
|
||||
item.cursor = 'default';
|
||||
}
|
||||
}
|
||||
that.folderMethodList = folderMethodList;
|
||||
// 三员管理配置
|
||||
if(ro.data.isHighSecurity != undefined){
|
||||
that.isHighSecurity = ro.data.isHighSecurity;
|
||||
that.securityList = ro.data.securityList;
|
||||
//设置密级options
|
||||
that.securityOptions = [];
|
||||
Object.keys(that.securityList).map(key =>{
|
||||
let option= {
|
||||
value: key,
|
||||
label: that.securityList[key]
|
||||
}
|
||||
that.securityOptions.push(option);
|
||||
})
|
||||
}
|
||||
}
|
||||
that.createMethodLoading = false;
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
createFolder(method, methodName) {// 创建文件夹
|
||||
|
||||
this.folderDialog.folderMethod = method;
|
||||
this.folderDialog.folderTitle = '新建' + methodName;
|
||||
this.folderDialog.dialogVisible = true;
|
||||
this.closeCreatePopover();
|
||||
},
|
||||
|
||||
clearFolderDlg(closeDlg) {
|
||||
this.$refs['folderForm'].resetFields();
|
||||
if (closeDlg) {
|
||||
this.folderDialog.dialogVisible = false;
|
||||
}
|
||||
},
|
||||
|
||||
clearSystemDlg(closeDlg) {
|
||||
this.$refs['systemForm'].resetFields();
|
||||
if (closeDlg) {
|
||||
this.ModelsetUpDialog.dialogVisible = false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
handleCloseFolder(done) {
|
||||
this.clearFolderDlg(false);
|
||||
done();
|
||||
},
|
||||
|
||||
handleCloseSystem(done) {
|
||||
this.clearSystemDlg(false);
|
||||
done();
|
||||
},
|
||||
|
||||
//ModelsetUpDialog
|
||||
createModelsetUp(method) {// 创建文件夹
|
||||
this.ModelsetUpDialog.systemMethod = method;
|
||||
this.ModelsetUpDialog.systemTitle = '名称录入';
|
||||
this.ModelsetUpDialog.dialogVisible = true;
|
||||
this.closeCreatePopover();
|
||||
},
|
||||
|
||||
createFolderSave(formName) {// 保存新建的文件夹
|
||||
debugger;
|
||||
const that = this;
|
||||
that.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
const name = that.folderDialog.folderForm.name;
|
||||
const desc = that.folderDialog.folderForm.desc;
|
||||
if (desc.length > 255) {
|
||||
that.$message({message: '[描述]不允许超过255个字符', type: 'warning'});
|
||||
return;
|
||||
}
|
||||
const nodeData = that.$refs.tree.getCurrentNode();
|
||||
const parentId = nodeData.id;
|
||||
const wsId = that.$store.getters.getWsIdFn;
|
||||
const teamId = that.$store.getters.getTeamIdFn;
|
||||
const method = that.folderDialog.folderMethod;// 默认文件夹或自定义method的文件夹
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_folder_create_save',
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
method: method,
|
||||
parentId: parentId,
|
||||
name: name,
|
||||
desc: desc,
|
||||
id: ''// 为空代表创建,不为空则更新
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
// 刷新节点,重新打开
|
||||
that.refreshNode();
|
||||
that.clearFolderDlg(true);
|
||||
that.openRepositoryList(parentId);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//
|
||||
createSystemSave(formName) {// 保存新建的文件夹
|
||||
const that = this;
|
||||
that.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
debugger;
|
||||
const checkdata = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_checkname',
|
||||
title: that.ModelsetUpDialog.systemForm.name
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(checkdata).then(function (ro) {
|
||||
if (ro.data.result == 'ok') {
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_updatetitle',
|
||||
uuid: that.ModelsetUpDialog.systemForm.uuid,
|
||||
title: that.ModelsetUpDialog.systemForm.name,
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType',
|
||||
title: that.ModelsetUpDialog.systemForm.name,
|
||||
type: that.ModelsetUpDialog.systemForm.systemType,
|
||||
method:that.ModelsetUpDialog.systemForm.method,
|
||||
uuid:that.ModelsetUpDialog.systemForm.uuid,
|
||||
parentId:that.ModelsetUpDialog.systemForm.parentId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
that.ModelsetUpDialog.dialogVisible = false;
|
||||
that.openRepositoryList(that.ModelsetUpDialog.systemForm.parentId);
|
||||
// 返回id
|
||||
openDesigner(that.$store.getters.getTeamIdFn, that.ModelsetUpDialog.systemForm.uuid, that.$store.state.sessionId);
|
||||
|
||||
//清空数据
|
||||
that.$refs['systemForm'].resetFields();
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
that.$message({message: that.ModelsetUpDialog.systemForm.name+'名称重复,请重新输入!!!', type: 'warning'});
|
||||
return;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
|
||||
|
||||
}else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
createDesigner(app, category, method) {// 新建文件
|
||||
const that = this;
|
||||
that.closeCreatePopover();
|
||||
if(this.isHighSecurity){
|
||||
//密级标定dialog
|
||||
let file = {
|
||||
uuid: 1,
|
||||
name : "未命名文件",
|
||||
category: category,
|
||||
method: method,
|
||||
};
|
||||
this.securityFileList.push(file);
|
||||
this.securityType = "create";
|
||||
this.securityVisible = true;
|
||||
}else{
|
||||
|
||||
const form = this.ModelsetUpDialog.systemForm;
|
||||
form.method = method;
|
||||
|
||||
const nodeData = that.$refs.tree.getCurrentNode();
|
||||
|
||||
const parentId = nodeData.id;
|
||||
const wsId = that.$store.getters.getWsIdFn;
|
||||
const teamId = that.$store.getters.getTeamIdFn;
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_repository_create_save',
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
category: category,
|
||||
method: method,
|
||||
parentId: parentId,
|
||||
container: '_blank'// 模板,暂时不做模板
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
|
||||
if (ro.result == 'ok') {
|
||||
// 返回id
|
||||
that.ModelsetUpDialog.systemForm.repositoryPathData=ro.data.repositoryPathData;
|
||||
that.ModelsetUpDialog.systemForm.uuid=ro.data.id;
|
||||
that.ModelsetUpDialog.systemForm.parentId=parentId;
|
||||
that.createModelsetUp(method);
|
||||
|
||||
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
uploadServer(){
|
||||
this.validateFlag = true;
|
||||
//规则校验
|
||||
for(let i=0;i<this.securityFileList.length;i++){
|
||||
let file = this.securityFileList[i];
|
||||
this.$refs[file.uuid][0].validate(valid =>{
|
||||
if(!valid){
|
||||
this.validateFlag = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(this.validateFlag){
|
||||
if("import" === this.securityType){
|
||||
//导入模型密级标定
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {
|
||||
cmd: 'com.actionsoft.apps.coe.pal_pl_file_security_level_batch_update',
|
||||
fileList: JSON.stringify(this.securityFileList),
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
// 刷新节点,重新打开
|
||||
that.refreshNode();
|
||||
that.openRepositoryList(parentId);
|
||||
that.$message({
|
||||
message: '导入成功',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}else{
|
||||
//开启设计器
|
||||
const that = this;
|
||||
const nodeData = that.$refs.tree.getCurrentNode();
|
||||
const parentId = nodeData.id;
|
||||
const wsId = that.$store.getters.getWsIdFn;
|
||||
const teamId = that.$store.getters.getTeamIdFn;
|
||||
for(let i=0;i<this.securityFileList.length;i++){
|
||||
let file = this.securityFileList[i];
|
||||
// 新建文件密级标定
|
||||
const data = {
|
||||
url: 'jd',
|
||||
data: {
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_repository_create_save',
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
category: file.category,
|
||||
method: file.method,
|
||||
parentId: parentId,
|
||||
container: '_blank',// 模板,暂时不做模板
|
||||
securityLevel: file.securityLevel,
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
// 刷新节点,重新打开
|
||||
that.refreshNode();
|
||||
that.openRepositoryList(parentId);
|
||||
// 返回id
|
||||
const id = ro.data.id;
|
||||
openDesigner(that.$store.getters.getTeamIdFn, id, that.$store.state.sessionId);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
this.securityVisible = false;
|
||||
}
|
||||
},
|
||||
importDesigners() {
|
||||
this.closeCreatePopover();
|
||||
// 导出窗口
|
||||
this.$refs.repositoryImport.openImportRepositoryDlg(this, this.$refs.tree.getCurrentNode().plCategory, this.$refs.tree.getCurrentNode().id);
|
||||
},
|
||||
closeCreatePopover() {
|
||||
this.createDesignerVisible = false;
|
||||
},
|
||||
reload() {
|
||||
|
||||
},
|
||||
initTreeHeight() {
|
||||
this.treeHeight = (parseInt(this.$store.getters.getTopMainHeightFn)) - (this.havingWritePerm ? parseInt(this.headerHeight1) : parseInt(this.headerHeight2)) + 'px';
|
||||
},
|
||||
getIsHighSecurity(){
|
||||
return this.isHighSecurity;
|
||||
},
|
||||
setSecurityVisible(visible){
|
||||
this.securityVisible= visible;
|
||||
},
|
||||
setSecurityType(val){
|
||||
this.securityType = val;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.initTreeHeight();
|
||||
},
|
||||
//密级选择dialogVisible 变为false,清空securityFileList
|
||||
securityVisible(newval, oldval){
|
||||
if(!newval){
|
||||
this.securityFileList.splice(0,this.securityFileList.length);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#repositoryMain >>> .el-main {
|
||||
display: block;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
-ms-flex-preferred-size: auto;
|
||||
flex-basis: auto;
|
||||
overflow: auto;
|
||||
margin: 0 10px 10px;
|
||||
}
|
||||
#repositoryMain >>> .el-header {
|
||||
padding: 0 10px;
|
||||
}
|
||||
#repositoryMain >>> .el-tree .el-tree-node > .el-tree-node__children {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#repositoryMain >>> .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
||||
background-color: #F5F7FA;
|
||||
color: #F79500;
|
||||
}
|
||||
|
||||
#repositoryMain >>> .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content .awsui-iconfont {
|
||||
color: #F79500 !important;
|
||||
}
|
||||
|
||||
#repositoryMain >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
#repositoryMain >>> .el-form-item__label {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
#repositoryMain >>> .el-tree {
|
||||
min-width: 100%;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
.icon-div-repository {
|
||||
border-radius: 10%;
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.icon-dynamic-repository {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.new-repository-item:hover .item-name {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
|
||||
.new-repository-item:hover {
|
||||
background-color: #F5F7FA;
|
||||
}
|
||||
|
||||
.new-repository-item {
|
||||
width: 60px;
|
||||
height: 70px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.icon-fixed-repository {
|
||||
font-size: 23px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.icon-text {
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fixed-icon-text {
|
||||
font-size: 12px;
|
||||
line-height: 25px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.main-tree::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,552 @@
|
||||
<template>
|
||||
<el-container id="repositoryMainList">
|
||||
<el-main :style="{'height': mainHeight}"
|
||||
v-loading="dataLoading"
|
||||
element-loading-text="拼命加载中">
|
||||
<div style="width: 100%;height: 100%;overflow: auto;display: inline">
|
||||
<div class="recent">
|
||||
<el-tabs v-model="activeName" @tab-click="handleRecnetOrStore">
|
||||
<el-tab-pane label="最近编辑" name="recent"></el-tab-pane>
|
||||
<el-tab-pane label="收藏文件" name="store"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div :style="{'margin': '12px 10px 10px 10px;','display':recentDisplay}">
|
||||
<!-- <div style="margin-bottom: 10px;margin-left: 10px;">-->
|
||||
<!-- <label style="font-size: 18px;font-weight: 600;" class="text-general-color">{{defaultCategoryName}}</label>-->
|
||||
<!-- </div>-->
|
||||
<!-- 最近 -->
|
||||
<div>
|
||||
<!--
|
||||
<div style="margin: 10px;">
|
||||
<label style="font-size: 13px;color: #979797;">最近编辑</label>
|
||||
</div>
|
||||
-->
|
||||
<div style="margin-left: 10px;">
|
||||
<el-table
|
||||
:data="recentData"
|
||||
style="width: 100%;"
|
||||
:row-style="{height:'46px'}"
|
||||
:cell-style="{padding:'0px'}"
|
||||
:show-header=false>
|
||||
<el-table-column
|
||||
width="20px"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="main"
|
||||
label="名称"
|
||||
class-name="row-repository-title"
|
||||
min-width="300px">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="!scope.row.folder" :style="{'background-color': scope.row.icon.color}" class="icon-div-repository">
|
||||
<i class="awsui-iconfont icon-dynamic-repository" v-html="scope.row.icon.code"></i>
|
||||
</div>
|
||||
<div v-else class="icon-div-repository">
|
||||
<i class="awsui-iconfont icon-dynamic-repository" :style="{color: scope.row.icon.color, 'font-size': '32px'}" v-html="scope.row.icon.code"></i>
|
||||
</div>
|
||||
<div class="div-repository-title">
|
||||
<p class="text-general-color" style="cursor: pointer;" @click="positionRepositoy(scope.row.id, scope.row.versionId, scope.row.pathData)">
|
||||
{{scope.row.name}}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="second"
|
||||
label="修改日期"
|
||||
width="350">
|
||||
<template slot-scope="scope">
|
||||
<div class="div-update-date">
|
||||
<p>
|
||||
{{scope.row.updateUser}} 于 {{scope.row.updateDate}}修改
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
align="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<div class="div-operate text-second-color">
|
||||
<div v-if="scope.row.isFavorite" class="div-cancel-favorite">
|
||||
<el-tooltip content="取消收藏" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont" style="cursor: pointer;color: #FFB800;" @click="setFavorite('0', scope.row.versionId, scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="!scope.row.isFavorite" class="non-favorite-display div-favorite">
|
||||
<el-tooltip content="收藏" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont icon-operate" style="cursor: pointer;" @click="setFavorite('1', scope.row.versionId, scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-operate text-second-color" style="margin: 0 10px 0 15px;">
|
||||
<div class="operate-icon-display">
|
||||
<el-tooltip v-if="scope.row.folder && havingWritePerm" placement="bottom" :hide-after=2000>
|
||||
<span slot="content">修改{{scope.row.methodName}}</span>
|
||||
<i class="iconfont icon-operate" style="display: inline-block;cursor: pointer;" @click="openUpdateFolder(scope.row.id, scope.row.name, scope.row.desc, scope.row.methodId, scope.row.methodName)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="!scope.row.folder" content="打开模型" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont icon-operate" style="display: inline-block;cursor: pointer;" @click="openDesigner(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div :style="{'margin': '10px;','margin-top': '20px;','display':storeDisplay}">
|
||||
<!-- 收藏 -->
|
||||
<div>
|
||||
<!--
|
||||
<div style="margin: 10px;">
|
||||
<label style="font-size: 13px;color: #979797;">收藏文件</label>
|
||||
</div>
|
||||
-->
|
||||
<div style="margin-left: 10px;">
|
||||
<el-table
|
||||
:data="commonData"
|
||||
style="width: 100%;"
|
||||
:row-style="{height:'46px'}"
|
||||
:cell-style="{padding:'0px'}"
|
||||
empty-text="无收藏文件"
|
||||
:show-header=false>
|
||||
<el-table-column
|
||||
width="20px"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="main"
|
||||
label="名称"
|
||||
class-name="row-repository-title"
|
||||
min-width="300px">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="!scope.row.folder" :style="{'background-color': scope.row.icon.color}" class="icon-div-repository">
|
||||
<i class="awsui-iconfont icon-dynamic-repository" v-html="scope.row.icon.code"></i>
|
||||
</div>
|
||||
<div v-else class="icon-div-repository">
|
||||
<i class="awsui-iconfont icon-dynamic-repository" :style="{color: scope.row.icon.color, 'font-size': '32px'}" v-html="scope.row.icon.code"></i>
|
||||
</div>
|
||||
<div class="div-repository-title">
|
||||
<p class="text-general-color" style="cursor: pointer;" @click="positionRepositoy(scope.row.id, scope.row.versionId, scope.row.pathData)">
|
||||
{{scope.row.name}}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="second"
|
||||
label="修改日期"
|
||||
width="350">
|
||||
<template slot-scope="scope">
|
||||
<div class="div-update-date">
|
||||
<p>
|
||||
{{scope.row.updateUser}} 于 {{scope.row.updateDate}}修改
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
align="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<div class="div-operate text-second-color">
|
||||
<div v-if="scope.row.isFavorite" class="div-cancel-favorite">
|
||||
<el-tooltip content="取消收藏" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont" style="cursor: pointer;color: #FFB800;" @click="setFavorite('0', scope.row.versionId, scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="!scope.row.isFavorite" class="non-favorite-display div-favorite">
|
||||
<el-tooltip content="收藏" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont icon-operate" style="cursor: pointer;" @click="setFavorite('1', scope.row.versionId, scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-operate text-second-color" style="margin: 0 10px 0 15px;">
|
||||
<div class="operate-icon-display">
|
||||
<el-tooltip v-if="scope.row.methodId=='default' && havingWritePerm" content="修改文件夹" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont icon-operate" style="display: inline-block;cursor: pointer;" @click="openUpdateFolder(scope.row.id, scope.row.name, scope.row.desc, scope.row.methodId, scope.row.methodName)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="scope.row.methodId !='default'" content="打开模型" placement="bottom" :hide-after=2000>
|
||||
<i class="iconfont icon-operate" style="display: inline-block;cursor: pointer;" @click="openDesigner(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-main>
|
||||
<el-dialog
|
||||
title="修改文件夹"
|
||||
:visible.sync="folderDialog.dialogVisible"
|
||||
:modal-append-to-body=false
|
||||
:close-on-click-modal=false
|
||||
:close-on-press-escape=true
|
||||
:before-close="handleCloseFolder"
|
||||
width="600px">
|
||||
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;">
|
||||
<awsui-form :model="folderDialog.folderForm" :rules="folderDialog.rules" ref="folderForm" label-position="top">
|
||||
<awsui-form-item label="名称" prop="name">
|
||||
<awsui-input v-model="folderDialog.folderForm.name"></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="描述" prop="desc">
|
||||
<awsui-input type="textarea" v-model="folderDialog.folderForm.desc"></awsui-input>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="updateFolderSave('folderForm')">确定</awsui-button>
|
||||
<awsui-button @click="closeFolderDlg">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<awsui-dialog
|
||||
:title="customFolderDialog.title"
|
||||
:visible.sync="customFolderDialog.dialogVisible"
|
||||
:modal-append-to-body=false
|
||||
:close-on-click-modal=false
|
||||
:close-on-press-escape=true
|
||||
:border="false"
|
||||
width="800px">
|
||||
<div>
|
||||
<repository-info-property v-if="customFolderDialog.dialogVisible" :id="customFolderDialog.id" :repositoryRefresh="repositoryRefresh"/>
|
||||
</div>
|
||||
</awsui-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {openDesigner} from "../../api/commonFun";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import RepositoryInfoProperty from "./RepositoryInfoProperty";
|
||||
|
||||
export default {
|
||||
name: "RepositoryMainList",
|
||||
components: {RepositoryInfoProperty},
|
||||
props: {
|
||||
refreshTreeParentNode: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn)) + 'px',
|
||||
dataLoading: false,
|
||||
defaultCategoryName: '',
|
||||
recentData: [],
|
||||
commonData: [],
|
||||
havingWritePerm: false,
|
||||
folderDialog: {
|
||||
dialogVisible: false,
|
||||
folderForm: {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: ''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 120, message: '长度在 1 到 120 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
customFolderDialog: {// 扩展的文件夹类建模方法
|
||||
dialogVisible: false,
|
||||
title: '',
|
||||
id: ''
|
||||
},
|
||||
activeName:"recent",
|
||||
recentDisplay: "block",
|
||||
storeDisplay: "none",
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
handleRecnetOrStore(tab, event){
|
||||
this.switchTabCard(tab.name);
|
||||
},
|
||||
switchTabCard(type){
|
||||
if(type == 'recent'){
|
||||
this.recentDisplay = "block";
|
||||
this.storeDisplay = "none"
|
||||
}else if(type == 'store'){
|
||||
this.recentDisplay = "none";
|
||||
this.storeDisplay = "block"
|
||||
}
|
||||
},
|
||||
handleCloseFolder(done) {
|
||||
this.folderDialog.dialogVisible = false;
|
||||
done();
|
||||
},
|
||||
openUpdateFolder(id, name, desc, methodId, methodName) {
|
||||
if (methodId == 'default') {// 默认文件夹
|
||||
this.folderDialog.folderForm.name = name;
|
||||
this.folderDialog.folderForm.desc = desc;
|
||||
this.folderDialog.folderForm.id = id;
|
||||
this.folderDialog.dialogVisible = true;
|
||||
} else {// 扩展的文件夹类型的建模方法
|
||||
this.customFolderDialog.id = id;
|
||||
this.customFolderDialog.title = '修改' + methodName;
|
||||
this.customFolderDialog.dialogVisible = true;
|
||||
}
|
||||
},
|
||||
closeFolderDlg() {
|
||||
this.folderDialog.dialogVisible = false;
|
||||
this.folderDialog.folderForm.name = '';
|
||||
this.folderDialog.folderForm.desc = '';
|
||||
this.folderDialog.folderForm.id = '';
|
||||
},
|
||||
updateFolderSave(formName) {
|
||||
const that = this;
|
||||
that.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
const name = that.folderDialog.folderForm.name;
|
||||
const desc = that.folderDialog.folderForm.desc;
|
||||
if (desc.length > 255) {
|
||||
that.$message({message: '[描述]不允许超过255个字符',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
const id = that.folderDialog.folderForm.id;
|
||||
const wsId = that.$store.getters.getWsIdFn;
|
||||
const teamId = that.$store.getters.getTeamIdFn;
|
||||
const method = 'default';// 文件夹
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_folder_create_save',
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
method: method,
|
||||
name: name,
|
||||
desc: desc,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.initData();
|
||||
if (that.refreshTreeParentNode) {
|
||||
that.refreshTreeParentNode(id);
|
||||
}
|
||||
that.closeFolderDlg();
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
initData() {// 初始化
|
||||
const that = this;
|
||||
that.dataLoading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_recent_and_favorite_data_query',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.defaultCategoryName = ro.data.defaultCategoryName;
|
||||
that.recentData = ro.data.recentData;
|
||||
that.commonData = ro.data.commonData;
|
||||
that.havingWritePerm = ro.data.havingWritePerm;
|
||||
that.dataLoading = false;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
that.dataLoading = false;
|
||||
})
|
||||
},
|
||||
openDesigner(id) {
|
||||
openDesigner(this.$store.getters.getTeamIdFn, id, this.$store.state.sessionId);
|
||||
},
|
||||
setFavorite(state, versionId, id) {
|
||||
if (state == '0') {// 取消收藏
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_favorite_cancel',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
versionId: versionId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.initData();
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {// 收藏
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_favorite_save',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
versionId: versionId
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.initData();
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
repositoryRefresh(id) {// 刷新父页面树
|
||||
if (this.refreshTreeParentNode) {
|
||||
this.refreshTreeParentNode(id);
|
||||
}
|
||||
this.initData();
|
||||
},
|
||||
positionRepositoy(id, versionId, pathData) {// 定位树结构
|
||||
const arr = [];
|
||||
for (let i = 0; i < pathData.length; i++) {
|
||||
const tempId = pathData[i].versionId;
|
||||
arr.push(tempId);
|
||||
}
|
||||
this.$router.push({path: '/Repository', query: {id: id, versionId: versionId, path: arr.join(','), param: Math.random()}});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(newd)) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.icon-div-repository {
|
||||
position: absolute;
|
||||
border-radius: 10%;
|
||||
left: 0px;
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.icon-dynamic-repository {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
}
|
||||
.div-repository-title {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: 32px;
|
||||
text-align: center;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.div-repository-title :hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.div-cancel-favorite {
|
||||
display: inline-block;
|
||||
/*left: 30px;*/
|
||||
}
|
||||
.div-favorite {
|
||||
/*left: 30px;*/
|
||||
}
|
||||
.div-update-date {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: 30px;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 12px;
|
||||
color: #92A2B2;
|
||||
}
|
||||
#repositoryMainList >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
#repositoryMainList >>> .el-form-item__label {
|
||||
line-height: 0;
|
||||
}
|
||||
#repositoryMainList >>> .el-table td, .el-table th {
|
||||
padding: 8px 0;
|
||||
}
|
||||
#repositoryMainList >>> .el-table td {
|
||||
border-bottom: 1px solid #F2F2F2;
|
||||
}
|
||||
#repositoryMainList >>> .el-table__row .non-favorite-display{
|
||||
display: none;
|
||||
}
|
||||
#repositoryMainList >>> .el-table__row:hover .non-favorite-display{
|
||||
display: inline-block;
|
||||
}
|
||||
#repositoryMainList >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#repositoryMainList >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
.div-operate {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.icon-operate:hover {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
#repositoryMainList >>> .row-repository-title .cell {/*IE错位问题*/
|
||||
position: relative;
|
||||
}
|
||||
.recent{
|
||||
margin-left: 1rem;
|
||||
margin-top: 0.6rem;
|
||||
}
|
||||
#repositoryMainList >>> .el-tabs__nav-wrap:after{
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
#repositoryMainList >>> .el-table:before{
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
#repositoryMainList >>> .el-tabs__item.is-active{
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#repositoryMainList >>> .el-tabs__item:hover{
|
||||
color: #4E7FF9;
|
||||
}
|
||||
#repositoryMainList >>> .el-tabs__active-bar {
|
||||
background-color: #4E7FF9;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "RepositoryMove"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
742
com.actionsoft.apps.coe.pal/views/repository/RepositoryQuery.vue
Normal file
742
com.actionsoft.apps.coe.pal/views/repository/RepositoryQuery.vue
Normal file
@ -0,0 +1,742 @@
|
||||
<template>
|
||||
<el-container class="repository-query text-general-color">
|
||||
<div v-if="this.$store.getters.getNavigationQueryVisibleFn" class="basic-query-div">
|
||||
<div style="margin: 0 0 0 0px;overflow-y: auto;" :style="{height: basicQueryAreaHeight}">
|
||||
<ul>
|
||||
<li class="li-general-hover-bgcolor li-general-height">
|
||||
<div class="li-div-basic-query" style="border-bottom: 1px solid #F2F2F2;">
|
||||
<div style="margin: 0 10px;position: relative;">
|
||||
<div class="li-basic-icon-div icon-div-repository" :style="{'background-color': '#4E7FF9'}">
|
||||
<i class="awsui-iconfont"><i class="iconfont li-basic-icon"></i></i>
|
||||
</div>
|
||||
<div style="display: inline-block;cursor: pointer; position: relative;left: 40px;text-align: left;width: 280px;height: 30px;line-height: 30px;vertical-align: middle;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" @click="openConditionQuery">
|
||||
在高级搜索中查看"<span class="text-linker-color">{{queryInput}}</span>"
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<template v-for="(item, i) in basicQueryResult">
|
||||
<li class="li-general-hover-bgcolor li-general-height">
|
||||
<div class="li-div-basic-query" style="border-bottom: 1px solid white;">
|
||||
<div style="margin: 0 10px;position: relative;">
|
||||
<div v-if="!item.folder" class="li-basic-icon-div icon-div-repository" :style="{'background-color': item.icon.color}">
|
||||
<i class="awsui-iconfont"><i class="awsui-iconfont li-basic-icon" v-html="item.icon.code"></i></i>
|
||||
</div>
|
||||
<div v-else class="li-basic-icon-div icon-div-repository">
|
||||
<i class="awsui-iconfont"><i class="awsui-iconfont li-basic-icon" :style="{color: item.icon.color, 'font-size': '32px'}" v-html="item.icon.code"></i></i>
|
||||
</div>
|
||||
<div class="li-basic-title-div" v-html="item.name" @click="positionRepository(item.id, item.versionId, item.path)">
|
||||
</div>
|
||||
<i v-if="!item.folder" style="float: right;cursor: pointer;" class="iconfont text-second-color icon-open-repository" @click="openRepository(item.id)"></i>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog
|
||||
:visible.sync="this.$store.getters.getNavigationConditionQueryVisibleFn"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal=false
|
||||
:destroy-on-close=true
|
||||
:show-close=false
|
||||
width="800px">
|
||||
<div style="height: 564px;">
|
||||
<!-- head -->
|
||||
<div class="condition-query-header" style="border-bottom: 1px solid #F2F2F2;">
|
||||
<el-input
|
||||
style="border: 0px;width: 90%;"
|
||||
placeholder="请输入关键字"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="conditionQueryInput"
|
||||
@input="queryConditionTimer">
|
||||
</el-input>
|
||||
<span class="condition-query-clear text-second-color" :style="{visibility: showClearButton ? 'visible' : 'hidden'}" @click="clearQueryInput">清除</span>
|
||||
<div style="height:10px;display:inline-block;border-left: 1px solid #F2F2F2;margin-left: 5px;"></div>
|
||||
<button type="button" aria-label="Close" class="el-dialog__headerbtn" style="float: right;" @click="closeDlg">
|
||||
<i class="el-dialog__close el-icon el-icon-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<!--tabs header-->
|
||||
<div>
|
||||
<el-tabs v-model="activeTabName" @tab-click="handleCagegoryChange">
|
||||
<el-tab-pane v-for="item in tabData" :label="item.label" :name="item.name"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<!--tabs contents-->
|
||||
<div>
|
||||
<div v-loading="loading" style="width: 70%;height:477px;float: left;overflow-x: hidden;overflow-y: auto;">
|
||||
<div style="padding: 0 10px;">
|
||||
<template>
|
||||
<el-table
|
||||
:data="conditionQueryResult"
|
||||
:row-style="{height:'50px'}"
|
||||
:cell-style="{padding:'0px'}"
|
||||
:show-header=false
|
||||
style="width: 100%">
|
||||
<div slot="empty">
|
||||
<div class="text-second-color">
|
||||
<i class="iconfont icon-wushuju" style="font-size: 60px;"></i>
|
||||
<p style="line-height: 0">暂无数据,请输入关键字搜索</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-table-column
|
||||
prop="icon"
|
||||
label=""
|
||||
align="right"
|
||||
width="52px">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="!scope.row.folder" class="icon-div-condition-query" :style="{'background-color': scope.row.icon.color}">
|
||||
<i class="awsui-iconfont icon-condition-query" v-html="scope.row.icon.code"></i>
|
||||
</div>
|
||||
<div v-else class="icon-div-condition-query">
|
||||
<i class="awsui-iconfont icon-condition-query" :style="{color: scope.row.icon.color, 'font-size': '32px'}" v-html="scope.row.icon.code"></i>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
align="left"
|
||||
label="名称">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<p class="condition-query-row-name"><span @click="positionRepository(scope.row.id, scope.row.versionId, scope.row.path)" v-html="scope.row.name"></span></p>
|
||||
<p class="condition-query-row-desc text-second-color" v-if="scope.row.shapeDataSize == 0" v-html="scope.row.createUser + ' 于' +scope.row.createDate + ' 创建 · ' + scope.row.updateUser + ' 于' + scope.row.updateDate + ' 修改'"></p>
|
||||
<p class="condition-query-row-desc text-second-color" v-else v-html="'包含 ' + scope.row.shapeDataStr + ' ' + scope.row.shapeDataSize + '个节点'"></p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operate"
|
||||
label="操作"
|
||||
width="40">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.methodId !='default'" class="iconfont text-second-color icon-open-repository" style="cursor: pointer;position:relative;top:2px;" @click="openRepository(scope.row.id)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 30%;height: 477px;float: left;overflow-y: auto;overflow-x: hidden;">
|
||||
<div style="border-left: 1px solid #F2F2F2;">
|
||||
<div style="padding: 10px;">
|
||||
<p class="query-filter-item-title">搜索类型</p>
|
||||
<template>
|
||||
<el-checkbox-group v-model="queryTypeChecked" class="query-filter-item-checkbox-group" @change="queryConditionTimer">
|
||||
<el-checkbox class="query-filter-item-checkbox" style="display: block;" label="file">文件</el-checkbox>
|
||||
<el-checkbox class="query-filter-item-checkbox" style="display: block;" label="shape">形状</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
<p class="query-filter-item-title">
|
||||
文件类型
|
||||
<template v-if="repositoryMethodList.length > 3">
|
||||
<i v-if="conditionFold.method" class="awsui-iconfont condition-query-item-fold" @click="conditionFold.method = conditionFold.method ? false : true"></i>
|
||||
<i v-else class="awsui-iconfont condition-query-item-fold" @click="conditionFold.method = conditionFold.method ? false : true"></i>
|
||||
</template>
|
||||
</p>
|
||||
<template v-if="repositoryMethodList.length > 0">
|
||||
<el-checkbox-group v-model="repositoryMethodChecked" class="query-filter-item-checkbox-group" @change="queryConditionTimer">
|
||||
<template v-for="(list, i) in repositoryMethodList">
|
||||
<el-checkbox v-show="i < 3 || (i >= 3 && !conditionFold.method)" class="query-filter-item-checkbox" style="display: block;" :label="list.id">{{list.name}}</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
<p v-if="repositoryMethodList.length > 3 && conditionFold.method" style="padding-left: 10px;"><i class="awsui-iconfont text-second-color condition-query-item-fold-more" @click="conditionFold.method = conditionFold.method ? false : true"></i></p>
|
||||
</template>
|
||||
<p class="query-filter-item-title">
|
||||
创建人
|
||||
<template v-if="createUserList.length > 3">
|
||||
<i v-if="conditionFold.createUser" class="awsui-iconfont condition-query-item-fold" @click="conditionFold.createUser = conditionFold.createUser ? false : true"></i>
|
||||
<i v-else class="awsui-iconfont condition-query-item-fold" @click="conditionFold.createUser = conditionFold.createUser ? false : true"></i>
|
||||
</template>
|
||||
</p>
|
||||
<template v-if="createUserList.length > 0">
|
||||
<el-checkbox-group v-model="createUserChecked" class="query-filter-item-checkbox-group" @change="queryConditionTimer">
|
||||
<template v-for="(list, i) in createUserList">
|
||||
<el-checkbox v-show="i < 3 || (i >= 3 && !conditionFold.createUser)" class="query-filter-item-checkbox" style="display: block;" :label="list.id">{{list.name}}</el-checkbox>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
<p v-if="createUserList.length > 3 && conditionFold.createUser" style="padding-left: 10px;"><i class="awsui-iconfont text-second-color condition-query-item-fold-more" @click="conditionFold.createUser = conditionFold.createUser ? false : true"></i></p>
|
||||
</template>
|
||||
<p class="query-filter-item-title">修改时间</p>
|
||||
<template>
|
||||
<el-radio-group v-model="updateDateChecked" class="query-filter-item-checkbox-group" @change="queryConditionTimer">
|
||||
<el-radio class="query-filter-item-checkbox" style="display: block;" label="all">全部</el-radio>
|
||||
<el-radio class="query-filter-item-checkbox" style="display: block;" label="thirty">近30天</el-radio>
|
||||
<el-radio class="query-filter-item-checkbox" style="display: block;" label="fifteen">近15天</el-radio>
|
||||
<el-radio class="query-filter-item-checkbox" style="display: block;" label="seven">近7天</el-radio>
|
||||
<el-radio class="query-filter-item-checkbox" style="display: block;" label="today">今天</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {openDesigner} from "../../api/commonFun";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "RepositoryQuery",
|
||||
data() {
|
||||
return {
|
||||
conditionQueryInput: this.queryInput,// 高级查询关键字搜索框
|
||||
showClearButton: false,
|
||||
basicQueryResult: [],
|
||||
basicQueryAreaHeight: '0px',
|
||||
activeTabName: '',
|
||||
queryTypeChecked: ['file'],
|
||||
repositoryMethodChecked: [],
|
||||
createUserChecked: [],
|
||||
updateDateChecked: 'all',
|
||||
repositoryMethodList: [],
|
||||
createUserList: [],
|
||||
tabData: [],
|
||||
conditionQueryResult: [],
|
||||
conditionFold: {// 条件选项中折叠处理
|
||||
method: true,// 文件类型,默认不折叠
|
||||
createUser: true // 创建人,默认不折叠
|
||||
},
|
||||
loading: false,
|
||||
timeStamp: 0,// 查询时记录时间戳
|
||||
queryInterval: 1000,// 查询时间间隔1000ms
|
||||
timer: null // 定时器
|
||||
}
|
||||
},
|
||||
props: ['queryInput'],
|
||||
computed: {
|
||||
listenNavigationConditionQueryVisibleFn() {
|
||||
return this.$store.getters.getNavigationConditionQueryVisibleFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
queryInput(val, oldVal) {// 基础查询输入值变动事件
|
||||
if (val.trim() != '') {
|
||||
if (this.$store.getters.getNavigationQueryVisibleFn) {// 基础查询
|
||||
this.basicQueryResult = [];// 清空记录
|
||||
this.queryBasicTimer();
|
||||
}
|
||||
}
|
||||
},
|
||||
conditionQueryInput(val, oldVal) {// 高级输入值变动事件
|
||||
if (val.trim() != '') {
|
||||
this.showClearButton = true;
|
||||
} else {
|
||||
this.showClearButton = false;
|
||||
}
|
||||
},
|
||||
listenNavigationConditionQueryVisibleFn: function (newd, old) {
|
||||
if (newd) {
|
||||
this.conditionQueryInput = this.queryInput;
|
||||
// 获取分类,以及各个分类的文件类型,创建人信息,默认选中信息
|
||||
this.queryTabInfo();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryTabInfo() {// 获取所有的tab信息,该窗口打开后立即执行
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_condition_main_query',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
const data = ro.data.data;
|
||||
const userData = ro.data.userData;
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const curr = data[i];
|
||||
curr.createUserList = JSON.parse(JSON.stringify(userData));
|
||||
}
|
||||
that.tabData = data;
|
||||
that.$nextTick(function(){
|
||||
// 执行查询全部
|
||||
that.activeTabName = 'all';
|
||||
that.handleCagegoryChange({'name': 'all'});// 执行查询
|
||||
});
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
clearQueryInput() {
|
||||
this.conditionQueryInput = '';
|
||||
this.queryConditionTimer();
|
||||
},
|
||||
closeDlg() {
|
||||
// 清空(恢复默认值)
|
||||
this.conditionQueryInput = '';
|
||||
this.showClearButton = false;
|
||||
this.queryTypeChecked = ['file'];
|
||||
this.repositoryMethodChecked = [];
|
||||
this.createUserChecked = [];
|
||||
this.updateDateChecked = 'all';
|
||||
this.repositoryMethodList = [];
|
||||
this.createUserList = [];
|
||||
this.tabData = [];
|
||||
this.conditionQueryResult = [];
|
||||
this.conditionFold.method = true;
|
||||
this.conditionFold.createUser = true;
|
||||
// 关闭dialog
|
||||
this.$store.commit('setNavigationConditionQueryVisibleFn', false);
|
||||
},
|
||||
save() {
|
||||
// 保存处理
|
||||
this.closeDlg();
|
||||
},
|
||||
handleClose(done) {
|
||||
done();
|
||||
this.closeDlg();
|
||||
},
|
||||
openConditionQuery() {// 打开高级查询
|
||||
this.$store.commit('setNavigationQueryVisibleFn',false);// 关闭普通查询
|
||||
this.$store.commit('setNavigationConditionQueryVisibleFn', true);
|
||||
},
|
||||
clearTimer() {// 清除定时器
|
||||
if (this.timer != null) {
|
||||
clearTimeout(this.timer);
|
||||
}
|
||||
},
|
||||
queryBasicTimer() {// 基础查询定时器
|
||||
const that = this;
|
||||
that.timeStamp = new Date().getTime() + '';// 记录最新时间戳
|
||||
that.clearTimer();// 清除之前的定时器
|
||||
that.timer = setTimeout(function(){// 等待间隔过后开始查询
|
||||
that.queryBasicRepository();
|
||||
}, that.queryInterval);
|
||||
},
|
||||
queryBasicRepository() {// 基本查询
|
||||
if (this.queryInput && this.queryInput.trim() != '') {
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_basic_query',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
name: that.queryInput.trim(),
|
||||
timeStamp: that.timeStamp
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if (ro.data.timeStamp == that.timeStamp) {// 时间戳比对成功,是最新的查询key
|
||||
that.clearTimer();// 清除定时器
|
||||
if (ro.result == 'ok') {
|
||||
const data = ro.data.data;
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const curr = data[i];
|
||||
curr.name = that.matchStyle(0, curr.name, that.queryInput.trim());
|
||||
}
|
||||
that.basicQueryAreaHeight = ((51 + data.length*50) > 350 ? 350 : (51 + data.length*50)) + 'px';
|
||||
that.basicQueryResult = data;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
matchStyle(start, str, key) {// 是否匹配文字校验并添加样式
|
||||
let str1 = str.toLocaleLowerCase();
|
||||
let key1 = key.toLocaleLowerCase();
|
||||
if (start > str.length - 1) {
|
||||
return str;
|
||||
}
|
||||
const index = str1.indexOf(key1, start);
|
||||
if (index != -1) {
|
||||
const key2 = str.substring(index, index + key.length);
|
||||
const prefix = '<span class="text-linker-color">';
|
||||
const suffix = '</span>';
|
||||
str = str.substring(0, start) + str.substring(start).replace(key2, prefix + key2 + suffix);
|
||||
start = index + key.length + prefix.length + suffix.length;
|
||||
return this.matchStyle(start, str, key);
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
},
|
||||
queryConditionTimer() {// 高级筛选查询定时器
|
||||
const that = this;
|
||||
that.timeStamp = new Date().getTime() + '';// 记录最新时间戳
|
||||
that.clearTimer();// 清除之前的定时器
|
||||
that.loading = true;
|
||||
that.timer = setTimeout(function(){// 等待间隔过后开始查询
|
||||
that.queryConditionRepository();
|
||||
}, that.queryInterval);
|
||||
},
|
||||
queryConditionRepository() {// 高级查询
|
||||
const that = this;
|
||||
if (that.conditionQueryInput && that.conditionQueryInput.trim() != '') {
|
||||
if (that.queryTypeChecked.length == 0 || that.repositoryMethodChecked.length == 0 || that.createUserChecked.length == 0) {
|
||||
that.conditionQueryResult = [];
|
||||
that.loading = false;
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_processlevel_condition_data_query',
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
type: JSON.stringify(that.queryTypeChecked),// 查询类型,文件/形状
|
||||
method: JSON.stringify(that.repositoryMethodChecked),// 建模方法分类范围
|
||||
createUser: JSON.stringify(that.createUserChecked),// 创建人
|
||||
updateDate: that.updateDateChecked, // 修改时间范围
|
||||
key: that.conditionQueryInput, // 搜索关键字
|
||||
timeStamp: that.timeStamp// 时间戳
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if (ro.data.timeStamp == that.timeStamp) {// 时间戳比对成功,是最新的查询key
|
||||
that.clearTimer();// 清除定时器
|
||||
if (ro.result == 'ok') {
|
||||
const data = ro.data.data;
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const curr = data[i];
|
||||
if (that.queryTypeChecked.indexOf("file") != -1) {
|
||||
curr.name = that.matchStyle(0, curr.name, that.conditionQueryInput);
|
||||
}
|
||||
if (that.queryTypeChecked.indexOf("shape") != -1 && curr.shapeDataSize > 0) {
|
||||
for (let j = 0; j < curr.shapeData.length; j++) {
|
||||
const shapeName = curr.shapeData[j];
|
||||
curr.shapeData[j] = that.matchStyle(0, shapeName, that.conditionQueryInput);
|
||||
}
|
||||
curr.shapeDataStr = curr.shapeData.join('、');
|
||||
}
|
||||
}
|
||||
that.conditionQueryResult = data;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}
|
||||
that.loading = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
that.conditionQueryResult = [];
|
||||
that.loading = false;
|
||||
return;
|
||||
}
|
||||
},
|
||||
handleCagegoryChange(tab, event) {// tab变更,重新加载文件类型,再执行查询
|
||||
// 重置文件类型,创建人
|
||||
const name = tab.name;
|
||||
for (let i = 0; i < this.tabData.length; i++) {
|
||||
const data = this.tabData[i];
|
||||
if (data.name == name) {
|
||||
this.repositoryMethodList = data.methodList;
|
||||
this.repositoryMethodChecked = [];
|
||||
for (let j = 0; j < this.repositoryMethodList.length; j++) {
|
||||
this.repositoryMethodChecked.push(this.repositoryMethodList[j].id);// 设置文件类型默认值
|
||||
}
|
||||
this.createUserList = data.createUserList;
|
||||
this.createUserChecked = [];
|
||||
for (let j = 0; j < this.createUserList.length; j++) {
|
||||
this.createUserChecked.push(this.createUserList[j].id);// 设置文件属性默认值
|
||||
}
|
||||
}
|
||||
}
|
||||
this.queryConditionTimer();// 查询
|
||||
},
|
||||
positionRepository(id, versionId, path) {// 定位查询的流程(基础查询和高级查询通用)
|
||||
this.$router.push({path: '/Repository', query: {id: id, versionId: versionId, path: path, param: Math.random()}});
|
||||
if (this.$store.getters.getNavigationQueryVisibleFn) {
|
||||
this.$store.commit('setNavigationQueryVisibleFn',false);// 关闭普通查询
|
||||
}
|
||||
if (this.$store.getters.getNavigationConditionQueryVisibleFn) {
|
||||
this.$store.commit('setNavigationConditionQueryVisibleFn', false);// 关闭高级查询
|
||||
}
|
||||
},
|
||||
openRepository(id) {// 打开查询的流程(基础查询和高级查询通用)
|
||||
if (this.$store.getters.getNavigationQueryVisibleFn) {
|
||||
this.$store.commit('setNavigationQueryVisibleFn',false);// 关闭普通查询
|
||||
}
|
||||
if (this.$store.getters.getNavigationConditionQueryVisibleFn) {
|
||||
this.$store.commit('setNavigationConditionQueryVisibleFn', false);// 关闭高级查询
|
||||
}
|
||||
openDesigner(this.$store.getters.getTeamIdFn, id, this.$store.state.sessionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.repository-query >>> .el-dialog__body {
|
||||
padding: 0px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.repository-query >>> .el-dialog__header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
.repository-query >>> .el-tabs__nav-wrap:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #F2F2F2;
|
||||
z-index: 1;
|
||||
}
|
||||
.repository-query >>> .el-tabs__active-bar {
|
||||
height: 1px;
|
||||
background-color: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-tabs__item.is-active {
|
||||
color: #4E7FF9;
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
.repository-query >>> .el-checkbox {
|
||||
margin-right: 0;
|
||||
}
|
||||
.repository-query >>> .el-radio {
|
||||
margin-right: 0;
|
||||
}
|
||||
.repository-query >>> .el-radio__input.is-checked .el-radio__inner {
|
||||
border-color: #4E7FF9;
|
||||
background: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-radio__input.is-checked+.el-radio__label {
|
||||
color: #606266;
|
||||
font-weight: normal;
|
||||
}
|
||||
.repository-query >>> .el-checkbox__input.is-checked+.el-checkbox__label {
|
||||
color: #606266;
|
||||
font-weight: normal;
|
||||
}
|
||||
.repository-query >>> .el-checkbox__label {
|
||||
color: #606266;
|
||||
font-weight: normal;
|
||||
}
|
||||
.repository-query >>> .el-radio__label {
|
||||
color: #606266;
|
||||
font-weight: normal;
|
||||
}
|
||||
.repository-query >>> .el-checkbox__label:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-radio__label:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-radio__input.is-checked+.el-radio__label:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-checkbox__input.is-checked+.el-checkbox__label:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-tabs__item {
|
||||
color: #606266;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
.repository-query >>> .el-tabs__item:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.repository-query >>> .el-dialog__headerbtn {
|
||||
z-index: 999;
|
||||
top: 16px;
|
||||
right: 8px;
|
||||
}
|
||||
.repository-query >>> .el-input__inner {
|
||||
border: 0px;
|
||||
padding-left: 45px;
|
||||
}
|
||||
|
||||
|
||||
.repository-query >>> .el-tabs__header {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
border-bottom: 1px solid #F2F2F2;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.repository-query >>> .el-table--mini td, .el-table--mini th {
|
||||
padding: 0px;
|
||||
}
|
||||
.repository-query >>> .el-table__row:hover .icon-open-repository{
|
||||
display: inline-block;
|
||||
}
|
||||
.repository-query >>> .el-table__row .icon-open-repository{
|
||||
display: none;
|
||||
}
|
||||
.repository-query >>> .el-table__empty-block {
|
||||
height: 470px !important;
|
||||
}
|
||||
.icon-div-repository {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
left: 0px;
|
||||
}
|
||||
.li-general-hover-bgcolor :hover .icon-open-repository {
|
||||
display: inline;
|
||||
}
|
||||
.li-general-hover-bgcolor .icon-open-repository {
|
||||
display: none;
|
||||
}
|
||||
.icon-open-repository:hover {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
.query-filter-item-checkbox-group {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.query-filter-item-checkbox {
|
||||
height: 24px;
|
||||
}
|
||||
.basic-query-div {
|
||||
width: 350px;
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
background-color: white;
|
||||
z-index: 3000;
|
||||
border-radius: 3px;
|
||||
border: 0px solid #F2F2F2;
|
||||
box-shadow: rgba(170, 170, 170, 0.3) 0px 2px 5px 0px;
|
||||
}
|
||||
.li-general-height {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
.li-div-basic-query {
|
||||
display: inline-block;
|
||||
width:100%;
|
||||
position: relative;
|
||||
line-height: 50px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.li-basic-icon-div {
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
top: 10px;
|
||||
}
|
||||
.li-basic-icon {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
}
|
||||
.li-basic-title-div {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
left: 40px;
|
||||
text-align: left;
|
||||
width: 260px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
vertical-align: middle;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.icon-div-condition-query {
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
border-radius: 50%;
|
||||
left: 9px;
|
||||
position: relative;
|
||||
}
|
||||
.icon-condition-query {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
}
|
||||
.condition-query-row-name {
|
||||
display: inline-block;
|
||||
width: 427px;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
font-size: 13px;
|
||||
position: relative;
|
||||
top: 9px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.condition-query-row-name span:hover {
|
||||
color: #4E7FF9 !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
.condition-query-row-desc {
|
||||
display:inline-block;
|
||||
font-size: 12px;
|
||||
transform: scale(0.8);
|
||||
transform-origin: 0 0;
|
||||
width: 533px;/*427/0.8*/
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
.condition-query-header >>> .el-input__inner {
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
.condition-query-header >>> .el-input__icon {
|
||||
font-size: 16px !important;
|
||||
width: 46px;
|
||||
hight:46px
|
||||
}
|
||||
.condition-query-clear {
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.condition-query-clear:hover {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
.query-filter-item-title {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
padding: 6px 0 6px 0;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
}
|
||||
.condition-query-item-fold {
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.condition-query-item-fold:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.condition-query-item-fold-more {
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
.condition-query-item-fold-more:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
|
||||
.el-table:before{
|
||||
height:0px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,693 @@
|
||||
<template>
|
||||
<awsui-layout id="repMark">
|
||||
<awsui-aside width="50%">
|
||||
<div class="treeWrapper">
|
||||
<div class="treeHeader" :style="{ height: headerHeight }">
|
||||
<div class="textWrapper">
|
||||
<span class="title">文件密级</span>
|
||||
<span class="desc" v-if="fileUnMarkNum !=-1">共有<span style="color: red">{{fileUnMarkNum}}</span>个待标密文件</span
|
||||
>
|
||||
</div>
|
||||
<div class="button">
|
||||
<awsui-button
|
||||
style="height: 36px; margin: 0; font-size: 14px"
|
||||
class="button-general-color"
|
||||
type="primary"
|
||||
@click="quickMark"
|
||||
>快速定位
|
||||
</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="treeMain"
|
||||
:style="{ 'padding-left': '2rem', height: mainHeight }"
|
||||
>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:props="treeProps"
|
||||
:expand-on-click-node="false"
|
||||
:highlight-current="true"
|
||||
@node-click="openNode"
|
||||
@node-expand="expandNode"
|
||||
@node-collapse="closeNode"
|
||||
node-key="id"
|
||||
lazy
|
||||
:load="loadNode"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<i
|
||||
class="awsui-iconfont tree-content-icon tree-content-icon-padding"
|
||||
:style="{ color: node.data.icon.color }"
|
||||
v-html="node.data.icon.icon"
|
||||
></i>
|
||||
<span
|
||||
:style="{ 'font-weight': data.id.length < 36 ? '600' : '' }"
|
||||
>
|
||||
{{ node.label }}
|
||||
<span
|
||||
v-if="data.id.length >= 26 &&!data.folder && data.securityLevelName != '未标密' "
|
||||
class="font12 blue"
|
||||
>
|
||||
{{ data.securityLevelName }}
|
||||
</span>
|
||||
<span
|
||||
v-if=" data.id.length >= 26 && !data.folder && data.securityLevelName == '未标密' "
|
||||
class="font12 red"
|
||||
@click="showMarkDialog(data, -1, 'file')"
|
||||
>
|
||||
{{ data.securityLevelName }}
|
||||
</span>
|
||||
<span
|
||||
v-if="
|
||||
data.id.length >= 26 && !data.folder && data.isUpfileUnmark
|
||||
"
|
||||
class="font12 red"
|
||||
>
|
||||
附件未标密
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</awsui-aside>
|
||||
<awsui-main>
|
||||
<div class="markWrapper">
|
||||
<div class="treeHeader">
|
||||
<div class="textWrapper">
|
||||
<span class="title">附件密级</span>
|
||||
<span class="desc">
|
||||
共有
|
||||
<span class="red">{{ upFileUnMark.length }}</span>
|
||||
个待标密文件
|
||||
</span>
|
||||
</div>
|
||||
<div class="button">
|
||||
<awsui-button
|
||||
style="height: 36px; margin: 0; font-size: 14px"
|
||||
class="button-general-color"
|
||||
type="primary"
|
||||
@click="showMark"
|
||||
>
|
||||
快速定位
|
||||
</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="treeMain noData" v-if="upFileTable.length <= 0 && shapeTable.length <= 0">
|
||||
<div class="wrapper">
|
||||
<div style="text-align: center">
|
||||
<span>
|
||||
<i class="iconfont" style="color: #c2c2c2; font-size: 60px">
|
||||

|
||||
</i>
|
||||
</span>
|
||||
<p class="text-general-color" style="margin: 15px 0">
|
||||
暂无未标定密级文件
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="fileWrapper">
|
||||
<!--附件密级显示-->
|
||||
<div v-if="upFileTable.length > 0" >
|
||||
<div class="title font16">文件密级</div>
|
||||
<div class="fileList">
|
||||
<ul>
|
||||
<li
|
||||
v-for="(file, index) in upFileTable"
|
||||
:key="file.id"
|
||||
:style="{'cursor': file.securityLevel === -1 ? 'pointer' : 'default'}"
|
||||
@click="showMarkDialog(file, index,'upfile')"
|
||||
>
|
||||
<span>
|
||||
<i class="awsui-iconfont">  </i>
|
||||
<span>{{ file.fileName }}</span>
|
||||
<span
|
||||
v-if="file.securityLevel === -1"
|
||||
class="font12 red ml12"
|
||||
>
|
||||
未标密
|
||||
</span>
|
||||
<span v-else class="font12 blue ml12">{{
|
||||
file.securityLevel
|
||||
}}</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--图形密级显示-->
|
||||
<div class="mt1rem" v-if="shapeTable.length > 0">
|
||||
<div class="title font16">形状密级</div>
|
||||
<div class="fileList">
|
||||
<ul>
|
||||
<li
|
||||
v-for="(file, index) in shapeTable"
|
||||
:key="file.id"
|
||||
@click="showMarkDialog(file, index,'shape')"
|
||||
>
|
||||
<span>
|
||||
<i class="awsui-iconfont">  </i>
|
||||
<span>{{ file.fileName }}</span>
|
||||
<span
|
||||
v-if="file.securityLevel === -1"
|
||||
class="font12 red ml12"
|
||||
>
|
||||
未标密
|
||||
</span>
|
||||
<span v-else class="font12 blue ml12">{{
|
||||
file.securityLevel
|
||||
}}</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</awsui-main>
|
||||
<awsui-dialog
|
||||
title="密级标定"
|
||||
:visible.sync="securityVisible"
|
||||
:border="false"
|
||||
append-to-body
|
||||
width="500px"
|
||||
>
|
||||
<div style="max-height:500px;overflow-y: auto">
|
||||
<awsui-form
|
||||
ref="securityDialog"
|
||||
label-width="200px"
|
||||
id="securityDialog"
|
||||
:rules="securityRules"
|
||||
:model="securityForm"
|
||||
>
|
||||
<awsui-form-item :label="securityForm.name" prop="securityLevel">
|
||||
<awsui-select
|
||||
v-model="securityForm.securityLevel"
|
||||
:options="securityOptions"
|
||||
style="width: 70%"
|
||||
></awsui-select>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<awsui-button type="primary" @click="securityMark">确定</awsui-button>
|
||||
<awsui-button @click="securityVisible = false">取 消</awsui-button>
|
||||
</div>
|
||||
</awsui-dialog>
|
||||
</awsui-layout>
|
||||
</template>
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "RepositoryMark",
|
||||
data() {
|
||||
var securityValidate = (rule, value, callback) => {
|
||||
if (value === undefined) {
|
||||
callback(new Error("请选择文件密级"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
treeProps: {
|
||||
value: "id",
|
||||
label: "name",
|
||||
isLeaf: "leaf",
|
||||
},
|
||||
headerHeight: "30px",
|
||||
securityVisible: false,
|
||||
securityRules: {
|
||||
securityLevel: [
|
||||
{
|
||||
required: true,
|
||||
trigger: "change",
|
||||
validator: securityValidate,
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
},
|
||||
securityForm: {},
|
||||
securityOptions: [],
|
||||
securityList: {},
|
||||
upFileTable: [],
|
||||
shapeTable: [],
|
||||
fileUnMarkNum: -1,
|
||||
upFileUnMark: [],
|
||||
pl_uuid: "",
|
||||
resolveFun: [],
|
||||
path: [],
|
||||
pid: "",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mainHeight() {
|
||||
return (
|
||||
parseInt(this.$store.getters.getTopMainHeightFn) -
|
||||
parseInt(this.headerHeight) +
|
||||
"px"
|
||||
);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
//密级选择dialogVisible 变为false,清空securityFileList
|
||||
securityVisible(newval, oldval) {
|
||||
if (!newval) {
|
||||
this.securityForm = {};
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
loadUpfile(uuid) {
|
||||
this.pl_uuid = uuid;
|
||||
const that = this;
|
||||
//获取node下属全部附件
|
||||
const data = {
|
||||
url: "jd",
|
||||
data: {
|
||||
cmd: "com.actionsoft.apps.coe.pal_processlevel_upfile_load_all",
|
||||
pl_uuid: uuid,
|
||||
type: "file",
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
},
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios
|
||||
.post(data)
|
||||
.then(function (ro) {
|
||||
if (ro.result == "ok") {
|
||||
// 清空未标密table
|
||||
that.upFileUnMark = [];
|
||||
//设置密级options
|
||||
that.securityList = ro.data.securityList;
|
||||
that.securityOptions = [];
|
||||
Object.keys(that.securityList).map((key) => {
|
||||
let option = {
|
||||
value: key,
|
||||
label: that.securityList[key],
|
||||
};
|
||||
that.securityOptions.push(option);
|
||||
});
|
||||
|
||||
// 筛选显示字段
|
||||
const list = ro.data.upfileList;
|
||||
let fileTable = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const curr = list[i];
|
||||
if (curr.securityLevel == -1) {
|
||||
that.upFileUnMark.push(curr);
|
||||
}
|
||||
const tableRow = {
|
||||
id: curr.uuid,
|
||||
fileName: curr.fileName,
|
||||
securityLevel:
|
||||
curr.securityLevel == -1
|
||||
? -1
|
||||
: ro.data.securityList[curr.securityLevel],
|
||||
};
|
||||
fileTable.push(tableRow);
|
||||
}
|
||||
that.upFileTable = fileTable;
|
||||
//---图形附件
|
||||
let shapeList = ro.data.shapeList;
|
||||
fileTable = [];
|
||||
for (let i = 0; i < shapeList.length; i++) {
|
||||
let curr = shapeList[i];
|
||||
if (curr.securityLevel == -1) {
|
||||
that.upFileUnMark.push(curr);
|
||||
}
|
||||
const tableRow = {
|
||||
id: curr.uuid,
|
||||
fileName: curr.fileName,
|
||||
securityLevel:
|
||||
curr.securityLevel == -1
|
||||
? -1
|
||||
: ro.data.securityList[curr.securityLevel],
|
||||
};
|
||||
fileTable.push(tableRow);
|
||||
}
|
||||
that.shapeTable = fileTable;
|
||||
|
||||
//回显附件未标密
|
||||
if (that.upFileUnMark.length == 0) {
|
||||
const tree = that.$refs.tree;
|
||||
let node = tree.getNode(that.pl_uuid);
|
||||
node.data.isUpfileUnmark = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
quickMark() {
|
||||
const that = this;
|
||||
const data = {
|
||||
url: "jd",
|
||||
data: {
|
||||
cmd: "com.actionsoft.apps.coe.pal_processlevel_upfile_unmark_path",
|
||||
wsId: that.$store.getters.getWsIdFn,
|
||||
teamId: that.$store.getters.getTeamIdFn,
|
||||
},
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios
|
||||
.post(data)
|
||||
.then(function (ro) {
|
||||
if (ro.result == "ok") {
|
||||
that.path = [];
|
||||
that.pid = "";
|
||||
if (ro.data.path.length == 0) {
|
||||
that.$message({
|
||||
message: "已全部标定密级",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
that.path = ro.data.path;
|
||||
for (let i = 0; i < that.path.length; i++) {
|
||||
const tree = that.$refs.tree;
|
||||
const node = tree.getNode(that.path[i]);
|
||||
if (node != null) {
|
||||
node.expand();
|
||||
let index = that.path.indexOf(that.path[i]);
|
||||
if (index != -1) {
|
||||
that.pid = that.path[index];
|
||||
that.path.splice(index, 1);
|
||||
i--;
|
||||
}
|
||||
if (that.path.length == 0) {
|
||||
tree.setCurrentKey(that.pid);
|
||||
that.loadUpfile(that.pid);
|
||||
//文件标密dialog
|
||||
if(that.fileUnMarkNum != -1){
|
||||
that.showMarkDialog(node.data,-1,"file");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const tree = that.$refs.tree;
|
||||
const node = tree.getNode(that.pid);
|
||||
node.expand();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
showMark() {
|
||||
if (this.upFileUnMark.length > 0) {
|
||||
let node = this.upFileUnMark[0];
|
||||
let list = [];
|
||||
if (node.type === "f") {
|
||||
list = this.upFileTable;
|
||||
} else {
|
||||
list = this.shapeTable;
|
||||
}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (node.uuid === list[i].id) {
|
||||
if (node.type === "f") {
|
||||
this.showMarkDialog(node, i, "upfile");
|
||||
} else {
|
||||
this.showMarkDialog(node, i, "shape");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message({
|
||||
message: "暂无可标定密级文件",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
},
|
||||
showMarkDialog(node, index,type) {
|
||||
// 开启密级标定对话框
|
||||
if (node.securityLevel === -1) {
|
||||
this.securityVisible = true;
|
||||
this.securityForm.index = index;
|
||||
this.securityForm.name = node.fileName == undefined ? node.name : node.fileName;
|
||||
this.securityForm.type = type;
|
||||
this.securityForm.node = node;
|
||||
}
|
||||
},
|
||||
securityMark() {
|
||||
const that = this;
|
||||
let node = this.securityForm.node;
|
||||
this.$refs.securityDialog.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.securityForm.type == "file") {
|
||||
//流程文件更改密级
|
||||
const data = {
|
||||
url: "jd",
|
||||
data: {
|
||||
cmd: "com.actionsoft.apps.coe.pal_pl_file_security_level_update",
|
||||
uuid: node.id,
|
||||
securityLevel: that.securityForm.securityLevel,
|
||||
},
|
||||
};
|
||||
awsuiAxios
|
||||
.post(data)
|
||||
.then(function (ro) {
|
||||
that.securityVisible = false;
|
||||
if (ro.result == "ok") {
|
||||
//重新加载附件
|
||||
that.loadUpfile(that.pl_uuid);
|
||||
|
||||
//更新流程文件密级
|
||||
let name = that.securityList[that.securityForm.securityLevel];
|
||||
let node = that.$refs.tree.getNode(that.pl_uuid);
|
||||
node.data.securityLevelName = name;
|
||||
|
||||
//更新未标密数量
|
||||
that.fileUnMarkNum--;
|
||||
|
||||
that.$message({
|
||||
message: "密级标定成功",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
that.securityVisible = false;
|
||||
that.$message.error("密级标定失败");
|
||||
});
|
||||
} else {
|
||||
//验证通过,附件更改密级
|
||||
const data = {
|
||||
url: "jd",
|
||||
data: {
|
||||
cmd: "com.actionsoft.apps.coe.pal_processlevel_upfile_security_level_update",
|
||||
uuid: node.id == undefined ? node.uuid : node.id,
|
||||
securityLevel: that.securityForm.securityLevel,
|
||||
},
|
||||
};
|
||||
awsuiAxios
|
||||
.post(data)
|
||||
.then(function (ro) {
|
||||
that.securityVisible = false;
|
||||
if (ro.result == "ok") {
|
||||
that.loadUpfile(that.pl_uuid);
|
||||
that.$message({
|
||||
message: "密级标定成功",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
that.securityVisible = false;
|
||||
that.$message.error("密级标定失败");
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openNode(obj, node, tree) {
|
||||
this.loadUpfile(node.data.id);
|
||||
},
|
||||
expandNode(obj, node, tree) {
|
||||
// 展开节点
|
||||
},
|
||||
closeNode(obj, node, tree) {
|
||||
// 关闭时清空,下次展开重新请求动态加载
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const that = this;
|
||||
const data = {
|
||||
url: "jd",
|
||||
data: {},
|
||||
};
|
||||
data.data.wsId = that.$store.getters.getWsIdFn;
|
||||
data.data.teamId = that.$store.getters.getTeamIdFn;
|
||||
data.data.cmd = "com.actionsoft.apps.coe.pal_processlevel_tree_data";
|
||||
|
||||
if (node.level === 0) {
|
||||
// 获取根目录
|
||||
data.data.pid = "";
|
||||
} else {
|
||||
// 获取其他目录
|
||||
data.data.pid = node.data.id;
|
||||
}
|
||||
// 查询数据
|
||||
awsuiAxios
|
||||
.post(data)
|
||||
.then(function (ro) {
|
||||
if (ro.result == "ok") {
|
||||
resolve(ro.data);
|
||||
// 快速定位
|
||||
that.$nextTick(() => {
|
||||
if (that.path.length > 0) {
|
||||
that.pid = that.path[0];
|
||||
const tree = that.$refs.tree;
|
||||
const curnode = tree.getNode(that.path[0]);
|
||||
if (curnode != null) {
|
||||
curnode.expand();
|
||||
that.path.splice(0, 1);
|
||||
}
|
||||
if (that.path.length == 0) {
|
||||
tree.setCurrentKey(that.pid);
|
||||
that.loadUpfile(that.pid);
|
||||
if(that.fileUnMarkNum != -1){
|
||||
//文件标密dialog
|
||||
that.showMarkDialog(curnode.data,-1,"file");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// 默认展开tree层级
|
||||
if (node.level == 0 && ro.data.length > 0) {
|
||||
const tree = that.$refs.tree;
|
||||
tree.getNode(ro.data[0].id).expand();
|
||||
setTimeout(function () {
|
||||
const childNode = tree.getNode(ro.data[0].id).childNodes[0];
|
||||
if (childNode != null) {
|
||||
childNode.expand();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
//流程文件未标密数量
|
||||
if (ro.data.length > 0) {
|
||||
let node = ro.data[0];
|
||||
if(node.isFileSecurity != undefined && node.isFileSecurity && that.fileUnMarkNum == -1){
|
||||
that.getUnmarkFileNum(data.data.wsId,data.data.teamId);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
getUnmarkFileNum(wsId, teamId) {
|
||||
let that = this;
|
||||
const data = {
|
||||
url: "jd",
|
||||
data: {
|
||||
cmd: "com.actionsoft.apps.coe.pal_pl_file_unmark_num_query",
|
||||
wsId: wsId,
|
||||
teamId: teamId,
|
||||
},
|
||||
};
|
||||
awsuiAxios
|
||||
.post(data)
|
||||
.then(function (ro) {
|
||||
if (ro.result == "ok") {
|
||||
that.fileUnMarkNum = ro.data.unmarkFileNum;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
that.securityVisible = false;
|
||||
that.$message.error("获取未标密文件失败");
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.awsui-main {
|
||||
padding: 0;
|
||||
}
|
||||
.treeWrapper {
|
||||
padding-right: 2rem;
|
||||
border-right: 3px dashed gray;
|
||||
}
|
||||
.markWrapper {
|
||||
padding-right: 2rem;
|
||||
height: 100%;
|
||||
}
|
||||
.treeHeader {
|
||||
padding-top: 1rem;
|
||||
padding-left: 2rem;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
.treeMain {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.treeMain::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.treeHeader .textWrapper {
|
||||
display: inline;
|
||||
}
|
||||
.treeHeader .title {
|
||||
font-size: 1.2rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
.treeHeader .desc {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
.treeHeader .button {
|
||||
display: inline;
|
||||
float: right;
|
||||
}
|
||||
.noData {
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.noData .wrapper {
|
||||
width: 300px;
|
||||
margin: auto;
|
||||
}
|
||||
.fileWrapper {
|
||||
padding-left: 2rem;
|
||||
}
|
||||
.fileWrapper .fileList {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
.fileWrapper .fileList li {
|
||||
list-style: none;
|
||||
margin-top: 1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.font12 {
|
||||
font-size: 12px;
|
||||
}
|
||||
.font16 {
|
||||
font-size: 16px;
|
||||
}
|
||||
.blue {
|
||||
color: #4e7ff9;
|
||||
}
|
||||
.red {
|
||||
color: #f56c6c;
|
||||
}
|
||||
.ml12 {
|
||||
margin-left: 12px;
|
||||
}
|
||||
.noView {
|
||||
display: none;
|
||||
}
|
||||
.mt1rem {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
</style>
|
||||
621
com.actionsoft.apps.coe.pal/views/system/Navigation.vue
Normal file
621
com.actionsoft.apps.coe.pal/views/system/Navigation.vue
Normal file
@ -0,0 +1,621 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-header class="el-header" height="100%">
|
||||
<div class="header-row">
|
||||
<div class="nav-left" style="min-width: 300px;text-align: left;">
|
||||
<!--资产库相关-->
|
||||
<div v-if="mainType=='0'" class="inline-block header-font text-general-color">AWS PAL资产库</div>
|
||||
<div v-if="mainType=='1'" id="ws-select" class="inline-block">
|
||||
<div class="icon-main-div cursor-pointer" :style="{'background-color': mainIcon.color}" @mouseenter="function(){mainIcon.code='';mainIcon.color='#6d97ff'}" @mouseleave="function(){mainIcon.code=mainIconTemp.code;mainIcon.color=mainIconTemp.color}" @click="returnMainPage">
|
||||
<i class="awsui-iconfont icon-i-ws" v-html="mainIcon.code"></i>
|
||||
</div>
|
||||
<el-dropdown trigger="click" @command="handleWsCommand" @visible-change="changeDropDownArrow">
|
||||
<span class="el-dropdown-link header-font cursor-pointer text-general-color">
|
||||
{{wsLabel}}<i class="awsui-iconfont" style="margin-left: 5px;font-size: 14px;" v-html="arrowTip=='down' ? '' : ''"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" class="navigation-dropdown-area">
|
||||
<template v-for="item in wsOptions">
|
||||
<el-dropdown-item class="el-dropdown-row" :command="item.value">
|
||||
<div class="inline-block text-general-color" style="height: 100%;width: 80%"><span style="font-size: 14px;">{{item.label}}</span></div>
|
||||
<div class="inline-block" style="width: 20%"><i :class="['el-icon-check','text-linker-color',{'icon-check-display':item.value != wsValue}]" style="float:right;"></i></div>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<el-dropdown-item divided></el-dropdown-item>
|
||||
<el-dropdown-item class="text-linker-color el-dropdown-row" command="create">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><i class="iconfont icon-xinjian" style="font-size: 14px;"></i><span>新建资产库</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item class="text-linker-color el-dropdown-row" command="import">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><i class="iconfont awsui-iconfont-sousuo1" style="font-size: 14px;"></i><span>导入资产库</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item class="text-general-color el-dropdown-row" command="manage">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><i class="iconfont awsui-iconfont-zengjia" style="font-size: 14px;"></i><span>管理资产库</span></div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<!--小组相关-->
|
||||
<div v-if="mainType=='2'" class="inline-block header-font text-general-color">AWS PAL小组</div>
|
||||
<div v-if="mainType=='3'" id="team-select" class="inline-block">
|
||||
<div class="icon-main-div cursor-pointer" :style="{'background-color': mainIcon.color}" @mouseenter="function(){mainIcon.code='';mainIcon.color='#6d97ff'}" @mouseleave="function(){mainIcon.code=mainIconTemp.code;mainIcon.color=mainIconTemp.color}" @click="returnMainPage">
|
||||
<i class="awsui-iconfont icon-i-ws" v-html="mainIcon.code"></i>
|
||||
</div>
|
||||
<el-dropdown trigger="click" @command="handleTeamCommand" @visible-change="changeDropDownArrow">
|
||||
<span class="el-dropdown-link header-font cursor-pointer text-general-color">
|
||||
{{teamLabel}}<i class="awsui-iconfont" style="margin-left: 5px;font-size: 14px;" v-html="arrowTip=='down' ? '' : ''"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" class="navigation-dropdown-area">
|
||||
<template v-for="item in teamOptions">
|
||||
<el-dropdown-item class="el-dropdown-row" :command="item.value">
|
||||
<div class="inline-block text-general-color" style="height: 100%;width: 80%"><span style="font-size: 14px;">{{item.label}}</span></div>
|
||||
<div class="inline-block" style="width: 20%"><i :class="['el-icon-check','text-linker-color',{'icon-check-display':item.value != teamValue}]" style="float:right;"></i></div>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<el-dropdown-item v-if="(isManage && isTeamManager) || isTeamManager" divided></el-dropdown-item>
|
||||
<el-dropdown-item v-if="isManage && isTeamManager" class="text-linker-color el-dropdown-row" command="create">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><i class="iconfont icon-xinjian" style="font-size: 14px;"></i><span>新建小组</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="isTeamManager" class="text-general-color el-dropdown-row" command="manage">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><i class="iconfont awsui-iconfont-zengjia" style="font-size: 14px;"></i><span>管理小组</span></div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<!--管理中心-->
|
||||
<div v-if="mainType=='4'" class="inline-block header-font text-general-color">AWS PAL管理中心</div>
|
||||
</div>
|
||||
<div class="nav-center" style="width: 350px;">
|
||||
<div v-if="mainType=='1' || mainType=='3'" style="position: relative;" @click.stop="keepRepositoryQuery" id="repositoryQueryArea">
|
||||
<el-input style="width:350px;" size="small" placeholder="搜索文件" v-model="queryInput" @input="basicQuery">
|
||||
<i class="inline-block awsui-iconfont" slot="prefix"></i>
|
||||
<i style="cursor: pointer;" class="inline-block awsui-iconfont" slot="suffix" @click="conditionQuery"></i>
|
||||
</el-input>
|
||||
<RepositoryQuery style="line-height: normal !important;" ref="repositoryQuery" :queryInput="queryInput"></RepositoryQuery>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-right">
|
||||
<ul class="nav-right-ul">
|
||||
<li>
|
||||
<div>
|
||||
<el-dropdown
|
||||
ref="userDropDownMenu"
|
||||
:hide-on-click=true
|
||||
@command="handleUserCommand"
|
||||
trigger="click">
|
||||
<span class="inline-block user_photo_dropdown_span cursor-pointer">
|
||||
<img class="user_photo_img radius3" :src="userPhoto">
|
||||
</span>
|
||||
<el-dropdown-menu class="text-general-color" slot="dropdown" style="width:200px;">
|
||||
<el-dropdown-item class="el-dropdown-row" v-if="mainType != '4' && isManage" command="manage">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="font-size: 14px;">管理中心</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="mainType != '4' && isManage" divided></el-dropdown-item>
|
||||
<el-dropdown-item class="el-dropdown-row" command="bbs">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="font-size: 14px;">研习社</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item class="el-dropdown-row" command="help">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="font-size: 14px;">帮助文档</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided></el-dropdown-item>
|
||||
<el-dropdown-item class="el-dropdown-row" v-if="isChangePwd()" command="updatePwd">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="font-size: 14px;">修改密码</span></div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item class="el-dropdown-row" command="logout">
|
||||
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="font-size: 14px;">退出登录</span></div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</li>
|
||||
<!-- 三员开启时安全保密员不显示以下功能 -->
|
||||
<template v-if="!isSecAdminUser">
|
||||
<li v-if="mainType != '2' && mainType != '4' && mainType != '0'">
|
||||
<div class="inline-block" style="line-height: 20px;vertical-align: middle;margin-left: 10px;margin-right:10px;">
|
||||
<div style="width: 1px;height: 20px;border-left: 1px solid #f2f2f2;margin-left: 5px;margin-right: 5px;"></div>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="mainType != '2' && mainType != '4' && mainType != '0'" v-show="!showAppDetail">
|
||||
<div id="appPopover">
|
||||
<el-popover
|
||||
ref="appPopover"
|
||||
placement="top-start"
|
||||
title="应用中心"
|
||||
:open-delay="250"
|
||||
trigger="click">
|
||||
<ul class="nav-app-list-ul">
|
||||
<li class="inline-block" v-for="row in Math.ceil(appList.length/5)" style="vertical-align: top;">
|
||||
<template v-for="item in appList.slice((row-1)*5, row*5)">
|
||||
<div class="app-div general-bgcolor-hover cursor-pointer"
|
||||
@click="openApp(item.appId, item.clazzName, item.name, item.icon.icon, item.icon.color)">
|
||||
<div class="inline-block app-icon-div" :style="{'background':item.icon.color}">
|
||||
<i class="awsui-iconfont" style="font-size: 18px;color: #fff" v-html="item.icon.icon"></i>
|
||||
</div>
|
||||
<div class="inline-block app-text-div">
|
||||
<div>
|
||||
<p class="app-label-p-title text-general-color">{{item.name}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="app-label-p-desc text-second-color">{{item.desc}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</li>
|
||||
</ul>
|
||||
<i slot="reference" class="iconfont cursor-pointer app-icon" style="font-size: 18px;"></i>
|
||||
</el-popover>
|
||||
</div>
|
||||
</li>
|
||||
<li v-show="showAppDetail">
|
||||
<div style="padding: 0 10px;background-color: #EEE;">
|
||||
<div class="inline-block app-icon-div" :style="{'background':currApp.bgColor}" style="width: 22px;height: 22px;line-height:22px;vertical-align:middle;top: 0px;">
|
||||
<i class="awsui-iconfont" style="font-size: 14px;color: #fff" v-html="currApp.icon"></i>
|
||||
</div>
|
||||
<span class="inline-block text-general-color" style="font-size: 14px;height: 100%;vertical-align: middle;margin:0 5px;">{{currApp.name}}</span>
|
||||
<i class="awsui-iconfont text-general-color cursor-pointer" style="font-size: 14px;" @click="closeApp()"></i>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div style="margin-right: 5px;">
|
||||
<div class="quick-access-btn" v-if="isManage && mainType != '0' && mainType != '1'" @click="openManageMainPage">
|
||||
<span><i class="awsui-iconfont quick-access-btn-icon"></i><span class="quick-access-btn-text">访问资产库</span></span>
|
||||
</div>
|
||||
<div class="quick-access-btn" v-if="(mainType == '0' || mainType == '1' || mainType == '4') && isCooperationActive" style="display: inline-block;cursor: pointer;color: #999;padding:0 5px;" @click="openCooperationPage">
|
||||
<span><i class="awsui-iconfont quick-access-btn-icon"></i><span class="quick-access-btn-text">访问小组</span></span>
|
||||
</div>
|
||||
<div class="quick-access-btn" v-if="isPbulishActive" style="display: inline-block;cursor: pointer;color: #999;padding:0 5px;" @click="openProcessManagePortalPage">
|
||||
<span><i class="awsui-iconfont quick-access-btn-icon"></i><span class="quick-access-btn-text">访问发布门户</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<WorkspaceUpdate ref="workspaceUpdate"></WorkspaceUpdate>
|
||||
<WorkspaceImport ref="workspaceImport"></WorkspaceImport>
|
||||
<cooperation-update
|
||||
ref="cooperationUpdate"
|
||||
:visible.sync="cooperation.visible"
|
||||
:teamId="cooperation.teamId"
|
||||
v-on:cancel="cooperation.visible = false"
|
||||
v-on:getResult="createCooperationCallback"
|
||||
:title="cooperation.title"/>
|
||||
</el-header>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import WorkspaceUpdate from "../workspace/WorkspaceUpdate";
|
||||
import WorkspaceImport from "../workspace/WorkspaceImport";
|
||||
import RepositoryQuery from "../repository/RepositoryQuery";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import {newWin, newPageWin, updateHtmlTitle} from "../../api/commonFun";
|
||||
import CooperationUpdate from "../../components/CooperationUpdate/component";
|
||||
export default {
|
||||
name: "Navigation",
|
||||
components: {WorkspaceUpdate, WorkspaceImport, RepositoryQuery, CooperationUpdate},
|
||||
data() {
|
||||
return {
|
||||
mainType : mainType,// 0:左侧显示资产库文字,中间无输入框,右侧显示所有,1:左侧显示资产库下拉菜单,中间显示输入框,右侧显示所有,2:左侧显示小组文字,中间无输入框,右侧显示所有,3:左侧显示小组下拉菜单,中甲显示输入框,右侧显示所有,4:管理中心
|
||||
isManage: isManage,
|
||||
isSecAdminUser: isSecAdminUser,// 是否安全保密员,三员开启且为安全保密员为true
|
||||
userPhoto : '',
|
||||
isPbulishActive : false,
|
||||
isCooperationActive : false,
|
||||
wsLabel : '',
|
||||
wsValue : '',
|
||||
wsOptions : [],
|
||||
teamLabel: '',
|
||||
teamValue: '',
|
||||
isTeamManager: false,
|
||||
teamOptions: [],
|
||||
arrowTip: 'down',
|
||||
queryInput : '',
|
||||
appList: [],
|
||||
teamAppList: {},
|
||||
showAppDetail:false,
|
||||
currApp:{
|
||||
id:'',
|
||||
clazzName:'',
|
||||
name:'',
|
||||
icon:'',
|
||||
bgColor:''
|
||||
},
|
||||
mainIcon: {code: '', color: '#4E7FF9'},
|
||||
mainIconTemp: {code: '', color: '#4E7FF9'},
|
||||
cooperation: {
|
||||
visible: false,
|
||||
teamId: '',
|
||||
title: '创建小组'
|
||||
},
|
||||
cooperationDrawer: {
|
||||
showCooperationDetail: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
inject : ['openAppDrawer', 'closeAppDrawer', 'openPwdConfig', 'logout', 'openCooperationDrawer', 'closeCooperationDrawer', 'saveAccessOpLog'],// 父组件方法注入
|
||||
methods : {
|
||||
basicQuery() {// 基础查询
|
||||
this.closeApp();
|
||||
this.closeCooperation();
|
||||
// this.showQueryArea = true;
|
||||
if (this.queryInput.trim() == '') {
|
||||
this.$store.commit('setNavigationQueryVisibleFn',false);// 导航栏输入框快速搜索
|
||||
} else {
|
||||
this.$store.commit('setNavigationQueryVisibleFn',true);// 导航栏输入框快速搜索
|
||||
}
|
||||
},
|
||||
conditionQuery() {// 筛选查询
|
||||
this.closeApp();
|
||||
this.closeCooperation();
|
||||
this.$store.commit('setNavigationQueryVisibleFn',false);// 导航栏输入框快速搜索
|
||||
this.$store.commit('setNavigationConditionQueryVisibleFn',true);// 导航栏输入框条件搜索窗口
|
||||
},
|
||||
keepRepositoryQuery() {// 无用,只是阻拦Main.vue中的页面click执行
|
||||
|
||||
},
|
||||
handleWsCommand(command) {// 资产库操作
|
||||
this.closeApp();
|
||||
this.closeCooperation();
|
||||
if (command == 'create') {
|
||||
// 资产库
|
||||
this.$refs.workspaceUpdate.openUpdateWsDlg('create', '', this);
|
||||
} else if (command == 'import') {
|
||||
this.$refs.workspaceImport.openImportWsDlg(this);
|
||||
} else if (command == 'manage') {
|
||||
newPageWin('palManage', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {mainType: 4}, '_top');
|
||||
} else {// 切换资产库
|
||||
this.wsValue = command;
|
||||
for (let i = 0; i < this.wsOptions.length; i++) {
|
||||
if (this.wsOptions[i].value == command) {
|
||||
this.wsLabel = this.wsOptions[i].label;
|
||||
this.$store.commit('setWsIdFn',this.wsValue);
|
||||
this.saveAccessOpLog('workspace');// 访问资产库日志
|
||||
updateHtmlTitle(this.wsLabel);// 修改网页标题
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleTeamCommand(command) {// 小组操作
|
||||
this.closeApp();
|
||||
this.closeCooperation();
|
||||
if (command == 'create') {// 小组创建
|
||||
this.cooperation.visible = true;
|
||||
} else if (command == 'manage') {// 小组管理
|
||||
this.openCooperation();
|
||||
} else {// 切换小组
|
||||
this.teamValue = command;
|
||||
for (let i = 0; i < this.teamOptions.length; i++) {
|
||||
if (this.teamOptions[i].value == command) {
|
||||
this.teamLabel = this.teamOptions[i].label;
|
||||
const teamId = this.teamValue.split('|')[0];
|
||||
this.$store.commit('setTeamIdFn',teamId);
|
||||
this.$store.commit('setWsIdFn',this.teamValue.split('|')[1]);
|
||||
this.appList = this.teamAppList[teamId];
|
||||
this.updateTeamLogo(teamId);
|
||||
this.saveAccessOpLog('cooperation');// 访问小组日志
|
||||
updateHtmlTitle(this.teamLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleUserCommand(command) {// 用户中心
|
||||
this.closeApp();
|
||||
this.closeCooperation();
|
||||
if (command == 'manage') {
|
||||
newPageWin('palCooperation', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {mainType: 4}, '_top');
|
||||
} else if (command == 'bbs') {// 研习社
|
||||
newWin('bbsLink', "http://www.awspal.com/study");
|
||||
} else if (command == 'help') {// 帮助中心
|
||||
newWin("helpLink", "http://docs.awspaas.com/coe/aws-paas-user-manual-coe-pal/index.html");
|
||||
} else if (command == 'updatePwd') {
|
||||
this.openPwdConfig();// 修改密码
|
||||
} else if (command == 'logout') {
|
||||
this.logout();// 退出pal
|
||||
}
|
||||
},
|
||||
/*******应用中心app侧边栏*********/
|
||||
openApp(appId, clazzName, name, icon, color) {// 打开App
|
||||
this.$refs['appPopover'].doClose();
|
||||
this.currApp.id = appId;
|
||||
this.currApp.name = name;
|
||||
this.currApp.clazzName = clazzName;
|
||||
this.currApp.icon = icon;
|
||||
this.currApp.bgColor = color;
|
||||
this.openAppDrawer();
|
||||
// 导航栏应用显示处理
|
||||
this.showAppDetail = true;
|
||||
},
|
||||
closeApp() {
|
||||
this.closeAppDrawer();
|
||||
},
|
||||
/*******PAL小组侧边栏*********/
|
||||
openCooperation() {// 打开PAL小组
|
||||
this.openCooperationDrawer();
|
||||
},
|
||||
closeCooperation() {
|
||||
this.closeCooperationDrawer();
|
||||
},
|
||||
isChangePwd() {// 是否可以修改密码
|
||||
return isSecurityPwdChange;
|
||||
},
|
||||
updateWorkspaceCallback() {// 新建、更新资产库回调函数
|
||||
newPageWin('palMain', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
|
||||
},
|
||||
importWorkspaceCallback() {// 导入资产库回调函数
|
||||
newPageWin('palMain', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
|
||||
},
|
||||
initParam() {// 初始化参数
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_nav_header_data',
|
||||
mainType : mainType
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
let data = ro.data;
|
||||
that.userPhoto = data.userPhoto;
|
||||
that.isPbulishActive = data.isPbulishActive;
|
||||
that.isCooperationActive = data.isCooperationActive;
|
||||
that.appList = data.appList;
|
||||
that.teamAppList = data.teamAppList;
|
||||
that.teamLabel = data.teamLabel;
|
||||
that.teamValue = data.teamValue;
|
||||
that.teamOptions = data.teamOptions;
|
||||
that.wsValue = data.wsValue;
|
||||
that.$store.commit('setWsIdFn',that.wsValue);
|
||||
if (that.teamValue != '') {
|
||||
const teamId = that.teamValue.split('|')[0];
|
||||
that.$store.commit('setTeamIdFn',teamId);
|
||||
that.$store.commit('setWsIdFn',that.teamValue.split('|')[1]);
|
||||
// 更新小组图标
|
||||
that.updateTeamLogo(teamId);
|
||||
}
|
||||
that.isTeamManager = data.isTeamManager;
|
||||
that.wsLabel = data.wsLabel;
|
||||
that.wsOptions = data.wsOptions;
|
||||
if (mainType == '0') {
|
||||
// 资产库(空白)
|
||||
that.$router.replace({path: 'workspace'});
|
||||
updateHtmlTitle('AWS PAL资产库');// 修改网页标题
|
||||
} else if (mainType== '2') {
|
||||
// 小组(空白)
|
||||
that.$router.replace({name: 'cooperationCreate',params: {isManage: isManage}});
|
||||
updateHtmlTitle('AWS PAL小组');// 修改网页标题
|
||||
} else if (mainType == '4') {
|
||||
// 管理中心
|
||||
that.$router.replace({path: 'manage'});
|
||||
updateHtmlTitle('AWS PAL管理中心');// 修改网页标题
|
||||
} else if (mainType == '1' || mainType == '3') {
|
||||
let htmlTitle = that.wsLabel;
|
||||
if (mainType == '1') {
|
||||
// 记录访问日志
|
||||
that.saveAccessOpLog('workspace');// 访问资产库日志
|
||||
} else {
|
||||
that.saveAccessOpLog('cooperation');// 访问小组日志
|
||||
htmlTitle = that.teamLabel
|
||||
}
|
||||
that.$router.replace({path: 'repository'})
|
||||
updateHtmlTitle(htmlTitle);// 修改网页标题
|
||||
}
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
returnMainPage() {// 返回主页(最近、星标文件)
|
||||
this.closeApp();
|
||||
this.closeCooperation();
|
||||
if (!this.queryInput == '') {
|
||||
this.queryInput = '';
|
||||
}
|
||||
this.$router.push({path: '/Repository', query: {param: Math.random()}});
|
||||
},
|
||||
changeDropDownArrow(flag) {// 资产库、小组下拉菜单图标
|
||||
if (flag) {
|
||||
this.arrowTip = 'up';
|
||||
} else {
|
||||
this.arrowTip = 'down';
|
||||
}
|
||||
},
|
||||
updateTeamLogo(teamId) {
|
||||
const that = this;
|
||||
for (let i = 0; i < that.teamOptions.length; i++) {
|
||||
if (that.teamOptions[i].teamId == teamId) {
|
||||
that.mainIcon.color = that.teamOptions[i].teamLogo.color;
|
||||
that.mainIcon.code = that.teamOptions[i].teamLogo.code;
|
||||
that.mainIconTemp.color = that.teamOptions[i].teamLogo.color;
|
||||
that.mainIconTemp.code = that.teamOptions[i].teamLogo.code;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
createCooperationCallback(result) {// 创建小组完成后执行
|
||||
if (result == 'ok') {
|
||||
newPageWin('palCooperation', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {mainType: 5}, '_top');
|
||||
}
|
||||
},
|
||||
openCooperationPage() {// 打开PAL小组
|
||||
newPageWin('palCooperation', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {mainType: 5}, '_top');
|
||||
},
|
||||
openManageMainPage() {// 跳转到PAL流程资产库管理员的主页面
|
||||
newPageWin('palCooperation', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
|
||||
},
|
||||
openProcessManagePortalPage() {// 跳转到流程管理门户页面
|
||||
newPageWin('publishPortal', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal.publisher_client_home');
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initParam();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-header {
|
||||
padding-right: 0;
|
||||
padding-left: 0
|
||||
}
|
||||
.header-row {
|
||||
border-bottom: 1px solid #F2F2F2;
|
||||
box-shadow: rgba(170, 170, 170, 0.3) 0px 2px 5px 0px;;
|
||||
height: 39px;
|
||||
line-height:40px;
|
||||
vertical-align:middle;
|
||||
padding-top:8px;
|
||||
padding-bottom:8px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px
|
||||
}
|
||||
.header-font {
|
||||
font-size: 16px !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
.nav-left {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
.nav-center {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
.nav-right {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
.nav-app-list-ul {
|
||||
max-width:1024px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nav-app-list-ul li {
|
||||
width: 200px;
|
||||
}
|
||||
.app-div {
|
||||
height: 56px;
|
||||
padding-left: 20px;
|
||||
/*margin: 5px 0;*/
|
||||
}
|
||||
.app-div:hover div div p {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.app-label-p-title {
|
||||
font-size:13px;
|
||||
}
|
||||
.app-label-p-desc {
|
||||
-webkit-transform:scale(0.9);
|
||||
transform-origin: 0 0;
|
||||
font-size:12px;
|
||||
}
|
||||
.app-icon-div {
|
||||
position: relative;
|
||||
top:-1px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
border-radius: 10%;
|
||||
}
|
||||
.app-text-div {
|
||||
margin-left: 7px;
|
||||
position: relative;
|
||||
top: 12px;
|
||||
}
|
||||
.app-text-div div p{
|
||||
width: 140px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user_photo_dropdown_span {
|
||||
width: 26px;
|
||||
height:26px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.user_photo_img {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
left: 0px;
|
||||
}
|
||||
.inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
.cursor-pointer {
|
||||
cursor:pointer;
|
||||
}
|
||||
.nav-right-ul li {
|
||||
float: right;
|
||||
}
|
||||
.icon-check-display {
|
||||
display: none;
|
||||
}
|
||||
.app-icon {
|
||||
color: #A5B5CE;
|
||||
}
|
||||
.app-icon:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.icon-main-div {
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
text-align: center;
|
||||
line-height: 26px;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
top: -4px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.icon-i-ws {
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
}
|
||||
.el-dropdown-link:hover {
|
||||
color: #4E7FF9;
|
||||
}
|
||||
.el-dropdown-row {
|
||||
min-height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
.el-dropdown-row :hover {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
.navigation-dropdown-area {
|
||||
min-width: 250px;
|
||||
max-height: 370px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
#appPopover >>> .el-popover__title {
|
||||
color: #606266;
|
||||
font-weight: 600;
|
||||
}
|
||||
#repositoryQueryArea div >>> .el-input__inner{
|
||||
color: #8E8E8E !important;
|
||||
background-color: #F0F3F9 !important;
|
||||
border: 0px;
|
||||
}
|
||||
.quick-access-btn {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: #999;
|
||||
padding:0 5px;
|
||||
}
|
||||
.quick-access-btn-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
.quick-access-btn-text {
|
||||
position: relative;top: -2px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
.quick-access-btn :hover {
|
||||
color: #4E7FF9 !important;
|
||||
}
|
||||
</style>
|
||||
207
com.actionsoft.apps.coe.pal/views/system/PwdChange.vue
Normal file
207
com.actionsoft.apps.coe.pal/views/system/PwdChange.vue
Normal file
@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="修改密码"
|
||||
:visible.sync="pwdConfig"
|
||||
:append-to-body=true
|
||||
top="15%"
|
||||
width="600px"
|
||||
:before-close="handleClose" class="pwd-change">
|
||||
<table style="width: 420px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-general-color" style="width:125px;">旧口令</td>
|
||||
<td>
|
||||
<span class="text-important-color">* </span><el-input size="small" v-model="pwd1" id="pwd1" placeholder="" name="pwd1" auto-complete="new-password" type="password" style="width: 240px; margin-bottom: 5px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-general-color">新口令</td>
|
||||
<td>
|
||||
<span class="text-important-color">* </span><el-input size="small" v-model="pwd2" placeholder="" id="pwd2" name="pwd2" auto-complete="new-password" type="password" style="width: 240px; margin-bottom: 5px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-general-color">确认口令</td>
|
||||
<td>
|
||||
<span class="text-important-color">* </span><el-input size="small" v-model="pwd3" id="pwd3" name="pwd3" placeholder="" auto-complete="new-password" type="password" style="width: 240px; margin-bottom: 5px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="saveUserPwd()">确定</awsui-button>
|
||||
<awsui-button @click="clearPwd(true)">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "PwdChange",
|
||||
data() {
|
||||
return {
|
||||
pwdConfig: false,
|
||||
pwd1:'',
|
||||
pwd2:'',
|
||||
pwd3:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveUserPwd() {
|
||||
const that = this;
|
||||
let type = 'success';
|
||||
let msg = '';
|
||||
if (that.pwd1 == '') {
|
||||
type = 'warning';
|
||||
msg = '[旧口令]不允许为空';
|
||||
} else if (that.pwd2 == '') {
|
||||
type = 'warning';
|
||||
msg = '[新口令]不允许为空';
|
||||
} else if (that.pwd3 == '') {
|
||||
type = 'warning';
|
||||
msg = '[确认口令]不允许为空';
|
||||
} else if (that.pwd1 == that.pwd2) {
|
||||
type = 'warning';
|
||||
msg = '新口令和旧口令不能相同';
|
||||
} else if (that.pwd2 != that.pwd3) {
|
||||
type = 'warning';
|
||||
msg = '新口令和确认口令不一致';
|
||||
} else if (that.pwd2.indexOf(" ") > -1) {
|
||||
type = 'warning';
|
||||
msg = '[新口令]不能包含空格';
|
||||
} else if (that.pwd3.indexOf(" ") > -1) {
|
||||
type = 'warning';
|
||||
msg = '[确认口令]不能包含空格';
|
||||
}
|
||||
if (type != 'success') {
|
||||
that.$message({
|
||||
message: msg,
|
||||
duration: 2000,
|
||||
type: type
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (that.validateUpdateLoginpassword(that.pwd2, "新口令")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const params1 = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'CLIENT_P_PERSON_CONFIG_PW_ISRIGHT',
|
||||
oldpwd: that.pwd1
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params1).then(function (msg) {
|
||||
if(msg== '-1'){
|
||||
that.$message.error("旧口令输入错误,请重新输入");
|
||||
return false;
|
||||
}
|
||||
const params2 = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: "CLIENT_P_PERSON_CONFIG_PW_SAVE",
|
||||
oldpwd: that.pwd1,
|
||||
newpwd: that.pwd2
|
||||
}
|
||||
}
|
||||
awsuiAxios.post(params2).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
// 关闭密码框
|
||||
that.$message({
|
||||
message: ro.msg,
|
||||
type: 'success'
|
||||
});
|
||||
that.clearPwd(true);
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 校验portal/console 端口令修改;
|
||||
* 页面需要有securityMinPwdLength(aws-portal.xml安全配置minPwdLength)、securityMaxPwdLength(aws-portal.xml安全配置maxPwdLength)、isSecurityPwdComplexity(aws-portal.xml安全配置pwdComplexity)参数
|
||||
* @param {} value 输入的口令
|
||||
* @param {} value 口令的label
|
||||
* @return {Boolean}
|
||||
*/
|
||||
validateUpdateLoginpassword(value, labelName) {
|
||||
// 允许账户口令最小长度,0表示无限制
|
||||
if (securityMinPwdLength > 0) {
|
||||
// 允许账户口令最小长度
|
||||
if (value.length < securityMinPwdLength) {
|
||||
this.$message({
|
||||
message: '[' + labelName + ']不得少于' + securityMinPwdLength + '个字符',
|
||||
type: 'warning'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
// 允许账户口令最大长度,最多32位长度
|
||||
if (value.length > securityMaxPwdLength) {
|
||||
this.$message({
|
||||
message: '[' + labelName + ']不允许超过' + securityMaxPwdLength + '个字符',
|
||||
duration: 2000,
|
||||
type: 'warning'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// 是否要求强度口令
|
||||
if (isSecurityPwdComplexity) {
|
||||
//自定义密码强度 参数判断在后台实现
|
||||
// var reg = new RegExp(pwdComplexityRegular);
|
||||
// if (!reg.test(value)) {
|
||||
// $.simpleAlert(labelName + 必须包含字母大小写和数字);
|
||||
// return true;
|
||||
// }
|
||||
}
|
||||
return false;
|
||||
},
|
||||
//判断口令长度
|
||||
checkPasswordLength(pwd1, pwd2) {
|
||||
var minLength = jQuery("#minLength").val();
|
||||
if (length2(pwd1) < minLength || length2(pwd2) < minLength) {
|
||||
$.simpleAlert("口令长度不能少于" + minLength + "位", "error", 2000);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.clearPwd(false);
|
||||
done();
|
||||
},
|
||||
clearPwd(close) {
|
||||
const that = this;
|
||||
that.pwd1 = '';
|
||||
that.pwd2 = '';
|
||||
that.pwd3 = '';
|
||||
if(close) {
|
||||
that.pwdConfig = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#pwd1,#pwd2,#pwd3 {
|
||||
display: inline-block;
|
||||
}
|
||||
.pwd-change >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
31
com.actionsoft.apps.coe.pal/views/user/BPMOrg.vue
Normal file
31
com.actionsoft.apps.coe.pal/views/user/BPMOrg.vue
Normal file
@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div :style="{width: '100%', height: mainHeight}">
|
||||
<iframe id="orgIframe" width="100%" :height="(parseInt(mainHeight) - 4) + 'px'" name="orgIframe" style="border:0;" :src="src"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "BPMOrg",
|
||||
data() {
|
||||
return {
|
||||
src: './w?sid=' + this.$store.state.sessionId + '&cmd=com.actionsoft.apps.coe.pal_average_user_org',
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 4) + 'px',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - 4) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
647
com.actionsoft.apps.coe.pal/views/user/User.vue
Normal file
647
com.actionsoft.apps.coe.pal/views/user/User.vue
Normal file
@ -0,0 +1,647 @@
|
||||
<template>
|
||||
<el-container id="user" style="width: 100%;">
|
||||
<el-header :height="headerHeight">
|
||||
<el-col :span="24" style="position: relative;top: 10px;">
|
||||
<div style="display:inline-block;float:left;">
|
||||
<awsui-button style="width: 100px;" class="button-general-color" type="primary" @click="addUser">添加用户</awsui-button>
|
||||
</div>
|
||||
<div style="display:inline-block;float:right;width:320px;padding-right: 20px;">
|
||||
<el-input
|
||||
placeholder="搜索"
|
||||
prefix-icon="el-icon-search"
|
||||
v-model="searchInput"
|
||||
@input="searchUser"
|
||||
size="small"
|
||||
clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-header>
|
||||
<el-main :style="{height: mainHeight}">
|
||||
<div class="text-general-color category-title"><p style="padding-left: 5px;" v-html="'管理用户(' + data1.length + ')'"></p></div>
|
||||
<div v-show="data1.length == 0" style="height: 200px;"></div>
|
||||
<template v-for="item in data1">
|
||||
<div style="display: inline;margin-right: 40px;" @mouseenter="enter(item.id, '0')" @mouseleave="leave(item.id, '0')">
|
||||
<el-card shadow="hover" style="width: 300px;display: inline-block;margin-top: 15px;">
|
||||
<div style="display: inline-block;width: 15px;margin-left: 5px;height: 20px;line-height: 20px;vertical-align: middle;">
|
||||
<div :style="{'display': (item.showCheckBox || item.checked) ? 'inline-block' : 'none'}">
|
||||
<el-checkbox v-model="item.checked" @change="handleCheckChange(item.id, '0')"></el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: inline;width: 30px;margin: 0 15px;">
|
||||
<img class="user_photo_img radius3" :src="item.userPhoto">
|
||||
</div>
|
||||
<div class="text-over-hidden" style="display: inline-block;width: 220px;height: 20px;line-height: 20px;vertical-align: middle;">
|
||||
<span class="text-general-color" v-html="item.name"></span>
|
||||
|
||||
<span class="text-second-color" style="font-size:12px;-webkit-transform: scale(0.9);">{{item.role}}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<div class="text-general-color category-title"><p style="padding-left: 5px;" v-html="'梳理用户(' + data2.length + ')'"></p></div>
|
||||
<template v-for="item in data2">
|
||||
<div style="display: inline;margin-right: 40px;" @mouseenter="enter(item.id, '1')" @mouseleave="leave(item.id, '1')">
|
||||
<el-card shadow="hover" style="width: 300px;display: inline-block;margin-top: 15px;">
|
||||
<div style="display: inline-block;width: 15px;margin-left: 5px;height: 20px;line-height: 20px;vertical-align: middle;">
|
||||
<div :style="{'display': (item.showCheckBox || item.checked) ? 'inline-block' : 'none'}">
|
||||
<el-checkbox v-model="item.checked" @change="handleCheckChange(item.id, '0')"></el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: inline;width: 30px;margin: 0 15px;">
|
||||
<img class="user_photo_img radius3" :src="item.userPhoto">
|
||||
</div>
|
||||
<div class="text-over-hidden" style="display: inline-block;width: 220px;height: 20px;line-height: 20px;vertical-align: middle;">
|
||||
<span class="text-general-color" v-html="item.name"></span>
|
||||
|
||||
<span class="text-second-color" style="font-size:12px;-webkit-transform: scale(0.9);">{{item.role}}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</el-main>
|
||||
<el-footer v-show="showFooter" :height="footerHeight">
|
||||
<div style="border-top: 1px solid #F2F2F2;height: 44px;">
|
||||
<div style="padding: 8px;margin-left: 20px;">
|
||||
<el-checkbox style="margin-right: 10px;" :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
|
||||
<awsui-button style="width: 100px;" class="button-general-color" type="primary" @click="changeRole()">变更角色</awsui-button>
|
||||
<awsui-button style="width: 100px;" class="button-general-color-reverse2" plain @click="removeUsers()">删除用户</awsui-button>
|
||||
<awsui-button style="width: 100px;" class="button-general-color-reverse3" plain @click="closeFooter">取消</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-footer>
|
||||
<el-drawer
|
||||
id="drawer"
|
||||
ref="drawer"
|
||||
title="添加用户"
|
||||
:visible.sync="drawerVisible"
|
||||
custom-class="text-general-color"
|
||||
:destroy-on-close=true
|
||||
:wrapperClosable=false
|
||||
size="700px"
|
||||
direction="rtl"
|
||||
:before-close="handleDrawerClose"
|
||||
@opened="handleOpenedDrawer">
|
||||
<div id="drawerDiv" style="width: 100%;height: 100%;border-top: 1px solid #F2F2F2;">
|
||||
<div :style="{'height': drawerMainHeight, 'overflow': 'auto', 'margin': '10px 20px'}">
|
||||
<div class="text-general-color category-title"><p style="padding-left: 5px;">管理用户</p></div>
|
||||
<el-input size="medium" readonly placeholder="请选择" @click.native="choiceBpmOrgUser('0')"></el-input>
|
||||
<p style="margin: 10px 0;" v-html="'已选择('+ drawerData1.length +')'"></p>
|
||||
<div>
|
||||
<template v-for="item in drawerData1">
|
||||
<div :name="item.id" class="row">
|
||||
<div class="text-over-hidden" style="display: inline-block;width: 88%;">
|
||||
<span>{{item.name}}</span>
|
||||
</div>
|
||||
<div class="operate-icon-display" style="position: relative;top: -6px;">
|
||||
<i style="display: inline-block;cursor: pointer;" class="awsui-iconfont" @click="removeDrawerUser(item.id, '0')"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="text-general-color category-title"><p style="padding-left: 5px;">梳理用户</p></div>
|
||||
<el-input size="medium" readonly placeholder="请选择" @click.native="choiceBpmOrgUser('1')"></el-input>
|
||||
<p style="margin: 10px 0;"v-html="'已选择('+ drawerData2.length +')'"></p>
|
||||
<div>
|
||||
<template v-for="item in drawerData2">
|
||||
<div :name="item.id" class="row">
|
||||
<div class="text-over-hidden" style="display: inline-block;width: 88%;">
|
||||
<span>{{item.name}}</span>
|
||||
</div>
|
||||
<div class="operate-icon-display" style="position: relative;top: -6px;">
|
||||
<i style="display: inline-block;cursor: pointer;" class="awsui-iconfont" @click="removeDrawerUser(item.id, '1')"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div id="drawerFooter" :style="{'height': drawerFooterHeight, 'visibility': 'hidden', 'background-color': '#F5F7FA'}">
|
||||
<div style="margin-top: 10px;margin-right: 5px;float: right;">
|
||||
<awsui-button style="width: 100px;" class="button-general-color" type="primary" @click="saveDrawer">保存</awsui-button>
|
||||
<awsui-button style="width: 100px;" class="button-general-color-reverse3" plain @click="closeDrawer">取消</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<BPMOrgAddress
|
||||
ref="bpmOrgAddress"
|
||||
:visible.sync="bpmOrg.visible"
|
||||
:addressType="bpmOrg.addressType"
|
||||
:highSecurityFilter="bpmOrg.highSecurityFilter"
|
||||
:multiple=true
|
||||
v-on:cancel="bpmOrg.visible = false"
|
||||
v-on:getResult="saveBpmOrgCompnentResult"
|
||||
:title="bpmOrg.title"
|
||||
></BPMOrgAddress>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
import BPMOrgAddress from "../../components/common/BPMOrgAddress/component";
|
||||
export default {
|
||||
name: "User",
|
||||
components: {BPMOrgAddress},
|
||||
data() {
|
||||
return {
|
||||
headerHeight: '50px',
|
||||
footerHeight: '45px',
|
||||
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 50 - (this.showFooter ? 45 : 0)) + 'px',
|
||||
searchInput: '',
|
||||
isIndeterminate: true,
|
||||
checkAll: false,
|
||||
showFooter: false,
|
||||
data1: [],
|
||||
dataTemp1: [],
|
||||
data2: [],
|
||||
dataTemp2: [],
|
||||
drawerVisible: false,
|
||||
drawerMainHeight: '0px',
|
||||
drawerFooterHeight: '50px',
|
||||
drawerData1: [],
|
||||
drawerData2: [],
|
||||
bpmOrg: {
|
||||
visible: false,
|
||||
addressType: "user",
|
||||
title: "选择用户",
|
||||
highSecurityFilter: 'sysAdmin,auditor',
|
||||
source: '0'// 组件是由谁触发的,0 管理员选择用户,1普通用户选择用户
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {// 初始化数据查询
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_user_data_query'
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
const data1 = ro.data.data1;
|
||||
for (let i = 0; i < data1.length; i++) {
|
||||
data1[i].checked = false;
|
||||
data1[i].showCheckBox = false;
|
||||
}
|
||||
const data2 = ro.data.data2;
|
||||
for (let i = 0; i < data2.length; i++) {
|
||||
data2[i].checked = false;
|
||||
data2[i].showCheckBox = false;
|
||||
}
|
||||
that.data1 = data1;
|
||||
that.data2 = data2;
|
||||
that.dataTemp1 = JSON.parse(JSON.stringify(that.data1));
|
||||
that.dataTemp2 = JSON.parse(JSON.stringify(that.data2));
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
enter(id, type) {// 鼠标进入卡片
|
||||
if (type == '0') {
|
||||
for (let i = 0; i < this.data1.length; i++) {
|
||||
if (this.data1[i].id == id) {
|
||||
this.data1[i].showCheckBox = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type == '1') {
|
||||
for (let i = 0; i < this.data2.length; i++) {
|
||||
if (this.data2[i].id == id) {
|
||||
this.data2[i].showCheckBox = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
leave(id, type) {// 鼠标移出卡片
|
||||
if (type == '0') {
|
||||
for (let i = 0; i < this.data1.length; i++) {
|
||||
if (this.data1[i].id == id) {
|
||||
this.data1[i].showCheckBox = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type == '1') {
|
||||
for (let i = 0; i < this.data2.length; i++) {
|
||||
if (this.data2[i].id == id) {
|
||||
this.data2[i].showCheckBox = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCheckChange(id) {// 多选变更
|
||||
const that = this;
|
||||
let count = 0;
|
||||
for (let i = 0; i < that.data1.length; i++) {
|
||||
const curr = that.data1[i];
|
||||
if (curr.checked) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < that.data2.length; i++) {
|
||||
const curr = that.data2[i];
|
||||
if (curr.checked) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
that.isIndeterminate = count > 0 && count < (that.data1.length + that.data2.length);
|
||||
that.checkAll = count == that.data1.length + that.data2.length;
|
||||
that.showFooter = count > 0;
|
||||
},
|
||||
handleCheckAllChange(val) {// 全选变更
|
||||
if (val) {// 全选
|
||||
for (let i = 0; i < this.data1.length; i++) {
|
||||
this.data1[i].checked = true;
|
||||
}
|
||||
for (let i = 0; i < this.data2.length; i++) {
|
||||
this.data2[i].checked = true;
|
||||
}
|
||||
} else {// 取消全选
|
||||
for (let i = 0; i < this.data1.length; i++) {
|
||||
this.data1[i].checked = false;
|
||||
}
|
||||
for (let i = 0; i < this.data2.length; i++) {
|
||||
this.data2[i].checked = false;
|
||||
}
|
||||
this.showFooter = false;
|
||||
}
|
||||
this.isIndeterminate = false;
|
||||
},
|
||||
changeRole() {// 一键变更角色
|
||||
const changeIds = [];
|
||||
for (let i = 0; i < this.data1.length; i++) {
|
||||
if (this.data1[i].checked) {
|
||||
changeIds.push(this.data1[i].id);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.data2.length; i++) {
|
||||
if (this.data2[i].checked) {
|
||||
changeIds.push(this.data2[i].id);
|
||||
}
|
||||
}
|
||||
if (changeIds.length == 0) {
|
||||
this.$message({message: '请选择需要变更角色的用户',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
// 三员模式下安全保密员不允许删除
|
||||
var secAdminUsers = this.getSecAdminUsers(changeIds);
|
||||
if (secAdminUsers[0].length > 0) {
|
||||
this.$message({message: '三员模式下安全保密员用户' + secAdminUsers[1].join('、') + '不允许变更',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (changeIds.indexOf('admin') > -1) {
|
||||
this.$message({message: 'admin管理员用户不允许变更',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
// 变更
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_user_role_change',
|
||||
userIds: changeIds.join(',')
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
if (ro.data.isExit) {// 将自己从管理员变更为普通用户,退出系统
|
||||
that.$message({
|
||||
message: '变更成功,即将退出系统',
|
||||
type: 'warning',
|
||||
onClose: function() {
|
||||
const src = wHref + "?sid=" + that.$store.state.sessionId + "&cmd=com.actionsoft.apps.coe.pal_user_logout";
|
||||
window.location.replace(src);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
that.$message({
|
||||
message: '变更成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.closeFooter();
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
removeUsers() {// 删除用户
|
||||
const removeIds = [];
|
||||
for (let i = 0; i < this.data1.length; i++) {
|
||||
if (this.data1[i].checked) {
|
||||
removeIds.push(this.data1[i].id);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.data2.length; i++) {
|
||||
if (this.data2[i].checked) {
|
||||
removeIds.push(this.data2[i].id);
|
||||
}
|
||||
}
|
||||
if (removeIds.length == 0) {
|
||||
this.$message({message: '请选择需要删除的用户',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
// 三员模式下安全保密员不允许删除
|
||||
var secAdminUsers = this.getSecAdminUsers(removeIds);
|
||||
if (secAdminUsers[0].length > 0) {
|
||||
this.$message({message: '三员模式下安全保密员用户' + secAdminUsers[1].join('、') + '不允许删除',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (removeIds.indexOf('admin') > -1) {
|
||||
this.$message({message: 'admin管理员用户不允许删除',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
// 删除
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_user_remove',
|
||||
userIds: removeIds.join(',')
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.closeFooter();
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
closeFooter() {// 关闭底部操作栏
|
||||
this.handleCheckAllChange(false);
|
||||
},
|
||||
searchUser() {// 搜索
|
||||
this.closeFooter();
|
||||
if (this.searchInput && this.searchInput.trim() != '') {// 根据条件搜索
|
||||
const data1 = [];
|
||||
for (let i = 0; i < this.dataTemp1.length; i++) {
|
||||
if (this.dataTemp1[i].name.indexOf(this.searchInput) > -1) {
|
||||
const temp = JSON.parse(JSON.stringify(this.dataTemp1[i]));
|
||||
temp.name = temp.name.replace(new RegExp(this.searchInput,'g'), '<span style="color: #4E7FF9">' + this.searchInput + '</span>');
|
||||
data1.push(temp);
|
||||
}
|
||||
}
|
||||
this.data1 = data1;
|
||||
const data2 = [];
|
||||
for (let i = 0; i < this.dataTemp2.length; i++) {
|
||||
if (this.dataTemp2[i].name.indexOf(this.searchInput) > -1) {
|
||||
const temp = JSON.parse(JSON.stringify(this.dataTemp2[i]));
|
||||
temp.name = temp.name.replace(new RegExp(this.searchInput,'g'), '<span style="color: #4E7FF9">' + this.searchInput + '</span>');
|
||||
data2.push(temp);
|
||||
}
|
||||
}
|
||||
this.data2 = data2;
|
||||
} else {// 显示全部
|
||||
this.data1 = this.dataTemp1;
|
||||
this.data2 = this.dataTemp2;
|
||||
}
|
||||
},
|
||||
addUser() {// 新增用户
|
||||
this.drawerVisible = true;
|
||||
},
|
||||
handleDrawerClose(done) {
|
||||
done();
|
||||
},
|
||||
handleOpenedDrawer() {// 打开抽屉之后执行,加载现有用户数据
|
||||
this.drawerMainHeight = (document.getElementById('drawer').offsetHeight - parseInt(this.drawerFooterHeight)) - 64 - 20 + 'px';
|
||||
document.getElementById('drawerFooter').style.visibility = "visible";
|
||||
// 初始化数据
|
||||
// 获取现有的用户,tempdata1,tempdata2,
|
||||
this.drawerData1 = JSON.parse(JSON.stringify(this.dataTemp1));
|
||||
this.drawerData2 = JSON.parse(JSON.stringify(this.dataTemp2));
|
||||
},
|
||||
removeDrawerUser(userId, type) {// 在抽屉中临时删除
|
||||
if (type == '0' && userId == 'admin') {
|
||||
this.$message({message: 'admin管理员用户不允许删除',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
// 三员模式下安全保密员不允许删除
|
||||
if (type == '0') {
|
||||
var secAdminUsers = this.getSecAdminUsers([userId]);
|
||||
if (secAdminUsers[0].length > 0) {
|
||||
this.$message({message: '三员模式下安全保密员用户[' + secAdminUsers[1].join('、') + ']不允许删除',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 临时删除抽屉数据
|
||||
let data = [];
|
||||
if (type == '0') {
|
||||
data = this.drawerData1;
|
||||
} else if (type == '1') {
|
||||
data = this.drawerData2;
|
||||
}
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (userId == data[i].id) {
|
||||
data.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
saveDrawer() {// 保存drawer结果
|
||||
// 校验
|
||||
// admin必须包含在管理员内
|
||||
// let isValid = false;
|
||||
// for (let i = 0; i < this.drawerData1.length; i++) {
|
||||
// if (this.drawerData1[i].id == 'admin') {
|
||||
// isValid = true;
|
||||
// }
|
||||
// }
|
||||
// if (!isValid) {
|
||||
// this.$message({message: '校验失败,admin管理员用户不允许变更角色、删除',type: 'warning'});
|
||||
// return;
|
||||
// }
|
||||
const managerUsers = [];// 管理用户
|
||||
const generalUsers = [];// 普通用户
|
||||
for (let i = 0; i < this.drawerData1.length; i++) {
|
||||
managerUsers.push(this.drawerData1[i].id);
|
||||
}
|
||||
for (let i = 0; i < this.drawerData2.length; i++) {
|
||||
generalUsers.push(this.drawerData2[i].id);
|
||||
if (managerUsers.indexOf(this.drawerData2[i].id) > -1) {
|
||||
this.$message({message: '用户[' + this.drawerData2[i].name + ']不能同时设置为管理员和普通用户',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const that = this;
|
||||
// 保存
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_user_save',
|
||||
managerUsers: managerUsers.join(','),
|
||||
generalUsers: generalUsers.join(',')
|
||||
}
|
||||
};
|
||||
// 查询数据
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if(ro.result == 'ok') {
|
||||
that.$message({message: '保存成功',type: 'success'});
|
||||
that.closeDrawer();// 关闭抽屉
|
||||
that.showFooter = false;
|
||||
that.initData();// 初始化数据
|
||||
} else if (ro.result == 'warning'){
|
||||
that.$message({message: ro.msg,type: 'warning'});
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
closeDrawer() {// 关闭
|
||||
this.$refs.drawer.closeDrawer();
|
||||
},
|
||||
choiceBpmOrgUser(source) {// 选择用户
|
||||
this.bpmOrg.source = source;
|
||||
this.bpmOrg.visible = true;
|
||||
},
|
||||
saveBpmOrgCompnentResult(data) {// 保存bpm选择结果
|
||||
this.bpmOrg.visible = false;
|
||||
let temp = [];
|
||||
if (this.bpmOrg.source == '0') {// 添加到管理员
|
||||
temp = this.drawerData1;
|
||||
} else {
|
||||
temp = this.drawerData2;
|
||||
}
|
||||
const repeatIds = [];
|
||||
for (let i = 0; i < temp.length; i++) {
|
||||
for (let j = 0; j < data.length; j++) {
|
||||
if (temp[i].id == data[j].id) {
|
||||
repeatIds.push(temp[i].id);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (repeatIds.indexOf(data[i].id) < 0) {
|
||||
temp.push(data[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
getSecAdminUsers(userIds) {// 检查并获取给定用户的安全保密员用户
|
||||
let result = [[],[]];
|
||||
for (let i = 0; i < this.dataTemp1.length; i++) {
|
||||
if (this.dataTemp1[i].isSecAdminUser && userIds.indexOf(this.dataTemp1[i].id) > -1) {
|
||||
result[0].push(this.dataTemp1[i].id);
|
||||
result[1].push(this.dataTemp1[i].name);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.dataTemp2.length; i++) {
|
||||
if (this.dataTemp2[i].isSecAdminUser && userIds.indexOf(this.dataTemp2[i].id) > -1) {
|
||||
result[0].push(this.dataTemp2[i].id);
|
||||
result[1].push(this.dataTemp2[i].name);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - 50 - (this.showFooter ? 45 : 0)) + 'px'
|
||||
if (this.drawerVisible) {// drawer高度自适应
|
||||
this.drawerMainHeight = (document.getElementById('drawer').offsetHeight - parseInt(this.drawerFooterHeight)) - 64 - 20 + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#user >>> .el-main {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
#user >>> .el-footer {
|
||||
padding: 0;
|
||||
}
|
||||
#user >>> .el-card__body {
|
||||
padding: 10px 0;
|
||||
}
|
||||
#user >>> .el-drawer__header {
|
||||
margin-bottom: 17px;
|
||||
color: #606266;
|
||||
font-size: 17px;
|
||||
}
|
||||
#drawerDiv .row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#drawerDiv .row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
#drawerDiv .row:hover{
|
||||
background-color: #F5F7FA;
|
||||
}
|
||||
.row {
|
||||
display: inline-block;
|
||||
width: 155px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
border-right: 1px solid #F2F2F2;
|
||||
padding-left: 4px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.category-title {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
vertical-align: center;
|
||||
margin: 10px 10px 5px 0px;
|
||||
border-left: 3px solid #4E7FF9;
|
||||
}
|
||||
.user_photo_img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
top: -0px;
|
||||
}
|
||||
.text-over-hidden {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
63
com.actionsoft.apps.coe.pal/views/workspace/Workspace.vue
Normal file
63
com.actionsoft.apps.coe.pal/views/workspace/Workspace.vue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div style="height: 100%;">
|
||||
<!--空白页面-->
|
||||
<div style="width:100%;height: 100%;">
|
||||
<div style="width: 300px;height: 300px;margin: auto;position: relative;top: 35%">
|
||||
<div style="text-align: center;">
|
||||
<span><i class="iconfont" style="color: #C2C2C2;font-size: 60px;"></i></span>
|
||||
<p class="text-general-color" style="margin: 15px 0;">您还没添加任何资产库!</p>
|
||||
</div>
|
||||
<div style="text-align:center;">
|
||||
<awsui-button class="button-general-color text-general-color" type="primary" @click="createWs">新建</awsui-button>
|
||||
<awsui-button class="button-general-color-reverse" @click="importWs">导入</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<WorkspaceUpdate ref="workspaceUpdate"></WorkspaceUpdate>
|
||||
</div>
|
||||
<div>
|
||||
<WorkspaceImport ref="workspaceImport"></WorkspaceImport>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import WorkspaceUpdate from "./WorkspaceUpdate";
|
||||
import WorkspaceImport from "./WorkspaceImport";
|
||||
import {newPageWin} from "../../api/commonFun";
|
||||
|
||||
export default {
|
||||
name: "Workspace",
|
||||
components : {WorkspaceImport, WorkspaceUpdate},
|
||||
data() {
|
||||
return {
|
||||
wsId : ''
|
||||
}
|
||||
},
|
||||
provide: function () {
|
||||
return {
|
||||
// openUpdateWsDlg: this.openUpdateWsDlg
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
createWs() {// 新建资产库
|
||||
this.$refs.workspaceUpdate.openUpdateWsDlg('create', this.wsId, this);
|
||||
},
|
||||
importWs() {// 导入资产库
|
||||
this.$refs.workspaceImport.openImportWsDlg(this);
|
||||
},
|
||||
updateWorkspaceCallback() {// 新建、更新资产库回调函数
|
||||
newPageWin('palMain', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
|
||||
},
|
||||
importWorkspaceCallback() {// 导入资产库回调函数
|
||||
newPageWin('palMain', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
399
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceBackup.vue
Normal file
399
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceBackup.vue
Normal file
@ -0,0 +1,399 @@
|
||||
<template>
|
||||
<el-container id="workspaceBackUp">
|
||||
<el-header style="height: 50px;">
|
||||
<div style="margin: 10px;">
|
||||
<awsui-button style="width: 130px;" class="button-general-color" type="primary" @click="createBackup()">新建备份</awsui-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-table
|
||||
id="workspaceBackupTable"
|
||||
ref="workspaceBackupTable"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
:height="tableHeight">
|
||||
<el-table-column
|
||||
prop="time"
|
||||
label="备份时间"
|
||||
width="250">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="user"
|
||||
label="操作用户"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
min-width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operation"
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.state != 0 && scope.row.state != 2 && scope.row.state != 3">
|
||||
<el-tooltip class="item" content="修改" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="update(scope.row.id, scope.row.remark)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" content="恢复" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="recover(scope.row.id, scope.row.time)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" content="导出" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="exportBackup(scope.row.id)"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" content="删除" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="deleteBackup(scope.row.id, scope.row.time)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="scope.row.state == 0">
|
||||
<el-tooltip class="item" content="正在备份..." placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: default;"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="scope.row.state == 2">
|
||||
<el-tooltip class="item" content="备份失败" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: default;"></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" content="删除" placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: pointer;" @click="deleteBackup(scope.row.id, scope.row.time)"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="scope.row.state == 3">
|
||||
<el-tooltip class="item" content="正在恢复..." placement="bottom" :hide-after=2000>
|
||||
<i class="awsui-iconfont" style="cursor: default;"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog
|
||||
title="资产库备份"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
:modal-append-to-body=false
|
||||
:close-on-click-modal=false>
|
||||
<div style="margin-bottom: 10px;">
|
||||
<label>备注</label>
|
||||
</div>
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
v-model="updateRemark"
|
||||
maxlength="200"
|
||||
:rows=5
|
||||
show-word-limit>
|
||||
</el-input>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" :disabled=false type="primary" @click="save">确定</awsui-button>
|
||||
<awsui-button @click="closeDlg">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "WorkspaceBackup",
|
||||
data() {
|
||||
return {
|
||||
tableHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 22 - 50) + 'px',
|
||||
tableData: [],
|
||||
dialogVisible: false,
|
||||
updateType: 'create',// 新增、修改的类型
|
||||
updateId: '',// 修改时的id
|
||||
updateRemark: '',// 新增、修改的备注
|
||||
exportProgressTimeout: '', // 导出备份轮询状态,用于完成轮询后清除定时器
|
||||
stateInterval: ''// 定时刷新器
|
||||
}
|
||||
},
|
||||
props: ['wsId'],
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// alert('a')
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
that.initData();
|
||||
setTimeout(function(){
|
||||
that.stateInterval = setInterval(function(){
|
||||
that.refreshState();
|
||||
}, 1000);
|
||||
}, 2000);
|
||||
|
||||
},
|
||||
methods: {
|
||||
initData(scrollTop) {// 初始化
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_ws_backup_data_query',
|
||||
wsId: that.wsId
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
let data = ro.data;
|
||||
that.tableData = data;
|
||||
if (scrollTop == undefined || scrollTop) {
|
||||
that.$refs.workspaceBackupTable.bodyWrapper.scrollTop = 0;
|
||||
}
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
createBackup() {// 新建备份
|
||||
this.updateRemark = '';
|
||||
this.updateId = '';
|
||||
this.updateType = 'create';
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
update(id, remark) {
|
||||
this.updateRemark = remark;
|
||||
this.updateId = id;
|
||||
this.updateType = 'update';
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
save() {// 新增、修改的保存
|
||||
const that = this;
|
||||
if (that.updateRemark.trim() == '') {
|
||||
that.$message({message: '[备注]不允许为空', type: 'warning'});
|
||||
return false;
|
||||
}
|
||||
if (that.updateType == 'create') {// 创建新的备份
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_add',
|
||||
wsId: that.wsId,
|
||||
remark: that.updateRemark
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.initData();
|
||||
that.closeDlg();
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
} else {// 修改备注
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_update',
|
||||
id: that.updateId,
|
||||
remark: that.updateRemark
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.$message({message: '修改成功',type: 'success'});
|
||||
that.initData();
|
||||
that.closeDlg();
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
recover(id, time) {
|
||||
const that = this;
|
||||
that.$confirm('恢复后,当前数据无法找回,请先备份当前数据!要继续恢复[' + time + ']的备份吗?', '提示', {
|
||||
confirmButtonText: '是,已经备份',
|
||||
cancelButtonText: '否,去备份',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_recover',
|
||||
wsId: that.wsId,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.initData(false);
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
that.createBackup();
|
||||
});
|
||||
},
|
||||
exportBackup(id) {
|
||||
const that = this;
|
||||
// 生成bak文件
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_export',
|
||||
wsId: that.wsId,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.exportProgressTimeout = setInterval(function(){that.exportBackupProgress(id)}, 2000);
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
exportBackupProgress(id) {// 查询是否备份完成
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_export_progress',
|
||||
wsId: that.wsId,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (r) {
|
||||
if(r.data.progress == "finish") {
|
||||
//已经生成bak,可系统下载
|
||||
clearTimeout(that.exportProgressTimeout);
|
||||
that.exportProgressTimeout = '';
|
||||
that.exportBackupDownload(id);
|
||||
} else if(r.data.progress == "byhand") {
|
||||
//已经生成bak,需手工下载
|
||||
clearTimeout(that.exportProgressTimeout);
|
||||
that.exportProgressTimeout = '';
|
||||
$.simpleAlert("close");
|
||||
var filename = that.wsId + ".bak";
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '文件过大,请联系管理员在服务器/doccenter/com.actionsoft.apps.coe.pal/tmp/exp/repository目录下获取备份文件' + filename,
|
||||
duration: 0,
|
||||
});
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
exportBackupDownload(id) {// 下载备份文件
|
||||
const that = this;
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_export_download',
|
||||
wsId: that.wsId,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
window.open(ro.data.downloadUrl);
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
deleteBackup(id, time) {
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_delete',
|
||||
wsId: that.wsId,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (ro) {
|
||||
that.$message({type: 'success',message: '删除成功!'});
|
||||
for (let i = 0; i < that.tableData.length; i++) {
|
||||
if (that.tableData[i].id == id) {
|
||||
that.tableData.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
done();
|
||||
},
|
||||
closeDlg() {
|
||||
this.dialogVisible = false;
|
||||
this.updateRemark = '';
|
||||
this.updateType = 'create';
|
||||
this.updateId = '';
|
||||
},
|
||||
refreshState() {// 查询
|
||||
const that = this;
|
||||
for (let i = 0; i < that.tableData.length; i++) {
|
||||
const data = that.tableData[i];
|
||||
if (data.state == 0 || data.state == 3) {
|
||||
// 查询状态
|
||||
const params = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd: 'com.actionsoft.apps.coe.pal_backup_state',
|
||||
wsId: that.wsId,
|
||||
id: data.id
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(params).then(function (r) {
|
||||
that.tableData[i].state = r.data.state;
|
||||
if (r.data.state == 4) {
|
||||
that.$message({message: '恢复成功',type: 'success'});
|
||||
setTimeout(function() {
|
||||
// 刷新首页
|
||||
location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.tableHeight = (parseInt(newd)) - 22 - 50 + 'px';
|
||||
}
|
||||
},
|
||||
beforeDestroy:function(){
|
||||
clearInterval(this.stateInterval);
|
||||
clearInterval(this.exportProgressTimeout);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#workspaceBackUp >>> .el-main {
|
||||
display: block;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
-ms-flex-preferred-size: auto;
|
||||
flex-basis: auto;
|
||||
overflow: auto;
|
||||
padding: 0px 20px 0px;
|
||||
}
|
||||
#workspaceBackUp >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
#workspaceBackupTable >>> .item {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
311
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceImport.vue
Normal file
311
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceImport.vue
Normal file
@ -0,0 +1,311 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入资产库"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal=false
|
||||
:destroy-on-close=true
|
||||
width="450px"
|
||||
:before-close="handleClose"
|
||||
@closed="restoreParam" class="workspace-import">
|
||||
<div v-show="step1" id="step1" style="height: 250px;text-align: center;">
|
||||
<div style="position: relative;top:35%;">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<awsui-button style="width: 130px;" :class="{'button-general-color': clickUploadButton == 'local', 'button-general-color-reverse': clickUploadButton == 'server'}" :type="clickUploadButton == 'local' ? 'primary' : ''" @click="localImport(true, true)">本地文件上传</awsui-button>
|
||||
</div>
|
||||
<div>
|
||||
<awsui-button style="width: 130px;" :class="{'button-general-color': clickUploadButton == 'server', 'button-general-color-reverse': clickUploadButton == 'local'}" :type="clickUploadButton == 'server' ? 'primary' : ''" @click="serverImport(true, true)">服务器文件导入</awsui-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="step2" id="step2" style="height: 250px;" v-loading="loading">
|
||||
<div style="text-align: center;padding-top: 30px;">
|
||||
<awsui-button style="width: 130px;" :class="{'button-general-color': clickUploadButton == 'local', 'button-general-color-reverse': clickUploadButton == 'server'}" :type="clickUploadButton == 'local' ? 'primary' : ''" @click="localImport(false, true)">本地文件上传</awsui-button>
|
||||
<awsui-button style="width: 130px;" :class="{'button-general-color': clickUploadButton == 'server', 'button-general-color-reverse': clickUploadButton == 'local'}" :type="clickUploadButton == 'server' ? 'primary' : ''" @click="serverImport(true, true)">服务器文件导入</awsui-button>
|
||||
</div>
|
||||
<div v-show="source == 'local'" style="height:100px;margin: 10px 10px;">
|
||||
<PALUpload ref="palUpload" style="width: 100%;"
|
||||
class="upload-demo"
|
||||
appId="com.actionsoft.apps.coe.pal"
|
||||
repositoryName="tmp"
|
||||
groupValue="Normal"
|
||||
fileValue="Normal"
|
||||
:on-preview="handlePreview"
|
||||
:on-success="handleSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:on-error="handleError"
|
||||
:before-remove="beforeRemove"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
accept=".bak"
|
||||
:file-list="fileList">
|
||||
<div style="display: none;">
|
||||
<awsui-button id="selectFileButton" style="width: 130px;" class="button-general-color" type="primary">本地文件上传</awsui-button>
|
||||
</div>
|
||||
</PALUpload>
|
||||
</div>
|
||||
<div v-show="source == 'remote'" style="height:70px;margin: 40px 10px 0px 10px;">
|
||||
<el-select style="width: 100%" v-model="serverValue" placeholder="请选择" size="mini" no-data-text="无资产库文件" @change="changeServerValue">
|
||||
<el-option
|
||||
v-for="item in serverOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div v-show="wsIsExist" style="margin: 10px;">
|
||||
<el-form>
|
||||
<el-form-item label="已存在资产库处理方法" prop="resource">
|
||||
<el-radio-group v-model="replaceType">
|
||||
<el-radio label="replace">替换</el-radio>
|
||||
<el-radio label="skip">跳过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" :disabled="buttonDisabled" type="primary" @click="save">确定</awsui-button>
|
||||
<awsui-button @click="cancel()">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PALUpload from "@/components/common/upload/index.vue";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "WorkspaceImport",
|
||||
components: {PALUpload},
|
||||
data() {
|
||||
return {
|
||||
buttonDisabled : false,
|
||||
dialogVisible : false,
|
||||
clickUploadButton: 'local',
|
||||
step1 : true,
|
||||
step2 : false,
|
||||
source : '',
|
||||
wsIsExist : false,
|
||||
fileList: [],
|
||||
serverOptions: [],
|
||||
serverValue: '',
|
||||
replaceType: 'replace',
|
||||
wsFileName: '',
|
||||
loading: false,
|
||||
obj: null //导入成功后回调的vue页面
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openImportWsDlg(obj) {
|
||||
this.dialogVisible = true;
|
||||
this.obj = obj;
|
||||
},
|
||||
handleClose(done) {
|
||||
done();
|
||||
},
|
||||
restoreParam() {// 关闭后数据初始化
|
||||
this.buttonDisabled = false;
|
||||
this.loading = false;
|
||||
this.dialogVisible = false;
|
||||
this.step1 = true;
|
||||
this.step2 = false;
|
||||
this.source = '';
|
||||
this.wsIsExist = false;
|
||||
this.fileList = [];
|
||||
this.serverOptions = [];
|
||||
this.serverValue = '';
|
||||
this.replaceType = 'replace';
|
||||
this.wsFileName = '';
|
||||
},
|
||||
cancel() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
changeServerValue() {
|
||||
const that = this;
|
||||
that.wsIsExist = false;
|
||||
that.replaceType = 'replace';
|
||||
that.wsFileName = that.serverValue;
|
||||
that.loading=true;
|
||||
that.buttonDisabled = true;
|
||||
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_is_exist',
|
||||
wsFileName : that.wsFileName,
|
||||
source : that.source
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
if (ro.data.message == "exist") {
|
||||
that.replaceType = 'replace';
|
||||
that.wsIsExist = true;
|
||||
} else {
|
||||
that.replaceType = 'replace';
|
||||
that.wsIsExist = false;
|
||||
}
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
that.loading = false;
|
||||
that.buttonDisabled = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
localImport(changeStep2, openFileSelect) {
|
||||
this.clickUploadButton = 'local';
|
||||
if (openFileSelect) {// 打开文件选择
|
||||
this.$refs.palUpload.clearFiles();
|
||||
this.source = 'local';
|
||||
document.getElementById("selectFileButton").click();
|
||||
}
|
||||
if (changeStep2) {
|
||||
this.step1 = false;
|
||||
this.step2 = true;
|
||||
}
|
||||
this.wsIsExist = false;
|
||||
this.replaceType = 'replace';
|
||||
this.wsFileName = '';
|
||||
},
|
||||
serverImport(changeStep2) {
|
||||
this.clickUploadButton = 'server';
|
||||
// 查询服务器中是否存在需要导入的资产库文件
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_remote_import_query'
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
that.serverOptions = ro.data.impRepsitorys;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
if (changeStep2) {
|
||||
that.step1 = false;
|
||||
that.step2 = true;
|
||||
}
|
||||
// 获取服务器中已经上传好的资产库文件
|
||||
that.serverOptions = [];
|
||||
that.serverValue = '';
|
||||
that.source = 'remote';
|
||||
that.wsIsExist = false;
|
||||
that.replaceType = 'replace';
|
||||
that.wsFileName = '';
|
||||
},
|
||||
save() {
|
||||
const that = this;
|
||||
if (that.wsFileName == '') {
|
||||
that.$message({message: '请'+ (that.clickUploadButton == 'local' ? '上传' : '选择') + '需要导入的文件', type: 'warning'});
|
||||
return;
|
||||
}
|
||||
that.buttonDisabled = true;
|
||||
that.loading = true;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_save_import',
|
||||
wsFileName : that.wsFileName,
|
||||
replaceChoice : that.replaceType,
|
||||
source : that.source
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
console.log("导入资产库[" + ro.data.wsName + "][" + ro.data.wsId + "]成功")
|
||||
that.$message({
|
||||
message: ro.msg,
|
||||
duration: 2000,
|
||||
type: 'success'
|
||||
});
|
||||
that.cancel();
|
||||
if (that.obj != null) {
|
||||
that.obj.importWorkspaceCallback();
|
||||
}
|
||||
} else {
|
||||
that.loading = false;
|
||||
that.buttonDisabled = false;
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
|
||||
handleExceed(files, fileList) {
|
||||
|
||||
},
|
||||
handleError(err, file, fileList) {
|
||||
},
|
||||
beforeUpload(file) {
|
||||
// 上传之前校验判断大小
|
||||
if (file.size / 1024 / 1024 > 2048) { //文件大于2G
|
||||
this.$message.warning('文件过大,请联系管理员将需上传的文件放在在服务器/doccenter/com.actionsoft.apps.coe.pal/tmp/imp/repository目录下使用服务器上传方式上传');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const that = this;
|
||||
that.buttonDisabled = true;
|
||||
that.loading = true;
|
||||
that.wsFileName = file.name;
|
||||
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_is_exist',
|
||||
wsFileName : that.wsFileName,
|
||||
source : that.source
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
if (ro.data.message == "exist") {
|
||||
that.replaceType = 'replace';
|
||||
that.wsIsExist = true;
|
||||
} else {
|
||||
that.replaceType = 'replace';
|
||||
that.wsIsExist = false;
|
||||
}
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
that.buttonDisabled = false;
|
||||
that.loading = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
if (file.status == 'success') {
|
||||
// 删除之前,进行服务器文件删除
|
||||
}
|
||||
this.wsFileName = '';
|
||||
this.wsIsExist = false;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.workspace-import >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
234
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceManage.vue
Normal file
234
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceManage.vue
Normal file
@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<el-container id="workspaceManage">
|
||||
<el-main id="workspaceManageMain" style="height: 100%;">
|
||||
<el-table
|
||||
id="workspaceManageTable"
|
||||
ref="workspaceManageTable"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
:height="tableHeight">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="资产库"
|
||||
min-width="250">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<div>
|
||||
<p class="text-general-color">
|
||||
{{scope.row.name}}
|
||||
</p>
|
||||
</div>
|
||||
<div style="display:table;">
|
||||
<p class="text-second-color" style="font-size: 12px;">
|
||||
{{scope.row.desc}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="admin"
|
||||
label="管理员"
|
||||
min-width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="count"
|
||||
label="文件量"
|
||||
min-width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="open"
|
||||
label="启用"
|
||||
min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
v-model="scope.row.open"
|
||||
active-color="#4E7FF9"
|
||||
inactive-color="#E2E2E2"
|
||||
@change="changeWsStatus(scope.row.wsId, scope.row.name, scope.row.open)">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operation"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div class="operate-icon-display">
|
||||
<i v-if="scope.row.open" class="el-icon-setting" style="cursor: pointer;" @click="updateWorkspace(scope.row.wsId)"></i>
|
||||
<i v-if="!scope.row.open" class="el-icon-delete" style="cursor: pointer;" @click="deleteWorkspace(scope.row.wsId, scope.row.name)"></i>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<WorkspaceUpdate ref="workspaceUpdate"></WorkspaceUpdate>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import WorkspaceUpdate from "./WorkspaceUpdate";
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
export default {
|
||||
name: "WorkspaceManage",
|
||||
components: {WorkspaceUpdate},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - 22) + 'px',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
listenTopMainHeight() {
|
||||
return this.$store.getters.getTopMainHeightFn;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
that.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
const that = this;
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_manage_data'
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
let data = ro.data.data;
|
||||
that.tableData = data;
|
||||
that.$refs.workspaceManageTable.bodyWrapper.scrollTop = 0;
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
changeWsStatus(wsId, name, open) {// 开启、停用资产库
|
||||
let state = 1;// 停用
|
||||
let str = '停用';
|
||||
if (open) {
|
||||
state = 0;// 启用
|
||||
str = '启用';
|
||||
}
|
||||
const that = this;
|
||||
that.$confirm('确定' + str + '[' + name + ']吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
closeOnClickModal: false,
|
||||
closeOnPressEscape: false,
|
||||
showClose: true,
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_stoporopen',
|
||||
id : wsId,
|
||||
state : state
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.msg == "1") {
|
||||
// 成功,刷新当前页面
|
||||
that.$message({
|
||||
message: str + '成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('变更状态失败请稍后重试');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
for (var currRowData in that.tableData) {
|
||||
if (that.tableData[currRowData].wsId == wsId) {
|
||||
if (open) {
|
||||
that.tableData[currRowData].open = false;
|
||||
} else {
|
||||
that.tableData[currRowData].open = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteWorkspace(wsId, name) {// 删除资产库
|
||||
const that = this;
|
||||
that.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
confirmButtonClass: 'button-general-color',
|
||||
cancelButtonText: '取消',
|
||||
closeOnClickModal: false,
|
||||
closeOnPressEscape: false,
|
||||
showClose: true,
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_remove',
|
||||
id : wsId,
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.msg == "1") {
|
||||
// 成功,刷新当前页面
|
||||
that.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
that.initData();
|
||||
} else {
|
||||
that.$message.error('删除失败请稍后重试');
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
updateWorkspace(wsId) {// 更新资产库
|
||||
this.$refs.workspaceUpdate.openUpdateWsDlg('update', wsId, this);
|
||||
},
|
||||
updateWorkspaceCallback() {
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
listenTopMainHeight: function (newd, old) {
|
||||
this.tableHeight = (parseInt(newd)) - 22 + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#workspaceManage >>> .el-main {
|
||||
display: block;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
-ms-flex-preferred-size: auto;
|
||||
flex-basis: auto;
|
||||
overflow: auto;
|
||||
padding-top: 20px;
|
||||
padding-left: 20px;
|
||||
padding-right: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
#workspaceManage >>> .el-table__row .operate-icon-display{
|
||||
display: none;
|
||||
}
|
||||
#workspaceManage >>> .el-table__row:hover .operate-icon-display{
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
196
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceUpdate.vue
Normal file
196
com.actionsoft.apps.coe.pal/views/workspace/WorkspaceUpdate.vue
Normal file
@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal=false
|
||||
width="450px"
|
||||
:before-close="handleClose" class="workspace-update">
|
||||
<div style="border: 1px solid #F2F2F2;padding: 0px 10px 10px 10px;">
|
||||
<awsui-form ref="ruleForm" :model="ruleForm" label-position="top" :rules="rules">
|
||||
<awsui-form-item label="名称" prop="name">
|
||||
<awsui-input v-model="ruleForm.name" placeholder="公司名称或项目名称" maxlength="36" :validate-event=false></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="描述">
|
||||
<awsui-input v-model="ruleForm.desc" type="textarea" placeholder="请输入描述" maxlength="255" show-word-limit></awsui-input>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="管理员" prop="admin">
|
||||
<awsui-select v-model="ruleForm.admin" :options="adminOptions" multiple placeholder="请选择管理员" :validate-event=false @change="updateAdminData"></awsui-select>
|
||||
</awsui-form-item>
|
||||
<awsui-form-item label="分类方法">
|
||||
<div>
|
||||
<el-radio-group fill="#4E7FF9" v-model="ruleForm.type" size="mini" :disabled="wsId != ''">
|
||||
<el-tooltip class="item" effect="dark" placement="bottom-start">
|
||||
<span slot="content">二分法流程分为"核心经营流程"和"支持管理流程"</span>
|
||||
<el-radio-button label="二分法"></el-radio-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" effect="dark" placement="bottom-start">
|
||||
<span slot="content">三分法流程分为"战略流程"、"运营流程"和"支持流程"</span>
|
||||
<el-radio-button label="三分法"></el-radio-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip class="item" effect="dark" placement="bottom-start">
|
||||
<span slot="content">可自己定义流程结构</span>
|
||||
<el-radio-button label="自定义"></el-radio-button>
|
||||
</el-tooltip>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</awsui-form-item>
|
||||
</awsui-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<awsui-button class="button-general-color" :disabled="buttonDisabled" type="primary" @click="save">确定</awsui-button>
|
||||
<awsui-button @click="cancel()">取消</awsui-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import awsuiAxios from "../../awsuiAxios";
|
||||
|
||||
export default {
|
||||
name: "WorkspaceUpdate",
|
||||
data() {
|
||||
return {
|
||||
title : '新建资产库',
|
||||
buttonDisabled : false,
|
||||
wsId : '',
|
||||
dialogVisible : false,
|
||||
adminOptions : [],
|
||||
obj : null,// 其他vue页面传递过来的this,可以执行相应回调函数
|
||||
ruleForm: {
|
||||
name : '',
|
||||
desc : '',
|
||||
admin : '',
|
||||
type : '二分法',
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '请输入资产库名称', trigger: 'blur' }],
|
||||
admin: [{ required: true, message: '请选择管理员', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods : {
|
||||
openUpdateWsDlg(action, wsId, obj) {
|
||||
if (action == 'create') {
|
||||
this.title = '新建资产库';
|
||||
this.obj = obj;
|
||||
} else {
|
||||
this.title = '修改资产库';
|
||||
this.wsId = wsId;
|
||||
this.obj = obj;
|
||||
}
|
||||
this.initData();
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
cancel() {
|
||||
this.$refs['ruleForm'].resetFields();
|
||||
this.buttonDisabled = false;
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
handleClose(done) {
|
||||
this.buttonDisabled = false;
|
||||
this.$refs['ruleForm'].resetFields();
|
||||
done();
|
||||
},
|
||||
initData() {// 初始化数据
|
||||
const that = this;
|
||||
// 查询资产库数据,若新建只查询用户,若更新,查询所有的,wsId是否有值为判断依据
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_update_data_query',
|
||||
wsId : that.wsId
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
let data = ro.data;
|
||||
that.ruleForm.name = data.name;
|
||||
that.ruleForm.type = data.type == 0 ? "二分法" : data.type == 1 ? "三分法" : "自定义";
|
||||
that.ruleForm.desc = data.desc;
|
||||
that.ruleForm.admin = data.admin;
|
||||
that.adminOptions = data.adminOptions;
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
updateAdminData(val) {
|
||||
this.ruleForm.admin = val;
|
||||
},
|
||||
save() {
|
||||
const that = this;
|
||||
// 名称,管理员,描述
|
||||
const name = that.ruleForm.name;
|
||||
const desc = that.ruleForm.desc;
|
||||
const admin = that.ruleForm.admin;
|
||||
if (name == "") {
|
||||
that.$message({message: '[名称]不允许为空',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (name.length > 36) {
|
||||
that.$message({message: '[名称]不允许超过36个字',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (desc.length > 255) {
|
||||
that.$message({message: '[描述]不允许超过255个字符',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
if (admin.length == 0) {
|
||||
that.$message({message: '[管理员]不允许为空',type: 'warning'});
|
||||
return;
|
||||
}
|
||||
that.buttonDisabled = true;
|
||||
|
||||
const data = {
|
||||
url:'jd',
|
||||
data:{
|
||||
cmd : 'com.actionsoft.apps.coe.pal_ws_update_save',
|
||||
wsId : that.wsId,
|
||||
name : that.ruleForm.name,
|
||||
type : that.ruleForm.type == '二分法' ? 0 : that.ruleForm.type == '三分法' ? 1 : 2,
|
||||
desc : that.ruleForm.desc,
|
||||
admin : that.ruleForm.admin.join(',')
|
||||
}
|
||||
};
|
||||
awsuiAxios.post(data).then(function (ro) {
|
||||
if (ro.result == 'ok') {
|
||||
that.$message({
|
||||
message: ro.msg,
|
||||
duration: 2000,
|
||||
type: 'success'
|
||||
});
|
||||
that.cancel();
|
||||
if (that.obj != null) {
|
||||
that.obj.updateWorkspaceCallback();
|
||||
}
|
||||
} else {
|
||||
that.$message.error(ro.msg);
|
||||
}
|
||||
that.buttonDisabled = false;
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
.label-padding {
|
||||
padding-bottom: 8px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
.workspace-update >>> .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user