inl-ui 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -231,6 +231,47 @@ const SystemSetting = defineComponent({
|
|
|
231
231
|
</>
|
|
232
232
|
);
|
|
233
233
|
};
|
|
234
|
+
const getDisabledData = (data: any[], fn: (item: any) => boolean) => {
|
|
235
|
+
return data.map((item) => {
|
|
236
|
+
return {
|
|
237
|
+
...item,
|
|
238
|
+
disabled: fn(item),
|
|
239
|
+
subList: getDisabledData(item.subList, fn),
|
|
240
|
+
};
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
window.treeSelect = (item) => {
|
|
244
|
+
return (
|
|
245
|
+
<>
|
|
246
|
+
{_props[`${item.name}`] ? (
|
|
247
|
+
<div class="systemConfig_form">
|
|
248
|
+
<span class="label">{item.label}</span>
|
|
249
|
+
<a-tree-select
|
|
250
|
+
treeDefaultExpandAll
|
|
251
|
+
fieldNames={{
|
|
252
|
+
children: "subList",
|
|
253
|
+
value: "id",
|
|
254
|
+
key: "id",
|
|
255
|
+
label: "name",
|
|
256
|
+
}}
|
|
257
|
+
treeData={getDisabledData(
|
|
258
|
+
data[`${item.name}Option`],
|
|
259
|
+
(item) => item.level !== 3
|
|
260
|
+
)}
|
|
261
|
+
v-model={[data.form[`${item.name}Id`], "value"]}
|
|
262
|
+
disabled={!edit.value}
|
|
263
|
+
>
|
|
264
|
+
{/* {data[`${item.name}Option`].map((val: OptionItem) => (
|
|
265
|
+
<a-select-option value={val.id}>{val.name}</a-select-option>
|
|
266
|
+
))} */}
|
|
267
|
+
</a-tree-select>
|
|
268
|
+
</div>
|
|
269
|
+
) : (
|
|
270
|
+
""
|
|
271
|
+
)}
|
|
272
|
+
</>
|
|
273
|
+
);
|
|
274
|
+
};
|
|
234
275
|
window.input = (item: { [key: string]: string }) => {
|
|
235
276
|
return (
|
|
236
277
|
<>
|