@@ -69,6 +112,7 @@
return {
nodeConfig: {},
drawer: false,
+ isEditTitle: false,
index: 0,
form: {}
}
@@ -85,9 +129,18 @@
show(index){
this.index = index
this.form = {}
- this.form = {...this.nodeConfig.conditionNodes[index]}
+ this.form = JSON.parse(JSON.stringify(this.nodeConfig.conditionNodes[index]))
this.drawer = true
},
+ editTitle(){
+ this.isEditTitle = true
+ this.$nextTick(()=>{
+ this.$refs.nodeTitle.focus()
+ })
+ },
+ saveTitle(){
+ this.isEditTitle = false
+ },
save(){
this.nodeConfig.conditionNodes[this.index] = this.form
this.$emit("update:modelValue", this.nodeConfig)
@@ -98,7 +151,9 @@
this.nodeConfig.conditionNodes.push({
nodeName: "条件" + len,
type: 3,
- priorityLevel: len
+ priorityLevel: len,
+ conditionMode: 1,
+ conditionList: []
})
},
delTerm(index){
@@ -128,11 +183,25 @@
})
this.$emit("update:modelValue", this.nodeConfig)
},
+ addConditionList(){
+ this.form.conditionList.push({
+ label: '',
+ field: '',
+ operator: '=',
+ value: ''
+ })
+ },
+ deleteConditionList(index){
+ this.form.conditionList.splice(index, 1)
+ },
toText(nodeConfig, index){
var { conditionList } = nodeConfig.conditionNodes[index]
- if (conditionList && conditionList.length > 0) {
+ if (conditionList && conditionList.length == 1) {
const text = conditionList.map(item => `${item.label}${item.operator}${item.value}`).join(" 和 ")
return text
+ }else if(conditionList && conditionList.length > 1){
+ const conditionModeText = nodeConfig.conditionNodes[index].conditionMode==1?'且行':'或行'
+ return conditionList.length + "个条件," + conditionModeText
}else{
if(index == nodeConfig.conditionNodes.length - 1){
return "其他条件进入此流程"
diff --git a/src/components/scWorkflow/nodes/promoter.vue b/src/components/scWorkflow/nodes/promoter.vue
index 2d6bec5b..f021db75 100644
--- a/src/components/scWorkflow/nodes/promoter.vue
+++ b/src/components/scWorkflow/nodes/promoter.vue
@@ -5,16 +5,28 @@
{{ nodeConfig.nodeName }}
- 所有人
+
+ {{ toText(nodeConfig) }}
+
-
+
+
+
+
+
+
+
-
-
+
+ 选择角色
+
+ {{role.name}}
+
+
@@ -30,6 +42,7 @@
import addNode from './addNode'
export default {
+ inject: ['select'],
props: {
modelValue: { type: Object, default: () => {} }
},
@@ -40,6 +53,7 @@
return {
nodeConfig: {},
drawer: false,
+ isEditTitle: false,
form: {}
}
},
@@ -54,12 +68,35 @@
methods: {
show(){
this.form = {}
- this.form = {...this.nodeConfig}
+ this.form = JSON.parse(JSON.stringify(this.nodeConfig))
+ this.isEditTitle = false
this.drawer = true
},
+ editTitle(){
+ this.isEditTitle = true
+ this.$nextTick(()=>{
+ this.$refs.nodeTitle.focus()
+ })
+ },
+ saveTitle(){
+ this.isEditTitle = false
+ },
+ selectHandle(type, data){
+ this.select(type, data)
+ },
+ delRole(index){
+ this.form.nodeRoleList.splice(index, 1)
+ },
save(){
this.$emit("update:modelValue", this.form)
this.drawer = false
+ },
+ toText(nodeConfig){
+ if(nodeConfig.nodeRoleList && nodeConfig.nodeRoleList.length > 0){
+ return nodeConfig.nodeRoleList.map(item=>item.name).join("、")
+ }else{
+ return "所有人"
+ }
}
}
}
diff --git a/src/components/scWorkflow/nodes/send.vue b/src/components/scWorkflow/nodes/send.vue
index 6b2c9b36..30bc97e1 100644
--- a/src/components/scWorkflow/nodes/send.vue
+++ b/src/components/scWorkflow/nodes/send.vue
@@ -12,16 +12,24 @@
-
+
+
+
+
+
+
+
-
-
+
+ 选择人员
+
+ {{user.name}}
+
-
-
+
@@ -38,6 +46,7 @@
import addNode from './addNode'
export default {
+ inject: ['select'],
props: {
modelValue: { type: Object, default: () => {} }
},
@@ -48,6 +57,7 @@
return {
nodeConfig: {},
drawer: false,
+ isEditTitle: false,
form: {}
}
},
@@ -62,9 +72,18 @@
methods: {
show(){
this.form = {}
- this.form = {...this.nodeConfig}
+ this.form = JSON.parse(JSON.stringify(this.nodeConfig))
this.drawer = true
},
+ editTitle(){
+ this.isEditTitle = true
+ this.$nextTick(()=>{
+ this.$refs.nodeTitle.focus()
+ })
+ },
+ saveTitle(){
+ this.isEditTitle = false
+ },
save(){
this.$emit("update:modelValue", this.form)
this.drawer = false
@@ -72,12 +91,18 @@
delNode(){
this.$emit("update:modelValue", this.nodeConfig.childNode)
},
+ delUser(index){
+ this.form.nodeUserList.splice(index, 1)
+ },
+ selectHandle(type, data){
+ this.select(type, data)
+ },
toText(nodeConfig){
if (nodeConfig.nodeUserList && nodeConfig.nodeUserList.length>0) {
- const users = nodeConfig.nodeUserList.map(item=>item.name).join(" 或 ")
+ const users = nodeConfig.nodeUserList.map(item=>item.name).join("、")
return users
}else{
- if(nodeConfig.ccSelfSelectFlag){
+ if(nodeConfig.userSelectFlag){
return "发起人自选"
}else{
return false
diff --git a/src/components/scWorkflow/select.vue b/src/components/scWorkflow/select.vue
new file mode 100644
index 00000000..44d338ca
--- /dev/null
+++ b/src/components/scWorkflow/select.vue
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+ {{item.name.substring(0,1)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 确 认
+
+
+
+
+
+
+
diff --git a/src/config/workflow.js b/src/config/workflow.js
new file mode 100644
index 00000000..ceb1305d
--- /dev/null
+++ b/src/config/workflow.js
@@ -0,0 +1,69 @@
+import API from "@/api";
+
+//审批工作流人员/组织选择器配置
+
+export default {
+ //配置接口正常返回代码
+ successCode: 200,
+ //配置组织
+ group: {
+ //请求接口对象
+ apiObj: API.system.role.list,
+ //接受数据字段映射
+ parseData: function (res) {
+ return {
+ rows: res.data,
+ msg: res.message,
+ code: res.code
+ }
+ },
+ //显示数据字段映射
+ props: {
+ key: 'id',
+ label: 'label',
+ children: 'children'
+ }
+ },
+ //配置用户
+ user: {
+ apiObj: API.demo.page,
+ pageSize: 20,
+ parseData: function (res) {
+ return {
+ rows: res.data.rows,
+ total: res.data.total,
+ msg: res.message,
+ code: res.code
+ }
+ },
+ props: {
+ key: 'id',
+ label: 'user',
+ },
+ request: {
+ page: 'page',
+ pageSize: 'pageSize',
+ groupId: 'groupId',
+ keyword: 'keyword'
+ }
+ },
+ //配置角色
+ role: {
+ //请求接口对象
+ apiObj: API.system.role.list,
+ //接受数据字段映射
+ parseData: function (res) {
+ return {
+ rows: res.data,
+ msg: res.message,
+ code: res.code
+ }
+ },
+ //显示数据字段映射
+ props: {
+ key: 'id',
+ label: 'label',
+ children: 'children'
+ }
+ }
+}
diff --git a/src/views/vab/workflow.vue b/src/views/vab/workflow.vue
index 7c06fac2..4477701f 100644
--- a/src/views/vab/workflow.vue
+++ b/src/views/vab/workflow.vue
@@ -1,8 +1,15 @@
-
-
-
-
+
+
+
+
+ export JSON
+
+
+
+
+
+
-
+