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 @@
-
+
@@ -9,13 +9,6 @@
-
-
- Content
- Content
-
- 高级查询
-
重置
查询
@@ -23,9 +16,9 @@
-
-
- {{ typeof addBtn === 'object' ? addBtn.text : '新增' }}
+
+
+ {{ newBtn.text || '新增' }}
@@ -37,6 +30,7 @@
:rowKey="rowKey"
:pagination="pagination"
@change="pageChange"
+ :row-selection="selected ? rowSelection : undefined"
>
@@ -56,8 +50,9 @@
:width="600"
@close="hidden"
:maskClosable="false"
+ :title="title"
>
-
+
@@ -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 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+ 导出
+
+
+
+
@@ -31,11 +98,24 @@
diff --git a/src/utils/index.js b/src/utils/index.js
index 3b1ef28a5334815b52eb4ed5462c81aedb2400d8..f032067b200fbb04508d7184da6e4366fbd7444d 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -114,9 +114,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]];
@@ -125,3 +125,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();
+}