|
@@ -224,8 +224,9 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="创建时间" prop="createTime" width="300"> </el-table-column>
|
|
|
|
- <el-table-column label="操作" prop="desc" width="150">
|
|
|
|
|
|
+ <el-table-column label="创建时间" prop="createTime" width="300">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" prop="desc" width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button @click="editor(scope.row)" type="text" size="small">
|
|
<el-button @click="editor(scope.row)" type="text" size="small">
|
|
编辑
|
|
编辑
|
|
@@ -257,6 +258,7 @@
|
|
<script>
|
|
<script>
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
import { getWindFieldNames } from "@/api/ledger.js";
|
|
import { getWindFieldNames } from "@/api/ledger.js";
|
|
|
|
+import { log } from "plotly.js-dist";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -306,6 +308,7 @@ export default {
|
|
type: "",
|
|
type: "",
|
|
path: "",
|
|
path: "",
|
|
name: "",
|
|
name: "",
|
|
|
|
+ id:null
|
|
},
|
|
},
|
|
formRules: {
|
|
formRules: {
|
|
wind: [{ required: true, message: "请选择风场", trigger: "blur" }],
|
|
wind: [{ required: true, message: "请选择风场", trigger: "blur" }],
|
|
@@ -473,6 +476,18 @@ export default {
|
|
this.transitionShow = true;
|
|
this.transitionShow = true;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ editor(row) {
|
|
|
|
+ console.log(row);
|
|
|
|
+ // return
|
|
|
|
+ this.transitionShow = true;
|
|
|
|
+ this.form.name = row.dataCollector;
|
|
|
|
+ this.form.path = row.readDir;
|
|
|
|
+ this.form.type = row.transferType;
|
|
|
|
+ this.form.wind = row.windFarmCode;
|
|
|
|
+
|
|
|
|
+ this.form.id=row.id
|
|
|
|
+ },
|
|
|
|
+
|
|
onSubmit() {
|
|
onSubmit() {
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
@@ -507,22 +522,27 @@ export default {
|
|
?.fieldName || "",
|
|
?.fieldName || "",
|
|
};
|
|
};
|
|
|
|
|
|
- axios
|
|
|
|
- .post("/ETLapi/dataTransfer/addDataTransferTask", params)
|
|
|
|
- .then((res) => {
|
|
|
|
- this.innerVisible = false;
|
|
|
|
- this.transitionShow = false;
|
|
|
|
- if (res.data.code === 200) {
|
|
|
|
- this.$message({
|
|
|
|
- message: "导入成功",
|
|
|
|
- type: "success",
|
|
|
|
- });
|
|
|
|
- this.query();
|
|
|
|
- }
|
|
|
|
- if (res.data.code === 500) {
|
|
|
|
- this.$message.error(res.data.message);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ let apiUrl = "/ETLapi/dataTransfer/addDataTransferTask"; // 默认是新增
|
|
|
|
+ if (this.form.id) {
|
|
|
|
+ // 如果有 id,说明是编辑
|
|
|
|
+ apiUrl = "/ETLapi/dataTransfer/editDataTransferTask";
|
|
|
|
+ params.id = this.form.id; // 传递 id
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ axios.post(apiUrl, params).then((res) => {
|
|
|
|
+ this.innerVisible = false;
|
|
|
|
+ this.transitionShow = false;
|
|
|
|
+ if (res.data.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "操作成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.query();
|
|
|
|
+ }
|
|
|
|
+ if (res.data.code === 500) {
|
|
|
|
+ this.$message.error(res.data.message);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|