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

View File

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