完成通过注释生成table选择器组件;完善table选择器必选效果。

This commit is contained in:
2022-07-09 15:53:00 +08:00
parent 7a8c75de45
commit 69ac76a108
7 changed files with 101 additions and 21 deletions

View File

@@ -11,4 +11,7 @@
}
.table-data-container .layui-input .layui-btn i {
pointer-events: all;
}
.table-data-container .layui-form-danger + .layui-input {
border-color: #ff5722 !important;
}

View File

@@ -1,5 +1,5 @@
<div class="table-data-container">
<input type="hidden" :name="setting.name" :value="value">
<div class="table-data-container" ref="tableData">
<input type="hidden" :name="setting.name" :value="value" :lay-verify="setting.required == 1?'required':''">
<div class="layui-input" @click="openSelectPage">
<div class="placeholder" v-if="listSelected.length == 0">{{setting.placeholder}}</div>
<div class="layui-btn layui-btn-xs layui-btn-normal" v-for="(itemSelect,indexSelect) in listSelected">

View File

@@ -76,7 +76,9 @@ define(['jquery', 'vue'], function ($, Vue) {
},
created() {
this.value = options.selectValue;
if(typeof this.value != 'string') {
this.value = this.value.toString();
}
var valueLength = this.value.split(',').length;
loading.show();
$.get(options.index,{
@@ -90,6 +92,11 @@ define(['jquery', 'vue'], function ($, Vue) {
})
},
mounted() {
if(options.required == 1){
$(this.$refs['tableData']).closest('.layui-form-item').children('.layui-form-label').addClass('required');
}
},
template: tableDataTemplate,
methods: {

View File

@@ -16,4 +16,9 @@
}
}
}
.layui-form-danger+.layui-input {
border-color: #ff5722 !important;
}
}