PAL小组

This commit is contained in:
446052889@qq.com 2022-07-07 11:17:41 +08:00
parent b6ae43319b
commit a478a37d25
40 changed files with 5151 additions and 4 deletions

View File

@ -0,0 +1,25 @@
.DS_Store
node_modules
# awsDevParams.js
/dist
/lib
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.history/*

View File

@ -0,0 +1,29 @@
module.exports = {
AWSPortalUrl: "http://localhost:8088/portal/",//aws平台启动地址用于开发时获取平台静态资源请求数据等注意最后的/,不要删)
AWSReleasePath: "/Users/sunlh/idea_workspace_aws6/release/", /*C:/work/workspace/release/*/ //aws的平台路径暂时写绝对路径用于build生成的主文件位置注意最后的/,不要删)
moduleTemplateInAWS: "apps/install/com.actionsoft.apps.coe.pal.cooperation/template/page/main.htm", /*apps/install/_bpm.platform/template/page/console.m.dw.design.vue.htm*/ //build后生成到平台的模板位置及名称
outputDir: "apps/install/com.actionsoft.apps.coe.pal.cooperation/web/com.actionsoft.apps.coe.pal.cooperation/main", /*webserver/webapps/portal/apps/_bpm.platform/dw/designer/main*/ //build后js或css生成到平台的位置
publicPath: "../apps/com.actionsoft.apps.coe.pal.cooperation/main", /*../apps/_bpm.platform/dw/designer/main*/ //build到平台后生成到模板中引入js文件的相对平台的位置
AWSJSAndCSSImport: [ //引入平台的js或css在portal目录开始,开发或build通用
/*
// 示例
{
type: "js",
path: "commons/js/util/Base64.js"
},
{
type: "css",
path: "commons/css/font/iconfont.css"
},
*/
{
type: 'js',
path: 'commons/awsui/js/icon.array.js'
}
],
devUserInfo: {//开发时通过用户名及密码获取sessionId前提必须需要安装并启动appcom.actionsoft.apps.getsession.app
userid: "admin", //具有后台管理的用户名
pwd: "admin", //密码
deviceType: "pc",
}
}

View File

@ -0,0 +1,24 @@
# dataviewsetting
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@ -0,0 +1,10 @@
module.exports = {
presets: [
[
'@vue/app',
{
useBuiltIns: 'entry'
}
]
]
}

View File

@ -0,0 +1,51 @@
{
"name": "com.actionsoft.apps.coe.pal.cooperation",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"awsui-vue": "^1.0.0",
"axios": "^0.20.0",
"babel-polyfill": "^6.26.0",
"core-js": "^3.8.0",
"element-ui": "^2.14.1",
"vue": "^2.6.11",
"vue-router": "^3.4.9",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-eslint": "~4.4.0",
"@vue/cli-plugin-router": "~4.4.0",
"@vue/cli-plugin-vuex": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<%= htmlWebpackPlugin.options.AWSJSAndCSSImport %>
<!--
其它的js或css引用方式示例<%= htmlWebpackPlugin.options.awsjsandcsspath%>
<link rel="stylesheet" type="text/css" href="<%= htmlWebpackPlugin.options.awsjsandcsspath%>apps/_bpm.platform/css/model/console.m.dw.design.css"/>
-->
<script>
const settingParam = <%= htmlWebpackPlugin.options.settingParam %>;
const axiosBaseUrl = "<%= htmlWebpackPlugin.options.axiosBaseUrl %>";
const production = <%= htmlWebpackPlugin.options.isproduction %>;
</script>
<% if(!htmlWebpackPlugin.options.isproduction) {%>
<script>
const devUserInfo = <%= JSON.stringify(htmlWebpackPlugin.options.devUserInfo) %>;
</script>
<% }%>
<script>
<% if(!htmlWebpackPlugin.options.isproduction) {%>
var mainPage = 'manage';// create新建主页面update管理主页面manage操作主页面
var isManage = true;// 是否PAL管理员用户
<%}else {%>
var mainPage = "<#mainPage>";
var isManage = <#isManage>;
<%}%>
</script>
</head>
<body style="margin:0;">
<div id="app"></div>
</body>
</html>

View File

@ -0,0 +1,13 @@
<template>
<div id="app">
<router-view />
</div>
</template>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>

View File

@ -0,0 +1,8 @@
.is-valid {
color: green;
}
.is-invalid {
color: #F56C6C !important;
font-size: 12px;
}

View 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);

View 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;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

View 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
}

View File

@ -0,0 +1 @@
说明小组范围内PAL模型树组件

View File

@ -0,0 +1,366 @@
<template>
<el-container>
<awsui-dialog
id="cooperationRepositoryTree"
:title="title"
:visible.sync="dialogVisible"
:destroy-on-close=true
:width="width"
:border=false
: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"
:default-checked-keys="treeChecked"
: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=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>
</awsui-dialog>
</el-container>
</template>
<script>
import awsuiAxios from "../../awsuiAxios";
export default {
name: "CooperationRepositoryTree",
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: '请选择'
},
selected: {// []
type: Array,
default: function () {
return []
}
}
},
data() {
return {
refresh: false,
dialogVisible: false,
loading: false,
searchKey: '',
treeSearchKey: '',
treeChecked: [],
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.treeChecked;
} else {//
const node = this.$refs.tree.getCurrentNode();
if (node != null) {
result.push(node);
}
}
this.$emit('getResult', result);
} else {
this.$emit('cancel');
}
//
this.clearData();
},
clearData() {
this.searchKey = '';
this.treeSearchKey = '';
this.treeChecked = [];
},
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.cooperation_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.cooperation_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;
},
checkedNode(data, checked, subChecked) {//
//
const that = this;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_repository_all_childern_data_query',
wsId: that.wsId,
teamId: that.teamId,
pid: data.id
}
};
awsuiAxios.post(params).then(function (ro) {
const childVerIds = ro.data;
const currVerId = data.versionId;
if (checked) {//
const checkedVerIds = that.treeChecked;
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.tree.setCheckedKeys(checkedVerIds);
} else {//
const checkedVerIds = that.treeChecked;
const tempArr = [];
for (let i = 0; i < checkedVerIds.length; i++) {
if (checkedVerIds[i] != currVerId && childVerIds.indexOf(checkedVerIds[i]) == -1) {
tempArr.push(checkedVerIds[i]);
}
}
that.treeChecked = tempArr;
that.$refs.tree.setCheckedKeys([]);
}
}).catch(error=>{
console.log(error);
})
}
},
watch: {
visible(val) {
this.dialogVisible = val;
if (val) {//
this.pid = this.rootId;
this.treeChecked = this.selected;
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:432px;
height: 300px;
}
#palRepositoryTree >>> .el-tree {
min-width: 100%;
display:inline-block !important;
}
</style>

View File

@ -0,0 +1,7 @@
import CooperationRepositoryTree from './component'
CooperationRepositoryTree.install = function(Vue) {
Vue.component(CooperationRepositoryTree.name, CooperationRepositoryTree);
}
export default CooperationRepositoryTree;

View File

@ -0,0 +1 @@
说明:小组新建、修改组件

View File

@ -0,0 +1,594 @@
<template>
<validation-observer ref="updateTeam">
<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"80px30px
iconFontSize: 52, //iconfont30px16px
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.updateTeam.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>

View File

@ -0,0 +1,6 @@
import CooperationUpdate from "./component";
CooperationUpdate.install = function(Vue) {
Vue.component(CooperationUpdate.name, CooperationUpdate);
}
export default CooperationUpdate;

View File

@ -0,0 +1,24 @@
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.config.productionTip = false
Vue.use(Babel);
Vue.use(Awsui)
new Vue({
router,
store,
render: h => {
return h(App);
},
}).$mount('#app')

View File

@ -0,0 +1,74 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '../store'
Vue.use(VueRouter)
const routes = [
{
path: '/create', //创建小组主页面
name: 'create',
component: () => import ('../views/main/Create'),
},
{
path: '/update', // 修改小组(pal)主页面
name: 'update',
component: () => import ('../views/main/Update'),
},
{
path: '/manage', //管理小组主页面
name: 'manage',
component: () => import ('../views/manage/Manage'),
},
{
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;
if (store.state.mainPage == 'create') {
store.commit("edit", { mainPage: Math.random() });
next('/create');
} else if (store.state.mainPage == 'update') {
store.commit("edit", { mainPage: Math.random() });
next('/update');
} else if (store.state.mainPage == 'manage') {
store.commit("edit", { mainPage: Math.random() });
next('/manage');
} else {
next();
}
// next();
}
//to.matched.some(res=>{res.meta.isLogin}) 能够获取路由配置的参数
});
//跳转后设置scroll为原点
router.afterEach((to, from, next) => {
window.scrollTo(0, 0);
});
export default router

View File

@ -0,0 +1,35 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
sessionId: settingParam.sessionId,
mainPage: mainPage,
topMainHeight: '',// 主页面主体高度
},
getters: {// 提供获取state相关数据的方法
getTopMainHeightFn(state) {// 获取PAL主页面主体高度
//console.log('get height ' + state.topMainHeight);
return state.topMainHeight;
}
},
actions: {// 提供跟后台接口交互的方法并且调用mutations提供的方法进行更新提交
setTopMainHeightFn({commit, state}, height) {// 设置主页面主体高度更新
commit("setTopMainHeightFn", height);
}
},
mutations: {// 提供存储设置state数据的方法
setTopMainHeightFn(state, height) {// 设置主页面主体高度更新
state.topMainHeight = height;
},
edit(state, data) {
for (let p in data) {
state[p] = data[p];
}
}
},
modules: {
}
})

View 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("/" + mainPage);
}
});
export default {
data() {
return {
dwList: [], //dw
};
},
methods: {},
mounted() {},
};
</script>

View File

@ -0,0 +1,81 @@
<template>
<awsui-layout id="create" v-loading="loading" :element-loading-text="loadingText">
<awsui-main id="createMain" :style="{width: '100%',padding:0,height:bodyHeight}">
<!--空白页面-->
<div style="width:100%;height: 100%;">
<div style="width:100%;height: 300px;margin: auto;position: relative;top: 35%">
<div style="text-align: center;">
<span><i class="iconfont" style="color: #C2C2C2;font-size: 60px;">&#xe65e;</i></span>
<p class="text-general-color" style="margin: 15px 0;">您还没加入任何小组</p>
</div>
<div v-if="isManage" style="text-align:center;">
<awsui-button class="button-general-color text-general-color" type="primary" @click="createTeam">创建小组</awsui-button>
</div>
</div>
</div>
</awsui-main>
<cooperation-update
ref="cooperationUpdate"
:visible.sync="update.visible"
:teamId="update.teamId"
v-on:cancel="update.visible = false"
v-on:getResult="updateDone"
:title="update.title"
/>
</awsui-layout>
</template>
<script>
import CooperationUpdate from "../../components/CooperationUpdate/component";
import awsuiAxios from "../../awsuiAxios";
export default {
name: "Create",
components: {CooperationUpdate},
data() {
return {
bodyHeight : (document.documentElement.clientHeight) + 'px',
isManage: isManage,
update: {
visible: false,
teamId: '',
title: '创建小组'
},
loading: false,
loadingText: '正在保存',
}
},
mounted() {
const that = this;
that.resize();
},
methods : {
createTeam() {
this.update.teamId = '';
this.update.visible = true;
},
updateDone(result) {//
const that = this;
if (result == 'ok') {
this.update.visible = false;
parent.location.reload();
}
},
resize() {// window.resize
const that = this
let resizeTimer = null;
window.onresize = () => {
return (() => {
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(function(){
that.bodyHeight = (document.documentElement.clientHeight) + 'px';
} , 400);
})()
}
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,206 @@
<template>
<el-container id="update">
<el-main id="updateMain" :style="{padding:0,height:bodyHeight}">
<el-table
id="updateTable"
ref="updateTable"
:data="tableData"
:row-style="{height:'50px'}"
:cell-style="{padding:'0px'}"
:height="bodyHeight">
<el-table-column
prop="icon"
label="小组"
align="right"
class-name="table-row-icon-cloumn"
min-width="45">
<template slot-scope="scope">
<div>
<div class="icon-div-repository" :style="{'background-color': scope.row.teamLogo.color}">
<i class="awsui-iconfont icon-dynamic-repository" v-html="scope.row.teamLogo.code"></i>
</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="name"
label=""
min-width="250">
<template slot-scope="scope">
<div>
<div style="line-height: 20px;">
<p class="text-general-color" style="font-size:14px;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
{{scope.row.teamName}}
</p>
</div>
<div style="line-height: 15px;">
<p class="text-second-color" style="font-size: 12px;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
{{scope.row.teamDesc}}
</p>
</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="wsName"
label="关联资产库"
min-width="150">
</el-table-column>
<el-table-column
prop="admin"
label="管理员"
min-width="180">
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
width="150"
align="center">
</el-table-column>
<el-table-column
prop="createTime"
label="状态"
width="100"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.isRun">启用中</span>
<span v-else class="text-important-color">已停用</span>
</template>
</el-table-column>
<el-table-column
prop="permStatus"
label="授权状态"
width="150">
<template slot-scope="scope">
<span v-html="scope.row.permStatus == 0 ? '未设置权限': '已包含' + scope.row.permStatus + '个文件'"></span>
</template>
</el-table-column>
<el-table-column
prop="operation"
label=""
align="center">
<template slot-scope="scope">
<div class="operate-icon-display" v-if="scope.row.isRun">
<el-tooltip class="item" effect="dark" content="设置" placement="bottom">
<i class="awsui-iconfont" style="cursor: pointer;" @click="updateTeam(scope.row.teamId)">&#xe615;</i>
</el-tooltip>
</div>
</template>
</el-table-column>
</el-table>
</el-main>
<cooperation-update
ref="cooperationUpdate"
:visible.sync="update.visible"
:teamId="update.teamId"
v-on:cancel="update.visible = false"
v-on:getResult="updateDone"
:title="update.title"
/>
</el-container>
</template>
<script>
import awsuiAxios from "../../awsuiAxios";
import CooperationUpdate from "../../components/CooperationUpdate/component";
export default {
name: "Update",
components: {CooperationUpdate},
data() {
return {
bodyHeight : (document.documentElement.clientHeight) + 'px',
tableData: [],
update: {
visible: false,
teamId: '',
title: '修改小组'
}
}
},
mounted() {
const that = this;
that.resize();
that.initData();
},
methods: {
initData() {
const that = this;
const data = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_team_info_list',
}
};
awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') {
that.tableData = ro.data;
}
}).catch(error=>{
console.log(error);
})
},
updateTeam(teamId) {
this.update.teamId = teamId;
this.update.visible = true;
},
updateDone(result) {
const that = this;
if (result == 'ok') {
this.update.visible = false;
that.initData();
}
},
resize() {// window.resize
const that = this
let resizeTimer = null;
window.onresize = () => {
return (() => {
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(function(){
that.bodyHeight = (document.documentElement.clientHeight) + 'px';
} , 400);
})()
}
},
},
}
</script>
<style scoped>
#update >>> .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;
}
#update >>> .el-table__row .operate-icon-display{
display: none;
}
#update >>> .el-table__row:hover .operate-icon-display{
display: inline-block;
}
#update >>> .table-row-icon-cloumn .cell {
padding-right: 0 !important;
}
.icon-div-repository {
border-radius: 15%;
display: inline-block;
width: 32px;
height: 32px;
text-align: center;
line-height: 32px;
vertical-align: middle;
}
.icon-dynamic-repository {
color: white;
font-size: 18px;
}
</style>

View File

@ -0,0 +1,65 @@
<template>
<awsui-layout id="manage" :style="{'width': '100%', 'height': mainHeight}">
<awsui-aside width="280px" style="overflow: hidden;border-right: 1px solid #F2F2F2">
<manage-main ref="manageMain" key="manageMain"/>
</awsui-aside>
<awsui-main>
<manage-list v-if="visibleList" ref="manageList" :teamId="teamId" :key="Math.random()"></manage-list>
</awsui-main>
</awsui-layout>
</template>
<script>
import ManageMain from "./ManageMain";
import ManageList from "./ManageList";
export default {
name: "Manage",
components: {ManageList, ManageMain},
data() {
return {
mainHeight: (document.documentElement.clientHeight) + 'px',
teamId: '',
visibleList: false
}
},
provide: function() {
return {
openTeam: this.openTeam
}
},
mounted() {
const that = this;
that.$store.commit('setTopMainHeightFn',this.mainHeight);//
that.resize();
},
methods: {
openTeam(teamId) {
this.visibleList = false;
this.teamId = teamId;
this.visibleList = true;
},
resize() {// window.resize
const that = this
let resizeTimer = null;
window.onresize = () => {
return (() => {
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(function(){
that.mainHeight = (document.documentElement.clientHeight) + 'px';
that.$store.commit('setTopMainHeightFn',that.mainHeight);
} , 400);
})()
}
},
},
}
</script>
<style scoped>
#manage >>> .awsui-main {
padding: 0px;
}
#manage >>> .awsui-aside {
padding: 0;
}
</style>

View File

@ -0,0 +1,516 @@
<template>
<awsui-layout id="manageList" class="text-general-color">
<awsui-header :height="(parseInt(header1Height) + parseInt(header2Height)) + 'px'">
<div style="width: 100%;height: 100%;">
<awsui-row :style="{height: header1Height}">
<awsui-col id="header" :span="24" :style="{height: header1Height}" style="padding: 10px 0 10px 10px;">
<!-- logo -->
<div id="teamLogo" class="inline-block">
<div id="headerLogo" class="team-icon-div inline-block" :style="{height: iconHeight, width: iconHeight, 'line-height': iconHeight, 'background-color': currTeam.teamLogo.color}">
<i class="awsui-iconfont" style="font-size: 32px;color: #fff" v-html="currTeam.teamLogo.code"></i>
</div>
</div>
<!-- teamDetail -->
<div id="teamDetail" class="inline-block">
<div class="inline-block" :style="{'padding-left': headerTitlePaddingLeft}">
<div id="headerTitle" style="height: 25px;position: relative;top: 11px;" class="text-overflow-hidden">
<span style="font-size: 18px;">{{currTeam.teamName}}</span>
<span v-if="!currTeam.isRun">
<span style="font-size: 12px;" >(</span>
<span style="font-size: 12px;" class="text-important-color">已停用</span>
<span style="font-size: 12px;" >)</span>
</span>
<span style="font-size: 12px;" class="text-second-color">关联"{{currTeam.wsName}}"</span>
</div>
<div id="headerDesc" class="text-overflow-hidden" style="height: 19px;position: relative;top: 14px;">
<span style="font-size: 12px;">{{currTeam.teamDesc}}</span>
</div>
</div>
</div>
<!-- button -->
<div id="manageButton" v-if="currTeam.teamManager" class="inline-block" :style="{width: manageButtonWidth, 'height': '20px'}">
<div style="position: absolute;right: -15px;">
<awsui-button style="width: 100px;" class="button-general-color-reverse" plain @click="manageRole">管理角色</awsui-button>
<awsui-button style="width: 100px;margin-left: 15px;" class="button-general-color" type="primary" @click="addMember">添加成员</awsui-button>
</div>
</div>
</awsui-col>
</awsui-row>
<awsui-row :style="{height: header2Height}">
<awsui-col :span="17" style="height: 100%;">
<div style="height: 100%;padding-left: 10px;">
<span>小组共<span style="color: #D9001B;">{{tempTableData.length}}</span>成员其中<span style="color: #D9001B;" v-html="getManageUserCount() + '名'"></span>管理员</span>
</div>
</awsui-col>
<awsui-col :span="7" style="height: 100%;margin-left: 0">
<div style="height: 100%;width: 260px;position: absolute;right: 0px;">
<awsui-input v-model="searchInput" @input="search" placeholder="搜索"></awsui-input>
</div>
</awsui-col>
</awsui-row>
</div>
</awsui-header>
<awsui-main>
<div id="tableMain" ref="tableMain">
<div v-if="!currTeam.teamManager" key="table1">
<el-table
ref="table"
:height="mainHeight"
:row-style="{height:'50px'}"
:cell-style="{padding:'0px'}"
:data="tableData"
style="width: 100%;"
highlight-current-row>
<el-table-column
prop="userName"
label="姓名"
min-width="150px">
<template slot-scope="scope">
<span v-html="scope.row.userName"></span><span v-if="scope.row.close" class="text-important-color">[已注销]</span>
</template>
</el-table-column>
<el-table-column
prop="roleName"
label="小组角色"
min-width="150px">
</el-table-column>
<el-table-column
prop="deptName"
label="部门"
min-width="150px">
</el-table-column>
<el-table-column
prop="email"
label="电子邮件"
min-width="150px">
</el-table-column>
</el-table>
</div>
<div v-if="currTeam.teamManager" key="table2">
<el-table
ref="table"
:height="mainHeight"
:row-style="{height:'50px'}"
:cell-style="{padding:'0px'}"
:data="tableData"
style="width: 100%;"
highlight-current-row
@cell-mouse-enter="showCheckbox"
@cell-mouse-leave="hideCheckbox"
:cell-class-name="hideCheckBoxCell"
@row-click="clickTableRow"
@selection-change="handlecheckedUsersChange">
<el-table-column
type="selection"
width="45"
align="center">
</el-table-column>
<el-table-column
prop="userName"
label="姓名"
min-width="150px">
<template slot-scope="scope">
<span v-html="scope.row.userName"></span><span v-if="scope.row.close" class="text-important-color">[已注销]</span>
</template>
</el-table-column>
<el-table-column
prop="roleName"
label="小组角色"
min-width="150px">
</el-table-column>
<el-table-column
prop="deptName"
label="部门"
min-width="150px">
</el-table-column>
<el-table-column
prop="email"
label="电子邮件"
min-width="150px">
</el-table-column>
<el-table-column
prop="operate"
label=""
align="center">
<template slot-scope="scope">
<div style="width: 30px;display: inline-block;">
<div class="operate-icon-display">
<el-tooltip content="修改角色" placement="bottom" :hide-after=2000>
<i class="iconfont icon-jiaoseguanli" style="cursor: pointer;padding-right: 10px;" @click="updateRole(scope.row.userId)"></i>
</el-tooltip>
<el-tooltip v-if="scope.row.userId != currTeam.userId" content="删除成员" placement="bottom" :hide-after=2000>
<i class="iconfont icon-lajitong1" style="cursor: pointer;" @click="removeUser(scope.row.userId)"></i>
</el-tooltip>
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</awsui-main>
<awsui-footer :height="footerHeight" v-show="showFooter" key="operateFooter">
<!-- <div style="border-top: 1px solid #F2F2F2;height: 100%;">-->
<div style="height: 100%;">
<div style="padding: 8px 8px 8px 14px;">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
<awsui-button style="width: 100px;margin-left: 15px;" class="button-general-color" type="primary" @click="updateRoles">修改角色</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>取消</awsui-button>
</div>
</div>
</awsui-footer>
<role-manage
ref="roleManage"
:visible.sync="roleManage.visible"
:teamId="teamId"
:userIds="roleManage.userIds"
:type="roleManage.type"
v-on:cancel="roleManage.visible = false"
v-on:getResult="roleManageDone"
:title="roleManage.title"/>
<member-add
ref="memberAdd"
:visible.sync="memberAdd.visible"
:teamId="teamId"
v-on:cancel="memberAdd.visible = false"
v-on:getResult="memberAddDone"
:title="memberAdd.title"
/>
</awsui-layout>
</template>
<script>
import RoleManage from "../role/RoleManage";
const header1Height = '80px';
const header2Height = '30px';
const footerHeight = '45px';
import awsuiAxios from "../../awsuiAxios";
import MemberAdd from "../member/MemberAdd";
export default {
name: "ManageList",
components: {MemberAdd, RoleManage},
props: {
teamId: {
type: String,
default: ''
}
},
data() {
return {
header1Height: header1Height,
header2Height: header2Height,
iconHeight: '56px',
headerTitlePaddingLeft: '10px',
manageButtonWidth: '250px',
mainHeight: (parseInt(this.$store.getters.getTopMainHeightFn) - (this.showFooter ? footerHeight : 0)) - parseInt(header1Height) - parseInt(header2Height) + 'px',
footerHeight: footerHeight,
searchInput: '',
tableData: [],
tempTableData: [],
showFooter: false,
checkAll: false,
checkedUsers: [],//
singleSelectedRepository: {},//
isIndeterminate: false,
currTeam: {
userId: '',
teamId: '',
teamName: '',
teamLogo: {
color: '',
code: ''
},
teamDesc: '',
wsId: '',
wsName: '',
teamManager: false,
isRun: false //
},
roleManage: {
visible: false,
title: '设置角色',
userIds: [],
type: ''
},
memberAdd: {
visible: false,
title: '添加小组成员'
}
}
},
mounted() {
this.initData();
},
methods: {
initData() {//
const that = this;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_team_detail_query',
teamId: that.teamId
}
};
//
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
const data = ro.data;
that.currTeam.userId = data.userId;
that.currTeam.teamId = data.teamId;
that.currTeam.teamName = data.teamName;
that.currTeam.teamDesc = data.teamDesc;
that.currTeam.teamLogo = data.teamLogo;
that.currTeam.wsId = data.wsId;
that.currTeam.isRun = data.run;
that.currTeam.wsName = data.wsName;
that.currTeam.teamManager = data.teamManager;
that.tempTableData = JSON.parse(JSON.stringify(data.members));
that.initCurrTeamHeaderWidth();
that.search();
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
},
search() {//
this.closeFooter();
if (this.searchInput && this.searchInput.trim() != '') {//
const data1 = [];
for (let i = 0; i < this.tempTableData.length; i++) {
if (this.tempTableData[i].userName.indexOf(this.searchInput) > -1) {
const temp = JSON.parse(JSON.stringify(this.tempTableData[i]));
temp.userName = temp.userName.replace(new RegExp(this.searchInput,'g'), '<span style="color: #4E7FF9">' + this.searchInput + '</span>');
data1.push(temp);
}
}
this.tableData = data1;
} else {//
this.tableData = this.tempTableData;
}
},
initCurrTeamHeaderWidth() {
const headerWidth = document.getElementById('header').offsetWidth - 10;
const width = headerWidth - parseInt(this.iconHeight) - (this.currTeam.teamManager ? parseInt(this.manageButtonWidth) : 0) - 10 + 'px';
},
closeFooter() {
this.handleCheckAllChange(false);
this.showFooter = false;
this.refreshMainHeight();
},
refreshMainHeight() {
this.mainHeight = (parseInt(this.$store.getters.getTopMainHeightFn) - (this.showFooter ? parseInt(footerHeight) : 0)) - (parseInt(header1Height)) - (parseInt(header2Height)) + 'px';
},
hideCheckBoxCell(row) {
return "hideCheckBoxCell";
},
showCheckbox(row, column, cell, event) {
cell.parentNode.querySelector(".el-table-column--selection").querySelector(".el-checkbox__input").style.visibility = "visible";
},
hideCheckbox(row, column, cell, event) {
let ck = cell.parentNode.querySelector(".el-table-column--selection").querySelector(".el-checkbox__input");
if (ck != null && this.checkedUsers.indexOf(row) < 0) {
ck.style.visibility = "hidden";
}
},
clickTableRow(row, column, event) {
this.$refs.table.setCurrentRow(row);
},
handleCheckAllChange(val) {//
if (val) {
this.$refs.table.clearSelection();
this.tableData.forEach(row => {
this.$refs.table.toggleRowSelection(row);
});
} else {
this.$refs.table.clearSelection();
}
this.isIndeterminate = false;
},
handlecheckedUsersChange(val) {//
const that = this;
that.checkedUsers = val;
let checkedCount = val.length;
if (checkedCount > 0) {
that.showFooter = true;
//
for (let i = 0; i < checkedCount; i++) {
let index = that.tableData.indexOf(val[i]);
const childNodes = that.tbody[0].childNodes;
if (childNodes != undefined) {
const selectChildNode = childNodes[index];
const selectTd = selectChildNode.childNodes[0];
if (selectTd && selectTd.querySelector(".el-checkbox__input")) {
selectTd.querySelector(".el-checkbox__input").style.visibility = "visible"
}
}
}
} else {
that.showFooter = false;
for (let j = 0; j < that.tableData.length; j++) {
const childNodes = that.tbody[0].childNodes;
if (childNodes != undefined) {
const selectChildNode = childNodes[j];
const selectTd = selectChildNode.childNodes[0];
if (selectTd && selectTd.querySelector(".el-checkbox__input")) {
selectTd.querySelector(".el-checkbox__input").style.visibility = "hidden"
}
}
}
}
that.refreshMainHeight();
that.checkAll = checkedCount === that.tableData.length;
that.isIndeterminate = checkedCount > 0 && checkedCount < that.tableData.length;
},
getManageUserCount() {
let count = 0;
for (let i = 0; i < this.tempTableData.length; i++) {
if (this.tempTableData[i].roleType == 0) {
count++;
}
}
return count;
},
/***********角色管理*************/
updateRole(userId) {//
this.roleManage.title = "角色设置";
this.roleManage.userIds = [userId];
this.roleManage.type = 'roleConfig';
this.roleManage.visible = true;
},
updateRoles() {//
if (this.checkedUsers.length == 0) {
this.$message({message: '请选择需要修改角色的用户',type: 'warning'});
return;
}
const userIds = [];
for (let i = 0; i < this.checkedUsers.length; i++) {
userIds.push(this.checkedUsers[i].userId);
}
this.roleManage.title = "角色设置";
this.roleManage.userIds = userIds;
this.roleManage.type = 'roleConfig';
this.roleManage.visible = true;
},
manageRole() {
this.roleManage.title = "角色管理";
this.roleManage.userIds = [];
this.roleManage.type = 'roleManage';
this.roleManage.visible = true;
},
roleManageDone(result) {
this.roleManage.visible = false;
if (result == 'ok') {
this.initData();
}
},
/****************成员添加、删除*****************/
addMember() {
this.memberAdd.visible = true;
},
memberAddDone(result) {
this.memberAdd.visible = false;
if (result == 'ok') {
this.initData();
}
},
removeUser(userId) {
this.removeUserRequest([userId]);
},
removeUsers() {
if (this.checkedUsers.length == 0) {
this.$message({message: '请选择需要删除的成员',type: 'warning'});
return;
}
const userIds = [];
for (let i = 0; i < this.checkedUsers.length; i++) {
userIds.push(this.checkedUsers[i].userId);
}
if (userIds.indexOf(this.currTeam.userId) > -1) {
this.$message({message: '删除成员中不能包含自己,请重新选择',type: 'warning'});
return;
}
this.removeUserRequest(userIds)
},
removeUserRequest(userIds) {
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.cooperation_manage_team_member_remove',
teamId: that.teamId,
userIds: JSON.stringify(userIds)
}
};
//
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
that.$message({
message: '删除成功',
type: 'success'
});
that.initData();
} else {
that.$message({message: ro.msg,type: 'warning'});
}
}).catch(error=>{
console.log(error);
})
}).catch(() => {
});
}
},
computed: {
tbody() {
return this.$refs.tableMain.querySelector(".el-table__body-wrapper").querySelector(".el-table__body").getElementsByTagName("tbody");
},
listenTopMainHeight() {
return this.$store.getters.getTopMainHeightFn;
}
},
watch : {
listenTopMainHeight: function (newd, old) {
this.refreshMainHeight();
this.initCurrTeamHeaderWidth();
}
}
}
</script>
<style scoped>
#manageList >>> .awsui-main {
padding: 0px 20px !important;
}
#tableMain >>> .hideCheckBoxCell .el-checkbox__input {
visibility: hidden;
}
#tableMain >>> .el-table__header-wrapper .el-checkbox{
display:none
}
#tableMain >>> .el-table__row .operate-icon-display{
display: none;
}
#tableMain >>> .el-table__row:hover .operate-icon-display{
display: inline-block;
}
.inline-block {
display: inline-block;
}
.team-icon-div {
text-align: center;
border-radius: 15%;
}
.text-overflow-hidden {
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
</style>

View File

@ -0,0 +1,525 @@
<template>
<validation-observer ref="updateTeamForm">
<div id="manageMain" style="width: 100%;height: 100%;">
<ul style="height:100%;overflow-y: auto;">
<draggable class="list-group" :list="teamData" @drop="draggableDrop" @update="onDragTeamSort" handle=".handle">
<li v-for="item in teamData" class="list-group-item inline-block" style="width: 100%;">
<div class="team-item-div general-bgcolor-hover" :style="{'background-color': clickId == item.teamId ? '#F5F7FA' : ''}">
<div class="inline-block team-item-icon-div text-second-color">
<i class="iconfont icon-yidongshu icon-drag handle" style="cursor:move;font-size: 18px;margin-left: 15px"></i>
</div>
<div class="inline-block team-item-icon-div cursor-pointer" :style="{'background':item.teamLogo.color}" @click="clickTeam(item.teamId)">
<i class="awsui-iconfont" style="font-size: 18px;color: #fff" v-html="item.teamLogo.code"></i>
</div>
<div class="inline-block team-item-text-div cursor-pointer" @click="clickTeam(item.teamId)">
<div>
<p :class="{'text-general-color': clickId != item.teamId, 'team-item-div-checked': clickId == item.teamId}">{{item.teamName}}</p>
</div>
</div>
<div class="inline-block team-item-icon-div" style="width: 16px;">
<div id="drawDown">
<el-dropdown
:hide-on-click="true"
trigger="click"
:visible-arrow=false
placement="bottom-start">
<span>
<div class="inline-block" style="width: 16px;height: 100%;">
<i class="iconfont operate-icon-display" style="cursor: pointer;">&#xe63c;</i>
</div>
</span>
<el-dropdown-menu style="min-width: 200px;">
<el-dropdown-item v-if="item.teamManage" class="el-dropdown-row" @click.native="updateTeamInfo(item.teamId)">
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="display: inline-block;width: 20px;"><i class="awsui-iconfont" style="font-size: 12px;">&#xe864;</i></span><span style="font-size: 12px;">信息修改</span></div>
</el-dropdown-item>
<el-dropdown-item v-if="item.teamManage && item.run" class="el-dropdown-row" @click.native="updateTeamStatus(item.teamId, 1)">
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="display: inline-block;width: 20px;"></span><span style="font-size: 12px;">暂停小组</span></div>
</el-dropdown-item>
<el-dropdown-item v-if="item.teamManage && !item.run" class="el-dropdown-row" @click.native="updateTeamStatus(item.teamId, 0)">
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="display: inline-block;width: 20px;"></span><span style="font-size: 12px;">启用小组</span></div>
</el-dropdown-item>
<el-dropdown-item v-if="item.teamManage" class="el-dropdown-row" @click.native="removeTeam(item.teamId)">
<div class="text-important-color" style="height: 100%;width: 100%;font-size: 14px;"><span style="display: inline-block;width: 20px;"></span><span style="font-size: 12px;">解散小组</span></div>
</el-dropdown-item>
<el-dropdown-item v-if="item.teamManage" divided/>
<el-dropdown-item class="el-dropdown-row" @click.native="exitTeam(item.teamId)">
<div style="height: 100%;width: 100%;font-size: 14px;"><span style="display: inline-block;width: 20px;"><i class="awsui-iconfont" style="font-size: 12px;">&#xe7a1;</i></span><span style="font-size: 12px;">退出小组</span></div>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
</li>
</draggable>
</ul>
<awsui-dialog
title="修改小组信息"
:visible.sync="updateTeam.visible"
:border=false
width="600px"
height="250px">
<div v-loading="updateTeam.loading" :element-loading-text="updateTeam.loadingText" style="position: relative;border-top: 1px solid #F2F2F2;padding-top: 15px;">
<awsui-form class="required-logo" ref="infoForm" :model="updateTeam.baseInfo.form" :rules="updateTeam.baseInfo.rules" label-width="100px" label-position="top">
<div v-if="isLoaded">
<awsui-icon-picker class="icon-team-div" :defaultOptions="iconPickerOptions" :value="{icon:updateTeam.baseInfo.form.teamLogo.code, color:updateTeam.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="updateTeam.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="updateTeam.baseInfo.form.category"
:options="updateTeam.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="updateTeam.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>
<span slot="footer" class="dialog-footer">
<awsui-button class="button-general-color" type="primary" @click="validateUpdateTeam">确定</awsui-button>
<awsui-button @click="updateTeam.visible = false">取消</awsui-button>
</span>
</awsui-dialog>
</div>
</validation-observer>
</template>
<script>
var iconDevArr = [
["公司", "&#xe68c;"],
["公司", "&#xe604;"],
["主页", "&#xe601;"],
["主页", "&#xe703;"],
["地球", "&#xe6f8;"]
];
import draggable from "vuedraggable";
import awsuiAxios from "../../awsuiAxios";
export default {
name: "ManageMain",
components: {draggable},
data() {
return {
teamData: [],
clickId: '',
updateTeam: {
loading: false,
loadingText: '加载中',
visible: false,
teamId: '',
baseInfo: {//
form: {
teamName: '',
category: '',
categoryOpts: [],
teamDesc: '',
teamLogo: {
color: '',
code: ''
}
},
rules: {
category: [
{ required: true, message: '[工作网络]不允许为空', trigger: 'blur' },
],
teamName: [
{ required: true, message: '[名称]不允许为空', trigger: 'blur' },
]
}
}
},
isLoaded: false,
iconPickerOptions: {
type: "background", //type"background"type"icon"
fatherWidth: 70, //type"background"type"icon"80px30px
iconFontSize: 52, //iconfont30px16px
colorList: ["#dc4f39", "#ff9421", "#009b52", "#3383da", "#009688", "#6600d5", "#0b0e7b", "#666666", "#e6e8ea"], //
iconfontArray: production ? window.iconfontArray : iconDevArr, //iconfont
}
}
},
inject: ['openTeam'],
mounted() {
this.initData();
},
methods: {
draggableDrop(ev) {
ev.stopPropagation();
ev.preventDefault();
ev.dataTransfer = ev.originalEvent.dataTransfer;
},
onDragTeamSort() {//
const that = this;
const teamIds = [];
for (let i = 0; i < that.teamData.length; i++) {
teamIds.push(that.teamData[i].teamId);
}
const data = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_user_team_sort',
teamIds: JSON.stringify(teamIds)
}
};
//
awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') {
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
console.log(this.teamData);
},
initData() {
const that = this;
const data = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_joined_team_list_query',
}
};
//
awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') {
that.teamData = ro.data;
if (that.teamData.length == 0) {
parent.location.reload();
return;
}
that.clickTeam(that.teamData[0].teamId);//
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
},
clickTeam(teamId) {//
this.openTeam(teamId);
this.clickId = teamId;
},
clearUpdateTeamContent() {//
const that = this;
that.updateTeam.baseInfo.form.teamName = '';
that.updateTeam.baseInfo.form.category = '';
that.updateTeam.baseInfo.form.teamDesc = '';
that.updateTeam.baseInfo.form.teamLogo = {};
that.updateTeam.loadingText = '加载中';
that.updateTeam.teamId = '';
that.isLoaded = false;
},
changeCategory(val) {//
this.updateTeam.baseInfo.form.category = val;
},
updateTeamInfo(teamId) {//
const that = this;
that.clearUpdateTeamContent();
that.updateTeam.teamId = teamId;
that.updateTeam.visible = true;
// axios
that.updateTeam.loading = true;
const data = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_query',
teamId: teamId
}
};
awsuiAxios.post(data).then(function (ro) {
if (ro.result == 'ok') {
const data = ro.data;
that.updateTeam.baseInfo.form.teamName = data.teamName;
that.updateTeam.baseInfo.form.category = data.category;
that.updateTeam.baseInfo.form.categoryOpts = data.categoryArr;
that.updateTeam.baseInfo.form.teamDesc = data.teamDesc;
that.updateTeam.baseInfo.form.teamLogo = data.teamLogo;
that.isLoaded = true;
} else {
that.$message.error(ro.msg);
}
that.updateTeam.loading = false;
}).catch(error=>{
console.log(error);
that.updateTeam.loading = false;
})
},
validateUpdateTeam() {
this.$refs.updateTeamForm.validate().then(valid => {
if (!valid) {
return
}
this.updateTeamSave()
});
},
updateTeamSave() {//
const that = this;
//
const teamName = that.updateTeam.baseInfo.form.teamName;
const category = that.updateTeam.baseInfo.form.category;
const teamDesc = that.updateTeam.baseInfo.form.teamDesc;
const teamLogo = that.updateTeam.baseInfo.form.teamLogo;
const data = {
teamId: that.updateTeam.teamId,
teamName: teamName,
category: category,
teamDesc: teamDesc,
teamLogo: teamLogo
};
that.updateTeam.loadingText = '请稍等';
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_team_baseinfo_update_save',
data: JSON.stringify(data)
}
};
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
const teamId = ro.data.teamId;
for (let i = 0; i < that.teamData.length; i++) {
if (teamId == that.teamData[i].teamId) {
that.teamData[i].teamName = ro.data.teamName;
that.teamData[i].teamLogo = ro.data.teamLogo;
}
}
if (teamId == that.clickId) {
//
that.clickTeam(teamId);
}
that.updateTeam.visible = false;
} else {
that.$message.error(ro.msg);
}
that.updateTeam.loading = false;
}).catch(error=>{
console.log(error);
that.updateTeam.loading = false;
})
},
updateTeamStatus(teamId, status) {// /
const that = this;
that.updateTeam.loadingText = '请稍等';
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_team_update_status',
status: status,
teamId: teamId
}
};
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
let msg = '停用';
if (status == 0) {
msg = '启用';
}
that.$message({
message: msg + '成功',
type: 'success'
});
for (let i = 0; i < that.teamData.length; i++) {
if (teamId == that.teamData[i].teamId) {
that.teamData[i].run = status == 0;
}
}
if (teamId == that.clickId) {
//
that.clickTeam(teamId);
}
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
},
removeTeam(teamId) {//
this.$confirm('解散小组不可恢复,确定要解散小组吗?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'button-general-color',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const that = this;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_team_remove',
teamId: teamId
}
};
//
awsuiAxios.post(params).then(function (ro) {
if(ro.result == 'ok') {
that.$message({
message: '解散成功',
type: 'success'
});
that.initData();
} else {
that.$message({
message: ro.msg,
type: 'warning'
});
}
}).catch(error=>{
console.log(error);
})
}).catch(() => {
});
},
exitTeam(teamId) {// 退
this.$confirm('确定要退出小组吗?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'button-general-color',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const that = this;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_manage_team_exit',
teamId: teamId
}
};
//
awsuiAxios.post(params).then(function (ro) {
if(ro.result == 'ok') {
that.$message({
message: '退出成功',
type: 'success'
});
that.initData();
} else {
that.$message({
message: ro.msg,
type: 'warning'
});
}
}).catch(error=>{
console.log(error);
})
}).catch(() => {
});
},
changeIcon(icon) {
this.updateTeam.baseInfo.form.teamLogo.code = icon.icon;
this.updateTeam.baseInfo.form.teamLogo.color = icon.color;
}
}
}
</script>
<style scoped>
#manageMain >>> .awsui-dialog__body {
padding-top: 5px;
}
#manageMain >>> .awsui-icon-picker-box1 {
border-radius: 15%;
}
.team-item-div {
height: 46px;
padding: 6px 0 4px 0px;
}
.team-item-icon-div {
position: relative;
top:5px;
width: 32px;
height: 32px;
line-height: 32px;
vertical-align: middle;
text-align: center;
border-radius: 15%;
}
.team-item-text-div {
margin-left: 7px;
position: relative;
top: 12px;
}
.team-item-text-div div{
width: 170px;
}
.team-item-text-div div p{
width: 160px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.inline-block {
display: inline-block;
}
.cursor-pointer {
cursor: pointer;
}
.general-bgcolor-hover:hover .icon-drag {
display: inline;
}
.general-bgcolor-hover .icon-drag {
display: none;
}
.general-bgcolor-hover:hover .operate-icon-display {
display: inline;
}
.general-bgcolor-hover .operate-icon-display {
display: none;
}
.general-bgcolor-hover:hover .team-item-text-div p {
color: #4E7FF9 !important;
}
.team-item-div-checked {
color: #4E7FF9;
}
.icon-team-div {
position:absolute;
right: 40px;
top: 45px;
z-index: 2;
height: 70px;
width: 70px;
line-height: 70px;
display: inline-block;
}
.icon-team {
color: white;
font-size: 52px;
}
.required-logo /deep/ label {
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,210 @@
<template>
<awsui-layout>
<awsui-main>
<awsui-dialog
v-loading="loading"
element-loading-text="加载中"
:border=false
:title=title
:visible.sync="dialogVisible"
width="400px"
:close-on-click-modal=false
:before-close="handleClose">
<!--awsui-dialog标签中的内容都可以自行去控制-->
<div class="text-general-color">
<awsui-form ref="form" :model="form" label-position="top">
<div class="awsui-form-item">
<label class="awsui-form-item__label">成员</label>
<div class="awsui-form-item__content">
<awsui-select filterable v-model="form.userArr" :options="form.userOpts" multiple size="large" key="user"></awsui-select>
</div>
</div>
<div class="awsui-form-item">
<label class="awsui-form-item__label">角色</label>
<label class="awsui-form-item__label text-linker-color" style="cursor: pointer;" @click="createRole">无满足角色去添加</label>
<div class="awsui-form-item__content">
<awsui-select filterable v-model="form.roleId" :options="form.roleOpts" size="large" key="role"></awsui-select>
</div>
</div>
</awsui-form>
</div>
<span slot="footer" class="dialog-footer">
<awsui-button :disabled="buttonDisabled" class="button-general-color" type="primary" @click="submit">确定</awsui-button>
<awsui-button @click="cancel">取消</awsui-button>
</span>
</awsui-dialog>
<role-update
ref="roleUpdate"
:visible.sync="roleUpdate.visible"
:teamId="teamId"
:roleId="roleUpdate.roleId"
v-on:cancel="roleUpdate.visible = false"
v-on:getResult="updateRoleDone"/>
</awsui-main>
</awsui-layout>
</template>
<script>
import awsuiAxios from "../../awsuiAxios";
import RoleUpdate from "../role/RoleUpdate";
export default {
name: "MemberAdd",
components: {RoleUpdate},
props: {
visible: {
type: Boolean,
default: false
},
teamId: {// ID
type: String,
default: ''
},
title: {//
type: String,
default: ''
}
},
data() {
return {
dialogVisible: false,
loading: false,
buttonDisabled: false,
form: {
userArr: [],
userOpts: [],
roleId: '',
roleOpts: []
},
roleUpdate: {
visible: false,
roleId: '',
}
}
},
methods: {
initData() {
const that = this;
that.loading = true;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_member_add_data_query',
teamId: that.teamId
}
};
//
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
const data = ro.data;
that.form.roleOpts = data.roleOpts;
that.form.userOpts = data.userOpts;
} else {
that.$message.error(ro.msg);
}
that.loading = false;
}).catch(error=>{
console.log(error);
that.loading = false;
})
},
clearAllData() {//
const that = this;
that.form.userArr = [];
that.form.userOpts = [];
that.form.roleId = '';
that.form.roleOpts = [];
that.buttonDisabled = false;
},
handleClose(done) {
this.closeDlalog('cancel');
done();
},
cancel() {
this.closeDlalog('cancel');
},
submit() {
this.closeDlalog('save');
},
closeDlalog(type) {// /
const that = this;
if (type == 'save') {
if (that.form.userArr.length == 0) {
that.$message.error('请选择[成员]');
return;
}
if (that.form.roleId == '') {
that.$message.error('请选择[角色]');
return;
}
const data = {
teamId: that.teamId,
userArr: that.form.userArr,
roleId: that.form.roleId
};
//
that.loading = true;
that.buttonDisabled = true;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_member_add_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({
message: ro.msg,
type: 'warning'
});
}
}).catch(error=>{
console.log(error);
that.loading = false;
that.buttonDisabled = false;
})
} else {
that.$emit('cancel');
that.dialogVisible = false;
//
that.clearAllData();
}
},
createRole() {//
this.roleUpdate.roleId = '';
this.roleUpdate.visible = true;
},
updateRoleDone(result) {//
this.roleUpdate.visible = false;
if (result == 'ok') {
this.initData();
}
}
},
watch: {
visible(val) {
this.dialogVisible = val;
if (val) {//
this.initData();
} else {//
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,283 @@
<template>
<awsui-layout id="roleManage">
<awsui-dialog
v-loading="loading"
element-loading-text="加载中"
:border=false
:title=title
:visible.sync="dialogVisible"
width="500px"
height="300px"
:close-on-click-modal=false
:before-close="handleClose">
<!--awsui-dialog标签中的内容都可以自行去控制-->
<div class="text-general-color">
<div style="border-top:1px solid #F2F2F2;"></div>
<div style="width: 100%;height: 258px;overflow-y: auto;">
<ul>
<li v-for="item in roleData" class="general-bgcolor-hover" :style="{'background-color': item.roleId == checkdRole ? '#F5F7FA' : ''}">
<div style="width: 100%;height: 50px;line-height: 50px;vertical-align: middle;">
<div style="width: 15%;display: inline-block;text-align: center;">
<i class="iconfont" v-html="item.icon"></i>
</div>
<div style="width: 70%;display: inline-block;line-height: 25px;vertical-align: middle;">
<p class="text-overflow-hidden" style="position:relative;top: 2px;font-size: 14px;">{{item.roleName}}</p>
<el-tooltip class="item" effect="dark" :content="item.roleDesc" placement="bottom-start">
<p class="text-overflow-hidden text-second-color" style="position:relative;top: -2px;font-size: 12px;">{{item.roleDesc}}</p>
</el-tooltip>
</div>
<div style="width: 15%;display: inline-block;text-align: center;">
<i v-if="type=='roleManage' && item.roleType!=0" class="awsui-iconfont general-bgcolor-text-hover operate-icon-display" style="cursor: pointer;font-size: 14px;" @click="updateRole(item.roleId)">&#xe622;</i>
<i v-if="type=='roleManage' && item.roleType!=0 && item.roleType!=1 && item.roleType!=2" class="awsui-iconfont general-bgcolor-text-hover operate-icon-display" style="padding-left: 10px;cursor: pointer;font-size: 14px;" @click="removeRole(item.roleId)">&#xe626;</i>
<awsui-radio v-if="type=='roleConfig'" v-else size="small" :label="item.roleId" :showText="false" v-model="checkdRole"></awsui-radio>
</div>
</div>
</li>
</ul>
</div>
<div style="border-top: 1px solid #F2F2F2;">
<div class="text-linker-color" style="cursor: pointer; width: 100%;height: 30px;line-height: 30px;vertical-align: middle;padding-top:8px;" @click="updateRole('')">
<div style="width: 15%;display: inline-block;text-align: center;">
<i class="awsui-iconfont">&#xe615;</i>
</div>
<div style="width: 85%;display: inline-block;">
<span v-if="type == 'roleConfig'">无满足角色去添加</span>
<span v-else>添加角色</span>
</div>
</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>
</awsui-dialog>
<role-update
ref="roleUpdate"
:visible.sync="roleUpdate.visible"
:teamId="teamId"
:roleId="roleUpdate.roleId"
v-on:cancel="roleUpdate.visible = false"
v-on:getResult="updateRoleDone"/>
</awsui-layout>
</template>
<script>
import awsuiAxios from "../../awsuiAxios";
import RoleUpdate from "./RoleUpdate";
export default {
name: "RoleManage",
components: {RoleUpdate},
props: {
visible: {
type: Boolean,
default: false
},
teamId: {// ID
type: String,
default: ''
},
title: {//
type: String,
default: ''
},
userIds: {// Ids
type: Array,
default: function () {
return []
}
},
type: {// roleManage roleConfig
type: String,
default: 'roleManage'
}
},
data() {
return {
dialogVisible: false,
loading: false,
roleData: [],
checkdRole: '',
roleUpdate: {
visible: false,
roleId: '',
}
};
},
created() {
},
mounted() {
},
methods: {
initData() {//
const that = this;
that.loading = true;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_role_data_query',
teamId: that.teamId,
userIds: JSON.stringify(that.userIds)
}
};
//
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
const data = ro.data;
that.roleData = data.roleData;
if (data.roleIds && data.roleIds.length > 0) {//
that.checkdRole = data.roleIds[0];
}
} else {
that.$message.error(ro.msg);
}
that.loading = false;
}).catch(error=>{
console.log(error);
that.loading = false;
})
},
clearAllData() {//
const that = this;
that.roleData = [];
that.checkdRole = '';
that.roleUpdate.visible = false;
that.roleUpdate.roleId = '';
},
handleClose(done) {
this.closeDlalog('cancel');
done();
},
cancel() {
this.closeDlalog('cancel');
},
submit() {
this.closeDlalog('save');
},
closeDlalog(type) {// /
const that = this;
if (type == 'save') {
if (this.type == 'roleManage') {//
that.$emit('getResult', 'ok');
} else {//
const data = {
teamId: that.teamId,
userIds: that.userIds,
roleId: that.checkdRole
}
//
that.loading = true;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_role_user_update_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({
message: ro.msg,
type: 'warning'
});
}
}).catch(error=>{
console.log(error);
that.loading = false;
})
}
} else {
that.$emit('cancel');
that.dialogVisible = false;
//
that.clearAllData();
}
},
updateRole(roleId) {//
this.roleUpdate.roleId = roleId;
this.roleUpdate.visible = true;
},
updateRoleDone(result) {//
this.roleUpdate.visible = false;
if (result == 'ok') {
this.initData();
}
},
removeRole(roleId) {
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.cooperation_role_remove',
teamId: that.teamId,
roleId: roleId
}
};
//
awsuiAxios.post(params).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);
})
}).catch(() => {
});
}
},
watch: {
visible(val) {
this.dialogVisible = val;
if (val) {//
this.initData();
} else {//
}
}
}
}
</script>
<style scoped>
#roleManage >>> .awsui-dialog__body {
margin: 0 16px;
}
#roleManage >>> .role_data_perm_textarea textarea {
cursor: pointer;
}
.text-overflow-hidden {
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.general-bgcolor-hover:hover .operate-icon-display {
display: inline;
}
.general-bgcolor-hover .operate-icon-display {
display: none;
}
</style>

View File

@ -0,0 +1,338 @@
<template>
<div>
<awsui-sidebar
:title="title"
:before-close="handleClose"
:wrapper-closable=false
:visible.sync="sidebarVisible">
<!--awsui-sidebar标签中的内容都可以自行去控制-->
<div id="updateRole" v-loading="loading" style="padding: 0px;">
<div style="border-top:1px solid #F2F2F2;"></div>
<div id="drawerBody" :style="{height: drawerBodyHeight}" style="padding: 16px;overflow-y: auto;">
<awsui-form ref="roleForm" :rules="rules" :model="roleForm" label-position="top">
<!-- <div class="awsui-form-item">-->
<!-- <label class="awsui-form-item__label"><span class="text-important-color">*</span>角色名称</label>-->
<!-- <div class="awsui-form-item__content">-->
<!-- <awsui-input v-model="roleForm.roleName"></awsui-input>-->
<!-- </div>-->
<!-- </div>-->
<awsui-form-item label="角色名称" prop="roleName">
<awsui-input placeholder="请输入内容" v-model="roleForm.roleName"></awsui-input>
</awsui-form-item>
<div class="awsui-form-item">
<label class="awsui-form-item__label">角色描述</label>
<div class="awsui-form-item__content">
<awsui-input type="textarea" v-model="roleForm.roleDesc"></awsui-input>
</div>
</div>
<div class="awsui-form-item">
<label class="awsui-form-item__label">数据权限</label>
<el-tooltip class="item" effect="dark" placement="bottom-start" :key="Math.random()">
<div slot="content">选择右侧全选则该角色数据权限始终与小组一致<br/>当小组数据权限调整时该角色数据权限自动调整</div>
<label class="awsui-form-item__label">
<span><i class="awsui-iconfont">&#xe629;</i></span>
</label>
</el-tooltip>
<awsui-checkbox size="small" v-model="roleForm.isAllDataPerm">全部</awsui-checkbox>
<div class="awsui-form-item__content">
<awsui-input class="role_data_perm_textarea" type="textarea" v-model="roleForm.isAllDataPerm ? '全部' : roleForm.dataPermText" readonly placeholder="请选择" @click.native="openDataPermTreeDlg"></awsui-input>
</div>
</div>
<awsui-form-item label="操作权限">
<el-checkbox-group v-model="roleForm.actionPerm">
<template v-for="item in roleForm.actionPermOpts">
<el-checkbox :label="item.label">{{item.value}}</el-checkbox>
</template>
</el-checkbox-group>
</awsui-form-item>
<div class="awsui-form-item">
<label class="awsui-form-item__label">应用权限</label>
<el-tooltip class="item" effect="dark" placement="bottom-start" :key="Math.random()">
<div slot="content">选择右侧全选则该角色默认拥有所有相关应用权限<br/>当PAL小组有新的扩展应用时该角色应用权限自动增加</div>
<label class="awsui-form-item__label">
<span><i class="awsui-iconfont">&#xe629;</i></span>
</label>
</el-tooltip>
<awsui-checkbox size="small" v-model="roleForm.isAllAppPerm"></awsui-checkbox>
<div class="awsui-form-item__content">
<el-checkbox-group v-model="roleForm.appPerm">
<template v-for="item in roleForm.appPermOpts">
<el-checkbox :disabled="roleForm.isAllAppPerm" :label="item.label">{{item.value}}</el-checkbox>
</template>
</el-checkbox-group>
</div>
</div>
</awsui-form>
</div>
<div class="drawer-footer" :style="{'background-color': '#F2F2F2', height: footerHeight}">
<div id="drawerFooter" style="float: right;position: relative;top: 9px;">
<awsui-button :disabled="buttonDisabled" size="large" style="width: 80px;" class="button-general-color" type="primary" @click="submit">保存</awsui-button>
<awsui-button size="large" style="width: 80px;" @click="cancel">取消</awsui-button>
</div>
</div>
</div>
</awsui-sidebar>
<cooperation-repository-tree
ref="cooperationRepositoryTree"
:visible.sync="cooperationRepositoryTree.visible"
:wsId="wsId"
:teamId="teamId"
:multiple=true
v-on:cancel="cooperationRepositoryTree.visible = false"
v-on:getResult="saveCooperationRepositoryResult"
:title="cooperationRepositoryTree.title"
:selected="JSON.parse(JSON.stringify(roleForm.dataPerm))"
/>
</div>
</template>
<script>
import awsuiAxios from "../../awsuiAxios";
import cooperationRepositoryTree from "../../components/CooperationRepositoryTree/component"
export default {
name: "RoleUpdate",
components: {cooperationRepositoryTree},
props: {
visible: {
type: Boolean,
default: false
},
teamId: {// ID
type: String,
default: ''
},
roleId: {// id
type: String,
default: ''
}
},
data() {
return {
loading: false,
sidebarVisible: false,
buttonDisabled: false,
title: '新增角色',
drawerBodyHeight: '0px',
footerHeight: '50px',
wsId: '',
roleForm: {
roleName: '',
roleDesc: '',
roleType: '',
appPermOpts: [],
actionPermOpts: [],
isAllDataPerm: false,
isAllAppPerm: false,
dataPerm: [],
dataPermText: '',//
appPerm: [],
actionPerm: [],
},
cooperationRepositoryTree: {
visible: false,
title: '设置数据权限'
},
rules: {
roleName: [
{required: true,message: '必填',trigger: 'blur'}
]
}
}
},
mounted() {
},
methods: {
initParams() {
if (this.roleId == '') {
this.title = '新增角色';
} else {
this.title = '修改角色';
}
this.initRoleSidebar();
},
initData() {
const that = this;
that.loading = true;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_role_create_or_update_data_query',
teamId: that.teamId,
roleId: that.roleId
}
};
//
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
const data = ro.data;
that.wsId = data.wsId;
that.roleForm.roleName = data.roleName;
that.roleForm.roleDesc = data.roleDesc;
that.roleForm.roleType = data.roleType;
that.roleForm.appPermOpts = data.appPermOpts;
that.roleForm.actionPermOpts = data.actionPermOpts;
that.roleForm.isAllDataPerm = data.isAllDataPerm;
that.roleForm.isAllAppPerm = data.isAllAppPerm;
that.roleForm.dataPerm = data.dataPerm;
that.roleForm.appPerm = data.appPerm;
that.roleForm.actionPerm = data.actionPerm;
that.roleForm.dataPermText = data.dataPermText;
} else {
that.$message.error(ro.msg);
}
that.loading = false;
}).catch(error=>{
console.log(error);
that.loading = false;
})
},
openDataPermTreeDlg() {//
this.cooperationRepositoryTree.visible = true;
},
saveCooperationRepositoryResult(data) {//
//
const that = this;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_repository_names_query',
versionIds: JSON.stringify(data)
}
};
//
awsuiAxios.post(params).then(function (ro) {
if (ro.result == 'ok') {
const data = ro.data;
that.roleForm.dataPerm = data.versionIdArr;
that.roleForm.dataPermText = data.names;
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
this.cooperationRepositoryTree.visible = false;
},
clearAllData() {//
const that = this;
that.buttonDisabled = false;
that.wsId = '';
that.roleForm = {
roleName: '',
roleDesc: '',
roleType: '',
appPermOpts: [],
actionPermOpts: [],
isAllDataPerm: false,
isAllAppPerm: false,
dataPerm: [],
dataPermText: '',//
appPerm: [],
actionPerm: [],
};
},
handleClose(done) {
this.closeDlalog('cancel');
done();
},
cancel() {
this.closeDlalog('cancel');
},
submit() {
this.$refs['roleForm'].validate(valid => {
if (valid){
this.closeDlalog('save');
}
})
},
closeDlalog(type) {// /
const that = this;
if (type == 'save') {
// --
// if (that.roleForm.roleName == '' || that.roleForm.roleName.trim() == '') {
// that.$message.error('[]');
// return;
// }
if (that.roleForm.roleName.trim().length > 30) {
that.$message.error('[角色名称]不允许超过30个字符');
return;
}
if (that.roleForm.roleDesc != '' && that.roleForm.roleDesc.trim().length > 255) {
that.$message.error('[角色名称]不允许超过255个字符');
return;
}
const data = {
teamId: that.teamId,
roleId: that.roleId,
roleName: that.roleForm.roleName,
roleDesc: that.roleForm.roleDesc,
roleType: that.roleForm.roleType,
isAllDataPerm: that.roleForm.isAllDataPerm,
isAllAppPerm: that.roleForm.isAllAppPerm,
dataPerm: that.roleForm.dataPerm,
appPerm: that.roleForm.appPerm,
actionPerm: that.roleForm.actionPerm
};
//
that.loading = true;
that.buttonDisabled = true;
const params = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.cooperation_role_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({
message: ro.msg,
type: 'warning'
});
}
}).catch(error=>{
console.log(error);
that.loading = false;
that.buttonDisabled = false;
})
} else {
that.$emit('cancel');
that.dialogVisible = false;
//
that.clearAllData();
}
},
initRoleSidebar() {
this.drawerBodyHeight = (document.documentElement.clientHeight) - 53 - 1 - 32 - parseInt(this.footerHeight) + 'px';
},
},
watch: {
visible(val) {
this.sidebarVisible = val;
if (val) {//
this.initParams();
this.initData();
} else {//
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,42 @@
* {
padding: 0;
margin: 0;
}
body {
color: #4a4a4a;
font-family: PingFangSC-Light;
}
ul {
list-style: none;
}
a {
text-decoration: none;
}
div,span,section,i,button {
-webkit-tap-highlight-color: transparent;
outline: none;
}
.radius3 {
-moz-border-radius: 3px 3px 3px 3px;
-webkit-border-radius: 3px 3px 3px 3px;
border-radius: 3px 3px 3px 3px;
}
.tree-content-icon {
font-size: 13px;
}
.tree-content-icon-padding {
padding-right: 2px;
}
.el-input__inner {
border-radius: 0px;
}
.el-textarea__inner {
border-radius: 0px;
}

View File

@ -0,0 +1,221 @@
/*设计颜色规范*/
/*
通用鼠标悬浮色
所有悬浮状态的底色包括下拉列表项表格卡片等
*/
.general-bgcolor-hover:hover {
background-color: #F5F7FA !important;
}
.general-bgcolor-text-hover:hover {
background-color: #F5F7FA !important;
color : #4E7FF9 !important;
}
/*通用分隔线*/
.general-dividing-line {
color: #F2F2F2;
}
/**********************下拉菜单覆盖*************************/
/*下拉菜单定义悬浮颜色和悬浮字体色*/
.el-dropdown-menu__item:not(.is-disabled):hover{
background-color: #F5F7FA !important;
color: #333333 !important;
}
/**********************导航菜单栏颜色设置*************************/
.el-menu-item:hover{
color: #4E7FF9;
background-color: #F5F7FA !important;
}
.el-submenu__title:hover{
background-color: #F5F7FA !important;
}
.el-menu-item.is-active {
color: #4E7FF9;
background-color: #F5F7FA !important;
}
/**********************文字*************************/
/*主要字体颜色,通用字体颜色,系统普遍使用的字体颜色*/
.text-general-color {
color : #606266;
}
.text-general-bgcolor {
background-color : #606266;
}
/*
次要字体颜色
1 次要标注性信息 管理员 于2020年2月23日 19:30 修改
2 非重要按钮 取消按钮文本
3 列表表头 流程清单编号流程名称
*/
.text-second-color {
color : #909399;
}
.text-second-bgcolor {
background-color : #909399;
}
/*链接、可点击文本、icon颜色*/
.text-linker-color {
color : #4E7FF9;
}
.text-linker-bgcolor {
background-color : #4E7FF9;
}
/*重要文本颜色*/
.text-important-color {
color : #D9001B;
}
.text-important-bgcolor {
background-color : #D9001B;
}
/**********************表格*************************/
/*表头文字颜色*/
.table-head-text-color {
color: #909399;
}
/*表头背景颜色*/
.table-head-bgcolor {
}
/*表头文字颜色*/
.table-body-text-color {
}
/*表格表体背景颜色*/
.table-body-bgcolor {
}
/*表格表体行鼠标悬浮色*/
.table-body-row-bgcolor:hover {
background-color: #F5F7FA !important;
}
/*表格表体行下划线颜色*/
.el-table td {
border-bottom: 1px solid #F2F2F2;
}
/**********************按钮*************************/
/*通用按钮1例如窗口确定按钮新建按钮等设计颜色*/
.button-general-color {
background-color: #4E7FF9 !important;
border-color: #4E7FF9 !important;
}
.button-general-color-reverse {
border-color: #4E7FF9 !important;
color: #4E7FF9 !important;
}
/*通用按钮2例如重要操作类按钮*/
.button-general-color2 {
background-color: #D9001B !important;
border-color: #D9001B !important;
}
.button-general-color-reverse2 {
border-color: #D9001B !important;
color: #D9001B !important;
}
/*通用按钮3例如取消等灰色按钮*/
.button-general-color3 {
background-color: #909399 !important;
border-color: #909399 !important;
}
.button-general-color-reverse3 {
border-color: #909399 !important;
color: #909399 !important;
}
/********************多选框***********************/
.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #4E7FF9;
border-color: #4E7FF9;
}
.el-checkbox__input.is-checked+.el-checkbox__label {
color: #4E7FF9;
}
/********************单选框***********************/
.el-radio__input.is-checked .el-radio__inner {
border-color: #4E7FF9;
background: #4E7FF9;
}
.el-radio__input.is-checked+.el-radio__label {
color: #4E7FF9;
}
/********************列表***********************/
.li-general-hover-bgcolor:hover {
background-color: #F5F7FA;
}
.el-table__body tr.current-row>td {
background-color: #F5F7FA;
}
/*******************加载中颜色********************/
.el-loading-spinner .path {
stroke: #4E7FF9;
}
.el-loading-spinner .el-loading-text {
color: #4E7FF9;
}
/******************下拉框文字选中颜色*************/
.el-select-dropdown__item.selected {
color: #4E7FF9;
}
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected {
color: #4E7FF9;
}
/*****************步骤条**********************/
.el-step__title.is-process {
color: #909399;
}
.el-step__title.is-finish {
color: #4E7FF9;
}
.el-step__head.is-process {
color: #909399;
border-color: #909399;
}
.el-step__head.is-finish {
color: #4E7FF9;
border-color: #4E7FF9;
}
/*********************Popover 弹出框***********************/
.el-popover__title {
color : #606266;
font-weight: 600;
}
/*********************树***********************/
.el-tree-node__content {
height: 30px;
}
/*树展开关闭图标大小*/
.el-tree-node__expand-icon {
font-size: 12px;
}
/*树展开关闭图标的padding*/
.el-tree-node__content>.el-tree-node__expand-icon {
padding: 1px;
}
.el-table__empty-text {
font-size: 12px;
}

View File

@ -117,10 +117,7 @@ module.exports = {
// hotOnly: false,
// before: app => {}
// },
devServer: {
host: '192.168.3.12',//如果是真机测试就使用这个IP
port: 8081,
},
// 第三方插件配置
pluginOptions: {
},