chore: install prettier

This commit is contained in:
Viet An
2026-05-04 15:22:27 +07:00
parent 93d29ca7d8
commit bd58e2b847
267 changed files with 22950 additions and 13581 deletions

View File

@@ -1,8 +1,15 @@
<template>
<div>
<b-tooltip label="Mở file" position="is-left" type="is-link">
<a class="mr-3" @click="openFile(row)">
<SvgIcon v-bind="{name: 'open.svg', type: 'dark', size: 16}"></SvgIcon>
<b-tooltip
label="Mở file"
position="is-left"
type="is-link"
>
<a
class="mr-3"
@click="openFile(row)"
>
<SvgIcon v-bind="{ name: 'open.svg', type: 'dark', size: 16 }"></SvgIcon>
</a>
</b-tooltip>
<!-- <b-tooltip label="Tải xuống" position="is-left" type="is-link">
@@ -10,41 +17,55 @@
<SvgIcon v-bind="{name: 'download1.svg', type: 'dark', size: 16}"></SvgIcon>
</a>
</b-tooltip> -->
<b-tooltip label="Xóa" position="is-left" type="is-danger" v-if="disable? !disable.delete : true">
<b-tooltip
label="Xóa"
position="is-left"
type="is-danger"
v-if="disable ? !disable.delete : true"
>
<a @click="remove()">
<SvgIcon v-bind="{name: 'bin1.svg', type: 'dark', size: 16}"></SvgIcon>
<SvgIcon v-bind="{ name: 'bin1.svg', type: 'dark', size: 16 }"></SvgIcon>
</a>
</b-tooltip>
</div>
</template>
<script>
export default {
props: ['api', 'pagename', 'row', 'disable'],
props: ["api", "pagename", "row", "disable"],
methods: {
async openFile(row) {
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`
window.open(url, '_blank')
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`;
window.open(url, "_blank");
},
async downloadFile(url, fileName) {
// const response = await fetch(url, { method: "GET" });
// const blob = await response.blob();
const urlDownload = url //window.URL.createObjectURL(blob);
const urlDownload = url; //window.URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = urlDownload;
link.setAttribute("download", fileName);
link.click();
},
async download(row) {
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`
await this.downloadFile(url, row.file__file || row.file)
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`;
await this.downloadFile(url, row.file__file || row.file);
},
remove() {
let text = 'Bạn có muốn xóa file <b>#file</b> không?'
text = text.replace('#file', this.row.file__name)
let obj = {component: 'dialog/Delete', title: this.$store.lang==='en'? 'Delete file' : 'Xóa file', width: '500px', height: '100px',
vbind: {content: text, duration: 10, vbind: {row: this.row, api: this.api, pagename: this.pagename}}}
this.$emit('open', {name: 'dataevent', data: {modal: obj}})
}
}
}
let text = "Bạn có muốn xóa file <b>#file</b> không?";
text = text.replace("#file", this.row.file__name);
let obj = {
component: "dialog/Delete",
title: this.$store.lang === "en" ? "Delete file" : "Xóa file",
width: "500px",
height: "100px",
vbind: {
content: text,
duration: 10,
vbind: { row: this.row, api: this.api, pagename: this.pagename },
},
};
this.$emit("open", { name: "dataevent", data: { modal: obj } });
},
},
};
</script>