增加人像图片
This commit is contained in:
parent
b2d902a2e0
commit
81a89bb4dc
@ -46,6 +46,8 @@ export interface PersonLibVO {
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
labelText: any;
|
||||
|
||||
}
|
||||
|
||||
export interface PersonLibForm extends BaseEntity {
|
||||
|
@ -32,7 +32,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
|
||||
{
|
||||
title: '人员库编码',
|
||||
field: 'libCode',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '人员库名称',
|
||||
|
@ -1,12 +1,53 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { FormSchemaGetter, VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { DictEnum } from '@vben/constants';
|
||||
import { getPopupContainer } from '@vben/utils';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { personLibList } from '#/api/sis/personLib';
|
||||
import type { PersonLibQuery, PersonLibVO } from '#/api/sis/personLib/model';
|
||||
import { Tag } from 'ant-design-vue';
|
||||
|
||||
let libArr: PersonLibVO[] = [];
|
||||
const labelText: VbenFormSchema = {
|
||||
label: '图片库',
|
||||
fieldName: 'libId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
resultField: 'list', // 根据API返回结构调整
|
||||
labelField: 'labelText',
|
||||
valueField: 'id',
|
||||
// immediate: true,
|
||||
api: async () => {
|
||||
if(!libArr || libArr.length == 0){
|
||||
const params: PersonLibQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 500,
|
||||
};
|
||||
const res = await personLibList(params);
|
||||
res.rows.forEach((item) => {
|
||||
let tag =
|
||||
item.libType == 1 ? (
|
||||
<Tag color="#108ee9">人像库</Tag>
|
||||
) : (
|
||||
<Tag color="#2db7f5">工服库</Tag>
|
||||
);
|
||||
item.labelText = (
|
||||
<span>
|
||||
{item.libName} {tag}
|
||||
</span>
|
||||
);
|
||||
});
|
||||
libArr = res.rows
|
||||
}
|
||||
return libArr;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
labelText,
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'imgName',
|
||||
@ -69,6 +110,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
labelText,
|
||||
{
|
||||
label: '人像名称',
|
||||
fieldName: 'imgName',
|
||||
@ -115,7 +157,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '人像图片',
|
||||
fieldName: 'img',
|
||||
fieldName: 'imgUrl',
|
||||
component: 'ImageUpload',
|
||||
componentProps: {
|
||||
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
|
@ -31,6 +31,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
|
Loading…
Reference in New Issue
Block a user