Skip to content

Commit

Permalink
修复路由开关错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Dot-Liu committed Jun 20, 2022
1 parent 9e2734a commit f9c126a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
25 changes: 12 additions & 13 deletions builds/resources/tpl/router_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ <h1 class="h2">路由列表</h1>
let d = res.data
return d
}
function statusSwitch(value, row, index,field){

if (row["disable"]) {
return `<input value="${row.name}" name="disable" type="checkbox" checked />`
}
return `<input value="${row.name}" name="disable" type="checkbox" />`
}
// function statusSwitch(value, row, index,field){
//
// if (row["disable"]) {
// return `<input value="${row.name}" name="disable" type="checkbox" checked />`
// }
// return `<input value="${row.name}" name="disable" type="checkbox" />`
// }

function detailFormatter(name,data) {
let content = ""
Expand Down Expand Up @@ -157,10 +157,11 @@ <h1 class="h2">路由列表</h1>
}
function renderSwitch(){
this.bootstrapSwitch({
onText : "发布",
offText : "下线",
onColor : "success",
offColor : "warning",
onText : "下线",
offText : "发布",
onColor : "warning",
offColor : "success",
inverse: true,
size : "small",
onSwitchChange : function(event, disable) {
let target = $(this)
Expand Down Expand Up @@ -188,9 +189,7 @@ <h1 class="h2">路由列表</h1>
toggle:"table",
flat:true,
onSort:function (name, order){

// $table.bootstrapTable('refresh')

},
onLoadSuccess: function () { //在成功加载远程数据时触发
renderStatus()
Expand Down
9 changes: 5 additions & 4 deletions builds/tpl/router_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ <h1 class="h2">路由列表</h1>
}
function renderSwitch(){
this.bootstrapSwitch({
onText : "发布",
offText : "下线",
onColor : "success",
offColor : "warning",
onText : "下线",
offText : "发布",
onColor : "warning",
offColor : "success",
inverse: true,
size : "small",
onSwitchChange : function(event, disable) {
let target = $(this)
Expand Down

0 comments on commit f9c126a

Please sign in to comment.