changes
This commit is contained in:
@@ -191,7 +191,7 @@ const pos = computed(() => {
|
|||||||
const clearTrigger = ref(0);
|
const clearTrigger = ref(0);
|
||||||
|
|
||||||
if (props.vdata) {
|
if (props.vdata) {
|
||||||
orgdata.value = props.vdata;
|
orgdata.value = $copy(props.vdata);
|
||||||
orgdata.value.forEach((v) => (v.search = $nonAccent(v[props.field])));
|
orgdata.value.forEach((v) => (v.search = $nonAccent(v[props.field])));
|
||||||
}
|
}
|
||||||
if (props.first) {
|
if (props.first) {
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
row: Object,
|
|
||||||
pagename: String,
|
|
||||||
});
|
|
||||||
const { $id } = useNuxtApp();
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<DataView
|
|
||||||
v-bind="{
|
|
||||||
setting: 'product-info',
|
|
||||||
pagename: $id(),
|
|
||||||
api: 'product',
|
|
||||||
params: {
|
|
||||||
filter: { prdbk__transaction__customer: props.row.id },
|
|
||||||
// copied from 02-connection.js
|
|
||||||
values:
|
|
||||||
'price_excluding_vat,prdbk__transaction__txncurrent__detail__status__name,locked_until,note,cart,cart__name,cart__code,cart__dealer,cart__dealer__code,cart__dealer__name,direction,type,zone_type,dealer,link,type__name,dealer__code,dealer__name,prdbk,prdbk__transaction__customer,prdbk__transaction,prdbk__transaction__policy__code,prdbk__transaction__sale_price,prdbk__transaction__discount_amount,prdbk__transaction__code,prdbk__transaction__customer__code,prdbk__transaction__customer__phone,prdbk__transaction__customer__fullname,prdbk__transaction__customer__legal_code,id,code,trade_code,land_lot_code,zone_code,zone_type__name,lot_area,building_area,total_built_area,number_of_floors,land_lot_size,origin_price,direction__name,villa_model,product_type,template_name,project,project__name,status,status__code,status__name,status__color,status__sale_status,status__sale_status__color,create_time,prdbk__transaction__amount_received,prdbk__transaction__amount_remain',
|
|
||||||
},
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -9,7 +9,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
setTimeout(() => store.commit("snackbar", undefined), 3900);
|
setTimeout(() => store.commit("snackbar", undefined), 2500);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -44,14 +44,15 @@ export default defineNuxtPlugin(() => {
|
|||||||
const filter = function (arr, obj, attr) {
|
const filter = function (arr, obj, attr) {
|
||||||
const keys = Object.keys(obj);
|
const keys = Object.keys(obj);
|
||||||
|
|
||||||
if (!arr) {
|
if (!Array.isArray(arr)) {
|
||||||
console.error(`$filter: arr is ${arr}`);
|
console.error(`$filter: arr ${arr} is not an array`);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const rows = arr.filter((v) => {
|
const rows = arr.filter((v) => {
|
||||||
let valid = true;
|
let valid = true;
|
||||||
keys.map((key) => {
|
|
||||||
|
keys.forEach((key) => {
|
||||||
let val = obj[key];
|
let val = obj[key];
|
||||||
if (valid === false) return false;
|
if (valid === false) return false;
|
||||||
else if (Array.isArray(val)) {
|
else if (Array.isArray(val)) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import localizedFormat from "dayjs/plugin/localizedFormat";
|
|||||||
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
||||||
import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
|
import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
|
||||||
import "dayjs/locale/vi";
|
import "dayjs/locale/vi";
|
||||||
|
import { deburr } from "es-toolkit";
|
||||||
dayjs.extend(weekday);
|
dayjs.extend(weekday);
|
||||||
dayjs.extend(weekOfYear);
|
dayjs.extend(weekOfYear);
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
@@ -213,24 +214,14 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const nonAccent = function (str) {
|
const nonAccent = function (str) {
|
||||||
if ($empty(str)) return null;
|
if ($empty(str)) return "";
|
||||||
str = str.replaceAll("/", "-").replaceAll("%", "-").replaceAll("?", "-");
|
const result = deburr(str)
|
||||||
str = str.toLowerCase();
|
.toLowerCase()
|
||||||
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
|
.replaceAll(/\u02C6/g, "") // 'ˆ' (Some system encode vietnamese combining accent as individual utf-8 characters)
|
||||||
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
|
.replaceAll(/[\/%?]/g, " ")
|
||||||
str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
|
.replaceAll(/[\s-]+/g, "-");
|
||||||
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o");
|
|
||||||
str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, "u");
|
return result;
|
||||||
str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, "y");
|
|
||||||
str = str.replace(/đ/g, "d");
|
|
||||||
// Some system encode vietnamese combining accent as individual utf-8 characters
|
|
||||||
str = str.replace(/\u0300|\u0301|\u0303|\u0309|\u0323/g, ""); // Huyền sắc hỏi ngã nặng
|
|
||||||
str = str.replace(/\u02C6|\u0306|\u031B/g, ""); // Â, Ê, Ă, Ơ, Ư
|
|
||||||
str = str
|
|
||||||
.split(" ")
|
|
||||||
.filter((s) => s)
|
|
||||||
.join("-");
|
|
||||||
return str;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const linkID = function (link) {
|
const linkID = function (link) {
|
||||||
|
|||||||
Reference in New Issue
Block a user