|
|
|
@ -249,8 +249,8 @@ layui.define(['globalTree'], function (exports) { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function addOtherLabel(value) { |
|
|
|
|
let template = `<div class="layui-input-block label-set-component other-label" th:data-field-title="其他标签"></div>`; |
|
|
|
|
function addOtherLabel(value, readonly) { |
|
|
|
|
let template = `<div class="layui-input-block label-set-component other-label ${readonly?'read-only':''}" th:data-field-title="其他标签"></div>`; |
|
|
|
|
$('.other-label-item').append(template); |
|
|
|
|
let cid = _KEY + _CACHE.size, |
|
|
|
|
component = new Component(cid, $('.label-set-component.other-label:last')); |
|
|
|
@ -272,15 +272,16 @@ layui.define(['globalTree'], function (exports) { |
|
|
|
|
|
|
|
|
|
function setData(dataArr = []) { |
|
|
|
|
for (let data of dataArr) { |
|
|
|
|
let find = false; |
|
|
|
|
let find = false, readonly = false; |
|
|
|
|
for (let component of _CACHE.values()) { |
|
|
|
|
readonly = component.isReadOnly(); |
|
|
|
|
if (data.fieldTitle !== '其他标签' && data.fieldTitle === component.fieldTitle) { |
|
|
|
|
component.setData(data); |
|
|
|
|
find = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!find) { |
|
|
|
|
addOtherLabel(data); |
|
|
|
|
addOtherLabel(data, readonly); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|