add soultable 下载名称 自动隐藏
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@ const _hoisted_8$2 = {
|
||||
class: "layui-table-cell-expand-icon-spaced"
|
||||
};
|
||||
const _hoisted_9$2 = ["colspan", "rowspan", "onClick"];
|
||||
const _hoisted_10$1 = {
|
||||
const _hoisted_10$2 = {
|
||||
key: 1,
|
||||
class: "layui-table-cell-expand-icon-spaced"
|
||||
};
|
||||
@@ -464,7 +464,7 @@ const _sfc_main$3 = defineComponent({
|
||||
key: 0,
|
||||
style: normalizeStyle({ "margin-right": __props.currentIndentSize + "px" })
|
||||
}, null, 4)) : createCommentVNode("", true),
|
||||
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_10$1)) : createCommentVNode("", true),
|
||||
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_10$2)) : createCommentVNode("", true),
|
||||
(unref(slot).expand || __props.data[__props.childrenColumnName]) && columnIndex === __props.expandIndex ? (openBlock(), createBlock(unref(_sfc_main$2E), {
|
||||
key: 2,
|
||||
class: "layui-table-cell-expand-icon",
|
||||
@@ -637,34 +637,48 @@ const _sfc_main$2 = defineComponent({
|
||||
};
|
||||
}
|
||||
});
|
||||
var soultable = /* @__PURE__ */ (() => ".soulbox{background-color:#333;color:#fff;display:inline-block;position:absolute;z-index:2147483647;min-width:160px;max-width:300px;overflow-y:auto;border:1px solid #e6e6e6;border-radius:5px;box-shadow:2px 2px 4px -2px #0003}\n")();
|
||||
var soultable = /* @__PURE__ */ (() => ".soulbox{background-color:#333;color:#fff;display:inline-block;position:absolute;z-index:2147483647;min-width:160px;max-width:320px;overflow-y:auto;border:1px solid #e6e6e6;border-radius:5px;box-shadow:2px 2px 4px -2px #0003}\n")();
|
||||
const _hoisted_1$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon soul-icon-asc" }, null, -1);
|
||||
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon soul-icon-desc" }, null, -1);
|
||||
const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon soul-icon-drop-list" }, null, -1);
|
||||
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("i", {
|
||||
class: "layui-icon layui-icon-right",
|
||||
style: { "float": "right" }
|
||||
}, null, -1);
|
||||
const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("li", {
|
||||
class: "soul-dropList",
|
||||
style: {},
|
||||
show: "select"
|
||||
}, [
|
||||
/* @__PURE__ */ createElementVNode("i", {
|
||||
class: "soul-icon soul-icon-drop-list",
|
||||
show: "select"
|
||||
}),
|
||||
/* @__PURE__ */ createTextVNode(" \u7B5B\u9009\u6570\u636E "),
|
||||
/* @__PURE__ */ createElementVNode("i", {
|
||||
class: "layui-icon layui-icon-right",
|
||||
style: { "float": "right" },
|
||||
show: "select"
|
||||
})
|
||||
], -1);
|
||||
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon soul-icon-download" }, null, -1);
|
||||
const _hoisted_5$1 = {
|
||||
class: "soulbox",
|
||||
style: { "left": "100%", "top": "65px" }
|
||||
};
|
||||
const _hoisted_6$1 = {
|
||||
class: "check",
|
||||
style: { "min-width": "180px" }
|
||||
style: { "min-width": "190px" }
|
||||
};
|
||||
const _hoisted_7$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon" }, "\uE623", -1);
|
||||
const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon" }, "\uE63E", -1);
|
||||
const _hoisted_9$1 = /* @__PURE__ */ createElementVNode("i", { class: "soul-icon" }, "\uE614", -1);
|
||||
const _hoisted_10$1 = { style: { "max-height": "300px", "overflow": "auto" } };
|
||||
const _sfc_main$1 = defineComponent({
|
||||
__name: "soultable",
|
||||
props: {
|
||||
left: { default: 10 },
|
||||
top: { default: 10 },
|
||||
list: { default: [] },
|
||||
soulkey: { default: "" }
|
||||
soulkey: { default: "" },
|
||||
show: { type: Boolean, default: false }
|
||||
},
|
||||
emits: ["asc", "desc", "sx"],
|
||||
emits: ["asc", "desc", "sx", "daochu"],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
function asc(event) {
|
||||
@@ -673,18 +687,20 @@ const _sfc_main$1 = defineComponent({
|
||||
function desc(event) {
|
||||
emit("desc", event);
|
||||
}
|
||||
function daochu() {
|
||||
emit("daochu");
|
||||
}
|
||||
const sel = ref([]);
|
||||
const list = ref([]);
|
||||
const alllist = ref([]);
|
||||
watch(() => [props.list, props.soulkey], () => {
|
||||
watch(() => [props.show], () => {
|
||||
let set = /* @__PURE__ */ new Set();
|
||||
for (let i of props.list) {
|
||||
set.add(i[props.soulkey]);
|
||||
console.log(i, i[props.soulkey]);
|
||||
}
|
||||
alllist.value = Array.from(set);
|
||||
list.value = alllist.value;
|
||||
console.log(list.value);
|
||||
selshow.value = false;
|
||||
}, { deep: true });
|
||||
const seltext = ref("");
|
||||
watch(seltext, () => {
|
||||
@@ -724,14 +740,22 @@ const _sfc_main$1 = defineComponent({
|
||||
}
|
||||
}
|
||||
const selshow = ref(false);
|
||||
function shubiao(event) {
|
||||
console.log(event, 160);
|
||||
if (event.target.getAttribute("show") == "select") {
|
||||
selshow.value = true;
|
||||
} else {
|
||||
selshow.value = false;
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", {
|
||||
class: "soulbox",
|
||||
style: normalizeStyle(`top: ${props.top}px;left:${props.left}px`),
|
||||
onClick: _cache[6] || (_cache[6] = withModifiers(() => {
|
||||
onClick: _cache[5] || (_cache[5] = withModifiers(() => {
|
||||
}, ["stop"]))
|
||||
}, [
|
||||
createElementVNode("ul", null, [
|
||||
createElementVNode("ul", { onMouseover: shubiao }, [
|
||||
createElementVNode("li", {
|
||||
onClick: asc,
|
||||
class: "soul-sort",
|
||||
@@ -750,21 +774,22 @@ const _sfc_main$1 = defineComponent({
|
||||
_hoisted_2$1,
|
||||
createTextVNode(" \u964D\u5E8F\u6392\u5217 ")
|
||||
]),
|
||||
_hoisted_3$1,
|
||||
createElementVNode("li", {
|
||||
class: "soul-dropList",
|
||||
style: {},
|
||||
onMouseover: _cache[0] || (_cache[0] = ($event) => selshow.value = true)
|
||||
onClick: daochu,
|
||||
class: "soul-sort",
|
||||
"data-value": "desc",
|
||||
style: { "border-bottom": "1px solid rgb(230, 230, 230)" }
|
||||
}, [
|
||||
_hoisted_3$1,
|
||||
createTextVNode(" \u7B5B\u9009\u6570\u636E "),
|
||||
_hoisted_4$1
|
||||
], 32)
|
||||
]),
|
||||
_hoisted_4$1,
|
||||
createTextVNode(" \u5BFC\u51FAexcel ")
|
||||
])
|
||||
], 32),
|
||||
withDirectives(createElementVNode("div", _hoisted_5$1, [
|
||||
createVNode(_sfc_main$8, {
|
||||
"prefix-icon": "layui-icon-search",
|
||||
modelValue: seltext.value,
|
||||
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => seltext.value = $event),
|
||||
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => seltext.value = $event),
|
||||
size: "sm",
|
||||
placeholder: "\u5173\u952E\u5B57\u641C\u7D22"
|
||||
}, null, 8, ["modelValue"]),
|
||||
@@ -772,7 +797,7 @@ const _sfc_main$1 = defineComponent({
|
||||
createElementVNode("div", {
|
||||
class: "multiOption",
|
||||
"data-type": "all",
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => select(1))
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => select(1))
|
||||
}, [
|
||||
_hoisted_7$1,
|
||||
createTextVNode(" \u5168\u9009 ")
|
||||
@@ -780,7 +805,7 @@ const _sfc_main$1 = defineComponent({
|
||||
createElementVNode("div", {
|
||||
class: "multiOption",
|
||||
"data-type": "none",
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => select(2))
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => select(2))
|
||||
}, [
|
||||
_hoisted_8$1,
|
||||
createTextVNode(" \u6E05\u7A7A ")
|
||||
@@ -788,16 +813,16 @@ const _sfc_main$1 = defineComponent({
|
||||
createElementVNode("div", {
|
||||
class: "multiOption",
|
||||
"data-type": "reverse",
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => select(3))
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => select(3))
|
||||
}, [
|
||||
_hoisted_9$1,
|
||||
createTextVNode("\u53CD\u9009 ")
|
||||
])
|
||||
]),
|
||||
createElementVNode("ul", null, [
|
||||
createElementVNode("ul", _hoisted_10$1, [
|
||||
createVNode(_sfc_main$9, {
|
||||
modelValue: sel.value,
|
||||
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => sel.value = $event)
|
||||
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => sel.value = $event)
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
(openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (i, j) => {
|
||||
@@ -925,7 +950,8 @@ const _sfc_main = defineComponent({
|
||||
getCheckboxProps: { type: Function, default: () => {
|
||||
} },
|
||||
getRadioProps: { type: Function, default: () => {
|
||||
} }
|
||||
} },
|
||||
download: { default: "" }
|
||||
},
|
||||
emits: [
|
||||
"change",
|
||||
@@ -1129,7 +1155,7 @@ const _sfc_main = defineComponent({
|
||||
}
|
||||
tableStr += "</tr>";
|
||||
}
|
||||
tableDataSource.value.forEach((item, rowIndex) => {
|
||||
datalist.value.forEach((item, rowIndex) => {
|
||||
tableStr += "<tr>";
|
||||
tableBodyColumns.value.forEach((tableColumn, columnIndex) => {
|
||||
Object.keys(item).forEach((name) => {
|
||||
@@ -1158,7 +1184,10 @@ const _sfc_main = defineComponent({
|
||||
<table syle="table-layout: fixed;word-wrap: break-word; word-break: break-all;">${tableStr}</table>
|
||||
</body>
|
||||
</html>`;
|
||||
window.location.href = uri + base64(exportTemplate);
|
||||
let a = document.createElement("a");
|
||||
a.href = uri + base64(exportTemplate);
|
||||
a.download = (props.download || "\u4E0B\u8F7D\u6587\u4EF6") + ".xls";
|
||||
a.click();
|
||||
return;
|
||||
};
|
||||
function base64(s2) {
|
||||
@@ -1760,12 +1789,14 @@ const _sfc_main = defineComponent({
|
||||
withDirectives(createVNode(_sfc_main$1, {
|
||||
top: soultop.value,
|
||||
left: soulleft.value,
|
||||
show: soulkey.value == column.key,
|
||||
onAsc: asc,
|
||||
onDesc: desc,
|
||||
list: props.dataSource,
|
||||
onDaochu: exportData,
|
||||
list: datalist.value,
|
||||
soulkey: column.key,
|
||||
onSx: sx
|
||||
}, null, 8, ["top", "left", "list", "soulkey"]), [
|
||||
}, null, 8, ["top", "left", "show", "list", "soulkey"]), [
|
||||
[vShow, soulkey.value == column.key]
|
||||
])
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user