2 Star 1 Fork 0

Admin/超级美眉-用户-模板

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
count.html 15.51 KB
一键复制 编辑 原始数据 按行查看 历史
Admin 提交于 2024-11-26 09:56 . 更新
<!DOCTYPE html>
<html>
<head>
${@view('./admin/head.html')}
</head>
<body class="${@hook_action('theme', 'admin')}">
<div id="app">
<div class="mm_card">
<div class="card_head arrow" @click="show_filter = !show_filter">
<h5>账户资产</h5>
</div>
<div class="card_body">
<div class="mm_form bar_filter" v-show="show_filter">
<div class="title">
<h5><span>筛选条件</span></h5>
</div>
<div class="mm_list list-3">
<div class="mm_item">
<control_input v-model="query.keyword" title="关键词" desc="用户名 / 昵称 / 手机号码"
@blur="search()" @keypress.enter.native="search()" />
</div>
<div class="mm_item">
<button class="mm_btn btn_primary-x" @click="reset();search()">重置</button>
</div>
</div>
</div>
<div class="bar_action">
<h5><span>操作</span></h5>
<div class="btns">
<!--{ if(user.gm >= 5) }-->
<!-- <button class="mm_btn btn_primary-x" @click="add_show()">添加</button> -->
<button @click="batch_show()" class="mm_btn btn_primary-x"
v-bind:class="{ 'disabled': !selects }">批量修改</button>
<!--{ /if }-->
<button class="mm_btn btn_primary plr-2" @click="$layout(0)" v-if="layout_style === 1">
<i class="fa fa-table"></i>
</button>
<button class="mm_btn btn_primary plr-2" @click="$layout(1)" v-else>
<i class="fa fa-list"></i>
</button>
</div>
<div class="btns_left">
<button class="mm_btn" @click="export_db()" v-if="url_export">导出</button>
</div>
</div>
<div class="mm_table" :class="{ list_mode: layout_style }">
<table class="table-2" :class="{ list_mode: layout_style }">
<thead class="table-sm">
<tr>
<th class="th_selected"><input type="checkbox" :checked="select_state"
@click="select_all()" /></th>
<th class="th_id"><span>UID</span></th>
<th class="th_nickname">
<span>用户昵称</span>
</th>
<th class="th_level">
<control_reverse title="等级" v-model="query.orderby" field="level"
:func="search">
</control_reverse>
</th>
<th class="th_exp">
<control_reverse title="经验值" v-model="query.orderby" field="exp" :func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="积分" v-model="query.orderby" field="credit_points"
:func="search">
</control_reverse>
</th>
<th class="th_money">
<control_reverse title="现金" v-model="query.orderby" field="money"
:func="search">
</control_reverse>
</th>
<th class="th_coin">
<control_reverse title="货币" v-model="query.orderby" field="coin" :func="search">
</control_reverse>
</th>
<!--{ if(user.gm > 5) }-->
<th class="th_integral">
<control_reverse title="拓展积分1" v-model="query.orderby" field="extcredits1"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分2" v-model="query.orderby" field="extcredits2"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分3" v-model="query.orderby" field="extcredits3"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分4" v-model="query.orderby" field="extcredits4"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分5" v-model="query.orderby" field="extcredits5"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分6" v-model="query.orderby" field="extcredits6"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分7" v-model="query.orderby" field="extcredits7"
:func="search">
</control_reverse>
</th>
<th class="th_integral">
<control_reverse title="拓展积分8" v-model="query.orderby" field="extcredits8"
:func="search">
</control_reverse>
</th>
<!--{ /if }-->
<!--{ if(user.gm >= 5) }-->
<th class="th_handle"><span>操作</span></th>
<!--{ /if }-->
</tr>
</thead>
<tbody>
<tr v-for="(o, idx) in list" :key="idx" :class="{'active': select == idx}"
@click="selected(idx)">
<th class="th_selected">
<input type="checkbox" :checked="select_has(o[field])"
@click="select_change(o[field])" />
</th>
<td class="td_id">{{ o[field] }}</td>
<td class="td_nickname"><span class="label">用户昵称:</span>
<span>{{ $to_name(list_account, o.user_id, 'user_id', 'nickname') }}</span>
</td>
<td class="td_level">
<span class="label">等级:</span>
<span>{{ o.level }}</span>
</td>
<td class="td_exp">
<span class="label">经验值:</span>
<span>{{ o.exp }}</span>
</td>
<td class="td_integral">
<span class="label">积分:</span>
<span>{{ o.credit_points }}</span>
</td>
<td class="td_money">
<span class="label">现金:</span>
<span>{{ o.money }}</span>
</td>
<td>
<span class="label">货币:</span>
<span>{{ o.coin }}</span>
</td>
<!--{ if(user.gm > 5) }-->
<td class="td_integral">
<span class="label">拓展积分1:</span>
<span>{{ o.extcredits1 }}</span>
</td>
<td class="td_integral">
<span class="label">拓展积分2:</span>
<span>{{ o.extcredits2 }}</span>
</td>
<td class="td_integral">
<span class="label">拓展积分3:</span>
<span>{{ o.extcredits3 }}</span>
</td>
<td class="td_integral">
<span class="label">拓展积分4:</span>
<span>{{ o.extcredits4 }}</span>
</td>
<td class="td_integral">
<span class="label">拓展积分5:</span>
<span>{{ o.extcredits5 }}</span>
</td>
<td class="td_integral">
<span class="label">拓展积分6:</span>
<span>{{ o.extcredits6 }}</span>
</td>
<td>
<span class="label">拓展积分7:</span>
<span>{{ o.extcredits7 }}</span>
</td>
<td class="td_integral">
<span class="label">拓展积分8:</span>
<span>{{ o.extcredits8 }}</span>
</td>
<!--{ /if }-->
<!--{ if(user.gm >= 5) }-->
<td class="td_handle">
<button class="btn_primary" @click="edit_show(o)">修改</button>
</td>
<!--{ /if }-->
</tr>
</tbody>
</table>
</div>
</div>
<div class="card_foot">
<div class="fl">
<control_select v-model="query.size" :options="$to_size()" @change="search()" />
</div>
<div class="fr">
<span class="mr">共 {{ count }} 条</span>
<span>当前</span>
<input type="number" class="pager_now" v-model.number="page_now" @blur="goTo(page_now)"
@change="page_change" />
<span>/{{ page_count }}页</span>
</div>
<control_pager display="2" v-model="query.page" :count="count / query.size" :func="goTo"
:icons="['首页', '上一页', '下一页', '尾页']"></control_pager>
</div>
</div>
<mm_modal v-model="show_batch" mask="true">
<div class="mm_card">
<div class="card_head">
<h5>批量修改</h5>
</div>
<div class="card_body pa">
<div class="mm_form">
<dl>
<dt>等级</dt>
<dd>
<control_number v-model="form.level" :min="0" />
</dd>
<dt>智商</dt>
<dd>
<control_number v-model="form.iq" :min="0" />
</dd>
<dt>信用度</dt>
<dd>
<control_number v-model="form.credit" :min="0" />
</dd>
<dt>经验值</dt>
<dd>
<control_number v-model="form.exp" :min="0" />
</dd>
<dt>现金</dt>
<dd>
<control_number v-model="form.money" :min="0" />
</dd>
<dt>货币</dt>
<dd>
<control_number v-model="form.coin" :min="0" />
</dd>
<!--{ if(user.gm > 5) }-->
<dt>拓展积分1</dt>
<dd>
<control_number v-model="form.extcredits1" :min="0" />
</dd>
<dt>拓展积分2</dt>
<dd>
<control_number v-model="form.extcredits2" :min="0" />
</dd>
<dt>拓展积分3</dt>
<dd>
<control_number v-model="form.extcredits3" :min="0" />
</dd>
<dt>拓展积分4</dt>
<dd>
<control_number v-model="form.extcredits4" :min="0" />
</dd>
<dt>拓展积分5</dt>
<dd>
<control_number v-model="form.extcredits5" :min="0" />
</dd>
<dt>拓展积分6</dt>
<dd>
<control_number v-model="form.extcredits6" :min="0" />
</dd>
<dt>拓展积分7</dt>
<dd>
<control_number v-model="form.extcredits7" :min="0" />
</dd>
<dt>拓展积分8</dt>
<dd>
<control_number v-model="form.extcredits8" :min="0" />
</dd>
<!--{ /if }-->
</dl>
</div>
</div>
<div class="card_foot">
<div class="mm_group">
<button class="btn_default" @click="show_batch = false">取消</button>
<button class="btn_primary" type="button" @click="batchSet()">提交</button>
</div>
</div>
</div>
</mm_modal>
<mm_modal v-model="show" mask="true">
<div class="mm_card">
<div class="card_head">
<h5>修改资产</h5>
</div>
<div class="card_body pa">
<div class="mm_form">
<dl>
<dt>用户昵称</dt>
<dd><span>{{ $to_name(list_account, form.user_id, 'user_id', 'nickname') }}</span></dd>
<dt>等级</dt>
<dd>
<control_input type="number" v-model="form.level" :min="0" />
</dd>
<dt>经验值</dt>
<dd>
<control_input type="number" v-model="form.exp" :min="0" />
</dd>
<dt>现金</dt>
<dd>
<control_number v-model="form.money" :min="0" />
</dd>
<dt>货币</dt>
<dd>
<control_number v-model="form.coin" :min="0" />
</dd>
<dt>智商</dt>
<dd>
<control_input type="number" v-model="form.iq" :min="0" />
</dd>
<dt>信用度</dt>
<dd>
<control_input type="number" v-model="form.credit" :min="0" />
</dd>
<!--{ if(user.gm > 5) }-->
<dt>拓展积分1</dt>
<dd>
<control_number v-model="form.extcredits1" :min="0" />
</dd>
<dt>拓展积分2</dt>
<dd>
<control_number v-model="form.extcredits2" :min="0" />
</dd>
<dt>拓展积分3</dt>
<dd>
<control_number v-model="form.extcredits3" :min="0" />
</dd>
<dt>拓展积分4</dt>
<dd>
<control_number v-model="form.extcredits4" :min="0" />
</dd>
<dt>拓展积分5</dt>
<dd>
<control_number v-model="form.extcredits5" :min="0" />
</dd>
<dt>拓展积分6</dt>
<dd>
<control_number v-model="form.extcredits6" :min="0" />
</dd>
<dt>拓展积分7</dt>
<dd>
<control_number v-model="form.extcredits7" :min="0" />
</dd>
<dt>拓展积分8</dt>
<dd>
<control_number v-model="form.extcredits8" :min="0" />
</dd>
<!--{ /if }-->
</dl>
</div>
</div>
<div class="card_foot">
<div class="mm_group">
<button class="btn_default" @click="show = false">取消</button>
<button class="btn_primary" @click="submit()">提交</button>
</div>
</div>
</div>
</mm_modal>
</div>
${@view('./admin/float.html')}
${@view('./admin/foot.html')}
<script src="/js/vue/mm_vue.js"></script>
<script src="/js/vue/mm_vue_ui.js"></script>
<script src="/src/mixins/page.js"></script>
<script>
Vue.use(mm_vue);
Vue.use(mm_vue_ui);
var app = new Vue({
el: "#app",
mixins: [mixin_page],
data() {
return {
// 列表请求地址
url_get_list: "/apis/user/count",
url_del: "/apis/user/count?method=del&",
url_set: "/apis/user/count?method=set&",
url_add: "/apis/user/count?method=add&",
url_import: "/apis/user/count?method=import&",
url_export: "/apis/user/count?method=export&",
field: "user_id",
query_set: {
"user_id": ""
},
// 查询条件
query: {
//页码
page: 1,
//页面大小
size: 10,
// 用户ID
'user_id': 0,
'iq_min': 0,
'credit_min': 0,
'credit_points_min': 0,
'exp_min': 0,
'extcredits1_min': 0,
'extcredits2_min': 0,
'extcredits3_min': 0,
'extcredits4_min': 0,
'extcredits5_min': 0,
'extcredits6_min': 0,
'extcredits7_min': 0,
'extcredits8_min': 0,
'money_min': 0,
'coin_min': 0,
'iq_max': 0,
'credit_max': 0,
'credit_points_max': 0,
'exp_max': 0,
'extcredits1_max': 0,
'extcredits2_max': 0,
'extcredits3_max': 0,
'extcredits4_max': 0,
'extcredits5_max': 0,
'extcredits6_max': 0,
'extcredits7_max': 0,
'extcredits8_max': 0,
'money_max': 0,
'coin_max': 0,
// 关键词
'keyword': '',
//排序
orderby: ""
},
form: {
'level': 0,
'iq': 0,
'credit': 0,
'credit_points': 0,
'exp': 0,
'extcredits1': 0,
'extcredits2': 0,
'extcredits3': 0,
'extcredits4': 0,
'extcredits5': 0,
'extcredits6': 0,
'extcredits7': 0,
'extcredits8': 0,
'money': 0,
'coin': 0
},
list_account: [],
// 视图模型
vm: {}
}
},
methods: {
batch_show() {
this.form = {
state: 0,
group_id: 0,
admin_id: 0,
gm: ''
}
this.show_batch = true;
},
/**
* 获取用户信息
* @param {query} 查询条件
*/
get_account(query) {
var _this = this;
if (!query) {
query = {
field: "user_id,nickname"
};
}
this.$get('~/apis/user/account?size=0', query, function(json) {
if (json.result) {
_this.list_account.clear();
_this.list_account.addList(json.result.list)
}
});
},
edit_show(o) {
this.form = Object.assign({}, o);
this.show = true;
},
submit_before(param) {
delete param.login_time;
if (param.password) {
if (param.password.length < 16) {
param.password = (param.password.md5() + param.salt).md5();
}
}
return param;
},
get_list_after() {
setTimeout(() => {
big_pic(".avatar");
}, 500)
}
},
created() {
// 获取用户
this.get_account();
}
});
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/qiuwenwu91/mm_tpl_user.git
git@gitee.com:qiuwenwu91/mm_tpl_user.git
qiuwenwu91
mm_tpl_user
超级美眉-用户-模板
master

搜索帮助