From a78991ea384746a7b9129f04fa1a3cf6b92b9e17 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 11 Jul 2024 23:46:16 +0800 Subject: [PATCH] up --- config/routes.ts | 7 + src/access.ts | 4 + src/constants.ts | 7 + src/pages/Dashboard/BusinessViews.tsx | 8 +- src/pages/Dashboard/ChannelStatistics.tsx | 3 + src/pages/Dashboard/ScanDetail.tsx | 5 + src/pages/Dashboard/index.tsx | 33 ++- .../Dictionary/components/UpdateForm.tsx | 83 ++++++ .../Dictionary/components/UpdateItemForm.tsx | 53 ++++ src/pages/Dictionary/index.tsx | 243 ++++++++++++++++++ src/pages/ProductList/add.tsx | 94 ++++--- src/pages/ProductList/category.tsx | 8 +- .../ProductList/components/UpdateForm.tsx | 55 +++- src/services/pop-b2b2c/errorController.ts | 30 +-- .../pop-b2b2c/pbcCategoryController.ts | 2 +- .../pop-b2b2c/pbcSpecificationController.ts | 6 +- 16 files changed, 569 insertions(+), 72 deletions(-) create mode 100644 src/pages/Dictionary/components/UpdateForm.tsx create mode 100644 src/pages/Dictionary/components/UpdateItemForm.tsx create mode 100644 src/pages/Dictionary/index.tsx diff --git a/config/routes.ts b/config/routes.ts index dc02d60..1cdfc7a 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -179,6 +179,13 @@ export default [ access: 'messageQuery', component: './MessageList', }, + { + name: '字典管理', + path: '/dictionary-list', + icon: 'message', + access: 'dictionaryQuery', + component: './Dictionary', + }, { path: '/' }, { path: '*', layout: false, component: './404' }, ]; diff --git a/src/access.ts b/src/access.ts index 3312b20..6fea96b 100644 --- a/src/access.ts +++ b/src/access.ts @@ -45,6 +45,10 @@ export default function access(initialState: { currentUser?: API.PbcUsersVO | un message: false, messageQuery: false, messageDelete: false, + dictionary: false, + dictionaryQuery: false, + dictionaryAdd: false, + dictionaryUpdate: false, }; for (let i = 0; i < currentUser?.currentAuthority.length; i++) { const element = currentUser?.currentAuthority[i]; diff --git a/src/constants.ts b/src/constants.ts index 090f679..0ae7ef1 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -129,6 +129,13 @@ const Constants = { link: '链接', share: '分享' }, + /** + * 规格输入类型 + */ + pbcSystemInputType: { + select: '下拉框', + text: '文本框', + }, // 手机正则 PHONE_PATTERN: /^(?:(0\d{2,3}-)?\d{7,8}|1[3-9]\d{9})$/, //邮箱正则 diff --git a/src/pages/Dashboard/BusinessViews.tsx b/src/pages/Dashboard/BusinessViews.tsx index 3cf5adb..32b3344 100644 --- a/src/pages/Dashboard/BusinessViews.tsx +++ b/src/pages/Dashboard/BusinessViews.tsx @@ -1,7 +1,7 @@ import { businessViewRankUsingPost, exportBusinessViewRankUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController'; import { ActionType, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-layout'; -import { Link } from '@umijs/max'; +import { Link, useSearchParams } from '@umijs/max'; import { Button, message } from 'antd'; import moment from 'moment'; import React, { useRef } from 'react'; @@ -46,6 +46,9 @@ const handleExport = async (values?: API.PbcOperationalDashboardDTO) => { const TableList: React.FC<{}> = () => { const actionRef = useRef(); const ref = useRef>(); + const [searchParams] = useSearchParams(); + const startDate = searchParams.get('startDate'); + const endDate = searchParams.get('endDate'); const columns: ProColumns[] = [ { @@ -93,9 +96,10 @@ const TableList: React.FC<{}> = () => { search: false }, { - title: '注册日期', + title: '浏览日期', dataIndex: 'pbcCreateAt', hideInTable: true, + initialValue: [moment(startDate),moment(endDate)], fieldProps:{ maxDate: moment() }, diff --git a/src/pages/Dashboard/ChannelStatistics.tsx b/src/pages/Dashboard/ChannelStatistics.tsx index 31892b8..2d4975b 100644 --- a/src/pages/Dashboard/ChannelStatistics.tsx +++ b/src/pages/Dashboard/ChannelStatistics.tsx @@ -49,6 +49,8 @@ import moment from 'moment'; const ref = useRef>(); const [searchParams] = useSearchParams(); const type = searchParams.get('type'); + const startDate = searchParams.get('startDate'); + const endDate = searchParams.get('endDate'); const columns: ProColumns[] = [ { @@ -77,6 +79,7 @@ import moment from 'moment'; title: '访问时间', dataIndex: 'pbcCreateAt', hideInTable: true, + initialValue: [moment(startDate),moment(endDate)], fieldProps:{ maxDate: moment() }, diff --git a/src/pages/Dashboard/ScanDetail.tsx b/src/pages/Dashboard/ScanDetail.tsx index d6f0cec..bbc9ede 100644 --- a/src/pages/Dashboard/ScanDetail.tsx +++ b/src/pages/Dashboard/ScanDetail.tsx @@ -2,6 +2,7 @@ import Constants from '@/constants'; import { exportPeopleScanDetailUsingPost, peopleScanDetailUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController'; import { ActionType, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-layout'; +import { useSearchParams } from '@umijs/max'; import { Button, message } from 'antd'; import moment from 'moment'; import React, { useRef } from 'react'; @@ -46,6 +47,9 @@ const handleExport = async (values?: API.PbcOperationalDashboardDTO) => { const TableList: React.FC<{}> = () => { const actionRef = useRef(); const ref = useRef>(); + const [searchParams] = useSearchParams(); + const startDate = searchParams.get('startDate'); + const endDate = searchParams.get('endDate'); const columns: ProColumns[] = [ { @@ -73,6 +77,7 @@ const TableList: React.FC<{}> = () => { title: '扫码时间', dataIndex: 'pbcCreateAt', valueType: 'dateRange', + initialValue: [moment(startDate),moment(endDate)], fieldProps:{ maxDate: moment() }, diff --git a/src/pages/Dashboard/index.tsx b/src/pages/Dashboard/index.tsx index b08c3e4..c4c7f3d 100644 --- a/src/pages/Dashboard/index.tsx +++ b/src/pages/Dashboard/index.tsx @@ -254,9 +254,18 @@ const Welcome: React.FC = () => { - + @@ -270,7 +279,16 @@ const Welcome: React.FC = () => { {'更多>>'} + } bordered={false}> { plot.on('plot:click', (evt: { x: any; y: any; }) => { @@ -304,7 +322,14 @@ const Welcome: React.FC = () => { } } } - history.push('/dashboard/channel-statistics?type='+type) + const param: any = ref.current?.getFieldsValue() + let startDate = param.pbcQueryType == 1 ? dayjs().format('YYYY-MM-DD') : dayjs().date(1).format('YYYY-MM-DD') + let endDate = dayjs().format('YYYY-MM-DD') + if (param.dateRange) { + startDate = dayjs(param.dateRange[0]).format('YYYY-MM-DD') + endDate = dayjs(param.dateRange[1]).format('YYYY-MM-DD') + } + history.push(`/dashboard/channel-statistics?type=${type}&startDate=${startDate}&endDate=${endDate}`) }); }} /> diff --git a/src/pages/Dictionary/components/UpdateForm.tsx b/src/pages/Dictionary/components/UpdateForm.tsx new file mode 100644 index 0000000..4e2e9d5 --- /dev/null +++ b/src/pages/Dictionary/components/UpdateForm.tsx @@ -0,0 +1,83 @@ +import React, { useRef } from 'react'; +import { DrawerForm, ProFormInstance, ProFormSelect, ProFormText } from '@ant-design/pro-components'; +import Constants from '@/constants'; +export type FormValueType = { + target?: string; + template?: string; + type?: string; + time?: string; + frequency?: string; +} & Partial; +export type UpdateFormProps = { + onCancel: (flag?: boolean, formVals?: FormValueType) => void; + onSubmit: (values: FormValueType) => Promise; + updateModalVisible: boolean; +}; + +const UpdateForm: React.FC = (props) => { + const formRef = useRef(); + return ( + { + return props.onSubmit({ ...value }) + }} + drawerProps={{ + destroyOnClose: true, + }} + onOpenChange={(visible) => { + formRef.current?.resetFields(); + if (!visible) { + props.onCancel(); + } + }} + > + + + + + ); +}; + +export default UpdateForm; diff --git a/src/pages/Dictionary/components/UpdateItemForm.tsx b/src/pages/Dictionary/components/UpdateItemForm.tsx new file mode 100644 index 0000000..ae32e94 --- /dev/null +++ b/src/pages/Dictionary/components/UpdateItemForm.tsx @@ -0,0 +1,53 @@ +import React, { useRef } from 'react'; +import { DrawerForm, ProFormInstance, ProFormText } from '@ant-design/pro-components'; +export type FormValueType = { + target?: string; + template?: string; + type?: string; + time?: string; + frequency?: string; +} & Partial; +export type UpdateFormProps = { + onCancel: (flag?: boolean, formVals?: FormValueType) => void; + onSubmit: (values: FormValueType) => Promise; + updateModalVisible: boolean; +}; + +const UpdateItemForm: React.FC = (props) => { + const formRef = useRef(); + return ( + { + return props.onSubmit({ ...value }) + }} + drawerProps={{ + destroyOnClose: true, + }} + onOpenChange={(visible) => { + formRef.current?.resetFields(); + if (!visible) { + props.onCancel(); + } + }} + > + + + ); +}; + +export default UpdateItemForm; diff --git a/src/pages/Dictionary/index.tsx b/src/pages/Dictionary/index.tsx new file mode 100644 index 0000000..ef7655e --- /dev/null +++ b/src/pages/Dictionary/index.tsx @@ -0,0 +1,243 @@ +import { dashboardUsingPost, exportDashboardDetailUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController'; +import { Bar, Pie, WordCloud, WordCloudConfig } from '@ant-design/plots'; +import dayjs from 'dayjs'; +import { ActionType, PageContainer, ProCard, ProColumns, ProForm, ProFormDateRangePicker, ProFormGroup, ProFormInstance, ProFormRadio, ProFormText, ProTable } from '@ant-design/pro-components'; +import { Button, Card, Col, message, Row, Spin, Statistic, Switch, Table } from 'antd'; +import React, { useEffect, useRef, useState } from 'react'; +import { Access, history, Link, useAccess } from '@umijs/max'; +import Constants from '@/constants'; +import { disabledDate } from '@/utils/utils'; +import { addSpecificationItemUsingPost, addSpecificationUsingPost, changeSpecificationItemStateUsingPost, getSpecificationItemListUsingGet, specificationListUsingGet } from '@/services/pop-b2b2c/pbcSpecificationController'; +import { FileAddFilled, PlusCircleFilled } from '@ant-design/icons'; +import UpdateForm from './components/UpdateForm'; +import UpdateItemForm from './components/UpdateItemForm'; + +/** + * 查询表格 + * @param param0 + */ +const fetchData = async (params: any) => { + const msg = await getSpecificationItemListUsingGet(params); + return { + data: msg.data || [], + success: msg.retcode, + } as any; +}; + +const handleUpdateState = async (id: number, state: number) => { + const hide = message.loading('正在保存'); + if (!id) return false; + try { + const msg = await changeSpecificationItemStateUsingPost({ pbcId: id, pbcState: state }); + hide(); + if (msg.retcode) { + message.success(!id ? '新增成功!' : '保存成功!'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!id ? '新增失败,请重试!' : '保存失败,请重试!'); + return false; + } +}; + +/** + * 更新节点 + * @param fields + */ +const handleUpdate = async (fields: API.PbcSpecification) => { + const hide = message.loading('正在保存'); + + try { + const msg = await addSpecificationUsingPost({ ...fields }); + hide(); + if (msg.retcode) { + message.success(!fields.pbcId ? '添加成功' : '保存成功'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!fields.pbcId ? '添加失败请重试!' : '保存失败请重试!'); + return false; + } +}; +/** + * 更新节点 + * @param fields + */ +const handleItemUpdate = async (fields: API.PbcCommonDataValue) => { + const hide = message.loading('正在保存'); + + try { + const msg = await addSpecificationItemUsingPost({ ...fields }); + hide(); + if (msg.retcode) { + message.success(!fields.pbcId ? '添加成功' : '保存成功'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!fields.pbcId ? '添加失败请重试!' : '保存失败请重试!'); + return false; + } +}; + + +const Welcome: React.FC = () => { + const actionRef = useRef(); + const access: any = useAccess(); + + const [specList, setSpecList] = useState([]) + const [updateModalVisible, handleUpdateModalVisible] = useState(false); + const [updateItemModalVisible, handleUpdateItemModalVisible] = useState(false); + const [specificationId, setSpecificationId] = useState() + + const columns: ProColumns[] = [ + { + title: 'ID', + dataIndex: 'pbcId', + }, + { + title: '名称', + dataIndex: 'pbcSystemValue', + }, + { + title: '最后操作人', + dataIndex: 'pbcUpdateByUserName', + }, + { + title: '最后操作时间', + dataIndex: 'pbcUpdateAt', + }, + { + title: '状态', + dataIndex: 'pbcState', + valueType: 'select', + valueEnum: Constants.state, + render: (_, record) => { + return ( + + { + const success = await handleUpdateState(record.pbcId || 0, value ? 1 : 2); + + if (success) { + if (actionRef.current) { + actionRef.current.reload(); + } + } + }} + /> + + ); + }, + }, + ] + + const getData = () => { + specificationListUsingGet().then(res => { + if (res.retcode && res.data) { + setSpecList(res.data) + } + }) + } + + useEffect(() => { + getData() + }, []) + + return ( + + + + { + handleUpdateModalVisible(true) + }} /> + }> + {specList.map(e =>

{ + setSpecificationId(e.pbcId) + }}>{e.pbcSystemName}

)} +
+ + + { + const index = specList.findIndex(e => e.pbcId === specificationId) + if (!specificationId) { + message.warning("请选择规格") + } else if (index >= 0 && specList[index].pbcSystemInputType === 'text') { + message.warning("所选规格为文本框,不能新增规格项") + } else { + handleUpdateItemModalVisible(true) + } + }} /> + }> + []} + pagination={false} + /> + + +
+ { + const success = await handleUpdate(value); + + if (success) { + handleUpdateModalVisible(false); + getData() + } + }} + onCancel={() => { + message.destroy(); + handleUpdateModalVisible(false); + }} + updateModalVisible={updateModalVisible} + /> + { + const success = await handleItemUpdate({...value, pbcSpecificationId: specificationId}); + + if (success) { + handleUpdateItemModalVisible(false); + actionRef.current?.reload() + } + }} + onCancel={() => { + message.destroy(); + handleUpdateItemModalVisible(false); + }} + updateModalVisible={updateItemModalVisible} + /> +
+ ); +}; + +export default Welcome; diff --git a/src/pages/ProductList/add.tsx b/src/pages/ProductList/add.tsx index 3591cd2..d106b03 100644 --- a/src/pages/ProductList/add.tsx +++ b/src/pages/ProductList/add.tsx @@ -1,9 +1,11 @@ import Constants from '@/constants'; import { getPbcBusinessListUsingPost } from '@/services/pop-b2b2c/pbcBusinessController'; import { listAdminTreeUsingGet } from '@/services/pop-b2b2c/pbcCategoryController'; +import { getRecordByL3CategoryIdUsingGet } from '@/services/pop-b2b2c/pbcCommonDataController'; import { addOrUpdateProductForAdminUsingPost } from '@/services/pop-b2b2c/pbcProductController'; import { getCities } from '@/utils/cities'; import { + FormListActionType, ProCard, ProForm, ProFormCascader, @@ -23,6 +25,9 @@ import React, { useRef, useState } from 'react'; const Detail: React.FC = () => { const [cities] = useState(() => getCities()) + const [colorData, setColorData] = useState() + const [commonDataList, setCommonDataList] = useState() + const formRef = useRef(); const onSave = () => { @@ -39,6 +44,14 @@ const Detail: React.FC = () => { pbcProductParentCategoryName: c2?.pbcCategoryName, pbcProductCategoryName: c3?.pbcCategoryName, }) + if (value.length === 3) { + getRecordByL3CategoryIdUsingGet({ l3CategoryId: value[2] }).then(res => { + if (res.retcode && res.data) { + setColorData(res.data.colorData) + setCommonDataList(res.data.commonDataList) + } + }) + } } const onSubmit = async (values: any) => { @@ -49,11 +62,12 @@ const Detail: React.FC = () => { const [pbcProductTopCategoryId, pbcProductParentCategoryId, pbcProductCategoryId] = values.pbcProductCategoryIdList console.log(values.colorItems) console.log(values.specItems) - const commonDataList: API.PbcProductCommonData[] = [] - if (values.colorItems && values.colorItems.length > 0) { + const specItems: API.PbcProductCommonData[] = [] + if (colorData != null && values.colorItems && values.colorItems.length > 0) { for (let i = 0; i < values.colorItems.length; i++) { const element = values.colorItems[i]; - commonDataList.push({ + specItems.push({ + pbcCommonDataId: colorData.length > 0 ? colorData[0].pbcId : undefined, pbcSystemName: '颜色', pbcSystemInputType: 'text', pbcCommonDataSystem: element.name, @@ -61,13 +75,21 @@ const Detail: React.FC = () => { }) } } - if (values.specItems && values.specItems.length > 0) { - for (let i = 0; i < values.specItems.length; i++) { - const element = values.specItems[i]; - commonDataList.push({ - pbcSystemName: element.name, - pbcSystemInputType: 'text', - pbcCommonDataSystem: element.value + if (commonDataList != null) { + for (let i = 0; i < commonDataList.length; i++) { + const element = commonDataList[i]; + console.log(values[`value${i}`]) + let name = '' + if (element.pbcSystemInputType === 'select' && element.commonDataValueList) { + name = element.commonDataValueList.find(e => e.pbcId === values[`value${i}`])?.pbcSystemValue || '' + } + specItems.push({ + pbcCommonDataId: element.pbcId, + pbcSystemName: element.pbcSystemName, + pbcSystemInputType: element.pbcSystemInputType, + pbcCommonDataValueId: element.pbcSystemInputType === 'select' ? values[`value${i}`] : undefined, + pbcCommonDataSystemValue: element.pbcSystemInputType === 'select' ? name : undefined, + pbcCommonDataSystem: element.pbcSystemInputType === 'select' ? undefined : values[`value${i}`] }) } } @@ -78,7 +100,7 @@ const Detail: React.FC = () => { pbcProductTopCategoryId, pbcProductParentCategoryId, pbcProductCategoryId, - productCommonDataList: commonDataList, + productCommonDataList: specItems, pbcProductImages: values.pbcProductImages.filter((e: any) => e.response && e.response.data).map((e: any) => e.response.data).join(','), pbcProductDetailImages: values.pbcProductDetailImages.filter((e: any) => e.response && e.response.data).map((e: any) => e.response.data).join(','), pbcZone: undefined, @@ -189,7 +211,7 @@ const Detail: React.FC = () => { ]} />
- + {colorData != null ? = () => { - + : null} = () => { /> - - - - - - - - - - - - + {commonDataList != null ? commonDataList.map((e, index) => + + + + + {e.pbcSystemInputType === 'select' ? { + return { + label: item.pbcSystemValue || '', + value: item.pbcId + } + })} rules={[ + { required: true, message: '请选择规格描述' }, + ]} /> : + } + + ) : null} { * 更新节点 * @param fields */ -const handleUpdate = async (fields: API.PbcCategory) => { +const handleUpdate = async (fields: API.PbcCategory & API.PbcSetSpecificationDTO) => { const hide = message.loading('正在保存'); try { const msg = await saveOrUpdateCategoryUsingPost({ ...fields }); + const msg1 = await setSpecificationForCategoryUsingPost({ pbcCategory: {...fields, pbcId: msg.data}, pbcSpecificationList: fields.pbcSpecificationList }); hide(); - if (msg.retcode) { + if (msg.retcode && msg1.retcode) { message.success(!fields.pbcId ? '添加成功' : '保存成功'); return true; } - message.error(msg.retmsg); + message.error(!msg.retcode ? msg.retmsg : msg1.retmsg); return false; } catch (error) { hide(); diff --git a/src/pages/ProductList/components/UpdateForm.tsx b/src/pages/ProductList/components/UpdateForm.tsx index 4c25a9a..8b428b0 100644 --- a/src/pages/ProductList/components/UpdateForm.tsx +++ b/src/pages/ProductList/components/UpdateForm.tsx @@ -1,8 +1,10 @@ -import React, { useRef, useState } from 'react'; -import { DrawerForm, ProFormInstance, ProFormText, ProFormUploadButton } from '@ant-design/pro-components'; +import React, { useEffect, useRef, useState } from 'react'; +import { DrawerForm, ProFormCheckbox, ProFormInstance, ProFormText, ProFormUploadButton } from '@ant-design/pro-components'; import { PlusCircleOutlined } from '@ant-design/icons'; import { message } from 'antd'; import { RcFile } from 'antd/es/upload'; +import { specificationListUsingGet } from '@/services/pop-b2b2c/pbcSpecificationController'; +import { getRecordByL3CategoryIdUsingGet } from '@/services/pop-b2b2c/pbcCommonDataController'; export type FormValueType = { target?: string; template?: string; @@ -19,6 +21,39 @@ export type UpdateFormProps = { const UpdateForm: React.FC = (props) => { const formRef = useRef(); + const [specList, setSpecList] = useState([]) + + useEffect(() => { + if (props.values.pbcCategoryLevel === 3) { + specificationListUsingGet().then(res => { + if (res.retcode && res.data) { + setSpecList(res.data) + } + }) + if (props.values.pbcId) { + getRecordByL3CategoryIdUsingGet({ l3CategoryId: props.values.pbcId }).then(res => { + if (res.retcode && res.data) { + const arr = new Set() + if (res.data.colorData) { + for (let i = 0; i < res.data.colorData.length; i++) { + const element = res.data.colorData[i]; + arr.add(element.pbcSpecificationId) + } + } + if (res.data.commonDataList) { + for (let i = 0; i < res.data.commonDataList.length; i++) { + const element = res.data.commonDataList[i]; + arr.add(element.pbcSpecificationId) + } + } + const ids = Array.from(arr); + formRef.current?.setFieldValue("pbcSpecificationList", ids) + } + }) + } + } + }, [props.values.pbcCategoryLevel, props.values.pbcId]) + return ( = (props) => { formRef={formRef} onFinish={(value) => { let pbcCategoryImage = "" - console.log(value) if (value.pbcCategoryImage && value.pbcCategoryImage.length > 0) { if (value.pbcCategoryImage[0].uid == '-1') { pbcCategoryImage = value.pbcCategoryImage[0].url; @@ -39,8 +73,8 @@ const UpdateForm: React.FC = (props) => { pbcCategoryImage = value.pbcCategoryImage[0].response.data; } } - console.log(pbcCategoryImage) - return props.onSubmit({ ...props.values, ...value, pbcCategoryImage, pbcId: props.values.pbcId }) + const arr = specList.filter(e => value.pbcSpecificationList && value.pbcSpecificationList.length > 0 && value.pbcSpecificationList.includes(e.pbcId)) + return props.onSubmit({ ...props.values, ...value, pbcSpecificationList: arr, pbcCategoryImage, pbcId: props.values.pbcId }) }} drawerProps={{ destroyOnClose: true, @@ -107,6 +141,17 @@ const UpdateForm: React.FC = (props) => { }} action={process.env.BASE_URL + '/oss/imgUpload'} /> + {props.values.pbcCategoryLevel === 3 ? { + return { + label: e.pbcSystemName || '', + value: e.pbcId || '' + } + })} + name="pbcSpecificationList" + /> : null} ); }; diff --git a/src/services/pop-b2b2c/errorController.ts b/src/services/pop-b2b2c/errorController.ts index 5f0967b..f29cc7f 100644 --- a/src/services/pop-b2b2c/errorController.ts +++ b/src/services/pop-b2b2c/errorController.ts @@ -2,41 +2,41 @@ /* eslint-disable */ import request from '@/utils/request'; -/** errorHtml GET /error */ -export async function errorHtmlUsingGet(options?: { [key: string]: any }) { - return request('/error', { +/** error GET /error */ +export async function errorUsingGet(options?: { [key: string]: any }) { + return request>('/error', { method: 'GET', ...(options || {}), }); } -/** errorHtml PUT /error */ -export async function errorHtmlUsingPut(options?: { [key: string]: any }) { - return request('/error', { +/** error PUT /error */ +export async function errorUsingPut(options?: { [key: string]: any }) { + return request>('/error', { method: 'PUT', ...(options || {}), }); } -/** errorHtml POST /error */ -export async function errorHtmlUsingPost(options?: { [key: string]: any }) { - return request('/error', { +/** error POST /error */ +export async function errorUsingPost(options?: { [key: string]: any }) { + return request>('/error', { method: 'POST', ...(options || {}), }); } -/** errorHtml DELETE /error */ -export async function errorHtmlUsingDelete(options?: { [key: string]: any }) { - return request('/error', { +/** error DELETE /error */ +export async function errorUsingDelete(options?: { [key: string]: any }) { + return request>('/error', { method: 'DELETE', ...(options || {}), }); } -/** errorHtml PATCH /error */ -export async function errorHtmlUsingPatch(options?: { [key: string]: any }) { - return request('/error', { +/** error PATCH /error */ +export async function errorUsingPatch(options?: { [key: string]: any }) { + return request>('/error', { method: 'PATCH', ...(options || {}), }); diff --git a/src/services/pop-b2b2c/pbcCategoryController.ts b/src/services/pop-b2b2c/pbcCategoryController.ts index 00f1cfa..c9dc33b 100644 --- a/src/services/pop-b2b2c/pbcCategoryController.ts +++ b/src/services/pop-b2b2c/pbcCategoryController.ts @@ -102,7 +102,7 @@ export async function saveOrUpdateCategoryUsingPost( body: API.PbcCategory, options?: { [key: string]: any }, ) { - return request('/b2b2c/pbccategory/saveOrUpdateCategory', { + return request('/b2b2c/pbccategory/saveOrUpdateCategory', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/src/services/pop-b2b2c/pbcSpecificationController.ts b/src/services/pop-b2b2c/pbcSpecificationController.ts index 8326edd..4250829 100644 --- a/src/services/pop-b2b2c/pbcSpecificationController.ts +++ b/src/services/pop-b2b2c/pbcSpecificationController.ts @@ -32,13 +32,13 @@ export async function addSpecificationItemUsingPost( }); } -/** changeSpecificationItemState 修改规格项状态,传pbcId和pbcState GET /b2b2c/pbcSpecification/changeSpecificationItemState */ -export async function changeSpecificationItemStateUsingGet( +/** changeSpecificationItemState 修改规格项状态,传pbcId和pbcState POST /b2b2c/pbcSpecification/changeSpecificationItemState */ +export async function changeSpecificationItemStateUsingPost( body: API.PbcCommonDataValue, options?: { [key: string]: any }, ) { return request('/b2b2c/pbcSpecification/changeSpecificationItemState', { - method: 'GET', + method: 'POST', headers: { 'Content-Type': 'application/json', },