mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-31 13:25:32 +08:00
60 lines
2.1 KiB
HTML
60 lines
2.1 KiB
HTML
<!--
|
|
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<link rel="stylesheet" type="text/css" href="<{$base_url}>/app/desktop/statics/css/layui.css"/>
|
|
<link rel="stylesheet" href="<{$base_url}>/app/desktop/statics/css/address.css">
|
|
<input id="cascader" >
|
|
<input type="hidden" name="<{$params.name}>" id="<{$params.id}>" value="<{$params.data}>">
|
|
|
|
<script>
|
|
var casader;
|
|
var value = "<{$params.data}>";
|
|
var options = <{$treeList}>;
|
|
if (value =='') {
|
|
value = null;
|
|
var disabled = false;
|
|
}else{
|
|
value = JSON.parse(value);
|
|
var disabled = true;
|
|
}
|
|
Ex_Loader('layui',function(){
|
|
Ex_Loader('address',function(){
|
|
layui.use(['layCascader'], function () {
|
|
var layCascader = layui.layCascader;
|
|
var cascader = layCascader({
|
|
elem: '#cascader',
|
|
options: options,
|
|
value: value,
|
|
disabled: disabled,
|
|
clearable: !disabled,
|
|
placeholder: '请选择',
|
|
props: {
|
|
multiple: true,
|
|
value: 'id',
|
|
label: 'label',
|
|
checkStrictly: true
|
|
}
|
|
});
|
|
cascader.change(function (values, nodes) {
|
|
var arr = nodes
|
|
.map(n => n.path.map(p => p.data.id).join(','))
|
|
document.getElementById("<{$params.id}>").value = JSON.stringify(arr)
|
|
})
|
|
});
|
|
});
|
|
});
|
|
</script>
|