From 84ece510c414446b13ff3e4a0e1553638bd1aba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E8=90=BD=28YangLei=29?= Date: Thu, 15 Jul 2021 18:50:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E5=8C=96=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 +- src/components/MySelect/url_select.vue | 2 +- src/components/table/table.vue | 12 +++- src/local/index.js | 16 +++++ src/local/select.js | 4 ++ src/main.js | 4 +- src/pages/ranger/report/trend/index.vue | 65 +++++++++++++++++++ .../ranger/task_managment/center/detail.vue | 3 +- src/router/config.js | 7 +- 9 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 src/local/index.js create mode 100644 src/local/select.js create mode 100644 src/pages/ranger/report/trend/index.vue diff --git a/src/api/index.js b/src/api/index.js index b151e1c..c55eae1 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -35,5 +35,5 @@ export const getStaticDataApi = async (data) => { }; export function getStaticDataByTwoParamsApi(paramModule, paramCode) { - return getStaticDataApi({ paramModule, paramCode }); + return () => getStaticDataApi({ paramModule, paramCode }); } diff --git a/src/components/MySelect/url_select.vue b/src/components/MySelect/url_select.vue index 35b180a..32fc5df 100644 --- a/src/components/MySelect/url_select.vue +++ b/src/components/MySelect/url_select.vue @@ -2,7 +2,7 @@
- +
@@ -21,7 +21,7 @@
- + {{ newBtn.text || '新增' }} @@ -104,6 +104,7 @@ export default { type: Object, default: () => ({}), }, + noMargin: Boolean, }, data() { @@ -164,6 +165,13 @@ export default { }, }; }, + tableCardStyle() { + return this.noMargin + ? { + paddingTop: 0, + } + : {}; + }, }, methods: { diff --git a/src/local/index.js b/src/local/index.js new file mode 100644 index 0000000..2fd0f73 --- /dev/null +++ b/src/local/index.js @@ -0,0 +1,16 @@ +import selectLang from './select'; + +const zh_CN = {}; +const en_US = {}; + +function formatLang(langObject) { + for (const key in langObject) { + const element = langObject[key]; + zh_CN[key] = element[0]; + en_US[key] = element[1]; + } +} + +formatLang(selectLang); + +export { en_US, zh_CN }; diff --git a/src/local/select.js b/src/local/select.js new file mode 100644 index 0000000..dfc7e71 --- /dev/null +++ b/src/local/select.js @@ -0,0 +1,4 @@ +// 0 中文, 1 英文 +export default { + 'select.placeholder': ['请选择', 'Please Select'], +}; diff --git a/src/main.js b/src/main.js index 012ef2c..259ec20 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ import { loadGuards, setAppOptions } from './utils/routerUtil'; import guards from './router/guards'; import { loadResponseInterceptor } from './utils/requestUtil'; import langUtils from '@/utils/langUtils'; +import { en_US, zh_CN } from '@/local'; import 'tailwindcss/tailwind.css'; import 'animate.css/source/animate.css'; @@ -43,6 +44,7 @@ const i18n = new VueI18n({ locale: localeLang, fallbackLocale: langUtils.fallbackLocale, silentFallbackWarn: true, + messages: { zh_CN, en_US }, }); //装载antd控件 @@ -67,5 +69,5 @@ new Vue({ router, store, i18n, - render: h => h(App), + render: (h) => h(App), }).$mount('#app'); diff --git a/src/pages/ranger/report/trend/index.vue b/src/pages/ranger/report/trend/index.vue new file mode 100644 index 0000000..d85a57f --- /dev/null +++ b/src/pages/ranger/report/trend/index.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/pages/ranger/task_managment/center/detail.vue b/src/pages/ranger/task_managment/center/detail.vue index f8c2482..f66f727 100644 --- a/src/pages/ranger/task_managment/center/detail.vue +++ b/src/pages/ranger/task_managment/center/detail.vue @@ -142,7 +142,7 @@ export default { title: '备注 & 附件', options: { fixed: 'right', - width: 150, + width: 100, }, data: [ { @@ -166,7 +166,6 @@ export default { }, methods: { viewDetail(row) { - console.log(row); this.$refs.table.show({ row, title: '备注 & 附件' }); }, }, diff --git a/src/router/config.js b/src/router/config.js index b21d25e..ec8fd77 100644 --- a/src/router/config.js +++ b/src/router/config.js @@ -81,13 +81,11 @@ const hasAuthorityRoutes = [ component: () => import('@/pages/ranger/basic/unit'), }, { - path: 'major', name: '专业配置', component: () => import('@/pages/ranger/basic/major'), }, { - path: 'item', name: '项目配置', component: () => import('@/pages/ranger/basic/item'), @@ -121,6 +119,11 @@ const hasAuthorityRoutes = [ name: '报表中心', component: RouterView, children: [ + { + path: 'trend-analysis', + name: '趋势对比', + component: () => import('@/pages/ranger/report/trend/index.vue'), + }, { path: 'week', name: '巡检周报', -- GitLab