Просмотр исходного кода

Mask off the Delete & Edit button for Support Role
https://dev.wormwood.com.sg/zentao/task-view-498.html

vbea 1 год назад
Родитель
Сommit
5014337825
1 измененных файлов с 66 добавлено и 31 удалено
  1. 66 31
      Strides-Admin/src/views/charge/RegisteredChargeStations.vue

+ 66 - 31
Strides-Admin/src/views/charge/RegisteredChargeStations.vue

@@ -87,7 +87,7 @@
             <div
               class="link-type"
               @click="editStation(row)"
-              v-if="row.dataStatus != 'Inactive'">
+              v-if="!$route.meta.onlyView && row.dataStatus != 'Inactive'">
               {{row.chargeBoxId}}
             </div>
             <span v-else>{{ row.chargeBoxId }}</span>
@@ -140,38 +140,71 @@
         prop="dataStatus"
         min-width="90"/>
       <el-table-column
-        v-if="!$route.meta.onlyView"
+        v-if="appName == 'FPNC'"
         label="Action"
         align="center"
         min-width="70">
-          <template slot-scope="{row}" v-if="row.dataStatus != 'Inactive'">
-            <el-dropdown
-              class="action-dropdown"
-              @command="(v) => handleCommand(v, row)">
-              <i class="el-icon-more icon-action"></i>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item
-                  command="editStation">
-                  Edit
-                </el-dropdown-item>
-                <el-dropdown-item
-                  command="softReset">
-                  Soft Reset
-                </el-dropdown-item>
-                <el-dropdown-item
-                  command="hardReset">
-                  Hard Reset
-                </el-dropdown-item>
-                <el-dropdown-item
-                  command="delStation">
-                  Delete
-                </el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-            <!-- <TableAction
-              @edit="editStation(row)"
-              @delete="delStation(row)"/> -->
-          </template>
+        <template slot-scope="{row}" v-if="row.dataStatus != 'Inactive'">
+          <el-dropdown
+            class="action-dropdown"
+            @command="(v) => handleCommand(v, row)">
+            <i class="el-icon-more icon-action"></i>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                command="editStation"
+                v-if="!$route.meta.onlyView">
+                Edit
+              </el-dropdown-item>
+              <el-dropdown-item
+                command="softReset">
+                Soft Reset
+              </el-dropdown-item>
+              <el-dropdown-item
+                command="hardReset">
+                Hard Reset
+              </el-dropdown-item>
+              <el-dropdown-item
+                command="delStation"
+                v-if="!$route.meta.onlyView">
+                Delete
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+      <el-table-column
+        v-else-if="!$route.meta.onlyView"
+        label="Action"
+        align="center"
+        min-width="70">
+        <template slot-scope="{row}" v-if="row.dataStatus != 'Inactive'">
+          <el-dropdown
+            class="action-dropdown"
+            @command="(v) => handleCommand(v, row)">
+            <i class="el-icon-more icon-action"></i>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                command="editStation">
+                Edit
+              </el-dropdown-item>
+              <el-dropdown-item
+                command="softReset">
+                Soft Reset
+              </el-dropdown-item>
+              <el-dropdown-item
+                command="hardReset">
+                Hard Reset
+              </el-dropdown-item>
+              <el-dropdown-item
+                command="delStation">
+                Delete
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+          <!-- <TableAction
+            @edit="editStation(row)"
+            @delete="delStation(row)"/> -->
+        </template>
       </el-table-column>
     </el-table>
     <div class="right">
@@ -190,6 +223,7 @@ import Pagination from '@/components/Pagination'
 import TableAction from '@/components/TableAction.vue'
 import api from '../../http/api/charge'
 import ocpp from '../../http/api/ocpp'
+import settings from '../../settings'
 import {getServiceProviderOptions} from '../../utils'
 export default {
   components: { Pagination, TableAction },
@@ -211,7 +245,8 @@ export default {
       statusOptions: [],
       providerOptions: [],
       total: 1,
-      sitePk: ""
+      sitePk: "",
+      appName: settings.projectName
     }
   },
   created() {