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

@@ -4,44 +4,64 @@
<p class="border-bottom mt-4 mb-5"></p>
<div class="field is-grouped">
<div class="control is-expanded">
<button class="button is-danger" @click="remove()">Đồng ý</button>
<button class="button is-dark ml-5" @click="cancel()">Hủy bỏ</button>
<button
class="button is-danger"
@click="remove()"
>
Đồng ý
</button>
<button
class="button is-dark ml-5"
@click="cancel()"
>
Hủy bỏ
</button>
</div>
<div class="control" v-if="duration">
<CountDown v-bind="{duration: duration}" @close="cancel()"></CountDown>
<div
class="control"
v-if="duration"
>
<CountDown
v-bind="{ duration: duration }"
@close="cancel()"
></CountDown>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['content', 'duration', 'vbind', 'setdeleted'],
props: ["content", "duration", "vbind", "setdeleted"],
methods: {
cancel() {
this.$emit('close')
this.$emit("close");
},
async remove() {
let pagename = this.vbind.pagename
let pagedata = this.$store.state[pagename]
let name = pagedata.origin_api.name || this.vbind.api
let id = this.vbind.row.id
let result
if(this.setdeleted) {
let record = await this.$getdata(name, {id: id}, undefined, true)
record.deleted = 1
result = await this.$updateapi(name, record)
} else result = await this.$deleteapi(name, id)
if(result==='error') return this.$dialog('Đã xảy ra lỗi, xóa dữ liệu thất bại', 'Lỗi', 'Error')
this.$snackbar('Dữ liệu đã được xoá khỏi hệ thống', undefined, 'Success')
let arr = Array.isArray(id)? id : [{id: id}]
let copy = this.$copy(this.$store.state[pagename].data)
arr.map(x=>{
let index = copy.findIndex(v=>v.id===x.id)
index>=0? this.$delete(copy,index) : false
})
this.$store.commit('updateState', {name: pagename, key: 'update', data: {data: copy}})
this.cancel()
}
}
}
</script>
let pagename = this.vbind.pagename;
let pagedata = this.$store.state[pagename];
let name = pagedata.origin_api.name || this.vbind.api;
let id = this.vbind.row.id;
let result;
if (this.setdeleted) {
let record = await this.$getdata(name, { id: id }, undefined, true);
record.deleted = 1;
result = await this.$updateapi(name, record);
} else result = await this.$deleteapi(name, id);
if (result === "error") return this.$dialog("Đã xảy ra lỗi, xóa dữ liệu thất bại", "Lỗi", "Error");
this.$snackbar("Dữ liệu đã được xoá khỏi hệ thống", undefined, "Success");
let arr = Array.isArray(id) ? id : [{ id: id }];
let copy = this.$copy(this.$store.state[pagename].data);
arr.map((x) => {
let index = copy.findIndex((v) => v.id === x.id);
index >= 0 ? this.$delete(copy, index) : false;
});
this.$store.commit("updateState", {
name: pagename,
key: "update",
data: { data: copy },
});
this.cancel();
},
},
};
</script>