mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
fix: 修复ts类型错误
This commit is contained in:
@@ -46,10 +46,10 @@ export function useFormEvents({
|
|||||||
await validate();
|
await validate();
|
||||||
loadingSub.value = false;
|
loadingSub.value = false;
|
||||||
emit('submit', formModel);
|
emit('submit', formModel);
|
||||||
return true;
|
return;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
loadingSub.value = false;
|
loadingSub.value = false;
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export interface FormProps {
|
|||||||
submitFunc?: () => Promise<void>;
|
submitFunc?: () => Promise<void>;
|
||||||
submitOnReset?: boolean;
|
submitOnReset?: boolean;
|
||||||
baseGridStyle?: CSSProperties;
|
baseGridStyle?: CSSProperties;
|
||||||
|
collapsedRows?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FormActionType {
|
export interface FormActionType {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
const getDropdownList = computed(() => {
|
const getDropdownList = computed(() => {
|
||||||
return (toRaw(props.dropDownActions) || [])
|
return (toRaw(props.dropDownActions) || [])
|
||||||
.filter((action) => {
|
.filter((action) => {
|
||||||
return hasPermission(action.auth) && isIfShow(action);
|
return hasPermission(action.auth as string[]) && isIfShow(action);
|
||||||
})
|
})
|
||||||
.map((action) => {
|
.map((action) => {
|
||||||
const { popConfirm } = action;
|
const { popConfirm } = action;
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
const getActions = computed(() => {
|
const getActions = computed(() => {
|
||||||
return (toRaw(props.actions) || [])
|
return (toRaw(props.actions) || [])
|
||||||
.filter((action) => {
|
.filter((action) => {
|
||||||
return hasPermission(action.auth) && isIfShow(action);
|
return hasPermission(action.auth as string[]) && isIfShow(action);
|
||||||
})
|
})
|
||||||
.map((action) => {
|
.map((action) => {
|
||||||
const { popConfirm } = action;
|
const { popConfirm } = action;
|
||||||
|
|||||||
@@ -34,4 +34,5 @@ export interface BasicTableProps {
|
|||||||
actionColumn: any[];
|
actionColumn: any[];
|
||||||
canResize: boolean;
|
canResize: boolean;
|
||||||
resizeHeightOffset: number;
|
resizeHeightOffset: number;
|
||||||
|
loading: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NButton } from 'naive-ui';
|
import { NButton } from 'naive-ui';
|
||||||
import { PermissionsEnum } from '@/enums/permissionsEnum';
|
import { PermissionsEnum } from '@/enums/permissionsEnum';
|
||||||
export interface ActionItem extends NButton.props {
|
export interface ActionItem extends Partial<InstanceType<typeof NButton>> {
|
||||||
onClick?: Fn;
|
onClick?: Fn;
|
||||||
label?: string;
|
label?: string;
|
||||||
color?: 'success' | 'error' | 'warning';
|
color?: 'success' | 'error' | 'warning';
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ const setting = {
|
|||||||
mixMenu: false,
|
mixMenu: false,
|
||||||
//触发移动端侧边栏的宽度
|
//触发移动端侧边栏的宽度
|
||||||
mobileWidth: 800,
|
mobileWidth: 800,
|
||||||
|
// 折叠菜单
|
||||||
|
collapsed: false,
|
||||||
},
|
},
|
||||||
//面包屑
|
//面包屑
|
||||||
crumbsSetting: {
|
crumbsSetting: {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { BasicForm, useForm } from '@/components/Form/index';
|
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
||||||
import { useMessage } from 'naive-ui';
|
import { useMessage } from 'naive-ui';
|
||||||
|
|
||||||
const schemas = [
|
const schemas: FormSchema[] = [
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
component: 'NInput',
|
component: 'NInput',
|
||||||
|
|||||||
@@ -259,7 +259,7 @@
|
|||||||
|
|
||||||
function lightOkModal() {
|
function lightOkModal() {
|
||||||
lightCloseModal();
|
lightCloseModal();
|
||||||
lightSetSubLoading();
|
lightSetSubLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLightModal() {
|
function showLightModal() {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
import { h, reactive, ref } from 'vue';
|
import { h, reactive, ref } from 'vue';
|
||||||
import { useMessage } from 'naive-ui';
|
import { useMessage } from 'naive-ui';
|
||||||
import { BasicTable, TableAction } from '@/components/Table';
|
import { BasicTable, TableAction } from '@/components/Table';
|
||||||
import { BasicForm, useForm } from '@/components/Form/index';
|
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
||||||
import { getTableList } from '@/api/table/list';
|
import { getTableList } from '@/api/table/list';
|
||||||
import { columns } from './columns';
|
import { columns } from './columns';
|
||||||
import { PlusOutlined } from '@vicons/antd';
|
import { PlusOutlined } from '@vicons/antd';
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const schemas = [
|
const schemas: FormSchema[] = [
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
labelMessage: '这是一个提示',
|
labelMessage: '这是一个提示',
|
||||||
|
|||||||
Reference in New Issue
Block a user