Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
d392ccec
Commit
d392ccec
authored
Nov 29, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
5dc89280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
167 deletions
+112
-167
common.js
src/api/common/common.js
+46
-2
area.vue
src/pages/system/area.vue
+66
-165
No files found.
src/api/common/common.js
View file @
d392ccec
...
...
@@ -89,7 +89,7 @@ export function UploadViittoFile(path, file, callback) {
}
else
if
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
)
{
vtUploadUrl
=
"http://upload.oytour.com"
;
viewFileUrl
=
"https://imgfile.oytour.com"
;
}
else
if
(
locationName
.
indexOf
(
'kookaku'
)
!==
-
1
)
{
}
else
if
(
locationName
.
indexOf
(
'kookaku'
)
!==
-
1
)
{
vtUploadUrl
=
"https://upload.oytour.com"
;
viewFileUrl
=
"https://imgfile.oytour.com"
;
}
...
...
@@ -383,6 +383,50 @@ export function queryAreaList(data) {
})
}
/**
* 获取省市区分页列表
*/
export
function
queryAreaPage
(
data
)
{
return
request
({
url
:
'/Public/GetAreaPage'
,
method
:
'post'
,
data
})
}
/**
* 根据编号获取地区详情
*/
export
function
queryAreaInfo
(
data
)
{
return
request
({
url
:
'/Public/GetAreaInfo'
,
method
:
'post'
,
data
})
}
/**
* 根据编号删除地区
*/
export
function
deleteArea
(
data
)
{
return
request
({
url
:
'/Public/RemoveArea'
,
method
:
'post'
,
data
})
}
/**
* 新增修改地区
*/
export
function
saveArea
(
data
)
{
return
request
({
url
:
'/Public/SetArea'
,
method
:
'post'
,
data
})
}
/**
* 获取文件扩展名
*/
...
...
@@ -450,4 +494,4 @@ export function wechatUploadSelfFile(path, file, callback, configObj) {
newPath
+=
"/"
+
timestamp1
+
""
+
suffix
;
UploadFileToTencent
(
uploadConfig
,
newPath
,
file
,
uploadLoadding
,
callback
);
}
}
}
\ No newline at end of file
src/pages/system/area.vue
View file @
d392ccec
...
...
@@ -3,15 +3,9 @@
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<div
class=
"col-3"
>
<q-input
@
change=
"resetSearch"
clearable
standout=
"bg-primary text-white"
class=
"col-6 q-pr-lg q-pr-lg"
v-model=
"msg.MenuName
"
label=
"名称"
maxlength=
"20"
@
clear=
"resetSearch"
/>
<q-input
@
input=
"resetSearch"
clearable
standout=
"bg-primary text-white"
class=
"col-6 q-pr-lg q-pr-lg
"
v-model=
"msg.Name"
label=
"名称"
maxlength=
"20"
@
clear=
"resetSearch"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"msg.MenuType"
class=
"col-6 q-pr-lg q-pr-lg"
:options=
"MenuTypeOpts"
emit-value
map-options
label=
"菜单类型"
/>
</div>
</div>
</div>
<div
class=
"page-content"
>
...
...
@@ -21,13 +15,29 @@
<div
class=
"col-2 q-table__title"
>
地区信息
</div>
<q-space
/>
<div
class=
"page-option"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
size=
"sm"
icon=
"add"
label=
"新增
菜单"
@
click=
"EditMenu
(null)"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
size=
"sm"
icon=
"add"
label=
"新增
地区"
@
click=
"editArea
(null)"
/>
</div>
</
template
>
<
template
v-slot:body-cell-CodeLevel=
"props"
>
<q-td
:props=
"props"
>
<span
v-if=
"props.row.CodeLevel==1"
>
国家
</span>
<span
v-if=
"props.row.CodeLevel==2"
>
省
</span>
<span
v-if=
"props.row.CodeLevel==3"
>
市
</span>
<span
v-if=
"props.row.CodeLevel==4"
>
区
</span>
</q-td>
</
template
>
<
template
v-slot:body-cell-Status=
"props"
>
<q-td
:props=
"props"
>
<q-toggle
size=
"md"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"props.row.Status"
title=
"注意:关闭后,分类将无法正常使用."
@
input=
"DeleteMenu(props.row)"
/>
title=
"注意:关闭后,分类将无法正常使用."
/>
</q-td>
</
template
>
<
template
v-slot:bottom
>
...
...
@@ -37,91 +47,67 @@
<
template
v-slot:body-cell-optioned=
"props"
>
<q-td
:props=
"props"
>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"EditMenu(props.row)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"功能权限"
@
click=
"gotomenufunction(props.row)"
/>
@
click=
"editArea(props.row)"
/>
</q-td>
</
template
>
</q-table>
<
menu-form
v-if=
"isShowMenuForm"
:save-obj=
"menuObjOption"
@
close=
"closeMenuSaveForm
"
@
success=
"refreshPage"
>
</
menu
-form>
<
area-form
v-if=
"isShowAreaForm"
:save-obj=
"areaObjOption"
@
close=
"refreshPage
"
@
success=
"refreshPage"
>
</
area
-form>
</div>
</div>
</template>
<
script
>
import
{
getMenuPage
,
getMenuTypeList
,
getMenuLevelList
,
updateMenuStatus
,
}
from
'../../api/system/index'
import
menuForm
from
'../../components/system/menu-form'
queryAreaPage
}
from
'../../api/common/common'
import
areaForm
from
'../../components/system/area-form'
export
default
{
meta
:
{
title
:
"地区管理"
},
components
:
{
menu
Form
,
area
Form
,
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'
MenuId
'
,
label
:
'
菜单
编号'
,
field
:
'
MenuId
'
,
name
:
'
ID
'
,
label
:
'编号'
,
field
:
'
ID
'
,
align
:
'left'
},
{
name
:
'
Menu
Name'
,
name
:
'Name'
,
required
:
true
,
label
:
'
菜单
名称'
,
label
:
'名称'
,
align
:
'left'
,
field
:
row
=>
row
.
MenuName
},
{
name
:
'MenuUrl'
,
label
:
'菜单地址'
,
field
:
'MenuUrl'
,
align
:
'left'
field
:
row
=>
row
.
Name
},
{
name
:
'
MenuTypeStr
'
,
label
:
'
菜单类型
'
,
field
:
'
MenuTypeStr
'
,
name
:
'
CodeLevel
'
,
label
:
'
行政级别
'
,
field
:
'
CodeLevel
'
,
align
:
'left'
},
{
name
:
'
MenuLevel
'
,
label
:
'
菜单等级
'
,
field
:
'
MenuLevel
'
,
name
:
'
CountryName
'
,
label
:
'
所属国家
'
,
field
:
'
CountryName
'
,
align
:
'left'
},
{
name
:
'
MenuIcon
'
,
label
:
'
图标
'
,
field
:
'
MenuIcon
'
,
name
:
'
ProvinceName
'
,
label
:
'
所属省份
'
,
field
:
'
ProvinceName
'
,
align
:
'left'
},
{
name
:
'
SortNum
'
,
label
:
'
排序
'
,
field
:
'
SortNum
'
,
name
:
'
CityName
'
,
label
:
'
所属市
'
,
field
:
'
CityName
'
,
align
:
'left'
},
{
name
:
'CreateTimeStr'
,
label
:
'创建时间'
,
field
:
'CreateTimeStr'
,
align
:
'left'
},
{
name
:
'Status'
,
label
:
'状态'
,
align
:
'left'
,
field
:
'Status'
},
{
name
:
'optioned'
,
label
:
'操作'
,
...
...
@@ -130,70 +116,49 @@
],
data
:
[],
loading
:
true
,
ShowOpts
:
[{
label
:
'全部'
,
value
:
'-1'
},
{
label
:
'正常'
,
value
:
'0'
},
{
label
:
'删除'
,
value
:
'1'
}
],
//菜单等级
MenuLevelOpts
:
[],
//菜单类型
MenuTypeOpts
:
[],
msg
:
{
pageIndex
:
1
,
pageSize
:
12
,
rowsPerPage
:
12
,
MenuName
:
""
,
MenuUrl
:
""
,
MenuLevel
:
-
1
,
MenuType
:
-
1
,
Status
:
"-1"
,
Name
:
""
,
},
pageCount
:
0
,
isShow
MenuForm
:
false
,
menu
ObjOption
:
null
,
isShow
AreaForm
:
false
,
//是否显示新增修改地区表单
area
ObjOption
:
null
,
}
},
mounted
()
{
this
.
initData
();
this
.
currentUrl
=
this
.
$route
.
path
this
.
get
menulist
()
this
.
get
Areapage
();
},
methods
:
{
//跳转到功能权限
gotomenufunction
(
obj
)
{
var
tempStr
=
'/system/menufunction?menuId='
+
obj
.
MenuId
;
this
.
$router
.
push
({
path
:
tempStr
});
//刷新页面
refreshPage
()
{
this
.
isShowAreaForm
=
false
;
this
.
areaObjOption
=
null
;
this
.
getAreapage
();
},
//初始化下拉框
initData
()
{
this
.
MenuTypeOpts
=
getMenuTypeList
();
this
.
MenuLevelOpts
=
getMenuLevelList
();
//新增修改地区
editArea
(
obj
)
{
if
(
obj
!=
null
)
{
this
.
areaObjOption
=
obj
;
}
this
.
isShowAreaForm
=
true
;
},
//重新查询
resetSearch
()
{
this
.
msg
.
pageIndex
=
1
;
this
.
get
menulist
();
this
.
get
Areapage
();
},
//翻页
changePage
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
get
menulist
()
this
.
get
Areapage
()
},
//获取
菜单
分页列表
get
menulist
()
{
//获取
地区
分页列表
get
Areapage
()
{
this
.
loading
=
true
;
getMenu
Page
(
this
.
msg
).
then
(
res
=>
{
queryArea
Page
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
...
...
@@ -201,73 +166,9 @@
this
.
loading
=
false
})
},
//刷新页面
refreshPage
()
{
if
(
!
this
.
menuObjOption
)
{
this
.
msg
.
pageIndex
=
1
;
this
.
msg
.
MenuName
=
""
;
this
.
msg
.
MenuUrl
=
""
;
this
.
msg
.
MenuLevel
=
-
1
;
this
.
msg
.
MenuType
=
-
1
;
this
.
msg
.
Status
=
"-1"
;
}
this
.
getmenulist
()
},
//新增修改菜单
EditMenu
(
obj
)
{
if
(
obj
)
{
this
.
menuObjOption
=
obj
}
else
{
this
.
menuObjOption
=
null
}
this
.
isShowMenuForm
=
true
},
//关闭弹窗
closeMenuSaveForm
()
{
this
.
isShowMenuForm
=
false
},
//修改菜单状态
DeleteMenu
(
obj
)
{
var
that
=
this
;
var
delMsg
=
{
MenuId
:
obj
.
MenuId
,
Status
:
obj
.
Status
};
var
tipMsg
=
""
;
if
(
delMsg
.
Status
==
0
)
{
tipMsg
=
"是否启用【"
+
obj
.
MenuName
+
"】菜单?"
;
}
else
{
tipMsg
=
"是否禁用【"
+
obj
.
MenuName
+
"】菜单?"
;
}
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
tipMsg
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
updateMenuStatus
(
delMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
that
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功'
,
position
:
'top'
})
that
.
getmenulist
();
}
})
}).
onCancel
(()
=>
{
obj
.
Status
=
obj
.
Status
==
1
?
0
:
1
;
});
}
}
}
</
script
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass')
</
style
>
</
style
>
\ No newline at end of file
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