修改设置页菜单iframe点击时不刷新跳转

pull/23/head
taoshihan1991 4 years ago
parent d2382d4757
commit 450955d4cf

@ -15,6 +15,7 @@ func InitViewRouter(engine *gin.Engine) {
engine.GET("/main", middleware.JwtPageMiddleware, tmpl.PageMain)
engine.GET("/chat_main", middleware.JwtPageMiddleware, tmpl.PageChatMain)
engine.GET("/setting", tmpl.PageSetting)
engine.GET("/setting_statistics", tmpl.PageSettingStatis)
engine.GET("/setting_mysql", tmpl.PageSettingMysql)
engine.GET("/setting_welcome", tmpl.PageSettingWelcome)
engine.GET("/setting_deploy", tmpl.PageSettingDeploy)

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="陶士涵">
<title>GO-IMAP网页版邮箱imap工具</title>
<title>GO-FLY客服管理系统</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
<link rel="stylesheet" href="/static/css/common.css">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
@ -27,7 +27,7 @@
}
.mainMain{
background: #fff;
margin-left: 10px;
/*margin-left: 10px;*/
margin-bottom: 60px;
}
.mainIframe{

@ -4,38 +4,11 @@
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain settingMain">
<h2 class="textDark">数据总览</h2>
<el-row :gutter="10">
<el-col :span="8">
<div class="smallBox bgInfo">
<h3 v-html="statistics.visitors"></h3>
<p>总访客数</p>
</div>
</el-col>
<el-col :span="8">
<div class="smallBox bgSuccess">
<h3 v-html="statistics.message"></h3>
<p>总消息数</p>
</div>
</el-col>
<el-col :span="8">
<div class="smallBox bgDanger">
<h3 v-html="statistics.session"></h3>
<p>当前会话数</p>
</div>
</el-col>
</el-row>
</el-main>
<iframe class="mainIframe" v-bind:src="iframeUrl" frameborder="0"></iframe>
</el-container>
</template>
</div>
</body>
<script>
var Password="{{.Password}}";
var Username="{{.Username}}";
</script>
{{template "setting_bottom" .}}

@ -7,6 +7,7 @@
el: '#app',
delimiters:["<{","}>"],
data: {
iframeUrl:"/setting_statistics",
fullscreenLoading:false,
openIndex:[1],
account: {
@ -145,7 +146,8 @@
},
//跳转
openUrl(url){
window.location.href=url;
//window.location.href=url;
this.iframeUrl=url;
},
//展示提示
showNotice(){
@ -186,7 +188,7 @@
_this.roleList=result;
});
}
if(ACTION=="setting"){
if(ACTION=="setting_statistics"){
this.sendAjax("/statistics","get",{},function(result) {
_this.statistics = result;
});

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container>
{{template "setting_left" .}}
<el-main class="mainMain">
<el-tabs>

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">
<el-table

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">
<el-button style="margin-bottom: 10px;" @click="addKefu" type="primary" size="small">添加客服</el-button>

@ -11,7 +11,7 @@
<span>账户设置</span>
</template>
<el-menu-item-group>
<el-menu-item index="1-1" v-on:click="openUrl('/setting')">统计信息</el-menu-item>
<el-menu-item index="1-1" v-on:click="openUrl('/setting_statistics')">统计信息</el-menu-item>
<el-menu-item index="1-2" v-on:click="openUrl('/setting_welcome')">自动欢迎</el-menu-item>
</el-menu-item-group>
</el-submenu>

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">
<el-form :model="mysql" :rules="rules" ref="mysql" label-width="120px">

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">
<el-button style="margin-bottom: 10px;" @click="" type="primary" size="small">添加角色</el-button>

@ -0,0 +1,34 @@
{{template "header" }}
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-main class="mainMain settingMain">
<h2 class="textDark">数据总览</h2>
<el-row :gutter="10">
<el-col :span="8">
<div class="smallBox bgInfo">
<h3 v-html="statistics.visitors"></h3>
<p>总访客数</p>
</div>
</el-col>
<el-col :span="8">
<div class="smallBox bgSuccess">
<h3 v-html="statistics.message"></h3>
<p>总消息数</p>
</div>
</el-col>
<el-col :span="8">
<div class="smallBox bgDanger">
<h3 v-html="statistics.session"></h3>
<p>当前会话数</p>
</div>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
</div>
</body>
{{template "setting_bottom" .}}

@ -2,7 +2,6 @@
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
{{template "setting_left" .}}
<el-main class="mainMain">
<el-button style="margin-bottom: 10px;" @click="addWelcome" type="primary" size="small">添加欢迎</el-button>

@ -21,6 +21,14 @@ func PageSettingWelcome(c *gin.Context) {
})
}
//统计
func PageSettingStatis(c *gin.Context) {
c.HTML(http.StatusOK, "setting_statistics.html", gin.H{
"tab_index": "1-3",
"action": "setting_statistics",
})
}
//设置mysql
func PageSettingMysql(c *gin.Context) {
c.HTML(http.StatusOK, "setting_mysql.html", gin.H{

Loading…
Cancel
Save