增加角色列表

pull/30/head
taoshihan1991 4 years ago
parent a77fa674a0
commit 48554f9203

@ -58,6 +58,7 @@ func main() {
engine.GET("/setting_mysql", tmpl.PageSettingMysql)
//角色列表
engine.GET("/roles", controller.GetRoleList)
engine.GET("/roles_list", tmpl.PageRoleList)
//网页部署
engine.GET("/setting_deploy", tmpl.PageSettingDeploy)

@ -147,7 +147,11 @@
_this.kefuList=result;
});
}
if(ACTION=="roles_list"){
this.sendAjax("/roles","get",{},function(result){
_this.roleList=result;
});
}
},
sendAjax(url,method,params,callback){
let _this=this;

@ -10,6 +10,16 @@
<el-menu-item index="1-2" v-on:click="openUrl('/setting_kefu_list')">客服管理</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="3">
<template slot="title">
<i class="el-icon-s-cooperation"></i>
<span>权限设置</span>
</template>
<el-menu-item-group>
<el-menu-item index="3-1" v-on:click="openUrl('/roles_list')">角色管理</el-menu-item>
<el-menu-item index="3-2" v-on:click="">结点管理</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="2">
<template slot="title">
<i class="el-icon-s-tools"></i>

@ -0,0 +1,62 @@
{{template "header" }}
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
{{template "setting_left" .}}
</el-aside>
<el-main class="mainMain">
<el-button style="margin-bottom: 10px;" @click="" type="primary" size="small">添加角色</el-button>
<el-table
:data="roleList"
border
style="width: 100%">
<el-table-column
prop="role_name"
label="角色名称">
</el-table-column>
<el-table-column
prop="id"
label="操作">
<template slot-scope="scope">
<el-button @click="" type="primary" size="small" plain>配置权限</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
<el-dialog
title="客服"
:visible.sync="kefuDialog"
width="30%"
>
<el-form ref="kefuForm" :model="kefuForm" :rules="rules" label-width="70px">
<el-form-item label="用户名" prop="name">
<el-input v-model="kefuForm.name"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="kefuForm.password"></el-input>
</el-form-item>
<el-form-item label="昵称" prop="nickname">
<el-input v-model="kefuForm.nickname"></el-input>
</el-form-item>
<el-form-item label="头像" prop="avator">
<el-select v-model="kefuForm.avator" placeholder="请选择头像">
<el-option :label="'头像'+item" :value="'/static/images/'+item+'.jpg'" v-for="item in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]" v-bind:key="item">
<el-avatar :size="30" :src="'/static/images/'+item+'.jpg'"></el-avatar>
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="kefuDialog = false">取 消</el-button>
<el-button type="primary" @click="submitKefuForm('kefuForm')">确 定</el-button>
</span>
</el-dialog>
</template>
</div>
</body>
{{template "setting_bottom" .}}

@ -39,6 +39,13 @@ func PageKefuList(c *gin.Context) {
"action":"setting_kefu_list",
})
}
//角色列表
func PageRoleList(c *gin.Context) {
c.HTML(http.StatusOK, "setting_role_list.html", gin.H{
"tab_index":"3-1",
"action":"roles_list",
})
}
type SettingHtml struct {
*CommonHtml
Username, Password string

Loading…
Cancel
Save