Browse Source

chore: Support multiple selection methods

master
wangxiang 2 years ago
parent
commit
921aed6ae7
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 35
      src/views/workflow/task/TaskForm.vue
  2. 2
      src/views/workflow/task/popups/UserPicker/index.vue

35
src/views/workflow/task/TaskForm.vue

@ -57,6 +57,7 @@ @@ -57,6 +57,7 @@
:labelCol="{ style: { width: '90px' } }"
:wrapperCol="{ style: { width: '100%' } }"
:model="state.auditForm"
:rules="state.rulesRef"
:scrollToFirstError="true"
>
<ACol :span="16">
@ -83,7 +84,6 @@ @@ -83,7 +84,6 @@
<AFormItem v-if="state.isCC"
label="抄送给"
name="userIds"
:rules="[{required: true, message: '用户不能为空', validateTrigger: 'blur'}]"
>
<AInputGroup compact>
<ApiSelect v-model:value="state.auditForm.userIds"
@ -114,7 +114,6 @@ @@ -114,7 +114,6 @@
<AFormItem v-if="state.isAssign"
label="指定"
name="assignee"
:rules="[{required: true, message: '用户不能为空', validateTrigger: 'blur'}]"
>
<AInputGroup compact>
<ApiSelect v-model:value="state.auditForm.assignee"
@ -140,7 +139,7 @@ @@ -140,7 +139,7 @@
</a-card>
</ALayoutContent>
<footer class="workflow-form__footer" :style="getWrapFormFooterStyle">
<a-button size="large" type="primary">审批</a-button>
<a-button size="large" type="primary" @click="test">审批</a-button>
<a-button size="large" type="primary" danger>驳回</a-button>
</footer>
<UserPicker @register="registerModal" @success="handleTransferTask"/>
@ -226,10 +225,11 @@ @@ -226,10 +225,11 @@
mesCode: string,
mesName: string,
// ID
userIds: string,
userIds: string[],
// ID
assignee: string,
},
rulesRef: Recordable;
}
/** 通用变量统一声明区域 */
@ -272,8 +272,12 @@ @@ -272,8 +272,12 @@
message: '',
mesCode: '',
mesName: '',
userIds: '',
userIds: [],
assignee: ''
},
rulesRef: {
assignee: [{ required: true, whitespace: true, message: '用户不能为空', validateTrigger: 'blur' }],
userIds: [{ required: true, type: 'array', message: '用户不能为空', validateTrigger: 'blur' }]
}
});
const { currentRoute, push } = useRouter();
@ -282,6 +286,7 @@ @@ -282,6 +286,7 @@
const { close } = useTabs();
const formPreview = ref();
const workflowChart = ref();
const auditForm = ref();
const [registerModal, { openModal }] = useModal();
const [registerRollBackTask , { openModal: openRollBackTask }] = useModal();
onActivated(() => {
@ -340,8 +345,8 @@ @@ -340,8 +345,8 @@
state.formReadOnly = query.formReadOnly === 'true';
state.isCC = false;
state.isAssign = false;
state.auditForm.assignee = '';
state.auditForm.userIds = '';
state.auditForm.assignee = '1510539584287346688';
state.auditForm.userIds = ['1510539584287346688'];
state.auditForm.message = '';
}
@ -350,7 +355,7 @@ @@ -350,7 +355,7 @@
if (state.isCC && state.auditForm.userIds) {
//this.$refs['auditForm'].validate((valid) => {
//if (valid) {
saveWorkflowCopy(state.auditForm.userIds, {
saveWorkflowCopy(state.auditForm.userIds.join(','), {
processDefId: state.processDefId,
processInsId: data.processInsId,
processDefName: '',
@ -613,6 +618,10 @@ @@ -613,6 +618,10 @@
}
}
function test() {
auditForm.value.validate();
}
</script>
<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-task-form';
@ -643,4 +652,14 @@ @@ -643,4 +652,14 @@
margin-bottom: 15px;
}
}
:deep(.ant-select) {
&-disabled {
&.ant-select:not(.ant-select-customize-input) {
.ant-select-selector {
background: transparent;
}
}
}
}
</style>

2
src/views/workflow/task/popups/UserPicker/index.vue

@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']]
},
maxHeight: 450,
rowSelection: { type: 'checkbox' },
rowSelection: { type: props.limit == 1 ? 'radio' : 'checkbox' },
useSearchForm: true,
showTableSetting: true,
bordered: true,

Loading…
Cancel
Save