change configuration & add talabBedehi
This commit is contained in:
@@ -1,44 +1,57 @@
|
||||
<template>
|
||||
<div class="flex-wrap mb-2 flex justify-between items-center border-1 border-gray-300 border-solid rounded-lg p-3">
|
||||
<div class="flex flex-col justify-between ">
|
||||
<div class=" font-bold">{{ item.name }}</div>
|
||||
<div class=" text-xs ">کلید: {{ item.key }}</div>
|
||||
<div class="mb-2 justify-between items-center border-1 border-gray-300 border-solid rounded-lg p-3">
|
||||
<div>
|
||||
<div class="flex justify-between">
|
||||
<div>{{ item.title_fa ?? item.name ?? '-' }}</div>
|
||||
<div>
|
||||
<a-switch
|
||||
checked-children="فعال"
|
||||
un-checked-children="غیرفعال"
|
||||
v-model:checked="isActive"
|
||||
@change="ok"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<a-switch
|
||||
checked-children="فعال"
|
||||
un-checked-children="غیرفعال"
|
||||
<div class="flex justify-between items-center mt-2">
|
||||
<div class="text-xs items-center">کلید: {{ item.key }}</div>
|
||||
<div class="flex">
|
||||
<a-switch
|
||||
checked-children="نمایش"
|
||||
un-checked-children="عدم نمایش"
|
||||
v-model:checked="value"
|
||||
@change="ok"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {loading} from '@/utils'
|
||||
import {setConfiguration} from '@/api/configuration'
|
||||
import {message} from 'ant-design-vue'
|
||||
import {onMounted} from 'vue'
|
||||
import type {TagItem} from "@/components/BasicTags/model";
|
||||
import { loading } from '@/utils'
|
||||
import { setConfiguration } from '@/api/configuration'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { onMounted } from 'vue'
|
||||
import type { TagItem } from '@/components/BasicTags/model'
|
||||
|
||||
interface Prop {
|
||||
item: TagItem
|
||||
}
|
||||
|
||||
const props = defineProps<Prop>()
|
||||
const value = ref<string>('false')
|
||||
const value = ref<boolean>(false)
|
||||
const isActive = ref<boolean>(false)
|
||||
|
||||
async function ok() {
|
||||
let obj = {
|
||||
id: props.item.id,
|
||||
key: props.item.key,
|
||||
value: `${value.value}`,
|
||||
type:props.item.type,
|
||||
title_fa:props.item.name,
|
||||
value: value.value ? 'true' : 'false',
|
||||
type: props.item.type,
|
||||
title_fa: props.item.title_fa ?? props.item.name,
|
||||
description: props.item.description,
|
||||
is_active: props.item.is_active,
|
||||
is_active: isActive.value
|
||||
}
|
||||
try {
|
||||
loading.value = true
|
||||
@@ -53,5 +66,6 @@ async function ok() {
|
||||
|
||||
onMounted(() => {
|
||||
value.value = props.item.value === 'true'
|
||||
isActive.value = props.item.is_active === true
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user