Skip to content

Commit

Permalink
fix: remove useModal.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Dec 28, 2021
1 parent 84d85b9 commit 24dff4e
Show file tree
Hide file tree
Showing 13 changed files with 1,076 additions and 1,137 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: deploy

name: syncToGitee
env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144

on:
push:
branches: [main]

jobs:
deploy:
repo-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -33,3 +30,28 @@ jobs:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
commit_message: Update ghPages
force_orphan: true

- name: Mirror the Github organization repos to Gitee.
uses: Yikun/hub-mirror-action@master
with:
src: 'github/buqiyuan'
dst: 'gitee/buqiyuan'
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
static_list: 'vue3-antd-admin'
force_update: true
debug: true

- name: Build Gitee Pages
uses: yanglbme/gitee-pages-action@main
with:
# 注意替换为你的 Gitee 用户名
gitee-username: buqiyuan
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD
gitee-password: ${{ secrets.GITEE_PASSWORD }}
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
gitee-repo: buqiyuan/vue3-antd-admin
# 是否强制使用 HTTPS
https: false
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
branch: gh-pages
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,38 @@
"test prod gzip": "http-server dist --cors --gzip -c-1"
},
"dependencies": {
"@vueuse/core": "^7.4.0",
"ant-design-vue": "3.0.0-alpha.15",
"@vueuse/core": "^7.4.1",
"ant-design-vue": "3.0.0-beta.3",
"axios": "^0.24.0",
"core-js": "^3.20.0",
"core-js": "^3.20.1",
"dayjs": "^1.10.7",
"lodash": "^4.17.21",
"mitt": "^3.0.0",
"mockjs": "^1.1.0",
"nprogress": "^1.0.0-1",
"pinia": "2.0.8",
"pinia": "2.0.9",
"qs": "^6.10.2",
"socket.io-client": "4.4.0",
"sortablejs": "^1.14.0",
"vue": "^3.2.26",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.3",
"@types/node": "^17.0.5",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"@vue/cli-plugin-babel": "^5.0.0-rc.1",
"@vue/cli-plugin-eslint": "^5.0.0-rc.1",
"@vue/cli-plugin-router": "^5.0.0-rc.1",
"@vue/cli-plugin-typescript": "^5.0.0-rc.1",
"@vue/cli-plugin-vuex": "^5.0.0-rc.1",
"@vue/cli-service": "^5.0.0-rc.1",
"@vue/compiler-sfc": "^3.2.26",
"@vue/eslint-config-typescript": "^9.1.0",
"@vue/eslint-config-typescript": "^10.0.0",
"babel-plugin-import": "^1.13.3",
"babel-plugin-lodash": "^3.3.4",
"commitizen": "^4.2.4",
Expand All @@ -60,9 +61,8 @@
"husky": "^7.0.4",
"less": "^4.1.2",
"less-loader": "10.2.0",
"lint-staged": "^12.1.3",
"lint-staged": "^12.1.4",
"lodash-webpack-plugin": "^0.11.6",
"mockjs": "^1.1.0",
"path-browserify": "^1.0.1",
"postcss-html": "^1.3.0",
"prettier": "^2.5.1",
Expand Down Expand Up @@ -109,7 +109,7 @@
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"stylelint --fix",
"stylelint --allow-empty-input",
"prettier --write"
],
"*.md": [
Expand Down
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<meta name="referrer" content="no-referrer" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<script src="<%= BASE_URL %>iconfont.js"></script>
</head>
<body>
<noscript>
Expand Down
16 changes: 0 additions & 16 deletions src/api/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,3 @@ export function getImageCaptcha(params?: API.CaptchaParams) {
params,
});
}

/**
* @description 登出
*/
export function logout(data: { token: string }) {
return request<BaseResponse>(
{
url: 'account/logout',
method: 'post',
data,
},
{
isGetDataDirectly: false,
},
);
}
3 changes: 3 additions & 0 deletions src/components/a-custom-modal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@
.ant-modal {
position: fixed;
padding: 0;
min-height: 200px;
min-width: 200px;
.ant-modal-close {
top: 6px;
right: 6px;
Expand Down Expand Up @@ -308,6 +310,7 @@
min-width: 200px;
overflow: hidden;
.ant-modal-body {
flex: auto;
overflow: auto;
height: 100%;
}
Expand Down
9 changes: 6 additions & 3 deletions src/components/iconfont/icon-font.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { defineComponent, PropType, unref, computed } from 'vue';
import { createFromIconfontCN } from '@ant-design/icons-vue';
import { isString } from '@/utils/is';

let scriptUrls = [`${process.env.BASE_URL}iconfont.js`];

let MyIconFont = createFromIconfontCN({
// scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js',
// scriptUrl: '//at.alicdn.com/t/font_2184398_zflo1kjcemp.js',
// iconfont字体图标本地化,详见:/public/iconfont.js
scriptUrl: '',
scriptUrl: scriptUrls,
});

export default defineComponent({
Expand All @@ -30,15 +32,16 @@ export default defineComponent({
},
scriptUrl: {
// 阿里图库字体图标路径
type: String as PropType<string>,
type: String as PropType<string | string[]>,
default: '',
},
},
setup(props, { attrs }) {
// 如果外部传进来字体图标路径,则覆盖默认的
if (props.scriptUrl) {
scriptUrls = [...new Set(scriptUrls.concat(props.scriptUrl))];
MyIconFont = createFromIconfontCN({
scriptUrl: props.scriptUrl,
scriptUrl: scriptUrls,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/icons-select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div
:title="iconItem.name"
class="select-box-item"
:class="{ active: modelValue == iconItem.font_class }"
:class="{ active: modelValue?.replace('icon-', '') == iconItem.font_class }"
@click="selectIcon(iconItem)"
>
<icon-font :type="iconItem.font_class" size="20" />
Expand Down
105 changes: 0 additions & 105 deletions src/hooks/useModal.tsx

This file was deleted.

6 changes: 4 additions & 2 deletions src/router/generator-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ export function filterAsyncRoute(
// 如果是页面
const Component = constantRouterComponents[viewPath] || NotFound;
route.component = Component;
const perms = routes.filter((n) => n.parentId === item.id).map((n) => n.perms?.split(','));
const perms = routes
.filter((n) => n.parentId === item.id)
.flatMap((n) => n.perms?.split(','));
if (route.meta && perms) {
// 设置当前页面所拥有的权限
route.meta.perms = perms.flat(Infinity) as string[];
route.meta.perms = perms;
}
return route;
}
Expand Down
18 changes: 16 additions & 2 deletions src/views/shared/demos/custom-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,37 @@
style="margin-bottom: 12px"
/>
<a-card>
<a-button type="primary" @click="state.visible = true">弹出弹窗</a-button>
<Space>
<a-button type="primary" @click="state.visible = true">弹出弹窗</a-button>
<a-button type="primary" @click="handleOpenModal">函数式调用弹窗</a-button>
</Space>
</a-card>
<CustomAModal v-model:visible="state.visible" @ok="onOk" />
</div>
</template>

<script setup lang="ts">
import { reactive } from 'vue';
import { Alert } from 'ant-design-vue';
import { Alert, Space } from 'ant-design-vue';
import { CustomAModal } from '@/components/a-custom-modal';
import { useModal } from '@/hooks/useModal/';
/**
* @description 扩展ant-design-vue模态框功能
*/
const fnModal = useModal();
const state = reactive({
visible: false,
});
const handleOpenModal = () => {
fnModal.show({
title: '我是标题',
content: 'hello',
});
};
const onOk = () => {
state.visible = false;
};
Expand Down
6 changes: 6 additions & 0 deletions src/views/shared/demos/form/basic-form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
</div>
</template>

<script lang="ts">
export default {
name: 'DemosFormBasicForm',
};
</script>

<script lang="ts" setup>
import { ref } from 'vue';
import { Alert, message } from 'ant-design-vue';
Expand Down
6 changes: 6 additions & 0 deletions src/views/shared/demos/form/rule-form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
</div>
</template>

<script lang="ts">
export default {
name: 'DemosFormRuleForm',
};
</script>

<script lang="ts" setup>
import { ref } from 'vue';
import { Alert, message } from 'ant-design-vue';
Expand Down
Loading

0 comments on commit 24dff4e

Please sign in to comment.