初始化项目
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user