Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
24da3ab0
提交
24da3ab0
authored
7月 21, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:商城改版
上级
807c35cb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
295 行增加
和
23 行删除
+295
-23
index.tsx
src/components/EditableCell/index.tsx
+14
-2
index.tsx
...oods/goodsAddOrEditOrDetail/components/baseInfo/index.tsx
+50
-0
index.tsx
...goodsAddOrEditOrDetail/components/introduceInfo/index.tsx
+10
-0
index.tsx
...sAddOrEditOrDetail/components/skuAddOrEditModal/index.tsx
+143
-0
index.tsx
...Goods/goodsAddOrEditOrDetail/components/skuInfo/index.tsx
+52
-0
index-old.tsx
...mallManage/mallGoods/goodsAddOrEditOrDetail/index-old.tsx
+0
-0
index.scss
...es/mallManage/mallGoods/goodsAddOrEditOrDetail/index.scss
+15
-10
index.tsx
...ges/mallManage/mallGoods/goodsAddOrEditOrDetail/index.tsx
+0
-0
router.tsx
src/router/router.tsx
+11
-11
没有找到文件。
src/components/EditableCell/index.tsx
浏览文件 @
24da3ab0
import
{
Form
,
InputNumber
,
Input
,
Select
}
from
'antd'
;
import
{
Form
,
InputNumber
,
Input
,
Select
,
Radio
}
from
'antd'
;
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
...
@@ -8,7 +8,7 @@ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
...
@@ -8,7 +8,7 @@ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
editing
:
boolean
;
editing
:
boolean
;
dataIndex
:
string
;
dataIndex
:
string
;
title
:
any
;
title
:
any
;
inputType
:
'number'
|
'text'
|
'select'
|
'uploader'
;
inputType
:
'number'
|
'text'
|
'select'
|
'uploader'
|
'radio'
;
record
:
any
;
record
:
any
;
index
:
number
;
index
:
number
;
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
...
@@ -16,6 +16,7 @@ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
...
@@ -16,6 +16,7 @@ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
const
EditableCell
:
React
.
FC
<
const
EditableCell
:
React
.
FC
<
EditableCellProps
&
{
EditableCellProps
&
{
selectOption
?:
{
name
:
string
;
id
:
number
}[];
selectOption
?:
{
name
:
string
;
id
:
number
}[];
radioOption
?:
{
name
:
string
;
id
:
number
}[];
uploadSuccess
?:
(
record
:
any
,
result
:
any
)
=>
void
;
uploadSuccess
?:
(
record
:
any
,
result
:
any
)
=>
void
;
rules
?:
any
;
rules
?:
any
;
}
}
...
@@ -27,6 +28,7 @@ const EditableCell: React.FC<
...
@@ -27,6 +28,7 @@ const EditableCell: React.FC<
record
,
record
,
index
,
index
,
selectOption
,
selectOption
,
radioOption
,
uploadSuccess
,
uploadSuccess
,
children
,
children
,
rules
,
rules
,
...
@@ -58,6 +60,16 @@ const EditableCell: React.FC<
...
@@ -58,6 +60,16 @@ const EditableCell: React.FC<
<
UploadOutlined
/>
<
UploadOutlined
/>
</
Uploader
>
</
Uploader
>
);
);
case
'radio'
:
return
(
<
Radio
.
Group
>
{
radioOption
?.
map
((
v
)
=>
(
<
Radio
value=
{
v
.
id
}
key=
{
v
.
id
}
>
{
v
.
name
}
</
Radio
>
))
}
</
Radio
.
Group
>
);
default
:
default
:
return
<
Input
placeholder=
{
`请输入${title}`
}
/>;
return
<
Input
placeholder=
{
`请输入${title}`
}
/>;
}
}
...
...
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/components/baseInfo/index.tsx
0 → 100644
浏览文件 @
24da3ab0
import
{
Button
,
Cascader
,
Form
,
Input
,
Radio
,
Select
}
from
'antd'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
const
BaseInfo
=
()
=>
{
const
[
baseInfoForm
]
=
Form
.
useForm
();
return
(
<
div
className=
'base-info'
>
<
Form
labelCol=
{
{
span
:
1
}
}
wrapperCol=
{
{
span
:
8
}
}
form=
{
baseInfoForm
}
>
<
Form
.
Item
label=
'商品名称'
>
<
Input
placeholder=
'请输入商品名称'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品描述'
>
<
Input
.
TextArea
rows=
{
4
}
placeholder=
'请输入商品描述'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品主图'
>
<
Uploader
fileUpload
listType=
'picture-card'
>
<
UploadOutlined
/>
</
Uploader
>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品副图'
>
<
Uploader
fileUpload
listType=
'picture-card'
>
<
UploadOutlined
/>
</
Uploader
>
</
Form
.
Item
>
{
' '
}
<
Form
.
Item
label=
'商品视频'
>
<
Uploader
fileUpload
listType=
'text'
>
<
Button
icon=
{
<
UploadOutlined
/>
}
>
上传视频
</
Button
>
</
Uploader
>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品分类'
>
<
Cascader
placeholder=
'请选择商品分类'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品状态'
>
<
Select
placeholder=
'请选择商品状态'
>
<
Select
.
Option
>
上架
</
Select
.
Option
>
<
Select
.
Option
>
下架
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'商品标签'
>
<
Radio
.
Group
>
<
Radio
value=
{
1
}
>
显示
</
Radio
>
<
Radio
value=
{
0
}
>
不显示
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
export
default
BaseInfo
;
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/components/introduceInfo/index.tsx
0 → 100644
浏览文件 @
24da3ab0
import
RichText
from
'~/components/richText'
;
const
IntroduceInfo
=
()
=>
{
return
(
<
div
className=
'introduce-info'
>
<
RichText
richTextContent=
''
height=
{
400
}
/>
</
div
>
);
};
export
default
IntroduceInfo
;
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/components/skuAddOrEditModal/index.tsx
0 → 100644
浏览文件 @
24da3ab0
import
{
Button
,
Form
,
Input
,
Modal
,
ModalProps
,
Radio
,
Select
,
Table
}
from
'antd'
;
import
{
FC
,
useState
}
from
'react'
;
import
EditableCell
from
'~/components/EditableCell'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
type
EditableTableProps
=
Parameters
<
typeof
Table
>
[
0
];
type
ColumnTypes
=
Exclude
<
EditableTableProps
[
'columns'
],
undefined
>
;
interface
selfProps
{
onCancel
:
()
=>
void
;
}
const
SkuAddOrEditModal
:
FC
<
ModalProps
&
selfProps
>
=
({
open
,
onCancel
})
=>
{
const
[
tableData
]
=
useState
<
any
>
([{
id
:
1
}]);
const
defaultColumns
:
(
ColumnTypes
[
number
]
&
{
editable
?:
boolean
;
dataIndex
?:
string
;
inputType
?:
string
;
radioOption
?:
{
name
:
string
;
id
:
number
}[];
})[]
=
[
{
title
:
'图片'
,
align
:
'center'
,
editable
:
true
,
dataIndex
:
''
,
inputType
:
'uploader'
,
},
{
title
:
'选项名称'
,
align
:
'center'
,
editable
:
true
,
dataIndex
:
''
,
},
{
title
:
'料号'
,
align
:
'center'
,
editable
:
true
,
dataIndex
:
''
,
},
{
title
:
'销售价'
,
align
:
'center'
,
editable
:
true
,
dataIndex
:
''
,
},
{
title
:
'渠道价'
,
editable
:
true
,
align
:
'center'
,
dataIndex
:
''
,
},
{
title
:
'库存'
,
editable
:
true
,
align
:
'center'
,
dataIndex
:
''
,
},
{
title
:
'是否显示'
,
editable
:
true
,
align
:
'center'
,
dataIndex
:
''
,
inputType
:
'radio'
,
width
:
'20%'
,
radioOption
:
[
{
id
:
1
,
name
:
'显示'
},
{
id
:
0
,
name
:
'不显示'
},
],
},
{
title
:
'操作'
,
align
:
'center'
,
width
:
'10%'
,
render
:
()
=>
(
<>
<
Button
type=
'primary'
icon=
{
<
PlusOutlined
/>
}
></
Button
>
</>
),
},
];
const
columns
=
defaultColumns
.
map
((
col
)
=>
{
if
(
!
col
.
editable
)
{
return
col
;
}
return
{
...
col
,
onCell
:
(
record
:
any
)
=>
({
record
,
dataIndex
:
col
.
dataIndex
,
title
:
col
.
title
,
editing
:
col
.
editable
,
radioOption
:
col
.
radioOption
,
inputType
:
col
.
inputType
,
}),
};
});
const
handleCancel
=
()
=>
{
onCancel
();
};
return
(
<
Modal
open=
{
open
}
title=
'添加规格'
width=
{
1000
}
onCancel=
{
handleCancel
}
>
<
Form
labelCol=
{
{
span
:
2
}
}
wrapperCol=
{
{
span
:
22
}
}
>
<
Form
.
Item
label=
'规格名称'
>
<
Input
placeholder=
'请输入规格名称'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'规格值'
>
<
Form
component=
{
false
}
>
<
Table
rowKey=
'id'
columns=
{
columns
as
ColumnTypes
}
components=
{
{
body
:
{
cell
:
EditableCell
,
},
}
}
bordered
dataSource=
{
tableData
}
></
Table
>
</
Form
>
</
Form
.
Item
>
<
Form
.
Item
label=
'选择方式'
>
<
Radio
.
Group
>
<
Radio
>
单选
</
Radio
>
<
Radio
>
多选
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
label=
'是否必选'
>
<
Radio
.
Group
>
<
Radio
>
非必选
</
Radio
>
<
Radio
>
必选
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
<
Form
.
Item
label=
'规格单位'
>
<
Select
>
<
Select
.
Option
value=
{
0
}
>
件
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
</
Form
>
</
Modal
>
);
};
export
default
SkuAddOrEditModal
;
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/components/skuInfo/index.tsx
0 → 100644
浏览文件 @
24da3ab0
import
{
Button
,
Table
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
FC
}
from
'react'
;
interface
selfProps
{
addOrEditSkuClick
:
()
=>
void
;
}
const
SkuInfo
:
FC
<
selfProps
>
=
({
addOrEditSkuClick
})
=>
{
const
TableColumns
:
ColumnsType
<
any
>
=
[
{
title
:
'序号'
,
align
:
'center'
,
},
{
title
:
'规格名称'
,
align
:
'center'
,
},
{
title
:
'选择方式'
,
align
:
'center'
,
},
{
title
:
'是否必选'
,
align
:
'center'
,
},
{
title
:
'规格单位'
,
align
:
'center'
,
},
{
title
:
'操作'
,
align
:
'center'
,
},
];
return
(
<
div
className=
'sku-info'
>
<
div
className=
'sku-info-operate'
style=
{
{
margin
:
' 20px 0 '
}
}
>
<
Button
type=
'primary'
icon=
{
<
PlusOutlined
></
PlusOutlined
>
}
onClick=
{
()
=>
addOrEditSkuClick
()
}
>
添加规格
</
Button
>
</
div
>
<
Table
bordered
columns=
{
TableColumns
}
/>
</
div
>
);
};
export
default
SkuInfo
;
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/index-old.tsx
0 → 100644
浏览文件 @
24da3ab0
差异被折叠。
点击展开。
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/index.scss
浏览文件 @
24da3ab0
.goods-info
{
.goods-operate-wrap
{
&
-operate
{
position
:
relative
;
margin-top
:
50px
;
.next-step
{
display
:
flex
;
margin
:
20px
0
0
0px
;
justify-content
:
center
;
text-align
:
center
;
button
{
button
{
width
:
100px
;
&
:first-child
{
height
:
40px
;
margin-right
:
20px
;
&
:first-child
{
margin-right
:
50px
;
}
}
width
:
100px
;
}
}
}
}
.back-btn
{
position
:
absolute
;
right
:
0
;
top
:
0
;
}
}
}
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/index.tsx
浏览文件 @
24da3ab0
差异被折叠。
点击展开。
src/router/router.tsx
浏览文件 @
24da3ab0
...
@@ -467,16 +467,6 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -467,16 +467,6 @@ export const routerList: Array<RouteObjectType> = [
},
},
children
:
[
children
:
[
{
{
path
:
'/mallManage/courseManage'
,
element
:
withLoadingComponent
(<
CourseManageView
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
1010
,
icon
:
<
BookOutlined
/>,
title
:
'课程管理'
,
},
},
{
path
:
'/mallManage/serviceList'
,
path
:
'/mallManage/serviceList'
,
element
:
withLoadingComponent
(<
ServiceListView
/>),
element
:
withLoadingComponent
(<
ServiceListView
/>),
errorElement
:
<
ErrorPage
/>,
errorElement
:
<
ErrorPage
/>,
...
@@ -903,7 +893,7 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -903,7 +893,7 @@ export const routerList: Array<RouteObjectType> = [
meta
:
{
meta
:
{
id
:
1600
,
id
:
1600
,
icon
:
<
BankOutlined
/>,
icon
:
<
BankOutlined
/>,
title
:
'
飞手
培训'
,
title
:
'
执照
培训'
,
},
},
children
:
[
children
:
[
{
{
...
@@ -938,6 +928,16 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -938,6 +928,16 @@ export const routerList: Array<RouteObjectType> = [
hidden
:
true
,
hidden
:
true
,
},
},
},
},
{
path
:
'/pilotTraining/courseManage'
,
element
:
withLoadingComponent
(<
CourseManageView
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
1010
,
icon
:
<
BookOutlined
/>,
title
:
'课程管理'
,
},
},
],
],
},
},
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论