diff --git a/.prettierrc b/.prettierrc index 7f81539..4da0e9f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "tabWidth": 2, - "printWidth": 120, + "printWidth": 180, "bracketSpacing": true, "singleQuote": true, "arrowParens": "avoid" diff --git a/package.json b/package.json index 26ec3b1..b170dc0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "starter-vue", "private": true, - "version": "0.0.0", + "version": "0.0.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src/api/instance/api.ts b/src/api/instance/api.ts index fa9558a..90e6151 100644 --- a/src/api/instance/api.ts +++ b/src/api/instance/api.ts @@ -22,8 +22,8 @@ addToastInterceptor(api.instance); * 添加异常处理拦截器 */ addExceptionInterceptor(api.instance, () => api.expireHandler?.()); + /** * 添加登陆令牌拦截器 */ addAuthInterceptor(api.instance); - diff --git a/src/api/instance/service.ts b/src/api/instance/service.ts index 3664394..9e2b504 100644 --- a/src/api/instance/service.ts +++ b/src/api/instance/service.ts @@ -1,3 +1,4 @@ +import { App } from 'vue'; import { Api } from '../generated/Api'; /** @@ -9,4 +10,12 @@ export class Service extends Api { * @description 勿动 */ expireHandler: () => void = () => {}; + + /** + * 作为VUE插件进行初始化 + * @param app + */ + install(app: App) { + app.config.globalProperties.$api = this; + } } diff --git a/src/components/AnBreadcrumb/bread-page.vue b/src/components/AnBreadcrumb/bread-page.vue index dd06f38..e5b4245 100644 --- a/src/components/AnBreadcrumb/bread-page.vue +++ b/src/components/AnBreadcrumb/bread-page.vue @@ -5,11 +5,6 @@
需要帮助? - - -
diff --git a/src/components/AnTable/components/Table.tsx b/src/components/AnTable/components/Table.tsx index c23da3d..a84daed 100644 --- a/src/components/AnTable/components/Table.tsx +++ b/src/components/AnTable/components/Table.tsx @@ -1,12 +1,4 @@ -import { - AnForm, - AnFormInstance, - AnFormModal, - AnFormModalInstance, - AnFormModalProps, - AnFormProps, - getModel, -} from '@/components/AnForm'; +import { AnForm, AnFormInstance, AnFormModal, AnFormModalInstance, AnFormModalProps, AnFormProps, getModel } from '@/components/AnForm'; import AnEmpty from '@/components/AnEmpty/AnEmpty.vue'; import { Button, PaginationProps, Table, TableColumnData, TableData, TableInstance } from '@arco-design/web-vue'; import { isArray, isFunction, merge } from 'lodash-es'; @@ -14,14 +6,8 @@ import { InjectionKey, PropType, Ref, VNodeChild, defineComponent, ref } from 'v import { PluginContainer } from '../hooks/useTablePlugin'; type DataFn = (filter: { page: number; size: number; [key: string]: any }) => any | Promise; - -export type ArcoTableProps = Omit< - TableInstance['$props'], - 'ref' | 'pagination' | 'loading' | 'data' | 'onPageChange' | 'onPageSizeChange' ->; - +export type ArcoTableProps = Omit; export const AnTableContextKey = Symbol('AnTableContextKey') as InjectionKey; - export type TableColumnRender = (data: { record: TableData; column: TableColumnData; rowIndex: number }) => VNodeChild; /** @@ -207,9 +193,7 @@ export const AnTable = defineComponent({
{this.create && } - {this.modify && ( - - )} + {this.modify && } {this.$slots.action?.(this.renderData)} {this.pluginer?.actions && (
@@ -220,12 +204,7 @@ export const AnTable = defineComponent({ )} {this.search && (
- + {{ submit: () => (