Commit 5be6bd63 authored by 黄奎's avatar 黄奎

页面修改

parent 87701097
......@@ -3,328 +3,263 @@
<template>
<div class="head-title">
管理员列表
<el-button
@click="showDialog"
style="float:right;margin-top: -5px;"
size="small"
type="primary"
>
<el-button @click="showDialog" style="float:right;margin-top: -5px;" size="small" type="primary">
添加管理员
</el-button>
</div>
<div class="content">
<div
class="searchInput"
style="display:inline-block;width:200px;"
>
<el-select
v-model="msg.platform"
placeholder="请选择"
size="small"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
<div class="searchInput" style="display:inline-block;width:200px;">
<el-select v-model="msg.Source" placeholder="请选择" size="small" @change="(msg.pageIndex = 1),getList()">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
<div class="searchInput">
<el-input
style="display:inline-block;width:260px;height:30px"
placeholder="请输入ID/昵称/手机号/备注/联系方式"
v-model="msg.PageName"
size="small"
clearable
@keyup.enter.native="msg.pageIndex=1,getList()"
@clear="msg.pageIndex=1,getList()"
>
<i
slot="suffix"
class="el-input__icon el-icon-search"
@click="msg.pageIndex=1,getList()"
></i>
<el-input style="display:inline-block;width:260px;height:30px" placeholder="请输入ID/昵称/手机号/备注/联系方式"
v-model="msg.Name" size="small" clearable @keyup.enter.native="msg.pageIndex=1,getList()"
@clear="msg.pageIndex=1,getList()">
<i slot="suffix" class="el-input__icon el-icon-search" @click="msg.pageIndex=1,getList()"></i>
</el-input>
</div>
<br>
<el-table
:data="dataList"
v-loading="loading"
border
style="width: 100%;margin:20px 0"
>
<el-table-column
prop="Id"
label="ID"
width="100"
>
<el-table :data="dataList" v-loading="loading" border style="width: 100%;margin:20px 0">
<el-table-column prop="AdminId" label="ID" width="100">
</el-table-column>
<el-table-column
prop="PageName"
label="头像"
>
</el-table-column>
<!-- <el-table-column
label="导航与模板"
prop="DetailsList"
width="500"
>
<el-table-column prop="Photo" label="头像">
<template slot-scope="scope">
<div class="templat-list">
<template
v-if="scope.row.DetailsList && scope.row.DetailsList.length>0"
v-for="(subItem,subIndex) in scope.row.DetailsList"
>
<div
class="templat-item"
:key="subIndex"
>
<div>{{subItem.NavName}}</div>
<div style="color: rgb(153, 153, 153);">{{subItem.TemplateShowName}}</div>
</div>
</template>
<div class="app-image" :style="{
backgroundImage: 'url(' + scope.row.Photo + ')',
backgroundSize: 'cover',
}"></div>
<div flex="dir:left cross:center">
{{ scope.row.Name }}
</div>
<img v-if="scope.row.Source == 1" style="width: 24px; height: 24px" src="../../assets/img/userman/wx.png"
alt="" class="platform-img" />
<img v-if="scope.row.Source == 2" style="width: 30px; height: 30px"
src="../../assets/img/userman/alipay.png" alt="" class="platform-img" />
</template>
</el-table-column> -->
<el-table-column
prop="IsHome"
label="手机号"
>
</el-table-column>
<el-table-column
prop="IsHome"
label="加入时间"
>
<el-table-column prop="Moblie" label="手机号">
</el-table-column>
<el-table-column prop="CreateDate" label="加入时间">
</el-table-column>
<el-table-column
label="操作"
width="180"
>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-tooltip
class="item"
effect="dark"
content="移除管理员"
placement="top"
>
<img
@click="removeAdmin(scope.row)"
style="width:32px;height:32px;margin:0 10px"
src="../../assets/img/userman/renew.png"
alt=""
>
<el-tooltip class="item" effect="dark" content="移除管理员" placement="top">
<img @click="removeAdmin(scope.row)" style="width:32px;height:32px;margin:0 10px"
src="../../assets/img/userman/renew.png" alt="">
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination
style="text-align:right"
background
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="prev, pager, next"
:total="total"
>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange"
:page-size="msg.pageSize" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
</template>
<el-dialog
title="设置管理员"
:visible.sync="isShowModule"
width="600px"
>
<el-form
:model="addMsg"
:rules="addMsgRules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item
label="昵称搜索"
prop="Name"
>
<el-select
v-model="addMsg.Name"
placeholder="请选择"
filterable
>
<el-option
v-for="item in adminOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-dialog title="设置管理员" :visible.sync="isShowModule" width="600px">
<el-form :model="addMsg" :rules="addMsgRules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="昵称搜索" prop="Name">
<el-select v-model="addMsg.UserId" placeholder="请选择" filterable>
<el-option v-for="item in adminOptions" :key="item.Id" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot="footer"
class="dialog-footer"
>
<el-button
size="small"
@click="isShowModule = false"
>取 消</el-button>
<el-button
size="small"
type="primary"
@click="submitForm('ruleForm')"
>确 定</el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowModule = false">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
//弹窗
isShowModule: false,
dataList: [],
msg: {
platform: 1,
PageName: "", //页面名称
pageIndex: 1,
pageSize: 10,
},
addMsg: {
Name: "",
},
total: 0,
options: [
{
value: 0,
label: "不限",
export default {
data() {
return {
loading: false,
//弹窗
isShowModule: false,
dataList: [],
msg: {
Source: "",
Name: "",
pageIndex: 1,
pageSize: 10,
},
{
value: 1,
label: "微信小程序",
addMsg: {
AdminId: 0,
UserId: "",
},
{
value: 2,
label: "支付宝小程序",
total: 0,
options: [{
value: 0,
label: "不限",
},
{
value: 1,
label: "微信小程序",
},
{
value: 2,
label: "支付宝小程序",
},
],
adminOptions: [],
addMsgRules: {
UserId: [{
required: true,
message: "请选择小程序用户",
trigger: "blur"
}],
},
],
adminOptions: [],
addMsgRules: {
Name: [{ required: true, message: "请输入名称", trigger: "blur" }],
},
};
},
methods: {
showDialog(){
this.isShowModule=true;
this.addMsg.Name="";
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
};
},
getList() {
this.apipost(
"/api/",
this.msg,
(res) => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
methods: {
showDialog() {
this.isShowModule = true;
this.addMsg.UserId = "";
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
that.apipost(
'/api/user/SetMiniprogramAdmin',
that.addMsg,
(res) => {
if (res.data.resultCode === 1) {
that.getList();
that.Success(res.data.message);
that.isShowModule=false;
} else {
that.Error(res.data.message);
}
});
} else {
this.Info(res.data.message);
return false;
}
}
);
},
//删除
removeAdmin(item) {
let that = this;
that.Confirm("是否删除?", function () {
that.apipost(
"",
{
Id: item.Id,
Status: 1,
},
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList() {
this.apipost(
"/api/user/GetMiniprogramAdminPage",
this.msg,
(res) => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
}
}
);
},
//删除
removeAdmin(item) {
let that = this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/user/DeleteMiniprogramAdmin", {
AdminId: item.AdminId,
},
(res) => {
if (res.data.resultCode == 1) {
that.getList();
} else {
that.Info(res.data.message);
}
}
);
});
},
//获取用户列表
getUserList() {
var qMsg={PageIndex:1,PageSize:1000000};
this.apipost(
"/api/user/GetMemberUserDropDownList", qMsg,
(res) => {
if (res.data.resultCode == 1) {
that.getList();
this.adminOptions = res.data.data.pageData;
} else {
that.Info(res.data.message);
this.Info(res.data.message);
}
}
);
});
}
},
mounted() {
this.getUserList();
this.getList();
},
},
mounted() {
// this.getList();
},
};
};
</script>
<style>
.CustomPage .templat-list {
border: 1px solid #ebeef5;
}
.CustomPage .app-image {
background-position: center center;
width: 50px;
height: 50px;
border-radius: 0%;
float: left;
margin-right: 8px;
}
.CustomPage .templat-list {
border: 1px solid #ebeef5;
}
.CustomPage .templat-item {
line-height: 40px;
height: 40px;
display: flex;
font-size: 13px;
}
.CustomPage .templat-item {
line-height: 40px;
height: 40px;
display: flex;
font-size: 13px;
}
.templat-item:nth-child(odd) {
background-color: #f7f7f7;
}
.templat-item:nth-child(odd) {
background-color: #f7f7f7;
}
.templat-item:nth-child(even) {
background-color: #fff;
}
.templat-item:nth-child(even) {
background-color: #fff;
}
.CustomPage .templat-item div {
width: 50%;
padding-left: 20px;
}
.CustomPage .templat-item div {
width: 50%;
padding-left: 20px;
}
.CustomPage .Custom_item {
border: 1px solid #ebeef5;
background-color: #fff;
color: #303133;
-webkit-transition: 0.3s;
transition: 0.3s;
margin-bottom: 10px;
}
.CustomPage .Custom_item {
border: 1px solid #ebeef5;
background-color: #fff;
color: #303133;
-webkit-transition: 0.3s;
transition: 0.3s;
margin-bottom: 10px;
}
.CustomPage .Custom_item>div {
padding: 20px;
}
.CustomPage .Custom_item > div {
padding: 20px;
}
.CustomPage .content {
background: #fff;
margin-top: 10px;
padding: 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.CustomPage .content {
background: #fff;
margin-top: 10px;
padding: 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.CustomPage .conten_indder {
padding: 20px;
background-color: #fff;
padding-right: 50%;
min-width: 1100px;
}
.CustomPage .conten_indder {
padding: 20px;
background-color: #fff;
padding-right: 50%;
min-width: 1100px;
}
</style>
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