Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intelligent_qp_manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
intelligent_qp_manager
Commits
84d36b30
Commit
84d36b30
authored
Oct 31, 2024
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了bug
parent
0fb54779
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
55 deletions
+85
-55
DictModal.vue
src/views/system/dict/DictModal.vue
+59
-1
dict.data.ts
src/views/system/dict/dict.data.ts
+18
-53
MenuDrawer.vue
src/views/system/menu/MenuDrawer.vue
+1
-1
menu.data.ts
src/views/system/menu/menu.data.ts
+7
-0
No files found.
src/views/system/dict/DictModal.vue
View file @
84d36b30
...
...
@@ -8,7 +8,13 @@
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./dict.data'
;
import
{
addDictType
,
changeFlagApi
,
DictDetailApi
}
from
'@/api/system/dict/dict'
;
import
{
addDictType
,
changeFlagApi
,
DictDetailApi
,
getDictDataByType
,
getDictListByPage
}
from
'@/api/system/dict/dict'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
defineOptions
({
name
:
'DictModal'
});
...
...
@@ -36,6 +42,7 @@
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
//修改
// 获取行数据的id
dictId
.
value
=
data
.
record
.
businessId
;
// 通过id获取行详情信息
...
...
@@ -47,6 +54,57 @@
});
});
}
//给父子典名称和数据赋值
var
options
=
[]
getDictListByPage
().
then
(
response
=>
{
options
=
response
.
data
.
map
(
item
=>
({
label
:
item
.
dictName
,
value
:
item
.
businessId
,
}))
updateSchema
({
field
:
'parentId'
,
componentProps
:
{
options
:
options
,
onChange
:
(
value
:
any
,
option
:
any
,
form
:
any
)
=>
{
//调用接口 返回的参数赋值给dictValue
if
(
value
!==
undefined
){
DictDetailApi
(
value
).
then
(
res
=>
{
const
dictType
=
res
.
data
.
dictType
// 调用接口获取 dictValue 列表
getDictDataByType
(
dictType
).
then
(
response
=>
{
const
dictData
=
response
.
data
||
[];
// 获取到的数据列表
// 更新 dictValue 字段的选项
//取出dictData里的dictLabel和dictValue
const
options
=
dictData
.
map
((
item
:
any
)
=>
({
label
:
item
.
dictLabel
,
value
:
item
.
businessId
,
}));
updateSchema
({
field
:
'dataId'
,
componentProps
:
{
options
:
options
,
},
ifShow
:
true
});
}).
catch
(
error
=>
{
console
.
error
(
'Error fetching dict values:'
,
error
);
});
})
}
else
{
const
options
=
[]
updateSchema
({
field
:
'dataId'
,
componentProps
:
{
options
:
options
,
},
ifShow
:
false
});
}
},
},
});
})
});
async
function
handleSubmit
()
{
...
...
src/views/system/dict/dict.data.ts
View file @
84d36b30
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
import
{
h
,
defineComponent
}
from
'vue'
;
import
{
Switch
}
from
'ant-design-vue'
;
import
{
Select
,
Switch
}
from
'ant-design-vue'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
changeFlagApi
,
DictDetailApi
,
getDictDataByType
}
from
'@/api/system/dict/dict'
;
import
{
changeDataFlagApi
,
changeFlagApi
,
DictDetailApi
,
getDictDataByType
}
from
'@/api/system/dict/dict'
;
import
{
log
}
from
'vxe-pc-ui'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
rowProps
}
from
'ant-design-vue/es/grid/Row'
;
...
...
@@ -10,6 +15,8 @@ import { getDictListByPage,getDictDataByType } from "@/api/system/dict/dict";
type
CheckedType
=
boolean
|
string
|
number
;
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'序号'
,
...
...
@@ -93,13 +100,13 @@ export const searchFormSchema: FormSchema[] = [
field
:
'dictName'
,
label
:
'字典名称'
,
component
:
'Input'
,
colProps
:
{
span
:
8
},
colProps
:
{
span
:
7
},
},
{
field
:
'dictType'
,
label
:
'字典类型'
,
component
:
'Input'
,
colProps
:
{
span
:
8
},
colProps
:
{
span
:
7
},
},
{
field
:
'flag'
,
...
...
@@ -111,7 +118,7 @@ export const searchFormSchema: FormSchema[] = [
{
label
:
'停用'
,
value
:
'0'
},
],
},
colProps
:
{
span
:
8
},
colProps
:
{
span
:
7
},
},
{
field
:
'date'
,
...
...
@@ -121,9 +128,9 @@ export const searchFormSchema: FormSchema[] = [
format
:
'YYYY-MM-DD'
,
// 显示的日期格式
valueFormat
:
'YYYY-MM-DD'
,
// 提交的日期格式
placeholder
:
[
'开始日期'
,
'结束日期'
],
// 占位符
style
:
{
width
:
'
300px
'
},
// 控制宽度
style
:
{
width
:
'
100%
'
},
// 控制宽度
},
colProps
:
{
span
:
4
},
colProps
:
{
span
:
7
},
},
];
...
...
@@ -159,52 +166,10 @@ export const formSchema: FormSchema[] = [
{
field
:
'parentId'
,
label
:
'父字典名称'
,
component
:
'ApiSelect'
,
componentProps
:
({
formModel
,
formActionType
})
=>
{
return
{
api
:
getDictListByPage
,
labelField
:
'dictName'
,
valueField
:
'businessId'
,
resultField
:
'data'
,
onChange
:
(
value
:
any
,
option
:
any
,
form
:
any
)
=>
{
//调用接口 返回的参数赋值给dictValue
if
(
value
!==
undefined
){
DictDetailApi
(
value
).
then
(
res
=>
{
const
dictType
=
res
.
data
.
dictType
// 调用接口获取 dictValue 列表
getDictDataByType
(
dictType
).
then
(
response
=>
{
const
dictData
=
response
.
data
||
[];
// 获取到的数据列表
// 更新 dictValue 字段的选项
const
{
updateSchema
}
=
formActionType
//获取表单方法
//取出dictData里的dictLabel和dictValue
const
options
=
dictData
.
map
((
item
:
any
)
=>
({
label
:
item
.
dictLabel
,
value
:
item
.
businessId
,
}));
updateSchema
({
field
:
'dataId'
,
componentProps
:
{
options
:
options
,
},
ifShow
:
true
});
}).
catch
(
error
=>
{
console
.
error
(
'Error fetching dict values:'
,
error
);
});
})
}
else
{
const
{
updateSchema
}
=
formActionType
//获取表单方法
const
options
=
[]
updateSchema
({
field
:
'dataId'
,
componentProps
:
{
options
:
options
,
},
ifShow
:
false
});
}
},
}
component
:
'Select'
,
componentProps
:
{
options
:
[],
onChange
:
(
value
:
any
,
option
:
any
,
form
:
any
)
=>
{},
},
},
{
...
...
src/views/system/menu/MenuDrawer.vue
View file @
84d36b30
...
...
@@ -51,7 +51,7 @@
}
if
(
unref
(
isAdd
)){
// 通过id获取菜单详情信息
const
id
=
data
.
record
.
parent
Id
const
id
=
data
.
record
.
business
Id
const
params
=
{
parentId
:
id
,
}
...
...
src/views/system/menu/menu.data.ts
View file @
84d36b30
...
...
@@ -154,6 +154,13 @@ export const formSchema: FormSchema[] = [
field
:
'orderNum'
,
label
:
'菜单排序'
,
component
:
'InputNumber'
,
componentProps
:
{
min
:
0
,
// 最小值
max
:
9999
,
// 最大值(根据需要调整)
step
:
1
,
// 每次增减的步长
placeholder
:
'请输入排序号'
,
// 占位符
style
:
{
width
:
'100%'
},
// 样式(可选)
},
required
:
true
,
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment