fix: datetimerange type error

This commit is contained in:
xingyu 2022-07-21 16:51:58 +08:00
parent bc233df980
commit 1b2c2b4257
11 changed files with 62 additions and 108 deletions

View File

@ -29,10 +29,10 @@ const formRef = ref<FormExpose>()
// ========== ==========
const filterText = ref('')
const deptOptions = ref([]) //
const deptOptions = ref() //
const treeRef = ref<InstanceType<typeof ElTree>>()
const getTree = async () => {
const res = await DeptApi.listSimpleDeptApi()
const res = await DeptApi.getDeptPageApi(null)
deptOptions.value = handleTree(res)
}
const filterNode = (value: string, data: Tree) => {
@ -118,6 +118,7 @@ onMounted(async () => {
:highlight-current="true"
default-expand-all
:filter-node-method="filterNode"
:expand-on-click-node="false"
>
<template #default="{ node, data }">
<span class="custom-tree-node">

View File

@ -56,26 +56,13 @@ const crudSchemas = reactive<CrudSchema[]>([
field: 'createTime',
form: {
show: false
}
},
{
label: t('common.createTime'),
field: 'daterange',
table: {
show: false
},
form: {
show: false
},
detail: {
show: false
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},

View File

@ -54,26 +54,13 @@ const crudSchemas = reactive<CrudSchema[]>([
field: 'createTime',
form: {
show: false
}
},
{
label: t('common.createTime'),
field: 'daterange',
table: {
show: false
},
form: {
show: false
},
detail: {
show: false
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},

View File

@ -16,10 +16,10 @@ import {
ElInput,
ElInputNumber,
ElSelect,
ElTreeSelect,
ElOption,
ElMessageBox,
ElMessage,
ElCascader,
ElRadioGroup,
ElRadioButton
} from 'element-plus'
@ -41,10 +41,13 @@ const menuProps = {
label: 'name',
value: 'id'
}
const menuOptions = ref([]) //
const menuOptions = ref() //
const getTree = async () => {
const res = await MenuApi.listSimpleMenusApi()
menuOptions.value = handleTree(res)
const menu = { id: 0, name: '主类目', children: [] }
menu.children = handleTree(res)
console.info(menu)
menuOptions.value = menu
}
// ========== ==========
const queryParams = reactive({
@ -264,13 +267,12 @@ onMounted(async () => {
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="上级菜单">
<el-cascader
:options="menuData"
:props="menuProps"
placeholder="请选择上级菜单"
<el-tree-select
node-key="id"
v-model="menuForm.parentId"
class="w-100"
clearable
:props="menuProps"
:data="menuData"
check-strictly
/>
</el-form-item>
</el-col>

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref, unref } from 'vue'
import dayjs from 'dayjs'
import { ElMessage, ElImage } from 'element-plus'
import { ElMessage, ElImage, ElTag } from 'element-plus'
import { DICT_TYPE } from '@/utils/dict'
import { useTable } from '@/hooks/web/useTable'
import { useI18n } from '@/hooks/web/useI18n'
@ -118,6 +118,16 @@ getList()
<template #status="{ row }">
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
</template>
<template #authorizedGrantTypes="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index"
>
{{ authorizedGrantType }}
</el-tag>
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>

View File

@ -68,7 +68,7 @@ getList()
<span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span>
</template>
<template #startTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
<span>{{ dayjs(row.startTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #action="{ row }">
<el-button link type="primary" @click="handleDetail(row)">

View File

@ -41,7 +41,10 @@ const crudSchemas = reactive<CrudSchema[]>([
},
{
label: '操作人员',
field: 'userNickname'
field: 'userNickname',
search: {
show: true
}
},
{
label: '操作明细',
@ -63,40 +66,37 @@ const crudSchemas = reactive<CrudSchema[]>([
},
{
label: '操作结果',
field: 'resultCode'
field: 'resultCode',
search: {
show: true,
component: 'Select',
componentProps: {
options: [
{ label: '成功', value: true },
{ label: '失败', value: false }
]
}
}
},
{
label: '操作日期',
field: 'startTime',
form: {
show: false
}
},
{
label: '执行时长',
field: 'duration'
},
{
label: '操作日期',
field: 'daterange',
table: {
show: false
},
form: {
show: false
},
detail: {
show: false
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},
{
label: '执行时长',
field: 'duration'
},
{
label: t('table.action'),
field: 'action',

View File

@ -65,12 +65,15 @@ const crudSchemas = reactive<CrudSchema[]>([
form: {
show: false
},
detail: {
show: false
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},

View File

@ -66,26 +66,13 @@ const crudSchemas = reactive<CrudSchema[]>([
field: 'createTime',
form: {
show: false
}
},
{
label: t('common.createTime'),
field: 'daterange',
table: {
show: false
},
form: {
show: false
},
detail: {
show: false
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},

View File

@ -77,16 +77,6 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.createTime'),
field: 'createTime',
form: {
show: false
}
},
{
label: '接收时间',
field: 'daterange',
table: {
show: false
},
form: {
show: false
},
@ -94,8 +84,8 @@ const crudSchemas = reactive<CrudSchema[]>([
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},

View File

@ -77,26 +77,13 @@ const crudSchemas = reactive<CrudSchema[]>([
field: 'createTime',
form: {
show: false
}
},
{
label: t('common.createTime'),
field: 'daterange',
table: {
show: false
},
form: {
show: false
},
detail: {
show: false
},
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'daterange',
valueFormat: 'YYYY-MM-DD'
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
}
},