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