|
@@ -7,10 +7,10 @@
|
|
|
:model="formInline"
|
|
|
class="demo-form-inline"
|
|
|
>
|
|
|
- <el-form-item label="批次编号:" prop="batchCode">
|
|
|
+ <el-form-item label="批次名称:" prop="batchName">
|
|
|
<el-input
|
|
|
- v-model="formInline.batchCode"
|
|
|
- placeholder="请输入批次编号"
|
|
|
+ v-model="formInline.batchName"
|
|
|
+ placeholder="请输入批次名称"
|
|
|
size="small"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
@@ -40,7 +40,6 @@
|
|
|
<div class="newly">
|
|
|
<el-button type="primary" @click="addData" size="small">新增</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
<el-table
|
|
|
class="center-align-table"
|
|
|
:data="tableData"
|
|
@@ -52,13 +51,18 @@
|
|
|
<!-- Table Columns -->
|
|
|
<el-table-column
|
|
|
fixed
|
|
|
- prop="batchCode"
|
|
|
+ prop="batchName"
|
|
|
align="center"
|
|
|
- label="批次编号"
|
|
|
- width="230"
|
|
|
+ label="批次名称"
|
|
|
+ width="200"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="fieldCode" align="center" label="风场编号">
|
|
|
+ <el-table-column
|
|
|
+ prop="fieldName"
|
|
|
+ align="center"
|
|
|
+ label="风场名称"
|
|
|
+ width="200"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="engineCount"
|
|
@@ -67,6 +71,47 @@
|
|
|
width="100"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="transferTypeName"
|
|
|
+ align="center"
|
|
|
+ label="类型"
|
|
|
+ width="200"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="transferProgress"
|
|
|
+ align="center"
|
|
|
+ label="进度"
|
|
|
+ width="200"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-progress
|
|
|
+ v-if="scope.row.transferState == 0"
|
|
|
+ :indeterminate="true"
|
|
|
+ :stroke-width="20"
|
|
|
+ :percentage="scope.row.transferProgress"
|
|
|
+ class="animated-progress"
|
|
|
+ ></el-progress>
|
|
|
+ <span v-else>/</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="" align="center" label="状态" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.transferState == -1">未转换</span>
|
|
|
+ <span v-else-if="scope.row.transferState == 0" style="color: #f90"
|
|
|
+ >转换中</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-else-if="scope.row.transferState == 1"
|
|
|
+ style="color: #4caf50"
|
|
|
+ >转换成功</span
|
|
|
+ >
|
|
|
+ <span v-else-if="scope.row.transferState == 2" style="color: #f00"
|
|
|
+ >转换失败</span
|
|
|
+ >
|
|
|
+ <span v-else>/</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="" align="center" label="异常状态" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.transferState == 2 ? "异常" : "未异常" }}
|
|
@@ -89,28 +134,11 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="" align="center" label="状态" width="100">
|
|
|
- <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="transferFinishTime"
|
|
|
align="center"
|
|
|
label="转换时间"
|
|
|
+ width="200"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -171,7 +199,6 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 弹出层 -->
|
|
|
<!-- 新增 -->
|
|
|
<el-dialog
|
|
@@ -185,21 +212,21 @@
|
|
|
<el-form ref="form" :model="newform" label-width="150px">
|
|
|
<el-row>
|
|
|
<el-form-item
|
|
|
- label="批次编号:"
|
|
|
+ label="批次名称:"
|
|
|
prop="batchCode"
|
|
|
:rules="batchCodeRules"
|
|
|
>
|
|
|
<el-select
|
|
|
filterable
|
|
|
v-model="newform.batchCode"
|
|
|
- placeholder="请选择批次编号"
|
|
|
+ placeholder="请选择批次名称"
|
|
|
size="small"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in batchList"
|
|
|
- :key="item"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
+ :key="item.batchCode"
|
|
|
+ :label="item.batchName"
|
|
|
+ :value="item.batchCode"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -267,31 +294,37 @@
|
|
|
:rules="editRules"
|
|
|
>
|
|
|
<el-row>
|
|
|
- <el-form-item label="批次编号:" prop="batchCode">
|
|
|
+ <el-form-item label="批次名称:" prop="batchCode">
|
|
|
<el-select
|
|
|
- v-model="newEditForm.batchCode"
|
|
|
- placeholder="请选择批次编号"
|
|
|
+ v-model="newEditForm.batchName"
|
|
|
+ placeholder="请选择批次名称"
|
|
|
size="small"
|
|
|
disabled
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in batchList"
|
|
|
- :key="item"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
+ :key="item.batchCode"
|
|
|
+ :label="item.batchName"
|
|
|
+ :value="item.batchCode"
|
|
|
></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.transferAddr"
|
|
|
- >
|
|
|
+ <el-form-item prop="dataTransferTypePathDtoList.0.transferAddr">
|
|
|
+ <span slot="label">
|
|
|
+ <el-tooltip
|
|
|
+ content="路径输入例如:/XX/XX/XX路径"
|
|
|
+ placement="bottom-start"
|
|
|
+ >
|
|
|
+ <i class="el-icon-question"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ {{
|
|
|
+ newEditForm.dataTransferTypePathDtoList[0]
|
|
|
+ .transferTypeName + ":"
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
<!-- :rules="{
|
|
|
required: true,
|
|
|
message:
|
|
@@ -309,7 +342,8 @@
|
|
|
newEditForm.dataTransferTypePathDtoList[0].transferTypeName
|
|
|
"
|
|
|
size="small"
|
|
|
- ></el-input>
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="13">
|
|
@@ -346,6 +380,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row> </el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="editCancel('editForm')" size="small"
|
|
@@ -370,7 +405,7 @@
|
|
|
<el-dialog
|
|
|
:title="editTransferStateTitle"
|
|
|
:visible.sync="editTransferStateLoading"
|
|
|
- width="400px"
|
|
|
+ width="900px"
|
|
|
:before-close="handleCloses"
|
|
|
>
|
|
|
<div v-loading="loadingViewEdit" class="views">
|
|
@@ -379,21 +414,73 @@
|
|
|
: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-row>
|
|
|
+ <el-form-item label="批次名称:" prop="batchCode">
|
|
|
+ <el-select
|
|
|
+ v-model="editTransferStateForm.batchName"
|
|
|
+ placeholder="请选择批次名称"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in batchList"
|
|
|
+ :key="item.batchCode"
|
|
|
+ :label="item.batchName"
|
|
|
+ :value="item.batchCode"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ prop="dataTransferTypePath"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: `请输入${editTransferStateForm.transferTypeName}`,
|
|
|
+ trigger: 'blur',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <span slot="label">
|
|
|
+ <el-tooltip
|
|
|
+ content="路径输入例如:/XX/XX/XX路径"
|
|
|
+ placement="bottom-start"
|
|
|
+ >
|
|
|
+ <i class="el-icon-question"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ {{ editTransferStateForm.transferTypeName + ":" }}
|
|
|
+ </span>
|
|
|
+ <el-input
|
|
|
+ v-model="editTransferStateForm.dataTransferTypePath"
|
|
|
+ :placeholder="'请输入数据转换路径'"
|
|
|
+ size="small"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="时间粒度"
|
|
|
+ prop="timeGranularity"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '请输入时间粒度',
|
|
|
+ trigger: 'blur',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="1"
|
|
|
+ v-model="editTransferStateForm.timeGranularity"
|
|
|
+ placeholder="
|
|
|
+ 请输入时间粒度
|
|
|
+ "
|
|
|
+ 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="editstateCancel('editStateForm')" size="small"
|
|
@@ -422,16 +509,22 @@ import axios from "axios";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ intervalId: null,
|
|
|
+ startTime: null,
|
|
|
+ maxPollingTime: 5 * 60 * 1000, //轮询最大时间
|
|
|
loading: false,
|
|
|
editTransferStateForm: {
|
|
|
transferAddr: "",
|
|
|
dataTransferTypePath: "",
|
|
|
+ batchName: "",
|
|
|
+ batchCode: "",
|
|
|
+ timeGranularity: "",
|
|
|
},
|
|
|
editTransferStateTitle: "",
|
|
|
editTransferStateLoading: false,
|
|
|
loadingView: false,
|
|
|
formInline: {
|
|
|
- batchCode: "",
|
|
|
+ batchName: "",
|
|
|
transferState: "",
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
@@ -489,6 +582,7 @@ export default {
|
|
|
loadingViewEdit: false,
|
|
|
newEditForm: {
|
|
|
batchCode: "",
|
|
|
+ batchName: "",
|
|
|
dataTransferTypePathDtoList: [{}],
|
|
|
},
|
|
|
};
|
|
@@ -514,7 +608,14 @@ export default {
|
|
|
editstateCancel(formName) {
|
|
|
this.$refs[formName] && this.$refs[formName].resetFields();
|
|
|
this.editTransferStateForm = {
|
|
|
- dataTransferTypePath: null,
|
|
|
+ transferAddr: "",
|
|
|
+ dataTransferTypePath: "",
|
|
|
+ batchName: "",
|
|
|
+ batchCode: "",
|
|
|
+ timeGranularity: "",
|
|
|
+ transferType: "",
|
|
|
+ transferTypeName: "",
|
|
|
+ timeGranularityName: "",
|
|
|
};
|
|
|
this.editTransferStateLoading = false;
|
|
|
this.loadingViewEdit = false;
|
|
@@ -528,6 +629,7 @@ export default {
|
|
|
dataTransferAddr: this.editTransferStateForm.dataTransferTypePath,
|
|
|
dataTransferType: this.editTransferStateForm.transferType,
|
|
|
batchCode: this.editTransferStateForm.batchCode,
|
|
|
+ timeGranularity: this.editTransferStateForm.timeGranularity,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.$message({
|
|
@@ -547,14 +649,25 @@ export default {
|
|
|
},
|
|
|
//转换\重新转换
|
|
|
editTransferState(row, title) {
|
|
|
- this.editTransferStateForm = row;
|
|
|
+ console.log(row, "row");
|
|
|
+ this.editTransferStateForm.timeGranularity = row.timeGranularity;
|
|
|
+ this.editTransferStateForm.dataTransferTypePath = row.transferAddr
|
|
|
+ ? row.transferAddr
|
|
|
+ : "";
|
|
|
+ this.editTransferStateForm.batchCode = row.batchCode;
|
|
|
+ this.editTransferStateForm.batchName = row.batchName;
|
|
|
+ this.editTransferStateForm.transferType = row.transferType;
|
|
|
+ this.editTransferStateForm.transferTypeName = row.transferTypeName;
|
|
|
+ this.editTransferStateForm.timeGranularityName = row.timeGranularityName;
|
|
|
this.editTransferStateTitle = title;
|
|
|
this.editTransferStateLoading = true;
|
|
|
},
|
|
|
handleEdit(row) {
|
|
|
this.editNuedialog = true;
|
|
|
this.newEditForm.batchCode = row.batchCode;
|
|
|
- this.newEditForm.dataTransferTypePathDtoList[0] = row;
|
|
|
+ this.newEditForm.batchName = row.batchName;
|
|
|
+ this.newEditForm.dataTransferTypePathDtoList[0] = { ...row };
|
|
|
+ console.log(this.newEditForm.dataTransferTypePathDtoList[0], "编辑");
|
|
|
},
|
|
|
editCancel() {
|
|
|
this.newform = {
|
|
@@ -783,6 +896,44 @@ export default {
|
|
|
this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
+ async fetchData() {
|
|
|
+ try {
|
|
|
+ const result = await queryDataTransferList({
|
|
|
+ ...this.formInline,
|
|
|
+ totalSize: undefined,
|
|
|
+ });
|
|
|
+ this.tableData = result.data.list;
|
|
|
+ this.formInline.totalSize = result.data.totalSize;
|
|
|
+ } catch (error) {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: "请检查是否连接网络",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ stopPolling() {
|
|
|
+ if (this.intervalId) {
|
|
|
+ clearInterval(this.intervalId);
|
|
|
+ this.intervalId = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ startPolling() {
|
|
|
+ this.startTime = new Date().getTime();
|
|
|
+ this.intervalId = setInterval(() => {
|
|
|
+ const currentTime = new Date().getTime();
|
|
|
+ if (currentTime - this.startTime >= this.maxPollingTime) {
|
|
|
+ this.stopPolling();
|
|
|
+ } else {
|
|
|
+ this.fetchData();
|
|
|
+ }
|
|
|
+ }, 10000); // 每10秒调用一次
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.startPolling();
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ this.stopPolling();
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -803,3 +954,43 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+<style scoped>
|
|
|
+@keyframes indeterminate {
|
|
|
+ 0% {
|
|
|
+ left: -100%;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ 50% {
|
|
|
+ left: 100%;
|
|
|
+ width: 10%;
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ left: 100%;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+::v-deep .el-progress__text {
|
|
|
+ font-size: 14px !important;
|
|
|
+}
|
|
|
+.el-progress-bar__outer {
|
|
|
+ position: relative;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+.el-progress-bar__inner {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ height: 100%;
|
|
|
+ text-align: right;
|
|
|
+ border-radius: 100px;
|
|
|
+ line-height: 1;
|
|
|
+ white-space: nowrap;
|
|
|
+ transition: width 0.6s ease;
|
|
|
+}
|
|
|
+.animated-progress .el-progress-bar__inner {
|
|
|
+ position: relative;
|
|
|
+ transform: translateZ(0);
|
|
|
+ animation: indeterminate 3s infinite;
|
|
|
+ background-color: #409eff; /* 或者你想要的任何颜色 */
|
|
|
+}
|
|
|
+</style>
|