|
@@ -516,8 +516,20 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <el-divider>映射点表配置</el-divider>
|
|
|
- <WindCodeAndTypeForPlt ref="forPltRef"></WindCodeAndTypeForPlt>
|
|
|
+ <el-divider
|
|
|
+ v-if="
|
|
|
+ editTransferStateForm.transferTypeName !== '故障' &&
|
|
|
+ editTransferStateForm.transferTypeName !== '告警'
|
|
|
+ "
|
|
|
+ >映射点表配置</el-divider
|
|
|
+ >
|
|
|
+ <WindCodeAndTypeForPlt
|
|
|
+ v-if="
|
|
|
+ editTransferStateForm.transferTypeName !== '故障' &&
|
|
|
+ editTransferStateForm.transferTypeName !== '告警'
|
|
|
+ "
|
|
|
+ ref="forPltRef"
|
|
|
+ ></WindCodeAndTypeForPlt>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="editstateCancel('editStateForm')" size="small"
|
|
|
>取 消</el-button
|
|
@@ -745,53 +757,64 @@ export default {
|
|
|
.then((_) => {
|
|
|
const token = JSON.parse(sessionStorage.getItem("vuex"))?.auth
|
|
|
?.userInfo?.token;
|
|
|
- axios
|
|
|
- .post(
|
|
|
- "/transDataWeb/transConf/insertOrUpdate",
|
|
|
- {
|
|
|
- type: this.forPltFrom.transferType,
|
|
|
- windCode: this.forPltFrom.fieldCode,
|
|
|
- windName: this.forPltFrom.fieldName,
|
|
|
- ...this.$refs.forPltRef.formData,
|
|
|
- },
|
|
|
- {
|
|
|
- headers: {
|
|
|
- token,
|
|
|
+ try {
|
|
|
+ axios
|
|
|
+ .post(
|
|
|
+ "/transDataWeb/transConf/insertOrUpdate",
|
|
|
+ {
|
|
|
+ type: this.forPltFrom.transferType,
|
|
|
+ windCode: this.forPltFrom.fieldCode,
|
|
|
+ windName: this.forPltFrom.fieldName,
|
|
|
+ ...(this.$refs.forPltRef && this.$refs.forPltRef.formData
|
|
|
+ ? this.$refs.forPltRef.formData
|
|
|
+ : {}),
|
|
|
},
|
|
|
- }
|
|
|
- )
|
|
|
- .then((pltRes) => {
|
|
|
- if (pltRes.data.code === 200) {
|
|
|
- dataTransfer({
|
|
|
- dataTransferAddr:
|
|
|
- this.editTransferStateForm.dataTransferTypePath,
|
|
|
- dataTransferType: this.editTransferStateForm.transferType,
|
|
|
- batchCode: this.editTransferStateForm.batchCode,
|
|
|
- timeGranularity:
|
|
|
- this.editTransferStateForm.timeGranularity,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "操作成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.$refs.forPltRef.reset("fromPlt");
|
|
|
- this.fetchData();
|
|
|
- this.editstateCancel();
|
|
|
+ {
|
|
|
+ headers: {
|
|
|
+ token,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then((pltRes) => {
|
|
|
+ if (pltRes.data.code === 200) {
|
|
|
+ dataTransfer({
|
|
|
+ dataTransferAddr:
|
|
|
+ this.editTransferStateForm.dataTransferTypePath,
|
|
|
+ dataTransferType:
|
|
|
+ this.editTransferStateForm.transferType,
|
|
|
+ batchCode: this.editTransferStateForm.batchCode,
|
|
|
+ timeGranularity:
|
|
|
+ this.editTransferStateForm.timeGranularity,
|
|
|
})
|
|
|
- .catch((error) => {
|
|
|
- this.loadingViewEdit = false;
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ if (this.$refs.forPltRef) {
|
|
|
+ this.$refs.forPltRef.reset("fromPlt");
|
|
|
+ }
|
|
|
+
|
|
|
+ this.fetchData();
|
|
|
+ this.editstateCancel();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ this.$message({
|
|
|
+ message: pltRes.message,
|
|
|
+ type: "error",
|
|
|
});
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: pltRes.message,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- this.loadingViewEdit = false;
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.loadingViewEdit = false;
|
|
|
+ });
|
|
|
+ } catch (err) {
|
|
|
+ this.loadingViewEdit = true;
|
|
|
+ }
|
|
|
})
|
|
|
.catch((_) => {
|
|
|
this.loadingViewEdit = false;
|
|
@@ -817,11 +840,13 @@ export default {
|
|
|
this.editTransferStateLoading = true;
|
|
|
// if (title === "重新转换") {
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.forPltRef.reset("fromPlt");
|
|
|
- this.$refs.forPltRef.reSetByWindCodeAndTypeForPlt({
|
|
|
- type: this.forPltFrom.transferType,
|
|
|
- windCode: this.forPltFrom.fieldCode,
|
|
|
- });
|
|
|
+ if (this.$refs.forPltRef) {
|
|
|
+ this.$refs.forPltRef.reset("fromPlt");
|
|
|
+ this.$refs.forPltRef.reSetByWindCodeAndTypeForPlt({
|
|
|
+ type: this.forPltFrom.transferType,
|
|
|
+ windCode: this.forPltFrom.fieldCode,
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
// } else {
|
|
|
// this.$nextTick(() => {
|