From 95289272be813e4dedc8590eb16434bdadfce6ab Mon Sep 17 00:00:00 2001
From: wangxiang <1827945911@qq.com>
Date: Thu, 19 Oct 2023 23:34:59 +0800
Subject: [PATCH] chore: userPicker compose
---
src/views/workflow/task/TaskForm.vue | 31 +++-
.../workflow/task/popups/UserPicker/index.vue | 172 ++++++++++++++++++
.../task/popups/UserPicker/userPicker.data.ts | 61 +++++++
3 files changed, 256 insertions(+), 8 deletions(-)
create mode 100644 src/views/workflow/task/popups/UserPicker/index.vue
create mode 100644 src/views/workflow/task/popups/UserPicker/userPicker.data.ts
diff --git a/src/views/workflow/task/TaskForm.vue b/src/views/workflow/task/TaskForm.vue
index b767111..35b47f9 100644
--- a/src/views/workflow/task/TaskForm.vue
+++ b/src/views/workflow/task/TaskForm.vue
@@ -85,7 +85,15 @@
name="userIds"
:rules="[{required: true, message: '用户不能为空', validateTrigger: 'blur'}]"
>
-
+
+
+
+
+
+
@@ -109,6 +117,7 @@
审批
驳回
+
+
+
+
+
+
+
diff --git a/src/views/workflow/task/popups/UserPicker/userPicker.data.ts b/src/views/workflow/task/popups/UserPicker/userPicker.data.ts
new file mode 100644
index 0000000..b1d0dbb
--- /dev/null
+++ b/src/views/workflow/task/popups/UserPicker/userPicker.data.ts
@@ -0,0 +1,61 @@
+import { BasicColumn } from '/@/components/Table';
+import { FormSchema } from '/@/components/Table';
+import { h } from 'vue';
+import { Tag } from 'ant-design-vue';
+
+/** 表格列配置 */
+export const columns: BasicColumn[] = [
+ {
+ title: '用户名称',
+ dataIndex: 'username',
+ },
+ {
+ title: '用户昵称',
+ dataIndex: 'nickName',
+ },
+ {
+ title: '机构名称',
+ dataIndex: 'deptName',
+ },
+ {
+ title: '状态',
+ dataIndex: 'status',
+ customRender: ({ record }) => {
+ const status = record.status;
+ // 采用二进制~~取反,只要为null或者0等等一些其他的空元素都会转为0
+ // 第一次取反会运算为-1,在后一次取反会运算为0
+ const enable = ~~status === 0;
+ const color = enable ? 'green' : 'warning';
+ const text = enable ? '启用' : '停用';
+ return h(Tag, { color: color }, () => text);
+ }
+ },
+ {
+ title: '创建时间',
+ dataIndex: 'createTime',
+ }
+];
+
+/** 搜索表单配置 */
+export const searchFormSchema: FormSchema[] = [
+ {
+ field: 'userName',
+ label: '用户名称',
+ component: 'Input',
+ componentProps: {
+ placeholder: '请输入用户名称',
+ },
+ colProps: { span: 8 }
+ },
+ {
+ field: 'dateRange',
+ label: '创建时间',
+ component: 'RangePicker',
+ componentProps: {
+ style: { width:'100%' },
+ valueFormat: 'YYYY-MM-DD',
+ placeholder: ['开始日期','结束日期']
+ },
+ colProps: { span: 8 }
+ }
+];