初始化项目

This commit is contained in:
2026-03-22 00:27:15 +08:00
parent b40a1634ef
commit 1b9448a5a3
105 changed files with 11434 additions and 193 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 MyChartInfo extends BasicModel<MyChartInfo> {
createTime?: string; // 记录时间
chartId: string; // 唯一标识
chartName?: string; // 图表名称
chartCode?: string; // 图表编号
sort?: number; // 序号
vueName?: string; // 组件名称
grid?: string; // 间距
ustatus?: string; // 状态
chartType?: string; // 图表类型
itemName?: string; // 项目名称
itemCode?: string; // 项目编号
remark?: string; // 备注描述
updateTime?: string; // 更新时间
}
export const myChartInfoList = (params?: MyChartInfo | any) =>
defHttp.get<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/list', params });
export const myChartInfoListAll = (params?: MyChartInfo | any) =>
defHttp.get<MyChartInfo[]>({ url: adminPath + '/biz/myChartInfo/listAll', params });
export const myChartInfoListData = (params?: MyChartInfo | any) =>
defHttp.post<Page<MyChartInfo>>({ url: adminPath + '/biz/myChartInfo/listData', params });
export const myChartInfoForm = (params?: MyChartInfo | any) =>
defHttp.get<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/form', params });
export const myChartInfoSave = (params?: any, data?: MyChartInfo | any) =>
defHttp.postJson<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/save', params, data });
export const myChartInfoImportData = (
params: UploadFileParams,
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) =>
defHttp.uploadFile<UploadApiResult>(
{
url: ctxPath + adminPath + '/biz/myChartInfo/importData',
onUploadProgress,
},
params,
);
export const myChartInfoDelete = (params?: MyChartInfo | any) =>
defHttp.get<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/delete', params });

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 MyProjectInfo extends BasicModel<MyProjectInfo> {
createTime?: string; // 记录创建时间
projectId?: string; // 唯一主键
projectCode: string; // 项目编码
projectName: string; // 项目名称
projectDesc?: string; // 项目描述
personId: string; // 人员编号
priority: string; // 级别
areaLevel: string; // 区域级别
areaCode: string; // 区域编号
startDate?: string; // 预计开始日期
endDate?: string; // 预计结束日期
actualEndDate?: string; // 实际结束日期
budget: number; // 项目预算(元)
projectType: string; // 项目类型
projectStatus: string; // 项目状态
updateTime?: string; // 更新时间
}
export const myProjectInfoList = (params?: MyProjectInfo | any) =>
defHttp.get<MyProjectInfo>({ url: adminPath + '/biz/myProjectInfo/list', params });
export const myProjectInfoListData = (params?: MyProjectInfo | any) =>
defHttp.post<Page<MyProjectInfo>>({ url: adminPath + '/biz/myProjectInfo/listData', params });
export const myProjectInfoForm = (params?: MyProjectInfo | any) =>
defHttp.get<MyProjectInfo>({ url: adminPath + '/biz/myProjectInfo/form', params });
export const myProjectInfoSave = (params?: any, data?: MyProjectInfo | any) =>
defHttp.postJson<MyProjectInfo>({ url: adminPath + '/biz/myProjectInfo/save', params, data });
export const myProjectInfoImportData = (
params: UploadFileParams,
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) =>
defHttp.uploadFile<UploadApiResult>(
{
url: ctxPath + adminPath + '/biz/myProjectInfo/importData',
onUploadProgress,
},
params,
);
export const myProjectInfoDelete = (params?: MyProjectInfo | any) =>
defHttp.get<MyProjectInfo>({ url: adminPath + '/biz/myProjectInfo/delete', params });

View File

@@ -0,0 +1,174 @@
<!--
* 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:myChartInfo: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="ViewsBizMyChartInfoForm">
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 { MyChartInfo, myChartInfoSave, myChartInfoForm } from '@jeesite/biz/api/biz/myChartInfo';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myChartInfo');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyChartInfo>({} as MyChartInfo);
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增图表') : t('编辑图表'),
}));
const inputFormSchemas: FormSchema<MyChartInfo>[] = [
{
label: t('基本信息'),
field: 'basicInfo',
component: 'FormGroup',
colProps: { md: 24, lg: 24 },
},
{
label: t('图表名称'),
field: 'chartName',
component: 'Input',
componentProps: {
maxlength: 152,
},
required: true,
},
{
label: t('所属看板'),
field: 'chartCode',
fieldLabel: 'screenTitle',
component: 'ListSelect',
componentProps: {
selectType: 'bizScreenSelect',
},
required: true,
},
{
label: t('组件名称'),
field: 'vueName',
component: 'Input',
componentProps: {
maxlength: 152,
},
required: true,
},
{
label: t('图表间距'),
field: 'grid',
component: 'InputNumber',
componentProps: {
maxlength: 12,
},
required: true,
},
{
label: t('图表类型'),
field: 'chartType',
component: 'Input',
componentProps: {
maxlength: 52,
},
required: true,
},
{
label: t('项目名称'),
field: 'itemName',
component: 'Input',
componentProps: {
maxlength: 52,
},
required: true,
},
{
label: t('项目编号'),
field: 'itemCode',
component: 'Input',
componentProps: {
maxlength: 52,
},
required: true,
},
{
label: t('图表状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: 'biz_status',
allowClear: true,
},
required: true,
},
{
label: t('备注描述'),
field: 'remark',
component: 'InputTextArea',
componentProps: {
maxlength: 52,
},
colProps: { md: 24, lg: 24 },
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyChartInfo>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await myChartInfoForm(data);
record.value = (res.myChartInfo || {}) as MyChartInfo;
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,
chartId: record.value.chartId || data.chartId,
};
// console.log('submit', params, data, record);
const res = await myChartInfoSave(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,285 @@
<!--
* 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:myChartInfo:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #bizScopeKey="{ record, text, value }">
<a @click="handleForm({ chartId: record.chartId })" :title="value">
{{ text }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizMyChartInfoList">
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 { MyChartInfo, myChartInfoList } from '@jeesite/biz/api/biz/myChartInfo';
import { myChartInfoDelete, myChartInfoListData } from '@jeesite/biz/api/biz/myChartInfo';
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.myChartInfo');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyChartInfo>({} as MyChartInfo);
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('图表管理'),
};
const loading = ref(false);
const searchForm: FormProps<MyChartInfo> = {
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: 'chartName',
component: 'Input',
},
{
label: t('图表编号'),
field: 'chartCode',
fieldLabel: 'screenTitle',
component: 'ListSelect',
componentProps: {
selectType: 'bizScreenSelect',
},
},
{
label: t('状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: 'biz_status',
allowClear: true,
},
},
{
label: t('图表类型'),
field: 'chartType',
component: 'Input',
},
{
label: t('项目编号'),
field: 'itemCode',
component: 'Input',
},
],
};
const tableColumns: BasicColumn<MyChartInfo>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
},
{
title: t('图表名称'),
dataIndex: 'chartName',
key: 'a.chart_name',
sorter: true,
width: 200,
align: 'left',
slot: 'bizScopeKey',
},
{
title: t('图表编号'),
dataIndex: 'chartCode',
key: 'a.chart_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('大屏标题'),
dataIndex: 'screenTitle',
key: 'b.screen_title',
sorter: true,
width: 200,
align: 'left',
},
{
title: t('序号'),
dataIndex: 'sort',
key: 'a.sort',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('组件名称'),
dataIndex: 'vueName',
key: 'a.vue_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('间距'),
dataIndex: 'grid',
key: 'a.grid',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('图表类型'),
dataIndex: 'chartType',
key: 'a.chart_type',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('项目名称'),
dataIndex: 'itemName',
key: 'a.item_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('项目编号'),
dataIndex: 'itemCode',
key: 'a.item_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
sorter: true,
width: 130,
align: 'center',
dictType: 'biz_status',
},
];
const actionColumn: BasicColumn<MyChartInfo> = {
width: 160,
align: 'center',
actions: (record: MyChartInfo) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑'),
onClick: handleForm.bind(this, { chartId: record.chartId }),
auth: 'biz:myChartInfo:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除'),
popConfirm: {
title: t('是否确认删除图表?'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myChartInfo:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<MyChartInfo>({
api: myChartInfoListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await myChartInfoList();
record.value = (res.myChartInfo || {}) as MyChartInfo;
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/myChartInfo/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
async function handleDelete(record: Recordable) {
const params = { chartId: record.chartId };
const res = await myChartInfoDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -1,14 +1,14 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { MyScreenInfo, myScreenInfoListData } from '@jeesite/biz/api/biz/myScreenInfo';
import { myChartInfoListData } from '@jeesite/biz/api/biz/myChartInfo';
const { t } = useI18n('biz.myScreenInfo');
const { t } = useI18n('biz.myChartInfo');
const modalProps = {
title: t('大屏选择'),
title: t('图表选择'),
};
const searchForm: FormProps<MyScreenInfo> = {
const searchForm: FormProps<MyChartInfo> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
@@ -31,23 +31,13 @@ const searchForm: FormProps<MyScreenInfo> = {
},
},
{
label: t('大屏名称'),
field: 'screenName',
label: t('图表名称'),
field: 'chartName',
component: 'Input',
},
{
label: t('大屏编码'),
field: 'screenCode',
component: 'Input',
},
{
label: t('大屏标题'),
field: 'screenTitle',
component: 'Input',
},
{
label: t('路由地址'),
field: 'path',
label: t('图表编号'),
field: 'chartCode',
component: 'Input',
},
{
@@ -59,10 +49,20 @@ const searchForm: FormProps<MyScreenInfo> = {
allowClear: true,
},
},
{
label: t('图表类型'),
field: 'chartType',
component: 'Input',
},
{
label: t('项目编号'),
field: 'itemCode',
component: 'Input',
},
],
};
const tableColumns: BasicColumn<MyScreenInfo>[] = [
const tableColumns: BasicColumn<MyChartInfo>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
@@ -73,41 +73,41 @@ const tableColumns: BasicColumn<MyScreenInfo>[] = [
slot: 'firstColumn',
},
{
title: t('大屏名称'),
dataIndex: 'screenName',
key: 'a.screen_name',
title: t('图表名称'),
dataIndex: 'chartName',
key: 'a.chart_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('大屏编码'),
dataIndex: 'screenCode',
key: 'a.screen_code',
title: t('图表编号'),
dataIndex: 'chartCode',
key: 'a.chart_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('大屏标题'),
dataIndex: 'screenTitle',
key: 'a.screen_title',
title: t('序号'),
dataIndex: 'sort',
key: 'a.sort',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('组件名称'),
dataIndex: 'vueName',
key: 'a.vue_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('路由地址'),
dataIndex: 'path',
key: 'a.path',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('说明描述'),
dataIndex: 'remark',
key: 'a.remark',
title: t('间距'),
dataIndex: 'grid',
key: 'a.grid',
sorter: true,
width: 130,
align: 'left',
@@ -121,6 +121,38 @@ const tableColumns: BasicColumn<MyScreenInfo>[] = [
align: 'center',
dictType: 'biz_status',
},
{
title: t('图表类型'),
dataIndex: 'chartType',
key: 'a.chart_type',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('项目名称'),
dataIndex: 'itemName',
key: 'a.item_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('项目编号'),
dataIndex: 'itemCode',
key: 'a.item_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('备注描述'),
dataIndex: 'remark',
key: 'a.remark',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
@@ -132,20 +164,20 @@ const tableColumns: BasicColumn<MyScreenInfo>[] = [
];
const tableProps: BasicTableProps = {
api: myScreenInfoListData,
api: myChartInfoListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'screenId',
rowKey: 'chartId',
};
export default {
modalProps,
tableProps,
itemCode: 'screenId',
itemName: 'screenId',
itemCode: 'chartId',
itemName: 'chartId',
isShowCode: false,
};

View File

@@ -89,9 +89,10 @@
{
label: t('市区级别'),
field: 'areaType',
component: 'Input',
component: 'Select',
componentProps: {
maxlength: 4,
dictType: 'area_level',
allowClear: true,
},
required: true,
},

View File

@@ -98,7 +98,11 @@
{
label: t('市区级别'),
field: 'areaType',
component: 'Input',
component: 'Select',
componentProps: {
dictType: 'area_level',
allowClear: true,
},
},
{
label: t('状态'),
@@ -170,6 +174,7 @@
sorter: true,
width: 130,
align: 'left',
dictType: 'area_level',
},
{
title: t('更新时间'),
@@ -196,16 +201,16 @@
actions: (record: MyCities) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑城市'),
title: t('编辑'),
onClick: handleForm.bind(this, { cityId: record.cityId }),
auth: 'biz:myCities:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除城市'),
title: t('删除'),
popConfirm: {
title: t('是否确认删除城市'),
title: t('是否确认删除城市?'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myCities:edit',

View File

@@ -266,7 +266,10 @@
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/myNotes/exportData',
params: getForm().getFieldsValue(),
params: {
...getForm().getFieldsValue(),
createUser: userinfo.value.loginCode,
},
});
loading.value = false;
}

View File

@@ -0,0 +1,235 @@
<!--
* 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:myProjectInfo: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="ViewsBizMyProjectInfoForm">
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 { MyAreaSource, MyAreaSourceTreeData } from '@jeesite/biz/api/biz/myAreaSource';
import { MyProjectInfo, myProjectInfoSave, myProjectInfoForm } from '@jeesite/biz/api/biz/myProjectInfo';
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myProjectInfo');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyProjectInfo>({} as MyProjectInfo);
const areaListParams = ref<Recordable>({ areaLevel: '1' });
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增项目') : t('编辑项目'),
}));
const inputFormSchemas: FormSchema<MyProjectInfo>[] = [
{
label: t('基本信息'),
field: 'basicInfo',
component: 'FormGroup',
colProps: { md: 24, lg: 24 },
},
{
label: t('项目编码'),
field: 'projectCode',
component: 'Input',
componentProps: {
maxlength: 52,
},
required: true,
},
{
label: t('项目名称'),
field: 'projectName',
component: 'Input',
componentProps: {
maxlength: 100,
},
required: true,
},
{
label: t('项目描述'),
field: 'projectDesc',
component: 'InputTextArea',
colProps: { md: 24, lg: 24 },
},
{
label: t('区域级别'),
field: 'areaLevel',
component: 'Select',
componentProps: {
dictType: 'area_level',
allowClear: true,
onChange: (value: string) => {
areaListParams.value.areaLevel = value;
},
},
required: true,
},
{
label: t('区域名称'),
field: 'areaCode',
fieldLabel: 'areaName',
component: 'TreeSelect',
componentProps: {
api: MyAreaSourceTreeData,
params: areaListParams.value,
allowClear: true,
},
required: true,
},
{
label: t('预计开始日期'),
field: 'startDate',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('预计结束日期'),
field: 'endDate',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('项目责任姓名'),
field: 'personId',
fieldLabel: 'personName',
component: 'ListSelect',
componentProps: {
selectType: 'bizPersonSelect',
},
required: true,
},
{
label: t('实际结束日期'),
field: 'actualEndDate',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('项目预算'),
field: 'budget',
component: 'Input',
componentProps: {
maxlength: 18,
},
required: true,
},
{
label: t('项目类型'),
field: 'projectType',
component: 'Select',
componentProps: {
dictType: 'project_type',
allowClear: true,
},
required: true,
},
{
label: t('项目级别'),
field: 'priority',
component: 'Select',
componentProps: {
dictType: 'biz_priority',
allowClear: true,
},
required: true,
},
{
label: t('项目状态'),
field: 'projectStatus',
component: 'Select',
componentProps: {
dictType: 'project_status',
allowClear: true,
},
required: true,
},
{
label: t('附件上传'),
field: 'dataMap',
component: 'Upload',
componentProps: {
loadTime: computed(() => record.value.__t),
bizKey: computed(() => record.value.id),
bizType: 'myProjectInfo_file',
uploadType: 'all',
},
colProps: { md: 24, lg: 24 },
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyProjectInfo>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await myProjectInfoForm(data);
record.value = (res.myProjectInfo || {}) as MyProjectInfo;
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,
projectId: record.value.projectId || data.projectId,
};
data[record.value.isNewRecord ? 'createTime' : 'updateTime'] = formatToDateTime(new Date());
// console.log('submit', params, data, record);
const res = await myProjectInfoSave(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,328 @@
<!--
* 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:myProjectInfo:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #bizScopeKey="{ record, text, value }">
<a @click="handleForm({ projectId: record.projectId })" :title="value">
{{ text }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizMyProjectInfoList">
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 { MyProjectInfo, myProjectInfoList } from '@jeesite/biz/api/biz/myProjectInfo';
import { MyAreaSource, MyAreaSourceTreeData } from '@jeesite/biz/api/biz/myAreaSource';
import { myProjectInfoDelete, myProjectInfoListData } from '@jeesite/biz/api/biz/myProjectInfo';
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.myProjectInfo');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<MyProjectInfo>({} as MyProjectInfo);
const areaListParams = ref<Recordable>({ areaLevel: '1' });
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('项目管理'),
};
const loading = ref(false);
const searchForm: FormProps<MyProjectInfo> = {
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: 'projectName',
component: 'Input',
},
{
label: t('责任人员'),
field: 'personId',
fieldLabel: 'personName',
component: 'ListSelect',
componentProps: {
selectType: 'bizPersonSelect',
},
},
{
label: t('区域级别'),
field: 'areaLevel',
component: 'Select',
componentProps: {
dictType: 'area_level',
allowClear: true,
onChange: (value: string) => {
areaListParams.value.areaLevel = value;
},
},
},
{
label: t('区域名称'),
field: 'areaId',
fieldLabel: 'areaName',
component: 'TreeSelect',
componentProps: {
api: MyAreaSourceTreeData,
params: areaListParams.value,
allowClear: true,
},
},
{
label: t('项目状态'),
field: 'projectStatus',
component: 'Select',
componentProps: {
dictType: 'project_status',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<MyProjectInfo>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
},
{
title: t('项目编码'),
dataIndex: 'projectCode',
key: 'a.project_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('项目名称'),
dataIndex: 'projectName',
key: 'a.project_name',
sorter: true,
width: 225,
align: 'left',
slot: 'bizScopeKey',
},
{
title: t('区域级别'),
dataIndex: 'areaLevel',
key: 'a.area_level',
sorter: true,
width: 130,
align: 'left',
dictType: 'area_level',
},
{
title: t('区域名称'),
dataIndex: 'areaName',
key: 'b.area_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('区域全称'),
dataIndex: 'treeName',
key: 'b.tree_name',
sorter: true,
width: 200,
align: 'left',
},
{
title: t('责任人员'),
dataIndex: 'personName',
key: 'c.person_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('预计开始日期'),
dataIndex: 'startDate',
key: 'a.start_date',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('预计结束日期'),
dataIndex: 'endDate',
key: 'a.end_date',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('实际结束日期'),
dataIndex: 'actualEndDate',
key: 'a.actual_end_date',
sorter: true,
width: 150,
align: 'center',
},
{
title: t('项目预算(元)'),
dataIndex: 'budget',
key: 'a.budget',
sorter: true,
width: 130,
align: 'right',
},
{
title: t('项目类型'),
dataIndex: 'projectType',
key: 'a.project_type',
sorter: true,
width: 130,
align: 'left',
dictType: 'project_type',
},
{
title: t('项目级别'),
dataIndex: 'priority',
key: 'a.priority',
sorter: true,
width: 130,
align: 'left',
dictType: 'biz_priority',
},
{
title: t('项目状态'),
dataIndex: 'projectStatus',
key: 'a.project_status',
sorter: true,
width: 130,
align: 'left',
dictType: 'project_status',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 150,
align: 'center',
},
];
const actionColumn: BasicColumn<MyProjectInfo> = {
width: 160,
align: 'center',
actions: (record: MyProjectInfo) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑'),
onClick: handleForm.bind(this, { projectId: record.projectId }),
auth: 'biz:myProjectInfo:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除'),
popConfirm: {
title: t('是否确认删除项目?'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myProjectInfo:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<MyProjectInfo>({
api: myProjectInfoListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await myProjectInfoList();
record.value = (res.myProjectInfo || {}) as MyProjectInfo;
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/myProjectInfo/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
async function handleDelete(record: Recordable) {
const params = { projectId: record.projectId };
const res = await myProjectInfoDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -1,19 +1,19 @@
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';
import { myProjectInfoListData } from '@jeesite/biz/api/biz/myProjectInfo';
const { t } = useI18n('biz.myPerson');
const { t } = useI18n('biz.myProjectInfo');
const modalProps = {
title: t('人员选择'),
title: t('项目选择'),
};
const searchForm: FormProps<MyPerson> = {
const searchForm: FormProps<MyProjectInfo> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
label: t('记录创建时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
@@ -22,7 +22,7 @@ const searchForm: FormProps<MyPerson> = {
},
},
{
label: t('记录时间止'),
label: t('记录创建时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
@@ -31,32 +31,28 @@ const searchForm: FormProps<MyPerson> = {
},
},
{
label: t('姓名'),
field: 'personName',
label: t('项目名称'),
field: 'projectName',
component: 'Input',
},
{
label: t('性别'),
field: 'gender',
label: t('人员编号'),
field: 'personId',
component: 'Input',
},
{
label: t('身份证号'),
field: 'idCard',
label: t('区域级别'),
field: 'areaLevel',
component: 'Input',
},
{
label: t('状态'),
field: 'ustatus',
component: 'Select',
componentProps: {
dictType: '',
allowClear: true,
},
label: t('区域编号'),
field: 'areaId',
component: 'Input',
},
{
label: t('公司编号'),
field: 'companyId',
label: t('项目状态'),
field: 'projectStatus',
component: 'Select',
componentProps: {
dictType: '',
@@ -66,9 +62,9 @@ const searchForm: FormProps<MyPerson> = {
],
};
const tableColumns: BasicColumn<MyPerson>[] = [
const tableColumns: BasicColumn<MyProjectInfo>[] = [
{
title: t('记录时间'),
title: t('记录创建时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
@@ -77,90 +73,98 @@ const tableColumns: BasicColumn<MyPerson>[] = [
slot: 'firstColumn',
},
{
title: t('姓名'),
dataIndex: 'personName',
key: 'a.person_name',
title: t('项目编码'),
dataIndex: 'projectCode',
key: 'a.project_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('性别'),
dataIndex: 'gender',
key: 'a.gender',
title: t('项目名称'),
dataIndex: 'projectName',
key: 'a.project_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('身份证号'),
dataIndex: 'idCard',
key: 'a.id_card',
title: t('项目描述'),
dataIndex: 'projectDesc',
key: 'a.project_desc',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('手机号码'),
dataIndex: 'phone',
key: 'a.phone',
title: t('人员编号'),
dataIndex: 'personId',
key: 'a.person_id',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('邮箱'),
dataIndex: 'email',
key: 'a.email',
title: t('区域级别'),
dataIndex: 'areaLevel',
key: 'a.area_level',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('出生日期'),
dataIndex: 'birthDate',
key: 'a.birth_date',
title: t('区域编号'),
dataIndex: 'areaId',
key: 'a.area_id',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('预计开始日期'),
dataIndex: 'startDate',
key: 'a.start_date',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('居住地址'),
dataIndex: 'address',
key: 'a.address',
title: t('预计结束日期'),
dataIndex: 'endDate',
key: 'a.end_date',
sorter: true,
width: 130,
align: 'left',
align: 'center',
},
{
title: t('所属部门'),
dataIndex: 'department',
key: 'a.department',
title: t('实际结束日期'),
dataIndex: 'actualEndDate',
key: 'a.actual_end_date',
sorter: true,
width: 130,
align: 'left',
align: 'center',
},
{
title: t('职位'),
dataIndex: 'positionName',
key: 'a.position_name',
title: t('项目预算'),
dataIndex: 'budget',
key: 'a.budget',
sorter: true,
width: 130,
align: 'left',
align: 'right',
},
{
title: t('状态'),
dataIndex: 'ustatus',
key: 'a.ustatus',
title: t('项目类型'),
dataIndex: 'projectType',
key: 'a.project_type',
sorter: true,
width: 130,
align: 'left',
dictType: '',
},
{
title: t('公司编号'),
dataIndex: 'companyId',
key: 'a.company_id',
title: t('项目状态'),
dataIndex: 'projectStatus',
key: 'a.project_status',
sorter: true,
width: 130,
align: 'left',
@@ -177,20 +181,20 @@ const tableColumns: BasicColumn<MyPerson>[] = [
];
const tableProps: BasicTableProps = {
api: myPersonListData,
api: myProjectInfoListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'personId',
rowKey: 'projectId',
};
export default {
modalProps,
tableProps,
itemCode: 'personId',
itemName: 'personId',
itemCode: 'projectId',
itemName: 'projectId',
isShowCode: false,
};

View File

@@ -210,7 +210,10 @@
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/myWebsiteStorage/exportData',
params: getForm().getFieldsValue(),
params: {
...getForm().getFieldsValue(),
loginUser: userinfo.value.loginCode,
},
});
loading.value = false;
}