|
@@ -2,7 +2,7 @@
|
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
|
* @Date: 2023-03-03 11:30:33
|
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
|
- * @LastEditTime: 2023-04-20 15:27:22
|
|
|
+ * @LastEditTime: 2023-04-20 18:10:17
|
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
*/
|
|
@@ -103,13 +103,13 @@ export default function CheckUnitClassficationMana() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const updateTable = async (formVal: any, type: 'EDIT' | "ADD"|'ADDCHILD') => {
|
|
|
+ const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'ADDCHILD') => {
|
|
|
|
|
|
|
|
|
- if (type == 'ADD'||type == 'ADDCHILD') {
|
|
|
+ if (type == 'ADD' || type == 'ADDCHILD') {
|
|
|
const resp = await addData({
|
|
|
- ...formVal,
|
|
|
- parentClassCode:formVal.parentClassCode?formVal.parentClassCode:'0'
|
|
|
+ ...formVal,
|
|
|
+ parentClassCode: formVal.parentClassCode ? formVal.parentClassCode : '0'
|
|
|
});
|
|
|
if (resp) {
|
|
|
tableRef.current?.reload();
|
|
@@ -142,7 +142,7 @@ export default function CheckUnitClassficationMana() {
|
|
|
}
|
|
|
|
|
|
|
|
|
- const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD'|'ADDCHILD' }) => {
|
|
|
+ const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' }) => {
|
|
|
|
|
|
return (
|
|
|
<ModalForm
|
|
@@ -152,12 +152,12 @@ export default function CheckUnitClassficationMana() {
|
|
|
initialValues={type == 'EDIT' ? {
|
|
|
...record,
|
|
|
|
|
|
- } :{}}
|
|
|
+ } : {}}
|
|
|
trigger={
|
|
|
- type == 'EDIT' ? <a key="edit" >编辑</a> :type=='ADDCHILD'?<a className='add'>添加</a>: <span className='add'>新增</span>
|
|
|
+ type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'ADDCHILD' ? <a className='add'>添加</a> : <span className='add'>新增</span>
|
|
|
}
|
|
|
onFinish={(val) => {
|
|
|
- return updateTable(type == 'EDIT' ? { ...record, ...val } :type == 'ADDCHILD'?{...val,parentClassCode:record.code}:{ ...val }, type);
|
|
|
+ return updateTable(type == 'EDIT' ? { ...record, ...val } : type == 'ADDCHILD' ? { ...val, parentClassCode: record.code,unitType:record.unitType} : { ...val }, type);
|
|
|
}}
|
|
|
modalProps={{ destroyOnClose: true }}
|
|
|
colProps={{ span: 24 }}
|
|
@@ -169,11 +169,15 @@ export default function CheckUnitClassficationMana() {
|
|
|
placeholder="请输入"
|
|
|
rules={[{ required: true, message: '名称不能为空!' }]}
|
|
|
/>
|
|
|
- <ProFormSelect label="职类:"
|
|
|
- name='unitType'
|
|
|
- options={(getDataByKeyFromDic(dicData, '1')).list}
|
|
|
- rules={[{ required: true, message: '职类不能为空!' }]}
|
|
|
- />
|
|
|
+ {
|
|
|
+ type == 'ADD' && (
|
|
|
+ <ProFormSelect label="职类:"
|
|
|
+ name='unitType'
|
|
|
+ options={(getDataByKeyFromDic(dicData, '1')).list}
|
|
|
+ rules={[{ required: true, message: '职类不能为空!' }]}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }
|
|
|
<ProFormDigit
|
|
|
name="sort"
|
|
|
label="序号:"
|
|
@@ -184,7 +188,7 @@ export default function CheckUnitClassficationMana() {
|
|
|
name="description"
|
|
|
label="说明:"
|
|
|
placeholder="请输入"
|
|
|
-
|
|
|
+
|
|
|
/>
|
|
|
</ModalForm>
|
|
|
)
|