Compare commits

..

No commits in common. "9fb0524c6b197215cdec70b6987ebdaa3e705341" and "72fd575dde721d6ae9a8e62a30ef194be3988857" have entirely different histories.

7 changed files with 77 additions and 151 deletions

View File

@ -4,8 +4,9 @@
:style="{'--row':row}">
<slot name="pre"></slot>
<div style="display: flex;">
<div v-for="(user,index) in userInfo" :key="index" class="avatar_name">
<el-avatar size="large"
<div v-for="(user,index) in userInfo" :key="index">
<div>
<el-avatar style="margin-right: 5px;" size="large"
:src="user.avatar"></el-avatar>
<div v-if="user.icon"
class="el-timeline-item__node" :style="{
@ -16,9 +17,8 @@
:class="user.icon"
></i>
</div>
<el-tooltip class="item" effect="dark" :content="user.name" placement="bottom-start">
<span class="item_name">{{ user.name }}</span>
</el-tooltip>
</div>
<div>{{user.name}}</div>
</div>
</div>
</div>
@ -27,20 +27,20 @@
<script>
export default {
name: "AvatarEllipsis",
install(Vue) {
install(Vue){
Vue.component('avatarEllipsis', this)
},
components: {},
props: {
props:{
row: {
type: Number,
default: 1
},
hoverTip: {
hoverTip:{
type: Boolean,
default: false
},
userInfo: {
userInfo:{
type: Array,
default: []
}
@ -52,7 +52,7 @@ export default {
return {}
},
methods: {
init() {
init(){
for (let user of this.userInfo) {
this.initUser(user)
}
@ -60,26 +60,26 @@ export default {
initUser(user) {
let state = user.state
//
if (state === 'CREATE') {
if (state === 'create') {
this.$set(user, "icon", "el-icon-check")
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'AGREE') {
if (state === 'agree') {
this.$set(user, "icon", "el-icon-check")
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'RUNNING') {
if (state === 'running') {
this.$set(user, "icon", "el-icon-loading")
this.$set(user, "color", "#f78f5f")
}
//
if (state === 'REFUSE') {
if (state === 'refuse') {
this.$set(user, "icon", "el-icon-close")
this.$set(user, "color", "#f56c6c")
}
if (state === 'PASS') {
if (state === 'pass'){
this.$set(user, "icon", "el-icon-more")
this.$set(user, "color", "#c0c4cc")
}
@ -90,18 +90,5 @@ export default {
</script>
<style scoped>
.avatar_name {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 5px;
/*width: 45px;*/
}
.item_name{
width: 45px;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden
}
</style>

View File

@ -19,6 +19,7 @@
<el-tree :data="dataList" ref="tree" :props="defaultProps" empty-text="" node-key="value"
:default-expanded-keys="expandedKeys"
@node-click="handleChange"
:filter-node-method="filterNode"
>
<div class="tree-node" slot-scope="{ node,data }">
<div v-if="data.type === 0" style="display: flex;align-items: center">
@ -69,12 +70,6 @@ export default {
return [];
}
},
selected: {
type: Array,
default: () => {
return [];
}
},
multiple: { //
default: true,
type: Boolean
@ -132,43 +127,33 @@ export default {
},
getList() {
getUserTree(this.radio, this.chooseId).then(res => {
console.log('人员', res.data)
// if (res.data) {
if (res.data) {
if (this.selectItem.type === -1 || this.selectItem.type === -2) {
this.dataList = res.data
}
else if (this.selectItem.type === 1) {
this.dataList = this.setData(res.data)
} else if (this.selectItem.type === 1) {
this.selectItem.children = res.data
} else if (this.selectItem.type === 2) {
this.selectItem.children = res.data
this.selectItem.children = this.setData(res.data)
}
}
// }
});
},
setData(source) {
// for (let item of source) {
// this.$set(item, "value", this.selectItem.value + "-" + item.id)
// }
for (let item of source) {
this.$set(item, "value", this.selectItem.value + "-" + item.id)
this.$set(item, "children", [])
}
return source;
},
//
// filterNode(value, data) {
// if (!value) return true;
// return data.name.indexOf(value) !== -1;
// },
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
//
showUserPicker() {
this.selectItem = {
type: -1,
value: '0',
}
this.dataList = []
// this.selectList = []
this.chooseId = 0
this.radio = 0
this.visible = true;
this.getList();
this.visible = true;
},
//
handleChange(item, check) {
@ -177,8 +162,8 @@ export default {
if (item.type !== 0) {
this.chooseId = item.id
this.getList()
return
}
if (!item.children) {
if (this.multiple) {
//
for (let i = 0; i < this.selectList.length; i++) {
@ -191,6 +176,7 @@ export default {
} else {
this.selectList = [item];
}
}
// this._value = this.selectList
},
//×
@ -216,7 +202,6 @@ export default {
//
selectConfirm() {
this.$emit("ok", this.selectList);
// this.dataList = []
this.visible = false;
}
}

View File

@ -9,7 +9,7 @@
<el-button icon="el-icon-user" type="primary" size="mini" round @click="$refs.userPicker.showUserPicker()">
选择人员
</el-button>
<user-select :multiple="multiple" ref="userPicker" title="请选择系统用户" :v-mode="_value" @ok="selected"/>
<user-select type="user" :multiple="multiple" ref="userPicker" :selected="_value" @ok="selected"/>
<span class="placeholder"> {{ placeholder }}</span>
<div style="display: flex;">
<div class="userStyle" v-for="(user, i) in _value" :key="i">

View File

@ -9,11 +9,11 @@
placement="top">
<el-card>
<div style="display: flex;">
<div v-for="(user,index) in operation.userInfo" :key="index" class="avatar_name">
<el-avatar size="large"
<div v-for="(user,index) in operation.userInfo" :key="index">
<el-avatar style="margin-right: 5px;" size="large"
:src="user.avatar"></el-avatar>
<div v-if="!$slots.dot && operation.userInfo.length > 1"
class="el-timeline-item__node avatar_icon" :style="{
class="el-timeline-item__node" :style="{
backgroundColor: user.color
}">
<i v-if="user.icon"
@ -21,9 +21,6 @@
:class="user.icon"
></i>
</div>
<el-tooltip effect="dark" :content="user.name" placement="bottom-start">
<span class="username">{{ user.name }}</span>
</el-tooltip>
</div>
<div style="margin-left: 10px;">
<div style="color: #c0bebe">{{ operation.operationName }}</div>
@ -148,26 +145,26 @@ export default {
initUser(user) {
let state = user.state
//
if (state === 'CREATE') {
if (state === 'create') {
this.$set(user, "icon", "el-icon-check")
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'AGREE') {
if (state === 'agree') {
this.$set(user, "icon", "el-icon-check")
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'RUNNING') {
if (state === 'running') {
this.$set(user, "icon", "el-icon-loading")
this.$set(user, "color", "#f78f5f")
}
//
if (state === 'REFUSE') {
if (state === 'refuse') {
this.$set(user, "icon", "el-icon-close")
this.$set(user, "color", "#f56c6c")
}
if (state === 'PASS'){
if (state === 'pass'){
this.$set(user, "icon", "el-icon-more")
this.$set(user, "color", "#c0c4cc")
}
@ -177,47 +174,47 @@ export default {
let state = operation.state
let type = operation.operation
//
if (state === 'CREATE') {
if (state === 'create') {
this.$set(operation, "icon", "el-icon-check")
this.$set(operation, "color", "#0bbd87")
this.$set(operation, "remark", operation.userInfo.name)
}
//
if (state === 'AGREE') {
if (state === 'agree') {
this.$set(operation, "icon", "el-icon-check")
this.$set(operation, "color", "#0bbd87")
this.$set(operation, "remark", operation.userInfo.name + ' (已同意)')
}
if (state === 'PASS'){
if (state === 'pass'){
this.$set(operation, "icon", "el-icon-more")
this.$set(operation, "color", "#c0c4cc")
}
//
if (state === 'RUNNING') {
if (state === 'running') {
this.$set(operation, "icon", "el-icon-loading")
this.$set(operation, "color", "#f78f5f")
this.$set(operation, "remark", operation.userInfo.name + ' (处理中)')
}
//
if (type === 'CC') {
if (type === 'cc') {
this.$set(operation, "icon", "el-icon-s-promotion")
this.$set(operation, "color", "#3395f8")
this.$set(operation, "remark", operation.userInfo.name + ' (抄送成功)')
}
//
if (state === 'COMMENT') {
if (state === 'comment') {
this.$set(operation, "icon", "el-icon-chat-dot-round")
this.$set(operation, "color", "#0bbd87")
this.$set(operation, "remark", operation.userInfo.name + ' (添加了评论)')
}
//
if (state === 'REFUSE' && type === 'COMMENT') {
if (state === 'refuse' && type === 'comment') {
this.$set(operation, "icon", "el-icon-chat-dot-round")
this.$set(operation, "color", "#f56c6c")
this.$set(operation, "remark", operation.userInfo.name + ' (填写拒绝理由)')
}
//
if (state === 'REFUSE' && type === 'OPINION') {
if (state === 'refuse' && type === 'opinion') {
this.$set(operation, "icon", "el-icon-close")
this.$set(operation, "color", "#f56c6c")
this.$set(operation, "remark", operation.userInfo.name + ' (拒绝)')
@ -233,25 +230,5 @@ export default {
/deep/ .el-card__body, .el-main {
padding: 10px;
}
.avatar_name{
width: 45px;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
margin-right: 5px;
}
.avatar_icon{
position: absolute;
bottom: 16px;
right: -2px;
}
.username{
width: 45px;
padding-top: 2px;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden
}
</style>

View File

@ -27,7 +27,7 @@ export default {
computed:{
selectUser(){
return {
show: this.config.props.assignedType !== 'ASSIGN_USER',
show: this.config.props.shouldAdd,
multiple: true
};
},

View File

@ -11,10 +11,8 @@
<div class="node-body-content">
<i :class="leftIcon" v-if="leftIcon"></i>
<template v-if="viewer && selectUser.show">
<div class="avatar_button">
<avatar-ellipsis :row="3" v-if="userInfo.length > 0" :user-info="userInfo"/>
<el-button type="primary" icon="el-icon-plus" circle @click="$refs.userPicker.showUserPicker()"/>
</div>
<avatar-ellipsis :row="3" v-if="userInfo.length > 0" :user-info="userInfo"/>
</template>
<template v-else-if="showAvatar">
<span class="placeholder" v-if="userInfo.length === 0">{{ placeholder }}</span>
@ -42,8 +40,8 @@
@insertNode="type => $emit('insertNode', type)"></insert-button>
</div>
</div>
<user-picker v-if="selectUser.show" title="请选择系统用户" :multiple="selectUser.multiple" ref="userPicker"
:selected="_userInfo"
<user-picker v-if="selectUser.show" title="请选择系统角色" :multiple="selectUser.multiple" ref="userPicker"
:v-model="userInfo"
@ok="selectedUser"/>
</div>
</template>
@ -79,7 +77,7 @@ export default {
//
userInfo: {
type: Array,
default() {
default(){
return []
}
},
@ -131,20 +129,12 @@ export default {
},
},
data() {
return {}
return{}
},
computed: {
viewer() {
return this.$store.state.diagramMode === 'viewer'
},
_userInfo: {
get() {
return this.userInfo
},
set(val) {
this.userInfo = val
}
},
},
methods: {
selectedUser(select) {
@ -157,9 +147,8 @@ export default {
}
userInfoList.push(userInfo)
}
//todo ,
this._userInfo = userInfoList
this.$store.state.selectUserMap.set(this.$store.state.selectedNode.id, userInfoList)
this.userInfo = userInfoList
this.$store.state.selectUserMap.set(this.$store.state.selectedNode.id,userInfoList)
},
}
}
@ -240,16 +229,6 @@ export default {
color: #656363;
font-size: 14px;
.avatar_button {
display: flex;
button {
height: 40px;
flex-shrink: 0;
flex-grow: 0;
}
}
i {
position: absolute;
top: 55%;

View File

@ -120,12 +120,10 @@ export default {
// todo
submitForm(){
let processInstance = this.$refs.processInstance;
let selectUserMap = {}
this.$store.state.selectUserMap.forEach(((value, key) => {selectUserMap[key]=value}))
let paramsData = {
processDefinitionId: this.selectForm.processDefinitionId,
formData: JSON.stringify(processInstance.formData),
optionalUser: selectUserMap
selectUserMap: this.$store.state.selectUserMap
}
processInstance.validate(valid => {
if (valid) {