|
@@ -234,89 +234,93 @@ margin-top:-8px;
|
|
|
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
<label id="col-sm-2" class="col-sm-2 control-label" for="name">选择栏目:</label>
|
|
<label id="col-sm-2" class="col-sm-2 control-label" for="name">选择栏目:</label>
|
|
- <div class="col-sm-2">
|
|
|
|
- <select name="s_contenttype" class="form-control" onchange="
|
|
|
|
- if(this.value != '')
|
|
|
|
- setCity(this.options[this.selectedIndex].value);">
|
|
|
|
- {{range .T.parentColumn }}
|
|
|
|
- <option value="{{.columnCode}}"> {{.columnName}} </option>
|
|
|
|
- {{end}}
|
|
|
|
- </select>
|
|
|
|
- <select name="secondClassify" id="classify" class="form-control" style="display: none;margin-left: 150px;margin-top: -38px;" hidden
|
|
|
|
- onchange="
|
|
|
|
- if(this.value != '')
|
|
|
|
- setColumn(this.options[this.selectedIndex].value);">
|
|
|
|
- <option value="0">-请选择-</option>
|
|
|
|
- </select>
|
|
|
|
- <select name="threeClassify" id="threeClassify" class="form-control" style="display: none;margin-left: 300px;margin-top: -38px;" hidden>
|
|
|
|
- <option value="0">-请选择-</option>
|
|
|
|
- </select>
|
|
|
|
- <script>
|
|
|
|
- var classifyArr = {{.T.childColumn}};
|
|
|
|
- function setCity(province) {
|
|
|
|
- // console.log(province);
|
|
|
|
- var city = document.getElementById('classify');
|
|
|
|
- var city_len = city.options.length;
|
|
|
|
- for (var i = 0; i < city_len; i++) {
|
|
|
|
- if (city_len > 0) {
|
|
|
|
- city.options.remove(0);
|
|
|
|
|
|
+ <div class="col-sm-2">
|
|
|
|
+ <select name="s_contenttype" class="form-control" onchange="
|
|
|
|
+ if(this.value != '')
|
|
|
|
+ setCity(this.options[this.selectedIndex].value);">
|
|
|
|
+ {{range .T.parentColumn }}
|
|
|
|
+ <option value="{{.columnCode}}"> {{.columnName}} </option>
|
|
|
|
+ {{end}}
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-sm-2">
|
|
|
|
+ <select name="secondClassify" id="classify" class="form-control" style="display: none;" hidden
|
|
|
|
+ onchange="
|
|
|
|
+ if(this.value != '')
|
|
|
|
+ setColumn(this.options[this.selectedIndex].value);">
|
|
|
|
+ <option value="0">-请选择-</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="col-sm-2">
|
|
|
|
+ <select name="threeClassify" id="threeClassify" class="form-control" style="display: none;" hidden>
|
|
|
|
+ <option value="0">-请选择-</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <script>
|
|
|
|
+ var classifyArr = {{.T.childColumn}};
|
|
|
|
+ function setCity(province) {
|
|
|
|
+ // console.log(province);
|
|
|
|
+ var city = document.getElementById('classify');
|
|
|
|
+ var city_len = city.options.length;
|
|
|
|
+ for (var i = 0; i < city_len; i++) {
|
|
|
|
+ if (city_len > 0) {
|
|
|
|
+ city.options.remove(0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- if (province == "0") {
|
|
|
|
- var opt = new Option('-请选择-', 0);
|
|
|
|
- city.options.add(opt);
|
|
|
|
- } else {
|
|
|
|
- // console.log("子栏目", classifyArr[province])
|
|
|
|
- if (classifyArr[province] === undefined){
|
|
|
|
- $('#classify').css('display','none')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- var province_len = classifyArr[province].length;
|
|
|
|
- var text_1 = document.getElementById("classify");
|
|
|
|
|
|
|
|
- $('#classify').css('display','block')
|
|
|
|
- text_1. hidden =false; //显示元素
|
|
|
|
- for (i = 0; i < province_len; i++) {
|
|
|
|
- var opt = new Option(classifyArr[province][i].columnName, classifyArr[province][i].columnCode);
|
|
|
|
- city.options.add(opt);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if (province == "0") {
|
|
|
|
+ var opt = new Option('-请选择-', 0);
|
|
|
|
+ city.options.add(opt);
|
|
|
|
+ } else {
|
|
|
|
+ // console.log("子栏目", classifyArr[province])
|
|
|
|
+ if (classifyArr[province] === undefined){
|
|
|
|
+ $('#classify').css('display','none')
|
|
|
|
+ $('#threeClassify').css('display','none')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ var province_len = classifyArr[province].length;
|
|
|
|
+ var text_1 = document.getElementById("classify");
|
|
|
|
|
|
- function setColumn(province) {
|
|
|
|
- var city = document.getElementById('threeClassify');
|
|
|
|
- var city_len = city.options.length;
|
|
|
|
- for (var i = 0; i < city_len; i++) {
|
|
|
|
- if (city_len > 0) {
|
|
|
|
- city.options.remove(0);
|
|
|
|
|
|
+ $('#classify').css('display','block')
|
|
|
|
+ text_1. hidden =false; //显示元素
|
|
|
|
+ for (i = 0; i < province_len; i++) {
|
|
|
|
+ var opt = new Option(classifyArr[province][i].columnName, classifyArr[province][i].columnCode);
|
|
|
|
+ city.options.add(opt);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (province == "0") {
|
|
|
|
- var opt = new Option('-请选择-', 0);
|
|
|
|
- city.options.add(opt);
|
|
|
|
- } else {
|
|
|
|
- // console.log("子栏目", classifyArr[province])
|
|
|
|
- if (classifyArr[province] === undefined){
|
|
|
|
- $('#threeClassify').css('display','none')
|
|
|
|
- return
|
|
|
|
|
|
+ function setColumn(province) {
|
|
|
|
+ var city = document.getElementById('threeClassify');
|
|
|
|
+ var city_len = city.options.length;
|
|
|
|
+ for (var i = 0; i < city_len; i++) {
|
|
|
|
+ if (city_len > 0) {
|
|
|
|
+ city.options.remove(0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- var province_len = classifyArr[province].length;
|
|
|
|
- var text_1 = document.getElementById("threeClassify");
|
|
|
|
|
|
|
|
- $('#threeClassify').css('display','block')
|
|
|
|
- text_1. hidden =false; //显示元素
|
|
|
|
- for (i = 0; i < province_len; i++) {
|
|
|
|
- var opt = new Option(classifyArr[province][i].columnName, classifyArr[province][i].columnCode);
|
|
|
|
|
|
+ if (province == "0") {
|
|
|
|
+ var opt = new Option('-请选择-', 0);
|
|
city.options.add(opt);
|
|
city.options.add(opt);
|
|
|
|
+ } else {
|
|
|
|
+ // console.log("子栏目", classifyArr[province])
|
|
|
|
+ if (classifyArr[province] === undefined){
|
|
|
|
+ $('#threeClassify').css('display','none')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ var province_len = classifyArr[province].length;
|
|
|
|
+ var text_1 = document.getElementById("threeClassify");
|
|
|
|
+
|
|
|
|
+ $('#threeClassify').css('display','block')
|
|
|
|
+ text_1. hidden =false; //显示元素
|
|
|
|
+ for (i = 0; i < province_len; i++) {
|
|
|
|
+ var opt = new Option(classifyArr[province][i].columnName, classifyArr[province][i].columnCode);
|
|
|
|
+ city.options.add(opt);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- </script>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ </script>
|
|
|
|
|
|
|
|
|
|
<div style="margin-top:80px;" class="form-group">
|
|
<div style="margin-top:80px;" class="form-group">
|