diff --git a/.env b/.env index 0c6e7c815ee9a660337942204365738d3308a70b..e911e7215ab4e826bdb0471d17bf283f900253b6 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ VUE_APP_PUBLIC_PATH=/ -VUE_APP_NAME=Admin +VUE_APP_NAME=Karote VUE_APP_ROUTES_KEY=admin.routes VUE_APP_PERMISSIONS_KEY=admin.permissions VUE_APP_ROLES_KEY=admin.roles diff --git a/src/api/index.js b/src/api/index.js index 18af1f5f3453148bf91cbbb61f4450e527525d08..dd390ca47936fc9735e7b9fd470b85f227c9f48a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,7 @@ import { request, METHOD } from '@/utils'; export * from './menu'; export * from './system'; +export * from './task'; export function getUserDetailInfoApi() { return request('/api/v1/detail', METHOD.GET); diff --git a/src/api/menu.js b/src/api/menu.js index 251636daf0df2c6f1339cc533b06a5254be845de..2e374afe7055427a7b3b16185ea5c1d5f0c6279d 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -35,3 +35,11 @@ export function getRoleApi(id) { export function updateRoleApi(data) { return putReq('/api/v1/roles', data); } + +export function getMenuComponentApi(id) { + return getReq(`/api/v1/menus/${id}/components`); +} + +export function addMenuComponentApi(id, data) { + return postReq(`/api/v1/menus/${id}/components`, data); +} diff --git a/src/api/task.js b/src/api/task.js new file mode 100644 index 0000000000000000000000000000000000000000..ca44ba176b1a34fe5f81a0c71b35a7ad62e783de --- /dev/null +++ b/src/api/task.js @@ -0,0 +1,9 @@ +import { postReq, putReq } from '@/utils'; + +export function addTaskApi(data) { + return postReq('/api/v1/schedules', data); +} + +export function updateTaskApi(data) { + return putReq('/api/v1/schedules', data); +} diff --git a/src/assets/img/logo.png b/src/assets/img/logo.png deleted file mode 100644 index 62bfe39aaad240dc0daa7dd5f48a80d1feedc002..0000000000000000000000000000000000000000 Binary files a/src/assets/img/logo.png and /dev/null differ diff --git a/src/assets/img/preview-nine.png b/src/assets/img/preview-nine.png deleted file mode 100644 index d63b00b2e5615539e969b4e90eee2544a1426b38..0000000000000000000000000000000000000000 Binary files a/src/assets/img/preview-nine.png and /dev/null differ diff --git a/src/assets/img/preview.png b/src/assets/img/preview.png deleted file mode 100644 index 21fffb5ac60c2bbd6abb0a5cf6b22c115060da23..0000000000000000000000000000000000000000 Binary files a/src/assets/img/preview.png and /dev/null differ diff --git a/src/components/Acron/ACron.vue b/src/components/Acron/ACron.vue index 242833ba28eb096f07b35e16f175b6834818033a..51a552b6f2095c09590f8849ea65ef7612d42ad1 100644 --- a/src/components/Acron/ACron.vue +++ b/src/components/Acron/ACron.vue @@ -1,86 +1,89 @@ \ No newline at end of file + diff --git a/src/components/Acron/AntCron.vue b/src/components/Acron/AntCron.vue index cc0aa0968cbaba2e37e5aab4a3ae296d9715efd3..160a736875bc71a78d394ef6aec32c806791ef7b 100644 --- a/src/components/Acron/AntCron.vue +++ b/src/components/Acron/AntCron.vue @@ -1,1150 +1,1197 @@ - - - \ No newline at end of file + diff --git a/src/components/FormMixin/index.js b/src/components/FormMixin/index.js index ec20166fb3688043843852578f4033257b8bcec6..370edc973636e39a7988954741f2b11e571b4be2 100644 --- a/src/components/FormMixin/index.js +++ b/src/components/FormMixin/index.js @@ -20,15 +20,16 @@ export default { async submit() { await this.$refs.DrawerForm.validate(); if (this.isAdd) { - return this?.add(); + return this.add(); } if (this.isEdit) { - return this?.edit(); + return this.edit(); } }, setData(data, type) { this.form = { ...data }; this.type = type; + console.log(data, type); }, }, }; diff --git a/src/components/action_button/index.vue b/src/components/action_button/index.vue index 818e4ca63f604b216da9d72984a142a1ad1f7173..9bd580d041555a596ac398cf814d3959c6f4b0e9 100644 --- a/src/components/action_button/index.vue +++ b/src/components/action_button/index.vue @@ -9,7 +9,7 @@ :onOk="btn.onOk" :label="btn.label" /> - {{ btn.label }} + {{ btn.label }} @@ -26,7 +26,7 @@ :onOk="btn.onOk" :label="btn.label" /> - {{ btn.label }} + {{ btn.label }} @@ -77,10 +77,10 @@ export default { return url; }, init() { - this.buttons.map((i) => { + this.buttons.map(i => { i.__hidden__ = i.isHidden && i.isHidden(this.row); }); - this.buttonsArr = this.buttons.filter((i) => !i.__hidden__); + this.buttonsArr = this.buttons.filter(i => !i.__hidden__); }, }, }; diff --git a/src/components/table/index.vue b/src/components/table/index.vue index c7aa3408f65b152264132756247a7e9445fc2ff2..b8055f064884e77ed2f32fbccfb7c26d06ea7c5a 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -180,6 +180,7 @@ export default { this.addVisible = true; this.type = 0; this.noFooter = false; + this.title = '新增'; }, addDrawerClose() { this.addVisible = false; diff --git a/src/components/table/table.vue b/src/components/table/table.vue index d3b657032b8ba7e6ed164222d01f20f287d671aa..b5921bf654eb00969392970d423b7c8caf665e83 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -15,10 +15,14 @@ - - - + + + + {{ typeof addBtn === 'object' ? addBtn.text : '新增' }} + + + + + + + + + + @@ -43,6 +65,10 @@ const initQuery = { export default { props: { url: String, + addBtn: [Object, Boolean], + buttons: Array, + noPage: Boolean, + formatData: Function, }, data() { @@ -54,6 +80,17 @@ export default { queryForm: {}, loading: false, total: 0, + visible: false, + title: '新增', + drawerStyle: { + display: 'flex', + flexDirection: 'column', + overflowY: 'hidden', + }, + bodyStyle: { + flex: 1, + overflow: 'hidden', + }, }; }, @@ -63,12 +100,14 @@ export default { computed: { pagination() { - return { - current: this.initQuery.pageNum, - pageSize: this.initQuery.pageSize, - total: this.total, - showQuickJumper: true, - }; + return this.noPage + ? false + : { + current: this.initQuery.pageNum, + pageSize: this.initQuery.pageSize, + total: this.total, + showQuickJumper: true, + }; }, }, @@ -76,7 +115,7 @@ export default { async getData() { this.loading = true; try { - await this.getDataWithPage(); + this.noPage ? await this.getDataNoPage() : await this.getDataWithPage(); } catch (error) { // todo } @@ -90,10 +129,34 @@ export default { else this.data = res.records; }, + async getDataNoPage() { + const res = await request(this.url, METHOD.GET, this.queryForm); + if (this.formatData) this.data = this.formatData(res); + else this.data = res; + }, + pageChange(page) { this.initQuery.pageNum = page.current; this.getData(); }, + + hidden() { + this.visible = false; + }, + show({ title } = {}) { + this.visible = true; + if (title) this.title = title; + }, + reset() { + this.queryForm = {}; + this.initQuery = { ...initQuery }; + this.getData(); + }, + addBtnClick() { + const { click } = typeof this.addBtn === 'object' ? this.addBtn : {}; + click && click(); + this.visible = true; + }, }, }; diff --git a/src/components/table/tableDrawer.vue b/src/components/table/tableDrawer.vue deleted file mode 100644 index b1435871875a050d139c0500105ba937ab7b3147..0000000000000000000000000000000000000000 --- a/src/components/table/tableDrawer.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - diff --git a/src/components/table/wraper.vue b/src/components/table/wraper.vue new file mode 100644 index 0000000000000000000000000000000000000000..88560dffad35aa43035ee79a2359bb9c536c3d8d --- /dev/null +++ b/src/components/table/wraper.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/config/global.config.js b/src/config/global.config.js index 2b0b10e70fe2eaebbdc593041469b2583eaa4cf9..f3e1abd57a0349ffaa6e6eeca00e3b0691c805c8 100644 --- a/src/config/global.config.js +++ b/src/config/global.config.js @@ -1,124 +1,113 @@ // 全部的配置数据 const globalConfig = { - //支持语言 - langs: [ - {key: 'zh_CN', name: '简体中文', alias: '简体'}, - {key: 'en_US', name: 'English', alias: 'English'} - ], //调色板 颜色 - palettes: ["#f5222d", "#fa541c", "#fadb14", "#3eaf7c", "#13c2c2", "#1890ff", "#722ed1", "#eb2f96"], + palettes: ['#f5222d', '#fa541c', '#fadb14', '#3eaf7c', '#13c2c2', '#1890ff', '#722ed1', '#eb2f96'], //tab出入动画效果 animates: { preset: [ //参考Animate.css 各种特效的css命名,default对应没有 direction的情况 - { name: "back", alias: "渐近", directions: ["Left", "Right"] }, - { name: "bounce", alias: "弹跳", directions: ["Left", "Right", "Default"] }, + { name: 'back', alias: '渐近', directions: ['Left', 'Right'] }, + { name: 'bounce', alias: '弹跳', directions: ['Left', 'Right', 'Default'] }, { - name: "fade", - alias: "淡化", - directions: ["Left", "LeftBig", "Right", "RightBig", "Default"], + name: 'fade', + alias: '淡化', + directions: ['Left', 'LeftBig', 'Right', 'RightBig', 'Default'], }, - { name: "lightSpeed", alias: "光速", directions: ["Left", "Right"] }, - { name: "slide", alias: "滑动", directions: ["Left", "Right"] }, + { name: 'lightSpeed', alias: '光速', directions: ['Left', 'Right'] }, + { name: 'slide', alias: '滑动', directions: ['Left', 'Right'] }, ], }, //当前主色调 + 3个功能颜色 + 3个模式菜单颜色 primary: { - color: "#3eaf7c", - warning: "#faad14", - success: "#52c41a", - error: "#f5222d", + color: '#3eaf7c', + warning: '#faad14', + success: '#52c41a', + error: '#f5222d', light: { - menuColors: ["#000c17", "#001529", "#002140"], + menuColors: ['#000c17', '#001529', '#002140'], }, dark: { - menuColors: ["#000c17", "#001529", "#002140"], + menuColors: ['#000c17', '#001529', '#002140'], }, night: { - menuColors: ["#151515", "#1f1f1f", "#1e1e1e"], + menuColors: ['#151515', '#1f1f1f', '#1e1e1e'], }, }, //主题 theme: { mode: { - DARK: "dark", - LIGHT: "light", - NIGHT: "night", + DARK: 'dark', + LIGHT: 'light', + NIGHT: 'night', }, dark: { - "layout-body-background": "#f0f2f5", - "body-background": "#fff", - "component-background": "#fff", - "heading-color": "rgba(0, 0, 0, 0.85)", - "text-color": "rgba(0, 0, 0, 0.65)", - "text-color-inverse": "#fff", - "text-color-secondary": "rgba(0, 0, 0, 0.45)", - "shadow-color": "rgba(0, 0, 0, 0.15)", - "border-color-split": "#f0f0f0", - "background-color-light": "#fafafa", - "background-color-base": "#f5f5f5", - "table-selected-row-bg": "#fafafa", - "table-expanded-row-bg": "#fbfbfb", - "checkbox-check-color": "#fff", - "disabled-color": "rgba(0, 0, 0, 0.25)", - "menu-dark-color": "rgba(254, 254, 254, 0.65)", - "menu-dark-highlight-color": "#fefefe", - "menu-dark-arrow-color": "#fefefe", - "btn-primary-color": "#fff", + 'layout-body-background': '#f0f2f5', + 'body-background': '#fff', + 'component-background': '#fff', + 'heading-color': 'rgba(0, 0, 0, 0.85)', + 'text-color': 'rgba(0, 0, 0, 0.65)', + 'text-color-inverse': '#fff', + 'text-color-secondary': 'rgba(0, 0, 0, 0.45)', + 'shadow-color': 'rgba(0, 0, 0, 0.15)', + 'border-color-split': '#f0f0f0', + 'background-color-light': '#fafafa', + 'background-color-base': '#f5f5f5', + 'table-selected-row-bg': '#fafafa', + 'table-expanded-row-bg': '#fbfbfb', + 'checkbox-check-color': '#fff', + 'disabled-color': 'rgba(0, 0, 0, 0.25)', + 'menu-dark-color': 'rgba(254, 254, 254, 0.65)', + 'menu-dark-highlight-color': '#fefefe', + 'menu-dark-arrow-color': '#fefefe', + 'btn-primary-color': '#fff', }, light: { - "layout-body-background": "#f0f2f5", - "body-background": "#fff", - "component-background": "#fff", - "heading-color": "rgba(0, 0, 0, 0.85)", - "text-color": "rgba(0, 0, 0, 0.65)", - "text-color-inverse": "#fff", - "text-color-secondary": "rgba(0, 0, 0, 0.45)", - "shadow-color": "rgba(0, 0, 0, 0.15)", - "border-color-split": "#f0f0f0", - "background-color-light": "#fafafa", - "background-color-base": "#f5f5f5", - "table-selected-row-bg": "#fafafa", - "table-expanded-row-bg": "#fbfbfb", - "checkbox-check-color": "#fff", - "disabled-color": "rgba(0, 0, 0, 0.25)", - "menu-dark-color": "rgba(1, 1, 1, 0.65)", - "menu-dark-highlight-color": "#fefefe", - "menu-dark-arrow-color": "#fefefe", - "btn-primary-color": "#fff", + 'layout-body-background': '#f0f2f5', + 'body-background': '#fff', + 'component-background': '#fff', + 'heading-color': 'rgba(0, 0, 0, 0.85)', + 'text-color': 'rgba(0, 0, 0, 0.65)', + 'text-color-inverse': '#fff', + 'text-color-secondary': 'rgba(0, 0, 0, 0.45)', + 'shadow-color': 'rgba(0, 0, 0, 0.15)', + 'border-color-split': '#f0f0f0', + 'background-color-light': '#fafafa', + 'background-color-base': '#f5f5f5', + 'table-selected-row-bg': '#fafafa', + 'table-expanded-row-bg': '#fbfbfb', + 'checkbox-check-color': '#fff', + 'disabled-color': 'rgba(0, 0, 0, 0.25)', + 'menu-dark-color': 'rgba(1, 1, 1, 0.65)', + 'menu-dark-highlight-color': '#fefefe', + 'menu-dark-arrow-color': '#fefefe', + 'btn-primary-color': '#fff', }, night: { - "layout-body-background": "#000", - "body-background": "#141414", - "component-background": "#141414", - "heading-color": "rgba(255, 255, 255, 0.85)", - "text-color": "rgba(255, 255, 255, 0.85)", - "text-color-inverse": "#141414", - "text-color-secondary": "rgba(255, 255, 255, 0.45)", - "shadow-color": "rgba(255, 255, 255, 0.15)", - "border-color-split": "#303030", - "background-color-light": "#ffffff0a", - "background-color-base": "#2a2a2a", - "table-selected-row-bg": "#ffffff0a", - "table-expanded-row-bg": "#ffffff0b", - "checkbox-check-color": "#141414", - "disabled-color": "rgba(255, 255, 255, 0.25)", - "menu-dark-color": "rgba(254, 254, 254, 0.65)", - "menu-dark-highlight-color": "#fefefe", - "menu-dark-arrow-color": "#fefefe", - "btn-primary-color": "#141414", + 'layout-body-background': '#000', + 'body-background': '#141414', + 'component-background': '#141414', + 'heading-color': 'rgba(255, 255, 255, 0.85)', + 'text-color': 'rgba(255, 255, 255, 0.85)', + 'text-color-inverse': '#141414', + 'text-color-secondary': 'rgba(255, 255, 255, 0.45)', + 'shadow-color': 'rgba(255, 255, 255, 0.15)', + 'border-color-split': '#303030', + 'background-color-light': '#ffffff0a', + 'background-color-base': '#2a2a2a', + 'table-selected-row-bg': '#ffffff0a', + 'table-expanded-row-bg': '#ffffff0b', + 'checkbox-check-color': '#141414', + 'disabled-color': 'rgba(255, 255, 255, 0.25)', + 'menu-dark-color': 'rgba(254, 254, 254, 0.65)', + 'menu-dark-highlight-color': '#fefefe', + 'menu-dark-arrow-color': '#fefefe', + 'btn-primary-color': '#141414', }, }, layout: { - SIDE: "side", - HEAD: "head", + SIDE: 'side', + HEAD: 'head', }, }; module.exports = globalConfig; - - - - - - \ No newline at end of file diff --git a/src/main.js b/src/main.js index f19815d1867d1e34d6129736aa422e00a78fcf4d..32eb188d903c89e521a18137f8e66d968a603293 100644 --- a/src/main.js +++ b/src/main.js @@ -8,17 +8,16 @@ import VueI18n from 'vue-i18n'; import { accountModule, settingModule } from './pages/frame/store'; import globalStore from '@/store'; import App from './App.vue'; -import 'tailwindcss/tailwind.css'; - -import 'animate.css/source/animate.css'; -import './theme/index.less'; import Plugins from './plugins'; - import { loadRoutes, loadGuards, setAppOptions } from './utils/routerUtil'; import guards from './router/guards'; import { loadResponseInterceptor } from './utils/requestUtil'; +import langUtils from '@/utils/langUtils'; + +import 'tailwindcss/tailwind.css'; +import 'animate.css/source/animate.css'; +import './theme/index.less'; -// import '@/mock'; import 'moment/locale/zh-cn'; //设置为非生产提示 @@ -40,13 +39,12 @@ const router = new Router(options); //装载vue-i18n控件 如果语言优先级 请直接修改这里localeLang和fallbackLang Vue.use(VueI18n); -//defalt 'CN' -const localeLang = store.state.settingModule.lang; -//default'EN' -const fallbackLang = store.state.settingModule.fallbackLang; + +const localeLang = langUtils.get(); + const i18n = new VueI18n({ locale: localeLang, - fallbackLocale: fallbackLang, + fallbackLocale: langUtils.fallbackLocale, silentFallbackWarn: true, }); diff --git a/src/pages/frame/components/header/LayoutTopHeaderLang.vue b/src/pages/frame/components/header/LayoutTopHeaderLang.vue index 1aabba52913c0100d461de8472fc856a8a47ffcc..1f3ce65a82ec81876e79ff1f9092a04fac1cec0f 100644 --- a/src/pages/frame/components/header/LayoutTopHeaderLang.vue +++ b/src/pages/frame/components/header/LayoutTopHeaderLang.vue @@ -1,7 +1,7 @@ diff --git a/src/pages/frame/view/template/BlankTemplateView.vue b/src/pages/frame/view/template/BlankTemplateView.vue index 203dceb385ba3943b45dc8bb3303235cdc3d90a6..310611e241b8abee31c7482511877bdd104b0072 100644 --- a/src/pages/frame/view/template/BlankTemplateView.vue +++ b/src/pages/frame/view/template/BlankTemplateView.vue @@ -1,22 +1,14 @@ diff --git a/src/pages/frame/view/template/PageTemplateView.vue b/src/pages/frame/view/template/PageTemplateView.vue index 10cfeb9a93e72fa1fa67fa02be19a4125318b2f8..524b0194147f2309a0f89046d2e7f97a1c7e4fbf 100644 --- a/src/pages/frame/view/template/PageTemplateView.vue +++ b/src/pages/frame/view/template/PageTemplateView.vue @@ -1,29 +1,26 @@ -