Ver código fonte

增加节点视图配置

QM303176530 4 anos atrás
pai
commit
9926e19258

+ 7 - 1
server/model/wf_process.go

@@ -17,6 +17,7 @@ type WorkflowProcess struct {
 	Label       string         `json:"label" gorm:"comment:流程标题"`
 	HideIcon    bool           `json:"hideIcon" gorm:"comment:是否隐藏图标"`
 	Description string         `json:"description" gorm:"comment:详细介绍"`
+	View        string         `json:"view" gorm:"comment:前端视图文件"`
 	Nodes       []WorkflowNode `json:"nodes"` // 流程节点数据
 	Edges       []WorkflowEdge `json:"edges"` // 流程链接数据
 }
@@ -31,7 +32,8 @@ type WorkflowNode struct {
 	Label             string         `json:"label" gorm:"comment:节点名称"`
 	Type              string         `json:"type" gorm:"comment:图标类型"`
 	Shape             string         `json:"shape" gorm:"comment:形状"`
-	Description       bool           `json:"description" gorm:"comment:详细介绍"`
+	Description       string         `json:"description" gorm:"comment:详细介绍"`
+	View              string         `json:"view" gorm:"comment:前端视图文件"`
 	X                 float64        `json:"y" gorm:"comment:x位置"`
 	Y                 float64        `json:"x" gorm:"comment:y位置"`
 	WaitState         string         `json:"waitState" gorm:"comment:等待属性"`
@@ -42,6 +44,9 @@ type WorkflowNode struct {
 	Cycle             string         `json:"cycle" gorm:"comment:循环时间"`
 	Duration          string         `json:"duration" gorm:"comment:持续时间"`
 	HideIcon          bool           `json:"hideIcon" gorm:"comment:是否隐藏图标"`
+	DueDate           time.Time      `json:"dueDate" gorm:"comment:到期时间"`
+	AssignType        string         `json:"assignType" gorm:"comment:审批类型"`
+	AssignValue       string         `json:"assignValue" gorm:"comment:审批类型值"`
 }
 
 type WorkflowEdge struct {
@@ -55,6 +60,7 @@ type WorkflowEdge struct {
 	Target              string             `json:"target" gorm:"comment:目标节点"`
 	SourceAnchor        int                `json:"sourceAnchor" gorm:"comment:起点"`
 	TargetAnchor        int                `json:"targetAnchor" gorm:"comment:目标点"`
+	Description         string             `json:"description" gorm:"comment:详细介绍"`
 	Shape               string             `json:"shape" gorm:"comment:形状"`
 	StartPoint          WorkflowStartPoint `json:"startPoint"` // 起点信息
 	EndPoint            WorkflowEndPoint   `json:"endPoint"`   // 终点信息

+ 8 - 0
web/src/components/gva-wfd/components/DetailPanel/StartEventDetail.vue

@@ -4,6 +4,14 @@
         <div class="panelBody">
             <DefaultDetail :model="model" :onChange="onChange" :readOnly="readOnly" />
         </div>
+         <div class="panelRow">
+                <div>视图路径(以view开头)</div>
+                <el-input style="width:90%; font-size:12px"
+                          :disabled="readOnly"
+                          type="view"
+                          :value="model.view"
+                          @input="(value) => {onChange('view', value)}" />
+            </div>
     </div>
 </template>
 <script>

+ 8 - 0
web/src/components/gva-wfd/components/DetailPanel/TimerEventDetail.vue

@@ -21,6 +21,14 @@
                           :value="model.duration"
                           @input="(value) => {onChange('duration', value)}" />
             </div>
+             <div class="panelRow">
+                <div>视图路径(以view开头)</div>
+                <el-input style="width:90%; font-size:12px"
+                          :disabled="readOnly"
+                          type="view"
+                          :value="model.view"
+                          @input="(value) => {onChange('view', value)}" />
+            </div>
         </div>
     </div>
 </template>

+ 14 - 6
web/src/components/gva-wfd/components/DetailPanel/UserTaskDetail.vue

@@ -21,7 +21,7 @@
                            :disabled="readOnly"
                            :value="model.assignValue"
                            clearable
-                           allow-create
+                           multiple
                            :filterable="true"
                            :filter-method="filterUsers"
                            @change="(e) => onChange('assignValue', e)">
@@ -33,11 +33,11 @@
                 <el-select style="width:90%; font-size:12px"
                            :placeholder="'请选择角色'"
                            :disabled="readOnly"
+                           multiple
                            :value="model.assignValue"
-                           allow-create
                            clearable
                            :filterable="true"
-                           :filter-method="authorities"
+                           :filter-method="filterAuthorities"
                            @change="(e) => onChange('assignValue', e)">
                     <el-option v-for="authority in authoritiesCopy" :key="authority.id" :label="authority.name" :value="authority.id" />
                 </el-select>
@@ -49,7 +49,6 @@
                                 :placeholder="i18n['userTask.dueDate.placeholder']"
                                 :disabled="readOnly"
                                 :value="model.dueDate"
-                                value-format="yyyy-MM-dd HH:mm:ss"
                                 @input="(value) => onChange('dueDate', value)" />
             </div>
             <div class="panelRow">
@@ -57,6 +56,14 @@
                              :disabled="readOnly"
                              :value="!!model.isSequential">{{i18n['userTask.counterSign']}}</el-checkbox>
             </div>
+            <div class="panelRow">
+                <div>视图路径(以view开头)</div>
+                <el-input style="width:90%; font-size:12px"
+                          :disabled="readOnly"
+                          type="view"
+                          :value="model.view"
+                          @input="(value) => {onChange('view', value)}" />
+            </div>
             <div class="panelRow">
                 <div>详情说明:</div>
                 <el-input style="width:90%; font-size:12px"
@@ -116,7 +123,7 @@
       filterUsers(input) {
         if (input) {
           this.usersCopy = this.users.filter((item) => {
-            if (!!~item.name.indexOf(input) || !!~item.name.toLowerCase().indexOf(input.toLowerCase())) {
+            if (item.name.indexOf(input) >-1 ) {
               return true
             }
           })
@@ -127,7 +134,8 @@
       filterAuthorities(input) {
         if (input) {
           this.authoritiesCopy = this.authorities.filter((item) => {
-            if (!!~item.name.indexOf(input) || !!~item.name.toLowerCase().indexOf(input.toLowerCase())) {
+            console.log(item)
+            if (item.name.indexOf(input) >-1 ) {
               return true
             }
           })

+ 13 - 3
web/src/view/workflow/workflowCreate/workflowCreate.vue

@@ -98,7 +98,7 @@ export default {
             y: 84,
             id: "userTask1603681299962",
             style: {},
-            assignValue: 1,
+            assignValue: [1],
             assignType: "user"
           },
           {
@@ -110,7 +110,7 @@ export default {
             y: 321,
             id: "userTask1603681302372",
             style: {},
-            assignValue: 2,
+            assignValue: [2],
             assignType: "user"
           },
           {
@@ -268,7 +268,12 @@ export default {
       const obj = this.$refs["wfd"].graph.save()
       const processModel = this.$refs["wfd"].processModel
       processModel.edges = obj.edges
-      processModel.nodes = obj.nodes
+      processModel.nodes = JSON.parse(JSON.stringify(obj.nodes))
+      processModel.nodes.map(item=>{
+        if(item.assignValue){
+          item.assignValue = String(item.assignValue)
+        }
+      })
       if(!processModel.id){
         this.$message({
           type:"error",
@@ -321,6 +326,11 @@ export default {
       const res = await findWorkflowProcess({ id: this.$route.query.id });
       this.disabled = this.$route.query.type == "view"
       if(res.code == 0){
+         res.data.reworkflowProcess.nodes.map(item=>{
+           if(item.assignValue){
+             item.assignValue = item.assignValue.split(",")
+           }
+         })
         this.demoData.nodes = res.data.reworkflowProcess.nodes
         delete res.data.reworkflowProcess.nodes
         this.demoData.edges = res.data.reworkflowProcess.edges