280
280
</el-form >
281
281
</div >
282
282
</el-tab-pane >
283
+ <el-tab-pane label =" 操作按钮设置" name =" buttons" v-if =" formType === 10" >
284
+ <div class =" button-setting-pane" >
285
+ <div class =" button-setting-desc" >操作按钮</div >
286
+ <div class =" button-setting-title" >
287
+ <div class =" button-title-label" >操作按钮</div >
288
+ <div class =" pl-4 button-title-label" >显示名称</div >
289
+ <div class =" button-title-label" >启用</div >
290
+ </div >
291
+ <div
292
+ class =" button-setting-item"
293
+ v-for =" (item, index) in configForm.buttonsSetting"
294
+ :key =" index"
295
+ >
296
+ <div class =" button-setting-item-label" > {{ OPERATION_BUTTON_NAME.get(item.id) }} </div >
297
+ <div class =" button-setting-item-label" >
298
+ <input
299
+ type =" text"
300
+ class =" editable-title-input"
301
+ @blur =" btnDisplayNameBlurEvent(index)"
302
+ v-mountedFocus
303
+ v-model =" item.displayName"
304
+ :placeholder =" item.displayName"
305
+ v-if =" btnDisplayNameEdit[index]"
306
+ />
307
+ <el-button v-else text @click =" changeBtnDisplayName(index)"
308
+ >{{ item.displayName }}   ; <Icon icon =" ep:edit"
309
+ /></el-button >
310
+ </div >
311
+ <div class =" button-setting-item-label" >
312
+ <el-switch v-model =" item.enable" />
313
+ </div >
314
+ </div >
315
+ </div >
316
+ </el-tab-pane >
283
317
<el-tab-pane label =" 表单字段权限" name =" fields" v-if =" formType === 10" >
284
318
<div class =" field-setting-pane" >
285
319
<div class =" field-setting-desc" >字段权限</div >
@@ -334,7 +368,9 @@ import {
334
368
TIMEOUT_HANDLER_ACTION_TYPES ,
335
369
TIME_UNIT_TYPES ,
336
370
REJECT_HANDLER_TYPES ,
337
- NODE_DEFAULT_NAME
371
+ NODE_DEFAULT_NAME ,
372
+ DEFAULT_BUTTON_SETTING ,
373
+ OPERATION_BUTTON_NAME
338
374
} from ' ../consts'
339
375
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
340
376
import { getDefaultFieldsPermission } from ' ../utils'
@@ -345,7 +381,6 @@ import * as PostApi from '@/api/system/post'
345
381
import * as UserApi from ' @/api/system/user'
346
382
import * as UserGroupApi from ' @/api/bpm/userGroup'
347
383
import { cloneDeep } from ' lodash-es'
348
-
349
384
defineOptions ({
350
385
name: ' UserTaskNodeConfig'
351
386
})
@@ -385,7 +420,8 @@ const configForm = ref<any>({
385
420
timeoutHandlerAction: 1 ,
386
421
timeDuration: 6 , // 默认 6小时
387
422
maxRemindCount: 1 , // 默认 提醒 1次
388
- fieldsPermission: []
423
+ fieldsPermission: [],
424
+ buttonsSetting: []
389
425
})
390
426
// 表单校验规则
391
427
const formRules = reactive ({
@@ -432,6 +468,8 @@ const saveConfig = async () => {
432
468
}
433
469
// 设置表单权限
434
470
currentNode .value .fieldsPermission = configForm .value .fieldsPermission
471
+ // 设置按钮权限
472
+ currentNode .value .buttonsSetting = configForm .value .buttonsSetting
435
473
436
474
currentNode .value .showText = getShowText ()
437
475
settingVisible .value = false
@@ -533,6 +571,7 @@ const setCurrentNode = (node: SimpleFlowNode) => {
533
571
currentNode .value = node
534
572
configForm .value .fieldsPermission =
535
573
cloneDeep (node .fieldsPermission ) || getDefaultFieldsPermission (formFields ?.value )
574
+ configForm .value .buttonsSetting = cloneDeep (node .buttonsSetting ) || DEFAULT_BUTTON_SETTING
536
575
configForm .value .candidateStrategy = node .candidateStrategy
537
576
const strCandidateParam = node ?.candidateParam
538
577
if (node .candidateStrategy === CandidateStrategy .EXPRESSION ) {
@@ -614,6 +653,7 @@ const blurEvent = () => {
614
653
currentNode .value .name =
615
654
currentNode .value .name || (NODE_DEFAULT_NAME .get (NodeType .USER_TASK_NODE ) as string )
616
655
}
656
+
617
657
const approveMethodChanged = () => {
618
658
configForm .value .rejectHandlerType = RejectHandlerType .FINISH_PROCESS
619
659
if (configForm .value .approveMethod === ApproveMethodType .APPROVE_BY_RATIO ) {
@@ -703,6 +743,99 @@ const convertTimeUnit = (strTimeUnit: string) => {
703
743
}
704
744
return TimeUnitType .HOUR
705
745
}
746
+
747
+ // 操作按钮显示名称可编辑
748
+ const btnDisplayNameEdit = ref <boolean []>([])
749
+ const changeBtnDisplayName = (index : number ) => {
750
+ btnDisplayNameEdit .value [index ] = true
751
+ }
752
+ const btnDisplayNameBlurEvent = (index : number ) => {
753
+ btnDisplayNameEdit .value [index ] = false
754
+ const buttonItem = configForm .value .buttonPermission [index ]
755
+ buttonItem .displayName = buttonItem .displayName || OPERATION_BUTTON_NAME .get (buttonItem .id )
756
+ }
706
757
</script >
707
758
708
- <style lang="scss" scoped></style >
759
+ <style lang="scss" scoped>
760
+ .button-setting-pane {
761
+ display : flex ;
762
+ flex-direction : column ;
763
+ font-size : 14px ;
764
+
765
+ .button-setting-desc {
766
+ padding-right : 8px ;
767
+ margin-bottom : 16px ;
768
+ font-size : 16px ;
769
+ font-weight : 700 ;
770
+ }
771
+
772
+ .button-setting-title {
773
+ display : flex ;
774
+ justify-content : space-between ;
775
+ align-items : center ;
776
+ height : 45px ;
777
+ padding-left : 12px ;
778
+ background-color : #f8fafc0a ;
779
+ border : 1px solid #1f38581a ;
780
+
781
+ & > :first-child {
782
+ width : 100px !important ;
783
+ text-align : left !important ;
784
+ }
785
+
786
+ & > :last-child {
787
+ text-align : center !important ;
788
+ }
789
+
790
+ .button-title-label {
791
+ width : 150px ;
792
+ font-size : 13px ;
793
+ font-weight : 700 ;
794
+ color : #000 ;
795
+ text-align : left ;
796
+ }
797
+ }
798
+
799
+ .button-setting-item {
800
+ align-items : center ;
801
+ display : flex ;
802
+ justify-content : space-between ;
803
+ height : 38px ;
804
+ padding-left : 12px ;
805
+ border : 1px solid #1f38581a ;
806
+ border-top : 0 ;
807
+
808
+ & > :first-child {
809
+ width : 100px !important ;
810
+ }
811
+
812
+ & > :last-child {
813
+ text-align : center !important ;
814
+ }
815
+
816
+ .button-setting-item-label {
817
+ width : 150px ;
818
+ overflow : hidden ;
819
+ text-align : left ;
820
+ text-overflow : ellipsis ;
821
+ white-space : nowrap ;
822
+ }
823
+
824
+ .editable-title-input {
825
+ height : 24px ;
826
+ max-width : 130px ;
827
+ margin-left : 4px ;
828
+ line-height : 24px ;
829
+ border : 1px solid #d9d9d9 ;
830
+ border-radius : 4px ;
831
+ transition : all 0.3s ;
832
+
833
+ & :focus {
834
+ border-color : #40a9ff ;
835
+ outline : 0 ;
836
+ box-shadow : 0 0 0 2px rgb (24 144 255 / 20% );
837
+ }
838
+ }
839
+ }
840
+ }
841
+ </style >
0 commit comments