changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<!-- v-if="currentsetting ? currentsetting.user === login.id : false" -->
|
||||
<div
|
||||
class="mb-4"
|
||||
class="block"
|
||||
v-if="currentsetting"
|
||||
>
|
||||
<span>Đang mở: </span>
|
||||
@@ -55,9 +55,33 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="radioSave === 'overwrite'">
|
||||
<div class="field">
|
||||
<label class="label">Tên<span class="has-text-danger"> * </span></label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="text"
|
||||
:value="$stripHtml(currentsetting.name, 40)"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Mô tả</label>
|
||||
<p class="control is-expanded">
|
||||
<textarea
|
||||
class="textarea"
|
||||
rows="1"
|
||||
placeholder="Note"
|
||||
disabled
|
||||
></textarea>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="radioSave === 'new'">
|
||||
<div class="field">
|
||||
<label class="label">Tên thiết lập <span class="has-text-danger"> * </span></label>
|
||||
<label class="label">Tên<span class="has-text-danger"> * </span></label>
|
||||
<div class="control">
|
||||
<!-- ref="name" -->
|
||||
<input
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
>
|
||||
<tbody>
|
||||
<tr
|
||||
v-if="rows.length"
|
||||
v-for="(v, i) in rows"
|
||||
:key="i"
|
||||
@click="doClick(v, i)"
|
||||
@@ -28,6 +29,12 @@
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<p
|
||||
v-else
|
||||
class="py-2 has-text-grey has-text-centered is-unselectable"
|
||||
>
|
||||
Không có giá trị nào.
|
||||
</p>
|
||||
</tbody>
|
||||
</table>
|
||||
<div
|
||||
|
||||
@@ -271,6 +271,11 @@ export default defineNuxtPlugin(() => {
|
||||
};
|
||||
|
||||
const unique = function (arr, keyProps) {
|
||||
// assume keyProps always has 1 element only
|
||||
// assume all elements of arr have the same shape
|
||||
// if keyProps[0] is not a key of arr[0], return []
|
||||
if (!Object.keys(arr[0]).includes(keyProps[0])) return [];
|
||||
|
||||
const kvArray = arr.map((entry) => {
|
||||
const key = keyProps.map((k) => entry[k]).join("|");
|
||||
return [key, entry];
|
||||
|
||||
Reference in New Issue
Block a user