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/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/table.vue b/src/components/table/table.vue index 7718106a3612953b7ab3446040212a468c7388bb..b61d4b22e30ec109d3726d3795b09c5e1a0e993d 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -1,6 +1,6 @@ @@ -70,6 +65,8 @@ const initQuery = { pageNum: 1, }; +const defaultTitle = '新增'; + export default { props: { url: String, @@ -78,9 +75,11 @@ export default { 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, @@ -90,7 +89,7 @@ export default { loading: false, total: 0, visible: false, - title: '新增', + title: newBtn.title ?? defaultTitle, drawerStyle: { display: 'flex', flexDirection: 'column', @@ -108,6 +107,9 @@ export default { }, computed: { + newBtn() { + return this.addBtn ? (typeof this.addBtn === 'object' ? this.addBtn : {}) : this.addBtn; + }, pagination() { return this.noPage ? false @@ -118,6 +120,13 @@ export default { showQuickJumper: true, }; }, + rowSelection() { + return { + onChange: (selectedRowKeys, selectedRows) => { + this.$emit('update:selected', [selectedRowKeys, selectedRows]); + }, + }; + }, }, methods: { @@ -151,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/xunjian/task_managment/center/common/index.js b/src/pages/xunjian/task_managment/center/common/index.js new file mode 100644 index 0000000000000000000000000000000000000000..610a23d28a0cf08c81acd41410d87bfba9135b17 --- /dev/null +++ b/src/pages/xunjian/task_managment/center/common/index.js @@ -0,0 +1,17 @@ +export const areaFormatData = { + label: 'regionName', + value: 'regionId', + key: 'regionId', +}; + +export const statusFormtData = { + label: 'paramName', + value: 'paramValue', + key: 'paramValue', +}; + +export const banZuFormatData = { + label: 'paramName', + value: 'paramValue', + key: 'paramValue', +}; diff --git a/src/pages/xunjian/task_managment/center/form.vue b/src/pages/xunjian/task_managment/center/form.vue index a2e32df425c9dc9e013b77a882d3dd11d9b3c6fc..a2e52824caeb88f3a2e84646b579d0bae3b169db 100644 --- a/src/pages/xunjian/task_managment/center/form.vue +++ b/src/pages/xunjian/task_managment/center/form.vue @@ -1,3 +1,100 @@ + + diff --git a/src/pages/xunjian/task_managment/center/index.vue b/src/pages/xunjian/task_managment/center/index.vue index 5f72a3077c9aafb2d2117017c4e33e7792eff411..5dabdc52dd877f10fc5787daea11792e48f3df8c 100644 --- a/src/pages/xunjian/task_managment/center/index.vue +++ b/src/pages/xunjian/task_managment/center/index.vue @@ -1,5 +1,11 @@