fix: tenant

This commit is contained in:
xingyu4j 2022-11-22 13:43:00 +08:00
parent 5da9ae25fe
commit fdfdd823a6
2 changed files with 1 additions and 7 deletions

View File

@ -99,7 +99,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, unref, onMounted } from 'vue' import { ref, unref, onMounted } from 'vue'
import dayjs from 'dayjs'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage' import { useMessage } from '@/hooks/web/useMessage'
import { useVxeGrid } from '@/hooks/web/useVxeGrid' import { useVxeGrid } from '@/hooks/web/useVxeGrid'
@ -163,7 +162,6 @@ const handleUpdate = async (rowId: number) => {
// //
const res = await TenantApi.getTenantApi(rowId) const res = await TenantApi.getTenantApi(rowId)
tenantPackageId.value = res.packageId tenantPackageId.value = res.packageId
res.expireTime = dayjs(res.expireTime).format('YYYY-MM-DD HH:mm:ss')
unref(formRef)?.setValues(res) unref(formRef)?.setValues(res)
} }
@ -198,11 +196,9 @@ const submitForm = async () => {
const data = unref(formRef)?.formModel as TenantApi.TenantVO const data = unref(formRef)?.formModel as TenantApi.TenantVO
data.packageId = tenantPackageId.value data.packageId = tenantPackageId.value
if (actionType.value === 'create') { if (actionType.value === 'create') {
data.expireTime = dayjs(data.expireTime).valueOf().toString()
await TenantApi.createTenantApi(data) await TenantApi.createTenantApi(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
data.expireTime = dayjs(data.expireTime).valueOf().toString()
await TenantApi.updateTenantApi(data) await TenantApi.updateTenantApi(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }

View File

@ -69,11 +69,9 @@ const crudSchemas = reactive<VxeCrudSchema>({
field: 'expireTime', field: 'expireTime',
formatter: 'formatDate', formatter: 'formatDate',
form: { form: {
show: true,
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
type: 'datetime', type: 'datetime'
valueFormat: 'x'
} }
} }
}, },