單選開關根據後端傳值顯示開與關

2021-10-06 02:53:01 字數 1980 閱讀 7815

控制器**

/**

* 系統設定

* @auth true

* @menu true

* @throws \think\exception

* @throws \think\db\exception\datanotfoundexception

* @throws \think\db\exception\modelnotfoundexception

* @throws \think\exception\dbexception

* @throws \think\exception\pdoexception

*/public

function

setting_index()

elseif

($this

->

request

->

ispost()

)else

}}

邏輯**

//系統設定

public

function

setting_index

($post_data

)else

}

html**

="layui-row margin-bottom-15"

>

="color-text" style=

"font-size:22px"

>

2.<

/span>

="color-text" style=

"font-size:18px"

>處方單自動審核<

/span>

<

/div>

="layui-row margin-bottom-15 margin-left-20"

>

="layui-form-item"

>

="layui-form-label" style=

"color: #5fb878"

>開關-預設關閉<

/label>

="layui-input-block" id=

"close"

>

"checkbox" name=

"close" lay-skin=

"switch" lay-filter=

"switchtest" lay-text=

"on|off"

>

<

/div>

<

/div>

="layui-col-xs8"

>

規則:開啟後,系統每5分鐘執行一次自動檢測,檢測是否存在訂單狀態為已完成且處在待審核的處方單,若是,則執行系統自動審核、自動加蓋水印操作,無需手工操作審核

關閉後,需手動操作審核,審核流程為調配人 -

> 複核人

<

/span>

<

/div>js**

window.form.

render()

;//根據後端資料顯示開關

$(function()

";if(close==

'on'

)else})

; layui.

use(

['form'],

function()

else

// alert(this.checked);

/* layer.msg('開關checked:'+ (this.checked ? 'true' : 'false'), );})

;});

<

/script>顯示頁面

springMVC 前後端傳值

由於在寫 的時候經常需要前後端進行傳值,那麼總結下前端是如何給後端傳值,以及後端是如何接收的。以下包括 pathvarible,pathparam,requestparam,requestbody,requestheader 以及 spring 自動封裝。前端 http localhost 8080...

SpringMVC 前後端傳值總結

文章主要來自 點這裡 這也是博主的部落格,主要分享了自己接觸過的一些後端技術,有不對的地方希望可以提出。由於在寫 的時候經常需要前後端進行傳值,那麼總結下前端是如何給後端傳值,以及後端是如何接收的。以下包括 pathvarible,pathparam,requestparam,requestbody...

前後端傳值互動方法

第一種 路徑傳值 id,token等 前端在ajax的url路徑上通過模板字串在url後拼接token或id url baseurl 9008 user register 後端通過 pathvariable註解拿到這個值 userinfo public result demo pathvariabl...