diff --git a/examples/App.vue b/examples/App.vue index c6f15c9..aefc531 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -1,13 +1,15 @@ \ No newline at end of file diff --git a/plugs/config/size/normal.ts b/plugs/config/size/normal.ts index c85270b..18bca7b 100644 --- a/plugs/config/size/normal.ts +++ b/plugs/config/size/normal.ts @@ -6,7 +6,7 @@ export default class Normal { titleSize = '18px'; //标题字体尺寸 headIconSize = '20px'; //头部图标尺寸 headHeight = '50px'; //头部高度 - closeTop = '40px'; //展开收起菜单按钮 + closeTop = '10px'; //展开收起菜单按钮 headRightWidth = '400px'; //头部右侧菜单宽度 headLeftWidth = ''; //头部左侧剩余宽度 asideWidth = '180px'; //左侧菜单宽度 diff --git a/plugs/config/styles/index.ts b/plugs/config/styles/index.ts index 4a3628c..74df622 100644 --- a/plugs/config/styles/index.ts +++ b/plugs/config/styles/index.ts @@ -2,7 +2,9 @@ import Plain from './plain'; import Plainb from './plainb'; import Light from './light'; import Dark from './dark'; +import ZhuBeidong from './zhuBeiDong'; export const plain = new Plain(); export const plainb = new Plainb(); export const light = new Light(); export const dark = new Dark(); +export const zhuBeiDong = new ZhuBeidong(); diff --git a/plugs/config/styles/zhuBeiDong.ts b/plugs/config/styles/zhuBeiDong.ts new file mode 100644 index 0000000..f6fb100 --- /dev/null +++ b/plugs/config/styles/zhuBeiDong.ts @@ -0,0 +1,21 @@ +import Plain from './plain'; +import { light, dark, grey } from './color'; + +export default class ZhuBeiDong extends Plain { + name = 'zhuBeiDong'; //总体样式名称 + i18n = 'styles.4'; //样式提示i18n配置 + bodyBg = light[0]; //全局背景颜色 + titleColor = dark[0]; //标题颜色 + subTitleColor = dark[3];//二级标题颜色 + + headBg = light[0]; //头部背景颜色 + + searchRowBg = light[0]; + itemBg = light[1]; + + tableBg = light[0]; //表格背景颜色 + tableHeadBg = light[0]; //表头行背景颜色 + tableCurBg = light[2]; //当前行背景颜色 + tableColor = dark[0]; //表格字体颜色 + tableBorderColor = light[9]; //行底部边框颜色 +} diff --git a/plugs/http/axios.ts b/plugs/http/axios.ts index d8bf87c..a4d30f2 100644 --- a/plugs/http/axios.ts +++ b/plugs/http/axios.ts @@ -172,7 +172,7 @@ function handResponse(response, resolve, noMsg, noLoading) { if (response.message?.indexOf('no permission for ') == 0) { response.message = t('http.noPermission'); } - if (!noMsg) { + if (!noMsg && response.message) { showMessage('error', response.message); } response.error && console.log(response.error); diff --git a/plugs/i18n/en.ts b/plugs/i18n/en.ts index 10098eb..dbcde31 100644 --- a/plugs/i18n/en.ts +++ b/plugs/i18n/en.ts @@ -36,7 +36,7 @@ export default class English { required: 'The password contains at least uppercase and lowercase letters and numbers', }; - styles = ['Default', 'Lignt', 'Dark', 'DefaultB']; + styles = ['Default', 'Lignt', 'Dark', 'DefaultB', 'zhuBeiDong']; head = { center: 'Personal center', diff --git a/plugs/i18n/index.ts b/plugs/i18n/index.ts index 97a8104..2f7559d 100644 --- a/plugs/i18n/index.ts +++ b/plugs/i18n/index.ts @@ -10,8 +10,16 @@ const i18n = createI18n({ locale: 'zh', messages, }); + const registerLang = (name, data) => { messages[name] = data; }; export { i18n, Zh, En, registerLang }; + +export const createt = (sufix: string) => { + return (key: string): string => { + key = sufix + key; + return i18n.t(key); + }; +}; diff --git a/plugs/i18n/zh.ts b/plugs/i18n/zh.ts index c426b68..c685261 100644 --- a/plugs/i18n/zh.ts +++ b/plugs/i18n/zh.ts @@ -35,7 +35,7 @@ export default class Zh { noSpace: '密码不能包含空格', required: '密码至少包含大小写字母和数字', }; - styles = ['青', '明亮', '黑夜', '蓝']; + styles = ['青', '明亮', '黑夜', '蓝', '主被动']; head = { center: '个人中心', diff --git a/plugs/store/index.ts b/plugs/store/index.ts index bb3e150..af19b85 100644 --- a/plugs/store/index.ts +++ b/plugs/store/index.ts @@ -63,8 +63,8 @@ export class Actions { const { state, commit } = store; state.size.headHeight = state.size.head + 'px'; state.size.asideWidth = state.size.aside + 'px'; - commit("initSize"); - this.getMenus(store) + commit('initSize'); + this.getMenus(store); }; } @@ -74,6 +74,7 @@ export class Mutations { }; initSize = (state, param) => { const size = state.size; + const aside = parseInt(size.asideWidth); const head = parseInt(size.headHeight); const mainPad = parseInt(size.mainPad); const searchRow = parseInt(size.searchRowHeight); @@ -87,7 +88,7 @@ export class Mutations { size.tableHeight = size.height - 2 * (mainPad + searchRowPad) - 3 - searchRow - head; size.pTableHeight = size.tableHeight - size.pageHeight; - size.headLeftWidth = size.width - headRightWidth - 20 + 'px'; + size.headLeftWidth = size.width - aside - headRightWidth - 20 + 'px'; }; updateDict = (state, param) => { state.dict[param[0]] = param[1];