Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
0ccb5fe8
提交
0ccb5fe8
authored
7月 22, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复:飞手培训问题修复
上级
77ddcb03
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
70 行增加
和
62 行删除
+70
-62
index.tsx
...categoryManage/category/components/EditableCell/index.tsx
+1
-1
index.scss
...nation/addOrEditInstitution/components/skuInfo/index.scss
+4
-4
index.tsx
...ination/addOrEditInstitution/components/skuInfo/index.tsx
+24
-27
index.tsx
...ning/ licensureExamination/addOrEditInstitution/index.tsx
+28
-24
index.tsx
...Training/ licensureExamination/institutionsList/index.tsx
+13
-6
没有找到文件。
src/pages/categoryManage/category/components/EditableCell/index.tsx
浏览文件 @
0ccb5fe8
import
{
Form
,
Input
,
InputNumber
}
from
'antd'
;
import
{
Form
,
Input
}
from
'antd'
;
interface
Item
{
interface
Item
{
key
:
string
;
key
:
string
;
...
...
src/pages/pilotTraining/ licensureExamination/addOrEditInstitution/components/skuInfo/index.scss
浏览文件 @
0ccb5fe8
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
font-weight
:
bold
;
font-weight
:
bold
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
line-height
:
20px
;
line-height
:
20px
;
&
:before
{
//
&:before{
content
:
'*'
;
//
content: '*';
color
:
red
;
//
color: red;
}
//
}
}
}
&
-table
{
&
-table
{
...
...
src/pages/pilotTraining/ licensureExamination/addOrEditInstitution/components/skuInfo/index.tsx
浏览文件 @
0ccb5fe8
...
@@ -15,11 +15,9 @@ type ColumnTypes = Exclude<EditableTableProps['columns'], undefined>;
...
@@ -15,11 +15,9 @@ type ColumnTypes = Exclude<EditableTableProps['columns'], undefined>;
type
tableDataType
=
{
type
tableDataType
=
{
gradeId
:
number
;
gradeId
:
number
;
id
:
number
;
id
:
number
;
mainImage
:
string
;
modelsId
:
number
;
modelsId
:
number
;
price
:
number
;
price
:
number
;
typeId
:
number
;
typeId
:
number
;
fileList
:
any
[];
};
};
//机型下拉返回类型
//机型下拉返回类型
type
modelsListType
=
InterDataType
<
licenceModelsListType
>
;
type
modelsListType
=
InterDataType
<
licenceModelsListType
>
;
...
@@ -49,6 +47,9 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -49,6 +47,9 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
return
Promise
.
reject
(
new
Error
(
'价格大于0且小于10万'
));
return
Promise
.
reject
(
new
Error
(
'价格大于0且小于10万'
));
}
}
}
else
{
}
else
{
if
(
value
===
undefined
||
value
===
''
||
value
===
null
)
{
return
Promise
.
resolve
();
}
return
Promise
.
reject
(
new
Error
(
'价格为数字且保留小数点后两位'
));
return
Promise
.
reject
(
new
Error
(
'价格为数字且保留小数点后两位'
));
}
}
return
Promise
.
resolve
();
return
Promise
.
resolve
();
...
@@ -67,15 +68,15 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -67,15 +68,15 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
render
:
(
_text
:
string
,
_record
,
index
:
number
)
=>
index
+
1
,
render
:
(
_text
:
string
,
_record
,
index
:
number
)
=>
index
+
1
,
width
:
'10%'
,
width
:
'10%'
,
},
},
{
//
{
title
:
'培训主图'
,
//
title: '培训主图',
align
:
'center'
,
//
align: 'center',
dataIndex
:
'mainImage'
,
//
dataIndex: 'mainImage',
width
:
'10%'
,
//
width: '10%',
inputType
:
'uploader'
,
//
inputType: 'uploader',
editable
:
true
,
//
editable: true,
rules
:
[{
required
:
true
,
message
:
'请上传培训主图'
}],
//
rules: [{ required: true, message: '请上传培训主图' }],
},
//
},
{
{
title
:
'培训机型'
,
title
:
'培训机型'
,
align
:
'center'
,
align
:
'center'
,
...
@@ -84,7 +85,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -84,7 +85,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
inputType
:
'select'
,
inputType
:
'select'
,
width
:
'15%'
,
width
:
'15%'
,
selectOption
:
modelsList
,
selectOption
:
modelsList
,
rules
:
[{
required
:
true
,
message
:
'请选择培训机型'
}],
//
rules: [{ required: true, message: '请选择培训机型' }],
},
},
{
{
title
:
'培训等级'
,
title
:
'培训等级'
,
...
@@ -94,7 +95,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -94,7 +95,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
inputType
:
'select'
,
inputType
:
'select'
,
width
:
'15%'
,
width
:
'15%'
,
selectOption
:
gradeList
,
selectOption
:
gradeList
,
rules
:
[{
required
:
true
,
message
:
'请选择培训等级'
}],
//
rules: [{ required: true, message: '请选择培训等级' }],
},
},
{
{
title
:
'培训类型'
,
title
:
'培训类型'
,
...
@@ -104,7 +105,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -104,7 +105,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
inputType
:
'select'
,
inputType
:
'select'
,
width
:
'15%'
,
width
:
'15%'
,
selectOption
:
typeList
,
selectOption
:
typeList
,
rules
:
[{
required
:
true
,
message
:
'请选择培训类型'
}],
//
rules: [{ required: true, message: '请选择培训类型' }],
},
},
{
{
title
:
'培训价格'
,
title
:
'培训价格'
,
...
@@ -112,7 +113,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -112,7 +113,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
editable
:
true
,
editable
:
true
,
dataIndex
:
'price'
,
dataIndex
:
'price'
,
width
:
'12%'
,
width
:
'12%'
,
rules
:
[{
required
:
tru
e
,
validator
:
priceValidator
}],
rules
:
[{
required
:
fals
e
,
validator
:
priceValidator
}],
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
...
@@ -160,7 +161,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -160,7 +161,7 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
editing
:
true
,
editing
:
true
,
selectOption
:
col
.
selectOption
,
selectOption
:
col
.
selectOption
,
inputType
:
col
.
inputType
,
inputType
:
col
.
inputType
,
uploadSuccess
:
col
.
inputType
===
'uploader'
?
uploadSuccess
:
undefined
,
//
uploadSuccess: col.inputType === 'uploader' ? uploadSuccess : undefined,
rules
:
col
.
rules
,
rules
:
col
.
rules
,
}),
}),
};
};
...
@@ -169,11 +170,9 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -169,11 +170,9 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
{
{
id
:
Math
.
random
(),
id
:
Math
.
random
(),
gradeId
:
-
1
,
gradeId
:
-
1
,
mainImage
:
''
,
modelsId
:
-
1
,
modelsId
:
-
1
,
price
:
-
1
,
price
:
-
1
,
typeId
:
-
1
,
typeId
:
-
1
,
fileList
:
[],
},
},
]);
]);
useImperativeHandle
(
ref
,
()
=>
({
useImperativeHandle
(
ref
,
()
=>
({
...
@@ -191,11 +190,9 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -191,11 +190,9 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
{
{
id
:
Math
.
random
(),
id
:
Math
.
random
(),
gradeId
:
-
1
,
gradeId
:
-
1
,
mainImage
:
''
,
modelsId
:
-
1
,
modelsId
:
-
1
,
price
:
-
1
,
price
:
-
1
,
typeId
:
-
1
,
typeId
:
-
1
,
fileList
:
[],
},
},
]);
]);
};
};
...
@@ -206,13 +203,13 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
...
@@ -206,13 +203,13 @@ const SkuInfo: FC<selfProps> = forwardRef((_props, ref) => {
setTableData
([...
tableData
]);
setTableData
([...
tableData
]);
};
};
//主图上传
//主图上传
const
uploadSuccess
=
(
record
:
tableDataType
,
result
:
any
)
=>
{
//
const uploadSuccess = (record: tableDataType, result: any) => {
const
index
:
number
=
tableData
.
findIndex
((
v
)
=>
v
.
id
===
record
.
id
);
//
const index: number = tableData.findIndex((v) => v.id === record.id);
skuForm
.
setFieldValue
(
'mainImage'
+
record
.
id
,
result
[
0
].
url
);
//
skuForm.setFieldValue('mainImage' + record.id, result[0].url);
tableData
[
index
].
mainImage
=
result
[
0
].
url
;
//
tableData[index].mainImage = result[0].url;
tableData
[
index
].
fileList
=
result
;
//
tableData[index].fileList = result;
setTableData
([...
tableData
]);
//
setTableData([...tableData]);
};
//
};
//培训机型下拉
//培训机型下拉
const
getLicenceModelsList
=
()
=>
{
const
getLicenceModelsList
=
()
=>
{
PilotTrainAPI
.
getLicenceModelsList
().
then
(({
result
})
=>
{
PilotTrainAPI
.
getLicenceModelsList
().
then
(({
result
})
=>
{
...
...
src/pages/pilotTraining/ licensureExamination/addOrEditInstitution/index.tsx
浏览文件 @
0ccb5fe8
...
@@ -46,14 +46,23 @@ const AddOrEditInstitution = () => {
...
@@ -46,14 +46,23 @@ const AddOrEditInstitution = () => {
if
(
!
introduceInfo
)
{
if
(
!
introduceInfo
)
{
return
message
.
warning
(
'机构介绍不能为空'
);
return
message
.
warning
(
'机构介绍不能为空'
);
}
}
const
skuReqData
=
skuRef
.
current
.
getTableData
().
map
((
v
:
tableDataType
)
=>
{
const
skuReqData
=
skuRef
.
current
.
getTableData
().
reduce
((
list
:
any
,
v
:
tableDataType
)
=>
{
return
Object
.
getOwnPropertyNames
(
v
).
reduce
((
pre
:
any
,
cur
:
string
)
=>
{
const
Obj
=
Object
.
getOwnPropertyNames
(
v
).
reduce
((
pre
:
any
,
cur
:
string
)
=>
{
if
(
Object
.
getOwnPropertyNames
(
value
[
1
]).
includes
(
cur
+
v
.
id
))
{
if
(
Object
.
getOwnPropertyNames
(
value
[
1
]).
includes
(
cur
+
v
.
id
))
{
pre
[
cur
]
=
value
[
1
][
cur
+
v
.
id
];
pre
[
cur
]
=
value
[
1
][
cur
+
v
.
id
];
}
}
return
pre
;
return
pre
;
},
{});
},
{});
});
if
(
Object
.
getOwnPropertyNames
(
Obj
).
length
&&
!
Object
.
getOwnPropertyNames
(
Obj
).
every
(
(
key
:
string
)
=>
Obj
[
key
]
===
''
||
Obj
[
key
]
===
undefined
||
Obj
[
key
]
===
null
,
)
)
{
list
.
push
(
Obj
);
}
return
list
;
},
[]);
PilotTrainAPI
[
institutionId
?
'updateOrg'
:
'insertOrg'
]({
PilotTrainAPI
[
institutionId
?
'updateOrg'
:
'insertOrg'
]({
...
value
[
0
],
...
value
[
0
],
trainingProgramsVOS
:
skuReqData
,
trainingProgramsVOS
:
skuReqData
,
...
@@ -139,27 +148,22 @@ const AddOrEditInstitution = () => {
...
@@ -139,27 +148,22 @@ const AddOrEditInstitution = () => {
]
]
:
[],
:
[],
);
);
const
programsList
=
institutionDetail
.
programsDOList
.
map
((
v
)
=>
({
if
(
institutionDetail
.
programsDOList
)
{
...
v
,
const
programsList
=
institutionDetail
.
programsDOList
.
map
((
v
)
=>
({
fileList
:
[
...
v
,
{
}));
id
:
Math
.
random
(),
skuRef
.
current
.
setDefaultDataEvent
().
setDefaultTableData
(
programsList
);
uid
:
Math
.
random
(),
const
skuObj
=
institutionDetail
.
programsDOList
.
reduce
((
pre
:
any
,
cur
:
any
)
=>
{
name
:
'img'
,
Object
.
getOwnPropertyNames
(
cur
)
url
:
v
.
mainImage
,
.
filter
((
key
:
string
)
=>
key
!==
'id'
)
},
.
forEach
((
v
:
string
)
=>
{
],
pre
[
v
+
cur
.
id
]
=
cur
[
v
];
}));
});
skuRef
.
current
.
setDefaultDataEvent
().
setDefaultTableData
(
programsList
);
return
pre
;
const
skuObj
=
institutionDetail
.
programsDOList
.
reduce
((
pre
:
any
,
cur
:
any
)
=>
{
},
{});
Object
.
getOwnPropertyNames
(
cur
)
skuRef
.
current
.
getForm
().
setFieldsValue
(
skuObj
);
.
filter
((
key
:
string
)
=>
key
!==
'id'
)
}
.
forEach
((
v
:
string
)
=>
{
pre
[
v
+
cur
.
id
]
=
cur
[
v
];
});
return
pre
;
},
{});
skuRef
.
current
.
getForm
().
setFieldsValue
(
skuObj
);
setIntroduceInfo
(
institutionDetail
.
detail
);
setIntroduceInfo
(
institutionDetail
.
detail
);
}
}
},
[
institutionDetail
]);
},
[
institutionDetail
]);
...
...
src/pages/pilotTraining/ licensureExamination/institutionsList/index.tsx
浏览文件 @
0ccb5fe8
...
@@ -79,12 +79,19 @@ const InstitutionsList = () => {
...
@@ -79,12 +79,19 @@ const InstitutionsList = () => {
{
{
title
:
'培训类型'
,
title
:
'培训类型'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
_text
:
string
,
record
)
=>
render
:
(
_text
:
string
,
record
:
any
)
=>
record
.
programsDOList
[
0
].
gradeName
+
record
.
programsDOList
'/'
+
?
Object
.
getOwnPropertyNames
(
record
.
programsDOList
[
0
])
record
.
programsDOList
[
0
].
modelsName
+
.
filter
(
'/'
+
(
key
:
string
)
=>
record
.
programsDOList
[
0
].
typeName
,
[
'gradeName'
,
'modelsName'
,
'typeName'
].
includes
(
key
)
&&
record
.
programsDOList
[
0
][
key
]
!==
undefined
&&
record
.
programsDOList
[
0
][
key
]
!==
''
&&
record
.
programsDOList
[
0
][
key
]
!==
null
,
)
.
map
((
key
:
string
)
=>
record
.
programsDOList
[
0
][
key
])
.
join
(
'/'
)
:
''
,
width
:
'20%'
,
width
:
'20%'
,
},
},
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论