项目初始化

This commit is contained in:
2026-03-20 15:40:07 +08:00
parent 7e10da0edf
commit f0ddf11022
27 changed files with 3253 additions and 7 deletions

View File

@@ -0,0 +1,59 @@
/**
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
*/
import { defHttp } from '@jeesite/core/utils/http/axios';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
import { UploadFileParams } from '@jeesite/types/axios';
import { AxiosProgressEvent } from 'axios';
const { ctxPath, adminPath } = useGlobSetting();
export interface MyCompany extends BasicModel<MyCompany> {
createTime?: string; // 记录时间
companyId?: string; // 唯一主键
companyName: string; // 公司全称
shortName: string; // 公司简称
creditCode: string; // 统一社会信用代码
legalPerson: string; // 法人姓名
registeredCapital: string; // 注册资本
establishDate: string; // 成立日期
province: string; // 所在省份
city: string; // 所在城市
address: string; // 注册地址
businessScope: string; // 经营范围
contactPhone?: string; // 公司电话
contactEmail?: string; // 公司邮箱
ustatus: string; // 数据状态
updateTime?: string; // 更新时间
}
export const myCompanyList = (params?: MyCompany | any) =>
defHttp.get<MyCompany>({ url: adminPath + '/biz/myCompany/list', params });
export const myCompanyListData = (params?: MyCompany | any) =>
defHttp.post<Page<MyCompany>>({ url: adminPath + '/biz/myCompany/listData', params });
export const myCompanyForm = (params?: MyCompany | any) =>
defHttp.get<MyCompany>({ url: adminPath + '/biz/myCompany/form', params });
export const myCompanySave = (params?: any, data?: MyCompany | any) =>
defHttp.postJson<MyCompany>({ url: adminPath + '/biz/myCompany/save', params, data });
export const myCompanyImportData = (
params: UploadFileParams,
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) =>
defHttp.uploadFile<UploadApiResult>(
{
url: ctxPath + adminPath + '/biz/myCompany/importData',
onUploadProgress,
},
params,
);
export const myCompanyDelete = (params?: MyCompany | any) =>
defHttp.get<MyCompany>({ url: adminPath + '/biz/myCompany/delete', params });

View File

@@ -0,0 +1,55 @@
/**
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
*/
import { defHttp } from '@jeesite/core/utils/http/axios';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
import { UploadFileParams } from '@jeesite/types/axios';
import { AxiosProgressEvent } from 'axios';
const { ctxPath, adminPath } = useGlobSetting();
export interface MyNotes extends BasicModel<MyNotes> {
createTime?: string; // 记录时间
noteId?: string; // 唯一标识
title: string; // 标题
content: string; // 内容
priority: string; // 级别
ustatus: string; // 状态
startTime?: string; // 开始时间
endTime?: string; // 结束时间
type: string; // 类型
deadline: string; // 截至时间
updateTime?: string; // 更新时间
createUser?: string; // 创建用户
}
export const myNotesList = (params?: MyNotes | any) =>
defHttp.get<MyNotes>({ url: adminPath + '/biz/myNotes/list', params });
export const myNotesListData = (params?: MyNotes | any) =>
defHttp.post<Page<MyNotes>>({ url: adminPath + '/biz/myNotes/listData', params });
export const myNotesForm = (params?: MyNotes | any) =>
defHttp.get<MyNotes>({ url: adminPath + '/biz/myNotes/form', params });
export const myNotesSave = (params?: any, data?: MyNotes | any) =>
defHttp.postJson<MyNotes>({ url: adminPath + '/biz/myNotes/save', params, data });
export const myNotesImportData = (
params: UploadFileParams,
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) =>
defHttp.uploadFile<UploadApiResult>(
{
url: ctxPath + adminPath + '/biz/myNotes/importData',
onUploadProgress,
},
params,
);
export const myNotesDelete = (params?: MyNotes | any) =>
defHttp.get<MyNotes>({ url: adminPath + '/biz/myNotes/delete', params });

View File

@@ -0,0 +1,57 @@
/**
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
*/
import { defHttp } from '@jeesite/core/utils/http/axios';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
import { UploadFileParams } from '@jeesite/types/axios';
import { AxiosProgressEvent } from 'axios';
const { ctxPath, adminPath } = useGlobSetting();
export interface MyPerson extends BasicModel<MyPerson> {
createTime?: string; // 记录时间
personId?: string; // 唯一主键
personName: string; // 姓名
gender: string; // 性别
idCard: string; // 身份证号
phone?: string; // 手机号码
email?: string; // 邮箱
birthDate: string; // 出生日期
address?: string; // 居住地址
department?: string; // 所属部门
positionName?: string; // 职位
ustatus?: string; // 状态
companyId?: string; // 公司编号
updateTime?: string; // 更新时间
}
export const myPersonList = (params?: MyPerson | any) =>
defHttp.get<MyPerson>({ url: adminPath + '/biz/myPerson/list', params });
export const myPersonListData = (params?: MyPerson | any) =>
defHttp.post<Page<MyPerson>>({ url: adminPath + '/biz/myPerson/listData', params });
export const myPersonForm = (params?: MyPerson | any) =>
defHttp.get<MyPerson>({ url: adminPath + '/biz/myPerson/form', params });
export const myPersonSave = (params?: any, data?: MyPerson | any) =>
defHttp.postJson<MyPerson>({ url: adminPath + '/biz/myPerson/save', params, data });
export const myPersonImportData = (
params: UploadFileParams,
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) =>
defHttp.uploadFile<UploadApiResult>(
{
url: ctxPath + adminPath + '/biz/myPerson/importData',
onUploadProgress,
},
params,
);
export const myPersonDelete = (params?: MyPerson | any) =>
defHttp.get<MyPerson>({ url: adminPath + '/biz/myPerson/delete', params });

View File

@@ -0,0 +1,206 @@
<!--
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicDrawer
v-bind="$attrs"
:showFooter="true"
:okAuth="'biz:myCompany:edit'"
@register="registerDrawer"
@ok="handleSubmit"
width="70%"
>
<template #title>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<BasicForm @register="registerForm" />
</BasicDrawer>
</template>
<script lang="ts" setup name="ViewsBizMyCompanyForm">
import { ref, unref, computed } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
import { MyCompany, myCompanySave, myCompanyForm } from '@jeesite/biz/api/biz/myCompany';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myCompany');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyCompany>({} as MyCompany);
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增公司') : t('编辑公司'),
}));
const inputFormSchemas: FormSchema<MyCompany>[] = [
{
label: t('基本信息'),
field: 'basicInfo',
component: 'FormGroup',
colProps: { md: 24, lg: 24 },
},
{
label: t('公司全称'),
field: 'companyName',
component: 'Input',
componentProps: {
maxlength: 100,
},
required: true,
},
{
label: t('公司简称'),
field: 'shortName',
component: 'Input',
componentProps: {
maxlength: 50,
},
required: true,
},
{
label: t('信用代码'),
field: 'creditCode',
component: 'Input',
componentProps: {
maxlength: 18,
},
required: true,
},
{
label: t('法人姓名'),
field: 'legalPerson',
component: 'Input',
componentProps: {
maxlength: 50,
},
required: true,
},
{
label: t('注册资本'),
field: 'registeredCapital',
component: 'Input',
componentProps: {
maxlength: 50,
},
required: true,
},
{
label: t('成立日期'),
field: 'establishDate',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
required: true,
},
{
label: t('所在省份'),
field: 'province',
component: 'Input',
componentProps: {
maxlength: 30,
},
required: true,
},
{
label: t('所在城市'),
field: 'city',
component: 'Input',
componentProps: {
maxlength: 30,
},
required: true,
},
{
label: t('注册地址'),
field: 'address',
component: 'Input',
componentProps: {
maxlength: 255,
},
required: true,
colProps: { md: 24, lg: 24 },
},
{
label: t('经营范围'),
field: 'businessScope',
component: 'Input',
required: true,
},
{
label: t('公司电话'),
field: 'contactPhone',
component: 'Input',
componentProps: {
maxlength: 30,
},
},
{
label: t('公司邮箱'),
field: 'contactEmail',
component: 'Input',
componentProps: {
maxlength: 100,
},
},
{
label: t('公司状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
required: true,
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyCompany>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await myCompanyForm(data);
record.value = (res.myCompany || {}) as MyCompany;
record.value.__t = new Date().getTime();
await setFieldsValue(record.value);
setDrawerProps({ loading: false });
});
async function handleSubmit() {
try {
const data = await validate();
setDrawerProps({ confirmLoading: true });
const params: any = {
isNewRecord: record.value.isNewRecord,
companyId: record.value.companyId || data.companyId,
};
// console.log('submit', params, data, record);
const res = await myCompanySave(params, data);
showMessage(res.message);
setTimeout(closeDrawer);
emit('success', data);
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setDrawerProps({ confirmLoading: false });
}
}
</script>

View File

@@ -0,0 +1,305 @@
<!--
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<template #toolbar>
<a-button type="default" :loading="loading" @click="handleExport()">
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
</a-button>
<a-button type="primary" @click="handleForm({})" v-auth="'biz:myCompany:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #bizScopeKey="{ record, text, value }">
<a @click="handleForm({ companyId: record.companyId })" :title="value">
{{ text }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizMyCompanyList">
import { onMounted, ref, unref } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
import { MyCompany, myCompanyList } from '@jeesite/biz/api/biz/myCompany';
import { myCompanyDelete, myCompanyListData } from '@jeesite/biz/api/biz/myCompany';
import { useDrawer } from '@jeesite/core/components/Drawer';
import { useModal } from '@jeesite/core/components/Modal';
import { FormProps } from '@jeesite/core/components/Form';
import InputForm from './form.vue';
const { t } = useI18n('biz.myCompany');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyCompany>({} as MyCompany);
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('公司管理'),
};
const loading = ref(false);
const searchForm: FormProps<MyCompany> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('公司全称'),
field: 'companyName',
component: 'Input',
},
{
label: t('信用代码'),
field: 'creditCode',
component: 'Input',
},
{
label: t('所在省份'),
field: 'province',
component: 'Input',
},
{
label: t('公司电话'),
field: 'contactPhone',
component: 'Input',
},
{
label: t('公司状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<MyCompany>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left'
},
{
title: t('公司全称'),
dataIndex: 'companyName',
key: 'a.company_name',
sorter: true,
width: 130,
align: 'left',
slot: 'bizScopeKey',
},
{
title: t('公司简称'),
dataIndex: 'shortName',
key: 'a.short_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('统一社会信用代码'),
dataIndex: 'creditCode',
key: 'a.credit_code',
sorter: true,
width: 200,
align: 'left',
},
{
title: t('法人姓名'),
dataIndex: 'legalPerson',
key: 'a.legal_person',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('注册资本'),
dataIndex: 'registeredCapital',
key: 'a.registered_capital',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('成立日期'),
dataIndex: 'establishDate',
key: 'a.establish_date',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('所在省份'),
dataIndex: 'province',
key: 'a.province',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('所在城市'),
dataIndex: 'city',
key: 'a.city',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('注册地址'),
dataIndex: 'address',
key: 'a.address',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('经营范围'),
dataIndex: 'businessScope',
key: 'a.business_scope',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('公司电话'),
dataIndex: 'contactPhone',
key: 'a.contact_phone',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('公司邮箱'),
dataIndex: 'contactEmail',
key: 'a.contact_email',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('公司状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 150,
align: 'center',
},
];
const actionColumn: BasicColumn<MyCompany> = {
width: 160,
align: 'center',
actions: (record: MyCompany) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑'),
onClick: handleForm.bind(this, { companyId: record.companyId }),
auth: 'biz:myCompany:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除'),
popConfirm: {
title: t('是否确认删除公司?'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myCompany:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<MyCompany>({
api: myCompanyListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await myCompanyList();
record.value = (res.myCompany || {}) as MyCompany;
await getForm().setFieldsValue(record.value);
});
const [registerDrawer, { openDrawer }] = useDrawer();
function handleForm(record: Recordable) {
openDrawer(true, record);
}
async function handleExport() {
loading.value = true;
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/myCompany/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
async function handleDelete(record: Recordable) {
const params = { companyId: record.companyId };
const res = await myCompanyDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -0,0 +1,207 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { MyCompany, myCompanyListData } from '@jeesite/biz/api/biz/myCompany';
const { t } = useI18n('biz.myCompany');
const modalProps = {
title: t('公司选择'),
};
const searchForm: FormProps<MyCompany> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('公司全称'),
field: 'companyName',
component: 'Input',
},
{
label: t('统一社会信用代码'),
field: 'creditCode',
component: 'Input',
},
{
label: t('所在省份'),
field: 'province',
component: 'Input',
},
{
label: t('公司电话'),
field: 'contactPhone',
component: 'Input',
},
{
label: t('数据状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<MyCompany>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 230,
align: 'left',
slot: 'firstColumn',
},
{
title: t('公司全称'),
dataIndex: 'companyName',
key: 'a.company_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('公司简称'),
dataIndex: 'shortName',
key: 'a.short_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('统一社会信用代码'),
dataIndex: 'creditCode',
key: 'a.credit_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('法人姓名'),
dataIndex: 'legalPerson',
key: 'a.legal_person',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('注册资本'),
dataIndex: 'registeredCapital',
key: 'a.registered_capital',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('成立日期'),
dataIndex: 'establishDate',
key: 'a.establish_date',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('所在省份'),
dataIndex: 'province',
key: 'a.province',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('所在城市'),
dataIndex: 'city',
key: 'a.city',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('注册地址'),
dataIndex: 'address',
key: 'a.address',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('经营范围'),
dataIndex: 'businessScope',
key: 'a.business_scope',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('公司电话'),
dataIndex: 'contactPhone',
key: 'a.contact_phone',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('公司邮箱'),
dataIndex: 'contactEmail',
key: 'a.contact_email',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('数据状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 130,
align: 'center',
},
];
const tableProps: BasicTableProps = {
api: myCompanyListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'companyId',
};
export default {
modalProps,
tableProps,
itemCode: 'companyId',
itemName: 'companyId',
isShowCode: false,
};

View File

@@ -0,0 +1,166 @@
<!--
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicDrawer
v-bind="$attrs"
:showFooter="true"
:okAuth="'biz:myNotes:edit'"
@register="registerDrawer"
@ok="handleSubmit"
width="70%"
>
<template #title>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<BasicForm @register="registerForm" />
</BasicDrawer>
</template>
<script lang="ts" setup name="ViewsBizMyNotesForm">
import { ref, unref, computed } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
import { MyNotes, myNotesSave, myNotesForm } from '@jeesite/biz/api/biz/myNotes';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myNotes');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyNotes>({} as MyNotes);
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增便签') : t('编辑便签'),
}));
const inputFormSchemas: FormSchema<MyNotes>[] = [
{
label: t('基本信息'),
field: 'basicInfo',
component: 'FormGroup',
colProps: { md: 24, lg: 24 },
},
{
label: t('标题'),
field: 'title',
component: 'Input',
componentProps: {
maxlength: 52,
},
required: true,
colProps: { md: 24, lg: 24 },
},
{
label: t('内容'),
field: 'content',
component: 'InputTextArea',
required: true,
colProps: { md: 24, lg: 24 },
},
{
label: t('级别'),
field: 'priority',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
required: true,
},
{
label: t('状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
required: true,
},
{
label: t('开始时间'),
field: 'startTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('结束时间'),
field: 'endTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('类型'),
field: 'type',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
required: true,
},
{
label: t('截至时间'),
field: 'deadline',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
required: true,
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyNotes>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await myNotesForm(data);
record.value = (res.myNotes || {}) as MyNotes;
record.value.__t = new Date().getTime();
await setFieldsValue(record.value);
setDrawerProps({ loading: false });
});
async function handleSubmit() {
try {
const data = await validate();
setDrawerProps({ confirmLoading: true });
const params: any = {
isNewRecord: record.value.isNewRecord,
noteId: record.value.noteId || data.noteId,
};
// console.log('submit', params, data, record);
const res = await myNotesSave(params, data);
showMessage(res.message);
setTimeout(closeDrawer);
emit('success', data);
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setDrawerProps({ confirmLoading: false });
}
}
</script>

View File

@@ -0,0 +1,275 @@
<!--
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<template #toolbar>
<a-button type="default" :loading="loading" @click="handleExport()">
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
</a-button>
<a-button type="primary" @click="handleForm({})" v-auth="'biz:myNotes:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #bizScopeKey="{ record, text, value }">
<a @click="handleForm({ noteId: record.noteId })" :title="value">
{{ text }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizMyNotesList">
import { onMounted, ref, unref } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
import { MyNotes, myNotesList } from '@jeesite/biz/api/biz/myNotes';
import { myNotesDelete, myNotesListData } from '@jeesite/biz/api/biz/myNotes';
import { useDrawer } from '@jeesite/core/components/Drawer';
import { useModal } from '@jeesite/core/components/Modal';
import { FormProps } from '@jeesite/core/components/Form';
import InputForm from './form.vue';
const { t } = useI18n('biz.myNotes');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyNotes>({} as MyNotes);
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('便签管理'),
};
const loading = ref(false);
const searchForm: FormProps<MyNotes> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('标题'),
field: 'title',
component: 'Input',
},
{
label: t('内容'),
field: 'content',
component: 'Input',
},
{
label: t('级别'),
field: 'priority',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
{
label: t('状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
{
label: t('类型'),
field: 'type',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<MyNotes>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
},
{
title: t('标题'),
dataIndex: 'title',
key: 'a.title',
sorter: true,
width: 180,
align: 'left',
slot: 'bizScopeKey',
},
{
title: t('内容'),
dataIndex: 'content',
key: 'a.content',
sorter: true,
width: 225,
align: 'left',
},
{
title: t('级别'),
dataIndex: 'priority',
key: 'a.priority',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('开始时间'),
dataIndex: 'startTime',
key: 'a.start_time',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('结束时间'),
dataIndex: 'endTime',
key: 'a.end_time',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('类型'),
dataIndex: 'type',
key: 'a.type',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('截至时间'),
dataIndex: 'deadline',
key: 'a.deadline',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 150,
align: 'center',
},
];
const actionColumn: BasicColumn<MyNotes> = {
width: 160,
align: 'center',
actions: (record: MyNotes) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑'),
onClick: handleForm.bind(this, { noteId: record.noteId }),
auth: 'biz:myNotes:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除'),
popConfirm: {
title: t('是否确认删除便签?'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myNotes:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<MyNotes>({
api: myNotesListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await myNotesList();
record.value = (res.myNotes || {}) as MyNotes;
await getForm().setFieldsValue(record.value);
});
const [registerDrawer, { openDrawer }] = useDrawer();
function handleForm(record: Recordable) {
openDrawer(true, record);
}
async function handleExport() {
loading.value = true;
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/myNotes/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
async function handleDelete(record: Recordable) {
const params = { noteId: record.noteId };
const res = await myNotesDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -0,0 +1,187 @@
<!--
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicDrawer
v-bind="$attrs"
:showFooter="true"
:okAuth="'biz:myPerson:edit'"
@register="registerDrawer"
@ok="handleSubmit"
width="70%"
>
<template #title>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<BasicForm @register="registerForm" />
</BasicDrawer>
</template>
<script lang="ts" setup name="ViewsBizMyPersonForm">
import { ref, unref, computed } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
import { MyPerson, myPersonSave, myPersonForm } from '@jeesite/biz/api/biz/myPerson';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myPerson');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyPerson>({} as MyPerson);
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增人员') : t('编辑人员'),
}));
const inputFormSchemas: FormSchema<MyPerson>[] = [
{
label: t('基本信息'),
field: 'basicInfo',
component: 'FormGroup',
colProps: { md: 24, lg: 24 },
},
{
label: t('姓名'),
field: 'personName',
component: 'Input',
componentProps: {
maxlength: 50,
},
required: true,
},
{
label: t('性别'),
field: 'gender',
component: 'Input',
componentProps: {
maxlength: 12,
},
required: true,
},
{
label: t('身份证号'),
field: 'idCard',
component: 'Input',
componentProps: {
maxlength: 18,
},
required: true,
},
{
label: t('手机号码'),
field: 'phone',
component: 'Input',
componentProps: {
maxlength: 20,
},
},
{
label: t('电子邮箱'),
field: 'email',
component: 'Input',
componentProps: {
maxlength: 100,
},
},
{
label: t('出生日期'),
field: 'birthDate',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
required: true,
},
{
label: t('居住地址'),
field: 'address',
component: 'Input',
componentProps: {
maxlength: 255,
},
colProps: { md: 24, lg: 24 },
},
{
label: t('所属部门'),
field: 'department',
component: 'Input',
componentProps: {
maxlength: 50,
},
},
{
label: t('所属职位'),
field: 'positionName',
component: 'Input',
componentProps: {
maxlength: 50,
},
},
{
label: t('所属公司'),
field: 'companyId',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
{
label: t('人员状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyPerson>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await myPersonForm(data);
record.value = (res.myPerson || {}) as MyPerson;
record.value.__t = new Date().getTime();
await setFieldsValue(record.value);
setDrawerProps({ loading: false });
});
async function handleSubmit() {
try {
const data = await validate();
setDrawerProps({ confirmLoading: true });
const params: any = {
isNewRecord: record.value.isNewRecord,
personId: record.value.personId || data.personId,
};
// console.log('submit', params, data, record);
const res = await myPersonSave(params, data);
showMessage(res.message);
setTimeout(closeDrawer);
emit('success', data);
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setDrawerProps({ confirmLoading: false });
}
}
</script>

View File

@@ -0,0 +1,294 @@
<!--
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<template #toolbar>
<a-button type="default" :loading="loading" @click="handleExport()">
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
</a-button>
<a-button type="primary" @click="handleForm({})" v-auth="'biz:myPerson:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #bizScopeKey="{ record, text, value }">
<a @click="handleForm({ personId: record.personId })" :title="value">
{{ text }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizMyPersonList">
import { onMounted, ref, unref } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
import { MyPerson, myPersonList } from '@jeesite/biz/api/biz/myPerson';
import { myPersonDelete, myPersonListData } from '@jeesite/biz/api/biz/myPerson';
import { useDrawer } from '@jeesite/core/components/Drawer';
import { useModal } from '@jeesite/core/components/Modal';
import { FormProps } from '@jeesite/core/components/Form';
import InputForm from './form.vue';
const { t } = useI18n('biz.myPerson');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyPerson>({} as MyPerson);
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('人员管理'),
};
const loading = ref(false);
const searchForm: FormProps<MyPerson> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('姓名'),
field: 'personName',
component: 'Input',
},
{
label: t('性别'),
field: 'gender',
component: 'Input',
},
{
label: t('身份证号'),
field: 'idCard',
component: 'Input',
},
{
label: t('公司编号'),
field: 'companyId',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
{
label: t('状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<MyPerson>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
},
{
title: t('姓名'),
dataIndex: 'personName',
key: 'a.person_name',
sorter: true,
width: 130,
align: 'left',
slot: 'bizScopeKey',
},
{
title: t('性别'),
dataIndex: 'gender',
key: 'a.gender',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('身份证号'),
dataIndex: 'idCard',
key: 'a.id_card',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('手机号码'),
dataIndex: 'phone',
key: 'a.phone',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('邮箱'),
dataIndex: 'email',
key: 'a.email',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('出生日期'),
dataIndex: 'birthDate',
key: 'a.birth_date',
sorter: true,
width: 180,
align: 'center',
},
{
title: t('居住地址'),
dataIndex: 'address',
key: 'a.address',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('所属部门'),
dataIndex: 'department',
key: 'a.department',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('职位'),
dataIndex: 'positionName',
key: 'a.position_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('公司编号'),
dataIndex: 'companyId',
key: 'a.company_id',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 180,
align: 'center',
},
];
const actionColumn: BasicColumn<MyPerson> = {
width: 160,
align: 'center',
actions: (record: MyPerson) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑'),
onClick: handleForm.bind(this, { personId: record.personId }),
auth: 'biz:myPerson:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除'),
popConfirm: {
title: t('是否确认删除人员?'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myPerson:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<MyPerson>({
api: myPersonListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await myPersonList();
record.value = (res.myPerson || {}) as MyPerson;
await getForm().setFieldsValue(record.value);
});
const [registerDrawer, { openDrawer }] = useDrawer();
function handleForm(record: Recordable) {
openDrawer(true, record);
}
async function handleExport() {
loading.value = true;
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/myPerson/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
async function handleDelete(record: Recordable) {
const params = { personId: record.personId };
const res = await myPersonDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -0,0 +1,196 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { MyPerson, myPersonListData } from '@jeesite/biz/api/biz/myPerson';
const { t } = useI18n('biz.myPerson');
const modalProps = {
title: t('人员选择'),
};
const searchForm: FormProps<MyPerson> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('姓名'),
field: 'personName',
component: 'Input',
},
{
label: t('性别'),
field: 'gender',
component: 'Input',
},
{
label: t('身份证号'),
field: 'idCard',
component: 'Input',
},
{
label: t('状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
{
label: t('公司编号'),
field: 'companyId',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<MyPerson>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 230,
align: 'left',
slot: 'firstColumn',
},
{
title: t('姓名'),
dataIndex: 'personName',
key: 'a.person_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('性别'),
dataIndex: 'gender',
key: 'a.gender',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('身份证号'),
dataIndex: 'idCard',
key: 'a.id_card',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('手机号码'),
dataIndex: 'phone',
key: 'a.phone',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('邮箱'),
dataIndex: 'email',
key: 'a.email',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('出生日期'),
dataIndex: 'birthDate',
key: 'a.birth_date',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('居住地址'),
dataIndex: 'address',
key: 'a.address',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('所属部门'),
dataIndex: 'department',
key: 'a.department',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('职位'),
dataIndex: 'positionName',
key: 'a.position_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('公司编号'),
dataIndex: 'companyId',
key: 'a.company_id',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 130,
align: 'center',
},
];
const tableProps: BasicTableProps = {
api: myPersonListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'personId',
};
export default {
modalProps,
tableProps,
itemCode: 'personId',
itemName: 'personId',
isShowCode: false,
};

View File

@@ -88,7 +88,7 @@
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
fixed: 'left',
},
{
title: t('网站名称'),
@@ -192,12 +192,6 @@
loading.value = false;
}
const [registerImportModal, { openModal: importModal }] = useModal();
function handleImport() {
importModal(true, {});
}
async function handleDelete(record: Recordable) {
const params = { websiteId: record.websiteId };
const res = await myWebsiteStorageDelete(params);