变更
This commit is contained in:
@@ -139,7 +139,10 @@ const _sfc_main$3 = defineComponent({
|
||||
set(val) {
|
||||
let newTableExpandKeys = [...tableExpandKeys.value];
|
||||
if (!val) {
|
||||
newTableExpandKeys.splice(newTableExpandKeys.indexOf(props.data[props.id]), 1);
|
||||
newTableExpandKeys.splice(
|
||||
newTableExpandKeys.indexOf(props.data[props.id]),
|
||||
1
|
||||
);
|
||||
} else {
|
||||
newTableExpandKeys.push(props.data[props.id]);
|
||||
}
|
||||
@@ -194,7 +197,9 @@ const _sfc_main$3 = defineComponent({
|
||||
}
|
||||
return props.rowClassName(data, index2);
|
||||
};
|
||||
const childrenIndentSize = computed(() => props.currentIndentSize + props.indentSize);
|
||||
const childrenIndentSize = computed(
|
||||
() => props.currentIndentSize + props.indentSize
|
||||
);
|
||||
const renderFixedStyle = (column, columnIndex) => {
|
||||
var _a, _b, _c, _d;
|
||||
if (column.fixed) {
|
||||
@@ -713,15 +718,19 @@ const _sfc_main$1 = defineComponent({
|
||||
const sel = ref([]);
|
||||
const list = ref([]);
|
||||
const alllist = ref([]);
|
||||
watch(() => [props.show], () => {
|
||||
let set = /* @__PURE__ */ new Set();
|
||||
for (let i of props.list) {
|
||||
set.add(i[props.soulkey]);
|
||||
}
|
||||
alllist.value = Array.from(set);
|
||||
list.value = alllist.value;
|
||||
selshow.value = false;
|
||||
}, { deep: true });
|
||||
watch(
|
||||
() => [props.show],
|
||||
() => {
|
||||
let set = /* @__PURE__ */ new Set();
|
||||
for (let i of props.list) {
|
||||
set.add(i[props.soulkey]);
|
||||
}
|
||||
alllist.value = Array.from(set);
|
||||
list.value = alllist.value;
|
||||
selshow.value = false;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
const seltext = ref("");
|
||||
watch(seltext, () => {
|
||||
let l = [];
|
||||
@@ -1082,12 +1091,20 @@ const _sfc_main = defineComponent({
|
||||
findFinalNode(0, tableColumns.value);
|
||||
const tableSelectedKeys = ref(props.selectedKeys);
|
||||
const tableExpandKeys = ref([...props.expandKeys]);
|
||||
watch(() => props.selectedKeys, () => {
|
||||
tableSelectedKeys.value = props.selectedKeys;
|
||||
}, { deep: true });
|
||||
watch(() => props.expandKeys, () => {
|
||||
tableExpandKeys.value = props.expandKeys;
|
||||
}, { deep: true });
|
||||
watch(
|
||||
() => props.selectedKeys,
|
||||
() => {
|
||||
tableSelectedKeys.value = props.selectedKeys;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
watch(
|
||||
() => props.expandKeys,
|
||||
() => {
|
||||
tableExpandKeys.value = props.expandKeys;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
const tableSelectedKey = computed({
|
||||
get() {
|
||||
return props.selectedKey;
|
||||
@@ -1096,10 +1113,14 @@ const _sfc_main = defineComponent({
|
||||
emit("update:selectedKey", val);
|
||||
}
|
||||
});
|
||||
watch(() => props.dataSource, () => {
|
||||
console.log("table\u6570\u636E\u66F4\u65B0");
|
||||
tableDataSource.value = [...props.dataSource];
|
||||
}, { deep: true });
|
||||
watch(
|
||||
() => props.dataSource,
|
||||
() => {
|
||||
console.log("table\u6570\u636E\u66F4\u65B0");
|
||||
tableDataSource.value = [...props.dataSource];
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
const changeAll = (isChecked) => {
|
||||
if (isChecked) {
|
||||
const datasources = datalist.value.filter((item, index2) => {
|
||||
@@ -1114,25 +1135,37 @@ const _sfc_main = defineComponent({
|
||||
tableSelectedKeys.value = [];
|
||||
}
|
||||
};
|
||||
watch(tableSelectedKeys, () => {
|
||||
if (tableSelectedKeys.value.length === props.dataSource.length) {
|
||||
allChecked.value = true;
|
||||
} else {
|
||||
allChecked.value = false;
|
||||
}
|
||||
if (tableSelectedKeys.value.length > 0) {
|
||||
hasChecked.value = true;
|
||||
} else {
|
||||
hasChecked.value = false;
|
||||
}
|
||||
if (tableSelectedKeys.value != props.selectedKeys) {
|
||||
console.log("\u521D\u59CB\u5316\u8D4B\u503C\u89E6\u53D1\u4FEE\u6539", tableSelectedKeys.value, props.selectedKeys);
|
||||
emit("update:selectedKeys", tableSelectedKeys.value);
|
||||
}
|
||||
}, { deep: true, immediate: true });
|
||||
watch(tableExpandKeys, () => {
|
||||
emit("update:expandKeys", tableExpandKeys.value);
|
||||
}, { deep: true, immediate: true });
|
||||
watch(
|
||||
tableSelectedKeys,
|
||||
() => {
|
||||
if (tableSelectedKeys.value.length === props.dataSource.length) {
|
||||
allChecked.value = true;
|
||||
} else {
|
||||
allChecked.value = false;
|
||||
}
|
||||
if (tableSelectedKeys.value.length > 0) {
|
||||
hasChecked.value = true;
|
||||
} else {
|
||||
hasChecked.value = false;
|
||||
}
|
||||
if (tableSelectedKeys.value != props.selectedKeys) {
|
||||
console.log(
|
||||
"\u521D\u59CB\u5316\u8D4B\u503C\u89E6\u53D1\u4FEE\u6539",
|
||||
tableSelectedKeys.value,
|
||||
props.selectedKeys
|
||||
);
|
||||
emit("update:selectedKeys", tableSelectedKeys.value);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
watch(
|
||||
tableExpandKeys,
|
||||
() => {
|
||||
emit("update:expandKeys", tableExpandKeys.value);
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
watch(tableDataSource, () => {
|
||||
if (!props.page || props.serverpage) {
|
||||
datalist.value = tableDataSource.value;
|
||||
@@ -1152,7 +1185,10 @@ const _sfc_main = defineComponent({
|
||||
emit("change", page);
|
||||
} else {
|
||||
page.current;
|
||||
datalist.value = tableDataSource.value.slice(page.limit * (page.current - 1), page.limit * page.current);
|
||||
datalist.value = tableDataSource.value.slice(
|
||||
page.limit * (page.current - 1),
|
||||
page.limit * page.current
|
||||
);
|
||||
}
|
||||
};
|
||||
const rowClick = function(data, evt) {
|
||||
@@ -1182,7 +1218,11 @@ const _sfc_main = defineComponent({
|
||||
var tmpWB = {
|
||||
SheetNames: ["sheet"],
|
||||
Sheets: {
|
||||
sheet: Object.assign({}, ws, {})
|
||||
sheet: Object.assign(
|
||||
{},
|
||||
ws,
|
||||
{}
|
||||
)
|
||||
}
|
||||
};
|
||||
writeFileSync(tmpWB, name + ".xlsx", {
|
||||
@@ -1281,14 +1321,18 @@ const _sfc_main = defineComponent({
|
||||
hasr.value ? "layui-table-has-fixed-right" : ""
|
||||
];
|
||||
});
|
||||
watch(() => [props.height, props.maxHeight, props.dataSource], () => {
|
||||
nextTick(() => {
|
||||
getScrollWidth();
|
||||
getFixedColumn();
|
||||
});
|
||||
}, {
|
||||
deep: true
|
||||
});
|
||||
watch(
|
||||
() => [props.height, props.maxHeight, props.dataSource],
|
||||
() => {
|
||||
nextTick(() => {
|
||||
getScrollWidth();
|
||||
getFixedColumn();
|
||||
});
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
var _a, _b;
|
||||
getScrollWidth();
|
||||
@@ -1497,41 +1541,45 @@ const _sfc_main = defineComponent({
|
||||
watch(sxlist, () => {
|
||||
console.log("sxlist\u66F4\u65B0");
|
||||
});
|
||||
watch([() => sxlist, () => props.dataSource], (old, new1) => {
|
||||
if (Object.keys(sxlist.value).length == 0) {
|
||||
return;
|
||||
}
|
||||
let list = [...props.dataSource];
|
||||
let endlist = [];
|
||||
for (let i in sxlist.value) {
|
||||
for (let j in list) {
|
||||
if (list[j] != "" && sxlist.value[i].length != 0) {
|
||||
if (!sxlist.value[i].includes(list[j][i])) {
|
||||
list[j] = "";
|
||||
watch(
|
||||
[() => sxlist, () => props.dataSource],
|
||||
(old, new1) => {
|
||||
if (Object.keys(sxlist.value).length == 0) {
|
||||
return;
|
||||
}
|
||||
let list = [...props.dataSource];
|
||||
let endlist = [];
|
||||
for (let i in sxlist.value) {
|
||||
for (let j in list) {
|
||||
if (list[j] != "" && sxlist.value[i].length != 0) {
|
||||
if (!sxlist.value[i].includes(list[j][i])) {
|
||||
list[j] = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i of list) {
|
||||
if (i != "") {
|
||||
endlist.push(i);
|
||||
for (let i of list) {
|
||||
if (i != "") {
|
||||
endlist.push(i);
|
||||
}
|
||||
}
|
||||
if (!props.page || props.serverpage) {
|
||||
nextTick(() => {
|
||||
datalist.value = endlist;
|
||||
});
|
||||
} else {
|
||||
tableDataSource.value = endlist;
|
||||
change({
|
||||
limit: props.page.limit,
|
||||
current: props.page.current,
|
||||
isReload: true
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
if (!props.page || props.serverpage) {
|
||||
nextTick(() => {
|
||||
datalist.value = endlist;
|
||||
});
|
||||
} else {
|
||||
tableDataSource.value = endlist;
|
||||
change({
|
||||
limit: props.page.limit,
|
||||
current: props.page.current,
|
||||
isReload: true
|
||||
});
|
||||
}
|
||||
}, {
|
||||
deep: true
|
||||
});
|
||||
);
|
||||
window.addEventListener("click", heddin);
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", {
|
||||
@@ -1647,7 +1695,11 @@ const _sfc_main = defineComponent({
|
||||
{
|
||||
textAlign: column.align
|
||||
},
|
||||
renderHeadFixedStyle(column, columnIndex, tableHeadColumn)
|
||||
renderHeadFixedStyle(
|
||||
column,
|
||||
columnIndex,
|
||||
tableHeadColumn
|
||||
)
|
||||
])
|
||||
}, [
|
||||
column.type == "checkbox" ? (openBlock(), createBlock(_sfc_main$5, {
|
||||
|
||||
Reference in New Issue
Block a user