mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-05 17:42:49 +08:00
优化tableData组件,修复动态字段,增加group重复验证
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<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">
|
||||
<span>{{itemSelect[setting.fieldName]}}</span>
|
||||
<i class="layui-icon layui-icon-close" @click.stop="removeItem(itemSelect,indexSelect)"></i>
|
||||
<i class="layui-icon layui-icon-close" @click.stop="removeItem(itemSelect,indexSelect)" v-if="setting.readonly != 1"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,6 @@ define(['jquery', 'vue'], function ($, Vue) {
|
||||
|
||||
var options = $.extend(defaultOption, data);
|
||||
|
||||
|
||||
var valueField = options.valueField;
|
||||
|
||||
if (options.index.indexOf('?') > -1) {
|
||||
@@ -84,8 +83,9 @@ define(['jquery', 'vue'], function ($, Vue) {
|
||||
$.get(options.index, {
|
||||
page: 1,
|
||||
limit: valueLength,
|
||||
filter: JSON.stringify({ id: this.value }),
|
||||
op: JSON.stringify({ id: 'in' })
|
||||
filter: JSON.stringify({ [options.valueField]: this.value }),
|
||||
op: JSON.stringify({ [options.valueField]: 'in' }),
|
||||
group: options.valueField
|
||||
}, (result) => {
|
||||
loading.hide()
|
||||
this.listSelected = result.data;
|
||||
@@ -101,8 +101,12 @@ define(['jquery', 'vue'], function ($, Vue) {
|
||||
|
||||
methods: {
|
||||
openSelectPage() {
|
||||
var selectedIds = this.listSelected.map(item => item.id);
|
||||
|
||||
if(options.readonly == 1){
|
||||
return false;
|
||||
}
|
||||
|
||||
var selectedIds = this.listSelected.map(item => item.id);
|
||||
|
||||
var index = layer.open({
|
||||
title: '选择数据',
|
||||
|
||||
Reference in New Issue
Block a user