瀏覽代碼

添加权限

DESKTOP-2S67K1S\31396 2 年之前
父節點
當前提交
7613d170d3

+ 10 - 5
src/views/device/music/index.vue

@@ -13,7 +13,8 @@
       <el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" icon="el-icon-plus" plain @click="getDialog('新增')">新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" plain @click="getDialog('新增')"
+          v-hasPermi="['device:music:add']">新增</el-button>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
     <!-- 列表 -->
     <!-- 列表 -->
@@ -30,11 +31,15 @@
       <el-table-column label="操作" align="center">
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button type="text" @click="getDialog('查看', scope.row.id)">查看</el-button>
           <el-button type="text" @click="getDialog('查看', scope.row.id)">查看</el-button>
-          <el-button type="text" v-if="scope.row.status === 0" @click="getChange('禁用', scope.row, 1)">禁用</el-button>
+          <el-button type="text" v-if="scope.row.status === 0" @click="getChange('禁用', scope.row, 1)"
+            v-hasPermi="['device:music:down']">禁用</el-button>
           <span v-else>
           <span v-else>
-            <el-button type="text" style="margin-left: 10px" @click="getDialog('编辑', scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange('启用', scope.row, 0)">启用</el-button>
-            <el-button type="delete" @click="getChange('删除', scope.row, 2)">删除</el-button>
+            <el-button type="text" style="margin-left: 10px" @click="getDialog('编辑', scope.row.id)"
+              v-hasPermi="['device:music:edit']">编辑</el-button>
+            <el-button type="text" @click="getChange('启用', scope.row, 0)"
+              v-hasPermi="['device:music:up']">启用</el-button>
+            <el-button type="delete" @click="getChange('删除', scope.row, 2)"
+              v-hasPermi="['device:music:delete']">删除</el-button>
           </span>
           </span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>

+ 10 - 5
src/views/operation/dialog/index.vue

@@ -13,7 +13,8 @@
       <el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" icon="el-icon-plus" plain @click="getDialog('新增')">新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" plain @click="getDialog('新增')"
+          v-hasPermi="['operation:dialog:add']">新增</el-button>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
     <!-- 列表 -->
     <!-- 列表 -->
@@ -31,11 +32,15 @@
       <el-table-column label="操作" align="center">
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button type="text" @click="getDialog('查看', scope.row.id)">查看</el-button>
           <el-button type="text" @click="getDialog('查看', scope.row.id)">查看</el-button>
-          <el-button v-if="scope.row.status === 0" type="text" @click="getChange(scope.row, 1, '禁用')">禁用</el-button>
+          <el-button v-if="scope.row.status === 0" type="text" @click="getChange(scope.row, 1, '禁用')"
+            v-hasPermi="['operation:dialog:down']">禁用</el-button>
           <span v-else style="margin-left: 10px">
           <span v-else style="margin-left: 10px">
-            <el-button type="text" @click="getDialog('编辑', scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 0, '启用')">启用</el-button>
-            <el-button type="delete" @click="getChange(scope.row, 2, '删除')">删除</el-button>
+            <el-button type="text" @click="getDialog('编辑', scope.row.id)"
+              v-hasPermi="['operation:dialog:edit']">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 0, '启用')"
+              v-hasPermi="['operation:dialog:up']">启用</el-button>
+            <el-button type="delete" @click="getChange(scope.row, 2, '删除')"
+              v-hasPermi="['operation:dialog:delete']">删除</el-button>
           </span>
           </span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>

+ 8 - 5
src/views/operation/scene/index.vue

@@ -14,11 +14,14 @@
       <el-table-column label="操作" align="center">
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <el-button v-if="scope.row.status === 0" type="text" @click="getChange(scope.row, 1, '禁用')">禁用</el-button>
+          <el-button v-if="scope.row.status === 0" type="text" @click="getChange(scope.row, 1, '禁用')"
+            v-hasPermi="['operation:scene:down']">禁用</el-button>
           <span v-else style="margin-left: 10px">
           <span v-else style="margin-left: 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 0, '启用')">启用</el-button>
-            <el-button type="delete" @click="getChange(scope.row, 2, '删除')">删除</el-button>
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['operation:scene:edit']">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 0, '启用')"
+              v-hasPermi="['operation:scene:up']">启用</el-button>
+            <el-button type="delete" @click="getChange(scope.row, 2, '删除')"
+              v-hasPermi="['operation:scene:delete']">删除</el-button>
           </span>
           </span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
@@ -76,7 +79,7 @@ export default {
             this.getList()
             this.getList()
           }
           }
         })
         })
-      }).catch(() => {})
+      }).catch(() => { })
     },
     },
 
 
     // 字典翻译
     // 字典翻译

+ 9 - 7
src/views/service/quota/index.vue

@@ -13,7 +13,8 @@
       <el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" icon="el-icon-plus" plain @click="getDialog('新增')">新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" plain @click="getDialog('新增')"
+          v-hasPermi="['service:quota:add']">新增</el-button>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
     <!-- 列表 -->
     <!-- 列表 -->
@@ -40,7 +41,8 @@
           <el-input-number v-model="dialogForm.totalQuota" :min="1" step-strictly :controls="false" /> / 天
           <el-input-number v-model="dialogForm.totalQuota" :min="1" step-strictly :controls="false" /> / 天
         </el-form-item>
         </el-form-item>
         <el-form-item label="生效起始时间:" prop="startDate">
         <el-form-item label="生效起始时间:" prop="startDate">
-          <el-date-picker v-model="dialogForm.startDate" type="datetime" placeholder="请选择生效起始时间" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" />
+          <el-date-picker v-model="dialogForm.startDate" type="datetime" placeholder="请选择生效起始时间"
+            :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" />
         </el-form-item>
         </el-form-item>
       </el-form>
       </el-form>
       <div slot="footer">
       <div slot="footer">
@@ -89,8 +91,8 @@ export default {
       }],
       }],
       // 定义时间选择器
       // 定义时间选择器
       pickerOptions: {
       pickerOptions: {
-        disabledDate(time) { 
-          return time.getTime() < (Date.now() - (24*60*60*1000))
+        disabledDate(time) {
+          return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000))
         }
         }
       },
       },
       // 只读
       // 只读
@@ -141,15 +143,15 @@ export default {
     },
     },
 
 
     // 取消
     // 取消
-    getCancel(){
+    getCancel() {
       this.dialogVisible = false
       this.dialogVisible = false
       this.dialogForm = {}
       this.dialogForm = {}
     },
     },
 
 
     // 确定
     // 确定
-    getSubmit(){
+    getSubmit() {
       create(this.dialogForm).then(res => {
       create(this.dialogForm).then(res => {
-        if(res.code === 0) {
+        if (res.code === 0) {
           this.$message.success('新增成功!')
           this.$message.success('新增成功!')
           this.getCancel()
           this.getCancel()
           this.getList()
           this.getList()