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