初始化项目
This commit is contained in:
@@ -19,3 +19,6 @@ export interface ChartInfo extends BasicModel<ChartInfo> {
|
||||
|
||||
export const HostInfoData = () =>
|
||||
defHttp.get<ChartInfo[]>({ url: adminPath + '/desktop/analysis/getHostInfo' });
|
||||
|
||||
export const ProvinceChart = () =>
|
||||
defHttp.get<ChartInfo[]>({ url: adminPath + '/desktop/analysis/getProvinceChart' });
|
||||
|
||||
@@ -27,6 +27,9 @@ export interface MyCities extends BasicModel<MyCities> {
|
||||
export const myCitiesList = (params?: MyCities | any) =>
|
||||
defHttp.get<MyCities>({ url: adminPath + '/biz/myCities/list', params });
|
||||
|
||||
export const myCitiesListAll = (params?: MyCities | any) =>
|
||||
defHttp.get<MyCities[]>({ url: adminPath + '/biz/myCities/listAll', params });
|
||||
|
||||
export const myCitiesListData = (params?: MyCities | any) =>
|
||||
defHttp.post<Page<MyCities>>({ url: adminPath + '/biz/myCities/listData', params });
|
||||
|
||||
|
||||
55
web-vue/packages/biz/api/biz/myMunicipalities.ts
Normal file
55
web-vue/packages/biz/api/biz/myMunicipalities.ts
Normal 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 MyMunicipalities extends BasicModel<MyMunicipalities> {
|
||||
municipalityId?: string; // 唯一主键
|
||||
createTime?: string; // 记录时间
|
||||
countyName?: string; // 县区名称
|
||||
provinceCode?: string; // 省份编码
|
||||
cityCode?: string; // 市区编码
|
||||
countyCode?: string; // 县区编码
|
||||
townName?: string; // 街道名称
|
||||
townCode?: string; // 街道编号
|
||||
villageName?: string; // 社区名称
|
||||
villageCode?: string; // 社区编号
|
||||
updateTime?: string; // 更新时间
|
||||
ustatus?: string; // 状态
|
||||
}
|
||||
|
||||
export const myMunicipalitiesList = (params?: MyMunicipalities | any) =>
|
||||
defHttp.get<MyMunicipalities>({ url: adminPath + '/biz/myMunicipalities/list', params });
|
||||
|
||||
export const myMunicipalitiesListData = (params?: MyMunicipalities | any) =>
|
||||
defHttp.post<Page<MyMunicipalities>>({ url: adminPath + '/biz/myMunicipalities/listData', params });
|
||||
|
||||
export const myMunicipalitiesForm = (params?: MyMunicipalities | any) =>
|
||||
defHttp.get<MyMunicipalities>({ url: adminPath + '/biz/myMunicipalities/form', params });
|
||||
|
||||
export const myMunicipalitiesSave = (params?: any, data?: MyMunicipalities | any) =>
|
||||
defHttp.postJson<MyMunicipalities>({ url: adminPath + '/biz/myMunicipalities/save', params, data });
|
||||
|
||||
export const myMunicipalitiesImportData = (
|
||||
params: UploadFileParams,
|
||||
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
||||
) =>
|
||||
defHttp.uploadFile<UploadApiResult>(
|
||||
{
|
||||
url: ctxPath + adminPath + '/biz/myMunicipalities/importData',
|
||||
onUploadProgress,
|
||||
},
|
||||
params,
|
||||
);
|
||||
|
||||
export const myMunicipalitiesDelete = (params?: MyMunicipalities | any) =>
|
||||
defHttp.get<MyMunicipalities>({ url: adminPath + '/biz/myMunicipalities/delete', params });
|
||||
@@ -87,3 +87,6 @@ export const myNoticeTodoImportData = (
|
||||
|
||||
export const myNoticeTodoDelete = (params?: MyNoticeTodo | any) =>
|
||||
defHttp.get<MyNoticeTodo>({ url: adminPath + '/biz/myNoticeTodo/delete', params });
|
||||
|
||||
export const myNoticeTodoPublish = (params?: MyNoticeTodo | any) =>
|
||||
defHttp.get<MyNoticeTodo>({ url: adminPath + '/biz/myNoticeTodo/publish', params });
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* 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 MyPageIndex extends BasicModel<MyPageIndex> {
|
||||
createTime?: string; // 记录时间
|
||||
indexId?: string; // 唯一标识
|
||||
module: string; // 模块名称
|
||||
moduleCode: string; // 模块编码
|
||||
title: string; // 说明描述
|
||||
value?: number; // 数值
|
||||
label?: string; // 名称
|
||||
iconImg: string; // 图片路径
|
||||
iconFilter?: string; // 图标颜色
|
||||
sort: number; // 序号
|
||||
indexCode: string; // 指标编号
|
||||
}
|
||||
|
||||
export const myPageIndexList = (params?: MyPageIndex | any) =>
|
||||
defHttp.get<MyPageIndex>({ url: adminPath + '/biz/myPageIndex/list', params });
|
||||
|
||||
export const myPageIndexListAll = (params?: MyPageIndex | any) =>
|
||||
defHttp.get<MyPageIndex[]>({ url: adminPath + '/biz/myPageIndex/listAll', params });
|
||||
|
||||
export const myPageIndexListData = (params?: MyPageIndex | any) =>
|
||||
defHttp.post<Page<MyPageIndex>>({ url: adminPath + '/biz/myPageIndex/listData', params });
|
||||
|
||||
export const myPageIndexForm = (params?: MyPageIndex | any) =>
|
||||
defHttp.get<MyPageIndex>({ url: adminPath + '/biz/myPageIndex/form', params });
|
||||
|
||||
export const myPageIndexSave = (params?: any, data?: MyPageIndex | any) =>
|
||||
defHttp.postJson<MyPageIndex>({ url: adminPath + '/biz/myPageIndex/save', params, data });
|
||||
|
||||
export const myPageIndexImportData = (
|
||||
params: UploadFileParams,
|
||||
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
||||
) =>
|
||||
defHttp.uploadFile<UploadApiResult>(
|
||||
{
|
||||
url: ctxPath + adminPath + '/biz/myPageIndex/importData',
|
||||
onUploadProgress,
|
||||
},
|
||||
params,
|
||||
);
|
||||
|
||||
export const myPageIndexDelete = (params?: MyPageIndex | any) =>
|
||||
defHttp.get<MyPageIndex>({ url: adminPath + '/biz/myPageIndex/delete', params });
|
||||
55
web-vue/packages/biz/api/biz/myQuickLogin.ts
Normal file
55
web-vue/packages/biz/api/biz/myQuickLogin.ts
Normal 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 MyQuickLogin extends BasicModel<MyQuickLogin> {
|
||||
createTime?: string; // 记录时间
|
||||
quickId?: string; // 自增主键
|
||||
systemName: string; // 系统名称
|
||||
systemType?: string; // 系统类型
|
||||
systemUrl?: string; // 首页地址
|
||||
systemIcon?: string; // 系统图标
|
||||
bgColor?: string; // 图标背景色
|
||||
ustatus?: string; // 状态
|
||||
updateTime?: string; // 更新时间
|
||||
}
|
||||
|
||||
export const myQuickLoginList = (params?: MyQuickLogin | any) =>
|
||||
defHttp.get<MyQuickLogin>({ url: adminPath + '/biz/myQuickLogin/list', params });
|
||||
|
||||
export const myQuickLoginListAll = (params?: MyQuickLogin | any) =>
|
||||
defHttp.get<MyQuickLogin[]>({ url: adminPath + '/biz/myQuickLogin/listAll', params });
|
||||
|
||||
export const myQuickLoginListData = (params?: MyQuickLogin | any) =>
|
||||
defHttp.post<Page<MyQuickLogin>>({ url: adminPath + '/biz/myQuickLogin/listData', params });
|
||||
|
||||
export const myQuickLoginForm = (params?: MyQuickLogin | any) =>
|
||||
defHttp.get<MyQuickLogin>({ url: adminPath + '/biz/myQuickLogin/form', params });
|
||||
|
||||
export const myQuickLoginSave = (params?: any, data?: MyQuickLogin | any) =>
|
||||
defHttp.postJson<MyQuickLogin>({ url: adminPath + '/biz/myQuickLogin/save', params, data });
|
||||
|
||||
export const myQuickLoginImportData = (
|
||||
params: UploadFileParams,
|
||||
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
||||
) =>
|
||||
defHttp.uploadFile<UploadApiResult>(
|
||||
{
|
||||
url: ctxPath + adminPath + '/biz/myQuickLogin/importData',
|
||||
onUploadProgress,
|
||||
},
|
||||
params,
|
||||
);
|
||||
|
||||
export const myQuickLoginDelete = (params?: MyQuickLogin | any) =>
|
||||
defHttp.get<MyQuickLogin>({ url: adminPath + '/biz/myQuickLogin/delete', params });
|
||||
@@ -44,6 +44,8 @@
|
||||
import InputForm from './form.vue';
|
||||
|
||||
const { t } = useI18n('biz.myChartInfo');
|
||||
|
||||
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<MyChartInfo>({} as MyChartInfo);
|
||||
|
||||
191
web-vue/packages/biz/views/biz/myMunicipalities/form.vue
Normal file
191
web-vue/packages/biz/views/biz/myMunicipalities/form.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<!--
|
||||
* 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:myMunicipalities: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="ViewsBizMyMunicipalitiesForm">
|
||||
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 { MyCities, myCitiesListAll } from '@jeesite/biz/api/biz/myCities';
|
||||
import { MyMunicipalities, myMunicipalitiesSave, myMunicipalitiesForm } from '@jeesite/biz/api/biz/myMunicipalities';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.myMunicipalities');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<MyMunicipalities>({} as MyMunicipalities);
|
||||
|
||||
const cityListParams = ref<Recordable>({ provinceCode: '1' });
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: record.value.isNewRecord ? t('新增社区') : t('编辑社区'),
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<MyMunicipalities>[] = [
|
||||
{
|
||||
label: t('基本信息'),
|
||||
field: 'basicInfo',
|
||||
component: 'FormGroup',
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('省份名称'),
|
||||
field: 'provinceCode',
|
||||
fieldLabel: 'provinceName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'bizProvinceSelect',
|
||||
onChange: (value: string) => {
|
||||
cityListParams.value.provinceCode = value;
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('市区名称'),
|
||||
field: 'cityCode',
|
||||
fieldLabel: 'cityName',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: myCitiesListAll,
|
||||
params: cityListParams.value,
|
||||
fieldNames: { label: 'cityName', value: 'cityCode' },
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('县区编码'),
|
||||
field: 'countyCode',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 24,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 65,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('街道编号'),
|
||||
field: 'townCode',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 32,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('街道名称'),
|
||||
field: 'townName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 125,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('社区编号'),
|
||||
field: 'villageCode',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 32,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('社区名称'),
|
||||
field: 'villageName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 125,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'biz_status',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
];
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyMunicipalities>({
|
||||
labelWidth: 120,
|
||||
schemas: inputFormSchemas,
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await myMunicipalitiesForm(data);
|
||||
record.value = (res.myMunicipalities || {}) as MyMunicipalities;
|
||||
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,
|
||||
municipalityId: record.value.municipalityId || data.municipalityId,
|
||||
};
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await myMunicipalitiesSave(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>
|
||||
298
web-vue/packages/biz/views/biz/myMunicipalities/list.vue
Normal file
298
web-vue/packages/biz/views/biz/myMunicipalities/list.vue
Normal file
@@ -0,0 +1,298 @@
|
||||
<!--
|
||||
* 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:myMunicipalities:edit'">
|
||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #bizScopeKey="{ record, text, value }">
|
||||
<a @click="handleForm({ municipalityId: record.municipalityId })" :title="value">
|
||||
{{ text }}
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizMyMunicipalitiesList">
|
||||
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 { MyCities, myCitiesListAll } from '@jeesite/biz/api/biz/myCities';
|
||||
import { MyMunicipalities, myMunicipalitiesList } from '@jeesite/biz/api/biz/myMunicipalities';
|
||||
import { myMunicipalitiesDelete, myMunicipalitiesListData } from '@jeesite/biz/api/biz/myMunicipalities';
|
||||
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.myMunicipalities');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<MyMunicipalities>({} as MyMunicipalities);
|
||||
|
||||
const cityListParams = ref<Recordable>({ provinceCode: '1' });
|
||||
|
||||
const getTitle = {
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: meta.title || t('社区管理'),
|
||||
};
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm: FormProps<MyMunicipalities> = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{
|
||||
label: t('省份名称'),
|
||||
field: 'provinceCode',
|
||||
fieldLabel: 'provinceName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'bizProvinceSelect',
|
||||
onChange: (value: string) => {
|
||||
cityListParams.value.provinceCode = value;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('市区名称'),
|
||||
field: 'cityCode',
|
||||
fieldLabel: 'cityName',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: myCitiesListAll,
|
||||
params: cityListParams.value,
|
||||
fieldNames: { label: 'cityName', value: 'cityCode' },
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('街道名称'),
|
||||
field: 'townName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('社区编号'),
|
||||
field: 'villageCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('社区名称'),
|
||||
field: 'villageName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'biz_status',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<MyMunicipalities>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('省份编码'),
|
||||
dataIndex: 'provinceCode',
|
||||
key: 'a.province_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('省份名称'),
|
||||
dataIndex: 'provinceName',
|
||||
key: 'b.province_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('市区编码'),
|
||||
dataIndex: 'cityCode',
|
||||
key: 'a.city_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('市区名称'),
|
||||
dataIndex: 'cityName',
|
||||
key: 'c.city_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('县区编码'),
|
||||
dataIndex: 'countyCode',
|
||||
key: 'a.county_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('县区名称'),
|
||||
dataIndex: 'countyName',
|
||||
key: 'a.county_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('街道编号'),
|
||||
dataIndex: 'townCode',
|
||||
key: 'a.town_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('街道名称'),
|
||||
dataIndex: 'townName',
|
||||
key: 'a.town_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('社区编号'),
|
||||
dataIndex: 'villageCode',
|
||||
key: 'a.village_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('社区名称'),
|
||||
dataIndex: 'villageName',
|
||||
key: 'a.village_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
slot: 'bizScopeKey',
|
||||
},
|
||||
{
|
||||
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: 'left',
|
||||
dictType: 'biz_status'
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<MyMunicipalities> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: MyMunicipalities) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { municipalityId: record.municipalityId }),
|
||||
auth: 'biz:myMunicipalities:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除社区?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:myMunicipalities:edit',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<MyMunicipalities>({
|
||||
api: myMunicipalitiesListData,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
actionColumn: actionColumn,
|
||||
formConfig: searchForm,
|
||||
showTableSetting: true,
|
||||
useSearchForm: true,
|
||||
canResize: true,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await myMunicipalitiesList();
|
||||
record.value = (res.myMunicipalities || {}) as MyMunicipalities;
|
||||
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/myMunicipalities/exportData',
|
||||
params: getForm().getFieldsValue(),
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { municipalityId: record.municipalityId };
|
||||
const res = await myMunicipalitiesDelete(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handleSuccess(record: Recordable) {
|
||||
await reload({ record });
|
||||
}
|
||||
</script>
|
||||
@@ -140,14 +140,6 @@
|
||||
align: 'left',
|
||||
slot: 'bizScopeKey',
|
||||
},
|
||||
{
|
||||
title: t('内容'),
|
||||
dataIndex: 'content',
|
||||
key: 'a.content',
|
||||
sorter: true,
|
||||
width: 225,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('级别'),
|
||||
dataIndex: 'priority',
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizMyNoticeTodoList">
|
||||
import { onMounted, ref, unref } from 'vue';
|
||||
import { computed, 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';
|
||||
@@ -37,11 +37,15 @@
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { MyNoticeTodo, myNoticeTodoList } from '@jeesite/biz/api/biz/myNoticeTodo';
|
||||
import { myNoticeTodoDelete, myNoticeTodoListData } from '@jeesite/biz/api/biz/myNoticeTodo';
|
||||
import { myNoticeTodoDelete, myNoticeTodoPublish, myNoticeTodoListData } from '@jeesite/biz/api/biz/myNoticeTodo';
|
||||
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';
|
||||
import { useUserStore } from '@jeesite/core/store/modules/user';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userinfo = computed(() => userStore.getUserInfo);
|
||||
|
||||
const { t } = useI18n('biz.myNoticeTodo');
|
||||
const { showMessage } = useMessage();
|
||||
@@ -212,14 +216,28 @@
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:myNoticeTodo:edit',
|
||||
ifShow: record.ustatus == '0'
|
||||
},
|
||||
{
|
||||
icon: 'ant-design:rollback-outlined',
|
||||
color: 'warning',
|
||||
title: t('发布'),
|
||||
popConfirm: {
|
||||
title: t('是否确认发布消息?'),
|
||||
confirm: handlePublish.bind(this, record),
|
||||
},
|
||||
ifShow: record.ustatus == '0'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<MyNoticeTodo>({
|
||||
api: myNoticeTodoListData,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
return {
|
||||
...params,
|
||||
createUser: userinfo.value.loginCode,
|
||||
};
|
||||
},
|
||||
columns: tableColumns,
|
||||
actionColumn: actionColumn,
|
||||
@@ -257,6 +275,13 @@
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handlePublish(record: Recordable) {
|
||||
const params = { id: record.id };
|
||||
const res = await myNoticeTodoPublish(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handleSuccess(record: Recordable) {
|
||||
await reload({ record });
|
||||
|
||||
@@ -4,44 +4,44 @@
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<BasicModal
|
||||
<BasicDrawer
|
||||
v-bind="$attrs"
|
||||
:showFooter="true"
|
||||
:okAuth="'biz:myPageIndex:edit'"
|
||||
@register="registerModal"
|
||||
:okAuth="'biz:myQuickLogin:edit'"
|
||||
@register="registerDrawer"
|
||||
@ok="handleSubmit"
|
||||
width="60%"
|
||||
width="70%"
|
||||
>
|
||||
<template #title>
|
||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||
<span> {{ getTitle.value }} </span>
|
||||
</template>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizMyPageIndexForm">
|
||||
<script lang="ts" setup name="ViewsBizMyQuickLoginForm">
|
||||
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 { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { MyPageIndex, myPageIndexSave, myPageIndexForm } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
||||
import { MyQuickLogin, myQuickLoginSave, myQuickLoginForm } from '@jeesite/biz/api/biz/myQuickLogin';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.myPageIndex');
|
||||
const { t } = useI18n('biz.myQuickLogin');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<MyPageIndex>({} as MyPageIndex);
|
||||
const record = ref<MyQuickLogin>({} as MyQuickLogin);
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: record.value.isNewRecord ? t('新增指标') : t('编辑指标'),
|
||||
value: record.value.isNewRecord ? t('新增快捷登录') : t('编辑快捷登录'),
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<MyPageIndex>[] = [
|
||||
const inputFormSchemas: FormSchema<MyQuickLogin>[] = [
|
||||
{
|
||||
label: t('基本信息'),
|
||||
field: 'basicInfo',
|
||||
@@ -49,44 +49,27 @@
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('指标名称'),
|
||||
field: 'module',
|
||||
label: t('系统名称'),
|
||||
field: 'systemName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 52,
|
||||
maxlength: 100,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('指标编码'),
|
||||
field: 'moduleCode',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 32,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('指标描述'),
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 32,
|
||||
},
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('指标数值'),
|
||||
field: 'value',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 18,
|
||||
},
|
||||
label: t('系统类型'),
|
||||
field: 'systemType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'system_type',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('指标单位'),
|
||||
field: 'label',
|
||||
label: t('首页地址'),
|
||||
field: 'systemUrl',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 32,
|
||||
@@ -94,67 +77,61 @@
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('图片路径'),
|
||||
field: 'iconImg',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 125,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('图标颜色'),
|
||||
field: 'iconFilter',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 32,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('指标序号'),
|
||||
field: 'sort',
|
||||
component: 'InputNumber',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('指标编号'),
|
||||
field: 'indexCode',
|
||||
label: t('系统图标'),
|
||||
field: 'systemIcon',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 24,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('背景颜色'),
|
||||
field: 'bgColor',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 52,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('系统状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'biz_status',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyPageIndex>({
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<MyQuickLogin>({
|
||||
labelWidth: 120,
|
||||
schemas: inputFormSchemas,
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ loading: true });
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await myPageIndexForm(data);
|
||||
record.value = (res.myPageIndex || {}) as MyPageIndex;
|
||||
const res = await myQuickLoginForm(data);
|
||||
record.value = (res.myQuickLogin || {}) as MyQuickLogin;
|
||||
record.value.__t = new Date().getTime();
|
||||
await setFieldsValue(record.value);
|
||||
setModalProps({ loading: false });
|
||||
setDrawerProps({ loading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
indexId: record.value.indexId || data.indexId,
|
||||
quickId: record.value.quickId || data.quickId,
|
||||
};
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await myPageIndexSave(params, data);
|
||||
const res = await myQuickLoginSave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeModal);
|
||||
setTimeout(closeDrawer);
|
||||
emit('success', data);
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
@@ -162,7 +139,7 @@
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -14,20 +14,20 @@
|
||||
<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:myPageIndex:edit'">
|
||||
<a-button type="primary" @click="handleForm({})" v-auth="'biz:myQuickLogin:edit'">
|
||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #firstColumn="{ record, text, value }">
|
||||
<a @click="handleForm({ indexId: record.indexId })" :title="value">
|
||||
<template #bizScopeKey="{ record, text, value }">
|
||||
<a @click="handleForm({ quickId: record.quickId })" :title="value">
|
||||
{{ text }}
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerModal" @success="handleSuccess" />
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizMyPageIndexList">
|
||||
<script lang="ts" setup name="ViewsBizMyQuickLoginList">
|
||||
import { onMounted, ref, unref } from 'vue';
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
||||
@@ -36,74 +36,55 @@
|
||||
import { router } from '@jeesite/core/router';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { MyPageIndex, myPageIndexList } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
import { myPageIndexDelete, myPageIndexListData } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
import { MyQuickLogin, myQuickLoginList } from '@jeesite/biz/api/biz/myQuickLogin';
|
||||
import { myQuickLoginDelete, myQuickLoginListData } from '@jeesite/biz/api/biz/myQuickLogin';
|
||||
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.myPageIndex');
|
||||
const { t } = useI18n('biz.myQuickLogin');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<MyPageIndex>({} as MyPageIndex);
|
||||
const record = ref<MyQuickLogin>({} as MyQuickLogin);
|
||||
|
||||
const getTitle = {
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: meta.title || t('指标管理'),
|
||||
value: meta.title || t('快捷登录管理'),
|
||||
};
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm: FormProps<MyPageIndex> = {
|
||||
const searchForm: FormProps<MyQuickLogin> = {
|
||||
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: 'module',
|
||||
label: t('系统名称'),
|
||||
field: 'systemName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('指标编码'),
|
||||
field: 'moduleCode',
|
||||
component: 'Input',
|
||||
label: t('系统类型'),
|
||||
field: 'systemType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'system_type',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('指标描述'),
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('单位名称'),
|
||||
field: 'label',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('指标编号'),
|
||||
field: 'indexCode',
|
||||
component: 'Input',
|
||||
label: t('状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'biz_status',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<MyPageIndex>[] = [
|
||||
const tableColumns: BasicColumn<MyQuickLogin>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
@@ -114,105 +95,91 @@
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('指标名称'),
|
||||
dataIndex: 'module',
|
||||
key: 'a.module',
|
||||
title: t('系统名称'),
|
||||
dataIndex: 'systemName',
|
||||
key: 'a.system_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('指标编码'),
|
||||
dataIndex: 'moduleCode',
|
||||
key: 'a.module_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('指标描述'),
|
||||
dataIndex: 'title',
|
||||
key: 'a.title',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
slot: 'bizScopeKey',
|
||||
},
|
||||
{
|
||||
title: t('指标数值'),
|
||||
dataIndex: 'value',
|
||||
key: 'a.value',
|
||||
title: t('系统类型'),
|
||||
dataIndex: 'systemType',
|
||||
key: 'a.system_type',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'right',
|
||||
align: 'left',
|
||||
dictType: 'system_type',
|
||||
},
|
||||
{
|
||||
title: t('单位名称'),
|
||||
dataIndex: 'label',
|
||||
key: 'a.label',
|
||||
title: t('首页地址'),
|
||||
dataIndex: 'systemUrl',
|
||||
key: 'a.system_url',
|
||||
sorter: true,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('系统图标'),
|
||||
dataIndex: 'systemIcon',
|
||||
key: 'a.system_icon',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('图片路径'),
|
||||
dataIndex: 'iconImg',
|
||||
key: 'a.icon_img',
|
||||
title: t('图标背景色'),
|
||||
dataIndex: 'bgColor',
|
||||
key: 'a.bg_color',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('图标颜色'),
|
||||
dataIndex: 'iconFilter',
|
||||
key: 'a.icon_filter',
|
||||
title: t('状态'),
|
||||
dataIndex: 'ustatus',
|
||||
key: 'a.ustatus',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'biz_status',
|
||||
},
|
||||
{
|
||||
title: t('指标序号'),
|
||||
dataIndex: 'sort',
|
||||
key: 'a.sort',
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('指标编号'),
|
||||
dataIndex: 'indexCode',
|
||||
key: 'a.index_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<MyPageIndex> = {
|
||||
const actionColumn: BasicColumn<MyQuickLogin> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: MyPageIndex) => [
|
||||
actions: (record: MyQuickLogin) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { indexId: record.indexId }),
|
||||
auth: 'biz:myPageIndex:edit',
|
||||
onClick: handleForm.bind(this, { quickId: record.quickId }),
|
||||
auth: 'biz:myQuickLogin:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除指标?'),
|
||||
title: t('是否确认删除快捷登录?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:myPageIndex:edit',
|
||||
auth: 'biz:myQuickLogin:edit',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<MyPageIndex>({
|
||||
api: myPageIndexListData,
|
||||
const [registerTable, { reload, getForm }] = useTable<MyQuickLogin>({
|
||||
api: myQuickLoginListData,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
@@ -225,30 +192,30 @@
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await myPageIndexList();
|
||||
record.value = (res.myPageIndex || {}) as MyPageIndex;
|
||||
const res = await myQuickLoginList();
|
||||
record.value = (res.myQuickLogin || {}) as MyQuickLogin;
|
||||
await getForm().setFieldsValue(record.value);
|
||||
});
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
openModal(true, record);
|
||||
openDrawer(true, record);
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
loading.value = true;
|
||||
const { ctxAdminPath } = useGlobSetting();
|
||||
await downloadByUrl({
|
||||
url: ctxAdminPath + '/biz/myPageIndex/exportData',
|
||||
url: ctxAdminPath + '/biz/myQuickLogin/exportData',
|
||||
params: getForm().getFieldsValue(),
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { indexId: record.indexId };
|
||||
const res = await myPageIndexDelete(params);
|
||||
const params = { quickId: record.quickId };
|
||||
const res = await myQuickLoginDelete(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
222
web-vue/packages/biz/views/biz/myScreen/components/ChartTop.vue
Normal file
222
web-vue/packages/biz/views/biz/myScreen/components/ChartTop.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<div class="chart-top">
|
||||
<div v-for="item in cardList" :key="item.key" class="chart-top__card">
|
||||
<div class="chart-top__left">
|
||||
<div class="chart-top__icon" :style="{ background: item.iconBg, color: item.iconColor }">
|
||||
<Icon :icon="item.icon" size="18" />
|
||||
</div>
|
||||
<div class="chart-top__label">{{ item.label }}</div>
|
||||
</div>
|
||||
<div class="chart-top__right">
|
||||
<span class="chart-top__value">{{ item.value }}</span>
|
||||
<span class="chart-top__unit">{{ item.unit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
|
||||
interface TopCardItem {
|
||||
key: string;
|
||||
label: string;
|
||||
value: string | number;
|
||||
unit: string;
|
||||
icon: string;
|
||||
iconBg: string;
|
||||
iconColor: string;
|
||||
}
|
||||
|
||||
const cardList = computed<TopCardItem[]>(() => [
|
||||
{
|
||||
key: 'customer',
|
||||
label: '客户总数',
|
||||
value: 1280,
|
||||
unit: '户',
|
||||
icon: 'ant-design:team-outlined',
|
||||
iconBg: 'rgba(59, 130, 246, 0.14)',
|
||||
iconColor: '#2563eb',
|
||||
},
|
||||
{
|
||||
key: 'contract',
|
||||
label: '合同金额',
|
||||
value: 986,
|
||||
unit: '万',
|
||||
icon: 'ant-design:file-text-outlined',
|
||||
iconBg: 'rgba(16, 185, 129, 0.14)',
|
||||
iconColor: '#059669',
|
||||
},
|
||||
{
|
||||
key: 'project',
|
||||
label: '项目数量',
|
||||
value: 246,
|
||||
unit: '个',
|
||||
icon: 'ant-design:appstore-outlined',
|
||||
iconBg: 'rgba(249, 115, 22, 0.14)',
|
||||
iconColor: '#ea580c',
|
||||
},
|
||||
{
|
||||
key: 'payment',
|
||||
label: '本月回款',
|
||||
value: 368,
|
||||
unit: '万',
|
||||
icon: 'ant-design:wallet-outlined',
|
||||
iconBg: 'rgba(168, 85, 247, 0.14)',
|
||||
iconColor: '#7e22ce',
|
||||
},
|
||||
{
|
||||
key: 'warning',
|
||||
label: '风险预警',
|
||||
value: 19,
|
||||
unit: '条',
|
||||
icon: 'ant-design:alert-outlined',
|
||||
iconBg: 'rgba(236, 72, 153, 0.14)',
|
||||
iconColor: '#db2777',
|
||||
},
|
||||
{
|
||||
key: 'rate',
|
||||
label: '完成率',
|
||||
value: 92.6,
|
||||
unit: '%',
|
||||
icon: 'ant-design:line-chart-outlined',
|
||||
iconBg: 'rgba(6, 182, 212, 0.14)',
|
||||
iconColor: '#0891b2',
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@dark-bg: #141414;
|
||||
|
||||
.chart-top {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.chart-top__card {
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
padding: 12px 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgb(226 232 240);
|
||||
background: rgb(255, 255, 255);
|
||||
box-shadow: 0 8px 24px rgb(148 163 184 / 14%);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
transform 0.2s ease,
|
||||
box-shadow 0.2s ease,
|
||||
border-color 0.2s ease,
|
||||
background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.chart-top__card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: rgb(147 197 253);
|
||||
box-shadow: 0 12px 28px rgb(96 165 250 / 20%);
|
||||
}
|
||||
|
||||
.chart-top__left {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.chart-top__icon {
|
||||
flex-shrink: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.chart-top__label {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: rgb(71 85 105);
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.chart-top__right {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 2px;
|
||||
color: rgb(15 23 42);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chart-top__value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.chart-top__unit {
|
||||
color: rgb(100 116 139);
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .chart-top__card {
|
||||
border-color: rgb(51 65 85);
|
||||
background: @dark-bg !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .chart-top__card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: rgb(96 165 250);
|
||||
background: @dark-bg !important;
|
||||
box-shadow: 0 14px 32px rgb(37 99 235 / 22%) !important;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .chart-top__label {
|
||||
color: rgb(148 163 184);
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .chart-top__right {
|
||||
color: rgb(241 245 249);
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .chart-top__unit {
|
||||
color: rgb(148 163 184);
|
||||
}
|
||||
|
||||
@media (max-width: 1400px) {
|
||||
.chart-top {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chart-top {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.chart-top__card {
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.chart-top__value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<div class="my-screen-page">
|
||||
<header class="my-screen-top">顶部区域</header>
|
||||
<header class="my-screen-panel my-screen-panel--header">
|
||||
<ChartTop />
|
||||
</header>
|
||||
<section class="my-screen-bottom">
|
||||
<div class="my-screen-left">
|
||||
<section class="my-screen-panel my-screen-left-top">左上区域</section>
|
||||
@@ -22,7 +24,9 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="BizMyScreen"></script>
|
||||
<script lang="ts" setup name="BizMyScreen">
|
||||
import ChartTop from './components/ChartTop.vue';
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@dark-bg: #141414;
|
||||
@@ -34,29 +38,34 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 4px;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.my-screen-top,
|
||||
.my-screen-panel {
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgb(226 232 240);
|
||||
background: rgb(248 250 252);
|
||||
background: rgb(255, 255, 255);
|
||||
box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: rgb(71 85 105);
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.my-screen-top {
|
||||
.my-screen-panel--header {
|
||||
flex: 0 0 10%;
|
||||
padding: 8px 16px;
|
||||
font-weight: 500;
|
||||
color: rgb(51 65 85);
|
||||
}
|
||||
|
||||
.my-screen-bottom {
|
||||
@@ -65,6 +74,7 @@
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
background: transparent;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.my-screen-left {
|
||||
@@ -102,6 +112,10 @@
|
||||
flex: 1 1 0;
|
||||
}
|
||||
|
||||
.my-screen-right .my-screen-panel {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
|
||||
.my-screen-right-top,
|
||||
.my-screen-right-middle,
|
||||
.my-screen-right-bottom {
|
||||
@@ -109,11 +123,15 @@
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .my-screen-page,
|
||||
html[data-theme='dark'] .my-screen-bottom {
|
||||
html[data-theme='dark'] .my-screen-bottom,
|
||||
html[data-theme='dark'] .my-screen-left,
|
||||
html[data-theme='dark'] .my-screen-right,
|
||||
html[data-theme='dark'] .my-screen-left-middle,
|
||||
html[data-theme='dark'] .my-screen-left-bottom {
|
||||
background: @dark-bg !important;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .my-screen-top,
|
||||
html[data-theme='dark'] .my-screen-panel,
|
||||
html[data-theme='dark'] .my-screen-panel {
|
||||
border-color: rgb(51 65 85);
|
||||
background: @dark-bg !important;
|
||||
@@ -121,13 +139,17 @@
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .my-screen-panel--header {
|
||||
color: rgb(203 213 225);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.my-screen-page {
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.my-screen-top {
|
||||
.my-screen-panel--header {
|
||||
flex-basis: 72px;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<Icon :icon="item.iconImg" class="icon-img" :style="{ filter: item.iconFilter }" />
|
||||
<Icon :icon="item.iconImg" class="icon-img" />
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
@@ -19,25 +19,40 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { MyPageIndex, myPageIndexListAll } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
|
||||
const cardList = ref<MyPageIndex[]>();
|
||||
import { ScreenTop, ErpChartTop } from '@jeesite/erp/api/erp/screen';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
const cardList = ref<ScreenTop[]>();
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: 'werpIndex',
|
||||
...props.formParams,
|
||||
};
|
||||
const res = await myPageIndexListAll(reqParams);
|
||||
const res = await ErpChartTop(reqParams);
|
||||
cardList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
cardList.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList();
|
||||
},
|
||||
{ deep: true, immediate: true },
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { ChartDataItem, CategoryChart } from '@jeesite/erp/api/erp/screen';
|
||||
import { ChartDataItem, ErpCategoryChart } from '@jeesite/erp/api/erp/screen';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
@@ -35,7 +35,7 @@
|
||||
...props.formParams,
|
||||
flowType: '1',
|
||||
};
|
||||
const res = await CategoryChart(params);
|
||||
const res = await ErpCategoryChart(params);
|
||||
vList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取支出数据失败:', error);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { ChartDataItem, CategoryChart } from '@jeesite/erp/api/erp/screen';
|
||||
import { ChartDataItem, ErpCategoryChart } from '@jeesite/erp/api/erp/screen';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
@@ -35,7 +35,7 @@
|
||||
...props.formParams,
|
||||
flowType: '2',
|
||||
};
|
||||
const res = await CategoryChart(params);
|
||||
const res = await ErpCategoryChart(params);
|
||||
vList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取收入数据失败:', error);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { ChartDataItem, CategoryChart } from '@jeesite/erp/api/erp/screen';
|
||||
import { ChartDataItem, ErpCategoryChart } from '@jeesite/erp/api/erp/screen';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
@@ -30,7 +30,7 @@
|
||||
...props.formParams,
|
||||
flowType: '1',
|
||||
};
|
||||
const res = await CategoryChart(params);
|
||||
const res = await ErpCategoryChart(params);
|
||||
vList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="erp-layout-container">
|
||||
<div class="erp-section erp-top-header">
|
||||
<div class="erp-card full-card">
|
||||
<ChartTop />
|
||||
<ChartTop :formParams="FormValues" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<Icon :icon="item.iconImg" class="icon-img" :style="{ filter: item.iconFilter }" />
|
||||
<Icon :icon="item.iconImg" class="icon-img" />
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
@@ -21,17 +21,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { MyPageIndex, myPageIndexListAll } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
|
||||
const cardList = ref<MyPageIndex[]>();
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: 'homeIndex',
|
||||
};
|
||||
const res = await myPageIndexListAll(reqParams);
|
||||
cardList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
cardList.value = [];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<Icon :icon="item.iconImg" class="icon-img" :style="{ filter: item.iconFilter }" />
|
||||
<Icon :icon="item.iconImg" class="icon-img" />
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
@@ -21,17 +21,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { MyPageIndex, myPageIndexListAll } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
|
||||
const cardList = ref<MyPageIndex[]>();
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: 'sysIndex',
|
||||
};
|
||||
const res = await myPageIndexListAll(reqParams);
|
||||
cardList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
cardList.value = [];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<Icon :icon="item.iconImg" class="icon-img" :style="{ filter: item.iconFilter }" />
|
||||
<Icon :icon="item.iconImg" class="icon-img" />
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
@@ -21,17 +21,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { MyPageIndex, myPageIndexListAll } from '@jeesite/biz/api/biz/myPageIndex';
|
||||
|
||||
const cardList = ref<MyPageIndex[]>();
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: 'workIndex',
|
||||
};
|
||||
const res = await myPageIndexListAll(reqParams);
|
||||
cardList.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
cardList.value = [];
|
||||
|
||||
@@ -4,63 +4,47 @@
|
||||
<span>常用应用</span>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<button v-for="item in appList" :key="item.id" class="biz-apps-item" type="button" @click="handleOpen(item)">
|
||||
<button v-for="item in bizAppData" class="biz-apps-item" type="button" @click="handleOpen(item)">
|
||||
<div class="biz-apps-item__main">
|
||||
<div class="biz-apps-item__pane biz-apps-item__pane--left">左侧区域</div>
|
||||
<div class="biz-apps-item__pane biz-apps-item__pane--right">右侧区域</div>
|
||||
<div class="biz-apps-item__pane">
|
||||
<img class="biz-apps-item__icon" :src="item.systemIcon" :alt="item.systemName" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="biz-apps-item__name">{{ item.name }}</div>
|
||||
<div class="biz-apps-item__name">{{ item.systemName }}</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { MyQuickLogin, myQuickLoginListAll } from '@jeesite/biz/api/biz/myQuickLogin';
|
||||
|
||||
interface BizAppItem {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
const router = useRouter();
|
||||
const bizAppData = ref<MyQuickLogin[]>([]);
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
ustatus: '1',
|
||||
systemType: '1',
|
||||
};
|
||||
const res = await myQuickLoginListAll(reqParams);
|
||||
bizAppData.value = res || [];
|
||||
} catch (error) {
|
||||
bizAppData.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
const appList = ref<BizAppItem[]>([
|
||||
{
|
||||
id: 'oa',
|
||||
name: '协同办公',
|
||||
url: '/oa',
|
||||
},
|
||||
{
|
||||
id: 'erp',
|
||||
name: 'ERP系统',
|
||||
url: '/erp',
|
||||
},
|
||||
{
|
||||
id: 'mes',
|
||||
name: 'MES平台',
|
||||
url: '/mes',
|
||||
},
|
||||
{
|
||||
id: 'crm',
|
||||
name: 'CRM系统',
|
||||
url: '/crm',
|
||||
},
|
||||
{
|
||||
id: 'hr',
|
||||
name: '人资门户',
|
||||
url: '/hr',
|
||||
},
|
||||
{
|
||||
id: 'bi',
|
||||
name: '数据驾驶舱',
|
||||
url: '/bi',
|
||||
},
|
||||
]);
|
||||
|
||||
function handleOpen(item: BizAppItem) {
|
||||
ElMessage.success(`准备进入:${item.name}`);
|
||||
function handleOpen(item: MyQuickLogin) {
|
||||
if (!item.systemUrl) return;
|
||||
router.push(item.systemUrl);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@@ -76,8 +60,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 37px;
|
||||
padding: 8px 16px;
|
||||
height: var(--analysis-card-title-height, 37px);
|
||||
padding: var(--analysis-card-title-padding, 8px 16px);
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
@@ -91,11 +75,11 @@
|
||||
.card-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
padding: var(--analysis-card-content-padding, 8px 12px 12px);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
gap: 8px;
|
||||
gap: var(--analysis-card-item-gap, 8px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -108,10 +92,11 @@
|
||||
min-height: 0;
|
||||
padding: 8px;
|
||||
border: 1px solid rgb(226 232 240);
|
||||
border-radius: 10px;
|
||||
border-radius: var(--analysis-card-radius, 10px);
|
||||
background: rgb(255, 255, 255);
|
||||
box-shadow: 0 8px 24px rgb(148 163 184 / 14%);
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
transition:
|
||||
transform 0.2s ease,
|
||||
box-shadow 0.2s ease,
|
||||
@@ -128,25 +113,33 @@
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: 8px;
|
||||
gap: 8px;
|
||||
padding: 2px;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
&__pane {
|
||||
flex: 1 1 0;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 8px;
|
||||
background: rgb(255, 255, 255);
|
||||
background: linear-gradient(135deg, rgb(239 246 255), rgb(224 242 254));
|
||||
color: rgb(51 65 85);
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
box-shadow: 0 8px 24px rgb(148 163 184 / 14%);
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
&__name {
|
||||
@@ -185,11 +178,8 @@
|
||||
box-shadow: 0 14px 32px rgb(37 99 235 / 22%);
|
||||
}
|
||||
|
||||
&__pane,
|
||||
&__pane--left,
|
||||
&__pane--right {
|
||||
background: linear-gradient(180deg, rgb(20, 20, 20) 0%, rgb(28 28 28) 100%);
|
||||
color: rgb(226 232 240);
|
||||
&__pane {
|
||||
background: linear-gradient(135deg, rgb(30 41 59), rgb(15 23 42));
|
||||
box-shadow: 0 10px 24px rgb(0 0 0 / 24%);
|
||||
}
|
||||
|
||||
@@ -203,8 +193,8 @@
|
||||
@media (max-width: 768px) {
|
||||
.biz-apps-card {
|
||||
.card-content {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 37px;
|
||||
padding: 8px 16px;
|
||||
height: var(--analysis-card-title-height, 37px);
|
||||
padding: var(--analysis-card-title-padding, 8px 16px);
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
@@ -266,7 +266,7 @@
|
||||
.card-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
padding: var(--analysis-card-content-padding, 8px 12px 12px);
|
||||
color: rgb(71 85 105);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
>
|
||||
<el-table-column prop="projectCode" label="项目编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="projectName" label="项目名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="projectType" label="项目类型" width="120" show-overflow-tooltip>
|
||||
<el-table-column prop="projectType" label="项目类型" width="100" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ getDictLabel(projectTypeDict, row.projectType) }}
|
||||
</template>
|
||||
@@ -64,12 +64,13 @@
|
||||
{{ getDictLabel(projectStatusDict, row.projectStatus) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="budget" label="项目预算(元)" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="treeName" label="项目区域" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="personName" label="项目人员" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="startDate" label="开始日期" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="endDate" label="结束日期" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="budget" label="项目预算(元)" width="120" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="pagination-panel">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
@@ -208,8 +209,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 37px;
|
||||
padding: 8px 16px;
|
||||
height: var(--analysis-card-title-height, 37px);
|
||||
padding: var(--analysis-card-title-padding, 8px 16px);
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
@@ -223,7 +224,7 @@
|
||||
.card-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
padding: var(--analysis-card-content-padding, 8px 12px 12px);
|
||||
color: rgb(71 85 105);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
@@ -231,7 +232,7 @@
|
||||
background: transparent;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
gap: var(--analysis-card-item-gap, 8px);
|
||||
}
|
||||
|
||||
.query-panel,
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div ref="provinceCardRef" class="province-card">
|
||||
<div class="card-title">
|
||||
<span>社区分布</span>
|
||||
<el-tooltip content="刷新" placement="top" :show-after="200">
|
||||
<el-button
|
||||
class="card-title__refresh"
|
||||
link
|
||||
type="primary"
|
||||
:icon="RefreshRight"
|
||||
:loading="loading"
|
||||
@click="getList"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="province-chart-panel">
|
||||
<div ref="chartRef" class="province-chart"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { RefreshRight } from '@element-plus/icons-vue';
|
||||
import { ChartInfo, ProvinceChart } from '@jeesite/biz/api/biz/myAnalysis';
|
||||
|
||||
const chartData = ref<ChartInfo[]>([]);
|
||||
const loading = ref(false);
|
||||
const provinceCardRef = ref<HTMLElement>();
|
||||
const chartRef = ref<HTMLElement>();
|
||||
|
||||
async function getList() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await ProvinceChart();
|
||||
chartData.value = res || [];
|
||||
nextTick(() => {
|
||||
renderChart();
|
||||
});
|
||||
} catch (error) {
|
||||
chartData.value = [];
|
||||
nextTick(() => {
|
||||
renderChart();
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
let resizeObserver: ResizeObserver | null = null;
|
||||
let themeObserver: MutationObserver | null = null;
|
||||
|
||||
function renderChart() {
|
||||
if (!chartRef.value) return;
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
}
|
||||
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const axisLabelRotate = chartData.value.length > 10 ? 45 : chartData.value.length > 6 ? 30 : 0;
|
||||
|
||||
chartInstance.setOption({
|
||||
grid: {
|
||||
left: 12,
|
||||
right: 12,
|
||||
top: 36,
|
||||
bottom: 8,
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
},
|
||||
backgroundColor: isDark ? 'rgba(20, 20, 20, 0.96)' : 'rgba(255, 255, 255, 0.96)',
|
||||
borderColor: isDark ? 'rgb(51 65 85)' : 'rgb(226 232 240)',
|
||||
borderWidth: 1,
|
||||
textStyle: {
|
||||
color: isDark ? '#e2e8f0' : '#334155',
|
||||
},
|
||||
formatter: (params: any) => {
|
||||
const current = Array.isArray(params) ? params[0] : params;
|
||||
const label = current?.axisValue || current?.name || '-';
|
||||
const value = current?.value ?? 0;
|
||||
const total = chartData.value.reduce((sum, item) => sum + Number(item.value || 0), 0);
|
||||
const percent = total > 0 ? ((Number(value) / total) * 100).toFixed(2) : '0.00';
|
||||
return `区域:${label}<br/>数量:${value}<br/>占比:${percent}%`;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: chartData.value.map((item) => item.label || '-'),
|
||||
axisTick: {
|
||||
alignWithLabel: true,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#475569' : '#cbd5e1',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: isDark ? '#cbd5e1' : '#64748b',
|
||||
margin: 10,
|
||||
rotate: axisLabelRotate,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '数量',
|
||||
nameTextStyle: {
|
||||
color: isDark ? '#94a3b8' : '#64748b',
|
||||
padding: [0, 0, 4, 0],
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? 'rgba(71, 85, 105, 0.35)' : 'rgba(203, 213, 225, 0.55)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: isDark ? '#94a3b8' : '#64748b',
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'bar',
|
||||
barWidth: '24%',
|
||||
data: chartData.value.map((item) => ({
|
||||
value: item.value,
|
||||
itemStyle: {
|
||||
color: item.color || '#3B82F6',
|
||||
borderRadius: [6, 6, 0, 0],
|
||||
},
|
||||
})),
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
color: isDark ? '#cbd5e1' : '#475569',
|
||||
fontSize: 11,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
function resizeChart() {
|
||||
chartInstance?.resize();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
||||
if (provinceCardRef.value) {
|
||||
resizeObserver = new ResizeObserver(() => {
|
||||
resizeChart();
|
||||
});
|
||||
resizeObserver.observe(provinceCardRef.value);
|
||||
}
|
||||
|
||||
window.addEventListener('resize', resizeChart);
|
||||
|
||||
themeObserver = new MutationObserver(() => {
|
||||
nextTick(() => {
|
||||
renderChart();
|
||||
});
|
||||
});
|
||||
themeObserver.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme'],
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
resizeObserver?.disconnect();
|
||||
themeObserver?.disconnect();
|
||||
window.removeEventListener('resize', resizeChart);
|
||||
chartInstance?.dispose();
|
||||
chartInstance = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.province-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
background: rgb(255, 255, 255);
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 37px;
|
||||
padding: 8px 16px;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
color: rgb(51 65 85);
|
||||
border-bottom: 1px solid rgb(226 232 240);
|
||||
background: transparent;
|
||||
|
||||
&__refresh {
|
||||
padding: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.province-chart-panel {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
background: rgb(255, 255, 255);
|
||||
box-shadow: 0 8px 24px rgb(148 163 184 / 14%);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.province-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
html[data-theme='dark'] .province-card {
|
||||
background: rgb(20, 20, 20);
|
||||
|
||||
.card-title {
|
||||
color: rgb(203 213 225);
|
||||
border-bottom-color: rgb(51 65 85);
|
||||
|
||||
&__refresh:deep(.el-icon) {
|
||||
color: rgb(147 197 253);
|
||||
}
|
||||
}
|
||||
|
||||
.province-chart-panel {
|
||||
background: linear-gradient(180deg, rgb(20, 20, 20) 0%, rgb(28 28 28) 100%);
|
||||
box-shadow: 0 10px 24px rgb(0 0 0 / 24%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -21,16 +21,16 @@
|
||||
}"
|
||||
>
|
||||
<button
|
||||
v-for="item in displayList"
|
||||
:key="item.renderKey"
|
||||
v-for="item in quickData"
|
||||
:key="item.quickId || item.systemName"
|
||||
class="quick-login-item"
|
||||
type="button"
|
||||
@click="handleLogin(item)"
|
||||
>
|
||||
<div class="quick-login-item__image-wrap">
|
||||
<img class="quick-login-item__image" :src="item.logo" :alt="item.name" />
|
||||
<img class="quick-login-item__image" :src="item.systemIcon" :alt="item.systemName" />
|
||||
</div>
|
||||
<div class="quick-login-item__name">{{ item.name }}</div>
|
||||
<div class="quick-login-item__name">{{ item.systemName }}</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,55 +52,10 @@
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
|
||||
interface QuickLoginItem {
|
||||
id: string;
|
||||
name: string;
|
||||
logo: string;
|
||||
url: string;
|
||||
}
|
||||
import { MyQuickLogin, myQuickLoginListAll } from '@jeesite/biz/api/biz/myQuickLogin';
|
||||
|
||||
interface RenderQuickLoginItem extends QuickLoginItem {
|
||||
renderKey: string;
|
||||
}
|
||||
|
||||
const baseList = ref<QuickLoginItem[]>([
|
||||
{
|
||||
id: 'oa',
|
||||
name: '协同办公',
|
||||
logo: 'https://dummyimage.com/96x96/2563eb/ffffff.png&text=OA',
|
||||
url: '/oa',
|
||||
},
|
||||
{
|
||||
id: 'erp',
|
||||
name: 'ERP系统',
|
||||
logo: 'https://dummyimage.com/96x96/0891b2/ffffff.png&text=ERP',
|
||||
url: '/erp',
|
||||
},
|
||||
{
|
||||
id: 'mes',
|
||||
name: 'MES平台',
|
||||
logo: 'https://dummyimage.com/96x96/7c3aed/ffffff.png&text=MES',
|
||||
url: '/mes',
|
||||
},
|
||||
{
|
||||
id: 'crm',
|
||||
name: 'CRM系统',
|
||||
logo: 'https://dummyimage.com/96x96/ea580c/ffffff.png&text=CRM',
|
||||
url: '/crm',
|
||||
},
|
||||
{
|
||||
id: 'hr',
|
||||
name: '人资门户',
|
||||
logo: 'https://dummyimage.com/96x96/16a34a/ffffff.png&text=HR',
|
||||
url: '/hr',
|
||||
},
|
||||
{
|
||||
id: 'bi',
|
||||
name: '数据驾驶舱',
|
||||
logo: 'https://dummyimage.com/96x96/db2777/ffffff.png&text=BI',
|
||||
url: '/bi',
|
||||
},
|
||||
]);
|
||||
const quickData = ref<MyQuickLogin[]>([]);
|
||||
const loading = ref(false);
|
||||
|
||||
const itemWidth = 136;
|
||||
const gapWidth = 8;
|
||||
@@ -111,22 +66,15 @@
|
||||
let resizeObserver: ResizeObserver | null = null;
|
||||
let autoScrollTimer: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
const canScroll = computed(() => baseList.value.length > visibleCount.value);
|
||||
const canScroll = computed(() => quickData.value.length > visibleCount.value);
|
||||
|
||||
const maxIndex = computed(() => {
|
||||
const value = baseList.value.length - visibleCount.value;
|
||||
const value = quickData.value.length - visibleCount.value;
|
||||
return value > 0 ? value : 0;
|
||||
});
|
||||
|
||||
const currentOffset = computed(() => currentIndex.value * stepWidth);
|
||||
|
||||
const displayList = computed<RenderQuickLoginItem[]>(() => {
|
||||
return baseList.value.map((item, index) => ({
|
||||
...item,
|
||||
renderKey: `${item.id}-${index}`,
|
||||
}));
|
||||
});
|
||||
|
||||
function updateVisibleCount() {
|
||||
const width = viewportRef.value?.clientWidth || 0;
|
||||
if (!width) return;
|
||||
@@ -162,11 +110,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
function handleLogin(item: QuickLoginItem) {
|
||||
ElMessage.success(`准备进入:${item.name}`);
|
||||
function handleLogin(item: MyQuickLogin) {
|
||||
window.open(item.systemUrl, '_blank');
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const reqParams = {
|
||||
ustatus: '1',
|
||||
systemType: '2',
|
||||
};
|
||||
const res = await myQuickLoginListAll(reqParams);
|
||||
quickData.value = res || [];
|
||||
currentIndex.value = 0;
|
||||
nextTick(() => {
|
||||
updateVisibleCount();
|
||||
startAutoScroll();
|
||||
});
|
||||
} catch (error) {
|
||||
quickData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
nextTick(() => {
|
||||
updateVisibleCount();
|
||||
startAutoScroll();
|
||||
@@ -199,8 +169,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 37px;
|
||||
padding: 8px 16px;
|
||||
height: var(--analysis-card-title-height, 37px);
|
||||
padding: var(--analysis-card-title-padding, 8px 16px);
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
@@ -214,12 +184,12 @@
|
||||
.card-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
padding: var(--analysis-card-content-padding, 8px 12px 12px);
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
gap: var(--analysis-card-item-gap, 8px);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -243,7 +213,7 @@
|
||||
|
||||
.quick-login-track {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
gap: var(--analysis-card-item-gap, 8px);
|
||||
align-items: stretch;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
@@ -262,7 +232,7 @@
|
||||
height: 100%;
|
||||
padding: 8px;
|
||||
border: 1px solid rgb(226 232 240);
|
||||
border-radius: 10px;
|
||||
border-radius: var(--analysis-card-radius, 10px);
|
||||
background: rgb(255, 255, 255);
|
||||
box-shadow: 0 8px 24px rgb(148 163 184 / 14%);
|
||||
cursor: pointer;
|
||||
@@ -285,7 +255,7 @@
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
padding: 8px;
|
||||
padding: 2px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -293,7 +263,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 6px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
&__name {
|
||||
@@ -343,7 +313,7 @@
|
||||
@media (max-width: 768px) {
|
||||
.quick-login-card {
|
||||
.card-content {
|
||||
padding: 8px 12px 12px;
|
||||
padding: var(--analysis-card-content-padding, 8px 12px 12px);
|
||||
}
|
||||
|
||||
.quick-login-item {
|
||||
|
||||
@@ -268,8 +268,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 37px;
|
||||
padding: 8px 16px;
|
||||
height: var(--analysis-card-title-height, 37px);
|
||||
padding: var(--analysis-card-title-padding, 8px 16px);
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
@@ -313,7 +313,7 @@
|
||||
.card-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 8px 12px 12px;
|
||||
padding: var(--analysis-card-content-padding, 8px 12px 12px);
|
||||
color: rgb(71 85 105);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
|
||||
@@ -90,12 +90,20 @@
|
||||
}
|
||||
|
||||
.mySpring-analysis .analysis-layout {
|
||||
--analysis-gap: 12px;
|
||||
--analysis-row-height: calc((100% - var(--analysis-gap) * 2) / 3);
|
||||
--analysis-double-row-height: calc(var(--analysis-row-height) * 2 + var(--analysis-gap));
|
||||
--analysis-card-title-height: 37px;
|
||||
--analysis-card-title-padding: 8px 16px;
|
||||
--analysis-card-content-padding: 8px 12px 12px;
|
||||
--analysis-card-item-gap: 8px;
|
||||
--analysis-card-radius: 10px;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
min-height: 0;
|
||||
gap: 12px;
|
||||
gap: var(--analysis-gap);
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
@@ -110,14 +118,14 @@
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
min-height: 0;
|
||||
gap: 12px;
|
||||
gap: var(--analysis-gap);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.mySpring-analysis .analysis-right-top {
|
||||
display: grid;
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
gap: var(--analysis-gap);
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
@@ -129,7 +137,7 @@
|
||||
|
||||
.mySpring-analysis .analysis-right {
|
||||
flex: 3 1 0;
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: minmax(0, var(--analysis-row-height)) minmax(0, var(--analysis-double-row-height));
|
||||
}
|
||||
|
||||
.mySpring-analysis .analysis-panel {
|
||||
@@ -139,7 +147,7 @@
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
border-radius: 10px;
|
||||
border-radius: var(--analysis-card-radius);
|
||||
border: 1px solid rgb(226 232 240);
|
||||
background: rgb(255, 255, 255);
|
||||
box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
|
||||
|
||||
@@ -142,7 +142,10 @@
|
||||
{ label: '进行中', color: '#3B82F6', field: 'value02' },
|
||||
{ label: '已完成', color: '#10B981', field: 'value03' },
|
||||
] as const;
|
||||
const months = chartData.value.map((item) => item.axisName || '-');
|
||||
const months = chartData.value.map((item) => {
|
||||
const axisName = item.axisName || '-';
|
||||
return axisName.endsWith('月') ? axisName : `${axisName}月`;
|
||||
});
|
||||
const pendingData = chartData.value.map((item) => Number(item.value01 || 0));
|
||||
const processingData = chartData.value.map((item) => Number(item.value02 || 0));
|
||||
const finishedData = chartData.value.map((item) => Number(item.value03 || 0));
|
||||
|
||||
@@ -7,13 +7,15 @@
|
||||
<div class="workbench-layout">
|
||||
<div class="workbench-row">
|
||||
<div class="workbench-col">
|
||||
<NoteInfo />
|
||||
</div>
|
||||
<div class="workbench-col">上右</div>
|
||||
<NoteInfo />
|
||||
</div>
|
||||
<div class="workbench-col">
|
||||
上右
|
||||
</div>
|
||||
</div>
|
||||
<div class="workbench-row">
|
||||
<div class="workbench-col">中左</div>
|
||||
<div class="workbench-col">中右</div>
|
||||
<div class="workbench-col">下左</div>
|
||||
<div class="workbench-col">下右</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,11 +48,11 @@
|
||||
.jeesite-workbench .workbench-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: 2px;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
@@ -60,7 +62,7 @@
|
||||
.jeesite-workbench .workbench-row {
|
||||
display: flex;
|
||||
flex: 1 1 0;
|
||||
gap: 12px;
|
||||
gap: 8px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,14 +52,28 @@ export interface ChartDataItem extends BasicModel<ChartDataItem> {
|
||||
indexMin: number; // 指标最小
|
||||
}
|
||||
|
||||
|
||||
export interface ScreenTop extends BasicModel<ScreenTop> {
|
||||
module: string; // 模块名称
|
||||
title: string; // 说明描述
|
||||
label?: string; // 名称
|
||||
value?: number; // 数值
|
||||
iconImg: string; // 图片路径
|
||||
iconFilter?: string; // 图标颜色
|
||||
sort: number; // 序号
|
||||
}
|
||||
|
||||
export const ErpChartTop = (params?: ErpTransactionFlow | any) =>
|
||||
defHttp.get<ScreenTop[]>({ url: adminPath + '/erp/screen/getErpChartTop', params });
|
||||
|
||||
export const ErpYearChart = (params?: ErpTransactionFlow | any) =>
|
||||
defHttp.get<ChartDataItem[]>({ url: adminPath + '/erp/screen/getErpYearChart', params });
|
||||
|
||||
export const ErpMonthChart = (params?: ErpTransactionFlow | any) =>
|
||||
defHttp.get<ChartDataItem[]>({ url: adminPath + '/erp/screen/getErpMonthChart', params });
|
||||
|
||||
export const CategoryChart = (params?: ErpTransactionFlow | any) =>
|
||||
defHttp.get<ChartDataItem[]>({ url: adminPath + '/erp/screen/getCategoryChart', params });
|
||||
export const ErpCategoryChart = (params?: ErpTransactionFlow | any) =>
|
||||
defHttp.get<ChartDataItem[]>({ url: adminPath + '/erp/screen/getErpCategoryChart', params });
|
||||
|
||||
export const ErpAccountChart = (params?: ErpTransactionFlow | any) =>
|
||||
defHttp.get<ChartDataItem[]>({ url: adminPath + '/erp/screen/getErpAccountChart', params });
|
||||
|
||||
Reference in New Issue
Block a user