1888 lines
96 KiB
Vue
1888 lines
96 KiB
Vue
<template>
|
||
<section class="content">
|
||
<div class="box box-primary">
|
||
<div class="box-body">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1 id="itemTitle"></h1>
|
||
</section>
|
||
<!-- .content -->
|
||
<section class="content">
|
||
<div id="table"></div>
|
||
<div id="toolbar">
|
||
<div class="col-sm-12">
|
||
<label for="selectGiftName" class="col-sm-1 control-label">名称:</label>
|
||
<div class="col-sm-2">
|
||
<input type="text" class="form-control" name="selectGiftName" id="selectGiftName"
|
||
placeholder="礼物名称" />
|
||
</div>
|
||
|
||
<label for="selectGiftGoldMin" class="col-sm-1 control-label">价格:</label>
|
||
<div class="col-sm-2">
|
||
<input type="number" class="form-control" name="selectGiftGoldMin" id="selectGiftGoldMin"
|
||
placeholder="下限" />
|
||
</div>
|
||
<label for="selectGiftGoldMax" class="col-sm-1 control-label">-</label>
|
||
<div class="col-sm-2">
|
||
<input type="number" class="form-control" name="selectGiftGoldMax" id="selectGiftGoldMax"
|
||
placeholder="上限" />
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-12">
|
||
<label for="condition_type" class="col-sm-1 control-label">状态:</label>
|
||
<div class="col-sm-2">
|
||
<select name="condition_type" id="condition_type" class="form-control">
|
||
<option value="0" selected="selected">全部</option>
|
||
<option value="1">有效</option>
|
||
<option value="2">无效</option>
|
||
</select>
|
||
</div>
|
||
|
||
<label for="consume_type" class="col-sm-1 control-label">消费类型:</label>
|
||
<div class="col-sm-2">
|
||
<select name="consume_type" id="consume_type" class="form-control">
|
||
<option value="" selected="selected">全部</option>
|
||
<option value="1">钻石礼物</option>
|
||
<option value="2">萝卜礼物</option>
|
||
<option value="3">免费礼物</option>
|
||
</select>
|
||
</div>
|
||
|
||
<label for="gift_type" class="col-sm-1 control-label">礼物类型:</label>
|
||
<div class="col-sm-2">
|
||
<select name="gift_type" id="gift_type" class="form-control">
|
||
<option value="" selected="selected">全部</option>
|
||
<option value="2">普通面板礼物</option>
|
||
<option value="3">福袋礼物</option>
|
||
<option value="5">福袋奖池礼物</option>
|
||
<option value="1">轻聊或者竞拍房</option>
|
||
<option value="4">卡片</option>
|
||
<option value="7">贵族礼物</option>
|
||
<option value="8">周星榜礼物</option>
|
||
<option value="9">合成礼物</option>
|
||
<option value="10">涂鸦礼物</option>
|
||
<option value="11">个播人气礼物</option>
|
||
<option value="15">线性福袋礼物</option>
|
||
<option value="16">超级幸运礼物</option>
|
||
<option value="17">国家礼物</option>
|
||
<option value="18">幸运礼物</option>
|
||
<option value="19">CP礼物</option>
|
||
<option value="20">定制礼物</option>
|
||
</select>
|
||
</div>
|
||
<label for="partitionId" class="col-sm-1 control-label">地区:</label>
|
||
<div class="col-sm-2">
|
||
<select name="partitionId" id="partitionId" class="form-control"></select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-12">
|
||
<button id="gift-add" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-plus"></i>增加
|
||
</button>
|
||
|
||
<button id="gift-multiDel" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-wrench"></i>批量删除
|
||
</button>
|
||
|
||
<button id="gift-version-reset" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-wrench"></i>设置礼物版本
|
||
</button>
|
||
|
||
<button id="gift-refresh" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-wrench"></i>查询
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</section><!-- .content -->
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<div class="modal fade" id="giftVersionModal" tabindex="-1" role="dialog" aria-labelledby="gift-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">×</span>
|
||
</button>
|
||
<h4 class="modal-title" id="gift-modalLabel">版本信息</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="form-horizontal" id="giftVersionForm">
|
||
<div class="form-group">
|
||
<label class="col-sm-4 control-label">当前礼物版本</label>
|
||
<div class="col-sm-8">
|
||
<input type="text" class="form-control" name="giftVersion" id="giftVersion"
|
||
readonly="false">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-4 control-label">新版本</label>
|
||
<div class="col-sm-8">
|
||
<input type="text" class="form-control validate[required]" name="configValue"
|
||
id="newGiftVersion">
|
||
</div>
|
||
</div>
|
||
<input type="hidden" name="configId" id="gift-configId" />
|
||
<input type="hidden" name="configName" id="gift-configName" />
|
||
<input type="hidden" name="nameSpace" id="gift-nameSpace" />
|
||
<input type="hidden" name="configStatus" id="gift-configStatus" />
|
||
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary" id="gift-version-save">保存</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal fade" id="giftModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
|
||
style="height: 100%; overflow: hidden; overflow: scroll;">
|
||
<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">×</span>
|
||
</button>
|
||
<h4 class="modal-title" id="modalLabel">礼物信息</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="form-horizontal" id="giftForm">
|
||
<input type="hidden" name="giftId" id="giftId" />
|
||
<div class="form-group">
|
||
<label for="partitionFlag" class="col-sm-2 control-label">选择分区</label>
|
||
<div class="col-sm-10">
|
||
<input type="checkbox" name="partitionFlag" value="1"/>英语区<br>
|
||
<input type="checkbox" name="partitionFlag" value="2"/>阿拉伯语区<br>
|
||
<input type="checkbox" name="partitionFlag" value="4"/>华语区<br>
|
||
<input type="checkbox" name="partitionFlag" value="8"/>土耳其区<br>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="consumeType" class="col-sm-2 control-label">消费类型</label>
|
||
<div class="col-sm-10">
|
||
<select class="form-control" name="consumeType" id="consumeType"
|
||
data-btn-class="btn-warning" onchange="selectConsumeChange(this)">
|
||
<option value="1" selected="selected">钻石礼物</option>
|
||
<option value="2">萝卜礼物</option>
|
||
<option value="3">免费礼物</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="giftName" class="col-sm-2 control-label">礼物名称</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control validate[required]" name="giftName" id="giftName">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="giftArName" class="col-sm-2 control-label">阿语礼物名称</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control validate[required]" name="giftName" id="giftArName">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="giftEnName" class="col-sm-2 control-label">英语礼物名称</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control validate[required]" name="giftName" id="giftEnName">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="giftTrName" class="col-sm-2 control-label">土耳其礼物名称</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control validate[required]" name="giftName" id="giftTrName">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="goldPrice" class="col-sm-2 control-label">礼物价格</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control validate[required]" name="goldPrice" id="goldPrice">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="giftType" class="col-sm-2 control-label">礼物类型</label>
|
||
<div class="col-sm-10">
|
||
<select name="giftType" id="giftType" class="form-control" data-btn-class="btn-warning">
|
||
<option value="2" selected>普通面板礼物</option>
|
||
<option value="3">福袋礼物</option>
|
||
<option value="5">福袋奖池礼物</option>
|
||
<option value="1">轻聊或者竞拍房</option>
|
||
<option value="4">卡片</option>
|
||
<option value="7">贵族礼物</option>
|
||
<option value="8">周星榜礼物</option>
|
||
<option value="9">合成礼物</option>
|
||
<option value="10">涂鸦礼物</option>
|
||
<option value="11">个播人气礼物</option>
|
||
<option value="15">线性福袋礼物</option>
|
||
<option value="16">超级幸运礼物</option>
|
||
<option value="17">国家礼物</option>
|
||
<option value="18">幸运礼物</option>
|
||
<option value="19">CP礼物</option>
|
||
<option value="20">定制礼物</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="roomFreeGift">
|
||
<div class="form-group">
|
||
<label for="maxStage" class="col-sm-2 control-label">每日获得上限</label>
|
||
<div class="col-sm-10">
|
||
<input type="number" class="form-control" name="maxStage" id="maxStage" min="1"
|
||
placeholder="1">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="firstStageSecond" class="col-sm-2 control-label">首次倒计时秒数</label>
|
||
<div class="col-sm-10">
|
||
<input type="number" class="form-control" name="firstStageSecond" id="firstStageSecond"
|
||
min="1" placeholder="1">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="otherStageSecond" class="col-sm-2 control-label">其余倒计时秒数</label>
|
||
<div class="col-sm-10">
|
||
<input type="number" class="form-control" name="otherStageSecond" id="otherStageSecond"
|
||
min="1" placeholder="1">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="resetTime" class="col-sm-2 control-label">重置时间</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control datepicker" name="resetTime" id="resetTime">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">礼物状态</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="giftStatus" value="1"
|
||
checked>有效</label>
|
||
<label class="radio-inline"><input type="radio" name="giftStatus" value="2">无效</label>
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">特效</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="hasEffect" value="0" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="hasEffect" value="1">是</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">vgg特效</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="hasVggPic" value="0" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="hasVggPic" value="1">是</label>
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">svga动画</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="hasSvga" value="0" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="hasSvga" value="1">是</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">最新礼物</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="isLatest" value="0" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="isLatest" value="1">是</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">是否需要全服通知</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="notifyFull" value="0" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="notifyFull" value="1">是</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">是否需要塞头像</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="showAvatarType" value="0" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="showAvatarType" value="1">送礼者</label>
|
||
<label class="radio-inline"><input type="radio" name="showAvatarType" value="2">收礼者</label>
|
||
<label class="radio-inline"><input type="radio" name="showAvatarType" value="3">左送右收</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">限时礼物</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="isTimeLimit" value="0"
|
||
checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="isTimeLimit" value="1">是</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">房间专属礼物</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="roomExclude" value="0"
|
||
onclick="setRoomId(this)" checked>否</label>
|
||
<label class="radio-inline"><input type="radio" name="roomExclude" value="1"
|
||
onclick="setRoomId(this)">是</label>
|
||
</div>
|
||
<div class="col-sm-10">
|
||
<input type="text" style="display:none" placeholder="输入房间ID,逗号隔开" class="form-control"
|
||
name="roomExcludeId" id="roomExcludeId">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="startValidTime" class="col-sm-2 control-label">定时上线时间</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="input-sm datetime" name="startValidTime" id="startValidTime">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="endValidTime" class="col-sm-2 control-label">定时下线时间</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="input-sm datetime" name="endValidTime" id="endValidTime">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">礼物图片:</label>
|
||
<div class="col-sm-10">
|
||
<img src="" id="picImage" style="width:250px;height:90px;" alt="">
|
||
<input type="file" id="picUploadFile" name="file" @change="changeFile($event)">
|
||
<button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
|
||
<input type="hidden" id="picUrl" name="picUrl" class="form-control validate[required]" />
|
||
<span id="picImgInfo" style="color:red;"></span>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">vgg图片:</label>
|
||
<div class="col-sm-10">
|
||
<img src="" id="vggImage" style="width:250px;height:90px;" alt="">
|
||
<input type="file" id="vggUploadFile" name="file" @change="changeFile($event)">
|
||
<button class="btn btn-success" type="button" id="vggUploadBtn">上传</button>
|
||
<input type="hidden" id="vggUrl" name="vggUrl" class="form-control validate[required]" />
|
||
<span id="vggImgInfo" style="color:red;"></span>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">svga文件:</label>
|
||
<div class="col-sm-10">
|
||
<input type="file" id="svgaUploadFile" name="file" @change="changeFile($event)">
|
||
<button class="btn btn-success" type="button" id="svgaUploadBtn">上传</button>
|
||
<span>注:这里只适用于福袋svga动效上传</span>
|
||
<input type="hidden" id="luckyGiftSvgaUrl" name="luckyGiftSvgaUrl"
|
||
class="form-control validate[required]" />
|
||
<span id="svgaImgInfo" style="color:red;"></span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="otherViewType" class="col-sm-2 control-label">其他视图文件类型:</label>
|
||
<div class="col-sm-10">
|
||
<select name="otherViewType" id="otherViewType" data-btn-class="btn-warning" class="form-control">
|
||
<option value="0">全部</option>
|
||
<option value="1" selected>MP4</option>
|
||
<option value="2">PAG</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">其他视图文件:</label>
|
||
<div class="col-sm-10">
|
||
<video src="" id="viewFile" style="width:50%;height:50%;" alt="" autoplay="true"></video>
|
||
<input type="file" id="viewUploadFile" name="file" @change="changeFile($event)">
|
||
<button class="btn btn-success" type="button" id="viewFileUploadBtn">上传</button>
|
||
<span>注:如果上面已经上传svga素材,此处不要再上传</span>
|
||
<input type="hidden" id="viewUrl" name="viewUrl" class="form-control validate[required]" />
|
||
<span id="viewFileInfo" style="color:red;"></span>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group">
|
||
<label for="giftExplainUrl" class="col-sm-2 control-label">礼物说明</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" placeholder="礼物说明链接,非必填" class="form-control" name="giftExplainUrl"
|
||
id="giftExplainUrl">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label for="seqNo" class="col-sm-2 control-label">排序</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control validate[required]" name="seqNo" id="seqNo">
|
||
</div>
|
||
</div>
|
||
<label class="col-sm-2 control-label">全服通知</label>
|
||
<div class="col-sm-3">
|
||
<label class="radio-inline"><input type="radio" name="isWholeServerLabel" value="0" checked
|
||
disabled>否</label>
|
||
<label class="radio-inline"><input type="radio" name="isWholeServerLabel" value="1"
|
||
disabled>是</label>
|
||
</div>
|
||
<input type="hidden" name="isWholeServer" id="isWholeServer" />
|
||
<input type="hidden" name="notifyStaySecond" id="notifyStaySecond" />
|
||
<input type="hidden" name="isSkipRoom" id="isSkipRoom" />
|
||
<input type="hidden" name="isSendMsg" id="isSendMsg" />
|
||
</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="save">保存</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal first fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">提示信息</h4>
|
||
</div>
|
||
<div class="modal-body" id="tipMsg"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- 为用户赠送礼物饰弹窗 -->
|
||
<div class="modal fade" id="sendGiftModal" 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">x</span></button>
|
||
<h4 class="modal-title" id="modalSendLabel">赠送礼物</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="form-horizontal" id="giftSendForm">
|
||
<input type="hidden" name="sendGiftId" id="sendGiftId" />
|
||
<div class="form-group">
|
||
<label for="sendErbanNo" class="col-sm-3 control-label">平台号</label>
|
||
<div class="col-sm-9">
|
||
<textarea name="sendErbanNo" id="sendErbanNo" class="form-control validate[required]"
|
||
placeholder="多个平台号使用英文逗号,分隔"></textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="giftNum" class="col-sm-3 control-label">赠送数量</label>
|
||
<div class="col-sm-9">
|
||
<input type="text" name="giftNum" id="giftNum" class="form-control validate[required]"
|
||
value="1" />
|
||
</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="send">提交</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!--礼物专属房间列表-->
|
||
<div class="modal fade" id="roomGiftModel" tabindex="-1" role="dialog" aria-labelledby="gift-modalLabel">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content room_class">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||
aria-hidden="true">×</span>
|
||
</button>
|
||
<h4 class="modal-title" id="roomGiftLabel">礼物专属房间列表</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="box box-primary">
|
||
<div class="box-body">
|
||
<section class="content">
|
||
<div id="roomGiftTable"></div>
|
||
<div id="roomGiftToolbar">
|
||
<div class="col-sm-12">
|
||
<label for="erbanNo" class="col-sm-2 control-label">用户平台号:</label>
|
||
<div class="col-sm-3">
|
||
<form class="form-horizontal" id="roomGiftForm">
|
||
<input type="hidden" class="form-control" name="giftId" id="query_gift_id">
|
||
<input type="text" class="form-control" name="erbanNo" id="erbanNo">
|
||
</form>
|
||
</div>
|
||
<button id="roomGiftSearch" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-wrench"></i>查询
|
||
</button>
|
||
<button id="roomGiftAdd" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-plus"></i>增加
|
||
</button>
|
||
<button id="roomGiftImport" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-import"></i>批量导入
|
||
</button>
|
||
<button id="roomGiftMultiDel" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-remove"></i>批量删除
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!--导入专属房间列表-->
|
||
<div class="modal fade" id="roomImportModel" tabindex="-1" role="dialog" aria-labelledby="gift-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">×</span>
|
||
</button>
|
||
<h4 class="modal-title" id="roomImportLabel">礼物专属房间列表</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="form-horizontal" id="roomImportForm">
|
||
<div class="form-group">
|
||
<input type="hidden" id="import_gift_id" name="giftId" />
|
||
<label for="uploadFile" class="col-sm-3 control-label">上传文件:</label>
|
||
<div class="col-sm-9">
|
||
<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
|
||
application/vnd.ms-excel" class="form-control validate[required]" name="uploadFile"
|
||
id="uploadFile" />
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">注意:</label>
|
||
<div class="col-sm-9">
|
||
<span>
|
||
<font color="#dd4b39">1.上传文件仅支持.xls/.xlsx格式的文件<br>
|
||
2.表格的第一行为标题,房间号请从表格的第二行开始填写<br>
|
||
3.导入之前请确认是用户正在使用的平台号,否则会导入失败<br>
|
||
4.导入之前请确认房间是否已存在,如果已存在会导致导入报错</font>
|
||
</span>
|
||
</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="upload">确定</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!--添加专属房间列表-->
|
||
<div class="modal fade" id="roomAddModel" tabindex="-1" role="dialog" aria-labelledby="gift-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">×</span>
|
||
</button>
|
||
<h4 class="modal-title" id="roomAddLabel">礼物专属房间列表</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="form-horizontal" id="roomAddForm">
|
||
<div class="form-group">
|
||
<input type="hidden" id="add_gift_id" name="giftId" />
|
||
<label for="addErbanNos" class="col-sm-3 control-label">房主平台号:</label>
|
||
<div class="col-sm-9">
|
||
<textarea type="text" class="form-control validate[required]" name="erbanNos"
|
||
id="addErbanNos" />
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">注意:</label>
|
||
<div class="col-sm-9">
|
||
<span>
|
||
<font color="#dd4b39">1.多个平台号用换行符分隔<br>
|
||
2.最多支持20个平台号输入<br>
|
||
3.超过20个平台号请使用文件导入方式增加<br>
|
||
4.增加之前请确认房间是否已存在,如果已存在会导致添加报错</font>
|
||
</span>
|
||
</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="roomAdd">确定</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||
import { formatTime, showLoading, hideLoading, apiResult } from '@/utils/maintainer';
|
||
import { uploadGift } from '@/api/common/upload';
|
||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||
import { buildSelectOption } from '@/utils/system-helper';
|
||
|
||
export default {
|
||
name: "GiftManageView",
|
||
data() {
|
||
return {
|
||
files: {},
|
||
};
|
||
},
|
||
setup() {
|
||
function selectConsumeChange(obj) {
|
||
var val = $('#consumeType').val();
|
||
if (val == 2) {
|
||
$('.noble').addClass("hidden");
|
||
} else {
|
||
$('.noble').removeClass("hidden");
|
||
}
|
||
if (val == 3) {
|
||
$('#giftType').val(2);
|
||
$("#giftType").attr('readonly', true);
|
||
$('#roomFreeGift').removeClass("hidden");
|
||
} else {
|
||
$("#giftType").attr('readonly', false);
|
||
$('#roomFreeGift').addClass("hidden");
|
||
}
|
||
}
|
||
// 添加房间专属礼物
|
||
function setRoomId(checkedRadio) {
|
||
checkedRadio.checked = true;
|
||
if (checkedRadio.value == '1') {
|
||
document.getElementById("roomExcludeId").style.display = '';
|
||
} else if (checkedRadio.value == '0') {
|
||
document.getElementById("roomExcludeId").style.display = 'none';
|
||
}
|
||
}
|
||
window.selectConsumeChange = selectConsumeChange;
|
||
window.setRoomId = setRoomId;
|
||
return {
|
||
selectConsumeChange,
|
||
setRoomId
|
||
};
|
||
},
|
||
created() {
|
||
this.$nextTick(function () {
|
||
this.initPartition();
|
||
this.initData();
|
||
});
|
||
},
|
||
methods: {
|
||
changeFile(event) {
|
||
console.log(event);
|
||
let target = event.target;
|
||
let id = target.id;
|
||
this.files[id] = target.files[0];
|
||
},
|
||
initData() {
|
||
let $this = this;
|
||
$(function () {
|
||
$('#table').bootstrapTable('destroy');
|
||
$('#table').bootstrapTable({
|
||
columns: [
|
||
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
|
||
{ field: 'giftId', title: '礼物ID', align: 'center', width: '5%' },
|
||
{field: 'giftName.zh', title: '礼物名称', align: 'center', width: '15%'},
|
||
{field: 'giftName.ar', title: '阿语礼物名称', align: 'center', width: '10%'},
|
||
{field: 'giftName.en', title: '英语礼物名称', align: 'center', width: '10%'},
|
||
{field: 'giftName.tr', title: '土耳其礼物名称', align: 'center', width: '10%'},
|
||
{
|
||
field: 'partitionFlag',
|
||
title: '地区',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
let value = '';
|
||
if ((val & 1) != 0) {
|
||
value += '英语区<br>';
|
||
}
|
||
if ((val & 2) != 0) {
|
||
value += '阿拉伯语区<br>';
|
||
}
|
||
if ((val & 4) != 0) {
|
||
value += '华语区<br>';
|
||
}
|
||
if ((val & 8) != 0) {
|
||
value += '土耳其<br>';
|
||
}
|
||
return value;
|
||
}
|
||
},
|
||
{
|
||
field: 'giftStatus',
|
||
title: '礼物状态',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
if (val == 1) {
|
||
return '有效';
|
||
} else {
|
||
return '无效';
|
||
}
|
||
}
|
||
},
|
||
{ field: 'goldPrice', title: '礼物价格', align: 'center', width: '10%' },
|
||
{
|
||
field: 'consumeType',
|
||
title: '消费类型',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
if (val == 1) {
|
||
return '钻石礼物';
|
||
} else if (val == 2) {
|
||
return '萝卜礼物';
|
||
} else if (val == 3) {
|
||
return '免费礼物';
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'hasEffect',
|
||
title: '特效',
|
||
align: 'center',
|
||
width: '5%',
|
||
formatter: function (val, row, index) {
|
||
if (val == true) {
|
||
return '有';
|
||
} else {
|
||
return '无'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'hasVggPic',
|
||
title: 'vgg特效',
|
||
align: 'center',
|
||
width: '5%',
|
||
formatter: function (val, row, index) {
|
||
if (val == true) {
|
||
return '有';
|
||
} else {
|
||
return '无'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'hasSvga',
|
||
title: 'svga动画',
|
||
align: 'center',
|
||
width: '5%',
|
||
formatter: function (val, row, index) {
|
||
if (val == true) {
|
||
return '有';
|
||
} else {
|
||
return '无'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'isLatest',
|
||
title: '最新礼物',
|
||
align: 'center',
|
||
width: '5%',
|
||
formatter: function (val, row, index) {
|
||
if (val == true) {
|
||
return '是';
|
||
} else {
|
||
return '否'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'isTimeLimit',
|
||
title: '限时礼物',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
if (val == true) {
|
||
return '是';
|
||
} else {
|
||
return '否'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'notifyFull',
|
||
title: '是否需要全服通知',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
if (val == 1) {
|
||
return '是';
|
||
} else {
|
||
return '否'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'showAvatarType',
|
||
title: '是否需要塞头像',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
if (val == 0) {
|
||
return '否';
|
||
}else if (val == 1) {
|
||
return '送礼者';
|
||
} else if (val == 2) {
|
||
return '收礼者';
|
||
}else {
|
||
return '左送右收'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'roomExclude',
|
||
title: '房间专属',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
if (val == true) {
|
||
return '是';
|
||
} else {
|
||
return '否'
|
||
}
|
||
}
|
||
},
|
||
{ field: 'seqNo', title: '排序', align: 'center', width: '10%' },
|
||
{
|
||
field: 'startValidTime', title: '上线时间', align: 'center', width: '10%',
|
||
formatter: function (val) {
|
||
if (val) {
|
||
const date = new Date(val);
|
||
return date.format('yyyy-MM-dd hh:mm:ss');
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'endValidTime', title: '下线时间', align: 'center', width: '10%',
|
||
formatter: function (val) {
|
||
if (val) {
|
||
const date = new Date(val);
|
||
return date.format('yyyy-MM-dd hh:mm:ss');
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'giftId', title: '操作', align: 'center', width: '15%', formatter: function (val, row, index) {
|
||
var str = '<button class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||
'<i class="glyphicon glyphicon-edit"></i>编辑</button>' +
|
||
'<button class="btn btn-sm btn-danger opt-remove" data-id=' + val +
|
||
'><i class="glyphicon glyphicon-remove"></i>删除</button>' +
|
||
'<button class="btn btn-sm btn-warning opt-send" data-id=' + val +
|
||
'><i class="glyphicon glyphicon-send"></i> 赠送</button>';
|
||
if (row.roomExclude) {
|
||
str = str + '<button class="btn btn-sm btn-primary opt-query" data-id=' + val +
|
||
'><i class="glyphicon glyphicon-eye-open"></i> 查看房间列表</button>';
|
||
}
|
||
return str;
|
||
|
||
}
|
||
}
|
||
],
|
||
cache: false,
|
||
striped: true,
|
||
showRefresh: false,
|
||
pageSize: 10,
|
||
pagination: true,
|
||
pageList: [1, 10, 20, 30, 50],
|
||
search: false,
|
||
sidePagination: "server", //表示服务端请求
|
||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||
//设置为limit可以获取limit, offset, search, sort, order
|
||
queryParamsType: "undefined",
|
||
queryParams: function queryParams(params) { //设置查询参数
|
||
var param = {
|
||
pageNumber: params.pageNumber,
|
||
pageSize: params.pageSize,
|
||
searchText: params.searchText,
|
||
type: $('#condition_type').val(),
|
||
consumeType: $('#consume_type').val(),
|
||
giftType: $('#gift_type').val(),
|
||
selectGiftName: $('#selectGiftName').val(),
|
||
selectGiftGoldMin: $('#selectGiftGoldMin').val(),
|
||
selectGiftGoldMax: $('#selectGiftGoldMax').val(),
|
||
partitionId: $('#partitionId').val(),
|
||
};
|
||
return param;
|
||
},
|
||
ajax:function(request){ //使用ajax请求
|
||
$.ajax({
|
||
type:"GET",
|
||
url:'/admin/gift/getList?type=' + ComboboxHelper.getSelected("#condition_type"),
|
||
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 value = i.giftName;
|
||
if (value.startsWith('{') && value.endsWith('}')) {
|
||
i.giftName = JSON.parse(value);
|
||
} else {
|
||
i.giftName = {
|
||
zh: value,
|
||
ar: value,
|
||
en: value,
|
||
};
|
||
}
|
||
return i;
|
||
}),
|
||
"total": res.total
|
||
});
|
||
},
|
||
error:function(error){
|
||
console.log(error);
|
||
}
|
||
})
|
||
},
|
||
toolbar: '#toolbar',
|
||
// url: '/admin/gift/getList',
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
console.log("load success");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.log("load fail");
|
||
}
|
||
});
|
||
|
||
$("#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删除后再也不能找回,请谨慎操作!")) {
|
||
$.ajax({
|
||
type: 'post',
|
||
url: "/admin/gift/del",
|
||
data: { 'ids': JSON.stringify([id]) },
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.success == 'true') {
|
||
$("#tipMsg").text("删除成功");
|
||
$("#tipModal").modal('show');
|
||
TableHelper.doRefresh("#table");
|
||
} else {
|
||
$("#tipMsg").text("删除失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
|
||
$("#gift-add").click(function () {
|
||
// 打开编辑弹窗
|
||
$("#giftModal").modal('show');
|
||
$this.files = {};
|
||
$("#giftForm")[0].reset();
|
||
|
||
$('#picUrl').val('');
|
||
$('#picImage').attr("src", '');
|
||
$("#picImgInfo").html('');
|
||
$("#picUploadFile").val('');
|
||
|
||
$('#vggUrl').val('');
|
||
$("#vggUploadFile").val('');
|
||
$('#vggImage').attr("src", '');
|
||
$("#vggImgInfo").html('');
|
||
|
||
$("#svgaUploadFile").val('');
|
||
$('#luckyGiftSvgaUrl').val('');
|
||
$('#svgaImgInfo').html('');
|
||
$('#giftExplainUrl').val('');
|
||
|
||
$("#seqNo").val('');
|
||
$("#giftId").val('');
|
||
|
||
$('#viewUploadFile').val('');
|
||
$('#viewUrl').val('');
|
||
$('#viewFile').attr("src", '');
|
||
$("#viewFileInfo").html('');
|
||
|
||
$("#startValidTime").val('');
|
||
$("#endValidTime").val('');
|
||
|
||
// $("#giftName").attr('readonly', false);
|
||
// $("#goldPrice").attr('readonly', false);
|
||
$("#nobleId").btComboBox('disable');
|
||
ComboboxHelper.setDef("#nobleId", '0');
|
||
$('#giftType').val(2);
|
||
$("input:radio[name='giftStatus']")[1].checked = true;
|
||
$("input:radio[name='hasEffect']")[0].checked = true;
|
||
$("input:radio[name='hasVggPic']")[1].checked = true;
|
||
$("input:radio[name='hasSvga']")[0].checked = true;
|
||
$("input:radio[name='isLatest']")[0].checked = true;
|
||
$("input:radio[name='isTimeLimit']")[0].checked = true;
|
||
$("input:radio[name='notifyFull']")[0].checked = true;
|
||
$("input:radio[name='showAvatarType']")[0].checked = true;
|
||
$("input:radio[name='roomExclude']")[0].checked = true;
|
||
$("#notifyStaySecond").val('');
|
||
$("#isSkipRoom").val('');
|
||
$("#isSendMsg").val('');
|
||
$("#consumeType").removeAttr("disabled");
|
||
$('#roomExcludeId').val('');
|
||
$('input[name="partitionFlag"]').each(function() {
|
||
$(this).checked = false;
|
||
});
|
||
window.selectConsumeChange($("#consumeType"));
|
||
$('#roomExcludeId').val('');
|
||
});
|
||
|
||
$("#gift-version-save").click(function () {
|
||
if ($("#giftVersionForm").validationEngine('validate')) {
|
||
$.ajax({
|
||
type: "post",
|
||
url: "/admin/sysConf/save",
|
||
data: $('#giftVersionForm').serialize(),
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.success == 'true') {
|
||
$("#giftVersionModal").modal('hide');
|
||
$("#tipMsg").text("设置成功");
|
||
$("#tipModal").modal('show');
|
||
} else {
|
||
$("#tipMsg").text("设置失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
})
|
||
|
||
$("#nobleId").on('change', function () {
|
||
if (ComboboxHelper.getSelected("#nobleId") != 0) {
|
||
var nobleName = $("#nobleId").btComboBox('selectedOption')[1];
|
||
$("#nobleName").val(nobleName);
|
||
}
|
||
else {
|
||
$("#nobleName").val('');
|
||
}
|
||
|
||
})
|
||
|
||
$("#notNoble").on('change', function () {
|
||
ComboboxHelper.setDef("#nobleId", '0');
|
||
$("#nobleName").val('');
|
||
$("#nobleId").btComboBox('disable');
|
||
})
|
||
|
||
$("#isNoble").on('change', function () {
|
||
$("#nobleId").btComboBox('enable');
|
||
})
|
||
|
||
$("#gift-version-reset").click(function () {
|
||
$("#giftVersion").val('');
|
||
$("#gift-configName").val('');
|
||
$("#gift-configId").val('');
|
||
$("#gift-nameSpace").val('');
|
||
$("#gift-configStatus").val('');
|
||
$("#newGiftVersion").val('');
|
||
|
||
$.ajax({
|
||
type: "get",
|
||
url: "/admin/gift/getCurGiftVersion",
|
||
data: {},
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.entity) {
|
||
$("#giftVersion").val(json.entity.configValue);
|
||
$("#gift-configName").val(json.entity.configName);
|
||
$("#gift-configId").val(json.entity.configId);
|
||
$("#gift-nameSpace").val(json.entity.nameSpace);
|
||
$("#gift-configStatus").val(json.entity.configStatus);
|
||
$("#giftVersionModal").modal("show");
|
||
} else {
|
||
$("#tipMsg").text("获取当前礼物版本失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#gift-refresh").click(function () {
|
||
$("#table").bootstrapTable('refresh', { url: '/admin/gift/getList' });
|
||
})
|
||
|
||
$("#gift-multiDel").click(function () {
|
||
var rows = $("#table").bootstrapTable("getSelections");
|
||
if (rows.length == 0) {
|
||
alert("请先选择要删除的记录");
|
||
return;
|
||
}
|
||
console.log("rows: " + rows.length);
|
||
var idArr = [];
|
||
for (var i = 0; i < rows.length; i++) {
|
||
idArr.push(rows[i]['giftId']);
|
||
}
|
||
console.log(idArr);
|
||
|
||
if (confirm("你确认批量删除该记录吗?" +
|
||
"\r\n删除后再也不能找回,请谨慎操作!")) {
|
||
$.ajax({
|
||
type: 'post',
|
||
url: "/admin/gift/del",
|
||
data: { 'ids': JSON.stringify(idArr) },
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.success == 'true') {
|
||
$("#tipMsg").text("删除成功");
|
||
$("#tipModal").modal('show');
|
||
TableHelper.doRefresh("#table");
|
||
} else {
|
||
$("#tipMsg").text("删除失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
$('#picUploadBtn').on('click', function () {
|
||
showLoading();
|
||
uploadGift($this.files['picUploadFile']).then(res => {
|
||
let path = res.path;
|
||
console.log(path);
|
||
$('#picUrl').val(path);
|
||
$('#picImage').attr("src", path);
|
||
if (path != '') {
|
||
$("#picImgInfo").html('已上传成功');
|
||
} else {
|
||
$("#picImgInfo").html('未上传成功');
|
||
}
|
||
hideLoading();
|
||
}).catch(e => {
|
||
console.error(e);
|
||
hideLoading();
|
||
});
|
||
});
|
||
|
||
$('#vggUploadBtn').on('click', function () {
|
||
showLoading();
|
||
uploadGift($this.files['vggUploadFile']).then(res => {
|
||
let path = res.path;
|
||
console.log(path);
|
||
$('#vggUrl').val(path);
|
||
$('#vggImage').attr("src", path);
|
||
if (path != '') {
|
||
$("#vggImgInfo").html('已上传成功');
|
||
} else {
|
||
$("#vggImgInfo").html('未上传成功');
|
||
}
|
||
hideLoading();
|
||
}).catch(e => {
|
||
console.error(e);
|
||
hideLoading();
|
||
});
|
||
});
|
||
|
||
$('#svgaUploadBtn').on('click', function () {
|
||
showLoading();
|
||
uploadGift($this.files['svgaUploadFile']).then(res => {
|
||
let path = res.path;
|
||
console.log(path);
|
||
$('#luckyGiftSvgaUrl').val(path);
|
||
if (path != '') {
|
||
$("#svgaImgInfo").html('已上传成功');
|
||
} else {
|
||
$("#svgaImgInfo").html('未上传成功');
|
||
}
|
||
hideLoading();
|
||
}).catch(e => {
|
||
console.error(e);
|
||
hideLoading();
|
||
});
|
||
});
|
||
|
||
$('#viewFileUploadBtn').on('click', function () {
|
||
showLoading();
|
||
uploadGift($this.files['viewUploadFile']).then(res => {
|
||
let path = res.path;
|
||
console.log(path);
|
||
$('#viewUrl').val(path);
|
||
$('#viewFile').attr("src", path);
|
||
if (path != '') {
|
||
$("#viewFileInfo").html('已上传成功');
|
||
} else {
|
||
$("#viewFileInfo").html('未上传成功');
|
||
}
|
||
hideLoading();
|
||
}).catch(e => {
|
||
console.error(e);
|
||
hideLoading();
|
||
});
|
||
});
|
||
|
||
$("#cancel").click(function () {
|
||
TableHelper.unCheckAll("#table");
|
||
});
|
||
|
||
function parseNum(val) {
|
||
if (val == undefined || val == 'false' || val == 0) {
|
||
return 0;
|
||
}
|
||
else {
|
||
return 1;
|
||
}
|
||
}
|
||
|
||
$('#resetTime').datetimepicker({
|
||
format: 'hh:ii:00',
|
||
autoclose: true,
|
||
});
|
||
|
||
$("#table").on("click", '.opt-edit', function () {
|
||
$('#picUrl').val('');
|
||
$('#picImage').attr("src", '');
|
||
$("#picImgInfo").html('');
|
||
$("#picUploadFile").val('');
|
||
|
||
$('#vggUrl').val('');
|
||
$("#vggUploadFile").val('');
|
||
$('#vggImage').attr("src", '');
|
||
$("#vggImgInfo").html('');
|
||
|
||
$("#svgaUploadFile").val('');
|
||
$('#luckyGiftSvgaUrl').val('');
|
||
$('#svgaImgInfo').html('');
|
||
$('#giftExplainUrl').val('');
|
||
|
||
$("#seqNo").val('');
|
||
$("#giftId").val('');
|
||
|
||
$('#viewUploadFile').val('');
|
||
$('#viewUrl').val('');
|
||
$('#viewFile').attr("src", '');
|
||
$("#viewFileInfo").html('');
|
||
|
||
$("#startValidTime").val('');
|
||
$("#endValidTime").val('');
|
||
$("#nobleId").btComboBox('disable');
|
||
ComboboxHelper.setDef("#nobleId", '0');
|
||
$('#giftType').val(2);
|
||
$("input:radio[name='giftStatus']")[1].checked = true;
|
||
$("input:radio[name='hasEffect']")[1].checked = true;
|
||
$("input:radio[name='hasVggPic']")[1].checked = true;
|
||
$("input:radio[name='hasSvga']")[0].checked = true;
|
||
$("input:radio[name='isLatest']")[1].checked = true;
|
||
$("input:radio[name='isTimeLimit']")[1].checked = true;
|
||
$("input:radio[name='notifyFull']")[0].checked = true;
|
||
$("input:radio[name='showAvatarType']")[0].checked = true;
|
||
$("input:radio[name='roomExclude']")[0].checked = true;
|
||
$('#giftType').val('');
|
||
$("#notifyStaySecond").val('');
|
||
$("#isSkipRoom").val('');
|
||
$("#isSendMsg").val('');
|
||
$("#consumeType").removeAttr("disabled");
|
||
$('#roomExcludeId').val('');
|
||
$("input:checkbox[name='partitionFlag']")[0].checked = false;
|
||
$("input:checkbox[name='partitionFlag']")[1].checked = false;
|
||
$("input:checkbox[name='partitionFlag']")[2].checked = false;
|
||
console.log("btnEdit");
|
||
var id = $(this).attr("data-id");
|
||
$this.files = {};
|
||
$.ajax({
|
||
type: "get",
|
||
url: "/admin/gift/get",
|
||
data: { id: id },
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.roomFreeGiftConfig) {
|
||
$("#maxStage").val(json.roomFreeGiftConfig.maxStage);
|
||
$("#firstStageSecond").val(json.roomFreeGiftConfig.firstStageSecond);
|
||
$("#otherStageSecond").val(json.roomFreeGiftConfig.otherStageSecond);
|
||
$("#resetTime").val(json.roomFreeGiftConfig.resetTime);
|
||
$("#resetTimeCron").val(json.roomFreeGiftConfig.resetTimeCron);
|
||
}
|
||
if (json.entity) {
|
||
$("#giftId").val(json.entity.giftId);
|
||
let giftName = json.entity.giftName;
|
||
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||
var jsonName = JSON.parse(giftName);
|
||
$("#giftName").val(jsonName.zh);
|
||
// 阿语名称
|
||
$("#giftArName").val(jsonName.ar);
|
||
// 英语名称
|
||
$("#giftEnName").val(jsonName.en);
|
||
// 土耳其
|
||
$("#giftTrName").val(jsonName.tr);
|
||
} else {
|
||
$("#giftName").val(giftName);
|
||
// 阿语名称
|
||
$("#giftArName").val(giftName);
|
||
// 英语名称
|
||
$("#giftEnName").val(giftName);
|
||
// 土耳其名称
|
||
$("#giftTrName").val(giftName);
|
||
}
|
||
$("#goldPrice").val(json.entity.goldPrice);
|
||
|
||
$("#seqNo").val(json.entity.seqNo);
|
||
$("#giftExplainUrl").val(json.entity.giftExplainUrl);
|
||
var consumeType = json.entity.consumeType;
|
||
$("#consumeType").val(consumeType);
|
||
$("#consumeType").attr("disabled", true);
|
||
|
||
$('#giftType').val(json.entity.giftType);
|
||
if (consumeType == 1) {
|
||
ComboboxHelper.setDef("#nobleId", '0');
|
||
$("#nobleId").btComboBox('disable');
|
||
$("#nobleName").val('');
|
||
}
|
||
if (consumeType == 2) {
|
||
$('.noble').addClass("hidden");
|
||
} else {
|
||
$('.noble').removeClass("hidden");
|
||
}
|
||
if (consumeType == 3) {
|
||
$("#giftType").attr('readonly', true);
|
||
$('#roomFreeGift').removeClass("hidden")
|
||
} else {
|
||
$("#giftType").attr('readonly', false);
|
||
$('#roomFreeGift').addClass("hidden")
|
||
}
|
||
|
||
$("#startValidTime").val(formatTime(json.entity.startValidTime));
|
||
$("#endValidTime").val(formatTime(json.entity.endValidTime));
|
||
|
||
var hasEffect = parseNum(json.entity.hasEffect);
|
||
var hasVggPic = parseNum(json.entity.hasVggPic);
|
||
var hasSvga = parseNum(json.entity.hasSvga);
|
||
var isLatest = parseNum(json.entity.isLatest);
|
||
var isTimeLimit = parseNum(json.entity.isTimeLimit);
|
||
var notifyFull = parseNum(json.entity.notifyFull);
|
||
var showAvatarType = json.entity.showAvatarType;
|
||
var isWholeServer = parseNum(json.entity.isWholeServer);
|
||
var roomExclude = parseNum(json.entity.roomExclude);
|
||
var partitionFlag = json.entity.partitionFlag;
|
||
$("#isWholeServer").val(isWholeServer);
|
||
|
||
// 礼物状态的值跟其他不同, 1为有效 2为无效
|
||
if (json.entity.giftStatus == 1) {
|
||
$("input:radio[name='giftStatus']")[0].checked = true;
|
||
} else {
|
||
$("input:radio[name='giftStatus']")[1].checked = true;
|
||
}
|
||
// 设置radio
|
||
$("input:radio[name='hasEffect']")[hasEffect].checked = true;
|
||
$("input:radio[name='hasVggPic']")[hasVggPic].checked = true;
|
||
$("input:radio[name='hasSvga']")[hasSvga].checked = true;
|
||
$("input:radio[name='isLatest']")[isLatest].checked = true;
|
||
$("input:radio[name='isTimeLimit']")[isTimeLimit].checked = true;
|
||
$("input:radio[name='notifyFull']")[notifyFull].checked = true;
|
||
$("input:radio[name='showAvatarType']")[showAvatarType].checked = true;
|
||
$("input:radio[name='isWholeServerLabel']")[isWholeServer].checked = true;
|
||
$("input:radio[name='roomExclude']")[roomExclude].checked = true;
|
||
|
||
$("#notifyStaySecond").val(json.entity.notifyStaySecond);
|
||
$("#isSkipRoom").val(json.entity.isSkipRoom);
|
||
$("#isSendMsg").val(json.entity.isSendMsg);
|
||
|
||
// 设置礼物图片
|
||
$("#picUploadFile").val('');
|
||
$('#picUrl').val(json.entity.picUrl);
|
||
$('#picImage').attr("src", json.entity.picUrl);
|
||
if (json.entity.picUrl != '') {
|
||
$("#picImgInfo").html('已上传');
|
||
} else {
|
||
$("#picImgInfo").html('未上传');
|
||
}
|
||
|
||
// 设置vgg图片
|
||
$("#vggUploadFile").val('');
|
||
$('#vggUrl').val(json.entity.vggUrl);
|
||
$('#vggImage').attr("src", json.entity.vggUrl);
|
||
if (json.entity.vggUrl != '') {
|
||
$("#vggImgInfo").html('已上传');
|
||
} else {
|
||
$("#vggImgInfo").html('未上传');
|
||
}
|
||
|
||
// 设置svga图片
|
||
$("#svgaUploadFile").val('');
|
||
$('#luckyGiftSvgaUrl').val(json.entity.luckyGiftSvgaUrl);
|
||
if (json.entity.luckyGiftSvgaUrl != undefined) {
|
||
$("#svgaImgInfo").html('已上传');
|
||
} else {
|
||
$("#svgaImgInfo").html('未上传');
|
||
}
|
||
|
||
// 设置其他视图文件效果图片
|
||
$('#viewUploadFile').val('');
|
||
$('#otherViewType').val(json.entity.otherViewType);
|
||
$('#viewUrl').val(json.entity.viewUrl);
|
||
$('#viewFile').attr("src", json.entity.viewUrl);
|
||
if (json.entity.viewUrl != null && json.entity.viewUrl != 'undefined' && json.entity.viewUrl != '') {
|
||
$("#viewFileInfo").html('已上传');
|
||
} else {
|
||
$("#viewFileInfo").html('未上传');
|
||
}
|
||
|
||
//分区
|
||
console.log(partitionFlag & 2);
|
||
console.log(partitionFlag & 4);
|
||
if ((partitionFlag & 1) != 0) {
|
||
$("input:checkbox[name='partitionFlag']")[0].checked = true;
|
||
} else {
|
||
$("input:checkbox[name='partitionFlag']")[0].checked = false;
|
||
}
|
||
if ((partitionFlag & 2) != 0) {
|
||
$("input:checkbox[name='partitionFlag']")[1].checked = true;
|
||
} else {
|
||
$("input:checkbox[name='partitionFlag']")[1].checked = false;
|
||
}
|
||
if ((partitionFlag & 4) != 0) {
|
||
$("input:checkbox[name='partitionFlag']")[2].checked = true;
|
||
} else {
|
||
$("input:checkbox[name='partitionFlag']")[2].checked = false;
|
||
}
|
||
// 打开编辑弹窗
|
||
$("#giftModal").modal('show');
|
||
} else {
|
||
$("#tipMsg").text("获取菜单信息出错");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#save").click(function () {
|
||
if ($("#giftForm").validationEngine('validate')) {
|
||
$("#consumeType").removeAttr("disabled");
|
||
// 获取序列化字符串并转换为对象
|
||
let formData = $('#giftForm').serializeArray().reduce(function(obj, item) {
|
||
obj[item.name] = item.value;
|
||
return obj;
|
||
}, {});
|
||
|
||
var name = $("#giftName").val();
|
||
// 阿语名称
|
||
var ar_name = $("#giftArName").val();
|
||
// 英语名称
|
||
var en_name = $("#giftEnName").val();
|
||
// 土耳其名称
|
||
var tr_name = $("#giftTrName").val();
|
||
// 国际化字段
|
||
var jsonName = {"zh":name,"ar":ar_name,"en":en_name,'tr':tr_name}
|
||
const nameValue = JSON.stringify(jsonName);
|
||
// 修改属性值
|
||
formData.giftName = nameValue; // 将giftName修改为"newGiftName"
|
||
//分区
|
||
const partitionFlagArray = $("input:checkbox[name='partitionFlag']:checked").serializeArray();
|
||
let partitionFlag = 0;
|
||
for (let i = 0, len = partitionFlagArray.length; i < len; i++) {
|
||
console.log(partitionFlagArray[i]);
|
||
partitionFlag |= partitionFlagArray[i].value;
|
||
}
|
||
formData.partitionFlag = partitionFlag;
|
||
// 将修改后的对象转换回序列化字符串
|
||
let newSerializeStr = $.param(formData);
|
||
$.ajax({
|
||
type: "post",
|
||
url: "/admin/gift/save",
|
||
data: newSerializeStr,
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.success == 'true') {
|
||
$("#giftModal").modal('hide');
|
||
$("#tipMsg").text("保存成功");
|
||
setTimeout(function() {
|
||
$("#tipModal").modal('show');
|
||
TableHelper.doRefresh("#table");
|
||
}, 1000);
|
||
} else {
|
||
$("#tipMsg").text("保存失败." + json.msg);
|
||
$("#tipModal").modal('show');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
//打开赠送礼物弹窗
|
||
$("#table").on('click', '.opt-send', function () {
|
||
//清除数据
|
||
$('#sendGiftModal').find('input').val('');
|
||
$('#sendGiftModal').find('textarea').val('');
|
||
//设置数据
|
||
var giftId = $(this).attr("data-id");
|
||
$('#sendGiftId').val(giftId);
|
||
$('#giftNum').val('1');
|
||
$('#sendGiftModal').modal('show');
|
||
});
|
||
|
||
|
||
//赠送礼物
|
||
$("#send").click(function () {
|
||
var erbanNo = $('#sendErbanNo').val().trim();//去掉首尾的空格和换行符
|
||
if (!(erbanNo.length > 0)) {
|
||
$("#tipMsg").text("请输入平台号");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
|
||
var erbanList = erbanNo.split("\n");
|
||
if (erbanList.length > 100) {
|
||
$("#tipMsg").text("输入平台号超过100个");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
|
||
var giftId = $('#sendGiftId').val();
|
||
var giftNum = $('#giftNum').val();
|
||
if (!giftNum) {
|
||
$("#tipMsg").text("请输入赠送数量");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
var reg = giftNum.match(/^[0-9]*$/);
|
||
if (giftNum && reg == null) {
|
||
$("#tipMsg").text("请输入合理的赠送数量");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
|
||
$("#tipMsg").text("赠送中,请稍后...");
|
||
$("#tipModal").modal('show');
|
||
if ($("#giftSendForm").validationEngine('validate')) {
|
||
$.ajax({
|
||
type: "post",
|
||
url: "/admin/gift/send",
|
||
data: {
|
||
giftId: giftId,
|
||
erbanNo: erbanNo,
|
||
giftNum: giftNum
|
||
},
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.code == 100) {
|
||
$('#sendGiftModal').modal('hide');
|
||
$("#tipMsg").text("全部赠送成功");
|
||
TableHelper.doRefresh("#table");
|
||
} else if (json.code == 200) {
|
||
$("#tipMsg").text("部分用户赠送失败,赠送失败平台号:" + json.erban + ",赠送失败原因:" + json.message);
|
||
} else {
|
||
$("#tipMsg").text("全部赠送失败,赠送失败原因:" + json.message);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
});
|
||
|
||
|
||
//打开查看房间列表弹窗
|
||
$("#table").on('click', '.opt-query', function () {
|
||
//清除数据
|
||
$("#erbanNo").val("");
|
||
//设置数据
|
||
var giftId = $(this).attr("data-id");
|
||
$("#query_gift_id").val(giftId);
|
||
roomGiftTableInit();
|
||
$('#roomGiftModel').modal('show');
|
||
});
|
||
|
||
//查询房间列表
|
||
$("#roomGiftSearch").on("click", function () {
|
||
roomGiftTableInit();
|
||
});
|
||
//打开导入房间列表弹窗
|
||
$("#roomGiftImport").on('click', function () {
|
||
var giftId = $("#query_gift_id").val();
|
||
$("#import_gift_id").val(giftId);
|
||
$('#roomImportModel').modal('show');
|
||
});
|
||
//打开增加房间列表弹窗
|
||
$("#roomGiftAdd").on("click", function () {
|
||
var giftId = $("#query_gift_id").val();
|
||
$("#add_gift_id").val(giftId);
|
||
$('#roomAddModel').modal('show');
|
||
});
|
||
|
||
|
||
//确认导入房间列表
|
||
$("#upload").on('click', function () {
|
||
var giftId = $("#import_gift_id").val();
|
||
if (giftId == null) {
|
||
$("#tipMsg").text("礼物ID不能为空.");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
var file = $("#uploadFile").val();
|
||
if (file == null || file == undefined || file == '') {
|
||
$("#tipMsg").text("上传文件不能为空.");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
showLoading();
|
||
var option = ({
|
||
type: "POST",
|
||
url: "/admin/gift/uploadRoomList",
|
||
cache: false,
|
||
contentType: false, //不可缺
|
||
processData: false, //不可缺
|
||
dataType: "json",
|
||
success: function (json) {
|
||
$("#roomImportModel").modal('hide');
|
||
hideLoading();
|
||
if (json.code == 200) {
|
||
TableHelper.doRefresh('#roomGiftTable');
|
||
$("#tipMsg").text("上传成功");
|
||
$("#tipModal").modal('show');
|
||
} else if (json.code == 300) {
|
||
$("#tipMsg").text(json.message + ",导入失败的行:" + json.data.row + ",导入失败原因:" + json.data.reason);
|
||
$("#tipModal").modal('show');
|
||
}
|
||
},
|
||
error: function () {
|
||
hideLoading();
|
||
$("#tipMsg").text("上传失败.");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
});
|
||
$("#roomImportForm").ajaxSubmit(option);
|
||
});
|
||
|
||
//确认增加房间列表
|
||
$("#roomAdd").on('click', function () {
|
||
var giftId = $("#add_gift_id").val();
|
||
if (giftId == null) {
|
||
$("#tipMsg").text("礼物ID不能为空.");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
var erbanNos = $("#addErbanNos").val().trim();
|
||
if (erbanNos == null || erbanNos == '') {
|
||
$("#tipMsg").text("房主平台号不能为空.");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
debugger;
|
||
var erbanList = erbanNos.split("\n");
|
||
if (erbanList.length > 20) {
|
||
$("#tipMsg").text("输入平台号超过20个,请使用批量导入方式上传");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
if ($("#roomAddForm").validationEngine('validate')) {
|
||
showLoading();
|
||
$.ajax({
|
||
type: "post",
|
||
url: "/admin/gift/addRoomList",
|
||
data: {
|
||
giftId: giftId,
|
||
erbanNos: erbanNos
|
||
},
|
||
dataType: "json",
|
||
success: function (json) {
|
||
$('#roomAddModel').modal('hide');
|
||
hideLoading();
|
||
if (json.code == 200) {
|
||
$('#sendGiftModal').modal('hide');
|
||
TableHelper.doRefresh("#roomGiftTable");
|
||
$("#tipMsg").text("添加成功");
|
||
$("#tipModal").modal('show');
|
||
} else if (json.code == 300) {
|
||
$("#tipMsg").text(json.message + ",添加失败的平台号:" + json.data.row + ",添加失败原因:" + json.data.reason);
|
||
$("#tipModal").modal('show');
|
||
}
|
||
},
|
||
error: function () {
|
||
hideLoading();
|
||
$("#tipMsg").text("添加失败.");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
//单个删除
|
||
$("#roomGiftTable").on('click', '.opt-delete', function () {
|
||
var id = $(this).attr("data-id");
|
||
if (confirm("确认删除该条记录吗?删除后不能找回,请谨慎操作!")) {
|
||
$.ajax({
|
||
type: "post",
|
||
url: "/admin/gift/del",
|
||
data: {
|
||
id: id
|
||
},
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.code == 200) {
|
||
TableHelper.doRefresh("#roomGiftTable");
|
||
$("#tipMsg").text("删除成功");
|
||
$("#tipModal").modal('show');
|
||
} else {
|
||
$("#tipMsg").text("删除失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
},
|
||
error: function () {
|
||
$("#tipMsg").text("删除失败.");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
});
|
||
}
|
||
})
|
||
|
||
//批量删除
|
||
$("#roomGiftMultiDel").on('click', function () {
|
||
var rows = $("#roomGiftTable").bootstrapTable("getSelections");
|
||
if (rows.length == 0) {
|
||
alert("请先选择要删除的记录");
|
||
return;
|
||
}
|
||
var idArr = [];
|
||
for (var i = 0; i < rows.length; i++) {
|
||
idArr.push(rows[i]['id']);
|
||
}
|
||
|
||
if (confirm("确认批量删除该记录吗?\r\n删除后再也不能找回,请谨慎操作!")) {
|
||
$.ajax({
|
||
type: 'post',
|
||
url: "/admin/gift/batchDel",
|
||
data: { 'ids': JSON.stringify(idArr) },
|
||
dataType: "json",
|
||
success: function (json) {
|
||
if (json.code == 200) {
|
||
TableHelper.doRefresh("#roomGiftTable");
|
||
$("#tipMsg").text("批量删除成功");
|
||
$("#tipModal").modal('show');
|
||
} else {
|
||
$("#tipMsg").text("批量删除失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
},
|
||
error: function () {
|
||
$("#tipMsg").text("批量删除失败.");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
});
|
||
}
|
||
})
|
||
|
||
|
||
$("#startValidTime").datetimepicker({
|
||
format: 'yyyy-mm-dd hh:ii:00',
|
||
autoclose: true,
|
||
startDate: new Date()
|
||
});
|
||
$('#endValidTime').datetimepicker({
|
||
format: 'yyyy-mm-dd hh:ii:00',
|
||
startDate: new Date()
|
||
});
|
||
});
|
||
},
|
||
initPartition() {
|
||
getPartitionInfoList().then(res => {
|
||
let data = res.data;
|
||
buildSelectOption(
|
||
"#partitionId",
|
||
null,
|
||
[{
|
||
value: '',
|
||
text: '全部',
|
||
}].concat(data.map((v) => {
|
||
return {
|
||
value: v.id,
|
||
text: v.desc,
|
||
};
|
||
}))
|
||
);
|
||
});
|
||
},
|
||
},
|
||
|
||
};
|
||
|
||
//初始化房间列表
|
||
function roomGiftTableInit() {
|
||
$('#roomGiftTable').bootstrapTable('destroy');
|
||
$('#roomGiftTable').bootstrapTable({
|
||
columns: [
|
||
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
|
||
{ field: 'erbanNo', title: '用户平台号', align: 'center', width: '10%' },
|
||
{ field: 'nick', title: '用户昵称', align: 'center', width: '30%' },
|
||
{ field: 'roomTitle', title: '房间标题', align: 'center', width: '30%' },
|
||
{ field: 'roomTag', title: '房间标签', align: 'center', width: '20%' },
|
||
{
|
||
field: 'permitRoom',
|
||
title: '房间类型',
|
||
align: 'center',
|
||
width: '10%',
|
||
formatter: function (val, row, index) {
|
||
switch (val) {
|
||
case 1:
|
||
return '牌照房';
|
||
|
||
case 2:
|
||
return '非牌照房';
|
||
|
||
case 3:
|
||
return '新秀房';
|
||
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'id', title: '操作', align: 'center', width: '10%', formatter: function (val, row, index) {
|
||
var id = row.id;
|
||
var str = '<button class="btn btn-sm btn-danger opt-delete" data-id=' + id +
|
||
'><i class="glyphicon glyphicon-remove"></i>删除</button> ';
|
||
return str;
|
||
|
||
}
|
||
}
|
||
],
|
||
cache: false,
|
||
striped: true,
|
||
showRefresh: true,
|
||
pageSize: 10,
|
||
pagination: true,
|
||
pageList: [1, 10, 20, 30, 50],
|
||
search: false,
|
||
sidePagination: "server", //表示服务端请求
|
||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||
//设置为limit可以获取limit, offset, search, sort, order
|
||
queryParamsType: "undefined",
|
||
queryParams: function queryParams(params) { //设置查询参数
|
||
var param = {
|
||
pageNumber: params.pageNumber,
|
||
pageSize: params.pageSize,
|
||
erbanNo: $('#erbanNo').val(),
|
||
giftId: $('#query_gift_id').val()
|
||
};
|
||
return param;
|
||
},
|
||
toolbar: '#roomGiftToolbar',
|
||
url: '/admin/gift/getRoomList',
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
console.log("load success");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.log("load fail");
|
||
}
|
||
})
|
||
}
|
||
|
||
|
||
</script>
|
||
|
||
<style scoped>
|
||
.room_class {
|
||
width: 150%;
|
||
}
|
||
|
||
.btn-sm {
|
||
width: 100%;
|
||
}
|
||
|
||
.first {
|
||
z-index: 2000;
|
||
}
|
||
</style> |