Преглед изворни кода

feat: 处理、视频管理、歌单、签到内容配置、兑换配置、多添加一层谨慎操作提示

Damon пре 9 месеци
родитељ
комит
0b1fabd907

+ 1 - 1
src/utils/DialogUtil.js

@@ -1,7 +1,7 @@
 // 列表
 export function dialogCallBack(that, callBack) {
   that.$alert(`删除后数据不可恢复,请谨慎进行该操作!`, "温馨提示:", {
-    confirmButtonText: "我已了解"
+    confirmButtonText: "我已知晓"
   }).then(() => {
     setTimeout(() => {
       if (callBack != null) {

+ 120 - 56
src/views/content/video/index.vue

@@ -1,46 +1,105 @@
+ <!-- 内容管理 视频管理 -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="创建时间:">
-        <el-date-picker v-model="form.listDate" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期"
-          value-format="yyyy-MM-dd HH:mm:ss" />
+        <el-date-picker
+          v-model="form.listDate"
+          type="datetimerange"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd HH:mm:ss"
+        />
       </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 type="primary" icon="el-icon-plus" plain @click="getDetail()"
-          v-hasPermi="['content:video:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['content:video:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
-      <el-table-column label="序号" type="index" align="center"></el-table-column>
-      <el-table-column label="视频宣传名称" prop="name" align="center"></el-table-column>
-      <el-table-column label="更新时间" prop="updateTime" align="center"></el-table-column>
-      <el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
+      <el-table-column
+        label="序号"
+        type="index"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="视频宣传名称"
+        prop="name"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="更新时间"
+        prop="updateTime"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="创建时间"
+        prop="createTime"
+        align="center"
+      ></el-table-column>
       <el-table-column label="操作" align="center">
         <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)" v-hasPermi="['content:video:edit']">编辑</el-button>
-          <el-button type="text" v-clipboard:copy="getUrl(scope.row)" v-clipboard:success="copySuccess">复制链接</el-button>
-          <el-button type="text"  @click="getCode(scope.row.id)">下载二维码</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['content:video:delete']">删除</el-button>
-          <vue-qr :text="getUrl(scope.row)" :ref="`qrcode` + scope.row.id" style="display: none;" />
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['content:video:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="text"
+            v-clipboard:copy="getUrl(scope.row)"
+            v-clipboard:success="copySuccess"
+            >复制链接</el-button
+          >
+          <el-button type="text" @click="getCode(scope.row.id)"
+            >下载二维码</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['content:video:delete']"
+            >删除</el-button
+          >
+          <vue-qr
+            :text="getUrl(scope.row)"
+            :ref="`qrcode` + scope.row.id"
+            style="display: none"
+          />
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
 <script>
-import VueQr from 'vue-qr'
-import { list, change } from '@/api/content/video'
+import { change, list } from "@/api/content/video";
+import { dialogCallBack } from "@/utils/DialogUtil";
+import VueQr from "vue-qr";
 export default {
   components: {
-    VueQr
+    VueQr,
   },
   data() {
     return {
@@ -49,43 +108,43 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
       // 列表
-      tableData: []
-    }
+      tableData: [],
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.getList()
+      this.form.pageNum = 1;
+      this.getList();
     },
 
     // 重置
     getRefresh() {
       this.form = {
         pageNum: 1,
-        pageSize: 10
-      }
-      this.getList()
+        pageSize: 10,
+      };
+      this.getList();
     },
 
     // 新增 查看 编辑
@@ -94,40 +153,45 @@ export default {
         path: `/content/video/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // H5路径
     getUrl(e) {
-      return `${e.copyUrl}pages/devices/detail?clientType=${e.clientType}&id=${e.id}`
+      return `${e.copyUrl}pages/devices/detail?clientType=${e.clientType}&id=${e.id}`;
     },
 
     // 复制成功
     copySuccess() {
-      this.$message.success('复制成功!')
+      this.$message.success("复制成功!");
     },
 
     // 下载二维码
     getCode(id) {
-      const url = this.$refs['qrcode' + id].$el.src
-      this.$download.saveAs(url, '二维码.png')
+      const url = this.$refs["qrcode" + id].$el.src;
+      this.$download.saveAs(url, "二维码.png");
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, 2).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      })
-    }
-  }
-}
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            change(row.id, 2).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
+      });
+    },
+  },
+};
 </script>

+ 3 - 3
src/views/device/version/index.vue

@@ -177,13 +177,13 @@ export default {
         },
       });
     },
-    
+
     // 删除
     getDelete(row) {
       var that = this;
       dialogCallBack(that, function () {
         that
-          .$confirm(`是否删除${row.title}?`, "提示:", {
+          .$confirm(`是否删除${row.title}?`, "提示:", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning",
@@ -207,4 +207,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 2 - 2
src/views/music/album/index.vue

@@ -311,7 +311,7 @@ export default {
       var that = this;
       dialogCallBack(that, function () {
         that
-          .$confirm(`是否删除${row.name}?`, "提示", {
+          .$confirm(`是否删除${row.name}?`, "提示", {
             type: "warning",
           })
           .then(() => {
@@ -353,4 +353,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 90 - 48
src/views/music/blogclass/index.vue

@@ -1,29 +1,63 @@
+<!-- 音频管理 内容分类 播客分类 -->
 <template>
-  <div class='app-container'>
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog()"
-      v-hasPermi="['music:blogclass:add']">新增</el-button>
+  <div class="app-container">
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDialog()"
+      v-hasPermi="['music:blogclass:add']"
+      >新增</el-button
+    >
+
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="序号" type="index" align="center" />
       <el-table-column label="分类名称" prop="name" align="center" />
       <el-table-column label="更新时间" align="center">
         <template slot-scope="scope">
-          {{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
+          {{ parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}:{s}") }}
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog(scope.row.id)" v-hasPermi="['music:blogclass:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:blogclass:delete']">删除</el-button>
+          <el-button
+            type="text"
+            @click="getDialog(scope.row.id)"
+            v-hasPermi="['music:blogclass:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['music:blogclass:delete']"
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
     <!-- 弹窗 -->
-    <el-dialog :visible.sync="dialogVisible" :title="dialogForm.id ? '编辑' : '新增'" width="500px" :before-close="getClose">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="dialogForm.id ? '编辑' : '新增'"
+      width="500px"
+      :before-close="getClose"
+    >
       <el-form label-width="auto" :model="dialogForm" ref="dialogForm">
-        <el-form-item label="分类名称:" prop="name" :rules="[{ required: true, message: '请输入分类名称', trigger: 'blur' }]">
+        <el-form-item
+          label="分类名称:"
+          prop="name"
+          :rules="[
+            { required: true, message: '请输入分类名称', trigger: 'blur' },
+          ]"
+        >
           <el-input v-model="dialogForm.name" placeholder="请输入分类名称" />
         </el-form-item>
       </el-form>
@@ -35,8 +69,10 @@
   </div>
 </template>
 
+
 <script>
-import { list, detail, submit, change } from '@/api/music/blogclass'
+import { change, detail, list, submit } from "@/api/music/blogclass";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -45,7 +81,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
@@ -54,73 +90,79 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗表单
-      dialogForm: {}
-    }
+      dialogForm: {},
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 弹窗
     getDialog(id) {
-      this.dialogVisible = true
+      this.dialogVisible = true;
       if (id) {
-        detail(id).then(res => {
+        detail(id).then((res) => {
           if (res.code === 0) {
-            this.dialogForm = res.data
+            this.dialogForm = res.data;
           }
-        })
+        });
       }
     },
 
     // 取消
     getClose() {
-      this.dialogVisible = false
-      this.dialogForm = {}
+      this.dialogVisible = false;
+      this.dialogForm = {};
     },
 
     // 确定
     getSubmit() {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
-          submit(this.dialogForm).then(res => {
+          submit(this.dialogForm).then((res) => {
             if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.getClose()
-              this.getList()
+              this.$message.success("提交成功!");
+              this.getClose();
+              this.getList();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, 2).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
-    }
-  }
-}
-</script>
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否有删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            change(row.id, 2).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
+    },
+  },
+};
+</script>

+ 2 - 2
src/views/music/menu/index.vue

@@ -283,7 +283,7 @@ export default {
       var that = this;
       dialogCallBack(that, function () {
         that
-          .$confirm(`是否删除${row.name}?`, "提示", {
+          .$confirm(`是否删除${row.name}?`, "提示", {
             type: "warning",
           })
           .then(() => {
@@ -321,4 +321,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 192 - 94
src/views/registration/content/index.vue

@@ -1,31 +1,69 @@
+<!-- 签到管理 内容配置 -->
 <template>
+
   <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="资源平台:">
-        <el-select v-model="form.platformId" placeholder="请选择资源平台" clearable>
-          <el-option v-for="item in platformOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.platformId"
+          placeholder="请选择资源平台"
+          clearable
+        >
+          <el-option
+            v-for="item in platformOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="音频类型:">
-        <el-select v-model="form.audioType" placeholder="请选择音频类型" clearable>
-          <el-option v-for="item in form.platformId === '' ? audioOptions : audioTypeOptions" :key="item.value"
-            :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.audioType"
+          placeholder="请选择音频类型"
+          clearable
+        >
+          <el-option
+            v-for="item in form.platformId === ''
+              ? audioOptions
+              : audioTypeOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="内容标题:">
-        <el-input v-model="form.audioName" placeholder="请输入内容标题" clearable />
+        <el-input
+          v-model="form.audioName"
+          placeholder="请输入内容标题"
+          clearable
+        />
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in disabledOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in disabledOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </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 type="primary" plain icon="el-icon-plus" @click="getDetail()"
-          v-hasPermi="['registration:content:add']">新增</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>
     <!-- 列表 -->
@@ -37,10 +75,30 @@
           <el-image :src="scope.row.pic" />
         </template>
       </el-table-column>
-      <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformFormatter" />
-      <el-table-column label="音频类型" prop="audioType" align="center" :formatter="audioTypeFormatter" />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
-      <el-table-column label="内容状态" prop="currentStatus" align="center" :formatter="currentFormatter" />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
+      <el-table-column
+        label="音频类型"
+        prop="audioType"
+        align="center"
+        :formatter="audioTypeFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
+      <el-table-column
+        label="内容状态"
+        prop="currentStatus"
+        align="center"
+        :formatter="currentFormatter"
+      />
       <el-table-column label="有效时间" align="center" show-overflow-tooltip>
         <template slot-scope="scope">
           {{ scope.row.startTime }} 至 {{ scope.row.endTime }}
@@ -48,28 +106,60 @@
       </el-table-column>
       <el-table-column label="操作" align="center">
         <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
+          >
           <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>
+            <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)"
-            v-hasPermi="['registration:content:down']">下架</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>
-    <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
 <script>
-import { platformMixin, audioMixin, disabledMixin, currentMixin } from '@/mixin/index'
-import { list, change, remove } from '@/api/registration/content'
+import { change, list, remove } from "@/api/registration/content";
+import {
+audioMixin,
+currentMixin,
+disabledMixin,
+platformMixin,
+} from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, audioMixin, disabledMixin, currentMixin],
   data() {
@@ -80,60 +170,60 @@ export default {
       form: {
         pageNum: 1,
         pageSize: 10,
-        audioType: '',
-        platformId: ''
+        audioType: "",
+        platformId: "",
       },
       // 列表
       tableData: [],
       // 总数据
-      total: 0
-    }
+      total: 0,
+    };
   },
   watch: {
-    'form.platformId': {
+    "form.platformId": {
       handler(val) {
-        if (val && this.form.audioType == '') {
-          this.form.audioType = ''
-          this.getAudioType(val)
-          this.getList()
+        if (val && this.form.audioType == "") {
+          this.form.audioType = "";
+          this.getAudioType(val);
+          this.getList();
         }
       },
-      deep: true
+      deep: true,
     },
-    'form.audioType': {
+    "form.audioType": {
       handler(val) {
-        if (val && this.form.platformId == '') {
-          this.form.platformId = ''
+        if (val && this.form.platformId == "") {
+          this.form.platformId = "";
           this.getPlatform({
-            audioType: val
-          })
-          this.getList()
+            audioType: val,
+          });
+          this.getList();
         }
       },
-      deep: true
-    }
+      deep: true,
+    },
   },
   mounted() {
-    this.getList()
-    this.getPlatform({})
+    this.getList();
+    this.getPlatform({});
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.getList()
+      this.form.pageNum = 1;
+      this.getList();
     },
 
     // 重置
@@ -141,10 +231,10 @@ export default {
       this.form = {
         pageNum: 1,
         pageSize: 10,
-        platformId: '',
-        audioType: ''
-      }
-      this.getList()
+        platformId: "",
+        audioType: "",
+      };
+      this.getList();
     },
 
     // 新增 查看 编辑
@@ -153,58 +243,66 @@ export default {
         path: `/registration/contentConfig/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 0 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.audioName}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change({
-          id: row.id,
-          status: status
-        }).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 0 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.audioName}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change({
+            id: row.id,
+            status: status,
+          }).then((res) => {
+            if (res.code === 0) {
+              this.$message.success(`${title}成功!`);
+              this.getList();
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.audioName}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove({
-          id: row.id
-        }).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否有删除${row.audioName}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            remove({
+              id: row.id,
+            }).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
     audioTypeFormatter(row) {
-      return this.selectDictLabel(this.audioOptions, row.audioType)
+      return this.selectDictLabel(this.audioOptions, row.audioType);
     },
     statusFormatter(row) {
-      return this.selectDictLabel(this.disabledOptions, row.status)
+      return this.selectDictLabel(this.disabledOptions, row.status);
     },
     currentFormatter(row) {
-      return this.selectDictLabel(this.currentOptions, row.currentStatus)
-    }
-  }
-}
+      return this.selectDictLabel(this.currentOptions, row.currentStatus);
+    },
+  },
+};
 </script>

+ 146 - 80
src/views/registration/exchange/index.vue

@@ -1,3 +1,4 @@
+<!-- 签到管理 兑换配置 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -7,21 +8,37 @@
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in disabledOptions" :key="item.value" :value="item.value"
-            :label="item.label" />
+          <el-option
+            v-for="item in disabledOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="兑换类型:">
         <el-select v-model="form.type" placeholder="请选择奖品类型" clearable>
-          <el-option v-for="item in rewardOptions" :key="item.value" :value="item.value"
-            :label="item.label" />
+          <el-option
+            v-for="item in rewardOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </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 type="primary" plain icon="el-icon-plus" @click="getDetail()"
-          v-hasPermi="['registration:exchange:add']">新增</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>
     <!-- 列表 -->
@@ -33,33 +50,70 @@
           <el-image :src="scope.row.pic" />
         </template>
       </el-table-column>
-      <el-table-column label="兑换类型" prop="type" align="center" :formatter="typeFormatter" />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="兑换类型"
+        prop="type"
+        align="center"
+        :formatter="typeFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="创建时间" prop="createTime" align="center" />
       <el-table-column label="操作" align="center">
         <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
+          >
           <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>
+            <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)"
-            v-hasPermi="['registration:exchange:down']">下架</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>
-    <pagination v-show="total>0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
 <script>
-import { disabledMixin } from '@/mixin/index'
-import { list, change, remove } from '@/api/registration/exchange'
+import { change, list, remove } from "@/api/registration/exchange";
+import { disabledMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [disabledMixin],
   data() {
@@ -69,108 +123,120 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
       // 列表
       tableData: [],
       // 奖品类型
-      rewardOptions: [{
-        value: 0,
-        label: '音乐套餐'
-      }, {
-        value: 1,
-        label: '流量套餐'
-      }, {
-        value: 3,
-        label: '音响实物'
-      }]
-    }
+      rewardOptions: [
+        {
+          value: 0,
+          label: "音乐套餐",
+        },
+        {
+          value: 1,
+          label: "流量套餐",
+        },
+        {
+          value: 3,
+          label: "音响实物",
+        },
+      ],
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 新增 编辑 查看
     getDetail(id, boolean) {
       this.$router.push({
-        path: '/registration/exchangeConfig/detail',
+        path: "/registration/exchangeConfig/detail",
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.getList()
+      this.form.pageNum = 1;
+      this.getList();
     },
 
     // 重置
     getRefresh() {
       this.form = {
         pageNum: 1,
-        pageSize: 10
-      }
-      this.getList()
+        pageSize: 10,
+      };
+      this.getList();
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 0 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change({
-          id: row.id,
-          status: status
-        }).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 0 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change({
+            id: row.id,
+            status: status,
+          }).then((res) => {
+            if (res.code === 0) {
+              this.$message.success(`${title}成功!`);
+              this.getList();
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove({
-          id: row.id
-        }).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否有删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            remove({
+              id: row.id,
+            }).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     statusFormatter(row) {
-      return this.selectDictLabel(this.disabledOptions, row.status)
+      return this.selectDictLabel(this.disabledOptions, row.status);
     },
     typeFormatter(row) {
-      return this.selectDictLabel(this.rewardOptions, row.type)
-    }
-  }
-}
+      return this.selectDictLabel(this.rewardOptions, row.type);
+    },
+  },
+};
 </script>

+ 2 - 2
src/views/service/package/index.vue

@@ -349,7 +349,7 @@ export default {
       var that = this;
       dialogCallBack(that, function () {
         that
-          .$confirm(`是否删除${row.name}?`, "提示", {
+          .$confirm(`是否删除${row.name}?`, "提示", {
             type: "warning",
           })
           .then(() => {
@@ -415,4 +415,4 @@ export default {
     },
   },
 };
-</script>
+</script>