Commit d392ccec authored by 黄奎's avatar 黄奎

页面修改

parent 5dc89280
...@@ -89,7 +89,7 @@ export function UploadViittoFile(path, file, callback) { ...@@ -89,7 +89,7 @@ export function UploadViittoFile(path, file, callback) {
} else if (locationName.indexOf('oytour') !== -1) { } else if (locationName.indexOf('oytour') !== -1) {
vtUploadUrl = "http://upload.oytour.com"; vtUploadUrl = "http://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com"; viewFileUrl = "https://imgfile.oytour.com";
}else if (locationName.indexOf('kookaku') !== -1) { } else if (locationName.indexOf('kookaku') !== -1) {
vtUploadUrl = "https://upload.oytour.com"; vtUploadUrl = "https://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com"; viewFileUrl = "https://imgfile.oytour.com";
} }
...@@ -383,6 +383,50 @@ export function queryAreaList(data) { ...@@ -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) { ...@@ -450,4 +494,4 @@ export function wechatUploadSelfFile(path, file, callback, configObj) {
newPath += "/" + timestamp1 + "" + suffix; newPath += "/" + timestamp1 + "" + suffix;
UploadFileToTencent(uploadConfig, newPath, file, uploadLoadding, callback); UploadFileToTencent(uploadConfig, newPath, file, uploadLoadding, callback);
} }
} }
\ No newline at end of file
...@@ -3,15 +3,9 @@ ...@@ -3,15 +3,9 @@
<div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <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" <q-input @input="resetSearch" clearable standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
label="名称" maxlength="20" @clear="resetSearch" /> v-model="msg.Name" label="名称" maxlength="20" @clear="resetSearch" />
</div> </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> </div>
<div class="page-content"> <div class="page-content">
...@@ -21,13 +15,29 @@ ...@@ -21,13 +15,29 @@
<div class="col-2 q-table__title">地区信息</div> <div class="col-2 q-table__title">地区信息</div>
<q-space /> <q-space />
<div class="page-option"> <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> </div>
</template> </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"> <template v-slot:body-cell-Status="props">
<q-td :props="props"> <q-td :props="props">
<q-toggle size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status" <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> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -37,91 +47,67 @@ ...@@ -37,91 +47,67 @@
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditMenu(props.row)" /> @click="editArea(props.row)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="功能权限"
@click="gotomenufunction(props.row)" />
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<menu-form v-if="isShowMenuForm" :save-obj="menuObjOption" @close="closeMenuSaveForm" @success="refreshPage"> <area-form v-if="isShowAreaForm" :save-obj="areaObjOption" @close="refreshPage" @success="refreshPage">
</menu-form> </area-form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import {
getMenuPage, queryAreaPage
getMenuTypeList, } from '../../api/common/common'
getMenuLevelList, import areaForm from '../../components/system/area-form'
updateMenuStatus,
} from '../../api/system/index'
import menuForm from '../../components/system/menu-form'
export default { export default {
meta: { meta: {
title: "地区管理" title: "地区管理"
}, },
components: { components: {
menuForm, areaForm,
}, },
data() { data() {
return { return {
currentUrl: "", currentUrl: "",
columns: [{ columns: [{
name: 'MenuId', name: 'ID',
label: '菜单编号', label: '编号',
field: 'MenuId', field: 'ID',
align: 'left' align: 'left'
}, },
{ {
name: 'MenuName', name: 'Name',
required: true, required: true,
label: '菜单名称', label: '名称',
align: 'left', align: 'left',
field: row => row.MenuName field: row => row.Name
},
{
name: 'MenuUrl',
label: '菜单地址',
field: 'MenuUrl',
align: 'left'
}, },
{ {
name: 'MenuTypeStr', name: 'CodeLevel',
label: '菜单类型', label: '行政级别',
field: 'MenuTypeStr', field: 'CodeLevel',
align: 'left' align: 'left'
}, },
{ {
name: 'MenuLevel', name: 'CountryName',
label: '菜单等级', label: '所属国家',
field: 'MenuLevel', field: 'CountryName',
align: 'left' align: 'left'
}, },
{ {
name: 'MenuIcon', name: 'ProvinceName',
label: '图标', label: '所属省份',
field: 'MenuIcon', field: 'ProvinceName',
align: 'left' align: 'left'
}, },
{ {
name: 'SortNum', name: 'CityName',
label: '排序', label: '所属市',
field: 'SortNum', field: 'CityName',
align: 'left' align: 'left'
}, },
{
name: 'CreateTimeStr',
label: '创建时间',
field: 'CreateTimeStr',
align: 'left'
},
{
name: 'Status',
label: '状态',
align: 'left',
field: 'Status'
},
{ {
name: 'optioned', name: 'optioned',
label: '操作', label: '操作',
...@@ -130,70 +116,49 @@ ...@@ -130,70 +116,49 @@
], ],
data: [], data: [],
loading: true, loading: true,
ShowOpts: [{
label: '全部',
value: '-1'
},
{
label: '正常',
value: '0'
},
{
label: '删除',
value: '1'
}
],
//菜单等级
MenuLevelOpts: [],
//菜单类型
MenuTypeOpts: [],
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 12, pageSize: 12,
rowsPerPage: 12, rowsPerPage: 12,
MenuName: "", Name: "",
MenuUrl: "",
MenuLevel: -1,
MenuType: -1,
Status: "-1",
}, },
pageCount: 0, pageCount: 0,
isShowMenuForm: false, isShowAreaForm: false, //是否显示新增修改地区表单
menuObjOption: null, areaObjOption: null,
} }
}, },
mounted() { mounted() {
this.initData();
this.currentUrl = this.$route.path this.currentUrl = this.$route.path
this.getmenulist() this.getAreapage();
}, },
methods: { methods: {
//跳转到功能权限 //刷新页面
gotomenufunction(obj) { refreshPage() {
var tempStr = '/system/menufunction?menuId=' + obj.MenuId; this.isShowAreaForm = false;
this.$router.push({ this.areaObjOption = null;
path: tempStr this.getAreapage();
});
}, },
//初始化下拉框 //新增修改地区
initData() { editArea(obj) {
this.MenuTypeOpts = getMenuTypeList(); if (obj != null) {
this.MenuLevelOpts = getMenuLevelList(); this.areaObjOption = obj;
}
this.isShowAreaForm = true;
}, },
//重新查询 //重新查询
resetSearch() { resetSearch() {
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.getmenulist(); this.getAreapage();
}, },
//翻页 //翻页
changePage(val) { changePage(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getmenulist() this.getAreapage()
}, },
//获取菜单分页列表 //获取地区分页列表
getmenulist() { getAreapage() {
this.loading = true; this.loading = true;
getMenuPage(this.msg).then(res => { queryAreaPage(this.msg).then(res => {
this.loading = false this.loading = false
this.data = res.Data.PageData this.data = res.Data.PageData
this.pageCount = res.Data.PageCount this.pageCount = res.Data.PageCount
...@@ -201,73 +166,9 @@ ...@@ -201,73 +166,9 @@
this.loading = false 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> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style>
</style> \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment