会员级别与会员权益修改
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('wdsxh/member/level/edit')}"
|
||||
data-operate-del="{:$auth->check('wdsxh/member/level/del')}"
|
||||
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
@@ -44,3 +45,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">OK</button>
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">OK</button>
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -39,6 +39,47 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 添加跳转按钮函数
|
||||
function addJumpButtons() {
|
||||
var tbody = document.querySelector('table tbody');
|
||||
if (!tbody) return;
|
||||
|
||||
var rows = tbody.querySelectorAll('tr');
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var row = rows[i];
|
||||
var lastTd = row.querySelector('td:last-child');
|
||||
if (lastTd && !lastTd.querySelector('.btn-jump')) {
|
||||
var rowIndex = row.getAttribute('data-index');
|
||||
var rowData = table.bootstrapTable('getData')[rowIndex];
|
||||
if (rowData && rowData.id) {
|
||||
var jumpBtn = document.createElement('a');
|
||||
jumpBtn.href = 'javascript:;';
|
||||
jumpBtn.className = 'btn btn-xs btn-success btn-jump';
|
||||
jumpBtn.setAttribute('data-id', rowData.id);
|
||||
jumpBtn.style.marginLeft = '5px';
|
||||
jumpBtn.innerHTML = '<i class="fa fa-external-link"></i> 权益';
|
||||
|
||||
// 绑定点击事件
|
||||
jumpBtn.onclick = (function(id) {
|
||||
return function() {
|
||||
window.location.href = 'rights?id=' + id;
|
||||
};
|
||||
})(rowData.id);
|
||||
|
||||
lastTd.appendChild(jumpBtn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 延迟执行确保表格已加载
|
||||
setTimeout(addJumpButtons, 500);
|
||||
|
||||
// 监听表格刷新完成事件
|
||||
table.on('load-success.bs.table', function() {
|
||||
setTimeout(addJumpButtons, 100);
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
|
||||
Reference in New Issue
Block a user