flat: 暂存
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@ _roadhog-api-doc
|
|||||||
|
|
||||||
# production
|
# production
|
||||||
/dist
|
/dist
|
||||||
|
/qingdao
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export default defineConfig({
|
|||||||
*/
|
*/
|
||||||
headScripts: [
|
headScripts: [
|
||||||
// 解决首次加载时白屏的问题
|
// 解决首次加载时白屏的问题
|
||||||
{ src: '/scripts/loading.js', async: true },
|
{ src: '/qingdao/scripts/loading.js', async: true },
|
||||||
],
|
],
|
||||||
//================ pro 插件配置 =================
|
//================ pro 插件配置 =================
|
||||||
presets: ['umi-presets-pro'],
|
presets: ['umi-presets-pro'],
|
||||||
@@ -151,6 +151,9 @@ export default defineConfig({
|
|||||||
mfsu: {
|
mfsu: {
|
||||||
strategy: 'normal',
|
strategy: 'normal',
|
||||||
},
|
},
|
||||||
|
outputPath: 'qingdao',
|
||||||
|
base: '/qingdao/',
|
||||||
|
publicPath: '/qingdao/',
|
||||||
esbuildMinifyIIFE: true,
|
esbuildMinifyIIFE: true,
|
||||||
requestRecord: {},
|
requestRecord: {},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default [
|
|||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
name: '字典数据',
|
name: '字典数据',
|
||||||
path: '/area/updata-router/index/:id',
|
path: '/area/updata-router/index',
|
||||||
component: './Area/Subway/UpLine',
|
component: './Area/Subway/UpLine',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
30
src/app.tsx
30
src/app.tsx
@@ -12,11 +12,10 @@ import { PageEnum } from './enums/pagesEnums';
|
|||||||
import {logout} from "@/services/system/auth";
|
import {logout} from "@/services/system/auth";
|
||||||
import { stringify } from 'querystring';
|
import { stringify } from 'querystring';
|
||||||
import { message } from 'antd'
|
import { message } from 'antd'
|
||||||
|
import { createRef } from 'react';
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const loginOut = async () => {
|
const loginOut = async () => {
|
||||||
await logout();
|
|
||||||
clearSessionToken();
|
clearSessionToken();
|
||||||
setRemoteMenu(null);
|
setRemoteMenu(null);
|
||||||
const { search, pathname } = window.location;
|
const { search, pathname } = window.location;
|
||||||
@@ -24,11 +23,12 @@ const loginOut = async () => {
|
|||||||
/** 此方法会跳转到 redirect 参数所在的位置 */
|
/** 此方法会跳转到 redirect 参数所在的位置 */
|
||||||
const redirect = urlParams.get('redirect');
|
const redirect = urlParams.get('redirect');
|
||||||
// Note: There may be security issues, please note
|
// Note: There may be security issues, please note
|
||||||
if (window.location.pathname !== '/user/login' && !redirect) {
|
console.log('redirect', window.location.pathname, redirect)
|
||||||
|
if (window.location.pathname !== '/qingdao/user/login' && !redirect) {
|
||||||
history.replace({
|
history.replace({
|
||||||
pathname: '/user/login',
|
pathname: '/user/login',
|
||||||
search: stringify({
|
search: stringify({
|
||||||
redirect: pathname + search,
|
redirect: pathname.replace('/qingdao', '') + search,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -79,9 +79,9 @@ export async function getInitialState(): Promise<{
|
|||||||
settings: defaultSettings as Partial<LayoutSettings>,
|
settings: defaultSettings as Partial<LayoutSettings>,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|
||||||
export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => {
|
export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// actionsRender: () => [<Question key="doc" />, <SelectLang key="SelectLang" />],
|
// actionsRender: () => [<Question key="doc" />, <SelectLang key="SelectLang" />],
|
||||||
actionsRender: () => [ <SelectLang key="SelectLang" />],
|
actionsRender: () => [ <SelectLang key="SelectLang" />],
|
||||||
@@ -95,9 +95,10 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
|||||||
waterMarkProps: {
|
waterMarkProps: {
|
||||||
// content: initialState?.currentUser?.nickName,
|
// content: initialState?.currentUser?.nickName,
|
||||||
},
|
},
|
||||||
|
// actionRef: layoutActionRef,
|
||||||
menu: {
|
menu: {
|
||||||
locale: false,
|
locale: false,
|
||||||
// 每当 initialState?.currentUser?.userid 发生修改时重新执行 request
|
// // 每当 initialState?.currentUser?.userid 发生修改时重新执行 request
|
||||||
params: {
|
params: {
|
||||||
userId: initialState?.currentUser?.userId,
|
userId: initialState?.currentUser?.userId,
|
||||||
},
|
},
|
||||||
@@ -105,7 +106,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
|||||||
if (!initialState?.currentUser?.userId) {
|
if (!initialState?.currentUser?.userId) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return getRemoteMenu();
|
return getRemoteMenu()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
footerRender: () => <Footer />,
|
footerRender: () => <Footer />,
|
||||||
@@ -176,7 +177,7 @@ export async function onRouteChange({ clientRoutes, location }) {
|
|||||||
// console.log('onRouteChange', clientRoutes, location, menus);
|
// console.log('onRouteChange', clientRoutes, location, menus);
|
||||||
if(menus === null && location.pathname !== PageEnum.LOGIN) {
|
if(menus === null && location.pathname !== PageEnum.LOGIN) {
|
||||||
console.log('refresh')
|
console.log('refresh')
|
||||||
history.go(0);
|
// history.go(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,13 +192,15 @@ export async function patchClientRoutes({ routes }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function render(oldRender: () => void) {
|
export async function render(oldRender: () => void) {
|
||||||
// console.log('render get routers', oldRender)
|
console.log('render get routers', oldRender)
|
||||||
const token = getAccessToken();
|
const token = getAccessToken();
|
||||||
if(!token || token?.length === 0) {
|
if(!token || token?.length === 0) {
|
||||||
oldRender();
|
oldRender();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await getRoutersInfo().then(res => {
|
await getRoutersInfo().then(res => {
|
||||||
|
console.log('render get routers', 123)
|
||||||
|
|
||||||
setRemoteMenu(res);
|
setRemoteMenu(res);
|
||||||
oldRender()
|
oldRender()
|
||||||
});
|
});
|
||||||
@@ -209,9 +212,10 @@ export async function render(oldRender: () => void) {
|
|||||||
* @doc https://umijs.org/docs/max/request#配置
|
* @doc https://umijs.org/docs/max/request#配置
|
||||||
*/
|
*/
|
||||||
const checkRegion = 5 * 60 * 1000;
|
const checkRegion = 5 * 60 * 1000;
|
||||||
|
|
||||||
export const request = {
|
export const request = {
|
||||||
...errorConfig,
|
...errorConfig,
|
||||||
|
baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://39.98.44.136:8080',
|
||||||
|
// baseURL: 'http://39.98.44.136:8080',
|
||||||
requestInterceptors: [
|
requestInterceptors: [
|
||||||
(url: any, options: { headers: any }) => {
|
(url: any, options: { headers: any }) => {
|
||||||
const headers = options.headers ? options.headers : [];
|
const headers = options.headers ? options.headers : [];
|
||||||
@@ -237,6 +241,11 @@ export const request = {
|
|||||||
clearSessionToken();
|
clearSessionToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(process.env.NODE_ENV !== 'development') {
|
||||||
|
if (url.startsWith('/api')) {
|
||||||
|
url = url.replace(/^\/api/, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
return { url, options };
|
return { url, options };
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -247,6 +256,7 @@ export const request = {
|
|||||||
switch (data.code) {
|
switch (data.code) {
|
||||||
case 401:
|
case 401:
|
||||||
loginOut()
|
loginOut()
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if(data.code !== 200 && data.msg) {
|
if(data.code !== 200 && data.msg) {
|
||||||
message.info(data.msg)
|
message.info(data.msg)
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,18 +1,25 @@
|
|||||||
import { GithubOutlined } from '@ant-design/icons';
|
import { GithubOutlined } from '@ant-design/icons';
|
||||||
import { DefaultFooter } from '@ant-design/pro-components';
|
import { DefaultFooter } from '@ant-design/pro-components';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import {getYear} from '@/utils/tools'
|
||||||
const Footer: React.FC = () => {
|
const Footer: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<DefaultFooter
|
<DefaultFooter
|
||||||
|
copyright={` ${getYear()} 青岛智慧就业服务系统`}
|
||||||
style={{
|
style={{
|
||||||
background: 'none',
|
background: 'none',
|
||||||
}}
|
}}
|
||||||
links={[
|
links={[
|
||||||
{
|
{
|
||||||
key: '青岛智慧就业服务系统',
|
key: '青岛政务网',
|
||||||
title: '青岛智慧就业服务系统',
|
title: '青岛政务网',
|
||||||
href: 'http://localhost:8000/',
|
href: 'http://www.qingdao.gov.cn/',
|
||||||
|
blankTarget: true,
|
||||||
|
},{
|
||||||
|
key: '青岛市人力资源和社会保障局',
|
||||||
|
title: '青岛市人力资源和社会保障局',
|
||||||
|
href: 'https://hrss.qingdao.gov.cn/',
|
||||||
|
blankTarget: true,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -53,11 +53,12 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, childre
|
|||||||
/** 此方法会跳转到 redirect 参数所在的位置 */
|
/** 此方法会跳转到 redirect 参数所在的位置 */
|
||||||
const redirect = urlParams.get('redirect');
|
const redirect = urlParams.get('redirect');
|
||||||
// Note: There may be security issues, please note
|
// Note: There may be security issues, please note
|
||||||
if (window.location.pathname !== '/user/login' && !redirect) {
|
console.log('redirect', window.location.pathname, redirect)
|
||||||
|
if (window.location.pathname !== '/qingdao/user/login' && !redirect) {
|
||||||
history.replace({
|
history.replace({
|
||||||
pathname: '/user/login',
|
pathname: '/user/login',
|
||||||
search: stringify({
|
search: stringify({
|
||||||
redirect: pathname + search,
|
redirect: pathname.replace('/qingdao', '') + search,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default {
|
|||||||
'System messages will be notified in the form of a station letter',
|
'System messages will be notified in the form of a station letter',
|
||||||
'app.settings.notification.todo': 'To-do Notification',
|
'app.settings.notification.todo': 'To-do Notification',
|
||||||
'app.settings.notification.todo-description':
|
'app.settings.notification.todo-description':
|
||||||
'The to-do list will be notified in the form of a letter from the station',
|
'The to-do List will be notified in the form of a letter from the station',
|
||||||
'app.settings.open': 'Open',
|
'app.settings.open': 'Open',
|
||||||
'app.settings.close': 'Close',
|
'app.settings.close': 'Close',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalForm<API.AreaBusiness.CircleParams>
|
<ModalForm<API.AreaBusiness.CircleParams>
|
||||||
title="新增线路"
|
title={`${props.values ? '编辑' : '新增'}商圈`}
|
||||||
form={form}
|
form={form}
|
||||||
// layout="inline"
|
// layout="inline"
|
||||||
autoFocusFirstInput
|
autoFocusFirstInput
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
import React, {Fragment, useRef, useState} from "react";
|
import React, {Fragment, useRef, useState} from "react";
|
||||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
import { FormInstance, Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, AlignLeftOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, FormOutlined, AlignLeftOutlined } from '@ant-design/icons';
|
||||||
import {getCmsAreaList, addCmsAreaListRow, updateCmsAreaListRow, deleteCmsAreaListRow} from "@/services/area/business";
|
import {
|
||||||
import SubWayEdit from "@/pages/Area/Business/edit";
|
getCmsAreaList,
|
||||||
import {deleteCmsLineSubWay} from "@/services/area/subway";
|
addCmsAreaListRow,
|
||||||
|
updateCmsAreaListRow,
|
||||||
|
deleteCmsAreaListRow,
|
||||||
|
exportCmsAreaListRow
|
||||||
|
} from "@/services/area/business";
|
||||||
|
import BusinessEdit from "@/pages/Area/Business/edit";
|
||||||
|
|
||||||
|
|
||||||
const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
|
const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
|
||||||
@@ -26,6 +31,20 @@ const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleExport = async (values: API.AreaBusiness.CircleEditParams) => {
|
||||||
|
const hide = message.loading('正在导出');
|
||||||
|
try {
|
||||||
|
await exportCmsAreaListRow(values);
|
||||||
|
hide();
|
||||||
|
message.success('导出成功');
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('导出失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
function ManagementList() {
|
function ManagementList() {
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
|
|
||||||
@@ -46,14 +65,15 @@ function ManagementList() {
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
width: 300,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
render: (_, record) => [
|
render: (_, record) => [
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="detail"
|
key="detail"
|
||||||
icon = <AlignLeftOutlined />
|
icon={<AlignLeftOutlined />}
|
||||||
hidden={!access.hasPerms('area:business:list.detail')}
|
hidden={!access.hasPerms('area:business:List.detail')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
@@ -65,8 +85,8 @@ function ManagementList() {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon = <FormOutlined />
|
icon = {<FormOutlined />}
|
||||||
hidden={!access.hasPerms('area:business:list.update')}
|
hidden={!access.hasPerms('area:business:List.update')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
@@ -79,8 +99,8 @@ function ManagementList() {
|
|||||||
size="small"
|
size="small"
|
||||||
danger
|
danger
|
||||||
key="batchRemove"
|
key="batchRemove"
|
||||||
icon = <DeleteOutlined/>
|
icon ={<DeleteOutlined/>}
|
||||||
hidden={!access.hasPerms('area:business:list')}
|
hidden={!access.hasPerms('area:business:List')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -112,21 +132,22 @@ function ManagementList() {
|
|||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
formRef={formTableRef}
|
formRef={formTableRef}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
rowKey={"commercialAreaName"}
|
||||||
|
key={"index"}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getCmsAreaList({ ...params } as API.AreaBusiness.CircleParams).then((res) => {
|
getCmsAreaList({ ...params } as API.AreaBusiness.CircleParams).then((res) => {
|
||||||
const result = {
|
return {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
success: true,
|
success: true,
|
||||||
};
|
}
|
||||||
return result;
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
toolBarRender={() => [
|
toolBarRender={() => [
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
hidden={!access.hasPerms('manage:list:add')}
|
hidden={!access.hasPerms('manage:List:add')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
@@ -134,10 +155,22 @@ function ManagementList() {
|
|||||||
>
|
>
|
||||||
<PlusOutlined /> 新建
|
<PlusOutlined /> 新建
|
||||||
</Button>,
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="export"
|
||||||
|
hidden={!access.hasPerms('system:user:export')}
|
||||||
|
onClick={async () => {
|
||||||
|
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||||
|
handleExport(searchVal);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined />
|
||||||
|
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||||
|
</Button>,
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<SubWayEdit
|
<BusinessEdit
|
||||||
open={modalVisible}
|
open={modalVisible}
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
let resData
|
let resData
|
||||||
@@ -164,7 +197,7 @@ function ManagementList() {
|
|||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
setCurrentRow(undefined)
|
setCurrentRow(undefined)
|
||||||
}}
|
}}
|
||||||
></SubWayEdit>
|
></BusinessEdit>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
|
||||||
import {
|
import {
|
||||||
ModalForm,
|
ModalForm,
|
||||||
ProForm,
|
ProForm,
|
||||||
ProFormDateRangePicker,
|
ProFormDigit,
|
||||||
ProFormSelect,
|
|
||||||
ProFormText,
|
ProFormText,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Button, Form, message } from 'antd';
|
import { Form } from 'antd';
|
||||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||||
|
import {useEffect} from 'react'
|
||||||
export type ListFormProps = {
|
export type ListFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
onCancel: (flag?: boolean, formVars?: unknown) => void;
|
||||||
onSubmit: (values: API.AreaSubWay.Line) => Promise<void>;
|
onSubmit: (values: API.AreaSubWay.LinePoint) => Promise<void>;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
values?: Partial<API.AreaSubWay.Line>;
|
values?: Partial<API.AreaSubWay.LinePoint>;
|
||||||
jobGroupOptions?: DictOptionType[];
|
jobGroupOptions?: DictOptionType[];
|
||||||
statusOptions?: DictValueEnumObj;
|
statusOptions?: DictValueEnumObj;
|
||||||
};
|
};
|
||||||
@@ -27,7 +25,19 @@ const waitTime = (time: number = 100) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||||
const [form] = Form.useForm<{ name: string; company: string }>();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.resetFields();
|
||||||
|
if(props.values) {
|
||||||
|
form.setFieldsValue({
|
||||||
|
stationName: props.values.stationName,
|
||||||
|
stationId: props.values.stationId,
|
||||||
|
longitude: props.values.longitude,
|
||||||
|
latitude: props.values.latitude,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [form, props]);
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
props.onCancel();
|
props.onCancel();
|
||||||
@@ -35,7 +45,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleFinish = async (values: Record<string, any>) => {
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
props.onSubmit(values as API.AreaSubWay.Line);
|
props.onSubmit(values as API.AreaSubWay.LinePoint);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -43,7 +53,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
name: string;
|
name: string;
|
||||||
company: string;
|
company: string;
|
||||||
}>
|
}>
|
||||||
title="新增线路"
|
title={`${props.values ? '编辑' : '新增'}站点`}
|
||||||
form={form}
|
form={form}
|
||||||
// layout="inline"
|
// layout="inline"
|
||||||
autoFocusFirstInput
|
autoFocusFirstInput
|
||||||
@@ -55,14 +65,53 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
submitTimeout={2000}
|
submitTimeout={2000}
|
||||||
onFinish={handleFinish}
|
onFinish={handleFinish}
|
||||||
>
|
>
|
||||||
|
<ProFormDigit
|
||||||
|
name="stationId"
|
||||||
|
label={'字典主键'}
|
||||||
|
placeholder="请输入字典主键"
|
||||||
|
disabled
|
||||||
|
hidden={true}
|
||||||
|
/>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
width="xl"
|
width="md"
|
||||||
name="lineName"
|
name="stationName"
|
||||||
label="线路名称:"
|
label="站点名称:"
|
||||||
placeholder="请输入名称"
|
placeholder="请输入名称"
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormDigit
|
||||||
|
label="纬度"
|
||||||
|
placeholder="请输入纬度"
|
||||||
|
name="latitude"
|
||||||
|
width="md"
|
||||||
|
min={-90}
|
||||||
|
max={90}
|
||||||
|
fieldProps={{ controls: false }}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入纬度!" ,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormDigit
|
||||||
|
label="经度"
|
||||||
|
placeholder="请输入经度"
|
||||||
|
name="longitude"
|
||||||
|
width="md"
|
||||||
|
min={-180}
|
||||||
|
max={180}
|
||||||
|
fieldProps={{ controls: false }}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入经度!" ,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import React, {Fragment, useRef, useState} from "react";
|
import React, {Fragment, useRef, useState, useCallback} from "react";
|
||||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
import {getCmsLineListPlatForm, addCmsLinePlatForm, deleteCmsLinePlatForm} from "@/services/area/upline";
|
import {getCmsLineListPlatForm, addCmsLinePlatForm, deleteCmsLinePlatForm} from "@/services/area/upline";
|
||||||
import SubWayEdit from "@/pages/Area/Subway/UpLine/edit";
|
import UpStationEdit from "@/pages/Area/Subway/UpLine/edit";
|
||||||
|
import {getCmsLineSubWay} from "@/services/area/subway";
|
||||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRow) return true;
|
if (!selectedRow) return true;
|
||||||
@@ -32,29 +33,66 @@ function ManagementList() {
|
|||||||
|
|
||||||
const [currentRow, setCurrentRow] = useState<API.AreaPlatForm.Line>()
|
const [currentRow, setCurrentRow] = useState<API.AreaPlatForm.Line>()
|
||||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
const [page, setPage] = useState<API.AreaPlatForm.LineParams>({})
|
||||||
|
|
||||||
|
const getStationInfo = useCallback(async () => {
|
||||||
|
// const resData = await getCmsLineSubWay()
|
||||||
|
}, [])
|
||||||
|
|
||||||
const columns: ProColumns<API.AreaSubWay.Line>[] = [
|
const columns: ProColumns<API.AreaSubWay.Line>[] = [
|
||||||
{
|
{
|
||||||
title: '线路名称',
|
title: '序号',
|
||||||
dataIndex: 'lineName',
|
dataIndex: 'index',
|
||||||
|
valueType: 'index',
|
||||||
|
align: 'center',
|
||||||
|
width: 48,
|
||||||
|
render: (dom, record, index) => {
|
||||||
|
if(page.current && page.pageSize) {
|
||||||
|
return (page.current - 1) * page.pageSize + index + 1
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '线路名称',
|
||||||
|
// dataIndex: 'lineName',
|
||||||
|
// align: 'center',
|
||||||
|
// search: false,
|
||||||
|
// valueType: 'text',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '站点名称',
|
||||||
|
dataIndex: 'stationName',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
render: (dom, record) => <Button type="link" onClick={() => history.push(`/area/updata-router/index/${record.lineId}`)} block>
|
|
||||||
{dom}
|
|
||||||
</Button>
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
width: 300,
|
||||||
render: (_, record) => [
|
render: (_, record) => [
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:business:List.update')}
|
||||||
|
onClick={() => {
|
||||||
|
setModalVisible(true);
|
||||||
|
setCurrentRow(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>,
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
danger
|
danger
|
||||||
key="batchRemove"
|
key="batchRemove"
|
||||||
icon = <DeleteOutlined/>
|
icon ={<DeleteOutlined/>}
|
||||||
hidden={!access.hasPerms('area:subway:list')}
|
hidden={!access.hasPerms('area:subway:List')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -91,7 +129,7 @@ function ManagementList() {
|
|||||||
key="lineIdList"
|
key="lineIdList"
|
||||||
request={(params) => {
|
request={(params) => {
|
||||||
return getCmsLineListPlatForm(params as API.AreaPlatForm.LineParams).then((res) => {
|
return getCmsLineListPlatForm(params as API.AreaPlatForm.LineParams).then((res) => {
|
||||||
console.log(params)
|
setPage(params as API.AreaPlatForm.LineParams)
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -104,7 +142,7 @@ function ManagementList() {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
hidden={!access.hasPerms('manage:list:add')}
|
hidden={!access.hasPerms('manage:List:add')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
@@ -115,9 +153,15 @@ function ManagementList() {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<SubWayEdit
|
<UpStationEdit
|
||||||
open={modalVisible}
|
open={modalVisible}
|
||||||
|
onCancel={() => {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined)
|
||||||
|
}}
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
|
// values.lineId =
|
||||||
|
// values.lineName =
|
||||||
const resData = await addCmsLinePlatForm(values)
|
const resData = await addCmsLinePlatForm(values)
|
||||||
if (resData.code === 200) {
|
if (resData.code === 200) {
|
||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
@@ -128,11 +172,8 @@ function ManagementList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onCancel={() => {
|
values={currentRow}
|
||||||
setModalVisible(false);
|
></UpStationEdit>
|
||||||
setCurrentRow(undefined)
|
|
||||||
}}
|
|
||||||
></SubWayEdit>
|
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,11 @@ import {
|
|||||||
ProFormDateRangePicker,
|
ProFormDateRangePicker,
|
||||||
ProFormSelect,
|
ProFormSelect,
|
||||||
ProFormText,
|
ProFormText,
|
||||||
|
ProFormDigit
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Button, Form, message } from 'antd';
|
import { Button, Form, message } from 'antd';
|
||||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||||
|
import {useEffect} from 'react'
|
||||||
|
|
||||||
export type ListFormProps = {
|
export type ListFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||||
@@ -27,7 +29,17 @@ const waitTime = (time: number = 100) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||||
const [form] = Form.useForm<{ name: string; company: string }>();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.resetFields();
|
||||||
|
if(props.values) {
|
||||||
|
form.setFieldsValue({
|
||||||
|
lineId: props.values.lineId,
|
||||||
|
lineName: props.values.lineName,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [form, props]);
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
props.onCancel();
|
props.onCancel();
|
||||||
@@ -43,7 +55,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
name: string;
|
name: string;
|
||||||
company: string;
|
company: string;
|
||||||
}>
|
}>
|
||||||
title="新增线路"
|
title={`${props.values ? '编辑' : '新增'}线路`}
|
||||||
form={form}
|
form={form}
|
||||||
// layout="inline"
|
// layout="inline"
|
||||||
autoFocusFirstInput
|
autoFocusFirstInput
|
||||||
@@ -55,7 +67,15 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
submitTimeout={2000}
|
submitTimeout={2000}
|
||||||
onFinish={handleFinish}
|
onFinish={handleFinish}
|
||||||
>
|
>
|
||||||
|
<ProFormDigit
|
||||||
|
name="lineId"
|
||||||
|
label={'字典主键'}
|
||||||
|
placeholder="请输入字典主键"
|
||||||
|
disabled
|
||||||
|
hidden={true}
|
||||||
|
/>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
|
|
||||||
<ProFormText
|
<ProFormText
|
||||||
width="xl"
|
width="xl"
|
||||||
name="lineName"
|
name="lineName"
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React, {Fragment, useRef, useState} from "react";
|
|||||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
import {getCmsLineList, addCmsLineSubWay, deleteCmsLineSubWay} from "@/services/area/subway";
|
import {getCmsLineList, addCmsLineSubWay, deleteCmsLineSubWay, putCmsLineSubWay} from "@/services/area/subway";
|
||||||
import SubWayEdit from "@/pages/Area/Subway/edit";
|
import SubWayEdit from "@/pages/Area/Subway/edit";
|
||||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
@@ -39,7 +39,7 @@ function ManagementList() {
|
|||||||
dataIndex: 'lineName',
|
dataIndex: 'lineName',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
render: (dom, record) => <Button type="link" onClick={() => history.push(`/area/updata-router/index/${record.lineId}`)} block>
|
render: (dom, record) => <Button type="link" onClick={() => history.push(`/area/updata-router/index?lineId=${record.lineId}`)} block>
|
||||||
{dom}
|
{dom}
|
||||||
</Button>
|
</Button>
|
||||||
},
|
},
|
||||||
@@ -47,14 +47,28 @@ function ManagementList() {
|
|||||||
title: '操作',
|
title: '操作',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
width: 300,
|
||||||
render: (_, record) => [
|
render: (_, record) => [
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:business:List.update')}
|
||||||
|
onClick={() => {
|
||||||
|
setModalVisible(true);
|
||||||
|
setCurrentRow(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>,
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
danger
|
danger
|
||||||
key="batchRemove"
|
key="batchRemove"
|
||||||
icon = <DeleteOutlined/>
|
icon = <DeleteOutlined/>
|
||||||
hidden={!access.hasPerms('area:subway:list')}
|
hidden={!access.hasPerms('area:subway:List')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -104,7 +118,7 @@ function ManagementList() {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
hidden={!access.hasPerms('manage:list:add')}
|
hidden={!access.hasPerms('manage:List:add')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
@@ -118,11 +132,20 @@ function ManagementList() {
|
|||||||
<SubWayEdit
|
<SubWayEdit
|
||||||
open={modalVisible}
|
open={modalVisible}
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
const resData = await addCmsLineSubWay(values)
|
let resData;
|
||||||
|
if (values.lineId) {
|
||||||
|
resData = await putCmsLineSubWay(values)
|
||||||
|
} else {
|
||||||
|
resData = await addCmsLineSubWay(values)
|
||||||
|
}
|
||||||
if (resData.code === 200) {
|
if (resData.code === 200) {
|
||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
message.success('添加成功')
|
if(values.lineId) {
|
||||||
|
message.success('修改成功')
|
||||||
|
} else {
|
||||||
|
message.success('新增成功')
|
||||||
|
}
|
||||||
if (actionRef.current) {
|
if (actionRef.current) {
|
||||||
actionRef.current.reload();
|
actionRef.current.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
105
src/pages/Company/List/edit.tsx
Normal file
105
src/pages/Company/List/edit.tsx
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
import {useEffect} from 'react'
|
||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormTextArea,
|
||||||
|
ProFormText,
|
||||||
|
ProFormDigit
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Button, Form, message } from 'antd';
|
||||||
|
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||||
|
|
||||||
|
export type ListFormProps = {
|
||||||
|
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||||
|
onSubmit: (values: API.CompanyList.Company) => Promise<void>;
|
||||||
|
open: boolean;
|
||||||
|
values?: Partial<API.CompanyList.Company>;
|
||||||
|
// jobGroupOptions: DictOptionType[];
|
||||||
|
// statusOptions: DictValueEnumObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const waitTime = (time: number = 100) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve(true);
|
||||||
|
}, time);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.resetFields();
|
||||||
|
if(props.values) {
|
||||||
|
form.setFieldsValue(props.values);
|
||||||
|
}
|
||||||
|
}, [form, props]);
|
||||||
|
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
props.onCancel();
|
||||||
|
form.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
|
props.onSubmit(values as API.CompanyList.Company);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalForm<{
|
||||||
|
name: string;
|
||||||
|
company: string;
|
||||||
|
}>
|
||||||
|
title={`${props.values ? '编辑' : '新增'}企业`}
|
||||||
|
form={form}
|
||||||
|
autoFocusFirstInput
|
||||||
|
open={props.open}
|
||||||
|
modalProps={{
|
||||||
|
destroyOnClose: true,
|
||||||
|
onCancel: () => handleCancel(),
|
||||||
|
}}
|
||||||
|
submitTimeout={2000}
|
||||||
|
onFinish={handleFinish}
|
||||||
|
>
|
||||||
|
<ProFormDigit
|
||||||
|
label="InputNumber"
|
||||||
|
name="companyId"
|
||||||
|
disabled
|
||||||
|
hidden={true}
|
||||||
|
/>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="name"
|
||||||
|
label="单位名称"
|
||||||
|
placeholder="请输入单位名称"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="code"
|
||||||
|
label="信用代码"
|
||||||
|
placeholder="请输入信用代码"
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="industry"
|
||||||
|
label="主要行业"
|
||||||
|
placeholder="请输入主要行业"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormTextArea
|
||||||
|
width="xl"
|
||||||
|
name="location"
|
||||||
|
label="单位地点"
|
||||||
|
placeholder="请输入单位地点"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default listEdit
|
||||||
226
src/pages/Company/List/index.tsx
Normal file
226
src/pages/Company/List/index.tsx
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
import React, {Fragment, useRef, useState, useEffect} from "react";
|
||||||
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
|
import {delCmsJobIds, getCmsJobList} from "@/services/Management/list";
|
||||||
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
|
import EditCompanyListRow from './edit'
|
||||||
|
import {
|
||||||
|
addCmsCompanyList,
|
||||||
|
delCmsCompanyList,
|
||||||
|
exportCmsCompanyList,
|
||||||
|
getCmsCompanyList,
|
||||||
|
putCmsCompanyList
|
||||||
|
} from "@/services/company/list";
|
||||||
|
|
||||||
|
const handleRemoveOne = async (jobId: string) => {
|
||||||
|
const hide = message.loading('正在删除');
|
||||||
|
if (!jobId) return true;
|
||||||
|
try {
|
||||||
|
const resp = await delCmsCompanyList(jobId);
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('删除成功,即将刷新');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('删除失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleExport = async (values: API.CompanyList.Params) => {
|
||||||
|
const hide = message.loading('正在导出');
|
||||||
|
try {
|
||||||
|
await exportCmsCompanyList(values);
|
||||||
|
hide();
|
||||||
|
message.success('导出成功');
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('导出失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function ManagementList() {
|
||||||
|
const access = useAccess();
|
||||||
|
|
||||||
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.CompanyList.Company>()
|
||||||
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
const [salaryEnum, setSalaryEnum] = useState<any>([])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// getDictValueEnum('salary', true).then((data) => {
|
||||||
|
// setSalaryEnum(data)
|
||||||
|
// });
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const editSubmit = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const columns: ProColumns<API.CompanyList.Company>[] = [
|
||||||
|
{
|
||||||
|
title: '公司名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '公司行业',
|
||||||
|
dataIndex: 'industry',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '公司规模',
|
||||||
|
dataIndex: 'scale',
|
||||||
|
valueType: 'text',
|
||||||
|
// hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '公司位置',
|
||||||
|
dataIndex: 'location',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'companyId',
|
||||||
|
width: 300,
|
||||||
|
render: (companyId, record) => [
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:business:List.update')}
|
||||||
|
onClick={() => {
|
||||||
|
setModalVisible(true);
|
||||||
|
setCurrentRow(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="batchRemove"
|
||||||
|
icon ={<DeleteOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:subway:List')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '删除',
|
||||||
|
content: '确定删除该项吗?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await handleRemoveOne(companyId as string);
|
||||||
|
if (success) {
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
|
<ProTable<API.CompanyList.Company>
|
||||||
|
// params 是需要自带的参数
|
||||||
|
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formTableRef}
|
||||||
|
rowKey="companyId"
|
||||||
|
key="index"
|
||||||
|
columns={columns}
|
||||||
|
request={(params) =>
|
||||||
|
getCmsCompanyList({ ...params } as API.CompanyList.Params).then((res) => {
|
||||||
|
const result = {
|
||||||
|
data: res.rows,
|
||||||
|
total: res.total,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="add"
|
||||||
|
hidden={!access.hasPerms('manage:List:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="export"
|
||||||
|
hidden={!access.hasPerms('system:user:export')}
|
||||||
|
onClick={async () => {
|
||||||
|
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||||
|
handleExport(searchVal as API.CompanyList.Params);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined />
|
||||||
|
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<EditCompanyListRow
|
||||||
|
open={modalVisible}
|
||||||
|
onSubmit={async (values) => {
|
||||||
|
let resData;
|
||||||
|
if (values.companyId) {
|
||||||
|
resData = await putCmsCompanyList(values)
|
||||||
|
} else {
|
||||||
|
resData = await addCmsCompanyList(values)
|
||||||
|
}
|
||||||
|
if (resData.code === 200) {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
if(values.companyId) {
|
||||||
|
message.success('修改成功')
|
||||||
|
} else {
|
||||||
|
message.success('新增成功')
|
||||||
|
}
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
}}
|
||||||
|
values={currentRow}
|
||||||
|
></EditCompanyListRow>
|
||||||
|
</Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default ManagementList
|
||||||
121
src/pages/Jobfair/List/edit.tsx
Normal file
121
src/pages/Jobfair/List/edit.tsx
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
import {useEffect} from 'react'
|
||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormTextArea,
|
||||||
|
ProFormText,
|
||||||
|
ProFormDigit,
|
||||||
|
ProFormRadio,
|
||||||
|
ProFormDateRangePicker
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Button, Form, message } from 'antd';
|
||||||
|
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||||
|
import { useIntl, FormattedMessage } from '@umijs/max';
|
||||||
|
|
||||||
|
export type ListFormProps = {
|
||||||
|
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||||
|
onSubmit: (values: API.JobFairList.JobFairListRows) => Promise<void>;
|
||||||
|
open: boolean;
|
||||||
|
values?: Partial<API.JobFairList.JobFairListRows>;
|
||||||
|
jobFairType?: DictValueEnumObj;
|
||||||
|
};
|
||||||
|
const waitTime = (time: number = 100) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve(true);
|
||||||
|
}, time);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const intl = useIntl();
|
||||||
|
const { jobFairType } = props;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.resetFields();
|
||||||
|
if(props.values) {
|
||||||
|
form.setFieldsValue({
|
||||||
|
...props.values,
|
||||||
|
createTimeRanger: [props.values.startTime, props.values.endTime],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [form, props]);
|
||||||
|
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
props.onCancel();
|
||||||
|
form.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
|
props.onSubmit(values as API.JobFairList.JobFairListRows);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalForm<{
|
||||||
|
name: string;
|
||||||
|
company: string;
|
||||||
|
}>
|
||||||
|
title={`${props.values ? '编辑' : '新增'}招聘会`}
|
||||||
|
form={form}
|
||||||
|
autoFocusFirstInput
|
||||||
|
open={props.open}
|
||||||
|
modalProps={{
|
||||||
|
destroyOnClose: true,
|
||||||
|
onCancel: () => handleCancel(),
|
||||||
|
}}
|
||||||
|
submitTimeout={2000}
|
||||||
|
onFinish={handleFinish}
|
||||||
|
>
|
||||||
|
<ProFormDigit
|
||||||
|
label="InputNumber"
|
||||||
|
name="jobFairId"
|
||||||
|
disabled
|
||||||
|
hidden={true}
|
||||||
|
/>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="name"
|
||||||
|
label="招聘会名称"
|
||||||
|
placeholder="请输入招聘会名称"
|
||||||
|
/>
|
||||||
|
<ProFormRadio.Group
|
||||||
|
valueEnum={jobFairType}
|
||||||
|
name="jobFairType"
|
||||||
|
label="招聘会类型"
|
||||||
|
colProps={{ md: 24 }}
|
||||||
|
placeholder="请选择招聘会类型"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请选择招聘会类型!" defaultMessage="请选择招聘会类型!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormDateRangePicker
|
||||||
|
transform={(values) => {
|
||||||
|
return {
|
||||||
|
startTime: values ? values[0] : undefined,
|
||||||
|
endTime: values ? values[1] : undefined,
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
width="md"
|
||||||
|
name="createTimeRanger"
|
||||||
|
label="招聘会时间"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormTextArea
|
||||||
|
width="xl"
|
||||||
|
name="location"
|
||||||
|
label="招聘会地点"
|
||||||
|
placeholder="请输入招聘会地点"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default listEdit
|
||||||
226
src/pages/Jobfair/List/index.tsx
Normal file
226
src/pages/Jobfair/List/index.tsx
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
import React, {Fragment, useRef, useState, useEffect} from "react";
|
||||||
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
|
import {delCmsJobIds, getCmsJobList} from "@/services/Management/list";
|
||||||
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
|
import EditCompanyListRow from './edit'
|
||||||
|
import {
|
||||||
|
addCmsFairList,
|
||||||
|
delCmsFairList,
|
||||||
|
exportCmsFairList,
|
||||||
|
getCmsFairList,
|
||||||
|
putCmsFairList
|
||||||
|
} from "@/services/jobfair/list";
|
||||||
|
import {getDictValueEnum} from "@/services/system/dict";
|
||||||
|
import DictTag from "@/components/DictTag";
|
||||||
|
|
||||||
|
const handleRemoveOne = async (jobFairId: string) => {
|
||||||
|
const hide = message.loading('正在删除');
|
||||||
|
if (!jobFairId) return true;
|
||||||
|
try {
|
||||||
|
const resp = await delCmsFairList(jobFairId);
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('删除成功,即将刷新');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('删除失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleExport = async (values: API.JobFairList.Params) => {
|
||||||
|
const hide = message.loading('正在导出');
|
||||||
|
try {
|
||||||
|
await exportCmsFairList(values);
|
||||||
|
hide();
|
||||||
|
message.success('导出成功');
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('导出失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function ManagementList() {
|
||||||
|
const access = useAccess();
|
||||||
|
|
||||||
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.JobFairList.JobFairListRows>()
|
||||||
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
const [jobFairType, setJobFairTypeEnum] = useState<any>([])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getDictValueEnum('job_fair_type', true).then((data) => {
|
||||||
|
setJobFairTypeEnum(data)
|
||||||
|
});
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const editSubmit = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const columns: ProColumns<API.JobFairList.JobFairListRows>[] = [
|
||||||
|
{
|
||||||
|
title: '招聘会名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'jobFairType',
|
||||||
|
valueType: 'select',
|
||||||
|
align: 'center',
|
||||||
|
valueEnum: jobFairType,
|
||||||
|
render: (_, record) => {
|
||||||
|
return (<DictTag enums={jobFairType} value={record.jobFairType} />);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '位置',
|
||||||
|
dataIndex: 'location',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'jobFairId',
|
||||||
|
width: 300,
|
||||||
|
render: (jobFairId, record) => [
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:business:List.update')}
|
||||||
|
onClick={() => {
|
||||||
|
setModalVisible(true);
|
||||||
|
setCurrentRow(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="batchRemove"
|
||||||
|
icon ={<DeleteOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:subway:List')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '删除',
|
||||||
|
content: '确定删除该项吗?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await handleRemoveOne(jobFairId as string);
|
||||||
|
if (success) {
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
|
<ProTable<API.JobFairList.JobFairListRows>
|
||||||
|
// params 是需要自带的参数
|
||||||
|
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formTableRef}
|
||||||
|
rowKey="companyId"
|
||||||
|
key="index"
|
||||||
|
columns={columns}
|
||||||
|
request={(params) =>
|
||||||
|
getCmsFairList({ ...params } as API.JobFairList.Params).then((res) => {
|
||||||
|
const result = {
|
||||||
|
data: res.rows,
|
||||||
|
total: res.total,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="add"
|
||||||
|
hidden={!access.hasPerms('manage:List:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="export"
|
||||||
|
hidden={!access.hasPerms('system:user:export')}
|
||||||
|
onClick={async () => {
|
||||||
|
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||||
|
handleExport(searchVal as API.JobFairList.Params);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined />
|
||||||
|
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<EditCompanyListRow
|
||||||
|
open={modalVisible}
|
||||||
|
onSubmit={async (values) => {
|
||||||
|
let resData;
|
||||||
|
if (values.jobFairId) {
|
||||||
|
resData = await putCmsFairList(values)
|
||||||
|
} else {
|
||||||
|
resData = await addCmsFairList(values)
|
||||||
|
}
|
||||||
|
if (resData.code === 200) {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
if(values.jobFairId) {
|
||||||
|
message.success('修改成功')
|
||||||
|
} else {
|
||||||
|
message.success('新增成功')
|
||||||
|
}
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
}}
|
||||||
|
jobFairType={jobFairType || {}}
|
||||||
|
values={currentRow}
|
||||||
|
></EditCompanyListRow>
|
||||||
|
</Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default ManagementList
|
||||||
@@ -9,6 +9,7 @@ import { getOperlogList, removeOperlog, addOperlog, updateOperlog, exportOperlog
|
|||||||
import UpdateForm from './detail';
|
import UpdateForm from './detail';
|
||||||
import { getDictValueEnum } from '@/services/system/dict';
|
import { getDictValueEnum } from '@/services/system/dict';
|
||||||
import DictTag from '@/components/DictTag';
|
import DictTag from '@/components/DictTag';
|
||||||
|
import {authUserSelectAll} from "@/services/system/role";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加节点
|
* 添加节点
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
|||||||
|
|
||||||
export type ListFormProps = {
|
export type ListFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||||
onSubmit: (values: API.Management.Manage) => Promise<void>;
|
onSubmit: (values: API.ManagementList.Manage) => Promise<void>;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
// values: Partial<API.Management.Manage>;
|
// values: Partial<API.Management.Manage>;
|
||||||
// jobGroupOptions: DictOptionType[];
|
// jobGroupOptions: DictOptionType[];
|
||||||
@@ -35,7 +35,7 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleFinish = async (values: Record<string, any>) => {
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
props.onSubmit(values as API.Management.Manage);
|
props.onSubmit(values as API.ManagementList.Manage);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -57,65 +57,67 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
width="md"
|
width="md"
|
||||||
name="jobName"
|
name="jobTitle"
|
||||||
label="岗位名称"
|
label="岗位名称"
|
||||||
placeholder="请输入名称"
|
placeholder="请输入名称"
|
||||||
/>
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
width="md"
|
width="md"
|
||||||
name="company"
|
name="minSalary"
|
||||||
label="我方公司名称"
|
label="最小薪资"
|
||||||
placeholder="请输入名称"
|
placeholder="请输入最小薪资(元)"
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="maxSalary"
|
||||||
|
label="最大薪资"
|
||||||
|
placeholder="请输入最大薪资(元)"
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
width="md"
|
width="md"
|
||||||
name="contract"
|
name="education"
|
||||||
label="合同名称"
|
label="学历要求"
|
||||||
placeholder="请输入名称"
|
placeholder="请输入学历要求"
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="experience"
|
||||||
|
label="工作经验"
|
||||||
|
placeholder="请输入工作经验"
|
||||||
/>
|
/>
|
||||||
<ProFormDateRangePicker name="contractTime" label="合同生效时间" />
|
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormSelect
|
<ProFormText
|
||||||
request={async () => [
|
width="md"
|
||||||
{
|
name="companyName"
|
||||||
value: 'chapter',
|
label="单位名称"
|
||||||
label: '盖章后生效',
|
placeholder="请输入单位名称"
|
||||||
},
|
|
||||||
]}
|
|
||||||
width="xs"
|
|
||||||
name="useMode"
|
|
||||||
label="合同约定生效方式"
|
|
||||||
/>
|
/>
|
||||||
<ProFormSelect
|
<ProFormText
|
||||||
width="xs"
|
width="md"
|
||||||
options={[
|
name="jobLocation"
|
||||||
{
|
label="工作地点"
|
||||||
value: 'time',
|
placeholder="请输入工作地点"
|
||||||
label: '履行完终止',
|
/>
|
||||||
},
|
</ProForm.Group>
|
||||||
]}
|
<ProForm.Group>
|
||||||
name="unusedMode"
|
<ProFormText
|
||||||
label="合同约定失效效方式"
|
width="md"
|
||||||
|
name="vacancies"
|
||||||
|
label="招聘人数"
|
||||||
|
placeholder="请输入招聘人数"
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="jobLocation"
|
||||||
|
label="工作地点"
|
||||||
|
placeholder="请输入工作地点"
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
<ProFormText width="sm" name="id" label="主合同编号" />
|
|
||||||
<ProFormText
|
|
||||||
name="project"
|
|
||||||
disabled
|
|
||||||
label="项目名称"
|
|
||||||
initialValue="xxxx项目"
|
|
||||||
/>
|
|
||||||
<ProFormText
|
|
||||||
width="xs"
|
|
||||||
name="mangerName"
|
|
||||||
disabled
|
|
||||||
label="商务经理"
|
|
||||||
initialValue="启途"
|
|
||||||
/>
|
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,38 +1,191 @@
|
|||||||
import React, {Fragment, useRef, useState} from "react";
|
import React, {Fragment, useRef, useState, useEffect} from "react";
|
||||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
import {getCmsJobList} from "@/services/Management/list";
|
import {delCmsJobIds, getCmsJobList} from "@/services/Management/list";
|
||||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
import EditManageRow from './edit'
|
import EditManageRow from './edit'
|
||||||
|
import {getDictValueEnum} from "@/services/system/dict";
|
||||||
|
import DictTag from "@/components/DictTag";
|
||||||
|
|
||||||
|
const handleRemoveOne = async (jobId: string) => {
|
||||||
|
const hide = message.loading('正在删除');
|
||||||
|
if (!jobId) return true;
|
||||||
|
try {
|
||||||
|
const resp = await delCmsJobIds(jobId);
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('删除成功,即将刷新');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('删除失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function ManagementList() {
|
function ManagementList() {
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
|
|
||||||
const formTableRef = useRef<FormInstance>();
|
const formTableRef = useRef<FormInstance>();
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
const [currentRow, setCurrentRow] = useState<API.Management.Manage>()
|
const [educationEnum, setEducationEnum] = useState<any>([])
|
||||||
|
const [experienceEnum, setExperienceEnum] = useState<any>([])
|
||||||
|
const [hotEnum, setHotEnum] = useState<any>([])
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>()
|
||||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
|
||||||
const columns: ProColumns<API.Management.Manage>[] = [
|
useEffect(() => {
|
||||||
|
getDictValueEnum('education',true).then((data) => {
|
||||||
|
setEducationEnum(data)
|
||||||
|
})
|
||||||
|
getDictValueEnum('experience',true).then((data) => {
|
||||||
|
setExperienceEnum(data)
|
||||||
|
})
|
||||||
|
// getDictValueEnum('job_hot',true).then((data) => {
|
||||||
|
// setHotEnum(data)
|
||||||
|
// })
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const columns: ProColumns<API.ManagementList.Manage>[] = [
|
||||||
{
|
{
|
||||||
title: '任务编号',
|
title: '岗位名称',
|
||||||
dataIndex: 'jobId',
|
dataIndex: 'jobTitle',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
},{
|
||||||
|
title: '最大最小薪资',
|
||||||
|
dataIndex: 'maxSalary',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
render: (_, record) => <>{record.minSalary}-{record.maxSalary}</>
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '单位名称',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '学历要求',
|
||||||
|
dataIndex: 'education',
|
||||||
|
valueType: 'select',
|
||||||
|
align: 'center',
|
||||||
|
valueEnum: educationEnum,
|
||||||
|
render: (_, record) => {
|
||||||
|
return (<DictTag enums={educationEnum} value={record.education} />);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '经验要求',
|
||||||
|
dataIndex: 'experience',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'select',
|
||||||
|
align: 'center',
|
||||||
|
valueEnum: experienceEnum,
|
||||||
|
render: (_, record) => {
|
||||||
|
return (<DictTag enums={experienceEnum} value={record.experience} />);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '是否热门',
|
||||||
|
// dataIndex: 'isHot',
|
||||||
|
// valueType: 'select',
|
||||||
|
// align: 'center',
|
||||||
|
// valueEnum: hotEnum,
|
||||||
|
// render: (_, record) => {
|
||||||
|
// return (<DictTag enums={hotEnum} value={record.isHot} />);
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '发布时间',
|
||||||
|
dataIndex: 'postingDate',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '招聘人数',
|
||||||
|
dataIndex: 'vacancies',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '浏览量',
|
||||||
|
dataIndex: 'view',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'jobId',
|
||||||
|
width: 300,
|
||||||
|
render: (jobId, record) => [
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:business:List.update')}
|
||||||
|
onClick={() => {
|
||||||
|
setModalVisible(true);
|
||||||
|
setCurrentRow(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="batchRemove"
|
||||||
|
icon ={<DeleteOutlined/>}
|
||||||
|
hidden={!access.hasPerms('area:subway:List')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '删除',
|
||||||
|
content: '确定删除该项吗?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await handleRemoveOne(jobId as string);
|
||||||
|
if (success) {
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div style={{ width: '100%', float: 'right' }}>
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
<ProTable<API.Management.Manage>
|
<ProTable<API.ManagementList.Manage>
|
||||||
// params 是需要自带的参数
|
// params 是需要自带的参数
|
||||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
formRef={formTableRef}
|
formRef={formTableRef}
|
||||||
|
rowKey="jobId"
|
||||||
|
key="index"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getCmsJobList({ ...params } as API.Management.ListParams).then((res) => {
|
getCmsJobList({ ...params } as API.ManagementList.ListParams).then((res) => {
|
||||||
|
console.log(params)
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -45,7 +198,7 @@ function ManagementList() {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
hidden={!access.hasPerms('manage:list:add')}
|
hidden={!access.hasPerms('manage:List:add')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export type JobFormProps = {
|
|||||||
const JobForm: React.FC<JobFormProps> = (props) => {
|
const JobForm: React.FC<JobFormProps> = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { jobGroupOptions, statusOptions } = props;
|
const { jobGroupOptions, statusOptions } = props;
|
||||||
|
console.log(jobGroupOptions)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ const JobTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon = <EditOutlined />
|
icon = {<EditOutlined />}
|
||||||
hidden={!access.hasPerms('monitor:job:edit.tsx')}
|
hidden={!access.hasPerms('monitor:job:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
@@ -230,7 +230,7 @@ const JobTableList: React.FC = () => {
|
|||||||
size="small"
|
size="small"
|
||||||
danger
|
danger
|
||||||
key="batchRemove"
|
key="batchRemove"
|
||||||
icon = <DeleteOutlined />
|
icon ={<DeleteOutlined />}
|
||||||
hidden={!access.hasPerms('monitor:job:remove')}
|
hidden={!access.hasPerms('monitor:job:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ const ConfigTableList: React.FC = () => {
|
|||||||
title: <FormattedMessage id="system.config.config_value" defaultMessage="参数键值" />,
|
title: <FormattedMessage id="system.config.config_value" defaultMessage="参数键值" />,
|
||||||
dataIndex: 'configValue',
|
dataIndex: 'configValue',
|
||||||
valueType: 'textarea',
|
valueType: 'textarea',
|
||||||
|
render: (dom) => <span style={{ wordWrap: 'break-word', wordBreak: 'break-word' }}>{dom || '--'}</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="system.config.config_type" defaultMessage="系统内置" />,
|
title: <FormattedMessage id="system.config.config_type" defaultMessage="系统内置" />,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { DataNode } from 'antd/es/tree';
|
|||||||
import { createIcon } from '@/utils/IconUtil';
|
import { createIcon } from '@/utils/IconUtil';
|
||||||
import { DictValueEnumObj } from '@/components/DictTag';
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
import IconSelector from '@/components/IconSelector';
|
import IconSelector from '@/components/IconSelector';
|
||||||
|
import {isEmptyObject} from '@/utils/tools'
|
||||||
|
|
||||||
export type MenuFormData = Record<string, unknown> & Partial<API.System.Menu>;
|
export type MenuFormData = Record<string, unknown> & Partial<API.System.Menu>;
|
||||||
|
|
||||||
@@ -39,27 +40,29 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
setMenuIconName(props.values.icon);
|
setMenuIconName(props.values.icon);
|
||||||
form.setFieldsValue({
|
if(!isEmptyObject(props.values)) {
|
||||||
menuId: props.values.menuId,
|
form.setFieldsValue({
|
||||||
menuName: props.values.menuName,
|
menuId: props.values.menuId,
|
||||||
parentId: props.values.parentId,
|
menuName: props.values.menuName,
|
||||||
orderNum: props.values.orderNum,
|
parentId: props.values.parentId,
|
||||||
path: props.values.path,
|
orderNum: props.values.orderNum,
|
||||||
component: props.values.component,
|
path: props.values.path,
|
||||||
query: props.values.query,
|
component: props.values.component,
|
||||||
isFrame: props.values.isFrame,
|
query: props.values.query,
|
||||||
isCache: props.values.isCache,
|
isFrame: props.values.isFrame,
|
||||||
menuType: props.values.menuType,
|
isCache: props.values.isCache,
|
||||||
visible: props.values.visible,
|
menuType: props.values.menuType,
|
||||||
status: props.values.status,
|
visible: props.values.visible,
|
||||||
perms: props.values.perms,
|
status: props.values.status,
|
||||||
icon: props.values.icon,
|
perms: props.values.perms,
|
||||||
createBy: props.values.createBy,
|
icon: props.values.icon,
|
||||||
createTime: props.values.createTime,
|
createBy: props.values.createBy,
|
||||||
updateBy: props.values.updateBy,
|
createTime: props.values.createTime,
|
||||||
updateTime: props.values.updateTime,
|
updateBy: props.values.updateBy,
|
||||||
remark: props.values.remark,
|
updateTime: props.values.updateTime,
|
||||||
});
|
remark: props.values.remark,
|
||||||
|
});
|
||||||
|
}
|
||||||
}, [form, props]);
|
}, [form, props]);
|
||||||
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
@@ -90,6 +93,15 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
|
|||||||
form={form}
|
form={form}
|
||||||
grid={true}
|
grid={true}
|
||||||
submitter={false}
|
submitter={false}
|
||||||
|
initialValues={{
|
||||||
|
isFrame: 1,
|
||||||
|
status: '0',
|
||||||
|
parentId: 0,
|
||||||
|
menuType: 'M',
|
||||||
|
isCache: 0,
|
||||||
|
visible: '0',
|
||||||
|
orderNum: 1
|
||||||
|
}}
|
||||||
layout="horizontal"
|
layout="horizontal"
|
||||||
onFinish={handleFinish}>
|
onFinish={handleFinish}>
|
||||||
<ProFormDigit
|
<ProFormDigit
|
||||||
@@ -202,7 +214,7 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
|
|||||||
placeholder="请输入显示顺序"
|
placeholder="请输入显示顺序"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: true,
|
||||||
message: <FormattedMessage id="请输入显示顺序!" defaultMessage="请输入显示顺序!" />,
|
message: <FormattedMessage id="请输入显示顺序!" defaultMessage="请输入显示顺序!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Checkbox, Col, Form, Modal, Row, Tree } from 'antd';
|
|||||||
import { FormattedMessage, useIntl } from '@umijs/max';
|
import { FormattedMessage, useIntl } from '@umijs/max';
|
||||||
import { Key, ProForm, ProFormDigit, ProFormSelect, ProFormText } from '@ant-design/pro-components';
|
import { Key, ProForm, ProFormDigit, ProFormSelect, ProFormText } from '@ant-design/pro-components';
|
||||||
import { DataNode } from 'antd/es/tree';
|
import { DataNode } from 'antd/es/tree';
|
||||||
import { CheckboxValueType } from 'antd/es/checkbox/Group';
|
import type { GetProp } from 'antd';
|
||||||
|
|
||||||
/* *
|
/* *
|
||||||
*
|
*
|
||||||
@@ -53,7 +53,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
|||||||
props.onCancel();
|
props.onCancel();
|
||||||
};
|
};
|
||||||
const handleFinish = async (values: Record<string, any>) => {
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
props.onSubmit({ ...values, deptIds } as FormValueType);
|
await props.onSubmit({ ...values, deptIds } as FormValueType);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAllDeptNode = (node: DataNode[]) => {
|
const getAllDeptNode = (node: DataNode[]) => {
|
||||||
@@ -70,7 +70,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
|||||||
const deptAllNodes = getAllDeptNode(deptTree);
|
const deptAllNodes = getAllDeptNode(deptTree);
|
||||||
|
|
||||||
|
|
||||||
const onDeptOptionChange = (checkedValues: CheckboxValueType[]) => {
|
const onDeptOptionChange: GetProp<typeof Checkbox.Group, 'onChange'> = (checkedValues) => {
|
||||||
if(checkedValues.includes('deptExpand')) {
|
if(checkedValues.includes('deptExpand')) {
|
||||||
setDeptTreeExpandKey(deptAllNodes);
|
setDeptTreeExpandKey(deptAllNodes);
|
||||||
} else {
|
} else {
|
||||||
@@ -179,7 +179,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
|||||||
]}
|
]}
|
||||||
fieldProps={{
|
fieldProps={{
|
||||||
onChange: (value) => {
|
onChange: (value) => {
|
||||||
setDataScopeType(value);
|
setDataScopeType(value as string);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ const UserTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon=<EditOutlined />
|
icon={<EditOutlined />}
|
||||||
hidden={!access.hasPerms('system:user:edit.tsx')}
|
hidden={!access.hasPerms('system:user:edit.tsx')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
fetchUserInfo(record.userId);
|
fetchUserInfo(record.userId);
|
||||||
@@ -270,7 +270,7 @@ const UserTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
danger
|
danger
|
||||||
icon=<DeleteOutlined />
|
icon={<DeleteOutlined />}
|
||||||
key="batchRemove"
|
key="batchRemove"
|
||||||
hidden={!access.hasPerms('system:user:remove')}
|
hidden={!access.hasPerms('system:user:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import Settings from '../../../../config/defaultSettings';
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { flushSync } from 'react-dom';
|
import { flushSync } from 'react-dom';
|
||||||
import { clearSessionToken, setSessionToken } from '@/access';
|
import { clearSessionToken, setSessionToken } from '@/access';
|
||||||
|
import {getRoutersInfo, setRemoteMenu} from "@/services/session";
|
||||||
|
import logoImg from '@/assets/logo.svg'
|
||||||
|
|
||||||
const ActionIcons = () => {
|
const ActionIcons = () => {
|
||||||
const langClassName = useEmotionCss(({ token }) => {
|
const langClassName = useEmotionCss(({ token }) => {
|
||||||
@@ -141,6 +143,7 @@ const Login: React.FC = () => {
|
|||||||
console.log('login ok');
|
console.log('login ok');
|
||||||
const urlParams = new URL(window.location.href).searchParams;
|
const urlParams = new URL(window.location.href).searchParams;
|
||||||
history.push(urlParams.get('redirect') || '/');
|
history.push(urlParams.get('redirect') || '/');
|
||||||
|
setTimeout(() => history.go(0), 0)
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
message.error(response.msg);
|
message.error(response.msg);
|
||||||
@@ -189,7 +192,7 @@ const Login: React.FC = () => {
|
|||||||
minWidth: 280,
|
minWidth: 280,
|
||||||
maxWidth: '75vw',
|
maxWidth: '75vw',
|
||||||
}}
|
}}
|
||||||
logo={<img alt="logo" src="/logo.svg" />}
|
logo={<img alt="logo" src={logoImg} />}
|
||||||
title="青岛智慧就业服务系统"
|
title="青岛智慧就业服务系统"
|
||||||
// subTitle={intl.formatMessage({ id: 'pages.layouts.userLayout.title' })}
|
// subTitle={intl.formatMessage({ id: 'pages.layouts.userLayout.title' })}
|
||||||
initialValues={{
|
initialValues={{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ workbox.core.setCacheNameDetails({
|
|||||||
workbox.clientsClaim();
|
workbox.clientsClaim();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use precaching list generated by workbox in build process.
|
* Use precaching List generated by workbox in build process.
|
||||||
* https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching
|
* https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching
|
||||||
*/
|
*/
|
||||||
workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
|
workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
import { request } from '@umijs/max';
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
export async function getCmsJobList(params?: API.Management.ListParams) {
|
export async function getCmsJobList(params?: API.ManagementList.ListParams) {
|
||||||
return request<API.Management.ManagePageResult>(`/api/cms/job/list`, {
|
return request<API.ManagementList.ManagePageResult>(`/api/cms/job/list`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getCmsJobIds(ids: string) {
|
export async function getCmsJobIds(ids: string) {
|
||||||
return request<API.Management.ManagePageResult>(`/api/cms/job/${ids}`, {
|
return request<API.ManagementList.ManagePageResult>(`/api/cms/job/${ids}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function delCmsJobIds(ids: string) {
|
||||||
|
return request<API.ManagementList.ManagePageResult>(`/api/cms/job/${ids}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,3 +27,9 @@ export async function deleteCmsAreaListRow(ids: number) {
|
|||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export async function exportCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) {
|
||||||
|
return request<API.AreaPlatForm.LinePageResult>(`/api/cms/area/export`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,11 +16,24 @@ export async function addCmsLineSubWay(params?: API.AreaSubWay.AddLineParams) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function putCmsLineSubWay(params?: API.AreaSubWay.AddLineParams) {
|
||||||
|
return request<API.AreaSubWay.LinePageResult>(`/api/cms/line`, {
|
||||||
|
method: 'put',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function deleteCmsLineSubWay(ids: number) {
|
export async function deleteCmsLineSubWay(ids: number) {
|
||||||
return request<API.AreaSubWay.LinePageResult>(`/api/cms/line/${ids}`, {
|
return request<API.AreaSubWay.LinePageResult>(`/api/cms/line/${ids}`, {
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getCmsLineSubWay(ids: number) {
|
||||||
|
return request<API.AreaSubWay.LinePageResult>(`/api/cms/line/${ids}`, {
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ export async function addCmsLinePlatForm(params?: API.AreaPlatForm.AddLineParams
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function putCmsLinePlatForm(params?: API.AreaPlatForm.AddLineParams) {
|
||||||
|
return request<API.AreaPlatForm.LinePageResult>(`/api/cms/station`, {
|
||||||
|
method: 'put',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function deleteCmsLinePlatForm(ids: number) {
|
export async function deleteCmsLinePlatForm(ids: number) {
|
||||||
return request<API.AreaPlatForm.LinePageResult>(`/api/cms/station/${ids}`, {
|
return request<API.AreaPlatForm.LinePageResult>(`/api/cms/station/${ids}`, {
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
|
|||||||
35
src/services/company/list.ts
Normal file
35
src/services/company/list.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
|
export async function getCmsCompanyList(params?: API.CompanyList.Params) {
|
||||||
|
return request<API.CompanyList.CompanyListResult>(`/api/cms/company/list`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function delCmsCompanyList(companyIds?: string) {
|
||||||
|
return request<API.CompanyList.CompanyListResult>(`/api/cms/company/${companyIds}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function addCmsCompanyList(params?: API.CompanyList.Params) {
|
||||||
|
return request<API.CompanyList.CompanyListResult>(`/api/cms/company`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function putCmsCompanyList(params?: API.CompanyList.Params) {
|
||||||
|
return request<API.CompanyList.CompanyListResult>(`/api/cms/company`, {
|
||||||
|
method: 'PUT',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function exportCmsCompanyList(params?: API.CompanyList.Params) {
|
||||||
|
return request<API.CompanyList.CompanyListResult>(`/cms/company/export`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
33
src/services/jobfair/list.ts
Normal file
33
src/services/jobfair/list.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
|
export async function getCmsFairList(params?: API.JobFairList.Params) {
|
||||||
|
return request<API.JobFairList.JobFairListResult>(`/api/app/fair/list`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function addCmsFairList(params?: API.JobFairList.JobFairListRows) {
|
||||||
|
return request<API.JobFairList.JobFairListResult>(`/api/app/fair`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function putCmsFairList(params?: API.JobFairList.Params) {
|
||||||
|
return request<API.JobFairList.JobFairListResult>(`/api/app/fair`, {
|
||||||
|
method: 'PUT',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function delCmsFairList(ids?: string) {
|
||||||
|
return request<API.JobFairList.JobFairListResult>(`/api/app/fair${ids}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function exportCmsFairList(ids?: API.JobFairList.Params) {
|
||||||
|
return request<API.JobFairList.JobFairListResult>(`/api/app/fair/export`, {
|
||||||
|
method: 'POST',
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -55,7 +55,7 @@ export async function deleteUser(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates list of users with given input array POST /user/createWithArray */
|
/** Creates List of users with given input array POST /user/createWithArray */
|
||||||
export async function createUsersWithArrayInput(
|
export async function createUsersWithArrayInput(
|
||||||
body: API.User[],
|
body: API.User[],
|
||||||
options?: { [key: string]: any },
|
options?: { [key: string]: any },
|
||||||
@@ -67,7 +67,7 @@ export async function createUsersWithArrayInput(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates list of users with given input array POST /user/createWithList */
|
/** Creates List of users with given input array POST /user/createWithList */
|
||||||
export async function createUsersWithListInput(body: API.User[], options?: { [key: string]: any }) {
|
export async function createUsersWithListInput(body: API.User[], options?: { [key: string]: any }) {
|
||||||
return request<any>('/user/createWithList', {
|
return request<any>('/user/createWithList', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
6
src/types/Management/list.d.ts
vendored
6
src/types/Management/list.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
declare namespace API.Management {
|
declare namespace API.ManagementList {
|
||||||
export interface Manage {
|
export interface Manage {
|
||||||
applyNum: number;
|
applyNum: number;
|
||||||
companyId: number;
|
companyId: number;
|
||||||
@@ -25,8 +25,8 @@ declare namespace API.Management {
|
|||||||
createTime?: string;
|
createTime?: string;
|
||||||
updateTime?: string;
|
updateTime?: string;
|
||||||
remark?: string;
|
remark?: string;
|
||||||
pageSize?: string;
|
pageSize?: number;
|
||||||
current?: string;
|
current?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ManagePageResult {
|
export interface ManagePageResult {
|
||||||
|
|||||||
6
src/types/area/upline.d.ts
vendored
6
src/types/area/upline.d.ts
vendored
@@ -15,11 +15,11 @@ declare namespace API.AreaPlatForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface LineParams {
|
export interface LineParams {
|
||||||
lineId: number;
|
lineId?: number;
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
updateTime?: string;
|
updateTime?: string;
|
||||||
pageSize?: string;
|
pageSize?: number;
|
||||||
current?: string;
|
current?: nnumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AddLineParams {
|
export interface AddLineParams {
|
||||||
|
|||||||
27
src/types/company/list.d.ts
vendored
Normal file
27
src/types/company/list.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
declare namespace API.CompanyList {
|
||||||
|
export interface CompanyListResult {
|
||||||
|
total: number;
|
||||||
|
rows: RootObjectRows[];
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
}
|
||||||
|
export interface Company {
|
||||||
|
createTime: string;
|
||||||
|
companyId: number;
|
||||||
|
name: string;
|
||||||
|
location?: any;
|
||||||
|
industry: string;
|
||||||
|
scale: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
export interface Params {
|
||||||
|
createTime?: string;
|
||||||
|
companyId?: number;
|
||||||
|
name?: string;
|
||||||
|
location?: any;
|
||||||
|
industry?: string;
|
||||||
|
scale?: string;
|
||||||
|
code?: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/types/jobfair/list.d.ts
vendored
Normal file
33
src/types/jobfair/list.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
declare namespace API.JobFairList {
|
||||||
|
export interface JobFairListResult {
|
||||||
|
total: number;
|
||||||
|
rows: RootObjectRows[];
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
}
|
||||||
|
export interface JobFairListRows {
|
||||||
|
createTime?: any;
|
||||||
|
jobFairId: number;
|
||||||
|
name: string;
|
||||||
|
jobFairType: string;
|
||||||
|
location: string;
|
||||||
|
latitude?: any;
|
||||||
|
longitude?: any;
|
||||||
|
startTime: string;
|
||||||
|
endTime: string;
|
||||||
|
companyList?: any;
|
||||||
|
}
|
||||||
|
export interface Params {
|
||||||
|
createTime?: any;
|
||||||
|
jobFairId: number;
|
||||||
|
name: string;
|
||||||
|
jobFairType: string;
|
||||||
|
location: string;
|
||||||
|
latitude?: any;
|
||||||
|
longitude?: any;
|
||||||
|
startTime: string;
|
||||||
|
endTime: string;
|
||||||
|
companyList?: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
10
src/utils/tools.ts
Normal file
10
src/utils/tools.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export function isEmptyObject(obj: any) {
|
||||||
|
return obj && Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getYear(date = new Date()) {
|
||||||
|
if (!(date instanceof Date)) {
|
||||||
|
throw new TypeError('Invalid date object');
|
||||||
|
}
|
||||||
|
return date.getFullYear();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user