diff --git a/package.json b/package.json index 944315eb014651f5b5dca4767dbd4586fde208c3..6c89ec31d998c7114d386cdd69e678c07f4759a9 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@vue/cli-plugin-eslint": "^4.4.0", "@vue/cli-service": "^4.4.0", "@vuepress/plugin-back-to-top": "^1.5.2", + "autoprefixer": "^9.8.6", "babel-eslint": "^10.1.0", "babel-plugin-transform-remove-console": "^6.9.4", "babel-polyfill": "^6.26.0", diff --git a/src/api/index.js b/src/api/index.js index 212ee85edc31006052e1d724e30b4dd44a3ce228..38e355e332fe7a5efaffa7a376d06da32b051533 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -2,6 +2,7 @@ import { request, METHOD, formatObj } from '@/utils'; export * from './menu'; export * from './system'; export * from './task'; +export * from './xunjian'; export function getUserDetailInfoApi() { return request('/api/v1/detail', METHOD.GET); diff --git a/src/api/menu.js b/src/api/menu.js index 2e374afe7055427a7b3b16185ea5c1d5f0c6279d..aec243b996aa56e2b024517add25fa31b99416b0 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -16,6 +16,10 @@ export async function getMenuDataApi(useCache) { }); } +export function getMenuDetailApi(id) { + return getReq(`/api/v1/menus/${id}`); +} + export function addMenuApi(data) { return postReq('/api/v1/menus', data); } diff --git a/src/api/xunjian.js b/src/api/xunjian.js new file mode 100644 index 0000000000000000000000000000000000000000..d4d106fef00de5afb33cee3e6520aeef7c0a3806 --- /dev/null +++ b/src/api/xunjian.js @@ -0,0 +1,32 @@ +import { getReq, postReq } from '@/utils/requestUtil'; +import langUtils from '@/utils/langUtils'; + +export function getXunJianDownloadUrlApi(idList) { + return getReq('/ranger/inspection/api/v1/jobs/export', { jobIdList: idList.join(',') }); +} + +export function getAreaListDataApi() { + return getReq(`/ranger/inspection/api/v1/region/list`); +} + +export function getBusinessListApi() { + return getReq( + `/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=inspection_state¶mLocale=${langUtils.get()}`, + ); +} + +export function getBanZuListApi() { + return getReq( + `/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=shift_type¶mLocale=${langUtils.get()}`, + ); +} + +export function getTaskTypeApi() { + return getReq( + `/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=job_type¶mLocale=${langUtils.get()}`, + ); +} + +export function addXunJianTaskApi(data) { + return postReq('/ranger/inspection/api/v1/jobs/temporary', data); +} diff --git a/src/components/MySelect/search_select.vue b/src/components/MySelect/search_select.vue new file mode 100644 index 0000000000000000000000000000000000000000..52b987735728883b3c256f23194785932f76a265 --- /dev/null +++ b/src/components/MySelect/search_select.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/MySelect/url_select.vue b/src/components/MySelect/url_select.vue new file mode 100644 index 0000000000000000000000000000000000000000..35b180a27e37054a51f0fab01ed3dcbbc9e0605d --- /dev/null +++ b/src/components/MySelect/url_select.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/components/table/index.vue b/src/components/table/index.vue index dec57485c6b3a750067ade70db0364405871f6e4..9f4a2db63de5ef91c2a5d1b0d82683f6a506dabd 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -69,7 +69,7 @@ - + diff --git a/src/components/table/table.vue b/src/components/table/table.vue index b5921bf654eb00969392970d423b7c8caf665e83..b61d4b22e30ec109d3726d3795b09c5e1a0e993d 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -1,6 +1,6 @@ @@ -62,6 +65,8 @@ const initQuery = { pageNum: 1, }; +const defaultTitle = '新增'; + export default { props: { url: String, @@ -69,9 +74,12 @@ export default { buttons: Array, noPage: Boolean, formatData: Function, + rowKey: [String, Function], + selected: Array, }, data() { + const newBtn = this.addBtn ? (typeof this.addBtn === 'object' ? this.addBtn : {}) : this.addBtn; return { initQuery: { ...initQuery, @@ -81,7 +89,7 @@ export default { loading: false, total: 0, visible: false, - title: '新增', + title: newBtn.title ?? defaultTitle, drawerStyle: { display: 'flex', flexDirection: 'column', @@ -99,6 +107,9 @@ export default { }, computed: { + newBtn() { + return this.addBtn ? (typeof this.addBtn === 'object' ? this.addBtn : {}) : this.addBtn; + }, pagination() { return this.noPage ? false @@ -109,6 +120,13 @@ export default { showQuickJumper: true, }; }, + rowSelection() { + return { + onChange: (selectedRowKeys, selectedRows) => { + this.$emit('update:selected', [selectedRowKeys, selectedRows]); + }, + }; + }, }, methods: { @@ -142,21 +160,29 @@ export default { hidden() { this.visible = false; + this.title = this.addBtn?.title ?? defaultTitle; }, + 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; }, + + getFormRef(ref) { + console.log(ref); + }, }, }; diff --git a/src/components/table/wraper.vue b/src/components/table/wraper.vue index 88560dffad35aa43035ee79a2359bb9c536c3d8d..efdb986a0c8bfe3b20f99d400244be9e341d2d69 100644 --- a/src/components/table/wraper.vue +++ b/src/components/table/wraper.vue @@ -31,6 +31,10 @@ export default { type: Function, default: EMPTY_FUN, }, + refresh: { + type: Function, + default: EMPTY_FUN, + }, }, data: () => ({ loading: false, @@ -43,9 +47,14 @@ export default { async ok() { this.loading = true; - await this.onOk(); + try { + await this.onOk(); + this.hidden(); + this.refresh(); + } catch (error) { + // todo + } this.loading = false; - this.hidden(); }, }, }; diff --git a/src/pages/frame/components/tab/LayoutTabsHeader.vue b/src/pages/frame/components/tab/LayoutTabsHeader.vue index 4b6f38433cfcdf20bc141ec1993e03bc43f6ecd1..081fdd1b0bfc7f9b3c434cbcbecec25ec9d26b9e 100644 --- a/src/pages/frame/components/tab/LayoutTabsHeader.vue +++ b/src/pages/frame/components/tab/LayoutTabsHeader.vue @@ -15,7 +15,9 @@ :class="['icon-sync', { hide: page.fullPath !== active && !page.loading }]" :type="page.loading ? 'loading' : 'sync'" /> -
{{ pageName(page) }}
+
+ {{ pageName(page) }} +
- + - + @@ -31,7 +31,7 @@ diff --git a/src/pages/xunjian/task_managment/center/index.js b/src/pages/xunjian/task_managment/center/index.js new file mode 100644 index 0000000000000000000000000000000000000000..63b68b8def407dda714507d4716bf563b1d32eb7 --- /dev/null +++ b/src/pages/xunjian/task_managment/center/index.js @@ -0,0 +1,3 @@ +import Center from './index.vue'; + +export default Center; diff --git a/src/pages/xunjian/task_managment/center/index.vue b/src/pages/xunjian/task_managment/center/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..5dabdc52dd877f10fc5787daea11792e48f3df8c --- /dev/null +++ b/src/pages/xunjian/task_managment/center/index.vue @@ -0,0 +1,144 @@ + + + diff --git a/src/pages/xunjian/view/area/index.vue b/src/pages/xunjian/view/area/index.vue deleted file mode 100644 index db4333268d3d32a97211a4a5bfe1564ad77b5ae2..0000000000000000000000000000000000000000 --- a/src/pages/xunjian/view/area/index.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/src/router/config.js b/src/router/config.js index a13aeeb477ba57df085c9d303620082473f0966e..201615dbe8cdf81337191ae53f13012fd94ca151 100644 --- a/src/router/config.js +++ b/src/router/config.js @@ -55,6 +55,25 @@ const hasAuthorityRoutes = [ }, ], }, + { + path: 'ranger', + name: '巡检管理', + component: PageTemplateView, + children: [ + { + path: 'task', + name: '任务管理', + component: RouterView, + children: [ + { + path: 'center', + name: '任务中心', + component: () => import('@/pages/xunjian/task_managment/center/index'), + }, + ], + }, + ], + }, { path: 'system', name: '系统管理', @@ -131,7 +150,7 @@ const hasAuthorityRoutes = [ }, { path: 'task', - name: '任务管理', + name: '任务', component: () => import('@/pages/system/view/task/index.vue'), }, ], diff --git a/src/utils/index.js b/src/utils/index.js index 47c69e02fd63aa5ad6c225c515bef107b1b6e0da..09c5ff4f4b053c63bf6c45fa836a893f7c2d20cc 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -113,9 +113,9 @@ export function arrayToTree(options) { } // select组件 数据格式化 -export const formatObj = async (ArrObj, obj) => { +export const formatObj = (ArrObj, obj) => { const newData = [...ArrObj]; - const newDataOne = await newData.map(i => { + const newDataOne = newData.map(i => { const newObj = { ...i }; Object.keys(obj).forEach(key => { newObj[key] = i[obj[key]]; @@ -124,3 +124,14 @@ export const formatObj = async (ArrObj, obj) => { }); return newDataOne; }; + +/** + * 下载文件 + * @param {String} url 下载路径 + */ +export function downloadFileByUrl(url) { + const aEle = document.createElement('a'); + aEle.setAttribute('download', true); + aEle.setAttribute('href', url); + aEle.click(); +} diff --git a/vue.config.js b/vue.config.js index 7b2497a088cf50554b1a445484fd90442a4a3124..a15919e5a2da8ba0353a773e48a00746acce5d46 100644 --- a/vue.config.js +++ b/vue.config.js @@ -281,7 +281,7 @@ module.exports = { }, }, postcss: { - plugins: [require('tailwindcss')], + plugins: [require('tailwindcss'), require('autoprefixer')], }, }, },