fix: datetimerange type error

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, unref } from 'vue' import { ref, unref } from 'vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ElMessage, ElImage } from 'element-plus' import { ElMessage, ElImage, ElTag } from 'element-plus'
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { useTable } from '@/hooks/web/useTable' import { useTable } from '@/hooks/web/useTable'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
@ -118,6 +118,16 @@ getList()
<template #status="{ row }"> <template #status="{ row }">
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" /> <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
</template> </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 }"> <template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template> </template>

View File

@ -68,7 +68,7 @@ getList()
<span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span> <span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span>
</template> </template>
<template #startTime="{ row }"> <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>
<template #action="{ row }"> <template #action="{ row }">
<el-button link type="primary" @click="handleDetail(row)"> <el-button link type="primary" @click="handleDetail(row)">

View File

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

View File

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

View File

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

View File

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

View File

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