同步数据修改

master
hongtianzai 3 years ago
parent b5e3ae96aa
commit 213a68f952

@ -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"
]
}

@ -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"
};

@ -6,4 +6,12 @@ export function getFileList(param){
method:"post",
data:param
})
}
}
export function exportToFile(param){
return request({
url:"/file/exportToFile",
method:"post",
data:param
})
}

@ -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
})
}

@ -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 () {

@ -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('');
}

@ -30,9 +30,9 @@
</el-form>
<el-table v-loading="loading" :data="tableData" border stripe>
<el-table-column label="文件名" align="center" prop="fileName">
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<a :href="'/files/'+scope.row.fileName" :download="scope.row.fileName">{{ scope.row.fileName }}</a>
</template>
</template>-->
</el-table-column>
<el-table-column label="行数" align="center" prop="count" :show-overflow-tooltip="true"/>
<el-table-column label="文件大小" align="center" prop="fileSize" :show-overflow-tooltip="true">
@ -40,6 +40,8 @@
{{ getFileSize(scope.row.fileSize) }}
</template>
</el-table-column>
<el-table-column label="起始日期" align="center" prop="startDate" :show-overflow-tooltip="true"/>
<el-table-column label="结束日期" align="center" prop="endDate" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
</el-table>
<el-pagination
@ -56,7 +58,7 @@
</template>
<script>
import {getFileList} from "@/api/UDIDownload/fileInfo";
import {getFileList,exportToFile} from "@/api/UDIDownload/fileInfo";
export default {
name: "fileInfo",
@ -127,7 +129,12 @@ export default {
* 重新下载文件
*/
download(){
if(this.dateRange == null || this.dateRange == ""){
this.$message.error("请选择日期");
return;
}
exportToFile(this.addDateRange({},this.dateRange));
this.$message.info("已发送下载指令,请稍等查看日志,防止同时下载!");
},
getFileSize(size) {
let res = "";

@ -20,6 +20,19 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-select
v-model="queryParams.downloadType"
placeholder="类型"
>
<el-option
v-for="item in downloadTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<span style="color: #000; margin-left: 10px; margin-right: 6px"
>创建日期:</span
@ -50,13 +63,15 @@
</el-button-group>
</el-form-item>
<el-form-item>
<el-button @click="dialog2.visible = true">按时间段下载</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
:row-style="rowStyle"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="类型" prop="type">
@ -64,6 +79,12 @@
<span>{{ getType(scope.row.type) }}</span>
</template>
</el-table-column>
<el-table-column label="下载类型" prop="downloadType">
<template slot-scope="scope">
<span>{{ getDownloadType(scope.row.downloadType) }}</span>
</template>
</el-table-column>
<el-table-column label="日期" prop="downloadDate"/>
<el-table-column label="提示行数" prop="totalCount"/>
<el-table-column label="实际行数" prop="realCount"/>
@ -105,12 +126,35 @@
<el-divider></el-divider>
<span>详情</span><span>{{ dialog.content }}</span>
</el-dialog>
<el-dialog title="重新下载"
:visible.sync="dialog2.visible"
width="650px">
<el-form label-width="60px">
<el-form-item>
<span style="color: #000; margin-left: 10px; margin-right: 6px"
>日期:</span>
<el-date-picker
v-model="dialog2.dateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="downloadDatas"> </el-button>
<el-button @click="dialog2.visible=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {logList,downloadByDay} from "@/api/UDIDownload/jobLog"
import {logList,downloadByDay,downloadByDays} from "@/api/UDIDownload/jobLog"
export default {
name: "jobLog",
@ -121,10 +165,12 @@ export default {
value: "warning",
label: "警告信息"
}, {value: "info", label: "正常信息"}],
downloadTypeOptions:[{value:"",label:"全部"},{value:"auto",label:"自动"},{value:"manual",label:"手动"}],
queryParams: {
page: 1,
limit: 10,
type: ""
type: "",
downloadType:''
},
loading: false,
list: [],
@ -135,6 +181,10 @@ export default {
msg:"",
content: ""
},
dialog2:{
visible: false,
dateRange: [],
},
pickerOptions: {
shortcuts: [
{
@ -199,11 +249,15 @@ export default {
this.getList();
},
getType(type) {
for (let i = 0; i < this.typeOptions.length; i++) {
return this.selectDictLabel(this.typeOptions,type);
/* for (let i = 0; i < this.typeOptions.length; i++) {
if (this.typeOptions[i].value == type)
return this.typeOptions[i].label;
}
return "未知";
return "未知";*/
},
getDownloadType(type){
return this.selectDictLabel(this.downloadTypeOptions,type);
},
showContent(row) {
console.log(JSON.stringify(row));
@ -242,17 +296,20 @@ export default {
});
});
},
//
addDateRange(params, dateRange) {
let search = params;
search.startDate = null
search.endDate = null;
if (null != dateRange && '' != dateRange) {
search.startDate = dateRange[0];
search.endDate = dateRange[1];
downloadDatas(){
let query=this.addDateRange({},this.dialog2.dateRange);
downloadByDays(query);
this.$message.info("已发送下载指令,请稍等查看日志,防止同时下载!");
this.dialog2.visible = false;
},
rowStyle({row,rowIndex}){
let rowBackground={};
if(row.type == 'error'){
//rowBackground.background="#f6f5ee";
rowBackground.color='#f60303';
}
return search;
return rowBackground;
}
}
}

Loading…
Cancel
Save