fix: 修复已知BUG
This commit is contained in:
parent
772e2439fa
commit
782b8e2f94
|
@ -107,7 +107,13 @@ const toggleClick = () => {
|
||||||
v-bind="getBindItemValue(item)"
|
v-bind="getBindItemValue(item)"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<slot :name="`${item.field}-label`" :label="item.label">{{ item.label }}</slot>
|
<slot
|
||||||
|
:name="`${item.field}-label`"
|
||||||
|
:row="{
|
||||||
|
label: item.label
|
||||||
|
}"
|
||||||
|
>{{ item.label }}</slot
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #default>
|
<template #default>
|
||||||
|
|
|
@ -412,7 +412,10 @@ watch(
|
||||||
{
|
{
|
||||||
icon: 'ant-design:close-outlined',
|
icon: 'ant-design:close-outlined',
|
||||||
label: t('common.closeTab'),
|
label: t('common.closeTab'),
|
||||||
disabled: !!visitedViews?.length && selectedTag?.meta.affix
|
disabled: !!visitedViews?.length && selectedTag?.meta.affix,
|
||||||
|
command: () => {
|
||||||
|
closeSelectedTag(selectedTag!)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
divided: true,
|
divided: true,
|
||||||
|
|
|
@ -214,7 +214,6 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
|
||||||
for (const task of formRequestTask) {
|
for (const task of formRequestTask) {
|
||||||
task()
|
task()
|
||||||
}
|
}
|
||||||
console.log(formSchema)
|
|
||||||
return formSchema
|
return formSchema
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +242,7 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[
|
||||||
|
|
||||||
// 给options添加国际化
|
// 给options添加国际化
|
||||||
const filterOptions = (options: Recordable, labelField?: string) => {
|
const filterOptions = (options: Recordable, labelField?: string) => {
|
||||||
return options.map((v: Recordable) => {
|
return options?.map((v: Recordable) => {
|
||||||
if (labelField) {
|
if (labelField) {
|
||||||
v['labelField'] = t(v.labelField)
|
v['labelField'] = t(v.labelField)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -30,11 +30,6 @@ router.beforeEach(async (to, from, next) => {
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
} else {
|
} else {
|
||||||
if (permissionStore.getIsAddRouters) {
|
|
||||||
next()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dictStore.getIsSetDict) {
|
if (!dictStore.getIsSetDict) {
|
||||||
// 获取所有字典
|
// 获取所有字典
|
||||||
const res = await getDictApi()
|
const res = await getDictApi()
|
||||||
|
@ -43,6 +38,10 @@ router.beforeEach(async (to, from, next) => {
|
||||||
dictStore.setIsSetDict(true)
|
dictStore.setIsSetDict(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (permissionStore.getIsAddRouters) {
|
||||||
|
next()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 开发者可根据实际情况进行修改
|
// 开发者可根据实际情况进行修改
|
||||||
const roleRouters = wsCache.get('roleRouters') || []
|
const roleRouters = wsCache.get('roleRouters') || []
|
||||||
|
|
|
@ -82,20 +82,20 @@ const formValidation = () => {
|
||||||
|
|
||||||
<Form is-custom :model="form" :rules="rules" @register="register">
|
<Form is-custom :model="form" :rules="rules" @register="register">
|
||||||
<Descriptions :title="t('descriptionsDemo.form')" :data="data" :schema="schema" class="mt-20px">
|
<Descriptions :title="t('descriptionsDemo.form')" :data="data" :schema="schema" class="mt-20px">
|
||||||
<template #username-label="{ row: scope }">
|
<template #username-label="{ row }">
|
||||||
<span class="is-required--item">{{ scope.label }}</span>
|
<span class="is-required--item">{{ row.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #nickName-label="{ row: scope }">
|
<template #nickName-label="{ row }">
|
||||||
<span class="is-required--item">{{ scope.label }}</span>
|
<span class="is-required--item">{{ row.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #phone-label="{ row: scope }">
|
<template #phone-label="{ row }">
|
||||||
<span class="is-required--item">{{ scope.label }}</span>
|
<span class="is-required--item">{{ row.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #email-label="{ row: scope }">
|
<template #email-label="{ row }">
|
||||||
<span class="is-required--item">{{ scope.label }}</span>
|
<span class="is-required--item">{{ row.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #addr-label="{ row: scope }">
|
<template #addr-label="{ row }">
|
||||||
<span class="is-required--item">{{ scope.label }}</span>
|
<span class="is-required--item">{{ row.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #username>
|
<template #username>
|
||||||
|
|
|
@ -21,6 +21,22 @@ const { getList } = methods
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
|
|
||||||
|
const {
|
||||||
|
register: register2,
|
||||||
|
tableObject: tableObject2,
|
||||||
|
methods: methods2
|
||||||
|
} = useTable<TableData>({
|
||||||
|
getListApi: getTableListApi,
|
||||||
|
response: {
|
||||||
|
list: 'list',
|
||||||
|
total: 'total'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { getList: getList2 } = methods2
|
||||||
|
|
||||||
|
getList2()
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const columns = reactive<TableColumn[]>([
|
const columns = reactive<TableColumn[]>([
|
||||||
|
@ -178,4 +194,30 @@ const selectAllNone = () => {
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
|
<ContentWrap :title="`UseTable 2 ${t('tableDemo.example')}`">
|
||||||
|
<Table
|
||||||
|
v-model:pageSize="tableObject2.pageSize"
|
||||||
|
v-model:currentPage="tableObject2.currentPage"
|
||||||
|
:columns="columns"
|
||||||
|
:data="tableObject2.tableList"
|
||||||
|
:loading="tableObject2.loading"
|
||||||
|
:pagination="paginationObj"
|
||||||
|
@register="register2"
|
||||||
|
>
|
||||||
|
<template #action="data">
|
||||||
|
<ElButton type="primary" @click="actionFn(data as TableSlotDefault)">
|
||||||
|
{{ t('tableDemo.action') }}
|
||||||
|
</ElButton>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #expand="data">
|
||||||
|
<div class="ml-30px">
|
||||||
|
<div>{{ t('tableDemo.title') }}:{{ data.row.title }}</div>
|
||||||
|
<div>{{ t('tableDemo.author') }}:{{ data.row.author }}</div>
|
||||||
|
<div>{{ t('tableDemo.displayTime') }}:{{ data.row.display_time }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Table>
|
||||||
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue