提交 31204a5e 作者: 龚洪江

Merge remote-tracking branch 'origin/develop' into develop

......@@ -4,7 +4,7 @@ metadata:
name: admin-deployment
namespace: default
spec:
minReadySeconds: 120
# minReadySeconds: 120
revisionHistoryLimit: 2
replicas: 1
selector:
......
......@@ -14,4 +14,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag: 19f90a28239990b38b47b958a96806d6132fd492
newTag: 3bff7965b990c05ebcc4298bd4aea6b4281b4495
......@@ -66,3 +66,12 @@ export type directoryListType = InterFunction<
type: number;
}[]
>;
//目录列表-产品指定
export type directoryProductType = InterFunction<
any,
{
id: number;
directoryName: string;
type: number;
}[]
>;
......@@ -60,7 +60,7 @@ export type updateCurriculumType = InterFunction<
>;
// V1.0.1课程技能列表
export type treeCurriculumSkillType = InterFunction<
NonNullable<unknown>,
any,
{
id: number;
skillsName: string;
......@@ -73,3 +73,22 @@ export type treeCurriculumSkillType = InterFunction<
>;
// V1.0.1删除课程
export type removeCurriculumType = InterFunction<{ id: number }, NonNullable<unknown>>;
// 根据类型获取各个目录及分类信息
export type queryCategoryInfoByType = InterFunction<
{
/**
* 类型:1:作业服务 2:设备 3:培训 4:产品商城
*/
type: number
},
{
directoryId: number
name: string
categoriesInfoListDTO: Array<{
id: number
directoryId: number
name: string
icon: string
}>
}[]
>
......@@ -25,7 +25,7 @@ export class CategoryManageAPI {
};
// 新增或编辑目录
static addOrEditDirectory = (
data: { id?: number; directoryName: string; type: number; relevance: number }[],
data: { id?: number; directoryName: string; type: number; show: number[] },
) => {
return axios.post('/pms/classify/addOrEditDirectory', data);
};
......@@ -65,8 +65,8 @@ export class CategoryManageAPI {
};
// 删除分类
static deleteGoodsTypeByOneLevel = (params: object): any => {
return axios.get('uavgoods/mgoods/deleteGoodsTypeByOneLevel', { params });
static deleteRelevantBusiness = (params: object): any => {
return axios.get('/pms/classify/deleteRelevantBusiness', { params });
};
// 删除子分类
......
......@@ -14,6 +14,7 @@ import {
ProductSpecListType,
productSpecPriceType,
} from '~/api/interface/produceManageType';
import { directoryProductType } from '~/api/interface/categoryManage';
export class ProduceManageAPI {
// 产品管理-分页列表
......@@ -70,4 +71,8 @@ export class ProduceManageAPI {
static getCooperationListTag: cooperationTagType = () => {
return axios.get('/userapp/cooperation/listTag');
};
// 产品-目录
static getProductDirectoryList: directoryProductType = () => {
return axios.get('/pms/product/spec/productDirectoryList');
};
}
......@@ -87,6 +87,9 @@ const BaseInfo: React.FC<selfProps> = forwardRef(
});
};
const directorySelectChange = (value: number) => {
form.setFieldsValue({
masterTypeId: undefined,
});
getCategoryList(value);
};
//商品标签
......
......@@ -64,7 +64,7 @@ export const Uploader: React.FC<PropsType> = (props) => {
return isType;
}
if (!isSize) {
message.error('文件最大2M,请压缩后上传!').then();
message.error(`文件最大${props.fileSize}M,请压缩后上传!`).then();
return isSize;
}
},
......
......@@ -17,7 +17,6 @@ import {
ProfileOutlined,
} from '@ant-design/icons';
import AddCgyDailog from './components/addCgyDailog';
import DeleteCgyDailog from './components/deleteCgyDailog';
import EditableCell from './components/EditableCell';
import { CategoryManageAPI } from '~/api';
import { categoryEntity, categoryDec } from '~/api/interface/categoryManage';
......@@ -129,7 +128,7 @@ const Category: FC = (props: any) => {
render: (text: string, record: categoryEntity, index: number) => {
return (
<div className='table-option-wrap'>
{record.children?.length > 0 ? (
{record.level == 1 ? (
<>
{btnAddChildCgy ? (
<Button
......@@ -234,8 +233,6 @@ const Category: FC = (props: any) => {
const [activeViewerIndex] = useState<number>(0);
// 新增弹窗
const [isVisible, setIsVisible] = useState<boolean>(false);
// 删除弹窗
const [isDeleteVisible, setIsDeleteVisible] = useState<boolean>(false);
// 删除分类id
const [cgyId, setCgyId] = useState<number>(0);
// 弹窗title
......@@ -358,7 +355,8 @@ const Category: FC = (props: any) => {
...values,
id: currentRecord.id,
pid: currentRecord.pid,
sortTypeId: activeTabKey,
directoryId: activeTabKey,
type,
});
if (res.code === '200') {
message.success('修改成功');
......@@ -418,7 +416,7 @@ const Category: FC = (props: any) => {
};
// 新增子分类
const sureAddChildrenCgy = (record: categoryEntity) => {
let pid: string | number = -1;
let pid: string | number;
categoryList.map((item: categoryEntity) => {
if (item.children && item.children.length != 0) {
const bol: boolean = item.children.some(
......@@ -485,40 +483,21 @@ const Category: FC = (props: any) => {
};
// 删除分类
const deleteCgy = (record: categoryEntity) => {
setCgyId(Number(record.id));
setIsDeleteVisible(true);
};
// 删除弹窗确认
const deleteHandleOk = async () => {
const bol = categoryList.some((item: categoryEntity) => item.id === cgyId);
if (bol) {
const res = await CategoryManageAPI.deleteGoodsTypeByOneLevel({
id: cgyId,
sortTypeId: activeTabKey,
Modal.confirm({
title: '分类删除',
content: '确认删除该分类?',
async onOk() {
const res = await CategoryManageAPI.deleteRelevantBusiness({
id: record.id,
});
if (res.code === '200') {
message.success('删除成功');
getCategoryList(Number(activeTabKey));
} else {
message.warning(res.message);
message.error(res.message);
}
} else {
const res = await CategoryManageAPI.deleteGoodsTypeByChildren({
id: cgyId,
sortTypeId: activeTabKey,
},
});
if (res.code === '200') {
message.success('删除成功');
getCategoryList(Number(activeTabKey));
} else {
message.warning(res.message);
}
}
setIsDeleteVisible(false);
};
// 删除弹框取消
const deleteHandleCancel = () => {
setIsDeleteVisible(false);
};
// 编辑分类
const editCgy = (record: categoryEntity) => {
......@@ -528,7 +507,7 @@ const Category: FC = (props: any) => {
setTitle('修改分类');
const addForm = baseRef.current.getForm();
addForm.setFieldsValue({
directoryName: record.classifyName,
classifyName: record.classifyName,
description: record.description,
remark: record.remark,
});
......@@ -764,11 +743,6 @@ const Category: FC = (props: any) => {
baseRef={baseRef}
imgClick={imgClick}
/>
<DeleteCgyDailog
isDeleteVisable={isDeleteVisible}
deleteHandleOk={deleteHandleOk}
deleteHandleCancel={deleteHandleCancel}
/>
{/* 图片放大 */}
<Viewer
visible={visible}
......
......@@ -10,6 +10,7 @@ import {
RadioChangeEvent,
Radio,
Space,
Checkbox,
} from 'antd';
import React, { useEffect, useState } from 'react';
......@@ -54,7 +55,6 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
editData,
}) => {
const [form] = Form.useForm<any>();
const [hasPid, setHasPid] = useState(false); //是否有上级目录
const [submitLoading, setSubmitLoading] = useState(false); //提交按钮的loading
const [directoryOptions, setDirectoryOptions] = useState([]); //目录options
......@@ -66,10 +66,11 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
form.setFieldValue('directoryName', editData.directoryName);
onChangeType(editData.type);
if (editData.pid) {
setHasPid(true);
} else {
setHasPid(false);
if (editData.type == 0) {
form.setFieldValue(
'show',
editData.show?.map((value) => Number(value)),
);
}
}
}
......@@ -92,7 +93,6 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
const res = await CategoryManageAPI.addOrEditDirectory({
...values,
id: editData?.id,
pid: hasPid ? values.pid : null,
});
res.code == '200' && message.success('新增成功');
handleOk();
......@@ -142,6 +142,20 @@ const AddOrEditDec: React.FC<PropsType & selfPropsType> = ({
<Form.Item label='目录名称' name='directoryName' rules={[{ required: true }]}>
<Input placeholder='请输入目录名称' allowClear={true}></Input>
</Form.Item>
{form.getFieldValue('type') == '0' && (
<Form.Item
label='显示设置'
name='show'
rules={[{ required: true, message: '请选择显示设置' }]}
>
<Checkbox.Group>
<Checkbox value={1}>作业服务分类</Checkbox>
<Checkbox value={3}>飞手培训分类</Checkbox>
<Checkbox value={2}>设备租赁分类</Checkbox>
<Checkbox value={4}>产品商城分类</Checkbox>
</Checkbox.Group>
</Form.Item>
)}
</Form>
</Modal>
);
......
......@@ -50,7 +50,6 @@ const DirectoryManage: FC = (props: any) => {
});
//目录modal
const [isAddOrEditDecModal, setIsAddOrEditDecModal] = useState<boolean>(false);
const [reload, setReload] = useState(false);
const [editData, setEditData] = useState<categoryDec | null>(null);
const columns: ColumnsType<DataType> = [
......@@ -109,6 +108,10 @@ const DirectoryManage: FC = (props: any) => {
},
];
useEffect(() => {
getDirectoryList();
}, [pagination.current]);
// 目录弹窗
const showDecModal = () => {
setEditData(null);
......@@ -163,7 +166,7 @@ const DirectoryManage: FC = (props: any) => {
CategoryManageAPI.removeDirectory(id).then((res) => {
if (res.code == 200) {
message.success('删除成功');
setReload(!reload);
getDirectoryList();
} else {
message.error(res.message);
}
......@@ -172,10 +175,6 @@ const DirectoryManage: FC = (props: any) => {
});
};
useEffect(() => {
getDirectoryList();
}, [JSON.stringify(pagination), reload]);
const handleTableChange = (
pagination: TablePaginationConfig,
filters: Record<string, FilterValue>,
......
import { useEffect, useState } from 'react';
import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd';
import { Button, message, Modal, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal';
import { InterListType, InterReqType } from '~/api/interface';
import { listAppUserType } from '~/api/interface/customManageType';
import { CustomManageAPI } from '~/api';
import { CustomManageAPI, SystemManageAPI } from '~/api';
// 表格数据类型
type TableType = InterListType<listAppUserType>;
......@@ -24,6 +24,7 @@ const portTypeList = [
];
function CustomListView() {
const { confirm } = Modal;
// 等级标签列表
const [cooperationTagIdList, setCooperationTagIdList] = useState<
{ value: number; label: string }[]
......@@ -80,6 +81,23 @@ function CustomListView() {
// console.log(res.result);
}
};
// 删除用户
const handleDelete = (value: TableType[0]) => {
confirm({
title: '提示',
content: '是否删除该账号?',
onOk: async () => {
const res = await SystemManageAPI.removeBAccount({ userAccountId: value.id });
if (res && res.code === '200') {
message.success('删除成功');
paginationChange(
tableData.length === 1 ? pagination.current - 1 : pagination.current,
pagination.pageSize,
);
}
},
});
};
// componentDidMount
useEffect(() => {
query = {};
......@@ -188,7 +206,7 @@ function CustomListView() {
>
变更
</Button>
<Button type={'link'} danger>
<Button type={'link'} danger onClick={() => handleDelete(record)}>
删除
</Button>
</>
......
......@@ -155,6 +155,7 @@ const AddEditModal: React.FC<propType> = (props) => {
listType={'picture-card'}
fileUpload
fileLength={1}
fileSize={10}
onChange={(e) => form.setFieldValue('surfaceUrl', e[0].url)}
defaultFileList={data?.surfaceUrl ? [{ url: data?.surfaceUrl }] : []}
>
......@@ -169,7 +170,7 @@ const AddEditModal: React.FC<propType> = (props) => {
<Form.Item
label='课程上传'
name='videoUrl'
rules={[{ required: true, message: '请上传质检视频' }]}
rules={[{ required: false, message: '请上传质检视频' }]}
style={{ marginBottom: '-40px' }}
>
<Uploader
......@@ -177,7 +178,7 @@ const AddEditModal: React.FC<propType> = (props) => {
fileUpload
fileLength={1}
fileType={['video/mp4', 'video/avi', 'video/wmv', 'video/rmvb']}
fileSize={10}
fileSize={1024}
onChange={(e) => form.setFieldValue('videoUrl', e[0].url)}
defaultFileList={data?.videoUrl ? [{ url: data?.videoUrl }] : []}
>
......
......@@ -189,7 +189,7 @@ function ProduceManage() {
};
// 目录列表
const getDirectoryList = () => {
CategoryManageAPI.getDirectoryListClone({ type: 4 }).then(({ result }) => {
ProduceManageAPI.getProductDirectoryList().then(({ result }) => {
setDecList(result || []);
});
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论