@7365admin1/layer-common 1.10.4 → 1.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,6 +76,26 @@
76
76
  style="max-height: calc(100vh - (200px))"
77
77
  class="border mt-5"
78
78
  >
79
+ <template #header.nric>
80
+ <div class="d-flex align-center">
81
+ NRIC
82
+ <v-icon
83
+ class="cursor-pointer ml-1"
84
+ size="18"
85
+ color="blue"
86
+ @click="isShowNRIC = !isShowNRIC"
87
+ >
88
+ {{ isShowNRIC ? "mdi-eye-off-outline" : "mdi-eye-outline" }}
89
+ </v-icon>
90
+ </div>
91
+ </template>
92
+ <template #item.nric="{ value }">
93
+ <tr>
94
+ {{
95
+ maskedNric(value)
96
+ }}
97
+ </tr>
98
+ </template>
79
99
  </v-data-table>
80
100
  </v-col>
81
101
 
@@ -142,6 +162,7 @@ const injuredTableHeader = [
142
162
  value: "contact",
143
163
  },
144
164
  ];
165
+
145
166
  const damagePropertyTableHeader = [
146
167
  {
147
168
  title: "Description",
@@ -164,4 +185,12 @@ const damagePropertyTableHeader = [
164
185
  value: "action",
165
186
  },
166
187
  ];
188
+
189
+ const isShowNRIC = ref(false);
190
+
191
+ const maskedNric = (nric: string) => {
192
+ if (!nric) return "";
193
+ if (isShowNRIC.value) return nric;
194
+ return nric[0] + "*".repeat(nric.length - 5) + nric.slice(-4);
195
+ };
167
196
  </script>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div class="d-flex align-center ga-2 flex-wrap">
3
+ <span v-if="formatted">
4
+ {{ formatted }}
5
+ </span>
6
+
7
+ <v-chip
8
+ v-if="extraCount > 0"
9
+ density="comfortable"
10
+ size="small"
11
+ >
12
+ + {{ extraCount }}
13
+ </v-chip>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup lang="ts">
18
+ const props = defineProps({
19
+ plateNumbers: {
20
+ type: Array as PropType<string[]>,
21
+ default: () => []
22
+ },
23
+ defaultValue: {
24
+ type: String,
25
+ default: ""
26
+ }
27
+ })
28
+
29
+ const formatted = computed(() => {
30
+ if (!props.plateNumbers?.length) return props.defaultValue || ""
31
+
32
+ const firstTwo = props.plateNumbers
33
+ .slice(0, 2)
34
+ .map((v: any) => v?.plateNumber || "")
35
+
36
+ return firstTwo.join(", ")
37
+ })
38
+
39
+ const extraCount = computed(() => {
40
+ if (!props.plateNumbers) return 0
41
+ return props.plateNumbers.length > 2
42
+ ? props.plateNumbers.length - 2
43
+ : 0
44
+ })
45
+ </script>
@@ -243,6 +243,9 @@ const getStatusColor = (status: unknown): string => {
243
243
  case "completed":
244
244
  case "accepted":
245
245
  return "success";
246
+ case "closed":
247
+ case "rejected":
248
+ return "error";
246
249
  default:
247
250
  return "secondary";
248
251
  }
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <v-card width="100%">
3
+ <v-toolbar>
4
+ <v-row no-gutters class="fill-height px-6" align="center">
5
+ <span class="font-weight-bold text-h5 text-capitalize">
6
+ Add Vehicle
7
+ </span>
8
+ </v-row>
9
+ </v-toolbar>
10
+
11
+ <v-card-text style="max-height: 100vh; overflow-y: auto" class="pa-5 my-5">
12
+ <span class="text-subtitle-2 w-100 font-weight-medium d-flex justify-center mb-3">Please Select Status</span>
13
+ <template v-for="item in selection" :key="item.value">
14
+ <v-btn color="primary-button" block variant="flat" rounded="md" size="48" :text="item.label" @click="select(item.value)" class="my-2 text-capitalize text-subtitle-2" />
15
+ </template>
16
+ </v-card-text>
17
+
18
+ <v-toolbar density="compact">
19
+ <v-row no-gutters>
20
+ <v-col cols="12">
21
+ <v-btn
22
+ tile
23
+ block
24
+ variant="text"
25
+ class="text-none"
26
+ size="48"
27
+ @click="cancel"
28
+ >
29
+ Cancel
30
+ </v-btn>
31
+ </v-col>
32
+ </v-row>
33
+ </v-toolbar>
34
+ </v-card>
35
+ </template>
36
+
37
+ <script setup lang="ts">
38
+ const prop = defineProps({
39
+ });
40
+
41
+ const emit = defineEmits(['cancel', 'select']);
42
+
43
+ const selection = computed<{label: string, value: TVehicleType}[]>(() => {
44
+ return [
45
+ { label: "Whitelist", value: "whitelist" },
46
+ { label: "Season Pass", value: "seasonpass" },
47
+ { label: "Blocklist", value: "blocklist" },
48
+ ];
49
+ })
50
+
51
+ function cancel() {
52
+ emit("cancel");
53
+ }
54
+
55
+ function select(value: string) {
56
+ emit("select", value);
57
+ }
58
+ </script>