|
@@ -1,166 +1,699 @@
|
|
|
<template>
|
|
|
- <div class="global-variable">
|
|
|
- <div class="condition">
|
|
|
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
|
- <el-form-item label="批次编号:">
|
|
|
- <el-input v-model="formInline.user" placeholder="请输入批次编号" size="small"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态:">
|
|
|
- <el-select v-model="formInline.region" placeholder="活动区域" size="small ">
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="onSubmit" size="small">查询</el-button>
|
|
|
- <el-button @click="reset" size="small">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <div class="list-page">
|
|
|
- <div class="newly">
|
|
|
- <el-button type="primary" @click="nuedialog = true" size="small">新增</el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-table class="center-align-table" :data="tableData" border :cell-style="rowStyle" stripe
|
|
|
- style="width: 100%">
|
|
|
- <!-- Table Columns -->
|
|
|
- <el-table-column fixed prop="" align="center" label="批次编号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="" align="center" label="风场编号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="" align="center" label="机组数量" width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="" align="center" label="异常状态" width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="abnormal" label="异常信息" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button v-if="scope.row.abnormal == 1" @click="particulars(scope.row)" type="text"
|
|
|
- size="small">详情</el-button>
|
|
|
- <span v-else>/</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="" align="center" label="转换时间">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="" align="center" label="状态" width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="" align="center" label="类型" width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="transition" align="center" fixed="right" label="操作" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small">下载</el-button>
|
|
|
- <el-button v-if="scope.row.transition == 1" @click="transition(scope.row)" type="text"
|
|
|
- size="small">转换</el-button>
|
|
|
- <el-button v-else @click="reconverted(scope.row)" type="text" size="small">重新转换</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="pagination-container">
|
|
|
- <el-pagination :page-size="10" :pager-count="11" layout="total, prev, pager, next" :total="35">
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <!-- 弹出层 -->
|
|
|
- <!-- 新增 -->
|
|
|
- <el-dialog title="新增" :visible.sync="nuedialog" width="380px">
|
|
|
- <el-form ref="form" :model="newform" label-width="120px">
|
|
|
- <el-form-item label="批次编号:">
|
|
|
- <el-select v-model="newform.batch" placeholder="请选择活动区域" size="small">
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="分钟级数据路径:">
|
|
|
- <el-input v-model="newform.name" size="small"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="秒级数据路径:">
|
|
|
- <el-input v-model="newform.name" size="small"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="测风塔数据路径:">
|
|
|
- <el-input v-model="newform.name" size="small"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="事件数据路径:">
|
|
|
- <el-input v-model="newform.name" size="small"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="nuedialog = false" size="small">取 消</el-button>
|
|
|
- <el-button type="primary" @click="newly" size="small">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 异常信息详情 -->
|
|
|
- <el-dialog title="异常详情" :visible.sync="unusualdialog" width="800px">
|
|
|
-
|
|
|
-
|
|
|
+ <div class="global-variable">
|
|
|
+ <div class="condition">
|
|
|
+ <el-form
|
|
|
+ ref="ruleForm"
|
|
|
+ :inline="true"
|
|
|
+ :model="formInline"
|
|
|
+ class="demo-form-inline"
|
|
|
+ >
|
|
|
+ <el-form-item label="批次编号:" prop="batchCode">
|
|
|
+ <el-input
|
|
|
+ v-model="formInline.batchCode"
|
|
|
+ placeholder="请输入批次编号"
|
|
|
+ size="small"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态:" prop="transferState">
|
|
|
+ <el-select
|
|
|
+ v-model="formInline.transferState"
|
|
|
+ placeholder="请选择状态"
|
|
|
+ size="small "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in stateDataList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.lable"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="onSubmit" size="small"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="reset('ruleForm')" size="small">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="list-page">
|
|
|
+ <div class="newly">
|
|
|
+ <el-button type="primary" @click="addData" size="small">新增</el-button>
|
|
|
+ </div>
|
|
|
|
|
|
- </el-dialog>
|
|
|
+ <el-table
|
|
|
+ class="center-align-table"
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ :cell-style="rowStyle"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <!-- Table Columns -->
|
|
|
+ <el-table-column fixed prop="batchCode" align="center" label="批次编号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="fieldCode" align="center" label="风场编号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="engineCount"
|
|
|
+ align="center"
|
|
|
+ label="机组数量"
|
|
|
+ width="100"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="异常状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.transferState == 2 ? "异常" : "未异常" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="abnormal" label="异常信息">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.transferState == 2"
|
|
|
+ @click="particulars(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >详情</el-button
|
|
|
+ >
|
|
|
+ <span v-else>/</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="transferFinishTime"
|
|
|
+ align="center"
|
|
|
+ label="转换时间"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.row.transferState == -1
|
|
|
+ ? "未转换"
|
|
|
+ : scope.row.transferState == 0
|
|
|
+ ? "转换中"
|
|
|
+ : scope.row.transferState == 1
|
|
|
+ ? "转换成功"
|
|
|
+ : scope.row.transferState == 2
|
|
|
+ ? "转换失败"
|
|
|
+ : "/"
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="transferTypeName" align="center" label="类型">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="transition"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ width="150"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="handleEdit(scope.row)" type="text" size="small"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
+ >下载</el-button
|
|
|
+ >
|
|
|
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ scope.row.transferState == -1 &&
|
|
|
+ (scope.row.transferFileAddr === null ||
|
|
|
+ scope.row.transferFileAddr === '')
|
|
|
+ "
|
|
|
+ @click="editTransferState(scope.row, '转换')"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >转换</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-else
|
|
|
+ @click="editTransferState(scope.row, '重新转换')"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >重新转换</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="pagination-container">
|
|
|
+ <el-pagination
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page.sync="formInline.pageNum"
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :page-size="formInline.pageSize"
|
|
|
+ :total="formInline.totalSize"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-</template>
|
|
|
|
|
|
+ <!-- 弹出层 -->
|
|
|
+ <!-- 新增 -->
|
|
|
+ <el-dialog
|
|
|
+ title="新增"
|
|
|
+ :visible.sync="nuedialog"
|
|
|
+ class="dialogBox"
|
|
|
+ width="900px"
|
|
|
+ >
|
|
|
+ <div v-loading="loadingView" class="views">
|
|
|
+ <el-form ref="form" :model="newform" label-width="150px">
|
|
|
+ <el-row>
|
|
|
+ <el-form-item
|
|
|
+ label="批次编号:"
|
|
|
+ prop="batchCode"
|
|
|
+ :rules="batchCodeRules"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="newform.batchCode"
|
|
|
+ placeholder="请选择批次编号"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in batchList"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ v-for="(item, index) in newform.dataTransferTypePathDtoList"
|
|
|
+ :key="item.transferType"
|
|
|
+ >
|
|
|
+ <el-col :span="11">
|
|
|
+ <el-form-item
|
|
|
+ :label="item.transferTypeName + ':'"
|
|
|
+ :prop="'transferFileAddr_' + index"
|
|
|
+ :rules="getFileAddrRules(index)"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="item.transferFileAddr"
|
|
|
+ :placeholder="'请输入' + item.transferTypeName"
|
|
|
+ size="small"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="13">
|
|
|
+ <el-form-item
|
|
|
+ :label="item.timeGranularityName + ':'"
|
|
|
+ :prop="'timeGranularity_' + index"
|
|
|
+ :rules="getTimeGranularityRules(index)"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ v-model="item.timeGranularity"
|
|
|
+ :placeholder="'请输入' + item.timeGranularityName"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <template slot="append">秒</template></el-input
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancel('form')" size="small">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="newly('form')" size="small"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 编辑 -->
|
|
|
+ <el-dialog
|
|
|
+ title="编辑"
|
|
|
+ :visible.sync="editNuedialog"
|
|
|
+ class="dialogBox"
|
|
|
+ width="900px"
|
|
|
+ >
|
|
|
+ <div v-loading="loadingViewEdit" class="views">
|
|
|
+ <el-form
|
|
|
+ ref="editForm"
|
|
|
+ :model="newEditForm"
|
|
|
+ label-width="160px"
|
|
|
+ :rules="editRules"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="批次编号:" prop="batchCode">
|
|
|
+ <el-select
|
|
|
+ v-model="newEditForm.batchCode"
|
|
|
+ placeholder="请选择批次编号"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in batchList"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="11">
|
|
|
+ <el-form-item
|
|
|
+ :label="
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0].transferTypeName +
|
|
|
+ ':'
|
|
|
+ "
|
|
|
+ prop="dataTransferTypePathDtoList.0.transferFileAddr"
|
|
|
+ >
|
|
|
+ <!-- :rules="{
|
|
|
+ required: true,
|
|
|
+ message:
|
|
|
+ '请输入' +
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0].transferTypeName,
|
|
|
+ trigger: 'blur',
|
|
|
+ }" -->
|
|
|
+ <el-input
|
|
|
+ disabled
|
|
|
+ v-model="
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0].transferFileAddr
|
|
|
+ "
|
|
|
+ :placeholder="
|
|
|
+ '请输入' +
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0].transferTypeName
|
|
|
+ "
|
|
|
+ size="small"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="13">
|
|
|
+ <el-form-item
|
|
|
+ :label="
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0]
|
|
|
+ .timeGranularityName + ':'
|
|
|
+ "
|
|
|
+ prop="dataTransferTypePathDtoList.0.timeGranularity"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message:
|
|
|
+ '请输入' +
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0]
|
|
|
+ .timeGranularityName,
|
|
|
+ trigger: 'blur',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ v-model="
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0].timeGranularity
|
|
|
+ "
|
|
|
+ :placeholder="
|
|
|
+ '请输入' +
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0]
|
|
|
+ .timeGranularityName
|
|
|
+ "
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <template slot="append">秒</template></el-input
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="editCancel('editForm')" size="small"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="editly('editForm')" size="small"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 异常信息详情 -->
|
|
|
+ <el-dialog title="异常详情" :visible.sync="unusualdialog" width="800px">
|
|
|
+ {{ errInfo }}
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 转换\重新转换 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="editTransferStateTitle"
|
|
|
+ :visible.sync="editTransferStateLoading"
|
|
|
+ width="400px"
|
|
|
+ >
|
|
|
+ <div v-loading="loadingViewEdit" class="views">
|
|
|
+ <el-form
|
|
|
+ ref="editStateForm"
|
|
|
+ :model="editTransferStateForm"
|
|
|
+ label-width="160px"
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ label="数据转换路径:"
|
|
|
+ prop="dataTransferTypePath"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '请输入数据转换路径',
|
|
|
+ trigger: 'blur',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="editTransferStateForm.dataTransferTypePath"
|
|
|
+ :placeholder="'请输入数据转换路径'"
|
|
|
+ size="small"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="editstateCancel('editStateForm')" size="small"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="editStately('editStateForm')"
|
|
|
+ size="small"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
<script>
|
|
|
+import {
|
|
|
+ queryDataTransferList,
|
|
|
+ fieldBatchListForDataTransfer,
|
|
|
+ addDataTransferList,
|
|
|
+ editTimeGranularityQuery,
|
|
|
+ dataTransfer,
|
|
|
+} from "@/api/dataManage";
|
|
|
+import axios from "axios";
|
|
|
export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- formInline: {
|
|
|
- user: '',
|
|
|
- region: ''
|
|
|
- },
|
|
|
- tableData: [{
|
|
|
- abnormal: "1",
|
|
|
- transition: "1"
|
|
|
- }, {
|
|
|
- abnormal: "0",
|
|
|
- transition: "0"
|
|
|
- }, {
|
|
|
- abnormal: "1",
|
|
|
- transition: "1"
|
|
|
- }],
|
|
|
- nuedialog: false,
|
|
|
- unusualdialog: false,
|
|
|
- newform: {
|
|
|
- batch: "",
|
|
|
- name: "",
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- rowStyle() {
|
|
|
- return "text-align:center";
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ editTransferStateForm: {
|
|
|
+ transferFileAddr: "",
|
|
|
+ },
|
|
|
+ editTransferStateTitle: "",
|
|
|
+ editTransferStateLoading: false,
|
|
|
+ loadingView: false,
|
|
|
+ formInline: {
|
|
|
+ batchCode: "",
|
|
|
+ transferState: "",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalSize: 0,
|
|
|
+ },
|
|
|
+ batchCodeRules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "批次编号不能为空",
|
|
|
+ trigger: ["change", "blur"],
|
|
|
},
|
|
|
-
|
|
|
- // 查询
|
|
|
- onSubmit() {
|
|
|
- console.log('submit!');
|
|
|
+ ],
|
|
|
+ editRules: {
|
|
|
+ batchCode: {
|
|
|
+ required: true,
|
|
|
+ message: "批次编号不能为空",
|
|
|
+ trigger: ["change", "blur"],
|
|
|
},
|
|
|
- // 重置
|
|
|
- reset() {
|
|
|
-
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ batchCode: {
|
|
|
+ required: true,
|
|
|
+ message: "批次编号不能为空",
|
|
|
+ trigger: "change",
|
|
|
},
|
|
|
- // 新增
|
|
|
- newly() {
|
|
|
- this.nuedialog = false
|
|
|
+ },
|
|
|
+ errInfo: "",
|
|
|
+ stateDataList: [
|
|
|
+ {
|
|
|
+ lable: "未转换",
|
|
|
+ value: -1,
|
|
|
},
|
|
|
-
|
|
|
- //异常详情
|
|
|
- particulars(row) {
|
|
|
- this.unusualdialog = true;
|
|
|
+ {
|
|
|
+ lable: "转换中",
|
|
|
+ value: 0,
|
|
|
},
|
|
|
- // 下载
|
|
|
- handleClick(row) { },
|
|
|
- // 转换
|
|
|
- transition(row) { },
|
|
|
- // 重新转换
|
|
|
- reconverted(row) { },
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+ {
|
|
|
+ lable: "转换成功",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ lable: "转换失败",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ batchList: [],
|
|
|
+ tableData: [],
|
|
|
+ nuedialog: false,
|
|
|
+ unusualdialog: false,
|
|
|
+ newform: {
|
|
|
+ batchCode: "",
|
|
|
+ dataTransferTypePathDtoList: [],
|
|
|
+ },
|
|
|
+ editNuedialog: false,
|
|
|
+ loadingViewEdit: false,
|
|
|
+ newEditForm: {
|
|
|
+ batchCode: "",
|
|
|
+ dataTransferTypePathDtoList: [{}],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getTableList();
|
|
|
+ this.getBatchCodeList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ editstateCancel(formName) {
|
|
|
+ this.$refs[formName] && this.$refs[formName].resetFields();
|
|
|
+ this.editTransferStateForm = {};
|
|
|
+ this.editTransferStateForm.dataTransferTypePath = "";
|
|
|
+ this.editTransferStateLoading = false;
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ },
|
|
|
+ editStately(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loadingViewEdit = true;
|
|
|
+ dataTransfer({
|
|
|
+ dataTransferFileAddr:
|
|
|
+ this.editTransferStateForm.dataTransferTypePath,
|
|
|
+ dataTransferType: this.editTransferStateForm.transferType,
|
|
|
+ batchCode: this.editTransferStateForm.batchCode,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: this.editTransferStateTitle + "成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.getTableList();
|
|
|
+ this.editstateCancel();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //转换\重新转换
|
|
|
+ editTransferState(row, title) {
|
|
|
+ this.editTransferStateForm = row;
|
|
|
+ this.editTransferStateTitle = title;
|
|
|
+ this.editTransferStateLoading = true;
|
|
|
+ },
|
|
|
+ handleEdit(row) {
|
|
|
+ this.editNuedialog = true;
|
|
|
+ this.newEditForm.batchCode = row.batchCode;
|
|
|
+ this.newEditForm.dataTransferTypePathDtoList[0] = row;
|
|
|
+ },
|
|
|
+ editCancel() {
|
|
|
+ this.newform = {
|
|
|
+ batchCode: "",
|
|
|
+ dataTransferTypePathDtoList: [{}],
|
|
|
+ };
|
|
|
+ this.editNuedialog = false;
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ },
|
|
|
+ editly(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loadingViewEdit = true;
|
|
|
+ editTimeGranularityQuery({
|
|
|
+ timeGranularity:
|
|
|
+ this.newEditForm.dataTransferTypePathDtoList[0].timeGranularity,
|
|
|
+ transferType:
|
|
|
+ this.newEditForm.dataTransferTypePathDtoList[0].transferType,
|
|
|
+ batchCode: this.newEditForm.batchCode,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "编辑成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.getTableList();
|
|
|
+ this.editCancel();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log("shibai", error);
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getFileAddrRules(index) {
|
|
|
+ return [{ validator: this.validateFileAddr, trigger: "blur" }];
|
|
|
+ },
|
|
|
+ getTimeGranularityRules(index) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) =>
|
|
|
+ this.validateTimeGranularity(rule, value, callback, index),
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ validateFileAddr(rule, value, callback) {
|
|
|
+ // 判断是否至少有一项 transferFileAddr 有值
|
|
|
+ const hasFileAddr = this.newform.dataTransferTypePathDtoList.some(
|
|
|
+ (item) => item.transferFileAddr
|
|
|
+ );
|
|
|
+ if (!hasFileAddr) {
|
|
|
+ callback(new Error("请至少填写一个数据路径"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ validateTimeGranularity(rule, value, callback, index) {
|
|
|
+ // 判断对应的 transferFileAddr 有值,则对应的 timeGranularity 也必须有值
|
|
|
+ const currentItem = this.newform.dataTransferTypePathDtoList[index];
|
|
|
+ if (currentItem.transferFileAddr && !currentItem.timeGranularity) {
|
|
|
+ callback(new Error("请填写时间粒度"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cancel(formName) {
|
|
|
+ this.$refs[formName] && this.$refs[formName].resetFields();
|
|
|
+ this.newform = {
|
|
|
+ batchCode: "",
|
|
|
+ dataTransferTypePathDtoList: [],
|
|
|
+ };
|
|
|
+ this.getBatchCodeList();
|
|
|
+ this.nuedialog = false;
|
|
|
+ this.loadingView = false;
|
|
|
+ },
|
|
|
+ rowStyle() {
|
|
|
+ return "text-align:center";
|
|
|
+ },
|
|
|
+ // 查询
|
|
|
+ onSubmit() {
|
|
|
+ this.getTableList();
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ reset(formName) {
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ this.getTableList();
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ newly(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ console.log(this.newform, "newform");
|
|
|
+ this.loadingView = true;
|
|
|
+ addDataTransferList({ ...this.newform })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "新增成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.getTableList();
|
|
|
+ this.cancel();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loadingView = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //异常详情
|
|
|
+ particulars(row) {
|
|
|
+ this.unusualdialog = true;
|
|
|
+ this.errInfo = row.errInfo;
|
|
|
+ },
|
|
|
+ // 下载
|
|
|
+ async handleClick(row) {
|
|
|
+ try {
|
|
|
+ const response = await axios.get("/downLoadApi", {
|
|
|
+ responseType: "text",
|
|
|
+ }); // 确保响应类型为文本
|
|
|
+ console.log(response, "结构");
|
|
|
+ const htmlContent = response.data; // HTML 内容
|
|
|
+ const blob = new Blob([htmlContent], { type: "text/html" }); // 创建 Blob 对象
|
|
|
+ const url = URL.createObjectURL(blob); // 创建临时 URL
|
|
|
+ window.open(url, "_blank"); // 在新标签页中打开该 URL
|
|
|
+ } catch (error) {
|
|
|
+ console.error("Failed to fetch data:", error);
|
|
|
+ this.$message.error("无法打开新链接");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 转换
|
|
|
+ transition(row) {},
|
|
|
+ // 重新转换
|
|
|
+ reconverted(row) {},
|
|
|
+ async getTableList() {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const result = await queryDataTransferList({
|
|
|
+ ...this.formInline,
|
|
|
+ totalSize: undefined,
|
|
|
+ });
|
|
|
+ this.tableData = result.data.list;
|
|
|
+ this.formInline.totalSize = result.data.totalSize;
|
|
|
+ this.loading = false;
|
|
|
+ } catch (error) {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: "请检查是否连接网络",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //分页数据切换
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.formInline.pageNum = val;
|
|
|
+ this.getTableList();
|
|
|
+ },
|
|
|
+ //新增按钮
|
|
|
+ addData() {
|
|
|
+ this.nuedialog = true;
|
|
|
+ },
|
|
|
+ //获取批次编号列表接口
|
|
|
+ async getBatchCodeList() {
|
|
|
+ try {
|
|
|
+ const result = await fieldBatchListForDataTransfer();
|
|
|
+ this.batchList = result.data.batchCodeList;
|
|
|
+ this.newform.dataTransferTypePathDtoList =
|
|
|
+ result.data.dataTransferTypeVoList;
|
|
|
+ } catch (error) {}
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
+::v-deep.dialogBox {
|
|
|
+ .el-form-item__content .el-input--small .el-input__inner {
|
|
|
+ width: 188px !important;
|
|
|
+ }
|
|
|
+ .el-row {
|
|
|
+ margin: 5px 0;
|
|
|
+ }
|
|
|
+ .dialog-footer {
|
|
|
+ margin-top: 20px;
|
|
|
+ justify-content: center !important;
|
|
|
+ }
|
|
|
+ .el-input-group {
|
|
|
+ width: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|