vbea 3 лет назад
Родитель
Сommit
eae9232038

+ 6 - 2
Strides-Admin/src/main.js

@@ -13,12 +13,16 @@ import locale from 'element-ui/lib/locale/lang/en'
 
 Vue.use(ElementUI, { locale })
 Vue.use(vueWaves)
-Vue.prototype.$openRoute = (route) => {
+Vue.prototype.$openRoute = (route, isResult) => {
   let sharpe = "#"
   if (route.indexOf("/") !== 0) {
     sharpe += "/";
   }
-  window.open(location.origin + location.pathname + sharpe + route);
+  if (isResult) {
+    window.open(location.origin + location.pathname + sharpe + route, "_blank", "status=no,location=no,menubar=no,toolbar=no,left=200");
+  } else {
+    window.open(location.origin + location.pathname + sharpe + route);
+  }
 }
 
 new Vue({

+ 7 - 1
Strides-Admin/src/views/charging/ConfigureStations.vue

@@ -142,9 +142,15 @@ export default {
     handleCommand(cb, item) {
       this[cb](item)
     },
-    hideDialog() {
+    hideDialog(resbound) {
+      console.log("hideDialog", resbound);
       this.actionDialog.isClear = false;
       this.actionDialog.visible = false;
+      if (resbound) {
+        setTimeout(() => {
+          this.getTableData();
+        }, 2000);
+      }
     },
     setChargingProfile(row) {
       this.actionDialog.isEdit = false;

+ 5 - 5
Strides-Admin/src/views/charging/components/DialogClearProfiles.vue

@@ -2,7 +2,7 @@
   <el-dialog
     class="dialog-profile"
     :visible="visible"
-    :before-close="hideDialog"
+    :before-close="e => hideDialog()"
     title="Clear Charging Profile">
     <el-form
       ref="setForm"
@@ -123,8 +123,8 @@ export default {
     this.getProfileOptions();
   },
   methods: {
-    hideDialog() {
-      this.$emit("hide");
+    hideDialog(success) {
+      this.$emit("hide", success || false);
       this.params = {
         filterType: "ChargingProfileId",
         stackLevel: "",
@@ -185,10 +185,10 @@ export default {
         params.connectorId = this.item.connectorId
       }
       ocpp.sendPerform("ocppOperations/clearChargingProfile", params).then(res => {
-        this.hideDialog();
+        this.hideDialog(true);
         this.loading = false;
         if (res.data.taskId) {
-          this.$openRoute("/ocpp-operations/result/" + res.data.taskId);
+          this.$openRoute("/ocpp-operations/result/" + res.data.taskId, true);
           //this.$router.push({path: '/ocpp-operations/result/' + res.data.taskId});
         }
       }).catch(err => {

+ 5 - 5
Strides-Admin/src/views/charging/components/DialogSetProfiles.vue

@@ -2,7 +2,7 @@
   <el-dialog
     class="dialog-profile"
     :visible="visible"
-    :before-close="hideDialog"
+    :before-close="e => hideDialog()"
     :title='isEdit ? "Edit Charging Profile" : "Set Charging Profile"'>
     <el-form
       ref="setForm"
@@ -92,8 +92,8 @@ export default {
     this.getProfileOptions();
   },
   methods: {
-    hideDialog() {
-      this.$emit("hide");
+    hideDialog(success) {
+      this.$emit("hide", success || false);
       this.chargingProfilePk = "";
       this.$nextTick(() => {
         this.$refs['setForm'].clearValidate();
@@ -127,10 +127,10 @@ export default {
         chargingProfilePk: this.chargingProfilePk
       }
       ocpp.sendPerform("ocppOperations/setChargingProfile", params).then(res => {
-        this.hideDialog();
+        this.hideDialog(true);
         this.loading = false;
         if (res.data.taskId) {
-          this.$openRoute("/ocpp-operations/result/" + res.data.taskId);
+          this.$openRoute("/ocpp-operations/result/" + res.data.taskId, true);
           //this.$router.push({path: '/ocpp-operations/result/' + res.data.taskId});
         }
       }).catch(err => {