Merge pull request #130 from gp0119/main

fix: 删除无用代码和修复一些错误
This commit is contained in:
Ah jung
2022-06-01 16:24:55 +08:00
committed by GitHub
26 changed files with 40 additions and 79 deletions

View File

@@ -5,7 +5,7 @@
<n-notification-provider>
<n-message-provider>
<MessageContent />
<slot slot="default"></slot>
<slot name="default"></slot>
</n-message-provider>
</n-notification-provider>
</n-dialog-provider>

View File

@@ -230,7 +230,6 @@
});
const { handleFormValues, initDefault } = useFormValues({
getProps,
defaultFormModel,
getSchema,
formModel,

View File

@@ -1,4 +1,4 @@
import { ComponentType } from '/types/index';
import { ComponentType } from './types/index';
/**
* @description: 生成placeholder

View File

@@ -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;
}
}

View File

@@ -41,6 +41,7 @@ export interface FormProps {
submitFunc?: () => Promise<void>;
submitOnReset?: boolean;
baseGridStyle?: CSSProperties;
collapsedRows?: number;
}
export interface FormActionType {

View File

@@ -135,22 +135,6 @@
}
}
@width: ~`Math.round(Math.random() * 100) ` px;
@left: calc(15px + `Math.round(Math.random(70)) `);
each(range(15), {
.xiaoma-@{value} {
height: (@value * 50px);
}
li:nth-child(@{index}) {
top: 50%;
left: @left;
width: @width;
height: @width;
transform: translate(-50%, -50%);
/*animation: moveToTop (Math.random(6) + 3s) ease-in-out -(Math.random(5000) / 1000s) infinite;*/
}
});
@keyframes rotate {
50% {
border-radius: 45% / 42% 38% 58% 49%;

View File

@@ -41,7 +41,7 @@
const props = defineProps({ ...basicProps });
const emit = defineEmits(['on-close', 'on-ok', 'register']);
const propsRef = ref(<Partial<ModalProps> | null>null);
const propsRef = ref<Partial<ModalProps> | null>(null);
const isModal = ref(false);
const subLoading = ref(false);

View File

@@ -1,4 +1,4 @@
import { ref, onUnmounted, unref, getCurrentInstance, watch, nextTick } from 'vue';
import { ref, unref, getCurrentInstance, watch } from 'vue';
import { isProdMode } from '@/utils/env';
import { ModalMethods, UseModalReturnType } from '../type';
import { getDynamicProps } from '@/utils';

View File

@@ -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;

View File

@@ -51,7 +51,6 @@
import { EventEnum } from '@/components/Table/src/componentMap';
import { parseISO, format } from 'date-fns';
import { Fn, LabelValueOptions } from '/#/index';
export default defineComponent({
name: 'EditableCell',

View File

@@ -34,4 +34,5 @@ export interface BasicTableProps {
actionColumn: any[];
canResize: boolean;
resizeHeightOffset: number;
loading: boolean;
}

View File

@@ -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';

View File

@@ -109,7 +109,7 @@
watch(
() => props.value,
() => {
imgList.value = props.value.map((item) => {
state.imgList = props.value.map((item) => {
return getImgUrl(item);
});
}

View File

@@ -1,24 +0,0 @@
import {
DownOutlined,
ReloadOutlined,
CloseOutlined,
VerticalRightOutlined,
VerticalLeftOutlined,
ColumnWidthOutlined,
MinusOutlined,
} from '@ant-design/icons-vue';
import { Dropdown, Tabs, Card } from 'ant-design-vue';
export default {
[Tabs.name]: Tabs,
[Tabs.TabPane.name]: Tabs.TabPane,
[Dropdown.name]: Dropdown,
[Card.name]: Card,
MinusOutlined,
DownOutlined,
ReloadOutlined,
CloseOutlined,
VerticalRightOutlined,
VerticalLeftOutlined,
ColumnWidthOutlined,
};

View File

@@ -37,6 +37,8 @@ const setting = {
mixMenu: false,
//触发移动端侧边栏的宽度
mobileWidth: 800,
// 折叠菜单
collapsed: false,
},
//面包屑
crumbsSetting: {

View File

@@ -1,6 +1,5 @@
import { defineStore } from 'pinia';
import { RouteLocationNormalized } from 'vue-router';
import { TABS_ROUTES } from '../mutation-types';
// 不需要出现在标签页中的路由
const whiteList = ['Redirect', 'login'];

View File

@@ -11,7 +11,7 @@
title="项目信息"
class="mt-4 proCard"
size="small"
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
>
<n-descriptions bordered label-placement="left" class="py-2">
<n-descriptions-item label="版本">
@@ -56,7 +56,7 @@
title="开发环境依赖"
class="mt-4 proCard"
size="small"
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
>
<n-descriptions bordered label-placement="left" class="py-2">
<n-descriptions-item v-for="item in devSchema" :key="item.field" :label="item.field">
@@ -70,7 +70,7 @@
title="生产环境依赖"
class="mt-4 proCard"
size="small"
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
>
<n-descriptions bordered label-placement="left" class="py-2">
<n-descriptions-item v-for="item in schema" :key="item.field" :label="item.field">

View File

@@ -18,7 +18,7 @@
<n-grid-item>
<NCard
title="需求池"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>
@@ -45,7 +45,7 @@
<n-grid-item>
<NCard
title="开发中"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>
@@ -72,7 +72,7 @@
<n-grid-item>
<NCard
title="已完成"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>
@@ -98,7 +98,7 @@
<n-grid-item>
<NCard
title="已验收"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>

View File

@@ -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',

View File

@@ -259,7 +259,7 @@
function lightOkModal() {
lightCloseModal();
lightSetSubLoading();
lightSetSubLoading(false);
}
function showLightModal() {

View File

@@ -5,7 +5,7 @@
<n-grid-item>
<NCard
title="访问量"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>
@@ -54,7 +54,7 @@
<n-grid-item>
<NCard
title="销售额"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>
@@ -97,7 +97,7 @@
<n-grid-item>
<NCard
title="订单量"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>
@@ -146,7 +146,7 @@
<n-grid-item>
<NCard
title="成交额"
:segmented="{ content: 'hard', footer: 'hard' }"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false"
>

View File

@@ -36,7 +36,7 @@
<n-grid class="mt-4" cols="2 s:1 m:1 l:2 xl:2 2xl:2" responsive="screen" :x-gap="12" :y-gap="9">
<n-gi>
<n-card
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
content-style="padding: 0;"
:bordered="false"
size="small"
@@ -145,7 +145,7 @@
</n-card>
<n-card
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
content-style="padding-top: 0;padding-bottom: 0;"
:bordered="false"
size="small"
@@ -221,7 +221,7 @@
</n-gi>
<n-gi>
<n-card
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
content-style="padding: 0;"
:bordered="false"
size="small"
@@ -290,7 +290,7 @@
</n-card>
</div>
</n-card>
<n-card :segmented="{ content: 'hard' }" :bordered="false" size="small" class="mt-4">
<n-card :segmented="{ content: true }" :bordered="false" size="small" class="mt-4">
<img src="~@/assets/images/Business.svg" class="w-full" />
</n-card>
</n-gi>

View File

@@ -10,7 +10,7 @@
title="基本信息"
class="mt-4 proCard"
size="small"
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
>
<n-descriptions label-placement="left" class="py-2">
<n-descriptions-item>
@@ -31,7 +31,7 @@
title="其它信息"
class="mt-4 proCard"
size="small"
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
>
<n-descriptions label-placement="left" class="py-2">
<n-descriptions-item>
@@ -52,7 +52,7 @@
title="表格信息"
class="mt-4 proCard"
size="small"
:segmented="{ content: 'hard' }"
:segmented="{ content: true }"
>
<n-table :bordered="false" :single-line="false">
<thead>

View File

@@ -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: '这是一个提示',

View File

@@ -3,7 +3,7 @@
<div class="n-layout-page-header">
<n-card :bordered="false" title="基础详情"> 基础详情有时也用于显示只读信息 </n-card>
</div>
<n-card :bordered="false" class="proCard mt-4" size="small" :segmented="{ content: 'hard' }">
<n-card :bordered="false" class="proCard mt-4" size="small" :segmented="{ content: true }">
<n-descriptions label-placement="left" class="py-2">
<n-descriptions-item>
<template #label>收款人姓名</template>

View File

@@ -7,7 +7,7 @@
</div>
<n-grid class="mt-4" cols="1 s:1 m:1 l:3 xl:3 2xl:3" responsive="screen" :x-gap="12">
<n-gi span="1">
<n-card :segmented="{ content: 'hard' }" :bordered="false" size="small">
<n-card :segmented="{ content: true }" :bordered="false" size="small">
<template #header>
<n-space>
<n-dropdown trigger="hover" @select="selectAddMenu" :options="addMenuOptions">
@@ -67,7 +67,7 @@
</n-card>
</n-gi>
<n-gi span="2">
<n-card :segmented="{ content: 'hard' }" :bordered="false" size="small">
<n-card :segmented="{ content: true }" :bordered="false" size="small">
<template #header>
<n-space>
<n-icon size="18">