flat: 暂存
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -8,6 +8,7 @@ _roadhog-api-doc
|
||||
|
||||
# production
|
||||
/dist
|
||||
/qingdao
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
@@ -40,4 +41,4 @@ screenshot
|
||||
|
||||
build
|
||||
|
||||
pnpm-lock.yaml
|
||||
pnpm-lock.yaml
|
||||
|
||||
@@ -125,7 +125,7 @@ export default defineConfig({
|
||||
*/
|
||||
headScripts: [
|
||||
// 解决首次加载时白屏的问题
|
||||
{ src: '/scripts/loading.js', async: true },
|
||||
{ src: '/qingdao/scripts/loading.js', async: true },
|
||||
],
|
||||
//================ pro 插件配置 =================
|
||||
presets: ['umi-presets-pro'],
|
||||
@@ -151,6 +151,9 @@ export default defineConfig({
|
||||
mfsu: {
|
||||
strategy: 'normal',
|
||||
},
|
||||
outputPath: 'qingdao',
|
||||
base: '/qingdao/',
|
||||
publicPath: '/qingdao/',
|
||||
esbuildMinifyIIFE: true,
|
||||
requestRecord: {},
|
||||
});
|
||||
|
||||
@@ -52,7 +52,7 @@ export default [
|
||||
routes: [
|
||||
{
|
||||
name: '字典数据',
|
||||
path: '/area/updata-router/index/:id',
|
||||
path: '/area/updata-router/index',
|
||||
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 { stringify } from 'querystring';
|
||||
import { message } from 'antd'
|
||||
import { createRef } from 'react';
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
const loginOut = async () => {
|
||||
await logout();
|
||||
clearSessionToken();
|
||||
setRemoteMenu(null);
|
||||
const { search, pathname } = window.location;
|
||||
@@ -24,11 +23,12 @@ const loginOut = async () => {
|
||||
/** 此方法会跳转到 redirect 参数所在的位置 */
|
||||
const redirect = urlParams.get('redirect');
|
||||
// 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({
|
||||
pathname: '/user/login',
|
||||
search: stringify({
|
||||
redirect: pathname + search,
|
||||
redirect: pathname.replace('/qingdao', '') + search,
|
||||
}),
|
||||
});
|
||||
}
|
||||
@@ -79,9 +79,9 @@ export async function getInitialState(): Promise<{
|
||||
settings: defaultSettings as Partial<LayoutSettings>,
|
||||
};
|
||||
}
|
||||
|
||||
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|
||||
export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => {
|
||||
|
||||
return {
|
||||
// actionsRender: () => [<Question key="doc" />, <SelectLang key="SelectLang" />],
|
||||
actionsRender: () => [ <SelectLang key="SelectLang" />],
|
||||
@@ -95,9 +95,10 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
||||
waterMarkProps: {
|
||||
// content: initialState?.currentUser?.nickName,
|
||||
},
|
||||
// actionRef: layoutActionRef,
|
||||
menu: {
|
||||
locale: false,
|
||||
// 每当 initialState?.currentUser?.userid 发生修改时重新执行 request
|
||||
// // 每当 initialState?.currentUser?.userid 发生修改时重新执行 request
|
||||
params: {
|
||||
userId: initialState?.currentUser?.userId,
|
||||
},
|
||||
@@ -105,7 +106,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
||||
if (!initialState?.currentUser?.userId) {
|
||||
return [];
|
||||
}
|
||||
return getRemoteMenu();
|
||||
return getRemoteMenu()
|
||||
},
|
||||
},
|
||||
footerRender: () => <Footer />,
|
||||
@@ -176,7 +177,7 @@ export async function onRouteChange({ clientRoutes, location }) {
|
||||
// console.log('onRouteChange', clientRoutes, location, menus);
|
||||
if(menus === null && location.pathname !== PageEnum.LOGIN) {
|
||||
console.log('refresh')
|
||||
history.go(0);
|
||||
// history.go(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,13 +192,15 @@ export async function patchClientRoutes({ routes }) {
|
||||
}
|
||||
|
||||
export async function render(oldRender: () => void) {
|
||||
// console.log('render get routers', oldRender)
|
||||
console.log('render get routers', oldRender)
|
||||
const token = getAccessToken();
|
||||
if(!token || token?.length === 0) {
|
||||
oldRender();
|
||||
return;
|
||||
}
|
||||
await getRoutersInfo().then(res => {
|
||||
console.log('render get routers', 123)
|
||||
|
||||
setRemoteMenu(res);
|
||||
oldRender()
|
||||
});
|
||||
@@ -209,9 +212,10 @@ export async function render(oldRender: () => void) {
|
||||
* @doc https://umijs.org/docs/max/request#配置
|
||||
*/
|
||||
const checkRegion = 5 * 60 * 1000;
|
||||
|
||||
export const request = {
|
||||
...errorConfig,
|
||||
baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://39.98.44.136:8080',
|
||||
// baseURL: 'http://39.98.44.136:8080',
|
||||
requestInterceptors: [
|
||||
(url: any, options: { headers: any }) => {
|
||||
const headers = options.headers ? options.headers : [];
|
||||
@@ -237,6 +241,11 @@ export const request = {
|
||||
clearSessionToken();
|
||||
}
|
||||
}
|
||||
if(process.env.NODE_ENV !== 'development') {
|
||||
if (url.startsWith('/api')) {
|
||||
url = url.replace(/^\/api/, '');
|
||||
}
|
||||
}
|
||||
return { url, options };
|
||||
},
|
||||
],
|
||||
@@ -247,6 +256,7 @@ export const request = {
|
||||
switch (data.code) {
|
||||
case 401:
|
||||
loginOut()
|
||||
break
|
||||
}
|
||||
if(data.code !== 200 && 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 { DefaultFooter } from '@ant-design/pro-components';
|
||||
import React from 'react';
|
||||
|
||||
import {getYear} from '@/utils/tools'
|
||||
const Footer: React.FC = () => {
|
||||
return (
|
||||
<DefaultFooter
|
||||
copyright={` ${getYear()} 青岛智慧就业服务系统`}
|
||||
style={{
|
||||
background: 'none',
|
||||
}}
|
||||
links={[
|
||||
{
|
||||
key: '青岛智慧就业服务系统',
|
||||
title: '青岛智慧就业服务系统',
|
||||
href: 'http://localhost:8000/',
|
||||
key: '青岛政务网',
|
||||
title: '青岛政务网',
|
||||
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 参数所在的位置 */
|
||||
const redirect = urlParams.get('redirect');
|
||||
// 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({
|
||||
pathname: '/user/login',
|
||||
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',
|
||||
'app.settings.notification.todo': 'To-do Notification',
|
||||
'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.close': 'Close',
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
|
||||
return (
|
||||
<ModalForm<API.AreaBusiness.CircleParams>
|
||||
title="新增线路"
|
||||
title={`${props.values ? '编辑' : '新增'}商圈`}
|
||||
form={form}
|
||||
// layout="inline"
|
||||
autoFocusFirstInput
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import React, {Fragment, useRef, useState} from "react";
|
||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||
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, AlignLeftOutlined } from '@ant-design/icons';
|
||||
import {getCmsAreaList, addCmsAreaListRow, updateCmsAreaListRow, deleteCmsAreaListRow} from "@/services/area/business";
|
||||
import SubWayEdit from "@/pages/Area/Business/edit";
|
||||
import {deleteCmsLineSubWay} from "@/services/area/subway";
|
||||
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||
import { FormInstance, Button, message, Modal } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, AlignLeftOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
getCmsAreaList,
|
||||
addCmsAreaListRow,
|
||||
updateCmsAreaListRow,
|
||||
deleteCmsAreaListRow,
|
||||
exportCmsAreaListRow
|
||||
} from "@/services/area/business";
|
||||
import BusinessEdit from "@/pages/Area/Business/edit";
|
||||
|
||||
|
||||
const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
|
||||
@@ -26,6 +31,20 @@ const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
|
||||
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() {
|
||||
const access = useAccess();
|
||||
|
||||
@@ -46,14 +65,15 @@ function ManagementList() {
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: 300,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => [
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="detail"
|
||||
icon = <AlignLeftOutlined />
|
||||
hidden={!access.hasPerms('area:business:list.detail')}
|
||||
icon={<AlignLeftOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.detail')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
@@ -65,8 +85,8 @@ function ManagementList() {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon = <FormOutlined />
|
||||
hidden={!access.hasPerms('area:business:list.update')}
|
||||
icon = {<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
@@ -79,8 +99,8 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon = <DeleteOutlined/>
|
||||
hidden={!access.hasPerms('area:business:list')}
|
||||
icon ={<DeleteOutlined/>}
|
||||
hidden={!access.hasPerms('area:business:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
@@ -112,21 +132,22 @@ function ManagementList() {
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
columns={columns}
|
||||
rowKey={"commercialAreaName"}
|
||||
key={"index"}
|
||||
request={(params) =>
|
||||
getCmsAreaList({ ...params } as API.AreaBusiness.CircleParams).then((res) => {
|
||||
const result = {
|
||||
return {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:list:add')}
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
@@ -134,10 +155,22 @@ function ManagementList() {
|
||||
>
|
||||
<PlusOutlined /> 新建
|
||||
</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>
|
||||
<SubWayEdit
|
||||
<BusinessEdit
|
||||
open={modalVisible}
|
||||
onSubmit={async (values) => {
|
||||
let resData
|
||||
@@ -164,7 +197,7 @@ function ManagementList() {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined)
|
||||
}}
|
||||
></SubWayEdit>
|
||||
></BusinessEdit>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDateRangePicker,
|
||||
ProFormSelect,
|
||||
ProFormDigit,
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Form, message } from 'antd';
|
||||
import { Form } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
|
||||
import {useEffect} from 'react'
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.AreaSubWay.Line) => Promise<void>;
|
||||
onCancel: (flag?: boolean, formVars?: unknown) => void;
|
||||
onSubmit: (values: API.AreaSubWay.LinePoint) => Promise<void>;
|
||||
open: boolean;
|
||||
values?: Partial<API.AreaSubWay.Line>;
|
||||
values?: Partial<API.AreaSubWay.LinePoint>;
|
||||
jobGroupOptions?: DictOptionType[];
|
||||
statusOptions?: DictValueEnumObj;
|
||||
};
|
||||
@@ -27,7 +25,19 @@ const waitTime = (time: number = 100) => {
|
||||
};
|
||||
|
||||
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 = () => {
|
||||
props.onCancel();
|
||||
@@ -35,7 +45,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
props.onSubmit(values as API.AreaSubWay.Line);
|
||||
props.onSubmit(values as API.AreaSubWay.LinePoint);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -43,7 +53,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
name: string;
|
||||
company: string;
|
||||
}>
|
||||
title="新增线路"
|
||||
title={`${props.values ? '编辑' : '新增'}站点`}
|
||||
form={form}
|
||||
// layout="inline"
|
||||
autoFocusFirstInput
|
||||
@@ -55,14 +65,53 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
<ProFormDigit
|
||||
name="stationId"
|
||||
label={'字典主键'}
|
||||
placeholder="请输入字典主键"
|
||||
disabled
|
||||
hidden={true}
|
||||
/>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="xl"
|
||||
name="lineName"
|
||||
label="线路名称:"
|
||||
width="md"
|
||||
name="stationName"
|
||||
label="站点名称:"
|
||||
placeholder="请输入名称"
|
||||
/>
|
||||
</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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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 { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||
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 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 hide = message.loading('正在删除');
|
||||
if (!selectedRow) return true;
|
||||
@@ -32,29 +33,66 @@ function ManagementList() {
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaPlatForm.Line>()
|
||||
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>[] = [
|
||||
{
|
||||
title: '线路名称',
|
||||
dataIndex: 'lineName',
|
||||
title: '序号',
|
||||
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',
|
||||
valueType: 'text',
|
||||
render: (dom, record) => <Button type="link" onClick={() => history.push(`/area/updata-router/index/${record.lineId}`)} block>
|
||||
{dom}
|
||||
</Button>
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
width: 300,
|
||||
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
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon = <DeleteOutlined/>
|
||||
hidden={!access.hasPerms('area:subway:list')}
|
||||
icon ={<DeleteOutlined/>}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
@@ -91,7 +129,7 @@ function ManagementList() {
|
||||
key="lineIdList"
|
||||
request={(params) => {
|
||||
return getCmsLineListPlatForm(params as API.AreaPlatForm.LineParams).then((res) => {
|
||||
console.log(params)
|
||||
setPage(params as API.AreaPlatForm.LineParams)
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
@@ -104,7 +142,7 @@ function ManagementList() {
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:list:add')}
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
@@ -115,9 +153,15 @@ function ManagementList() {
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<SubWayEdit
|
||||
<UpStationEdit
|
||||
open={modalVisible}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined)
|
||||
}}
|
||||
onSubmit={async (values) => {
|
||||
// values.lineId =
|
||||
// values.lineName =
|
||||
const resData = await addCmsLinePlatForm(values)
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
@@ -128,11 +172,8 @@ function ManagementList() {
|
||||
}
|
||||
}
|
||||
}}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined)
|
||||
}}
|
||||
></SubWayEdit>
|
||||
values={currentRow}
|
||||
></UpStationEdit>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import {
|
||||
ProFormDateRangePicker,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
ProFormDigit
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Form, message } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
import {useEffect} from 'react'
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
@@ -27,7 +29,17 @@ const waitTime = (time: number = 100) => {
|
||||
};
|
||||
|
||||
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 = () => {
|
||||
props.onCancel();
|
||||
@@ -43,7 +55,7 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
name: string;
|
||||
company: string;
|
||||
}>
|
||||
title="新增线路"
|
||||
title={`${props.values ? '编辑' : '新增'}线路`}
|
||||
form={form}
|
||||
// layout="inline"
|
||||
autoFocusFirstInput
|
||||
@@ -55,7 +67,15 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
<ProFormDigit
|
||||
name="lineId"
|
||||
label={'字典主键'}
|
||||
placeholder="请输入字典主键"
|
||||
disabled
|
||||
hidden={true}
|
||||
/>
|
||||
<ProForm.Group>
|
||||
|
||||
<ProFormText
|
||||
width="xl"
|
||||
name="lineName"
|
||||
|
||||
@@ -2,8 +2,8 @@ import React, {Fragment, useRef, useState} from "react";
|
||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import {getCmsLineList, addCmsLineSubWay, deleteCmsLineSubWay} from "@/services/area/subway";
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import {getCmsLineList, addCmsLineSubWay, deleteCmsLineSubWay, putCmsLineSubWay} from "@/services/area/subway";
|
||||
import SubWayEdit from "@/pages/Area/Subway/edit";
|
||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
||||
const hide = message.loading('正在删除');
|
||||
@@ -39,7 +39,7 @@ function ManagementList() {
|
||||
dataIndex: 'lineName',
|
||||
align: 'center',
|
||||
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}
|
||||
</Button>
|
||||
},
|
||||
@@ -47,14 +47,28 @@ function ManagementList() {
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
width: 300,
|
||||
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
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon = <DeleteOutlined/>
|
||||
hidden={!access.hasPerms('area:subway:list')}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
@@ -104,7 +118,7 @@ function ManagementList() {
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:list:add')}
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
@@ -118,11 +132,20 @@ function ManagementList() {
|
||||
<SubWayEdit
|
||||
open={modalVisible}
|
||||
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) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
message.success('添加成功')
|
||||
if(values.lineId) {
|
||||
message.success('修改成功')
|
||||
} else {
|
||||
message.success('新增成功')
|
||||
}
|
||||
if (actionRef.current) {
|
||||
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 { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
import {authUserSelectAll} from "@/services/system/role";
|
||||
|
||||
/**
|
||||
* 添加节点
|
||||
|
||||
@@ -11,7 +11,7 @@ import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.Management.Manage) => Promise<void>;
|
||||
onSubmit: (values: API.ManagementList.Manage) => Promise<void>;
|
||||
open: boolean;
|
||||
// values: Partial<API.Management.Manage>;
|
||||
// jobGroupOptions: DictOptionType[];
|
||||
@@ -35,7 +35,7 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
props.onSubmit(values as API.Management.Manage);
|
||||
props.onSubmit(values as API.ManagementList.Manage);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -57,65 +57,67 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="jobName"
|
||||
name="jobTitle"
|
||||
label="岗位名称"
|
||||
placeholder="请输入名称"
|
||||
/>
|
||||
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="company"
|
||||
label="我方公司名称"
|
||||
placeholder="请输入名称"
|
||||
name="minSalary"
|
||||
label="最小薪资"
|
||||
placeholder="请输入最小薪资(元)"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="maxSalary"
|
||||
label="最大薪资"
|
||||
placeholder="请输入最大薪资(元)"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="contract"
|
||||
label="合同名称"
|
||||
placeholder="请输入名称"
|
||||
name="education"
|
||||
label="学历要求"
|
||||
placeholder="请输入学历要求"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="experience"
|
||||
label="工作经验"
|
||||
placeholder="请输入工作经验"
|
||||
/>
|
||||
<ProFormDateRangePicker name="contractTime" label="合同生效时间" />
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
request={async () => [
|
||||
{
|
||||
value: 'chapter',
|
||||
label: '盖章后生效',
|
||||
},
|
||||
]}
|
||||
width="xs"
|
||||
name="useMode"
|
||||
label="合同约定生效方式"
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="companyName"
|
||||
label="单位名称"
|
||||
placeholder="请输入单位名称"
|
||||
/>
|
||||
<ProFormSelect
|
||||
width="xs"
|
||||
options={[
|
||||
{
|
||||
value: 'time',
|
||||
label: '履行完终止',
|
||||
},
|
||||
]}
|
||||
name="unusedMode"
|
||||
label="合同约定失效效方式"
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="jobLocation"
|
||||
label="工作地点"
|
||||
placeholder="请输入工作地点"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="vacancies"
|
||||
label="招聘人数"
|
||||
placeholder="请输入招聘人数"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="jobLocation"
|
||||
label="工作地点"
|
||||
placeholder="请输入工作地点"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFormText width="sm" name="id" label="主合同编号" />
|
||||
<ProFormText
|
||||
name="project"
|
||||
disabled
|
||||
label="项目名称"
|
||||
initialValue="xxxx项目"
|
||||
/>
|
||||
<ProFormText
|
||||
width="xs"
|
||||
name="mangerName"
|
||||
disabled
|
||||
label="商务经理"
|
||||
initialValue="启途"
|
||||
/>
|
||||
</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 {getCmsJobList} from "@/services/Management/list";
|
||||
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, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
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() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
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 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: '任务编号',
|
||||
dataIndex: 'jobId',
|
||||
title: '岗位名称',
|
||||
dataIndex: 'jobTitle',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},{
|
||||
title: '最大最小薪资',
|
||||
dataIndex: 'maxSalary',
|
||||
valueType: 'text',
|
||||
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 (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.Management.Manage>
|
||||
<ProTable<API.ManagementList.Manage>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="jobId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
getCmsJobList({ ...params } as API.Management.ListParams).then((res) => {
|
||||
getCmsJobList({ ...params } as API.ManagementList.ListParams).then((res) => {
|
||||
console.log(params)
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
@@ -45,7 +198,7 @@ function ManagementList() {
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:list:add')}
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { DictOptionType, DictValueEnumObj } from '@/components/DictTag';
|
||||
|
||||
/**
|
||||
* 定时任务调度 Edit Form
|
||||
*
|
||||
*
|
||||
* @author whiteshader
|
||||
* @date 2023-02-07
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ export type JobFormProps = {
|
||||
const JobForm: React.FC<JobFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const { jobGroupOptions, statusOptions } = props;
|
||||
|
||||
console.log(jobGroupOptions)
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
form.setFieldsValue({
|
||||
|
||||
@@ -216,7 +216,7 @@ const JobTableList: React.FC = () => {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon = <EditOutlined />
|
||||
icon = {<EditOutlined />}
|
||||
hidden={!access.hasPerms('monitor:job:edit.tsx')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -230,7 +230,7 @@ const JobTableList: React.FC = () => {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon = <DeleteOutlined />
|
||||
icon ={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('monitor:job:remove')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
|
||||
@@ -176,6 +176,7 @@ const ConfigTableList: React.FC = () => {
|
||||
title: <FormattedMessage id="system.config.config_value" defaultMessage="参数键值" />,
|
||||
dataIndex: 'configValue',
|
||||
valueType: 'textarea',
|
||||
render: (dom) => <span style={{ wordWrap: 'break-word', wordBreak: 'break-word' }}>{dom || '--'}</span>,
|
||||
},
|
||||
{
|
||||
title: <FormattedMessage id="system.config.config_type" defaultMessage="系统内置" />,
|
||||
|
||||
@@ -13,6 +13,7 @@ import { DataNode } from 'antd/es/tree';
|
||||
import { createIcon } from '@/utils/IconUtil';
|
||||
import { DictValueEnumObj } from '@/components/DictTag';
|
||||
import IconSelector from '@/components/IconSelector';
|
||||
import {isEmptyObject} from '@/utils/tools'
|
||||
|
||||
export type MenuFormData = Record<string, unknown> & Partial<API.System.Menu>;
|
||||
|
||||
@@ -39,27 +40,29 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
setMenuIconName(props.values.icon);
|
||||
form.setFieldsValue({
|
||||
menuId: props.values.menuId,
|
||||
menuName: props.values.menuName,
|
||||
parentId: props.values.parentId,
|
||||
orderNum: props.values.orderNum,
|
||||
path: props.values.path,
|
||||
component: props.values.component,
|
||||
query: props.values.query,
|
||||
isFrame: props.values.isFrame,
|
||||
isCache: props.values.isCache,
|
||||
menuType: props.values.menuType,
|
||||
visible: props.values.visible,
|
||||
status: props.values.status,
|
||||
perms: props.values.perms,
|
||||
icon: props.values.icon,
|
||||
createBy: props.values.createBy,
|
||||
createTime: props.values.createTime,
|
||||
updateBy: props.values.updateBy,
|
||||
updateTime: props.values.updateTime,
|
||||
remark: props.values.remark,
|
||||
});
|
||||
if(!isEmptyObject(props.values)) {
|
||||
form.setFieldsValue({
|
||||
menuId: props.values.menuId,
|
||||
menuName: props.values.menuName,
|
||||
parentId: props.values.parentId,
|
||||
orderNum: props.values.orderNum,
|
||||
path: props.values.path,
|
||||
component: props.values.component,
|
||||
query: props.values.query,
|
||||
isFrame: props.values.isFrame,
|
||||
isCache: props.values.isCache,
|
||||
menuType: props.values.menuType,
|
||||
visible: props.values.visible,
|
||||
status: props.values.status,
|
||||
perms: props.values.perms,
|
||||
icon: props.values.icon,
|
||||
createBy: props.values.createBy,
|
||||
createTime: props.values.createTime,
|
||||
updateBy: props.values.updateBy,
|
||||
updateTime: props.values.updateTime,
|
||||
remark: props.values.remark,
|
||||
});
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
const intl = useIntl();
|
||||
@@ -90,6 +93,15 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
|
||||
form={form}
|
||||
grid={true}
|
||||
submitter={false}
|
||||
initialValues={{
|
||||
isFrame: 1,
|
||||
status: '0',
|
||||
parentId: 0,
|
||||
menuType: 'M',
|
||||
isCache: 0,
|
||||
visible: '0',
|
||||
orderNum: 1
|
||||
}}
|
||||
layout="horizontal"
|
||||
onFinish={handleFinish}>
|
||||
<ProFormDigit
|
||||
@@ -202,7 +214,7 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
|
||||
placeholder="请输入显示顺序"
|
||||
rules={[
|
||||
{
|
||||
required: false,
|
||||
required: true,
|
||||
message: <FormattedMessage id="请输入显示顺序!" defaultMessage="请输入显示顺序!" />,
|
||||
},
|
||||
]}
|
||||
|
||||
@@ -3,13 +3,13 @@ import { Checkbox, Col, Form, Modal, Row, Tree } from 'antd';
|
||||
import { FormattedMessage, useIntl } from '@umijs/max';
|
||||
import { Key, ProForm, ProFormDigit, ProFormSelect, ProFormText } from '@ant-design/pro-components';
|
||||
import { DataNode } from 'antd/es/tree';
|
||||
import { CheckboxValueType } from 'antd/es/checkbox/Group';
|
||||
import type { GetProp } from 'antd';
|
||||
|
||||
/* *
|
||||
*
|
||||
* @author whiteshader@163.com
|
||||
* @datetime 2023/02/06
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
export type FormValueType = any & Partial<API.System.Dept>;
|
||||
@@ -53,7 +53,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
||||
props.onCancel();
|
||||
};
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
props.onSubmit({ ...values, deptIds } as FormValueType);
|
||||
await props.onSubmit({ ...values, deptIds } as FormValueType);
|
||||
};
|
||||
|
||||
const getAllDeptNode = (node: DataNode[]) => {
|
||||
@@ -70,7 +70,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
||||
const deptAllNodes = getAllDeptNode(deptTree);
|
||||
|
||||
|
||||
const onDeptOptionChange = (checkedValues: CheckboxValueType[]) => {
|
||||
const onDeptOptionChange: GetProp<typeof Checkbox.Group, 'onChange'> = (checkedValues) => {
|
||||
if(checkedValues.includes('deptExpand')) {
|
||||
setDeptTreeExpandKey(deptAllNodes);
|
||||
} else {
|
||||
@@ -81,7 +81,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
||||
} else {
|
||||
setDeptIds([]);
|
||||
}
|
||||
|
||||
|
||||
if(checkedValues.includes('deptCheckStrictly')) {
|
||||
setCheckStrictly(false);
|
||||
} else {
|
||||
@@ -179,7 +179,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => {
|
||||
]}
|
||||
fieldProps={{
|
||||
onChange: (value) => {
|
||||
setDataScopeType(value);
|
||||
setDataScopeType(value as string);
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -254,7 +254,7 @@ const UserTableList: React.FC = () => {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon=<EditOutlined />
|
||||
icon={<EditOutlined />}
|
||||
hidden={!access.hasPerms('system:user:edit.tsx')}
|
||||
onClick={async () => {
|
||||
fetchUserInfo(record.userId);
|
||||
@@ -270,7 +270,7 @@ const UserTableList: React.FC = () => {
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
icon=<DeleteOutlined />
|
||||
icon={<DeleteOutlined />}
|
||||
key="batchRemove"
|
||||
hidden={!access.hasPerms('system:user:remove')}
|
||||
onClick={async () => {
|
||||
|
||||
@@ -22,6 +22,8 @@ import Settings from '../../../../config/defaultSettings';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
import { clearSessionToken, setSessionToken } from '@/access';
|
||||
import {getRoutersInfo, setRemoteMenu} from "@/services/session";
|
||||
import logoImg from '@/assets/logo.svg'
|
||||
|
||||
const ActionIcons = () => {
|
||||
const langClassName = useEmotionCss(({ token }) => {
|
||||
@@ -141,6 +143,7 @@ const Login: React.FC = () => {
|
||||
console.log('login ok');
|
||||
const urlParams = new URL(window.location.href).searchParams;
|
||||
history.push(urlParams.get('redirect') || '/');
|
||||
setTimeout(() => history.go(0), 0)
|
||||
return;
|
||||
} else {
|
||||
message.error(response.msg);
|
||||
@@ -189,7 +192,7 @@ const Login: React.FC = () => {
|
||||
minWidth: 280,
|
||||
maxWidth: '75vw',
|
||||
}}
|
||||
logo={<img alt="logo" src="/logo.svg" />}
|
||||
logo={<img alt="logo" src={logoImg} />}
|
||||
title="青岛智慧就业服务系统"
|
||||
// subTitle={intl.formatMessage({ id: 'pages.layouts.userLayout.title' })}
|
||||
initialValues={{
|
||||
|
||||
@@ -9,7 +9,7 @@ workbox.core.setCacheNameDetails({
|
||||
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
|
||||
*/
|
||||
workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export async function getCmsJobList(params?: API.Management.ListParams) {
|
||||
return request<API.Management.ManagePageResult>(`/api/cms/job/list`, {
|
||||
export async function getCmsJobList(params?: API.ManagementList.ListParams) {
|
||||
return request<API.ManagementList.ManagePageResult>(`/api/cms/job/list`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
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',
|
||||
});
|
||||
}
|
||||
|
||||
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',
|
||||
});
|
||||
}
|
||||
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) {
|
||||
return request<API.AreaSubWay.LinePageResult>(`/api/cms/line/${ids}`, {
|
||||
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) {
|
||||
return request<API.AreaPlatForm.LinePageResult>(`/api/cms/station/${ids}`, {
|
||||
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(
|
||||
body: API.User[],
|
||||
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 }) {
|
||||
return request<any>('/user/createWithList', {
|
||||
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 {
|
||||
applyNum: number;
|
||||
companyId: number;
|
||||
@@ -25,8 +25,8 @@ declare namespace API.Management {
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
remark?: string;
|
||||
pageSize?: string;
|
||||
current?: string;
|
||||
pageSize?: number;
|
||||
current?: number;
|
||||
}
|
||||
|
||||
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 {
|
||||
lineId: number;
|
||||
lineId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
pageSize?: string;
|
||||
current?: string;
|
||||
pageSize?: number;
|
||||
current?: nnumber;
|
||||
}
|
||||
|
||||
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