From 213a68f95270a2a9400fd17c666667a906033874 Mon Sep 17 00:00:00 2001 From: hongtianzai Date: Fri, 7 Jan 2022 17:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 87 ++++++++++++++-------------- public/config.js | 8 +-- src/api/UDIDownload/fileInfo.js | 10 +++- src/api/UDIDownload/jobLog.js | 19 +++++++ src/main.js | 4 +- src/utils/tools.js | 23 ++++++++ src/views/UDIDownload/fielInfo.vue | 15 +++-- src/views/UDIDownload/jobLog.vue | 91 ++++++++++++++++++++++++------ 8 files changed, 187 insertions(+), 70 deletions(-) create mode 100644 src/utils/tools.js diff --git a/package.json b/package.json index 8a9fc73..c8e9775 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,46 @@ { - "name": "my-project", - "version": "0.1.0", - "private": true, - "scripts": { - "serve": "vue-cli-service serve", - "stage": "vue-cli-service build --mode stage", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint", - "test:unit": "vue-cli-service test:unit" - }, - "dependencies": { - "axios": "^0.18.0", - "babel-polyfill": "^6.26.0", - "element-china-area-data": "^5.0.2", - "element-ui": "^2.8.2", - "file-saver": "^2.0.2", - "js-cookie": "^2.2.0", - "mockjs": "^1.0.1-beta3", - "nprogress": "^0.2.0", - "pinyin": "^2.10.2", - "vue": "^2.5.16", - "vue-router": "^3.0.1", - "vue2-verify": "^1.1.5", - "vuedraggable": "^2.17.0", - "vuex": "^3.0.1" - }, - "devDependencies": { - "@vue/cli-plugin-babel": "^3.0.0-beta.15", - "@vue/cli-plugin-eslint": "^3.0.0-beta.15", - "@vue/cli-plugin-unit-jest": "^3.0.0-beta.15", - "@vue/cli-service": "^3.0.0-beta.15", - "@vue/eslint-config-prettier": "^3.0.0-rc.3", - "@vue/test-utils": "^1.0.0-beta.16", - "babel-core": "7.0.0-bridge.0", - "babel-jest": "^23.0.1", - "sass-loader": "^7.0.1", - "vue-template-compiler": "^2.5.16" - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not ie <= 8" - ] + "name": "my-project", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "stage": "vue-cli-service build --mode stage", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint", + "test:unit": "vue-cli-service test:unit" + }, + "dependencies": { + "axios": "^0.18.0", + "babel-polyfill": "^6.26.0", + "element-china-area-data": "^5.0.2", + "element-ui": "^2.8.2", + "file-saver": "^2.0.2", + "js-cookie": "^2.2.0", + "mockjs": "^1.0.1-beta3", + "node-sass": "^7.0.1", + "nprogress": "^0.2.0", + "pinyin": "^2.10.2", + "vue": "^2.5.16", + "vue-router": "^3.0.1", + "vue2-verify": "^1.1.5", + "vuedraggable": "^2.17.0", + "vuex": "^3.0.1" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^3.0.0-beta.15", + "@vue/cli-plugin-eslint": "^3.0.0-beta.15", + "@vue/cli-plugin-unit-jest": "^3.0.0-beta.15", + "@vue/cli-service": "^3.0.0-beta.15", + "@vue/eslint-config-prettier": "^3.0.0-rc.3", + "@vue/test-utils": "^1.0.0-beta.16", + "babel-core": "7.0.0-bridge.0", + "babel-jest": "^23.0.1", + "sass-loader": "^7.0.1", + "vue-template-compiler": "^2.5.16" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] } diff --git a/public/config.js b/public/config.js index 48ab6b5..17735cf 100644 --- a/public/config.js +++ b/public/config.js @@ -1,9 +1,9 @@ window.global_config = { - - - "BASE_URL":"https://www.udims.com/UDIC_UDI_Server" + + + "BASE_URL":"http://127.0.0.1:9995", // "BASE_URL":"https://www.udims.com/UDIC_UDI_Server" - // "BASE_URL":"http://127.0.0.1:9995" + "BASE_URL":"http://127.0.0.1:9994" }; diff --git a/src/api/UDIDownload/fileInfo.js b/src/api/UDIDownload/fileInfo.js index 7c48a57..155bd61 100644 --- a/src/api/UDIDownload/fileInfo.js +++ b/src/api/UDIDownload/fileInfo.js @@ -6,4 +6,12 @@ export function getFileList(param){ method:"post", data:param }) -} \ No newline at end of file + +} +export function exportToFile(param){ + return request({ + url:"/file/exportToFile", + method:"post", + data:param + }) +} diff --git a/src/api/UDIDownload/jobLog.js b/src/api/UDIDownload/jobLog.js index fbbf007..753ce49 100644 --- a/src/api/UDIDownload/jobLog.js +++ b/src/api/UDIDownload/jobLog.js @@ -8,6 +8,11 @@ export function logList(param){ }); } +/** + * 按天下载 + * @param day + * @returns {*} + */ export function downloadByDay(day){ return request({ url: "/udidl/device/dlByDay", @@ -15,3 +20,17 @@ export function downloadByDay(day){ params:{day:day} }) } + +/** + * 按时间段下载 + * @param query + * @returns {*} + */ +export function downloadByDays(query){ + return request({ + url: "/udidl/device/dlByDays", + method: "get", + params:query + }) +} + diff --git a/src/main.js b/src/main.js index 8d0e4dd..90c0122 100644 --- a/src/main.js +++ b/src/main.js @@ -16,6 +16,7 @@ import axios from "axios"; import "../public/config.json"; import myReq from "./utils/axios"; import request from "@/utils/request"; +import {addDateRange,selectDictLabel} from '@/utils/tools'; // 注册全局组件(register global) Vue.component("icon-svg", IconSvg); axios.defaults.withCredentials = true @@ -23,7 +24,8 @@ axios.defaults.withCredentials = true Object.keys(filters).forEach(key => { Vue.filter(key, filters[key]); }); - +Vue.prototype.addDateRange = addDateRange; +Vue.prototype.selectDictLabel = selectDictLabel; Vue.config.productionTip = false; let getUrl = ""; let startApp = function () { diff --git a/src/utils/tools.js b/src/utils/tools.js new file mode 100644 index 0000000..e437ac6 --- /dev/null +++ b/src/utils/tools.js @@ -0,0 +1,23 @@ +// 添加日期范围 +export function addDateRange(params, dateRange) { + let search = params; + search.startDate = null + search.endDate = null; + if (null != dateRange && '' != dateRange) { + search.startDate = dateRange[0]; + search.endDate = dateRange[1]; + } + return search; +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + var actions = []; + Object.keys(datas).map((key) => { + if (datas[key].value == ('' + value)) { + actions.push(datas[key].label); + return false; + } + }) + return actions.join(''); +} diff --git a/src/views/UDIDownload/fielInfo.vue b/src/views/UDIDownload/fielInfo.vue index 6a3f378..42c730c 100644 --- a/src/views/UDIDownload/fielInfo.vue +++ b/src/views/UDIDownload/fielInfo.vue @@ -30,9 +30,9 @@ - + +