格式化

This commit is contained in:
Theluyuan 2023-05-05 09:59:19 +08:00
parent 27f75e2ced
commit f87a5bb70a
4 changed files with 26 additions and 24 deletions

View File

@ -52,7 +52,7 @@ export interface TableProps {
loading?: boolean; loading?: boolean;
getCheckboxProps?: Function; getCheckboxProps?: Function;
getRadioProps?: Function; getRadioProps?: Function;
download?:string; download?: string;
} }
const props = withDefaults(defineProps<TableProps>(), { const props = withDefaults(defineProps<TableProps>(), {
@ -77,7 +77,7 @@ const props = withDefaults(defineProps<TableProps>(), {
loading: false, loading: false,
getCheckboxProps: () => {}, getCheckboxProps: () => {},
getRadioProps: () => {}, getRadioProps: () => {},
download:"" download: "",
}); });
const emit = defineEmits([ const emit = defineEmits([
@ -423,9 +423,9 @@ 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>`;
let a = document.createElement("a") let a = document.createElement("a");
a.href = uri + base64(exportTemplate); a.href = uri + base64(exportTemplate);
a.download= (props.download || "下载文件") + ".xls"; a.download = (props.download || "下载文件") + ".xls";
a.click(); a.click();
// window.location.href = // window.location.href =
return; return;

View File

@ -20,7 +20,11 @@
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="" show="select"> <li class="soul-dropList" style="" show="select">
<i class="soul-icon soul-icon-drop-list" show="select"></i> 筛选数据 <i class="soul-icon soul-icon-drop-list" show="select"></i> 筛选数据
<i class="layui-icon layui-icon-right" style="float: right" show="select"></i> <i
class="layui-icon layui-icon-right"
style="float: right"
show="select"
></i>
</li> </li>
<li <li
@click="daochu" @click="daochu"
@ -54,7 +58,7 @@
<i class="soul-icon"></i>反选 <i class="soul-icon"></i>反选
</div> </div>
</div> </div>
<ul style="max-height: 300px;overflow: auto;"> <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 }}
@ -76,24 +80,24 @@ export interface SoulTableProps {
top: number; top: number;
list: any; list: any;
soulkey: string; soulkey: string;
show:boolean; 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 show: false,
}); });
const emit = defineEmits(["asc", "desc", "sx",'daochu']); 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(){ function daochu() {
emit("daochu") emit("daochu");
} }
const sel: any = ref([]); const sel: any = ref([]);
const list: any = ref([]); const list: any = ref([]);
@ -108,7 +112,7 @@ watch(
} }
alllist.value = Array.from(set); alllist.value = Array.from(set);
list.value = alllist.value; list.value = alllist.value;
selshow.value = false selshow.value = false;
// console.log(list.value); // console.log(list.value);
}, },
{ deep: true } { deep: true }
@ -157,14 +161,12 @@ function select(type: number) {
} }
} }
const selshow = ref(false); const selshow = ref(false);
function shubiao(event:any){ function shubiao(event: any) {
console.log(event,160) console.log(event, 160);
if(event.target.getAttribute("show") == "select"){ if (event.target.getAttribute("show") == "select") {
selshow.value = true selshow.value = true;
}else{ } else {
selshow.value = false selshow.value = false;
} }
} }
</script> </script>

View File

@ -70,8 +70,8 @@ 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){ if (props.hideicon) {
return "" return "";
} }
return "layui-icon-file"; return "layui-icon-file";
}; };

View File

@ -38,7 +38,7 @@ export interface TreeProps {
showLine?: boolean; showLine?: boolean;
showCheckbox?: boolean; showCheckbox?: boolean;
replaceFields?: ReplaceFieldsOptions; replaceFields?: ReplaceFieldsOptions;
hideicon?:boolean; hideicon?: boolean;
} }
interface TreeEmits { interface TreeEmits {