Browse Source

chore: adaptation

master
wangxiang 2 years ago
parent
commit
9f6dbae5a5
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 4
      src/components/Form/src/components/ApiSelect.vue
  2. 48
      src/views/workflow/task/TaskForm.vue

4
src/components/Form/src/components/ApiSelect.vue

@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
value: [Array, Object, String, Number],
numberToString: propTypes.bool,
api: {
type: Function as PropType<(arg?: Recordable) => Promise<OptionsItem[]>>,
type: Function as PropType<(...args: Recordable[]) => Promise<Recordable>>,
default: null,
},
// api params
@ -111,7 +111,7 @@ @@ -111,7 +111,7 @@
loading.value = true;
const res = await api(props.params);
if (Array.isArray(res)) {
options.value = res;
options.value = res as OptionsItem[];
emitChange();
return;
}

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

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<ATables v-model:activeKey="state.taskSelectedTab"
class="bg-white"
:tab-bar-style="{ 'padding-left': '13px' }"
@tabClick="handleTabsClick"
@tab-click="handleTabsClick"
>
<ATabPane key="formInfo">
<template #tab>
@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
</ACol>
<ACol :span="16">
<AFormItem v-if="state.taskId" label="审批信息" name="message">
<ATextarea
<AInputTextarea
v-model:value="state.auditForm.message"
placeholder="请输入审批意见"
:rows="3"
@ -85,15 +85,24 @@ @@ -85,15 +85,24 @@
name="userIds"
:rules="[{required: true, message: '用户不能为空', validateTrigger: 'blur'}]"
>
<a-input-group compact>
<a-input v-model:value="state.auditForm.userIds" style="width: calc(100% - 48px)"/>
<AInputGroup compact>
<ApiSelect v-model:value="state.auditForm.userIds"
disabled
mode="multiple"
style="width: calc(100% - 48px)"
:api="listUser"
:params="{ size: 999 }"
resultField="data"
labelField="username"
valueField="id"
/>
<a-button type="primary"
style="width: 48px"
@click="handleCCUserPicker"
>
<Icon icon="fa6-solid:users-viewfinder"/>
</a-button>
</a-input-group>
</AInputGroup>
</AFormItem>
</ACol>
<ACol :span="16">
@ -107,7 +116,23 @@ @@ -107,7 +116,23 @@
name="assignee"
:rules="[{required: true, message: '用户不能为空', validateTrigger: 'blur'}]"
>
<a-select v-model:value="state.auditForm.userIds" allowClear/>
<AInputGroup compact>
<ApiSelect v-model:value="state.auditForm.assignee"
disabled
style="width: calc(100% - 48px)"
:api="listUser"
:params="{ size: 999 }"
resultField="data"
labelField="username"
valueField="id"
/>
<a-button type="primary"
style="width: 48px"
@click="handleCCUserPicker"
>
<Icon icon="fa6-solid:clipboard-user"/>
</a-button>
</AInputGroup>
</AFormItem>
</ACol>
</AForm>
@ -135,9 +160,9 @@ @@ -135,9 +160,9 @@
import { useRouter } from 'vue-router';
import { saveWorkflowCopy } from '/@/api/platform/workflow/extension/controller/workflowCopy';
import { useMessage } from '/@/hooks/web/useMessage';
import { startProcessDefinition, stopProcessInstance, getFlowChart as getProcessDefFlowChart } from '/@/api/platform/workflow/controller/process';
import { startProcessDefinition, stopProcessInstance } from '/@/api/platform/workflow/controller/process';
import { useTabs } from '/@/hooks/web/useTabs';
import { auditTask, rollBackTaskList, rejectTask, transferTask, delegateTask, getFlowChart, listHistoryFlowChange } from '/@/api/platform/workflow/controller/task';
import { auditTask, rollBackTaskList, rejectTask, transferTask, delegateTask, listHistoryFlowChange } from '/@/api/platform/workflow/controller/task';
import { useModal } from '/@/components/Modal';
import type { KiccUser } from '/@/api/common/base/entity';
import WorkflowPreviewForm from './WorkflowPreviewForm.vue';
@ -150,6 +175,8 @@ @@ -150,6 +175,8 @@
import { useAppInject } from '/@/hooks/web/useAppInject';
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
import UserPicker from './popups/UserPicker/index.vue';
import { ApiSelect } from '/@/components/Form';
import { listUser } from '/@/api/platform/system/controller/user';
/** 类型规范统一声明定义区域 */
interface WindowState {
@ -211,7 +238,8 @@ @@ -211,7 +238,8 @@
const AForm = Form;
const AFormItem = Form.Item;
const ACol = Col;
const ATextarea = Input.TextArea;
const AInputTextarea = Input.TextArea;
const AInputGroup = Input.Group;
const { prefixCls } = useDesign('task-form');
const { getIsMobile } = useAppInject();
@ -389,7 +417,7 @@ @@ -389,7 +417,7 @@
/** 抄送 */
function handleCCUserPicker() {
openModal(true,{ _tag: 'transfer' });
openModal(true,{ record: { ids: [], emitEventName: 'test' } });
}
/** 转办 */

Loading…
Cancel
Save