Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
Overview
Overview
Details
Activity
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
常超
founder_vue
Commits
b3f5c1c1
Commit
b3f5c1c1
authored
Dec 01, 2022
by
liuguorong93
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取本地json数据
parent
16a0b188
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
19 deletions
+67
-19
public/JsonData/CODE_JWJXXL.json
+40
-0
public/js/configPage/enumeration.js
+0
-14
src/utils/getJsonData.js
+20
-0
src/views/artisanManage/index.vue
+7
-5
No files found.
public/JsonData/CODE_JWJXXL.json
0 → 100644
View file @
b3f5c1c1
{
"code"
:
200
,
"data"
:{
"rows"
:[
{
"ids"
:
"666666"
,
"label"
:
"警务技术"
,
"codeType"
:
"CODE_JWJXXL"
,
"text"
:
"警务技术"
,
"pId"
:
null
,
"id"
:
"1"
,
"isParent"
:
false
,
"children"
:[]
},
{
"ids"
:
"666667"
,
"label"
:
"执法勤务"
,
"codeType"
:
"CODE_JWJXXL"
,
"text"
:
"执法勤务"
,
"pId"
:
null
,
"id"
:
"2"
,
"isParent"
:
false
,
"children"
:[]
},
{
"ids"
:
"666668"
,
"label"
:
"综合管理"
,
"codeType"
:
"CODE_JWJXXL"
,
"text"
:
"综合管理"
,
"pId"
:
null
,
"id"
:
"3"
,
"isParent"
:
false
,
"children"
:[]
}
]
},
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
public/js/configPage/enumeration.js
View file @
b3f5c1c1
...
...
@@ -19,18 +19,4 @@ var enumeration = {
code
:
'0'
}
],
jwjsxlOptions
:
[
{
name
:
'警务技术'
,
code
:
'1'
},
{
name
:
'执法勤务'
,
code
:
'2'
},
{
name
:
'综合管理'
,
code
:
'3'
}
]
}
src/utils/getJsonData.js
0 → 100644
View file @
b3f5c1c1
// 获取本地json数据
export
const
getJsonDataApi
=
(
fileName
)
=>
{
let
datas
if
(
!
fileName
)
return
[]
return
new
Promise
((
resolve
)
=>
{
axios
.
get
(
`JsonData/
${
fileName
}
.json`
).
then
((
res
)
=>
{
try
{
datas
=
res
.
data
.
data
.
rows
resolve
(
datas
)
}
catch
(
e
)
{
datas
=
[]
resolve
(
options
)
}
}).
catch
((
e
)
=>
{
datas
=
[]
resolve
(
options
)
})
})
}
src/views/artisanManage/index.vue
View file @
b3f5c1c1
...
...
@@ -89,8 +89,8 @@
<el-option
v-for=
"(item, index) in jwjsxlOptions"
:key=
"index"
:label=
"item.
name
"
:value=
"item.
code
"
:label=
"item.
label
"
:value=
"item.
id
"
>
</el-option>
</el-select>
...
...
@@ -280,6 +280,7 @@
<
script
>
import
{
getArtisanList
}
from
"@/api/menuDataApi/artisanManageApi.js"
;
import
{
getJsonDataApi
}
from
"@/utils/getJsonData.js"
;
export
default
{
name
:
"artisanManage"
,
...
...
@@ -304,10 +305,11 @@ export default {
sexOptions
:
enumeration
.
sexOptions
,
shifouOptions
:
enumeration
.
shifouOptions
,
jwjsxlOptions
:
enumeration
.
jwjsxlOptions
,
jwjsxlOptions
:
[]
,
};
},
mounted
()
{
async
mounted
()
{
this
.
jwjsxlOptions
=
await
getJsonDataApi
(
"CODE_JWJXXL"
);
this
.
getLists
(
1
);
},
methods
:
{
...
...
@@ -356,7 +358,7 @@ export default {
this
.
tableData
=
res
.
data
.
data
.
records
;
this
.
total
=
res
.
data
.
data
.
total
;
this
.
tableLoading
=
false
;
console
.
log
(
this
.
tableData
);
//
console.log(this.tableData);
return
;
}
this
.
tableLoading
=
false
;
...
...
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