Compare commits

..

No commits in common. "4809a5ce473fc745fc022489ccd2f10f99fbb442" and "4b912c8ee771328f4e4ce361c80201efa2d7f72e" have entirely different histories.

9 changed files with 60 additions and 236 deletions

View File

@ -10,8 +10,8 @@ Vue.prototype.$axios = axios;
// 字体图标 // 字体图标
export function getBaseUrl(){ export function getBaseUrl(){
// return "http://gateway.mytwins.top" return "http://gateway.mytwins.top"
return "http://localhost:8000" // return "http://localhost:8000"
} }
const service = axios.create({ const service = axios.create({

View File

@ -1,94 +0,0 @@
<template>
<div :class="{'line': row === 1, 'lines': row > 1}"
:title="hoverTip ? content: null"
:style="{'--row':row}">
<slot name="pre"></slot>
<div style="display: flex;">
<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="{
backgroundColor: user.color
}">
<i v-if="user.icon"
class="el-timeline-item__icon"
:class="user.icon"
></i>
</div>
</div>
<div>{{user.name}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "AvatarEllipsis",
install(Vue){
Vue.component('avatarEllipsis', this)
},
components: {},
props:{
row: {
type: Number,
default: 1
},
hoverTip:{
type: Boolean,
default: false
},
userInfo:{
type: Array,
default: []
}
},
created() {
this.init()
},
data() {
return {}
},
methods: {
init(){
for (let user of this.userInfo) {
this.initUser(user)
}
},
initUser(user) {
let state = user.state
//
if (state === 'create') {
this.$set(user, "icon", "el-icon-check")
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'agree') {
this.$set(user, "icon", "el-icon-check")
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'process') {
this.$set(user, "icon", "el-icon-loading")
this.$set(user, "color", "#f78f5f")
}
//
if (state === 'refuse') {
this.$set(user, "icon", "el-icon-close")
this.$set(user, "color", "#f56c6c")
}
if (state === 'pass'){
this.$set(user, "icon", "el-icon-more")
this.$set(user, "color", "#c0c4cc")
}
return user;
},
}
}
</script>
<style scoped>
</style>

View File

@ -12,13 +12,13 @@ import "@/assets/theme.less";
import "@/assets/global.css"; import "@/assets/global.css";
import "@/assets/iconfont/iconfont.css" import "@/assets/iconfont/iconfont.css"
import AvatarEllipsis from '@/components/common/AvatarEllipsis'
import Ellipsis from '@/components/common/Ellipsis' import Ellipsis from '@/components/common/Ellipsis'
import WDialog from '@/components/common/WDialog' import WDialog from '@/components/common/WDialog'
import Tip from '@/components/common/Tip' import Tip from '@/components/common/Tip'
import axios from "axios";
import {getBaseUrl} from "./api/request";
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(AvatarEllipsis);
Vue.use(Ellipsis); Vue.use(Ellipsis);
Vue.use(WDialog); Vue.use(WDialog);
Vue.use(Tip); Vue.use(Tip);

View File

@ -74,8 +74,6 @@ export default {
</script> </script>
<style scoped> <style scoped>
p{
background-color: #fff;
}
</style> </style>

View File

@ -9,18 +9,8 @@
placement="top"> placement="top">
<el-card> <el-card>
<div style="display: flex;"> <div style="display: flex;">
<div v-for="(user,index) in operation.userInfo" :key="index"> <div>
<el-avatar style="margin-right: 5px;" size="large" <el-avatar size="large" :src="operation.userInfo.avatar"></el-avatar>
:src="user.avatar"></el-avatar>
<div v-if="!$slots.dot && operation.userInfo.length > 1"
class="el-timeline-item__node" :style="{
backgroundColor: user.color
}">
<i v-if="user.icon"
class="el-timeline-item__icon"
:class="user.icon"
></i>
</div>
</div> </div>
<div style="margin-left: 10px;"> <div style="margin-left: 10px;">
<div style="color: #c0bebe">{{ operation.operationName }}</div> <div style="color: #c0bebe">{{ operation.operationName }}</div>
@ -77,106 +67,46 @@ export default {
}, },
data() { data() {
return { return {
timeline: {}, timeline: {}
} }
}, },
created() { created() {
console.log(this.operationList)
this.init()
}, switch (this.state) {
methods: { case '1':
init() { this.timeline = {
switch (this.state) { color: '#f78f5f',
case '1': icon: 'el-icon-more',
this.timeline = { context: '审批进行中'
color: '#f78f5f',
icon: 'el-icon-more',
context: '审批进行中'
}
break
case '2':
this.timeline = {
color: '#0bbd87',
icon: 'el-icon-check',
context: '审批通过'
}
break
case '3':
this.timeline = {
color: '#f56c6c',
icon: 'el-icon-close',
context: '审核已驳回'
}
break
case '4':
this.timeline = {
color: '#0bbd87',
icon: 'el-icon-check',
context: '审批通过'
}
break
default:
break
}
// let operationListNew = []
console.log(this.operationList.length, "sdjshjdhasjds")
for (let i = 0;i<this.operationList.length;i++) {
let operationNew = this.initOperationFun(this.operationList[i])
console.log(operationNew, "sdjshjdhasjds")
let userList = []
for (let user of operationNew.userInfo) {
let userNew = this.initUser(user)
userList.push(userNew)
} }
console.log(userList, "userList") break
operationNew.userInfo = userList case '2':
// operationListNew.push(operationNew) this.timeline = {
// this.operationList.push(operationNew) color: '#0bbd87',
this.operationList[i] = operationNew icon: 'el-icon-check',
} context: '审批通过'
console.log(this.operationList, "operationListNew")
},
//
getAttachmentList(attachments, image) {
let result = [];
for (let attachment of attachments) {
if (attachment.isImage === image) {
result.push(attachment)
} }
} break
return result; case '3':
}, this.timeline = {
initUser(user) { color: '#f56c6c',
let state = user.state icon: 'el-icon-close',
// context: '审核已驳回'
if (state === 'create') { }
this.$set(user, "icon", "el-icon-check") break
this.$set(user, "color", "#0bbd87") case '4':
} this.timeline = {
// color: '#0bbd87',
if (state === 'agree') { icon: 'el-icon-check',
this.$set(user, "icon", "el-icon-check") context: '审批通过'
this.$set(user, "color", "#0bbd87") }
} break
// default:
if (state === 'process') { break
this.$set(user, "icon", "el-icon-loading") }
this.$set(user, "color", "#f78f5f")
} for (let operation of this.operationList) {
//
if (state === 'refuse') {
this.$set(user, "icon", "el-icon-close")
this.$set(user, "color", "#f56c6c")
}
if (state === 'pass'){
this.$set(user, "icon", "el-icon-more")
this.$set(user, "color", "#c0c4cc")
}
return user;
},
initOperationFun(operation) {
console.log("开始处理内容了")
let state = operation.state let state = operation.state
let type = operation.operation let type = operation.operation
// //
@ -191,10 +121,6 @@ export default {
this.$set(operation, "color", "#0bbd87") this.$set(operation, "color", "#0bbd87")
this.$set(operation, "remark", operation.userInfo.name + ' (已同意)') this.$set(operation, "remark", operation.userInfo.name + ' (已同意)')
} }
if (state === 'pass'){
this.$set(operation, "icon", "el-icon-more")
this.$set(operation, "color", "#c0c4cc")
}
// //
if (state === 'process') { if (state === 'process') {
this.$set(operation, "icon", "el-icon-loading") this.$set(operation, "icon", "el-icon-loading")
@ -225,7 +151,18 @@ export default {
this.$set(operation, "color", "#f56c6c") this.$set(operation, "color", "#f56c6c")
this.$set(operation, "remark", operation.userInfo.name + ' (拒绝)') this.$set(operation, "remark", operation.userInfo.name + ' (拒绝)')
} }
return operation; }
},
methods: {
//
getAttachmentList(attachments, image) {
let result = [];
for (let attachment of attachments) {
if (attachment.isImage === image) {
result.push(attachment)
}
}
return result;
}, },
} }
} }

View File

@ -1,8 +1,7 @@
<template> <template>
<node :title="config.name" :show-error="showError" :content="content" :user-info="config.props.assignedUser" :error-info="errorInfo" <node :title="config.name" :show-error="showError" :content="content" :error-info="errorInfo"
@selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)" @selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)"
placeholder="请设置审批人" :header-bgc="headerBgc" header-icon="el-icon-s-check"/> placeholder="请设置审批人" :header-bgc="headerBgc" header-icon="el-icon-s-check"/>
</template> </template>
<script> <script>

View File

@ -1,5 +1,5 @@
<template> <template>
<node :title="config.name" :show-error="showError" :content="content" :error-info="errorInfo" :user-info="config.props.assignedUser" <node :title="config.name" :show-error="showError" :content="content" :error-info="errorInfo"
@selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)" @selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)"
placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/> placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/>
</template> </template>

View File

@ -9,20 +9,9 @@
</div> </div>
<div class="node-body-content"> <div class="node-body-content">
<i :class="leftIcon" v-if="leftIcon"></i> <i :class="leftIcon" v-if="leftIcon"></i>
<template v-if="$store.state.diagramMode !== 'viewer'"> <span class="placeholder" v-if="(content || '').trim() === ''">{{placeholder}}</span>
<span class="placeholder" v-if="(content || '').trim() === ''">{{placeholder}}</span> <ellipsis :row="3" :content="content" v-else/>
<ellipsis :row="3" :content="content" v-else/> <i class="el-icon-arrow-right" v-if="$store.state.diagramMode !== 'viewer'" ></i>
<i class="el-icon-arrow-right"></i>
</template>
<template v-else>
<template v-if="userInfo.length > 0">
<avatar-ellipsis :row="3" :user-info="userInfo"/>
</template>
<template v-else>
<span class="placeholder" v-if="(content || '').trim() === ''">{{placeholder}}</span>
<ellipsis :row="3" :content="content" v-else/>
</template>
</template>
</div> </div>
<div class="node-error" v-if="showError"> <div class="node-error" v-if="showError">
<el-tooltip effect="dark" :content="errorInfo" placement="top-start"> <el-tooltip effect="dark" :content="errorInfo" placement="top-start">
@ -67,11 +56,6 @@ export default {
type: String, type: String,
default: "" default: ""
}, },
//
userInfo: {
type: Array,
default: []
},
title:{ title:{
type: String, type: String,
default: "标题" default: "标题"

View File

@ -1,5 +1,5 @@
<template> <template>
<node title="发起人" :is-root="true" :content="content" :user-info="config.props.assignedUser" <node title="发起人" :is-root="true" :content="content"
@selected="$emit('selected')" @insertNode="type => $emit('insertNode', type)" @selected="$emit('selected')" @insertNode="type => $emit('insertNode', type)"
placeholder="所有人" :header-bgc="config.props.headerBgc" header-icon="el-icon-user-solid"/> placeholder="所有人" :header-bgc="config.props.headerBgc" header-icon="el-icon-user-solid"/>
</template> </template>