提交 d1f90f95 作者: 翁进城

Merge branch 'master' into develop

...@@ -66,3 +66,12 @@ export type directoryListType = InterFunction< ...@@ -66,3 +66,12 @@ export type directoryListType = InterFunction<
type: number; type: number;
}[] }[]
>; >;
//目录列表-产品指定
export type directoryProductType = InterFunction<
any,
{
id: number;
directoryName: string;
type: number;
}[]
>;
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
ProductSpecListType, ProductSpecListType,
productSpecPriceType, productSpecPriceType,
} from '~/api/interface/produceManageType'; } from '~/api/interface/produceManageType';
import { directoryProductType } from '~/api/interface/categoryManage';
export class ProduceManageAPI { export class ProduceManageAPI {
// 产品管理-分页列表 // 产品管理-分页列表
...@@ -70,4 +71,8 @@ export class ProduceManageAPI { ...@@ -70,4 +71,8 @@ export class ProduceManageAPI {
static getCooperationListTag: cooperationTagType = () => { static getCooperationListTag: cooperationTagType = () => {
return axios.get('/userapp/cooperation/listTag'); return axios.get('/userapp/cooperation/listTag');
}; };
// 产品-目录
static getProductDirectoryList: directoryProductType = () => {
return axios.get('/pms/product/spec/productDirectoryList');
};
} }
...@@ -64,7 +64,7 @@ export const Uploader: React.FC<PropsType> = (props) => { ...@@ -64,7 +64,7 @@ export const Uploader: React.FC<PropsType> = (props) => {
return isType; return isType;
} }
if (!isSize) { if (!isSize) {
message.error('文件最大2M,请压缩后上传!').then(); message.error(`文件最大${props.fileSize}M,请压缩后上传!`).then();
return isSize; return isSize;
} }
}, },
......
...@@ -129,7 +129,7 @@ const Category: FC = (props: any) => { ...@@ -129,7 +129,7 @@ const Category: FC = (props: any) => {
render: (text: string, record: categoryEntity, index: number) => { render: (text: string, record: categoryEntity, index: number) => {
return ( return (
<div className='table-option-wrap'> <div className='table-option-wrap'>
{record.children?.length > 0 ? ( {record.level == 1 ? (
<> <>
{btnAddChildCgy ? ( {btnAddChildCgy ? (
<Button <Button
...@@ -418,7 +418,7 @@ const Category: FC = (props: any) => { ...@@ -418,7 +418,7 @@ const Category: FC = (props: any) => {
}; };
// 新增子分类 // 新增子分类
const sureAddChildrenCgy = (record: categoryEntity) => { const sureAddChildrenCgy = (record: categoryEntity) => {
let pid: string | number = -1; let pid: string | number;
categoryList.map((item: categoryEntity) => { categoryList.map((item: categoryEntity) => {
if (item.children && item.children.length != 0) { if (item.children && item.children.length != 0) {
const bol: boolean = item.children.some( const bol: boolean = item.children.some(
......
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import SearchBox from '~/components/search-box'; 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 { ColumnsType } from 'antd/es/table';
import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal'; import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal';
import { InterListType, InterReqType } from '~/api/interface'; import { InterListType, InterReqType } from '~/api/interface';
import { listAppUserType } from '~/api/interface/customManageType'; import { listAppUserType } from '~/api/interface/customManageType';
import { CustomManageAPI } from '~/api'; import { CustomManageAPI, SystemManageAPI } from '~/api';
// 表格数据类型 // 表格数据类型
type TableType = InterListType<listAppUserType>; type TableType = InterListType<listAppUserType>;
...@@ -24,6 +24,7 @@ const portTypeList = [ ...@@ -24,6 +24,7 @@ const portTypeList = [
]; ];
function CustomListView() { function CustomListView() {
const { confirm } = Modal;
// 等级标签列表 // 等级标签列表
const [cooperationTagIdList, setCooperationTagIdList] = useState< const [cooperationTagIdList, setCooperationTagIdList] = useState<
{ value: number; label: string }[] { value: number; label: string }[]
...@@ -80,6 +81,23 @@ function CustomListView() { ...@@ -80,6 +81,23 @@ function CustomListView() {
// console.log(res.result); // 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 // componentDidMount
useEffect(() => { useEffect(() => {
query = {}; query = {};
...@@ -188,7 +206,7 @@ function CustomListView() { ...@@ -188,7 +206,7 @@ function CustomListView() {
> >
变更 变更
</Button> </Button>
<Button type={'link'} danger> <Button type={'link'} danger onClick={() => handleDelete(record)}>
删除 删除
</Button> </Button>
</> </>
......
...@@ -155,6 +155,7 @@ const AddEditModal: React.FC<propType> = (props) => { ...@@ -155,6 +155,7 @@ const AddEditModal: React.FC<propType> = (props) => {
listType={'picture-card'} listType={'picture-card'}
fileUpload fileUpload
fileLength={1} fileLength={1}
fileSize={10}
onChange={(e) => form.setFieldValue('surfaceUrl', e[0].url)} onChange={(e) => form.setFieldValue('surfaceUrl', e[0].url)}
defaultFileList={data?.surfaceUrl ? [{ url: data?.surfaceUrl }] : []} defaultFileList={data?.surfaceUrl ? [{ url: data?.surfaceUrl }] : []}
> >
...@@ -169,7 +170,7 @@ const AddEditModal: React.FC<propType> = (props) => { ...@@ -169,7 +170,7 @@ const AddEditModal: React.FC<propType> = (props) => {
<Form.Item <Form.Item
label='课程上传' label='课程上传'
name='videoUrl' name='videoUrl'
rules={[{ required: true, message: '请上传质检视频' }]} rules={[{ required: false, message: '请上传质检视频' }]}
style={{ marginBottom: '-40px' }} style={{ marginBottom: '-40px' }}
> >
<Uploader <Uploader
...@@ -177,7 +178,7 @@ const AddEditModal: React.FC<propType> = (props) => { ...@@ -177,7 +178,7 @@ const AddEditModal: React.FC<propType> = (props) => {
fileUpload fileUpload
fileLength={1} fileLength={1}
fileType={['video/mp4', 'video/avi', 'video/wmv', 'video/rmvb']} fileType={['video/mp4', 'video/avi', 'video/wmv', 'video/rmvb']}
fileSize={10} fileSize={1024}
onChange={(e) => form.setFieldValue('videoUrl', e[0].url)} onChange={(e) => form.setFieldValue('videoUrl', e[0].url)}
defaultFileList={data?.videoUrl ? [{ url: data?.videoUrl }] : []} defaultFileList={data?.videoUrl ? [{ url: data?.videoUrl }] : []}
> >
......
...@@ -189,7 +189,7 @@ function ProduceManage() { ...@@ -189,7 +189,7 @@ function ProduceManage() {
}; };
// 目录列表 // 目录列表
const getDirectoryList = () => { const getDirectoryList = () => {
CategoryManageAPI.getDirectoryListClone({ type: 4 }).then(({ result }) => { ProduceManageAPI.getProductDirectoryList().then(({ result }) => {
setDecList(result || []); setDecList(result || []);
}); });
}; };
......
...@@ -89,7 +89,7 @@ const GoodsAddOrEditOrDetail = () => { ...@@ -89,7 +89,7 @@ const GoodsAddOrEditOrDetail = () => {
}; };
//根据目录获取分类列表 //根据目录获取分类列表
const getCategoryList = (directoryId: number) => { const getCategoryList = (directoryId: number) => {
CategoryManageAPI.getCategoryList({ directoryId, type: 4, pageSize: 9999, pageNo: 1 }).then( CategoryManageAPI.getCategoryList({ directoryId, type: 2, pageSize: 9999, pageNo: 1 }).then(
({ result }) => { ({ result }) => {
setCategoryList(result.list || []); setCategoryList(result.list || []);
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论