-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
152 changed files
with
1,645 additions
and
1,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
<template> | ||
<ConfigProvider :locale="zhCN"> | ||
<ConfigProvider :locale="getAntdLocale"> | ||
<router-view v-slot="{ Component }"> | ||
<Suspense> | ||
<component :is="Component" /> | ||
</Suspense> | ||
<component :is="Component" /> | ||
</router-view> | ||
<LockScreen /> | ||
</ConfigProvider> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import zhCN from 'ant-design-vue/es/locale/zh_CN'; | ||
import { watchEffect } from 'vue'; | ||
import { ConfigProvider } from 'ant-design-vue'; | ||
// import SuspenseWithError from '@/components/SuspenseWithError.vue' | ||
import { LockScreen } from '@/components/lockscreen'; | ||
import { LockScreen } from '@/components/basic/lockscreen'; | ||
import { useRoute } from 'vue-router'; | ||
import { useLocale } from '@/locales/useLocale'; | ||
import { transformI18n } from './hooks/useI18n'; | ||
const route = useRoute(); | ||
const { getAntdLocale } = useLocale(); | ||
watchEffect(() => { | ||
if (route.meta?.title) { | ||
// 翻译网页标题 | ||
document.title = transformI18n(route.meta.title); | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="less"></style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### 基础组件(目录说明) | ||
|
||
| 组件名称 | 描述 | 是否全局组件 | 使用建议 | | ||
| --- | --- | --- | --- | | ||
| button | `按钮组件`基于 a-button 二次封装,主要扩展了按钮的颜色,基本使用方式与 antdv 的 a-button 保持一致 | 是 | -- | | ||
| check-box | `复选框`基于 a-checkbox 二次封装,基本使用方式与 antdv 的 a-checkbox 保持一致 | 否 | -- | |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ponents/button/styles/setButtonColor.less → ...s/basic/button/styles/setButtonColor.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as LocalePicker } from './index.vue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<Dropdown placement="bottomRight"> | ||
<SvgIcon name="locale" /> | ||
<span v-if="showText" class="ml-1">{{ getLocaleText }}</span> | ||
<template #overlay> | ||
<Menu v-model:selectedKeys="selectedKeys" @click="handleMenuClick"> | ||
<Menu.Item v-for="item in localeList" :key="item.lang"> | ||
<a href="javascript:;">{{ item.icon }} {{ item.label }}</a> | ||
</Menu.Item> | ||
</Menu> | ||
</template> | ||
</Dropdown> | ||
</template> | ||
<script lang="ts" setup> | ||
import { ref, watchEffect, unref, computed } from 'vue'; | ||
import { Dropdown, Menu } from 'ant-design-vue'; | ||
import { useLocale } from '@/locales/useLocale'; | ||
import { type LocaleType, localeList } from '@/locales/config'; | ||
import { SvgIcon } from '@/components/basic/svg-icon'; | ||
const props = defineProps({ | ||
/** | ||
* Whether to display text | ||
*/ | ||
showText: { type: Boolean, default: true }, | ||
/** | ||
* Whether to refresh the interface when changing | ||
*/ | ||
reload: { type: Boolean }, | ||
}); | ||
const selectedKeys = ref<string[]>([]); | ||
const { changeLocale, getLocale } = useLocale(); | ||
const getLocaleText = computed(() => { | ||
const key = selectedKeys.value[0]; | ||
if (!key) { | ||
return ''; | ||
} | ||
return localeList.find((item) => item.lang === key)?.label; | ||
}); | ||
watchEffect(() => { | ||
selectedKeys.value = [unref(getLocale)]; | ||
}); | ||
async function toggleLocale(lang: LocaleType | string) { | ||
await changeLocale(lang as LocaleType); | ||
selectedKeys.value = [lang as string]; | ||
props.reload && location.reload(); | ||
} | ||
function handleMenuClick({ key }) { | ||
if (unref(getLocale) === key) { | ||
return; | ||
} | ||
toggleLocale(key as string); | ||
} | ||
</script> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<svg v-bind="$attrs" class="svg-icon" :style="getStyle" aria-hidden="true"> | ||
<use :xlink:href="symbolId" /> | ||
</svg> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, type CSSProperties } from 'vue'; | ||
const importAll = (requireContext: __WebpackModuleApi.RequireContext) => | ||
requireContext.keys().forEach(requireContext); | ||
try { | ||
importAll(require.context('@/assets/icons', true, /\.svg$/)); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
const props = defineProps({ | ||
prefix: { | ||
type: String, | ||
default: 'icon', | ||
}, | ||
name: { | ||
type: String, | ||
required: true, | ||
}, | ||
size: { | ||
type: [Number, String], | ||
default: 16, | ||
}, | ||
}); | ||
const symbolId = computed(() => `#${props.prefix}-${props.name}`); | ||
const getStyle = computed((): CSSProperties => { | ||
const { size } = props; | ||
const s = `${size}`.replace('px', '').concat('px'); | ||
return { | ||
width: s, | ||
height: s, | ||
}; | ||
}); | ||
</script> | ||
|
||
<style lang="less"> | ||
.svg-icon { | ||
overflow: hidden; | ||
vertical-align: -0.15em; | ||
fill: currentColor; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as TitleI18n } from './index.vue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<i18n-t tag="span" :keypath="getTitle" scope="global" /> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Title18n } from 'types/vue-router'; | ||
import { type PropType, computed } from 'vue'; | ||
import { useLocaleStore } from '@/store/modules/locale'; | ||
const props = defineProps({ | ||
title: { | ||
type: [String, Object] as PropType<string | Title18n>, | ||
required: true, | ||
default: '', | ||
}, | ||
}); | ||
const localeStore = useLocaleStore(); | ||
const getTitle = computed(() => { | ||
const { title = '' } = props; | ||
if (typeof title === 'object') { | ||
return title?.[localeStore.locale] ?? title; | ||
} | ||
return title; | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### 业务组件(目录说明) | ||
|
||
#### 与业务强耦合的组件可以放这里 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### 核心组件(目录说明) | ||
|
||
| 组件名称 | 描述 | 是否全局组件 | 使用建议 | | ||
| --- | --- | --- | --- | | ||
| draggable-modal | `可拖拽弹窗`基于 a-modal 二次封装的可拖拽模态框,基本使用方式与 antdv 的 a-modal 保持一致 | 否 | 有弹窗拖拽需求的可以使用此组件 | | ||
| dynamic-table | `动态表格`基于 a-table 二次封装的表格,基本使用方式与 antdv 的 a-table 保持一致 | 否 | 根据自己需求调整,建议全局使用统一的表格封装组件 | | ||
| schema-form | `动态表单`基于 a-form 二次封装。通过 JSON schema 的方式配置使用 | 否 | 定制性不高的表单都可以考虑使用 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DraggableModal } from './index.vue'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/dynamic-table/typing.ts → src/components/core/dynamic-table/typing.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/JSON-schema-form/helper.ts → src/components/core/schema-form/helper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.