review:通用的代码生成 demo
parent
9f8e7533fb
commit
2fd6367983
|
@ -1,3 +1,4 @@
|
||||||
|
<!-- add by puhui999:vxe table 工具栏二次封装,提供给 vxe 原生列表使用 -->
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { VxeToolbarInstance } from 'vxe-table';
|
import type { VxeToolbarInstance } from 'vxe-table';
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ defineExpose({
|
||||||
<VxeToolbar ref="toolbarRef" custom>
|
<VxeToolbar ref="toolbarRef" custom>
|
||||||
<template #toolPrefix>
|
<template #toolPrefix>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
<!-- TODO @puhui999:貌似 icon 没和 vxe 对上。可以考虑用 /Users/yunai/Java/yudao-ui-admin-vben-v5/packages/icons/src/iconify -->
|
||||||
<Button class="ml-2 font-[8px]" shape="circle" @click="onHiddenSearchBar">
|
<Button class="ml-2 font-[8px]" shape="circle" @click="onHiddenSearchBar">
|
||||||
<Search :size="15" />
|
<Search :size="15" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -1,39 +1,86 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type {
|
import type { VxeTableInstance } from 'vxe-table';
|
||||||
OnActionClickParams,
|
|
||||||
VxeTableGridOptions,
|
|
||||||
} from '#/adapter/vxe-table';
|
|
||||||
import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
|
import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
|
||||||
|
|
||||||
import { h } from 'vue';
|
import { h, nextTick, onMounted, reactive, ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { Download, Plus } from '@vben/icons';
|
import { Download, Plus } from '@vben/icons';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { cloneDeep, formatDateTime } from '@vben/utils';
|
||||||
|
|
||||||
import { Button, message } from 'ant-design-vue';
|
import {
|
||||||
|
Button,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
message,
|
||||||
|
Pagination,
|
||||||
|
RangePicker,
|
||||||
|
Select,
|
||||||
|
} from 'ant-design-vue';
|
||||||
|
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import {
|
import {
|
||||||
deleteDemo01Contact,
|
deleteDemo01Contact,
|
||||||
exportDemo01Contact,
|
exportDemo01Contact,
|
||||||
getDemo01ContactPage,
|
getDemo01ContactPage,
|
||||||
} from '#/api/infra/demo/demo01';
|
} from '#/api/infra/demo/demo01';
|
||||||
|
import { ContentWrap } from '#/components/content-wrap';
|
||||||
|
import { DictTag } from '#/components/dict-tag';
|
||||||
|
import { TableToolbar } from '#/components/table-toolbar';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
import { getRangePickerDefaultProps } from '#/utils/date';
|
||||||
|
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||||
|
import { downloadByData } from '#/utils/download';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import Demo01ContactForm from './modules/form.vue';
|
||||||
import Form from './modules/form.vue';
|
|
||||||
|
const loading = ref(true); // 列表的加载中
|
||||||
|
const list = ref<Demo01ContactApi.Demo01Contact[]>([]); // 列表的数据
|
||||||
|
const total = ref(0); // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
sex: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
});
|
||||||
|
const queryFormRef = ref(); // 搜索的表单
|
||||||
|
const exportLoading = ref(false); // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const params = cloneDeep(queryParams) as any;
|
||||||
|
if (params.createTime && Array.isArray(params.createTime)) {
|
||||||
|
params.createTime = (params.createTime as string[]).join(',');
|
||||||
|
}
|
||||||
|
const data = await getDemo01ContactPage(params);
|
||||||
|
list.value = data.list;
|
||||||
|
total.value = data.total;
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
const [FormModal, formModalApi] = useVbenModal({
|
||||||
connectedComponent: Form,
|
connectedComponent: Demo01ContactForm,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 刷新表格 */
|
|
||||||
function onRefresh() {
|
|
||||||
gridApi.query();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 创建示例联系人 */
|
/** 创建示例联系人 */
|
||||||
function onCreate() {
|
function onCreate() {
|
||||||
formModalApi.setData({}).open();
|
formModalApi.setData({}).open();
|
||||||
|
@ -57,7 +104,7 @@ async function onDelete(row: Demo01ContactApi.Demo01Contact) {
|
||||||
content: $t('ui.actionMessage.deleteSuccess', [row.id]),
|
content: $t('ui.actionMessage.deleteSuccess', [row.id]),
|
||||||
key: 'action_process_msg',
|
key: 'action_process_msg',
|
||||||
});
|
});
|
||||||
onRefresh();
|
await getList();
|
||||||
} catch {
|
} catch {
|
||||||
hideLoading();
|
hideLoading();
|
||||||
}
|
}
|
||||||
|
@ -65,84 +112,166 @@ async function onDelete(row: Demo01ContactApi.Demo01Contact) {
|
||||||
|
|
||||||
/** 导出表格 */
|
/** 导出表格 */
|
||||||
async function onExport() {
|
async function onExport() {
|
||||||
const data = await exportDemo01Contact(await gridApi.formApi.getValues());
|
try {
|
||||||
downloadFileFromBlobPart({ fileName: '示例联系人.xls', source: data });
|
exportLoading.value = true;
|
||||||
}
|
const data = await exportDemo01Contact(queryParams);
|
||||||
|
downloadByData(data, '示例联系人.xls');
|
||||||
/** 表格操作按钮的回调函数 */
|
} finally {
|
||||||
function onActionClick({
|
exportLoading.value = false;
|
||||||
code,
|
|
||||||
row,
|
|
||||||
}: OnActionClickParams<Demo01ContactApi.Demo01Contact>) {
|
|
||||||
switch (code) {
|
|
||||||
case 'delete': {
|
|
||||||
onDelete(row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'edit': {
|
|
||||||
onEdit(row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
/** 隐藏搜索栏 */
|
||||||
formOptions: {
|
const hiddenSearchBar = ref(false);
|
||||||
schema: useGridFormSchema(),
|
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||||
},
|
const tableRef = ref<VxeTableInstance>();
|
||||||
gridOptions: {
|
/** 初始化 */
|
||||||
columns: useGridColumns(onActionClick),
|
onMounted(async () => {
|
||||||
height: 'auto',
|
await getList();
|
||||||
pagerConfig: {
|
await nextTick();
|
||||||
enabled: true,
|
// 挂载 toolbar 工具栏
|
||||||
},
|
const table = tableRef.value;
|
||||||
proxyConfig: {
|
const tableToolbar = tableToolbarRef.value;
|
||||||
ajax: {
|
if (table && tableToolbar) {
|
||||||
query: async ({ page }, formValues) => {
|
await table.connect(tableToolbar.getToolbarRef()!);
|
||||||
return await getDemo01ContactPage({
|
}
|
||||||
pageNo: page.currentPage,
|
|
||||||
pageSize: page.pageSize,
|
|
||||||
...formValues,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rowConfig: {
|
|
||||||
keyField: 'id',
|
|
||||||
isHover: true,
|
|
||||||
},
|
|
||||||
toolbarConfig: {
|
|
||||||
refresh: { code: 'query' },
|
|
||||||
search: true,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<Demo01ContactApi.Demo01Contact>,
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<FormModal @success="onRefresh" />
|
<FormModal @success="getList" />
|
||||||
|
|
||||||
<Grid table-title="示例联系人列表">
|
<ContentWrap v-if="!hiddenSearchBar">
|
||||||
<template #toolbar-tools>
|
<!-- 搜索工作栏 -->
|
||||||
<Button
|
<Form :model="queryParams" ref="queryFormRef" layout="inline">
|
||||||
:icon="h(Plus)"
|
<Form.Item label="名字" name="name">
|
||||||
type="primary"
|
<Input
|
||||||
@click="onCreate"
|
v-model:value="queryParams.name"
|
||||||
v-access:code="['infra:demo01-contact:create']"
|
placeholder="请输入名字"
|
||||||
|
allow-clear
|
||||||
|
@press-enter="handleQuery"
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<!-- TODO @puhui999:貌似性别的宽度不对;并且选择后,会变哈; -->
|
||||||
|
<Form.Item label="性别" name="sex">
|
||||||
|
<Select
|
||||||
|
v-model:value="queryParams.sex"
|
||||||
|
placeholder="请选择性别"
|
||||||
|
allow-clear
|
||||||
|
class="w-full"
|
||||||
|
>
|
||||||
|
<!-- TODO @puhui999:要不咱还是把 getIntDictOptions 还是搞出来?总归方便点~ -->
|
||||||
|
<Select.Option
|
||||||
|
v-for="dict in getDictOptions(
|
||||||
|
DICT_TYPE.SYSTEM_USER_SEX,
|
||||||
|
'number',
|
||||||
|
)"
|
||||||
|
:key="dict.value"
|
||||||
|
:value="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="创建时间" name="createTime">
|
||||||
|
<RangePicker
|
||||||
|
v-model:value="queryParams.createTime"
|
||||||
|
v-bind="getRangePickerDefaultProps()"
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item>
|
||||||
|
<Button class="ml-2" @click="resetQuery"> 重置 </Button>
|
||||||
|
<Button class="ml-2" @click="handleQuery" type="primary">
|
||||||
|
搜索
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap title="示例联系人">
|
||||||
|
<!-- TODO @puhui999:暗黑模式下,会有个黑底 -->
|
||||||
|
<template #extra>
|
||||||
|
<TableToolbar
|
||||||
|
ref="tableToolbarRef"
|
||||||
|
v-model:hidden-search="hiddenSearchBar"
|
||||||
>
|
>
|
||||||
{{ $t('ui.actionTitle.create', ['示例联系人']) }}
|
<Button
|
||||||
</Button>
|
class="ml-2"
|
||||||
<Button
|
:icon="h(Plus)"
|
||||||
:icon="h(Download)"
|
type="primary"
|
||||||
type="primary"
|
@click="onCreate"
|
||||||
class="ml-2"
|
v-access:code="['infra:demo01-contact:create']"
|
||||||
@click="onExport"
|
>
|
||||||
v-access:code="['infra:demo01-contact:export']"
|
{{ $t('ui.actionTitle.create', ['示例联系人']) }}
|
||||||
>
|
</Button>
|
||||||
{{ $t('ui.actionTitle.export') }}
|
<Button
|
||||||
</Button>
|
:icon="h(Download)"
|
||||||
|
type="primary"
|
||||||
|
class="ml-2"
|
||||||
|
:loading="exportLoading"
|
||||||
|
@click="onExport"
|
||||||
|
v-access:code="['infra:demo01-contact:export']"
|
||||||
|
>
|
||||||
|
{{ $t('ui.actionTitle.export') }}
|
||||||
|
</Button>
|
||||||
|
</TableToolbar>
|
||||||
</template>
|
</template>
|
||||||
</Grid>
|
<VxeTable ref="tableRef" :data="list" show-overflow :loading="loading">
|
||||||
|
<VxeColumn field="id" title="编号" align="center" />
|
||||||
|
<VxeColumn field="name" title="名字" align="center" />
|
||||||
|
<VxeColumn field="sex" title="性别" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<DictTag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="row.sex" />
|
||||||
|
</template>
|
||||||
|
</VxeColumn>
|
||||||
|
<VxeColumn field="birthday" title="出生年" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ formatDateTime(row.birthday) }}
|
||||||
|
</template>
|
||||||
|
</VxeColumn>
|
||||||
|
<VxeColumn field="description" title="简介" align="center" />
|
||||||
|
<VxeColumn field="avatar" title="头像" align="center" />
|
||||||
|
<VxeColumn field="createTime" title="创建时间" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ formatDateTime(row.createTime) }}
|
||||||
|
</template>
|
||||||
|
</VxeColumn>
|
||||||
|
<VxeColumn field="operation" title="操作" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
type="link"
|
||||||
|
@click="onEdit(row as any)"
|
||||||
|
v-access:code="['infra:demo01-contact:update']"
|
||||||
|
>
|
||||||
|
{{ $t('ui.actionTitle.edit') }}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
type="link"
|
||||||
|
class="ml-2"
|
||||||
|
@click="onDelete(row as any)"
|
||||||
|
v-access:code="['infra:demo01-contact:delete']"
|
||||||
|
>
|
||||||
|
{{ $t('ui.actionTitle.delete') }}
|
||||||
|
</Button>
|
||||||
|
</template>
|
||||||
|
</VxeColumn>
|
||||||
|
</VxeTable>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<div class="mt-2 flex justify-end">
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:current="queryParams.pageNo"
|
||||||
|
v-model:page-size="queryParams.pageSize"
|
||||||
|
show-size-changer
|
||||||
|
@change="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ContentWrap>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,52 +1,73 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
|
||||||
import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
|
import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import {
|
||||||
|
DatePicker,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
message,
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
|
} from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
|
||||||
import {
|
import {
|
||||||
createDemo01Contact,
|
createDemo01Contact,
|
||||||
getDemo01Contact,
|
getDemo01Contact,
|
||||||
updateDemo01Contact,
|
updateDemo01Contact,
|
||||||
} from '#/api/infra/demo/demo01';
|
} from '#/api/infra/demo/demo01';
|
||||||
|
import { Tinymce as RichTextarea } from '#/components/tinymce';
|
||||||
|
import { ImageUpload } from '#/components/upload';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||||
import { useFormSchema } from '../data';
|
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<Demo01ContactApi.Demo01Contact>();
|
|
||||||
|
const formRef = ref();
|
||||||
|
const formData = ref<Partial<Demo01ContactApi.Demo01Contact>>({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
sex: undefined,
|
||||||
|
birthday: undefined,
|
||||||
|
description: undefined,
|
||||||
|
avatar: undefined,
|
||||||
|
});
|
||||||
|
const rules: Record<string, Rule[]> = {
|
||||||
|
name: [{ required: true, message: '名字不能为空', trigger: 'blur' }],
|
||||||
|
sex: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
|
||||||
|
birthday: [{ required: true, message: '出生年不能为空', trigger: 'blur' }],
|
||||||
|
description: [{ required: true, message: '简介不能为空', trigger: 'blur' }],
|
||||||
|
};
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
return formData.value?.id
|
return formData.value?.id
|
||||||
? $t('ui.actionTitle.edit', ['示例联系人'])
|
? $t('ui.actionTitle.edit', ['示例联系人'])
|
||||||
: $t('ui.actionTitle.create', ['示例联系人']);
|
: $t('ui.actionTitle.create', ['示例联系人']);
|
||||||
});
|
});
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
/** 重置表单 */
|
||||||
commonConfig: {
|
const resetForm = () => {
|
||||||
componentProps: {
|
formData.value = {
|
||||||
class: 'w-full',
|
id: undefined,
|
||||||
},
|
name: undefined,
|
||||||
formItemClass: 'col-span-2',
|
sex: undefined,
|
||||||
labelWidth: 80,
|
birthday: undefined,
|
||||||
},
|
description: undefined,
|
||||||
layout: 'horizontal',
|
avatar: undefined,
|
||||||
schema: useFormSchema(),
|
};
|
||||||
showDefaultActions: false,
|
formRef.value?.resetFields();
|
||||||
});
|
};
|
||||||
|
|
||||||
const [Modal, modalApi] = useVbenModal({
|
const [Modal, modalApi] = useVbenModal({
|
||||||
async onConfirm() {
|
async onConfirm() {
|
||||||
const { valid } = await formApi.validate();
|
await formRef.value?.validate();
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const data = (await formApi.getValues()) as Demo01ContactApi.Demo01Contact;
|
const data = formData.value as Demo01ContactApi.Demo01Contact;
|
||||||
try {
|
try {
|
||||||
await (formData.value?.id
|
await (formData.value?.id
|
||||||
? updateDemo01Contact(data)
|
? updateDemo01Contact(data)
|
||||||
|
@ -64,10 +85,9 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
},
|
},
|
||||||
async onOpenChange(isOpen: boolean) {
|
async onOpenChange(isOpen: boolean) {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
formData.value = undefined;
|
resetForm();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载数据
|
// 加载数据
|
||||||
let data = modalApi.getData<Demo01ContactApi.Demo01Contact>();
|
let data = modalApi.getData<Demo01ContactApi.Demo01Contact>();
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
@ -81,15 +101,47 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
modalApi.unlock();
|
modalApi.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 设置到 values
|
|
||||||
formData.value = data;
|
formData.value = data;
|
||||||
await formApi.setValues(formData.value);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Modal :title="getTitle">
|
<Modal :title="getTitle">
|
||||||
<Form class="mx-4" />
|
<Form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="{ span: 5 }"
|
||||||
|
:wrapper-col="{ span: 18 }"
|
||||||
|
>
|
||||||
|
<Form.Item label="名字" name="name">
|
||||||
|
<Input v-model:value="formData.name" placeholder="请输入名字" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="性别" name="sex">
|
||||||
|
<RadioGroup v-model:value="formData.sex">
|
||||||
|
<Radio
|
||||||
|
v-for="dict in getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number')"
|
||||||
|
:key="dict.value"
|
||||||
|
:value="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="出生年" name="birthday">
|
||||||
|
<DatePicker
|
||||||
|
v-model:value="formData.birthday"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择出生年"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="简介" name="description">
|
||||||
|
<RichTextarea v-model="formData.description" height="500px" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="头像" name="avatar">
|
||||||
|
<ImageUpload v-model:value="formData.avatar" />
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -154,6 +154,7 @@ onMounted(async () => {
|
||||||
class="w-full"
|
class="w-full"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<!-- TODO @puhui999:貌似性别的宽度不对;并且选择后,会变哈; -->
|
||||||
<Form.Item label="性别" name="sex">
|
<Form.Item label="性别" name="sex">
|
||||||
<Select
|
<Select
|
||||||
v-model:value="queryParams.sex"
|
v-model:value="queryParams.sex"
|
||||||
|
@ -161,6 +162,7 @@ onMounted(async () => {
|
||||||
allow-clear
|
allow-clear
|
||||||
class="w-full"
|
class="w-full"
|
||||||
>
|
>
|
||||||
|
<!-- TODO @puhui999:要不咱还是把 getIntDictOptions 还是搞出来?总归方便点~ -->
|
||||||
<Select.Option
|
<Select.Option
|
||||||
v-for="dict in getDictOptions(
|
v-for="dict in getDictOptions(
|
||||||
DICT_TYPE.SYSTEM_USER_SEX,
|
DICT_TYPE.SYSTEM_USER_SEX,
|
||||||
|
@ -191,6 +193,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap title="示例联系人">
|
<ContentWrap title="示例联系人">
|
||||||
|
<!-- TODO @puhui999:暗黑模式下,会有个黑底 -->
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<TableToolbar
|
<TableToolbar
|
||||||
ref="tableToolbarRef"
|
ref="tableToolbarRef"
|
||||||
|
|
|
@ -18,6 +18,9 @@ export function useContentMaximize() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切换最大化和隐藏 tabbar
|
||||||
|
*/
|
||||||
function toggleMaximizeAndTabbarHidden() {
|
function toggleMaximizeAndTabbarHidden() {
|
||||||
const isMaximize = contentIsMaximize.value;
|
const isMaximize = contentIsMaximize.value;
|
||||||
updatePreferences({
|
updatePreferences({
|
||||||
|
|
Loading…
Reference in New Issue