格式化

This commit is contained in:
Theluyuan 2023-05-05 09:59:16 +08:00
parent 1686971f8c
commit a19040aa60
4 changed files with 26 additions and 24 deletions

View File

@ -52,7 +52,7 @@ export interface TableProps {
loading?: boolean;
getCheckboxProps?: Function;
getRadioProps?: Function;
download?:string;
download?: string;
}
const props = withDefaults(defineProps<TableProps>(), {
@ -77,7 +77,7 @@ const props = withDefaults(defineProps<TableProps>(), {
loading: false,
getCheckboxProps: () => {},
getRadioProps: () => {},
download:""
download: "",
});
const emit = defineEmits([
@ -423,11 +423,11 @@ const exportData = () => {
<table syle="table-layout: fixed;word-wrap: break-word; word-break: break-all;">${tableStr}</table>
</body>
</html>`;
let a = document.createElement("a")
let a = document.createElement("a");
a.href = uri + base64(exportTemplate);
a.download= (props.download || "下载文件") + ".xls";
a.download = (props.download || "下载文件") + ".xls";
a.click();
// window.location.href =
// window.location.href =
return;
};

View File

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

View File

@ -70,8 +70,8 @@ const nodeIconType = (node: TreeData): string => {
if (node.children.length !== 0) {
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
}
if(props.hideicon){
return ""
if (props.hideicon) {
return "";
}
return "layui-icon-file";
};

View File

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