Skip to content

Commit

Permalink
Fixes bug add baseModal | baseForm 组件
Browse files Browse the repository at this point in the history
  • Loading branch information
jekip committed Aug 5, 2021
1 parent 98e1bf0 commit 8a5f237
Show file tree
Hide file tree
Showing 59 changed files with 2,056 additions and 106 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = defineConfig({
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/script-setup-uses-vars': 'off',
'vue/html-self-closing': [
'error',
{
Expand Down
31 changes: 25 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# 1.5 (2021-07-30)
# 1.5.1 (2021-08-07)
### 🐛 Bug Fixes
- 修复windows系统获取项目换行符问题
- 修复表格分页计算问题 [@Chika99](https://github.com/Chika99)
- 修复锁屏样式自适应问题 [@Chika99](https://github.com/Chika99)
- 依赖 dayjs 移除,用date-fns,和UI框架底层保持一致
- 修复已知bug



- ### ✨ Features
- 新增 `baseForm` 组件,和`基础``useForm`使用方式
- 新增 `baseModal`,组件,和 `useForm`使用方式
- 新增`子菜单` new Tag标签
- 菜单支持 `根路由`配置




# 1.5.0 (2021-07-30)
### 🐛 Bug Fixes
- 修复表格列配置,拖拽时最后的操作列重复增加
- 多标签页交互优化
Expand All @@ -15,7 +34,7 @@
- 本次更新,有破坏性更新,涉及文件重命名,增删调整


# 1.4 (2021-07-21)
# 1.4.0 (2021-07-21)
### 🐛 Bug Fixes
- vite降至2.3.6
- 多标签页交互优化
Expand All @@ -27,7 +46,7 @@
- 持续更新更多实用组件及示例,感谢Star


# 1.3 (2021-07-19)
# 1.3.0 (2021-07-19)
### 🐛 Bug Fixes
- 修复多标签页左右切换按钮自适应展示
- 修复登录页面出现多标签页
Expand All @@ -40,7 +59,7 @@
- 持续更新更多实用组件及示例,感谢Star


# 1.2 (2021-07-16)
# 1.2.0 (2021-07-16)
### 🐛 Bug Fixes
- 修复面包屑显示登录页面
- 菜单支持只展开当前父级菜单
Expand All @@ -54,15 +73,15 @@
- 持续更新更多实用示例,同时也演示`Naive UI`使用方法


# 1.1 (2021-07-15)
# 1.1.0 (2021-07-15)
- ### ✨ Features
- 新增 `基础表单` 示例页面
- 新增 `分步表单` 示例页面
- 新增 `表单详情` 示例页面
- 持续更新更多实用示例,同时也演示`Naive UI`使用方法


# 1.0 (2021-07-12)
# 1.0.0 (2021-07-12)
### 🐛 Bug Fixes
- 修复页面切换面包屑未及时更新

Expand Down
2 changes: 1 addition & 1 deletion build/getConfigFileName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @param env
*/
export const getConfigFileName = (env: Record<string, any>) => {
return `__PRODUCTION__${ env.VITE_GLOB_APP_SHORT_NAME || '__APP' }__CONF__`
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`
.toUpperCase()
.replace(/\s/g, '');
};
12 changes: 6 additions & 6 deletions build/script/buildConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ function createConfig(
}: { configName: string; config: any; configFileName?: string } = { configName: '', config: {} }
) {
try {
const windowConf = `window.${ configName }`;
const windowConf = `window.${configName}`;
// Ensure that the variable will not be modified
const configStr = `${ windowConf }=${ JSON.stringify(config) };
Object.freeze(${ windowConf });
Object.defineProperty(window, "${ configName }", {
const configStr = `${windowConf}=${JSON.stringify(config)};
Object.freeze(${windowConf});
Object.defineProperty(window, "${configName}", {
configurable: false,
writable: false,
});
`.replace(/\s/g, '');
fs.mkdirp(getRootPath(OUTPUT_DIR));
writeFileSync(getRootPath(`${ OUTPUT_DIR }/${ configFileName }`), configStr);
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);

console.log(chalk.cyan(`✨ [${ pkg.name }]`) + ` - configuration file is build successfully:`);
console.log(chalk.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
console.log(chalk.gray(OUTPUT_DIR + '/' + chalk.green(configFileName)) + '\n');
} catch (error) {
console.log(chalk.red('configuration file configuration file failed to package:\n' + error));
Expand Down
2 changes: 1 addition & 1 deletion build/script/postBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const runBuild = async () => {
await runBuildConfig();
}

console.log(`✨ ${ chalk.cyan(`[${ pkg.name }]`) }` + ' - build successfully!');
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
} catch (error) {
console.log(chalk.red('vite build error:\n' + error));
process.exit(1);
Expand Down
16 changes: 8 additions & 8 deletions build/vite/plugin/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { GLOB_CONFIG_FILE_NAME } from '../../constant';
export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
const { VITE_GLOB_APP_TITLE, VITE_PUBLIC_PATH } = env;

const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${ VITE_PUBLIC_PATH }/`;
const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${VITE_PUBLIC_PATH}/`;

const getAppConfigSrc = () => {
return `${ path || '/' }${ GLOB_CONFIG_FILE_NAME }?v=${ pkg.version }-${ new Date().getTime() }`;
return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
};

const htmlPlugin: Plugin[] = html({
Expand All @@ -28,13 +28,13 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
// Embed the generated app.config.js file
tags: isBuild
? [
{
tag: 'script',
attrs: {
src: getAppConfigSrc(),
{
tag: 'script',
attrs: {
src: getAppConfigSrc(),
},
},
},
]
]
: [],
},
});
Expand Down
2 changes: 1 addition & 1 deletion build/vite/plugin/styleImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function configStyleImportPlugin(isBuild: boolean) {
libraryName: 'ant-design-vue',
esModule: true,
resolveStyle: (name) => {
return `ant-design-vue/es/${ name }/style/index`;
return `ant-design-vue/es/${name}/style/index`;
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion mock/table/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const tableList = (pageSize) => {
const result: any[] = [];
doCustomTimes(pageSize, () => {
result.push({
id: '@integer(10,100)',
id: '@integer(10,999999)',
beginTime: '@datetime',
endTime: '@datetime',
address: '@city()',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "naive-ui-admin",
"version": "1.5.0",
"version": "1.5.1",
"author": {
"name": "Ahjung",
"email": "[email protected]",
Expand Down Expand Up @@ -30,15 +30,15 @@
"@vueuse/core": "^5.0.3",
"axios": "^0.21.1",
"blueimp-md5": "^2.18.0",
"dayjs": "^1.10.5",
"date-fns": "^2.23.0",
"echarts": "^5.1.2",
"element-resize-detector": "^1.2.3",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"makeit-captcha": "^1.2.5",
"mitt": "^2.1.0",
"mockjs": "^1.1.0",
"naive-ui": "^2.15.11",
"naive-ui": "^2.16.0",
"pinia": "^2.0.0-beta.3",
"qs": "^6.10.1",
"vfonts": "^0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ module.exports = {
requirePragma: false,
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'lf',
endOfLine: 'auto',
rangeStart: 0,
};
13 changes: 10 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import { useLockscreenStore } from '@/store/modules/lockscreen';
import { useRoute } from 'vue-router';
import { useDesignSettingStore } from '@/store/modules/designSetting';
import { lighten } from '@/utils/index';
export default defineComponent({
name: 'App',
Expand All @@ -35,14 +36,20 @@
const isLock = computed(() => useLockscreen.isLock);
const lockTime = computed(() => useLockscreen.lockTime);
/**
* @type import('naive-ui').GlobalThemeOverrides
*/
const getThemeOverrides = computed(() => {
const appTheme = designStore.appTheme;
const lightenStr = lighten(designStore.appTheme, 6);
return {
common: {
primaryColor: designStore.appTheme,
primaryColorHover: '#57a3f3',
primaryColor: appTheme,
primaryColorHover: lightenStr,
primaryColorPressed: lightenStr,
},
LoadingBar: {
colorLoading: designStore.appTheme,
colorLoading: appTheme,
},
};
});
Expand Down
4 changes: 4 additions & 0 deletions src/components/Form/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as BasicForm } from './src/BasicForm.vue';
export { useForm } from './src/hooks/useForm';
export * from './src/types/form';
export * from './src/types/index';
Loading

0 comments on commit 8a5f237

Please sign in to comment.