changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- v-if="currentsetting ? currentsetting.user === login.id : false" -->
|
<!-- v-if="currentsetting ? currentsetting.user === login.id : false" -->
|
||||||
<div
|
<div
|
||||||
class="mb-4"
|
class="block"
|
||||||
v-if="currentsetting"
|
v-if="currentsetting"
|
||||||
>
|
>
|
||||||
<span>Đang mở: </span>
|
<span>Đang mở: </span>
|
||||||
@@ -55,9 +55,33 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</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'">
|
<template v-if="radioSave === 'new'">
|
||||||
<div class="field">
|
<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">
|
<div class="control">
|
||||||
<!-- ref="name" -->
|
<!-- ref="name" -->
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
>
|
>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr
|
||||||
|
v-if="rows.length"
|
||||||
v-for="(v, i) in rows"
|
v-for="(v, i) in rows"
|
||||||
:key="i"
|
:key="i"
|
||||||
@click="doClick(v, i)"
|
@click="doClick(v, i)"
|
||||||
@@ -28,6 +29,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<p
|
||||||
|
v-else
|
||||||
|
class="py-2 has-text-grey has-text-centered is-unselectable"
|
||||||
|
>
|
||||||
|
Không có giá trị nào.
|
||||||
|
</p>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -271,6 +271,11 @@ export default defineNuxtPlugin(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const unique = function (arr, keyProps) {
|
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 kvArray = arr.map((entry) => {
|
||||||
const key = keyProps.map((k) => entry[k]).join("|");
|
const key = keyProps.map((k) => entry[k]).join("|");
|
||||||
return [key, entry];
|
return [key, entry];
|
||||||
|
|||||||
Reference in New Issue
Block a user