Compare commits
3 Commits
bcbe71c7ad
...
a19040aa60
Author | SHA1 | Date | |
---|---|---|---|
a19040aa60 | |||
1686971f8c | |||
cb5a696c09 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -23,7 +23,8 @@ const _sfc_main$1 = defineComponent({
|
|||||||
selectedKey: null,
|
selectedKey: null,
|
||||||
checkStrictly: { type: [Boolean, String] },
|
checkStrictly: { type: [Boolean, String] },
|
||||||
collapseTransition: { type: Boolean },
|
collapseTransition: { type: Boolean },
|
||||||
onlyIconControl: { type: Boolean }
|
onlyIconControl: { type: Boolean },
|
||||||
|
hideicon: { type: Boolean }
|
||||||
},
|
},
|
||||||
emits: ["node-click"],
|
emits: ["node-click"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
@ -42,6 +43,9 @@ const _sfc_main$1 = defineComponent({
|
|||||||
if (node.children.length !== 0) {
|
if (node.children.length !== 0) {
|
||||||
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
|
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
|
||||||
}
|
}
|
||||||
|
if (props.hideicon) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return "layui-icon-file";
|
return "layui-icon-file";
|
||||||
};
|
};
|
||||||
function recursiveNodeClick(node) {
|
function recursiveNodeClick(node) {
|
||||||
@ -161,6 +165,7 @@ const _sfc_main$1 = defineComponent({
|
|||||||
"collapse-transition": __props.collapseTransition,
|
"collapse-transition": __props.collapseTransition,
|
||||||
checkStrictly: __props.checkStrictly,
|
checkStrictly: __props.checkStrictly,
|
||||||
"only-icon-control": __props.onlyIconControl,
|
"only-icon-control": __props.onlyIconControl,
|
||||||
|
hideicon: props.hideicon,
|
||||||
onNodeClick: recursiveNodeClick
|
onNodeClick: recursiveNodeClick
|
||||||
}, createSlots({ _: 2 }, [
|
}, createSlots({ _: 2 }, [
|
||||||
_ctx.$slots.title ? {
|
_ctx.$slots.title ? {
|
||||||
@ -172,7 +177,7 @@ const _sfc_main$1 = defineComponent({
|
|||||||
]),
|
]),
|
||||||
key: "0"
|
key: "0"
|
||||||
} : void 0
|
} : void 0
|
||||||
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control"])
|
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control", "hideicon"])
|
||||||
])) : createCommentVNode("", true)
|
])) : createCommentVNode("", true)
|
||||||
]),
|
]),
|
||||||
_: 2
|
_: 2
|
||||||
@ -377,7 +382,8 @@ const _sfc_main = defineComponent({
|
|||||||
children: "children",
|
children: "children",
|
||||||
title: "title"
|
title: "title"
|
||||||
};
|
};
|
||||||
} }
|
} },
|
||||||
|
hideicon: { type: Boolean }
|
||||||
},
|
},
|
||||||
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
|
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
@ -439,7 +445,8 @@ const _sfc_main = defineComponent({
|
|||||||
"check-strictly": __props.checkStrictly,
|
"check-strictly": __props.checkStrictly,
|
||||||
"collapse-transition": __props.collapseTransition,
|
"collapse-transition": __props.collapseTransition,
|
||||||
"only-icon-control": __props.onlyIconControl,
|
"only-icon-control": __props.onlyIconControl,
|
||||||
onNodeClick: handleClick
|
onNodeClick: handleClick,
|
||||||
|
hideicon: props.hideicon
|
||||||
}, createSlots({ _: 2 }, [
|
}, createSlots({ _: 2 }, [
|
||||||
_ctx.$slots.title ? {
|
_ctx.$slots.title ? {
|
||||||
name: "title",
|
name: "title",
|
||||||
@ -448,7 +455,7 @@ const _sfc_main = defineComponent({
|
|||||||
]),
|
]),
|
||||||
key: "0"
|
key: "0"
|
||||||
} : void 0
|
} : void 0
|
||||||
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control"])
|
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control", "hideicon"])
|
||||||
], 2);
|
], 2);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -52,6 +52,7 @@ export interface TableProps {
|
|||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
getCheckboxProps?: Function;
|
getCheckboxProps?: Function;
|
||||||
getRadioProps?: Function;
|
getRadioProps?: Function;
|
||||||
|
download?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<TableProps>(), {
|
const props = withDefaults(defineProps<TableProps>(), {
|
||||||
@ -76,6 +77,7 @@ const props = withDefaults(defineProps<TableProps>(), {
|
|||||||
loading: false,
|
loading: false,
|
||||||
getCheckboxProps: () => {},
|
getCheckboxProps: () => {},
|
||||||
getRadioProps: () => {},
|
getRadioProps: () => {},
|
||||||
|
download: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
@ -286,7 +288,7 @@ watch(
|
|||||||
|
|
||||||
const changeAll = (isChecked: boolean) => {
|
const changeAll = (isChecked: boolean) => {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
const datasources = props.dataSource.filter((item: any, index: number) => {
|
const datasources = datalist.value.filter((item: any, index: number) => {
|
||||||
return !props.getCheckboxProps(item, index)?.disabled;
|
return !props.getCheckboxProps(item, index)?.disabled;
|
||||||
});
|
});
|
||||||
const ids = datasources.map((item) => {
|
const ids = datasources.map((item) => {
|
||||||
@ -387,7 +389,7 @@ const exportData = () => {
|
|||||||
}
|
}
|
||||||
tableStr += "</tr>";
|
tableStr += "</tr>";
|
||||||
}
|
}
|
||||||
tableDataSource.value.forEach((item, rowIndex) => {
|
datalist.value.forEach((item, rowIndex) => {
|
||||||
tableStr += "<tr>";
|
tableStr += "<tr>";
|
||||||
tableBodyColumns.value.forEach((tableColumn, columnIndex) => {
|
tableBodyColumns.value.forEach((tableColumn, columnIndex) => {
|
||||||
Object.keys(item).forEach((name) => {
|
Object.keys(item).forEach((name) => {
|
||||||
@ -421,7 +423,11 @@ const exportData = () => {
|
|||||||
<table syle="table-layout: fixed;word-wrap: break-word; word-break: break-all;">${tableStr}</table>
|
<table syle="table-layout: fixed;word-wrap: break-word; word-break: break-all;">${tableStr}</table>
|
||||||
</body>
|
</body>
|
||||||
</html>`;
|
</html>`;
|
||||||
window.location.href = uri + base64(exportTemplate);
|
let a = document.createElement("a");
|
||||||
|
a.href = uri + base64(exportTemplate);
|
||||||
|
a.download = (props.download || "下载文件") + ".xls";
|
||||||
|
a.click();
|
||||||
|
// window.location.href =
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1133,9 +1139,11 @@ window.addEventListener("click", heddin);
|
|||||||
:top="soultop"
|
:top="soultop"
|
||||||
:left="soulleft"
|
:left="soulleft"
|
||||||
v-show="soulkey == column.key"
|
v-show="soulkey == column.key"
|
||||||
|
:show="soulkey == column.key"
|
||||||
@asc="asc"
|
@asc="asc"
|
||||||
@desc="desc"
|
@desc="desc"
|
||||||
:list="props.dataSource"
|
@daochu="exportData"
|
||||||
|
:list="datalist"
|
||||||
:soulkey="column.key"
|
:soulkey="column.key"
|
||||||
@sx="sx"
|
@sx="sx"
|
||||||
></soultable>
|
></soultable>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 2147483647;
|
z-index: 2147483647;
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
max-width: 300px;
|
max-width: 320px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: 1px solid #e6e6e6;
|
border: 1px solid #e6e6e6;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
:style="`top: ${props.top}px;left:${props.left}px`"
|
:style="`top: ${props.top}px;left:${props.left}px`"
|
||||||
@click.stop=""
|
@click.stop=""
|
||||||
>
|
>
|
||||||
<ul>
|
<ul @mouseover="shubiao">
|
||||||
<li @click="asc" class="soul-sort" data-value="asc" style="">
|
<li @click="asc" class="soul-sort" data-value="asc" style="">
|
||||||
<i class="soul-icon soul-icon-asc"></i> 升序排列
|
<i class="soul-icon soul-icon-asc"></i> 升序排列
|
||||||
</li>
|
</li>
|
||||||
@ -18,9 +18,21 @@
|
|||||||
</li>
|
</li>
|
||||||
<!-- <li class="soul-column" style=""><i class="layui-icon layui-icon-table"></i> 表格列 <i
|
<!-- <li class="soul-column" style=""><i class="layui-icon layui-icon-table"></i> 表格列 <i
|
||||||
class="layui-icon layui-icon-right" style="float: right"></i></li> -->
|
class="layui-icon layui-icon-right" style="float: right"></i></li> -->
|
||||||
<li class="soul-dropList" style="" @mouseover="selshow = true">
|
<li class="soul-dropList" style="" show="select">
|
||||||
<i class="soul-icon soul-icon-drop-list"></i> 筛选数据
|
<i class="soul-icon soul-icon-drop-list" show="select"></i> 筛选数据
|
||||||
<i class="layui-icon layui-icon-right" style="float: right"></i>
|
<i
|
||||||
|
class="layui-icon layui-icon-right"
|
||||||
|
style="float: right"
|
||||||
|
show="select"
|
||||||
|
></i>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
@click="daochu"
|
||||||
|
class="soul-sort"
|
||||||
|
data-value="desc"
|
||||||
|
style="border-bottom: 1px solid rgb(230, 230, 230)"
|
||||||
|
>
|
||||||
|
<i class="soul-icon soul-icon-download"></i> 导出excel
|
||||||
</li>
|
</li>
|
||||||
<!-- <li class="soul-condition" style=""><i class="soul-icon soul-icon-query"></i> 筛选条件 <i
|
<!-- <li class="soul-condition" style=""><i class="soul-icon soul-icon-query"></i> 筛选条件 <i
|
||||||
class="layui-icon layui-icon-right" style="float: right"></i></li>
|
class="layui-icon layui-icon-right" style="float: right"></i></li>
|
||||||
@ -35,7 +47,7 @@
|
|||||||
placeholder="关键字搜索"
|
placeholder="关键字搜索"
|
||||||
>
|
>
|
||||||
</lay-input>
|
</lay-input>
|
||||||
<div class="check" style="min-width: 180px">
|
<div class="check" style="min-width: 190px">
|
||||||
<div class="multiOption" data-type="all" @click="select(1)">
|
<div class="multiOption" data-type="all" @click="select(1)">
|
||||||
<i class="soul-icon"></i> 全选
|
<i class="soul-icon"></i> 全选
|
||||||
</div>
|
</div>
|
||||||
@ -46,7 +58,7 @@
|
|||||||
<i class="soul-icon"></i>反选
|
<i class="soul-icon"></i>反选
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul style="max-height: 300px; overflow: auto">
|
||||||
<LayCheckboxGroup v-model="sel">
|
<LayCheckboxGroup v-model="sel">
|
||||||
<li v-for="(i, j) in list">
|
<li v-for="(i, j) in list">
|
||||||
<LayCheckbox skin="primary" :value="i"></LayCheckbox>{{ i }}
|
<LayCheckbox skin="primary" :value="i"></LayCheckbox>{{ i }}
|
||||||
@ -68,34 +80,40 @@ export interface SoulTableProps {
|
|||||||
top: number;
|
top: number;
|
||||||
list: any;
|
list: any;
|
||||||
soulkey: string;
|
soulkey: string;
|
||||||
|
show: boolean;
|
||||||
}
|
}
|
||||||
const props = withDefaults(defineProps<SoulTableProps>(), {
|
const props = withDefaults(defineProps<SoulTableProps>(), {
|
||||||
top: 10,
|
top: 10,
|
||||||
left: 10,
|
left: 10,
|
||||||
list: [],
|
list: [],
|
||||||
soulkey: "",
|
soulkey: "",
|
||||||
|
show: false,
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["asc", "desc", "sx"]);
|
const emit = defineEmits(["asc", "desc", "sx", "daochu"]);
|
||||||
function asc(event: any) {
|
function asc(event: any) {
|
||||||
emit("asc", event);
|
emit("asc", event);
|
||||||
}
|
}
|
||||||
function desc(event: any) {
|
function desc(event: any) {
|
||||||
emit("desc", event);
|
emit("desc", event);
|
||||||
}
|
}
|
||||||
|
function daochu() {
|
||||||
|
emit("daochu");
|
||||||
|
}
|
||||||
const sel: any = ref([]);
|
const sel: any = ref([]);
|
||||||
const list: any = ref([]);
|
const list: any = ref([]);
|
||||||
const alllist: any = ref([]);
|
const alllist: any = ref([]);
|
||||||
watch(
|
watch(
|
||||||
() => [props.list, props.soulkey],
|
() => [props.show],
|
||||||
() => {
|
() => {
|
||||||
let set = new Set();
|
let set = new Set();
|
||||||
for (let i of props.list) {
|
for (let i of props.list) {
|
||||||
set.add(i[props.soulkey]);
|
set.add(i[props.soulkey]);
|
||||||
console.log(i, i[props.soulkey]);
|
// console.log(i, i[props.soulkey]);
|
||||||
}
|
}
|
||||||
alllist.value = Array.from(set);
|
alllist.value = Array.from(set);
|
||||||
list.value = alllist.value;
|
list.value = alllist.value;
|
||||||
console.log(list.value);
|
selshow.value = false;
|
||||||
|
// console.log(list.value);
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
@ -143,4 +161,12 @@ function select(type: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const selshow = ref(false);
|
const selshow = ref(false);
|
||||||
|
function shubiao(event: any) {
|
||||||
|
console.log(event, 160);
|
||||||
|
if (event.target.getAttribute("show") == "select") {
|
||||||
|
selshow.value = true;
|
||||||
|
} else {
|
||||||
|
selshow.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -35,6 +35,7 @@ export interface TreeNodeProps {
|
|||||||
checkStrictly: boolean | string;
|
checkStrictly: boolean | string;
|
||||||
collapseTransition: boolean;
|
collapseTransition: boolean;
|
||||||
onlyIconControl: boolean;
|
onlyIconControl: boolean;
|
||||||
|
hideicon?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TreeNodeEmits {
|
interface TreeNodeEmits {
|
||||||
@ -69,6 +70,9 @@ const nodeIconType = (node: TreeData): string => {
|
|||||||
if (node.children.length !== 0) {
|
if (node.children.length !== 0) {
|
||||||
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
|
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
|
||||||
}
|
}
|
||||||
|
if (props.hideicon) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return "layui-icon-file";
|
return "layui-icon-file";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -193,6 +197,7 @@ const isChildAllSelected = computed(() => {
|
|||||||
:collapse-transition="collapseTransition"
|
:collapse-transition="collapseTransition"
|
||||||
:checkStrictly="checkStrictly"
|
:checkStrictly="checkStrictly"
|
||||||
:only-icon-control="onlyIconControl"
|
:only-icon-control="onlyIconControl"
|
||||||
|
:hideicon="props.hideicon"
|
||||||
@node-click="recursiveNodeClick"
|
@node-click="recursiveNodeClick"
|
||||||
>
|
>
|
||||||
<template v-if="$slots.title" v-slot:title="slotProp: { data: any }">
|
<template v-if="$slots.title" v-slot:title="slotProp: { data: any }">
|
||||||
|
@ -38,6 +38,7 @@ export interface TreeProps {
|
|||||||
showLine?: boolean;
|
showLine?: boolean;
|
||||||
showCheckbox?: boolean;
|
showCheckbox?: boolean;
|
||||||
replaceFields?: ReplaceFieldsOptions;
|
replaceFields?: ReplaceFieldsOptions;
|
||||||
|
hideicon?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TreeEmits {
|
interface TreeEmits {
|
||||||
@ -144,6 +145,7 @@ function handleClick(node: TreeData) {
|
|||||||
:collapse-transition="collapseTransition"
|
:collapse-transition="collapseTransition"
|
||||||
:only-icon-control="onlyIconControl"
|
:only-icon-control="onlyIconControl"
|
||||||
@node-click="handleClick"
|
@node-click="handleClick"
|
||||||
|
:hideicon="props.hideicon"
|
||||||
>
|
>
|
||||||
<template v-if="$slots.title" v-slot:title="{ data }">
|
<template v-if="$slots.title" v-slot:title="{ data }">
|
||||||
<slot name="title" :data="data"></slot>
|
<slot name="title" :data="data"></slot>
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user