소스 검색

添加按钮级权限

DESKTOP-O04BTUJ\muzen 2 년 전
부모
커밋
5569fc1849

+ 19 - 9
src/views/music/album/index.vue

@@ -32,9 +32,12 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['music:album:add']">新增</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)"
+          v-hasPermi="['music:album:up']">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)"
+          v-hasPermi="['music:album:down']">批量下架</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -47,7 +50,8 @@
           <el-image v-if="scope.row.coverUrl" :src="scope.row.coverUrl" />
         </template>
       </el-table-column>
-      <el-table-column label="专辑类型" prop="albumType" align="center" :formatter="typeFormatter" show-overflow-tooltip />
+      <el-table-column label="专辑类型" prop="albumType" align="center" :formatter="typeFormatter"
+        show-overflow-tooltip />
       <el-table-column label="付费类型" prop="payType" align="center" :formatter="payTypeFormatter" />
       <el-table-column label="歌曲数量" prop="programCount" align="center" />
       <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformFormatter" />
@@ -60,12 +64,18 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:album:edit']"
+              style="margin-left: 10px">
+              编辑
+            </el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:album:up']">上架
+            </el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:album:delete']">删除
+            </el-button>
           </span>
-          <el-button v-else type="text" @click="getChange(scope.row, 2)">下架</el-button>
+          <el-button v-else type="text" @click="getChange(scope.row, 2)" v-hasPermi="['music:album:down']">下架
+          </el-button>
         </template>
       </el-table-column>
     </el-table>

+ 11 - 6
src/views/music/anchor/index.vue

@@ -20,7 +20,8 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['music:anchor:add']">新增</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -37,12 +38,16 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:anchor:edit']"
+              style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:anchor:up']">上架
+            </el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:anchor:delete']">删除
+            </el-button>
           </span>
-          <el-button v-else type="text" @click="getChange(scope.row, 2)">下架</el-button>
+          <el-button v-else type="text" @click="getChange(scope.row, 2)" v-hasPermi="['music:anchor:down']">下架
+          </el-button>
         </template>
       </el-table-column>
     </el-table>

+ 15 - 8
src/views/music/blog/index.vue

@@ -29,9 +29,12 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['music:blog:add']">新增</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)"
+          v-hasPermi="['music:blog:up']">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)"
+          v-hasPermi="['music:blog:down']">批量下架</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -61,12 +64,16 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:blog:edit']"
+              style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:blog:up']">上架
+            </el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:blog:delete']">删除
+            </el-button>
           </span>
-          <el-button v-else type="text" @click="getChange(scope.row, 2)">下架</el-button>
+          <el-button v-else type="text" @click="getChange(scope.row, 2)" v-hasPermi="['music:blog:down']">下架
+          </el-button>
         </template>
       </el-table-column>
     </el-table>

+ 18 - 11
src/views/music/list/index.vue

@@ -23,11 +23,14 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
-        <Upload action="/admin/program/batch/upload" multiple title="批量上传音频" @loading="loading = true" @upload="loading = false"
-          style="margin-left: 10px" />
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['music:list:add']">新增</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)"
+          v-hasPermi="['music:list:up']">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)"
+          v-hasPermi="['music:list:down']">批量下架</el-button>
+        <Upload action="/admin/program/batch/upload" multiple title="批量上传音频" @loading="loading = true"
+          @upload="loading = false" style="margin-left: 10px" v-hasPermi="['music:list:upload']" />
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -57,13 +60,17 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:list:edit']"
+              style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:list:up']">上架
+            </el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:list:delete']">删除
+            </el-button>
           </span>
-          <el-button type="text" v-else @click="getChange(scope.row, 2)">下架</el-button>
-          <Audio :src="scope.row.progaramUrl" />
+          <el-button type="text" v-else @click="getChange(scope.row, 2)" v-hasPermi="['music:list:down']">下架
+          </el-button>
+          <Audio :src="scope.row.progaramUrl" style="margin-left: 10px" />
         </template>
       </el-table-column>
     </el-table>

+ 15 - 8
src/views/music/menu/index.vue

@@ -20,9 +20,12 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['music:menu:add']">新增</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)"
+          v-hasPermi="['music:menu:up']">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)"
+          v-hasPermi="['music:menu:down']">批量下架</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -47,12 +50,16 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:menu:edit']"
+              style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:menu:up']">上架
+            </el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:menu:delete']">删除
+            </el-button>
           </span>
-          <el-button v-else type="text" @click="getChange(scope.row, 2)">下架</el-button>
+          <el-button v-else type="text" @click="getChange(scope.row, 2)" v-hasPermi="['music:menu:down']">下架
+          </el-button>
         </template>
       </el-table-column>
     </el-table>

+ 3 - 3
src/views/music/platform/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog()">新增</el-button>
+    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog()" v-hasPermi="['music:platform:add']">新增</el-button>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
@@ -9,8 +9,8 @@
       <el-table-column label="对接方式" prop="joinType" align="center" :formatter="joinTypeFormatter" />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog(scope.row.id)">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <el-button type="text" @click="getDialog(scope.row.id)" v-hasPermi="['music:platform:edit']">编辑</el-button>
+          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:platform:delete']">删除</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 11 - 11
src/views/music/program/index.vue

@@ -25,9 +25,9 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()" v-hasPermi="['music:program:add']">新增</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)" v-hasPermi="['music:program:up']">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)" v-hasPermi="['music:program:down']">批量下架</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -35,11 +35,11 @@
       <el-table-column type="selection" align="center" />
       <el-table-column label="ID" prop="id" align="center" show-overflow-tooltip />
       <el-table-column label="节目名称" prop="name" align="center" show-overflow-tooltip />
-      <el-table-column label="付费类型" prop="isFree" align="center" :formatter="freeFormatter" />
+      <el-table-column label="付费类型" prop="isFree" align="center" :formatter="freeFormatter" width="100px" />
       <el-table-column label="原价 / 元" prop="price" align="center" />
       <el-table-column label="折扣价 / 元" prop="discountedPrice" align="center" />
       <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformFormatter" />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" width="100px" />
       <el-table-column label="更新时间" align="center" show-overflow-tooltip>
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
@@ -48,13 +48,13 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:program:edit']" style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:program:up']">上架</el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:program:delete']">删除</el-button>
           </span>
-          <el-button type="text" v-else @click="getChange(scope.row, 2)">下架</el-button>
-          <Audio :src="scope.row.fullUrl" />
+          <el-button type="text" v-else @click="getChange(scope.row, 2)" v-hasPermi="['music:program:down']">下架</el-button>
+          <Audio :src="scope.row.fullUrl" style="margin-left: 10px" />
         </template>
       </el-table-column>
     </el-table>

+ 9 - 9
src/views/music/radio/index.vue

@@ -30,9 +30,9 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
-        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()" v-hasPermi="['music:radio:add']">新增</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)" v-hasPermi="['music:radio:up']">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)" v-hasPermi="['music:radio:down']">批量下架</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -52,13 +52,13 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin: 0 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:radio:edit']" style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:radio:up']">上架</el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:radio:delete']">删除</el-button>
           </span>
-          <el-button v-else type="text" @click="getChange(scope.row, 2)">下架</el-button>
-          <Audio :src="scope.row.fullUrl" />
+          <el-button v-else type="text" @click="getChange(scope.row, 2)" v-hasPermi="['music:radio:down']">下架</el-button>
+          <Audio :src="scope.row.fullUrl" style="margin-left: 10px" />
         </template>
       </el-table-column>
     </el-table>

+ 11 - 6
src/views/music/singer/index.vue

@@ -31,7 +31,8 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['music:singer:add']">新增</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -50,12 +51,16 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 2" style="margin-left: 10px">
-            <el-button type="text" @click="getDetail(scope.row.id)">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 2">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['music:singer:edit']"
+              style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:singer:up']">上架
+            </el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:singer:delete']">删除
+            </el-button>
           </span>
-          <el-button type="text" v-else @click="getChange(scope.row, 2)">下架</el-button>
+          <el-button type="text" v-else @click="getChange(scope.row, 2)" v-hasPermi="['music:singer:down']">下架
+          </el-button>
         </template>
       </el-table-column>
     </el-table>

+ 6 - 6
src/views/registration/content/index.vue

@@ -27,7 +27,7 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()" v-hasPermi="['registration:content:add']">新增</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -51,12 +51,12 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 1" style="margin: 0 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="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 1">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['registration:content:edit']" style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 0)" v-hasPermi="['registration:content:up']">启用</el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['registration:content:delete']">删除</el-button>
           </span>
-          <el-button v-else type="delete" @click="getChange(scope.row, 1)">禁用</el-button>
+          <el-button v-else type="delete" @click="getChange(scope.row, 1)" v-hasPermi="['registration:content:down']">禁用</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 11 - 6
src/views/registration/exchange/index.vue

@@ -20,7 +20,8 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
+          v-hasPermi="['registration:exchange:add']">新增</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -38,12 +39,16 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 1" style="margin: 0 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="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 1">
+            <el-button type="text" @click="getDetail(scope.row.id)"
+              v-hasPermi="['registration:exchange:edit']" style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 0)" v-hasPermi="['registration:exchange:up']">
+              启用</el-button>
+            <el-button type="delete" @click="getDelete(scope.row)"
+              v-hasPermi="['registration:exchange:delete']">删除</el-button>
           </span>
-          <el-button v-else type="delete" @click="getChange(scope.row, 1)">禁用</el-button>
+          <el-button v-else type="delete" @click="getChange(scope.row, 1)"
+            v-hasPermi="['registration:exchange:down']">禁用</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 6 - 6
src/views/registration/lottery/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-form size="mini">
       <el-form-item>
-        <el-button type="primary" icon="el-icon-plus" @click="getDetail()">新增</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="getDetail()" v-hasPermi="['registration:lottery:add']">新增</el-button>
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -19,12 +19,12 @@
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <span v-if="scope.row.status === 1" style="margin: 0 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="getDelete(scope.row)">删除</el-button>
+          <span v-if="scope.row.status === 1">
+            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['registration:lottery:edit']" style="margin-left: 10px">编辑</el-button>
+            <el-button type="text" @click="getChange(scope.row, 0)" v-hasPermi="['registration:lottery:up']">启用</el-button>
+            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['registration:lottery:delete']">删除</el-button>
           </span>
-          <el-button v-else type="delete" @click="getChange(scope.row, 1)">禁用</el-button>
+          <el-button v-else type="delete" @click="getChange(scope.row, 1)" v-hasPermi="['registration:lottery:down']">禁用</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 97 - 91
src/views/registration/regConfig/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="form" ref="form" :rules="rules" label-width="auto" v-loading="loading">
+    <el-form :model="form" ref="form" :rules="rules" label-width="auto" v-loading="loading" :disabled="checkPermi(['registration:regConfig:change']) ? false : true">
       <el-form-item label="签到标题:" prop="signTitle">
         <el-input v-model="form.signTitle" placeholder="请输入签到标题" maxlength="50" show-word-limit />
       </el-form-item>
@@ -35,8 +35,7 @@
           </el-table-column>
           <el-table-column align="center">
             <template #header>
-              <el-button type="text" icon="el-icon-plus" @click="handlerPush('签到奖励')"
-                :disabled="continuePush">添加</el-button>
+              <el-button type="text" icon="el-icon-plus" @click="handlerPush('签到奖励')" :disabled="continuePush">添加</el-button>
             </template>
             <template slot-scope="scope">
               <el-button type="delete" @click="getDeleteContinue(scope)">
@@ -90,7 +89,8 @@
           placeholder="请输入签到规则" />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" @click="getSubmit">确定</el-button>
+        <el-button type="primary" @click="getSubmit">确定
+        </el-button>
       </el-form-item>
     </el-form>
   </div>
@@ -98,6 +98,7 @@
 
 <script>
 import { list, submit, removeContinue, removeListenGood } from '@/api/registration/regConfig'
+import { checkPermi } from '@/utils/permission'
 export default {
   data() {
     return {
@@ -130,7 +131,9 @@ export default {
       rewardOptions: [{
         value: 4,
         label: '积分'
-      }]
+      }],
+      // 是否只读
+      disabled: false
     }
   },
   watch: {
@@ -174,101 +177,104 @@ export default {
         removeContinue(ids).then(res => { })
       }
       this.form.pointConfigContinueRList = []
-  },
-
-  // 添加
-  handlerPush(key) {
-    if (key === '签到奖励') {
-      this.form.pointConfigContinueRList.push({
-        signDay: undefined,
-        rewardPoint: undefined,
-        status: 1,
-      })
-    } else {
-      this.form.pointConfigListenGoodList.push({
-        listenTime: undefined,
-        rewardPoint: undefined,
-        type: this.form.notifyRewardType
-      })
-    }
-  },
-
-  // 判断连续签到天数是否大于签到周期天数
-  checkSignDay(e, index) {
-    if (e > this.form.signDay) {
-      this.$message.error('连续签到天数不可大于签到周期!')
-      this.form.pointConfigContinueRList[index].signDay = undefined
-    }
-    if (this.form.pointConfigContinueRList.filter(i => i.signDay === e).length === 2) {
-      this.$message.error('此天数已存在!')
-      this.form.pointConfigContinueRList[index].signDay = undefined
-    }
-  },
-
-  // 判断收听播放奖励时是否填写重复的时间
-  checkListenTime(e, index) {
-    if (this.form.pointConfigListenGoodList.filter(i => i.listenTime === e).length === 2) {
-      this.$message.error('此时间已存在!')
-      this.form.pointConfigListenGoodList[index].listenTime = undefined
-    }
-  },
+    },
 
-  // 删除连续签到奖励
-  getDeleteContinue(scope) {
-    let title = scope.row.signDay ? scope.row.signDay : '空'
-    this.$confirm(`是否删除 连续签到天数为${title} 的数据?`, '提示', {
-      type: 'warning'
-    }).then(() => {
-      if (scope.row.id) {
-        removeContinue(scope.row.id).then(res => {
-          if (res.code !== 0) {
-            return false
-          }
+    // 添加
+    handlerPush(key) {
+      if (key === '签到奖励') {
+        this.form.pointConfigContinueRList.push({
+          signDay: undefined,
+          rewardPoint: undefined,
+          status: 1,
         })
-      }
-      this.$message.success('删除成功!')
-      this.form.pointConfigContinueRList.splice(scope.$index, 1)
-    }).catch(() => { })
-  },
-
-  // 删除收听播放奖励
-  getDeleteListenGood(scope) {
-    let title = scope.row.listenTime ? scope.row.listenTime : '空'
-    this.$confirm(`是否删除 播放时间为${title} 的数据?`, '提示', {
-      type: 'warning'
-    }).then(() => {
-      if (scope.row.id) {
-        removeListenGood({
-          id: scope.row.id
-        }).then(res => {
-          if (res.code !== 0) {
-            return false
-          }
+      } else {
+        this.form.pointConfigListenGoodList.push({
+          listenTime: undefined,
+          rewardPoint: undefined,
+          type: this.form.notifyRewardType
         })
       }
-      this.$message.success('删除成功!')
-      this.form.pointConfigListenGoodList.splice(scope.$index, 1)
-    }).catch(() => { })
+    },
 
-  },
+    // 判断连续签到天数是否大于签到周期天数
+    checkSignDay(e, index) {
+      if (e > this.form.signDay) {
+        this.$message.error('连续签到天数不可大于签到周期!')
+        this.form.pointConfigContinueRList[index].signDay = undefined
+      }
+      if (this.form.pointConfigContinueRList.filter(i => i.signDay === e).length === 2) {
+        this.$message.error('此天数已存在!')
+        this.form.pointConfigContinueRList[index].signDay = undefined
+      }
+    },
 
-  // 确定
-  getSubmit() {
-    this.$refs.form.validate((valid) => {
-      if (valid) {
-        submit(this.form).then(res => {
-          if (res.code === 0) {
-            this.$message.success('修改成功!')
-            this.getList()
-          }
-        })
-      } else {
-        return false
+    // 判断收听播放奖励时是否填写重复的时间
+    checkListenTime(e, index) {
+      if (this.form.pointConfigListenGoodList.filter(i => i.listenTime === e).length === 2) {
+        this.$message.error('此时间已存在!')
+        this.form.pointConfigListenGoodList[index].listenTime = undefined
       }
-    })
+    },
+
+    // 删除连续签到奖励
+    getDeleteContinue(scope) {
+      let title = scope.row.signDay ? scope.row.signDay : '空'
+      this.$confirm(`是否删除 连续签到天数为${title} 的数据?`, '提示', {
+        type: 'warning'
+      }).then(() => {
+        if (scope.row.id) {
+          removeContinue(scope.row.id).then(res => {
+            if (res.code !== 0) {
+              return false
+            }
+          })
+        }
+        this.$message.success('删除成功!')
+        this.form.pointConfigContinueRList.splice(scope.$index, 1)
+      }).catch(() => { })
+    },
+
+    // 删除收听播放奖励
+    getDeleteListenGood(scope) {
+      let title = scope.row.listenTime ? scope.row.listenTime : '空'
+      this.$confirm(`是否删除 播放时间为${title} 的数据?`, '提示', {
+        type: 'warning'
+      }).then(() => {
+        if (scope.row.id) {
+          removeListenGood({
+            id: scope.row.id
+          }).then(res => {
+            if (res.code !== 0) {
+              return false
+            }
+          })
+        }
+        this.$message.success('删除成功!')
+        this.form.pointConfigListenGoodList.splice(scope.$index, 1)
+      }).catch(() => { })
+
+    },
+
+    // 确定
+    getSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          submit(this.form).then(res => {
+            if (res.code === 0) {
+              this.$message.success('修改成功!')
+              this.getList()
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    
+    // 监控权限
+    checkPermi
   }
 }
-}
 </script>
 
 <style lang="scss" scoped>