feat(tenants): show read-only createdAt for hamkar/khanegi versions
This commit is contained in:
@@ -5,6 +5,7 @@ import { message, Modal } from 'ant-design-vue'
|
||||
import { ArrowRightOutlined, PlusOutlined, SearchOutlined } from '@ant-design/icons-vue'
|
||||
import api from '@/api/http'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { formatIranDateTime } from '@/utils/datetime'
|
||||
|
||||
type Tenant = {
|
||||
id: string
|
||||
@@ -20,6 +21,7 @@ type Tenant = {
|
||||
notes?: string | null
|
||||
hasAppUiConfig?: boolean
|
||||
uiVariant?: 'modular' | 'newTheme'
|
||||
createdAt?: string
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
@@ -141,6 +143,7 @@ onMounted(load)
|
||||
<div class="version-meta">
|
||||
<h3>{{ item.nameFa }}</h3>
|
||||
<div class="domain">{{ item.domain }}</div>
|
||||
<div class="created-at">ایجاد: {{ formatIranDateTime(item.createdAt) }}</div>
|
||||
<div style="margin-top: 8px">
|
||||
<a-tag>{{ item.slug }}</a-tag>
|
||||
<a-tag v-if="item.nameEn" color="blue">{{ item.nameEn }}</a-tag>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { message } from 'ant-design-vue'
|
||||
import { ArrowRightOutlined, PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import api from '@/api/http'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { formatIranDateTime } from '@/utils/datetime'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -12,6 +13,7 @@ const auth = useAuthStore()
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const uploading = ref(false)
|
||||
const createdAt = ref<string | null>(null)
|
||||
|
||||
const isEdit = computed(() => Boolean(route.params.id))
|
||||
|
||||
@@ -49,12 +51,14 @@ async function load() {
|
||||
if (!isEdit.value) {
|
||||
const q = String(route.query.product || '')
|
||||
form.product = q === 'khanegi' ? 'khanegi' : 'hamkar'
|
||||
createdAt.value = null
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const { data } = await api.get(`/tenants/${route.params.id}`)
|
||||
createdAt.value = data.createdAt || null
|
||||
Object.assign(form, {
|
||||
product: data.product,
|
||||
slug: data.slug,
|
||||
@@ -185,6 +189,9 @@ onMounted(load)
|
||||
<a-form-item label="دامنه فروشگاه" name="domain" :rules="[{ required: true, message: 'لازم است' }]">
|
||||
<a-input v-model:value="form.domain" size="large" placeholder="example.com" dir="ltr" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="isEdit" label="تاریخ ایجاد">
|
||||
<a-input :value="formatIranDateTime(createdAt)" size="large" disabled />
|
||||
</a-form-item>
|
||||
</section>
|
||||
|
||||
<section class="form-section">
|
||||
|
||||
@@ -298,6 +298,12 @@ button, input, textarea, select,
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.version-meta .created-at {
|
||||
margin-top: 4px;
|
||||
color: #94a3b8;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.version-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
Reference in New Issue
Block a user