Compare commits

..

4 Commits

Author SHA1 Message Date
dragon
e31f755216 完成周奖励后台 2025-02-07 18:19:12 +08:00
dragon
a73f806d92 周奖励后台暂存 2025-02-07 18:19:12 +08:00
khalil
fa1138dc03 ip限制-增加原因 2025-02-06 16:40:48 +08:00
dragon
6191f1a3f5 新增分区 2025-02-06 15:53:35 +08:00
5 changed files with 901 additions and 354 deletions

View File

@@ -20,13 +20,35 @@ export const chargeAgentExport = query => {
}; };
// 获取 周期列表 // 获取 周期列表
export const getDateCycleList = query => { export const getDateCycleList = query => {
return request({ return request({
url: '/anchorSalaryBill/dateCycle/list', url: '/anchorSalaryBill/dateCycle/list',
method: 'get', method: 'get',
params: query params: query
}); });
}; };
// 获取 周奖励周期列表
export const familyMemberWeekLevelRewardListCycleDate = query => {
return request({
url: '/admin/familyMemberWeekLevelReward/listCycleDate',
method: 'get',
params: query
});
};
// 获取 周奖励查询列表
export const familyMemberWeekLevelRewardPage = query => {
return request({
url: '/admin/familyMemberWeekLevelReward/page',
method: 'get',
params: query
});
};
// 导出
export const familyMemberWeekLevelRewardExport = query => {
window.location.href = `/admin/familyMemberWeekLevelReward/export?${genQueryParam(query)}`;
return;
};
// 获取 公会钻石薪资流水统计 列表 // 获取 公会钻石薪资流水统计 列表
export const getAgencyDiamondFlow = query => { export const getAgencyDiamondFlow = query => {

View File

@@ -51,6 +51,7 @@
{{langFormat(scope.row.lang)}} {{langFormat(scope.row.lang)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="reason" align="center" label="原因" />
<el-table-column align="center" label="操作" width="300"> <el-table-column align="center" label="操作" width="300">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button

View File

@@ -0,0 +1,282 @@
<template>
<div class="box">
<!-- 查询 -->
<div class="inquire">
<div class="block">
<span class="demonstration">分区</span>
<el-select
v-model="inquire.partitionId"
style="width: 75%"
placeholder="请选择"
>
<el-option
v-for="item in inquire.partitionArr"
:key="item.id"
:label="item.desc"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<div class="inquire">
<span>周期</span>
<el-select v-model="inquire.gameArrVal" placeholder="请选择">
<el-option
v-for="item in inquire.gamesArr"
:key="item.gameId"
:label="item.gameName"
:value="item.gameId"
>
</el-option>
</el-select>
</div>
<div class="inquire">
<span>ID</span>
<el-input
v-model="inquire.userId"
placeholder=""
class="input"
></el-input>
</div>
<!-- 查询按钮 -->
<el-button
class="primary"
type="primary"
@click="
tableData = [];
currentPage = 1;
isFinished = false;
getData();
"
>查询</el-button
>
<el-button
class="primary"
type="primary"
@click="
this.inquire.userId = '';
this.getData();
"
>重置搜索</el-button
>
<el-button class="primary" type="primary" @click="confirmExport2Excel()"
>导出</el-button
>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
ref="multipleTable"
@selection-change="handleSelectionChange"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="cycleDate" align="center" label="周期" />
<el-table-column prop="familyId" align="center" label="公会ID" />
<el-table-column prop="familyName" align="center" label="公会昵称" />
<el-table-column prop="familyOwnerId" align="center" label="公会长ID" />
<el-table-column
prop="familyOwnerNick"
align="center"
label="公会长昵称"
/>
<el-table-column prop="erbanNo" align="center" label="主播ID" />
<el-table-column prop="nick" align="center" label="主播昵称" />
<el-table-column prop="level" align="center" label="主播等级" />
<el-table-column prop="processNum" align="center" label="钻石流水" />
<el-table-column prop="rewardNum" align="center" label="已获得金币" />
<el-table-column prop="receivedNum" align="center" label="已领取金币" />
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[1, 10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import {
familyMemberWeekLevelRewardPage,
familyMemberWeekLevelRewardExport,
familyMemberWeekLevelRewardListCycleDate,
} from "@/api/relAgency/relAgency";
import { listPartitionInfo } from "@/api/noblemanNew/noblemanNew";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage, ElTable } from "element-plus";
import { ref } from "vue";
import { ElMessageBox } from "element-plus"; // 正确引入 ElM
export default {
name: "weeklyRewards",
data() {
return {
loading: false,
//查询所需条件对象
inquire: {
userId: "",
gamesArr: [],
gameArrVal: 1,
partitionId: 1,
partitionArr: [
{ id: 1, desc: "英语区" },
{ id: 2, desc: "阿拉伯" },
],
},
// 表格
tableData: [],
// 分页
total: 0, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
};
},
created() {
// const timestamps = this.getCurrentWeekTimestamps();
// var obj = {};
// timestamps.forEach((res, i) => {
// this.inquire.gamesArr[i] = {
// gameName: dateFormat(res, "yyyy-MM-dd"),
// gameId: dateFormat(res, "yyyy-MM-dd"),
// };
// });
// this.inquire.gameArrVal = this.inquire.gamesArr[0].gameId;
familyMemberWeekLevelRewardListCycleDate().then((res) => {
if (res.code == 200) {
res.data.forEach((res, i) => {
this.inquire.gamesArr[i] = {
gameName: `${dateFormat(res.startDate, "yyyy-MM-dd")}~${dateFormat(
res.endDate,
"yyyy-MM-dd"
)}`,
gameId: res.dateCycle,
};
});
this.inquire.gameArrVal = this.inquire.gamesArr[0].gameId;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
// listPartitionInfo().then((res) => {
// this.inquire.partitionArr = res.data;
// this.inquire.partitionId = this.inquire.partitionArr[0].id;
// this.getData();
// });
},
methods: {
// 查询接口
getData() {
this.isLoading = true;
this.loading = true;
familyMemberWeekLevelRewardPage({
cycleDate: this.inquire.gameArrVal,
erbanNo: this.inquire.userId,
pageNo: this.currentPage,
pageSize: this.pageSize,
partitionId: this.inquire.partitionId,
}).then((res) => {
if (res.code == 200) {
this.total = res.data.total;
this.tableData = res.data.rows;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
this.loading = false;
this.isLoading = false;
});
},
getCurrentWeekTimestamps() {
const today = new Date();
const dayOfWeek = today.getDay(); // 0周日到6周六
// 计算到周一的天数差:周日需-6天其他天减(当前星期数 - 1)
const diffToMonday = dayOfWeek === 0 ? -6 : 1 - dayOfWeek;
const monday = new Date(today);
monday.setDate(monday.getDate() + diffToMonday);
monday.setHours(0, 0, 0, 0); // 设置为周一的0点
const weekTimestamps = [];
for (let i = 0; i < 7; i++) {
const date = new Date(monday);
date.setDate(monday.getDate() + i);
weekTimestamps.push(date.getTime());
}
return weekTimestamps; // 包含周一到周日每天0点的时间戳数组
},
// 导出
confirmExport2Excel() {
familyMemberWeekLevelRewardExport({
cycleDate: this.inquire.gameArrVal,
erbanNo: this.inquire.userId,
partitionId: this.inquire.partitionId,
}).then();
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
.selectBox {
display: flex;
height: 35px;
line-height: 35px;
margin-bottom: 20px;
}
.selectBoxImg {
height: 150px;
}
.pagination {
margin: 10px auto 10px;
position: relative;
left: 50%;
transform: translateX(-50%);
}
.pagination_in {
text-align: center;
}
</style>

View File

@@ -1,369 +1,584 @@
<template> <template>
<section class="content"> <section class="content">
<div class="box box-primary"> <div class="box box-primary">
<div class="box-body"> <div class="box-body">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1 id="itemTitle"></h1> <h1 id="itemTitle"></h1>
</section> </section>
<div id="toolbar"> <div class="col-sm-12">
<div class="col-sm-12"> <label for="partitionId" class="col-sm-1 control-label">地区:</label>
<button id="btnSearch" class="btn btn-default"> <div class="col-sm-2">
<i class="glyphicon glyphicon-search"></i>查询 <select name="partitionId" id="partitionId" class="form-control">
</button> <option value="4" selected>华语区</option>
<button id="btnAdd" class="btn btn-default"> </select>
<i class="glyphicon glyphicon-plus"></i>增加 </div>
</button>
</div>
<input type="hidden" id="currentPageNum">
</div>
</div>
<!-- .content -->
<div id="table"></div>
</div> </div>
</section> <div id="toolbar">
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnAdd" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
<div class="modal fade" id="roomTabModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"> <input type="hidden" id="currentPageNum" />
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">编辑房间标签</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group">
<label for="modal_seq" class="col-sm-3 control-label">排序<font color="red">*</font>:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[custom[integer]]" name="seq" id="modal_seq"
placeholder="数字小的排前面,必填">
</div>
</div>
<div class="form-group">
<label for="modal_name" class="col-sm-3 control-label">名称<font color="red">*</font>:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="name" id="modal_name">
</div>
</div>
<div class="form-group">
<label for="ar_modal_name" class="col-sm-3 control-label">阿语名称<font color="red">*</font>:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="name" id="ar_modal_name">
</div>
</div>
<div class="form-group">
<label for="en_modal_name" class="col-sm-3 control-label">英语名称<font color="red">*</font>:</label>
<div class="col-sm-9">
<input type="text" class="form-control validate[required]" name="name" id="en_modal_name">
</div>
</div>
<div class="form-group">
<label for="status" class="col-sm-3 control-label">显示状态<font color="red">*</font></label>
<div class="col-sm-9">
<select name="status" id="modal_status" class="form-control validate[required]">
<option value=""></option>
<option value="1">显示</option>
<option value="0">不显示</option>
</select>
</div>
</div>
<div class="form-group">
<label for="room_tab_show" class="col-sm-3 control-label">房间管理列表展示状态<font color="red">*</font>
</label>
<div class="col-sm-9">
<select name="room_tab_show" id="modal_room_tab_show"
class="form-control validate[required]">
<option value=""></option>
<option value="true">展示</option>
<option value="false">不展示</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div> </div>
</div>
<!-- .content -->
<div id="table"></div>
</div> </div>
</section>
<div
class="modal fade"
id="roomTabModal"
tabindex="-1"
role="dialog"
aria-labelledby="modalLabel"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">编辑房间标签</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<div class="form-group">
<label for="modal_seq" class="col-sm-3 control-label"
>排序<font color="red">*</font>:</label
>
<div class="col-sm-9">
<input
type="text"
class="form-control validate[custom[integer]]"
name="seq"
id="modal_seq"
placeholder="数字小的排前面,必填"
/>
</div>
</div>
<div class="form-group">
<label for="modal_name" class="col-sm-3 control-label"
>名称<font color="red">*</font>:</label
>
<div class="col-sm-9">
<input
type="text"
class="form-control validate[required]"
name="name"
id="modal_name"
/>
</div>
</div>
<div class="form-group">
<label for="ar_modal_name" class="col-sm-3 control-label"
>阿语名称<font color="red">*</font>:</label
>
<div class="col-sm-9">
<input
type="text"
class="form-control validate[required]"
name="name"
id="ar_modal_name"
/>
</div>
</div>
<div class="form-group">
<label for="en_modal_name" class="col-sm-3 control-label"
>英语名称<font color="red">*</font>:</label
>
<div class="col-sm-9">
<input
type="text"
class="form-control validate[required]"
name="name"
id="en_modal_name"
/>
</div>
</div>
<div class="form-group">
<label for="tr_modal_name" class="col-sm-3 control-label"
>土耳其名称<font color="red">*</font>:</label
>
<div class="col-sm-9">
<input
type="text"
class="form-control validate[required]"
name="name"
id="tr_modal_name"
/>
</div>
</div>
<div class="form-group">
<label for="status" class="col-sm-3 control-label"
>显示状态<font color="red">*</font></label
>
<div class="col-sm-9">
<select
name="status"
id="modal_status"
class="form-control validate[required]"
>
<option value=""></option>
<option value="1">显示</option>
<option value="0">不显示</option>
</select>
</div>
</div>
<div class="form-group">
<label for="room_tab_show" class="col-sm-3 control-label"
>房间管理列表展示状态<font color="red">*</font> </label
>
<div class="col-sm-9">
<select
name="room_tab_show"
id="modal_room_tab_show"
class="form-control validate[required]"
>
<option value=""></option>
<option value="true">展示</option>
<option value="false">不展示</option>
</select>
</div>
</div>
<div class="form-group" id="imgBox">
<label class="col-sm-3 control-label">icon</label>
<div class="col-sm-8">
<img
src=""
id="iconImgUrl"
style="width: 108px; height: 45px"
alt=""
/>
<input
type="file"
id="iconFile"
name="uploadFile"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"
/>
<button class="btn btn-success" type="button" id="iconBtn">
上传
</button>
<input
type="hidden"
id="iconUrl"
name="alertWinPic"
class="form-control validate[required]"
/>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">
关闭
</button>
<button type="button" class="btn btn-primary" id="add">确定</button>
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
import TableHelper from '@/utils/bootstrap-table-helper'; import TableHelper from "@/utils/bootstrap-table-helper";
import { getPartitionInfoList } from "@/api/partition/partitionInfo";
import { buildSelectOption } from "@/utils/system-helper";
export default { export default {
name: "RoomTabView", name: "RoomTabView",
setup() { setup() {
return {}; return {};
}, },
created() { created() {
this.$nextTick(function () { this.$nextTick(function () {
this.initData(); this.initPartition();
}); this.initData();
}, });
methods: { },
initData() { methods: {
$(function () { initData() {
$('#table').bootstrapTable('destroy'); $(function () {
$('#table').bootstrapTable({ $("#table").bootstrapTable("destroy");
columns: [ $("#table").bootstrapTable({
{ field: 'seq', title: '排序', align: 'center', width: '5%' }, columns: [
{field: 'name.zh', title: 'Tab名称', align: 'center', width: '10%'}, { field: "seq", title: "排序", align: "center", width: "5%" },
{field: 'name.ar', title: '阿语Tab名称', align: 'center', width: '10%'}, {
{field: 'name.en', title: '英语Tab名称', align: 'center', width: '10%'}, field: "name.zh",
{ title: "Tab名称",
field: 'status', title: '显示状态', align: 'center', valign: 'middle', width: '5%', align: "center",
formatter: function (val, row, index) { width: "10%",
if (val) { },
return '显示'; {
} else { field: "name.ar",
return '不显示'; title: "阿语Tab名称",
} align: "center",
width: "10%",
} },
}, {
{ field: "name.en",
field: 'roomTabShow', title: '房间管理列表展示状态', align: 'center', valign: 'middle', width: '5%', title: "英语Tab名称",
formatter: function (val, row, index) { align: "center",
if (val) { width: "10%",
return '展示'; },
} else { {
return '不展示'; field: "name.tr",
} title: "土耳其Tab名称",
align: "center",
} width: "10%",
}, },
{ {
field: 'id', field: "status",
title: '操作', title: "显示状态",
align: 'center', align: "center",
width: '10%', valign: "middle",
formatter: function (val, row, index) { width: "5%",
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' + formatter: function (val, row, index) {
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' + if (val) {
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + return "显示";
'><i class="glyphicon glyphicon-remove"></i>删除</button>'; } else {
} return "不显示";
} }
], },
undefinedText: 0, },
cache: false, {
striped: true, field: "icon",
showRefresh: false, title: "图标",
pageSize: 20, align: "center",
pagination: true, valign: "middle",
pageList: [20, 50, 100, 200, 300, 500], width: "10%",
search: false, formatter: function (val, row, index) {
sidePagination: "server", //表示服务端请求 if (null != val && val != "") {
queryParamsType: "undefined", return (
queryParams: function queryParams(params) { //设置查询参数 '<img src="' +
$("#currentPageNum").val(params.pageNumber); val +
var param = { '" alt="" style="width: 50px; height: 50px;">'
page: params.pageNumber, );
pageSize: params.pageSize, }
}; return "-";
return param; },
}, },
ajax: function (request) { //使用ajax请求 {
$.ajax({ field: "roomTabShow",
type: "GET", title: "房间管理列表展示状态",
url: '/admin/roomTab/list', align: "center",
contentType: 'application/json;charset=utf-8', valign: "middle",
dataType: 'json', width: "5%",
data: request.data, formatter: function (val, row, index) {
success: function (res) { if (val) {
console.log(res); return "展示";
request.success({ } else {
"rows": res.rows.map(i=>{ return "不展示";
let name = i.name; }
if (name.startsWith('{') && name.endsWith('}')) { },
i.name = JSON.parse(i.name); },
} else { {
i.name = { field: "id",
zh: i.name, title: "操作",
ar: i.name, align: "center",
en: i.name, width: "10%",
}; formatter: function (val, row, index) {
} return (
return i; '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' +
}), val +
"total": res.total ">" +
}); '<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
}, '&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id=' +
error: function (error) { val +
console.log(error); '><i class="glyphicon glyphicon-remove"></i>删除</button>'
} );
}) },
}, },
toolbar: '#toolbar', ],
onLoadSuccess: function () { //加载成功时执行 undefinedText: 0,
console.log("load success"); cache: false,
}, striped: true,
onLoadError: function () { //加载失败时执行 showRefresh: false,
console.log("load fail"); pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200, 300, 500],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
//设置查询参数
$("#currentPageNum").val(params.pageNumber);
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
partitionId: $("#partitionId").val(),
};
return param;
},
ajax: function (request) {
//使用ajax请求
$.ajax({
type: "GET",
url: "/admin/roomTab/list",
contentType: "application/json;charset=utf-8",
dataType: "json",
data: request.data,
success: function (res) {
console.log(res);
request.success({
rows: res.rows.map((i) => {
let name = i.name;
if (name.startsWith("{") && name.endsWith("}")) {
i.name = JSON.parse(i.name);
} else {
i.name = {
zh: i.name,
ar: i.name,
en: i.name,
};
} }
return i;
}),
total: res.total,
}); });
},
error: function (error) {
// 查询刷新 console.log(error);
$('#btnSearch').on('click', function () { },
TableHelper.doRefresh('#table');
});
//新建标签
$("#btnAdd").click(function () {
$("#id").val("");
$("#modal_name").val("");
$("#ar_modal_name").val("");
$("#en_modal_name").val("");
$("#modal_seq").val("");
$("#modal_status").val("");
$("#modal_room_tab_show").val("");
$("#modal_type").val("");
$("#modal_istop").val("");
$("#modal_description").val("");
$('#addActPic').val('');
$('#addUploadFile').val('');
$('#addImgUrl').attr('src', '');
$("#roomTabModal").modal('show');
});
$("#add").click(function () {
var id = $("#id").val();
var name = $("#modal_name").val();
// 阿语名称
var ar_name = $("#ar_modal_name").val();
// 英语名称
var en_name = $("#en_modal_name").val();
// 国际化字段
var jsonName = {"zh":name,"ar":ar_name,"en":en_name}
const nameValue = JSON.stringify(jsonName);
var seq = $("#modal_seq").val();
var status = $("#modal_status").val();
var roomTabShow = $("#modal_room_tab_show").val();
if ($("#addForm").validationEngine('validate')) {
$.ajax({
type: "post",
url: "/admin/roomTab/save",
data: {
id: id,
name: nameValue,
seq: seq,
status: status,
roomTabShow: roomTabShow,
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTabModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#roomTabModal").modal('hide');
}
}
});
}
});
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
$('#addImgUrl').attr('src', '');
$('#addActPic').val('');
$('#addUploadFile').val('');
$.ajax({
type: "get",
url: "/admin/roomTab/get",
data: { id: id },
dataType: "json",
success: function (ret) {
console.log(ret);
if (ret.code == 200) {
var json = ret.data.roomTab;
$("#id").val(id);
let name = json.name;
if (name.startsWith('{') && name.endsWith('}')) {
var jsonName = JSON.parse(json.name);
$("#modal_name").val(jsonName.zh);
// 阿语名称
$("#ar_modal_name").val(jsonName.ar);
// 英语名称
$("#en_modal_name").val(jsonName.en);
} else {
$("#modal_name").val(name);
// 阿语名称
$("#ar_modal_name").val(name);
// 英语名称
$("#en_modal_name").val(name);
}
$("#modal_seq").val(json.seq);
if (json.status == 1) {
$("#modal_status").val(1);
} else {
$("#modal_status").val(0);
}
if (json.roomTabShow == 1) {
$("#modal_room_tab_show").val("true");
} else {
$("#modal_room_tab_show").val("false");
}
// 打开编辑弹窗
$("#roomTabModal").modal('show');
$("#modalLabel").text("编辑房间Tab");
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');
}
}
});
});
$("#table").on("click", '.opt-remove', function () {
var id = $(this).attr("data-id");
if (id == 'undefined') {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal('show');
return;
}
if (confirm("你确认删除吗? \r\n 删除后隐藏tab不会显示请谨慎操作")) {
$.ajax({
type: 'post',
url: "/admin/roomTab/hide",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal('show');
}
}
});
}
});
}); });
} },
}, toolbar: "#toolbar",
onLoadSuccess: function () {
//加载成功时执行
console.log("load success");
},
onLoadError: function () {
//加载失败时执行
console.log("load fail");
},
});
// 查询刷新
$("#btnSearch").on("click", function () {
TableHelper.doRefresh("#table");
});
//新建标签
$("#btnAdd").click(function () {
$("#id").val("");
$("#modal_name").val("");
$("#ar_modal_name").val("");
$("#en_modal_name").val("");
$("#tr_modal_name").val("");
$("#modal_seq").val("");
$("#modal_status").val("");
$("#modal_room_tab_show").val("");
$("#modal_type").val("");
$("#modal_istop").val("");
$("#modal_description").val("");
$("#addActPic").val("");
$("#addUploadFile").val("");
$("#addImgUrl").attr("src", "");
$("#roomTabModal").modal("show");
});
$("#add").click(function () {
var id = $("#id").val();
var name = $("#modal_name").val();
// 阿语名称
var ar_name = $("#ar_modal_name").val();
// 英语名称
var en_name = $("#en_modal_name").val();
var tr_name = $("#tr_modal_name").val();
// 国际化字段
var jsonName = { zh: name, ar: ar_name, en: en_name, tr: tr_name };
const nameValue = JSON.stringify(jsonName);
var seq = $("#modal_seq").val();
var status = $("#modal_status").val();
var roomTabShow = $("#modal_room_tab_show").val();
var icon = $("#iconImgUrl").attr("src");
if ($("#addForm").validationEngine("validate")) {
$.ajax({
type: "post",
url: "/admin/roomTab/save",
data: {
id: id,
name: nameValue,
seq: seq,
status: status,
roomTabShow: roomTabShow,
icon: icon,
},
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("保存成功");
$("#tipModal").modal("show");
TableHelper.doRefresh("#table");
$("#roomTabModal").modal("hide");
} else {
$("#tipMsg").text("保存失败." + json.msg);
$("#tipModal").modal("show");
TableHelper.doRefresh("#table");
$("#roomTabModal").modal("hide");
}
},
});
}
});
$("#table").on("click", ".opt-edit", function () {
var id = $(this).attr("data-id");
$("#addImgUrl").attr("src", "");
$("#addActPic").val("");
$("#addUploadFile").val("");
$.ajax({
type: "get",
url: "/admin/roomTab/get",
data: { id: id },
dataType: "json",
success: function (ret) {
console.log(ret);
if (ret.code == 200) {
var json = ret.data.roomTab;
$("#id").val(id);
let name = json.name;
$('#iconImgUrl').attr('src',json.icon);
if (name.startsWith("{") && name.endsWith("}")) {
var jsonName = JSON.parse(json.name);
$("#modal_name").val(jsonName.zh);
// 阿语名称
$("#ar_modal_name").val(jsonName.ar);
// 英语名称
$("#en_modal_name").val(jsonName.en);
// 土耳其名称
$("#tr_modal_name").val(jsonName.tr);
} else {
$("#modal_name").val(name);
// 阿语名称
$("#ar_modal_name").val(name);
// 英语名称
$("#en_modal_name").val(name);
// 土耳其名称
$("#tr_modal_name").val(name);
}
$("#modal_seq").val(json.seq);
if (json.status == 1) {
$("#modal_status").val(1);
} else {
$("#modal_status").val(0);
}
if (json.roomTabShow == 1) {
$("#modal_room_tab_show").val("true");
} else {
$("#modal_room_tab_show").val("false");
}
// 打开编辑弹窗
$("#roomTabModal").modal("show");
$("#modalLabel").text("编辑房间Tab");
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal("show");
}
},
});
});
$("#table").on("click", ".opt-remove", function () {
var id = $(this).attr("data-id");
if (id == "undefined") {
$("#tipMsg").text("id参数有误");
$("#tipModal").modal("show");
return;
}
if (
confirm("你确认删除吗? \r\n 删除后隐藏tab不会显示请谨慎操作")
) {
$.ajax({
type: "post",
url: "/admin/roomTab/hide",
data: { id: id },
dataType: "json",
success: function (json) {
if (json.code == 200) {
$("#tipMsg").text("删除成功");
$("#tipModal").modal("show");
TableHelper.doRefresh("#table");
} else {
$("#tipMsg").text("删除失败");
$("#tipModal").modal("show");
}
},
});
}
});
$("#iconBtn").on("click", function () {
if ($("#iconFile").val() == "") {
$("#tipMsg").text("上传图片为空");
$("#tipModal").modal("show");
return;
}
$.ajaxFileUpload({
fileElementId: "iconFile", //需要上传的文件域的ID即<input type="file">的ID。
url: "/admin/upload/img", //后台方法的路径
type: "post", //当要提交自定义参数时这个参数要设置成post
dataType: "json", //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) {
//提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$("#iconUrl").val(json.path);
$("#iconImgUrl").attr("src", json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal("show");
}
},
error: function (data, status, e) {
//提交失败自动执行的处理函数。
console.error(e);
},
});
});
function clearModal() {
$("#iconImgUrl").attr("src", "");
$("#addForm")
.find("input[type=text],input[type=hidden],input[type=file]")
.each(function () {
$(this).val("");
});
$("#type").val(1);
}
});
},
initPartition() {
getPartitionInfoList().then((res) => {
let data = res.data;
buildSelectOption(
"#partitionId",
4,
data.map((v) => {
return {
value: v.id,
text: v.desc,
};
})
);
});
},
},
}; };
</script> </script>

View File

@@ -16,6 +16,14 @@
method="post" method="post"
target="_blank" target="_blank"
> >
<div class="col-sm-12">
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
<div class="col-sm-2">
<select name="partitionId" id="partitionId" class="form-control">
<option value="4" selected>华语区</option>
</select>
</div>
</div>
<div class="col-sm-12"> <div class="col-sm-12">
<label for="erbanNo" class="col-sm-1 control-label" <label for="erbanNo" class="col-sm-1 control-label"
>平台号:</label >平台号:</label
@@ -240,6 +248,8 @@
<script> <script>
import TableHelper from "@/utils/bootstrap-table-helper"; import TableHelper from "@/utils/bootstrap-table-helper";
import { showLoading, hideLoading } from "@/utils/maintainer"; import { showLoading, hideLoading } from "@/utils/maintainer";
import { getPartitionInfoList } from "@/api/partition/partitionInfo";
import { buildSelectOption } from "@/utils/system-helper";
var picker1 = $("#beginDate").datetimepicker({ var picker1 = $("#beginDate").datetimepicker({
format: "yyyy-mm-dd hh:ii:00", format: "yyyy-mm-dd hh:ii:00",
@@ -325,6 +335,7 @@ export default {
created() { created() {
this.$nextTick(function () { this.$nextTick(function () {
this.initData(); this.initData();
this.initPartition();
}); });
}, },
methods: { methods: {
@@ -503,6 +514,7 @@ export default {
beginDate: $("#beginDate").val(), beginDate: $("#beginDate").val(),
endDate: $("#endDate").val(), endDate: $("#endDate").val(),
wolrdId: $("#wolrdId").val(), wolrdId: $("#wolrdId").val(),
partitionId: $("#partitionId").val(),
}; };
return param; return param;
}, },
@@ -640,6 +652,21 @@ export default {
}); });
}); });
}, },
initPartition() {
getPartitionInfoList().then((res) => {
let data = res.data;
buildSelectOption(
"#partitionId",
4,
data.map((v) => {
return {
value: v.id,
text: v.desc,
};
})
);
});
},
}, },
}; };