diff --git a/config/proxy.ts b/config/proxy.ts index aba6abd..2472498 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -11,16 +11,16 @@ */ export default { // 如果需要自定义本地开发服务器 请取消注释按需调整 - // dev: { + dev: { // localhost:8000/api/** -> https://preview.pro.ant.design/api/** - // '/api/': { - // // 要代理的地址 - // target: 'http://10.147.18.100:8082', - // // 配置了这个可以从 http 代理到 https - // // 依赖 origin 的功能可能需要这个,比如 cookie - // changeOrigin: true, - // }, - // }, + '/api/': { + // 要代理的地址 + target: 'https://dev.neighbourhood.cn', + // 配置了这个可以从 http 代理到 https + // 依赖 origin 的功能可能需要这个,比如 cookie + changeOrigin: true, + }, + }, mako: {}, /** * @name 详细的代理配置 diff --git a/config/routes.ts b/config/routes.ts index 92946e1..8989cfa 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -11,6 +11,8 @@ export default [ { name: '用户管理', icon: 'table', path: '/list/anchor', component: './table-list/anchor' }, { name: '主播报单管理', icon: 'table', path: '/list/declaration', component: './table-list/declaration' }, { name: '模卡管理', icon: 'table', path: '/list/resume', component: './table-list/material' }, + { name: '运营二维码管理', icon: 'table', path: '/list/staff-qrcode', component: './table-list/staff-qrcode' }, + { name: '城市运营管理', icon: 'table', path: '/list/city-operation', component: './table-list/city-operation' }, { path: '/', redirect: '/list/job' }, { path: '*', layout: false, component: './404' }, ]; diff --git a/package.json b/package.json index e992988..40ef9d0 100644 --- a/package.json +++ b/package.json @@ -96,5 +96,6 @@ }, "engines": { "node": ">=12.0.0" - } + }, + "packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184" } diff --git a/src/constants/api.ts b/src/constants/api.ts index b6eb26e..19c539d 100644 --- a/src/constants/api.ts +++ b/src/constants/api.ts @@ -25,4 +25,16 @@ export enum AdminAPI { // 模卡 MATERIAL_LIST = '/api/bo/resume/list', MATERIAL_UPDATE = '/api/bo/resume/update', + // 七牛 + UPLOAD_FILE = '/api/backend/file/upload', + // 运营人员 + STAFF_LIST = '/api/staff/getStaffPageList', + STAFF_ALL = '/api/staff/getAllStaff', + STAFF_UPDATE = '/api/staff/addOrEdit', + STAFF_DELETE = '/api/staff/{id}', + STAFF_SET_DEFAULT = '/api/staff/setAsDefault/{id}', + // 城市运营 + CITY_OPERATOR_LIST = '/api/cityOperator/getStaffPageList', + CITY_OPERATOR_UPDATE = '/api/cityOperator/addOrEdit', + CITY_OPERATOR_DELETE = '/api/cityOperator/{id}', } diff --git a/src/pages/table-list/city-operation/index.tsx b/src/pages/table-list/city-operation/index.tsx new file mode 100644 index 0000000..dfdd988 --- /dev/null +++ b/src/pages/table-list/city-operation/index.tsx @@ -0,0 +1,206 @@ +import { PlusOutlined } from '@ant-design/icons'; +import { ActionType, ProColumns, ProFormInstance, ProFormSelect, ProFormText } from '@ant-design/pro-components'; +import { ModalForm, PageContainer, ProTable } from '@ant-design/pro-components'; +import '@umijs/max'; +import { Button, message } from 'antd'; +import { Select } from 'antd'; +import { createStyles } from 'antd-style'; +import dayjs from 'dayjs'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; + +import { CITY_OPTIONS } from '@/constants/city'; +import { TIME_FORMAT } from '@/constants/global'; +import { deleteCityOperator, getAllStaffList, getCityOpratorList, updateCityOperator } from '@/services/list'; + +const useStyles = createStyles(({ token }) => { + return { + img: { + width: 100, + height: 100, + }, + delete: { + color: token.colorError, + }, + button: { + marginRight: '8px', + }, + }; +}); + +const TableList: React.FC = () => { + const [updateModalOpen, handleUpdateModalOpen] = useState(false); + const [currentRow, setCurrentRow] = useState(); + const actionRef = useRef(); + const formRef = useRef(); + const [staffOptions, setStaffOptions] = useState>([]); + const defaultStaff = useMemo(() => { + return staffOptions.find(it => it.isDefault) || staffOptions[0]; + }, [staffOptions]); + const { styles } = useStyles(); + + const getAllStaffOptions = async () => { + try { + const results = await getAllStaffList(); + setStaffOptions( + results.map(it => ({ + label: it.staffName, + isDefault: Boolean(it.isDefault), + value: it.id, + })), + ); + } catch (e) { + } finally { + } + }; + + const handleDelete = async (id: number) => { + await deleteCityOperator(id); + message.success('操作成功'); + actionRef.current?.reload(); + }; + + useEffect(() => { + getAllStaffOptions(); + }, []); + + const columns: ProColumns[] = [ + { + title: '城市', + dataIndex: 'cityCode', + valueType: 'textarea', + render: (_text, record) => record.cityName, + renderFormItem() { + return ( +