diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..99d9ef62f --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,18 @@ +name: "Close stale issues" + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.OPER_TOKEN }} + stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days' + stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days' + exempt-issue-labels: 'bug,enhancement' + days-before-stale: 60 + days-before-close: 7 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 97cc1f8a2..17e29a137 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -9,5 +9,6 @@ "antfu.iconify", "antfu.unocss", "mikestead.dotenv", + "warmthsea.vscode-custom-code-color", ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 0d366fb0e..3238cffdd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -108,7 +108,11 @@ "i18n-ally.sortKeys": true, "i18n-ally.namespace": true, "i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}", - "i18n-ally.enabledParsers": ["json","ts","js"], + "i18n-ally.enabledParsers": [ + "json", + "ts", + "js" + ], "i18n-ally.sourceLanguage": "en", "i18n-ally.displayLanguage": "zh-CN", "i18n-ally.enabledFrameworks": [ @@ -182,5 +186,7 @@ ".eslintrc.cjs": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,.stylelintrc.*" }, "terminal.integrated.scrollback": 10000, - "nuxt.isNuxtApp": false -} + "nuxt.isNuxtApp": false, + "vscodeCustomCodeColor.highlightValue": "v-auth", + "vscodeCustomCodeColor.highlightValueColor": "#6366f1", +} \ No newline at end of file diff --git a/src/components/Modal/src/index.less b/src/components/Modal/src/index.less index 027556be8..10fc76833 100644 --- a/src/components/Modal/src/index.less +++ b/src/components/Modal/src/index.less @@ -1,3 +1,5 @@ +@prefix-cls: ~'@{namespace}-basic-modal-wrap'; + .fullscreen-modal { overflow: hidden; @@ -18,103 +20,105 @@ } } -.ant-modal { - width: 520px; - padding-bottom: 0; +.@{prefix-cls} { + .ant-modal { + width: 520px; + padding-bottom: 0; - .ant-modal-body > .scrollbar { - padding: 14px; - } + .ant-modal-body > .scrollbar { + padding: 14px; + } - &-title { - font-size: 16px; - font-weight: bold; + &-title { + font-size: 16px; + font-weight: bold; - .base-title { - cursor: move !important; + .base-title { + cursor: move !important; + } } - } - .ant-modal-body { - padding: 0; + .ant-modal-body { + padding: 0; - > .scrollbar > .scrollbar__bar.is-horizontal { - display: none; + > .scrollbar > .scrollbar__bar.is-horizontal { + display: none; + } } - } - &-large { - top: 60px; + &-large { + top: 60px; - &--mini { - top: 16px; + &--mini { + top: 16px; + } } - } - &-header { - padding: 16px; - border-bottom: 1px solid @border-color-base; - } + &-header { + padding: 16px; + border-bottom: 1px solid @border-color-base; + } - &-content { - padding: 0 !important; - box-shadow: - 0 4px 8px 0 rgb(0 0 0 / 20%), - 0 6px 20px 0 rgb(0 0 0 / 19%); - } + &-content { + padding: 0 !important; + box-shadow: + 0 4px 8px 0 rgb(0 0 0 / 20%), + 0 6px 20px 0 rgb(0 0 0 / 19%); + } - &-footer { - padding: 10px 16px; - border-top: 1px solid @border-color-base; + &-footer { + padding: 10px 16px; + border-top: 1px solid @border-color-base; - button + button { - margin-left: 10px; + button + button { + margin-left: 10px; + } } - } - &-close { - top: 0 !important; - right: 0 !important; - width: auto !important; - outline: none; - background: transparent !important; - font-weight: normal; - } + &-close { + top: 0 !important; + right: 0 !important; + width: auto !important; + outline: none; + background: transparent !important; + font-weight: normal; + } - &-close-x { - display: inline-block; - width: 96px; - height: 56px; - line-height: 56px !important; - } + &-close-x { + display: inline-block; + width: 96px; + height: 56px; + line-height: 56px !important; + } - &-confirm-body { - .ant-modal-confirm-content { - > * { - color: @text-color-help-dark; + &-confirm-body { + .ant-modal-confirm-content { + > * { + color: @text-color-help-dark; + } } } - } - &-confirm-confirm.error .ant-modal-confirm-body > .anticon { - color: @error-color; - } + &-confirm-confirm.error .ant-modal-confirm-body > .anticon { + color: @error-color; + } - &-confirm-btns { - .ant-btn:last-child { - margin-right: 0; + &-confirm-btns { + .ant-btn:last-child { + margin-right: 0; + } } - } - &-confirm-info { - .ant-modal-confirm-body > .anticon { - color: @warning-color; + &-confirm-info { + .ant-modal-confirm-body > .anticon { + color: @warning-color; + } } - } - &-confirm-confirm.success { - .ant-modal-confirm-body > .anticon { - color: @success-color; + &-confirm-confirm.success { + .ant-modal-confirm-body > .anticon { + color: @success-color; + } } } } diff --git a/src/components/Table/src/BasicTable.vue b/src/components/Table/src/BasicTable.vue index 174d6d971..943b98d3b 100644 --- a/src/components/Table/src/BasicTable.vue +++ b/src/components/Table/src/BasicTable.vue @@ -144,6 +144,7 @@ getDataSourceRef, getDataSource, getRawDataSource, + getSearchInfo, setTableData, updateTableDataRecord, deleteTableDataRecord, @@ -300,6 +301,7 @@ setLoading, getDataSource, getRawDataSource, + getSearchInfo, setProps, getRowSelection, getPaginationRef: getPagination, diff --git a/src/components/Table/src/hooks/useDataSource.ts b/src/components/Table/src/hooks/useDataSource.ts index aa6a85f3c..f5da7d45c 100644 --- a/src/components/Table/src/hooks/useDataSource.ts +++ b/src/components/Table/src/hooks/useDataSource.ts @@ -50,6 +50,7 @@ export function useDataSource( }); const dataSourceRef = ref([]); const rawDataSourceRef = ref({}); + const searchInfoRef = ref({}); watchEffect(() => { tableData.value = unref(dataSourceRef); @@ -275,7 +276,7 @@ export function useDataSource( if (beforeFetch && isFunction(beforeFetch)) { params = (await beforeFetch(params)) || params; } - + searchInfoRef.value = params; const res = await api(params); rawDataSourceRef.value = res; @@ -339,6 +340,10 @@ export function useDataSource( return await fetch(opt); } + function getSearchInfo() { + return searchInfoRef.value as T; + } + onMounted(() => { useTimeoutFn(() => { unref(propsRef).immediate && fetch(); @@ -349,6 +354,8 @@ export function useDataSource( getDataSourceRef, getDataSource, getRawDataSource, + searchInfoRef, + getSearchInfo, getRowKey, setTableData, getAutoCreateKey, diff --git a/src/components/Table/src/hooks/useTable.ts b/src/components/Table/src/hooks/useTable.ts index 196eecd94..1e353ab03 100644 --- a/src/components/Table/src/hooks/useTable.ts +++ b/src/components/Table/src/hooks/useTable.ts @@ -89,6 +89,9 @@ export function useTable(tableProps?: Props): [ getRawDataSource: () => { return getTableInstance().getRawDataSource(); }, + getSearchInfo: () => { + return getTableInstance().getSearchInfo(); + }, getColumns: ({ ignoreIndex = false }: { ignoreIndex?: boolean } = {}) => { const columns = getTableInstance().getColumns({ ignoreIndex }) || []; return toRaw(columns); diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts index ed268f178..653b736b0 100644 --- a/src/components/Table/src/types/table.ts +++ b/src/components/Table/src/types/table.ts @@ -114,6 +114,7 @@ export interface TableActionType { setColumns: (columns: BasicColumn[] | string[]) => void; getDataSource: () => T[]; getRawDataSource: () => T; + getSearchInfo: () => T; setLoading: (loading: boolean) => void; setProps: (props: Partial) => void; redoHeight: () => void; diff --git a/src/components/Tree/src/types/tree.ts b/src/components/Tree/src/types/tree.ts index 541b336a5..6a4fc3642 100644 --- a/src/components/Tree/src/types/tree.ts +++ b/src/components/Tree/src/types/tree.ts @@ -91,6 +91,7 @@ export const treeProps = buildProps({ expandedKeys: { type: Array as PropType, + default: () => [], }, selectedKeys: { diff --git a/src/directives/permission.ts b/src/directives/permission.ts index 582566f0f..5f6fcf98b 100644 --- a/src/directives/permission.ts +++ b/src/directives/permission.ts @@ -8,6 +8,7 @@ import type { App, Directive, DirectiveBinding } from 'vue'; import { usePermission } from '@/hooks/web/usePermission'; import { unref } from 'vue'; import { NoPermissionModeEnum } from '@/enums/appEnum'; +import { RoleEnum } from '@/enums/roleEnum'; function isAuth(el: Element, binding: any) { const { hasPermission } = usePermission(); @@ -19,7 +20,7 @@ function isAuth(el: Element, binding: any) { } } -const mounted = (el: Element, binding: DirectiveBinding) => { +const mounted = (el: Element, binding: DirectiveBinding) => { isAuth(el, binding); }; diff --git a/src/views/demo/system/account/index.vue b/src/views/demo/system/account/index.vue index fd406acba..86e0dbc1e 100644 --- a/src/views/demo/system/account/index.vue +++ b/src/views/demo/system/account/index.vue @@ -4,6 +4,7 @@