Explorar o código

Merge branch 'develop/3.2.2' into test

Damon hai 9 meses
pai
achega
a31b876f49
Modificáronse 43 ficheiros con 5868 adicións e 2794 borrados
  1. 1 0
      src/router/index.js
  2. 12 0
      src/utils/DialogUtil.js
  3. 124 54
      src/views/content/article/index.vue
  4. 121 57
      src/views/content/video/index.vue
  5. 199 78
      src/views/device/class/index.vue
  6. 20 14
      src/views/device/function/index.vue
  7. 22 16
      src/views/device/version/index.vue
  8. 122 68
      src/views/device/warning/index.vue
  9. 117 55
      src/views/goods/list/index.vue
  10. 19 13
      src/views/music/album/index.vue
  11. 136 68
      src/views/music/anchor/index.vue
  12. 19 13
      src/views/music/blog/index.vue
  13. 90 48
      src/views/music/blogclass/index.vue
  14. 286 111
      src/views/music/choiceness/detail.vue
  15. 125 62
      src/views/music/choiceness/index.vue
  16. 186 80
      src/views/music/list/index.vue
  17. 195 80
      src/views/music/menu/index.vue
  18. 193 80
      src/views/music/program/index.vue
  19. 234 93
      src/views/music/radio/index.vue
  20. 129 65
      src/views/music/radioclass/index.vue
  21. 176 70
      src/views/music/singer/index.vue
  22. 135 80
      src/views/ohplay/operation/index.vue
  23. 21 17
      src/views/operation/activity/index.vue
  24. 128 78
      src/views/operation/agreement/index.vue
  25. 17 10
      src/views/operation/channel/index.vue
  26. 28 19
      src/views/operation/channels/index.vue
  27. 123 62
      src/views/operation/feedbacktype/index.vue
  28. 99 52
      src/views/operation/map/detail.vue
  29. 146 71
      src/views/operation/map/index.vue
  30. 181 93
      src/views/operation/module/index.vue
  31. 330 153
      src/views/operation/recommend/index.vue
  32. 135 73
      src/views/operation/sceneTime/index.vue
  33. 123 64
      src/views/operation/startPage/index.vue
  34. 221 110
      src/views/operation/tag/index.vue
  35. 305 142
      src/views/operation/waken/detail.vue
  36. 79 39
      src/views/operation/waken/index.vue
  37. 145 64
      src/views/push/dialog/index.vue
  38. 128 57
      src/views/push/update/index.vue
  39. 193 95
      src/views/registration/content/index.vue
  40. 147 81
      src/views/registration/exchange/index.vue
  41. 254 122
      src/views/registration/regConfig/index.vue
  42. 288 126
      src/views/service/package/index.vue
  43. 116 61
      src/views/user/store/index.vue

+ 1 - 0
src/router/index.js

@@ -404,6 +404,7 @@ export const dynamicRoutes = [{
       }
     }]
   },
+
   // 猫王精选电台
   {
     path: '/music',

+ 12 - 0
src/utils/DialogUtil.js

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

+ 124 - 54
src/views/content/article/index.vue

@@ -1,58 +1,122 @@
+<!-- 内容管理 文章管理 -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="文章标题:">
         <el-input v-model="form.title" placeholder="请输入文章标题" clearable />
       </el-form-item>
       <el-form-item label="创建时间">
-        <el-date-picker v-model="form.listDate" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期" />
+        <el-date-picker
+          v-model="form.listDate"
+          type="datetimerange"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        />
       </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="['content:article:add']">新增</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          @click="getDetail()"
+          v-hasPermi="['content:article: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 label="文章ID" prop="id" align="center" show-overflow-tooltip />
-      <el-table-column label="文章标题" prop="title" align="center" show-overflow-tooltip />
-      <el-table-column label="分享标题" prop="shareTitle" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="文章ID"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="文章标题"
+        prop="title"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="分享标题"
+        prop="shareTitle"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="分享图片" align="center" width="100px">
         <template slot-scope="scope">
           <el-image :src="scope.row.shareIcon" />
         </template>
       </el-table-column>
       <el-table-column label="浏览数" prop="viewCount" align="center" />
-      <el-table-column label="创建时间" prop="createTime" align="center" show-overflow-tooltip />
-      <el-table-column label="更新时间" prop="updateTime" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="创建时间"
+        prop="createTime"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="更新时间"
+        prop="updateTime"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <el-popover trigger="click">
             <vue-qr :text="getUrl(scope.row)" :ref="`qrcode` + scope.row.id" />
-            <el-button type="text" slot="reference" style="margin-right: 10px;">预览</el-button>
+            <el-button type="text" slot="reference" style="margin-right: 10px"
+              >预览</el-button
+            >
           </el-popover>
-          <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['content:article:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['content:article:delete']">删除</el-button>
-          <el-button type="text" v-clipboard:copy="getUrl(scope.row)" v-clipboard:success="copySuccess">复制</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['content:article:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['content:article:delete']"
+            >删除</el-button
+          >
+          <el-button
+            type="text"
+            v-clipboard:copy="getUrl(scope.row)"
+            v-clipboard:success="copySuccess"
+            >复制</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 VueQr from 'vue-qr'
-import { list, change } from '@/api/content/article'
+import { change, list } from "@/api/content/article";
+import { dialogCallBack } from "@/utils/DialogUtil";
+import VueQr from "vue-qr";
 export default {
   components: {
-    VueQr
+    VueQr,
   },
   data() {
     return {
@@ -61,43 +125,43 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
       // 总数据
-      total: 0
-    }
+      total: 0,
+    };
   },
   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();
     },
 
     // 详情
@@ -106,33 +170,39 @@ export default {
         path: `/content/articleList/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.title}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, 2).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.title}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            change(row.id, 2).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 复制地址
     getUrl(e) {
-      return `${e.copyUrl}pages/content/index?articleId=${e.id}`
+      return `${e.copyUrl}pages/content/index?articleId=${e.id}`;
     },
 
     copySuccess() {
-      this.$message.success('复制成功!')
-    }
-  }
-}
-</script>
+      this.$message.success("复制成功!");
+    },
+  },
+};
+</script>

+ 121 - 57
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()
-          }
-        })
-      })
-    }
-  }
-}
-</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();
+              }
+            });
+          });
+      });
+    },
+  },
+};
+</script>

+ 199 - 78
src/views/device/class/index.vue

@@ -1,75 +1,189 @@
+<!-- 设备管理 设备大类˝ -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="大类名称:">
         <el-input v-model="form.name" placeholder="请输入大类名称" clearable />
       </el-form-item>
       <el-form-item label="设备分类:">
-        <el-select v-model="form.categoryId" placeholder="请选择设备分类" clearable>
-          <el-option v-for="item in categoryOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.categoryId"
+          placeholder="请选择设备分类"
+          clearable
+        >
+          <el-option
+            v-for="item in categoryOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="是否热门:">
         <el-select v-model="form.isHot" placeholder="请选择是否热门" clearable>
-          <el-option v-for="item in yesOrNoOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in yesOrNoOptions"
+            :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" icon="el-icon-plus" plain @click="getDetail()"
-          v-hasPermi="['device:class:add']">新增</el-button>
-        <el-button type="primary" :disabled="ids === ''" @click="getChange(ids, 1, '批量上架')"
-          v-hasPermi="['device:class:up']">批量上架</el-button>
-        <el-button type="primary" :disabled="ids === ''" @click="getChange(ids, 2, '批量下架')"
-          v-hasPermi="['device:class:down']">批量下架</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['device:class:add']"
+          >新增</el-button
+        >
+        <el-button
+          type="primary"
+          :disabled="ids === ''"
+          @click="getChange(ids, 1, '批量上架')"
+          v-hasPermi="['device:class:up']"
+          >批量上架</el-button
+        >
+        <el-button
+          type="primary"
+          :disabled="ids === ''"
+          @click="getChange(ids, 2, '批量下架')"
+          v-hasPermi="['device:class:down']"
+          >批量下架</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading="loading" @selection-change="handleSelection">
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      @selection-change="handleSelection"
+    >
       <el-table-column type="selection" align="center" />
-      <el-table-column label="大类Id" prop="id" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="大类Id"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="大类名称" prop="name" align="center" />
       <el-table-column label="设备图片" align="center" width="100px">
-        <template slot-scope="scope"><el-image :src="scope.row.img" /></template>
+        <template slot-scope="scope"
+          ><el-image :src="scope.row.img"
+        /></template>
       </el-table-column>
-      <el-table-column label="设备分类" prop="categoryId" align="center" :formatter="categoryIdFormatter" />
-      <el-table-column label="设备类型" prop="type" align="center" :formatter="typeFormatter" />
-      <el-table-column label="是否热门" prop="isHot" align="center" :formatter="isHotFormatter" />
-      <el-table-column label="关联设备" prop="deviceIds" align="center" :formatter="deviceFormatter" show-overflow-tooltip />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="设备分类"
+        prop="categoryId"
+        align="center"
+        :formatter="categoryIdFormatter"
+      />
+      <el-table-column
+        label="设备类型"
+        prop="type"
+        align="center"
+        :formatter="typeFormatter"
+      />
+      <el-table-column
+        label="是否热门"
+        prop="isHot"
+        align="center"
+        :formatter="isHotFormatter"
+      />
+      <el-table-column
+        label="关联设备"
+        prop="deviceIds"
+        align="center"
+        :formatter="deviceFormatter"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="更新时间" prop="updateTime" align="center" />
       <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 v-if="scope.row.status === 1" type="text" @click="getChange(scope.row.id, 2, '下架')"
-            v-hasPermi="['device:class:down']">下架</el-button>
-          <span v-else style="margin-left: 10px;">
-            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['device:class:edit']">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row.id, 1, '上架')"
-              v-hasPermi="['device:class:up']">上架</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['device:class:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            v-if="scope.row.status === 1"
+            type="text"
+            @click="getChange(scope.row.id, 2, '下架')"
+            v-hasPermi="['device:class:down']"
+            >下架</el-button
+          >
+          <span v-else style="margin-left: 10px">
+            <el-button
+              type="text"
+              @click="getDetail(scope.row.id)"
+              v-hasPermi="['device:class:edit']"
+              >编辑</el-button
+            >
+            <el-button
+              type="text"
+              @click="getChange(scope.row.id, 1, '上架')"
+              v-hasPermi="['device:class:up']"
+              >上架</el-button
+            >
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['device:class:delete']"
+              >删除</el-button
+            >
           </span>
         </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 { list, change } from '@/api/device/class'
-import { devCategoryMixin, devMixin, onOrOffMixin, devTypeMixin, yesOrNoMixin } from '@/mixin/index'
+import { change, list } from "@/api/device/class";
+import {
+devCategoryMixin,
+devMixin,
+devTypeMixin,
+onOrOffMixin,
+yesOrNoMixin,
+} from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
-  mixins: [devCategoryMixin, devMixin, onOrOffMixin, devTypeMixin, yesOrNoMixin],
+  mixins: [
+    devCategoryMixin,
+    devMixin,
+    onOrOffMixin,
+    devTypeMixin,
+    yesOrNoMixin,
+  ],
   data() {
     return {
       // 遮罩层
@@ -77,108 +191,115 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
       // 列表
       tableData: [],
       // 批量上下架
-      ids: ''
-    }
+      ids: "",
+    };
   },
   mounted() {
-    this.getDevList()
-    this.getCateGory(1)
-    this.getList()
+    this.getDevList();
+    this.getCateGory(1);
+    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();
     },
 
     // 新增
     getDetail(id, boolean) {
       this.$router.push({
-        path: '/device/class/detail',
+        path: "/device/class/detail",
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 多选
     handleSelection(e) {
       if (e.length > 0) {
-        let arr = []
-        e.filter(i => {
-          arr.push(i.id)
-          this.ids = arr.join(',')
-        })
+        let arr = [];
+        e.filter((i) => {
+          arr.push(i.id);
+          this.ids = arr.join(",");
+        });
       } else {
-        this.ids = ''
+        this.ids = "";
       }
     },
 
     // 上架 下架 删除
     getChange(ids, status, title) {
-      change(ids, status).then(res => {
+      change(ids, status).then((res) => {
         if (res.code === 0) {
-          this.$message.success(`${title}成功!`)
-          this.getList()
+          this.$message.success(`${title}成功!`);
+          this.getList();
         }
-      })
+      });
     },
 
     // 删除
     getDelete(e) {
-      this.$confirm(`是否删除${e.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        this.getChange(e.id, 0, '删除')
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${e.name}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            that.getChange(e.id, 0, "删除");
+          });
+      });
     },
 
     // 字典翻译
     categoryIdFormatter(row) {
-      return this.selectDictLabel(this.categoryOptions, row.categoryId)
+      return this.selectDictLabel(this.categoryOptions, row.categoryId);
     },
     typeFormatter(row) {
-      return this.selectDictLabel(this.devTypeOptions, row.type)
+      return this.selectDictLabel(this.devTypeOptions, row.type);
     },
     isHotFormatter(row) {
-      return this.selectDictLabel(this.yesOrNoOptions, row.isHot)
+      return this.selectDictLabel(this.yesOrNoOptions, row.isHot);
     },
     deviceFormatter(row) {
-      return row.deviceIds.split(',').map(i => this.selectDictLabel(this.devOptions, i))
+      return row.deviceIds
+        .split(",")
+        .map((i) => this.selectDictLabel(this.devOptions, i));
     },
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
+    },
+  },
+};
+</script>

+ 20 - 14
src/views/device/function/index.vue

@@ -80,6 +80,7 @@
 
 <script>
 import { create, edit, list } from "@/api/device/function";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   dicts: ["sys_normal_disable"],
   data() {
@@ -186,21 +187,26 @@ export default {
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.form = row;
-        this.form.isDelete = 1;
-        edit(this.form).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("已删除!");
-            this.getList();
-          }
-        });
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示:", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            that.form = row;
+            that.form.isDelete = 1;
+            edit(that.form).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("已删除!");
+                that.getList();
+              }
+            });
+          });
       });
     },
   },
 };
-</script>
+</script>

+ 22 - 16
src/views/device/version/index.vue

@@ -112,6 +112,7 @@
 <script>
 import { getPageList, getVersionDelete } from "@/api/device/version";
 import { devMixin, devModeMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [devMixin, devModeMixin],
   data() {
@@ -176,29 +177,34 @@ export default {
         },
       });
     },
+
     // 删除
     getDelete(row) {
-      var id = row.id;
-      this.$confirm(`是否删除${row.title}?`, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.loading = true;
-        getVersionDelete({ id: id }).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("删除成功!");
-            this.getList();
-            this.loading = false;
-          }
-        });
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.title}?`, "提示:", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            that.loading = true;
+            var id = row.id;
+            getVersionDelete({ id: id }).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+                that.loading = false;
+              }
+            });
+          });
       });
     },
-
     // 字典翻译
     typeFormatter(row) {
       return this.selectDictLabel(this.devModeOptions, row.type);
     },
   },
 };
-</script>
+</script>

+ 122 - 68
src/views/device/warning/index.vue

@@ -1,5 +1,6 @@
+<!-- 设备管理 预警管理 -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="手机号:">
@@ -9,9 +10,18 @@
         <el-input v-model="form.email" placeholder="请输入邮箱" clearable />
       </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="getDialog()" v-hasPermi="['device:warning:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDialog()"
+          v-hasPermi="['device:warning:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -23,14 +33,34 @@
       <el-table-column label="创建时间" prop="createTime" align="center" />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog(scope.row.id)" v-hasPermi="['device:warning:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['device:warning:delete']">删除</el-button>
+          <el-button
+            type="text"
+            @click="getDialog(scope.row.id)"
+            v-hasPermi="['device:warning:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['device:warning:delete']"
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
     <!-- 弹出 -->
-    <el-dialog :visible.sync="dialogVisible" :title="form.id ? '编辑' : '新增'" width="500px" :before-close="getClose">
-      <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="auto">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="form.id ? '编辑' : '新增'"
+      width="500px"
+      :before-close="getClose"
+    >
+      <el-form
+        :model="dialogForm"
+        ref="dialogForm"
+        :rules="rules"
+        label-width="auto"
+      >
         <el-form-item label="联系人:" prop="username">
           <el-input v-model="dialogForm.username" placeholder="请输入联系人" />
         </el-form-item>
@@ -50,26 +80,27 @@
 </template>
 
 <script>
-import { list, detail, submit, change } from '@/api/device/warning'
+import { change, detail, list, submit } from "@/api/device/warning";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
-    var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
+    var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
     var checkPhone = (rule, value, callback) => {
       if (value) {
         if (!reg.test(value)) {
-          callback(new Error('请输入正确的手机号'))
+          callback(new Error("请输入正确的手机号"));
         } else {
-          callback()
+          callback();
         }
       }
-    }
+    };
     return {
       // 遮罩层
       loading: false,
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
@@ -81,100 +112,123 @@ export default {
       dialogForm: {},
       // 校验
       rules: {
-        username: [{
-          required: true, message: '请输入联系人', trigger: 'blur'
-        }],
-        phone: [{
-          required: true, message: '请输入手机号', trigger: 'blur'
-        }, {
-          validator: checkPhone, trigger: 'blur'
-        }],
-        email: [{
-          required: true, message: '请输入邮箱', trigger: 'blur'
-        }, {
-          type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur'
-        }]
-      }
-    }
+        username: [
+          {
+            required: true,
+            message: "请输入联系人",
+            trigger: "blur",
+          },
+        ],
+        phone: [
+          {
+            required: true,
+            message: "请输入手机号",
+            trigger: "blur",
+          },
+          {
+            validator: checkPhone,
+            trigger: "blur",
+          },
+        ],
+        email: [
+          {
+            required: true,
+            message: "请输入邮箱",
+            trigger: "blur",
+          },
+          {
+            type: "email",
+            message: "请输入正确的邮箱地址",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
   },
   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();
     },
 
     // 弹窗
     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.dialogForm = {}
-      this.$refs.dialogForm.resetFields()
-      this.dialogVisible = false
+      this.dialogForm = {};
+      this.$refs.dialogForm.resetFields();
+      this.dialogVisible = false;
     },
 
     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.username}的信息?`, '提示', {
-        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.username}的信息?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            change(row.id, 2).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
+    },
+  },
+};
+</script>

+ 117 - 55
src/views/goods/list/index.vue

@@ -1,39 +1,82 @@
+<!-- 商品推荐 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="推荐位置:">
-        <el-select v-model="form.position" placeholder="请选择推荐位置" clearable>
-          <el-option v-for="item in locationOptions" :key="item.value" :label="item.label" :value="item.value" />
+        <el-select
+          v-model="form.position"
+          placeholder="请选择推荐位置"
+          clearable
+        >
+          <el-option
+            v-for="item in locationOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in currentOptions" :key="item.value" :label="item.label" :value="item.value" />
+          <el-option
+            v-for="item in currentOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="商品名称:">
         <el-input v-model="form.name" placeholder="请输入商品名称" clearable />
       </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="['goods:list:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['goods:list:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
-      <el-table-column label="推荐位置" prop="position" align="center" :formatter="positionFormatter" />
-      <el-table-column label="商品名称" prop="name" align="center" show-overflow-tooltip />
-      <el-table-column label="商品简介" prop="description" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="推荐位置"
+        prop="position"
+        align="center"
+        :formatter="positionFormatter"
+      />
+      <el-table-column
+        label="商品名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="商品简介"
+        prop="description"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="商品价格/元" prop="price" align="center" />
       <el-table-column label="商品图片" align="center" width="100px">
         <template slot-scope="scope">
           <el-image :src="scope.row.pic" :previewSrcList="[scope.row.pic]" />
         </template>
       </el-table-column>
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="权重" prop="sort" align="center" />
       <el-table-column label="有效期" align="center" show-overflow-tooltip>
         <template slot-scope="scope">
@@ -42,24 +85,38 @@
       </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['goods:list:edit']">
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['goods:list:edit']"
+          >
             编辑
           </el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['goods:list:delete']">
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['goods:list: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"
+    />
   </div>
 </template>
 
 <script>
-import { list, remove } from '@/api/goods/list'
-import { locMixin } from './mixin'
-import { currentMixin } from '@/mixin/index'
+import { list, remove } from "@/api/goods/list";
+import { currentMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
+import { locMixin } from "./mixin";
 export default {
   mixins: [locMixin, currentMixin],
   data() {
@@ -69,77 +126,82 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
-      total: 0
-    }
+      total: 0,
+    };
   },
   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();
     },
     // 新增 编辑
     getDetail(id) {
       this.$router.push({
         path: `/goods/goodsList/detail`,
         query: {
-          id: id
-        }
-      })
+          id: id,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}商品?`, '提醒', {
-        'confirmButtonText': '确定',
-        'cancelButtonText': '取消',
-        type: 'warning'
-      }).then(() => {
-        remove({
-          id: row.id
-        }).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}商品?`, "提示:", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            remove({
+              id: row.id,
+            }).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
+      });
     },
 
     // 字典翻译
     positionFormatter(row) {
-      return this.selectDictLabel(this.locationOptions, row.position)
+      return this.selectDictLabel(this.locationOptions, row.position);
     },
 
     statusFormatter(row) {
-      return this.selectDictLabel(this.currentOptions, row.status)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.currentOptions, row.status);
+    },
+  },
+};
+</script>

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

@@ -1,3 +1,4 @@
+<!-- 音频管理 音乐专辑 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -214,6 +215,7 @@ onOrOffMixin,
 payTypeMixin,
 platformMixin,
 } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, onOrOffMixin, payTypeMixin, albumTypeMixin],
   data() {
@@ -306,18 +308,22 @@ export default {
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示", {
-        type: "warning",
-      })
-        .then(() => {
-          remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 多选
@@ -347,4 +353,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 136 - 68
src/views/music/anchor/index.vue

@@ -1,27 +1,52 @@
+<!-- 音频管理 主播 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="主播名称:">
-        <el-input v-model="form.nickname" placeholder="请输入主播名称" clearable />
+        <el-input
+          v-model="form.nickname"
+          placeholder="请输入主播名称"
+          clearable
+        />
       </el-form-item>
       <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.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :value="item.value"
-            :label="item.label" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :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="['music:anchor:add']">新增</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>
     <!-- 列表 -->
@@ -33,32 +58,68 @@
           <el-image v-if="scope.row.avatar" :src="scope.row.avatar" />
         </template>
       </el-table-column>
-      <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="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <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 === 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
+              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
+              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)" v-hasPermi="['music:anchor:down']">下架
+          <el-button
+            v-else
+            type="text"
+            @click="getChange(scope.row, 2)"
+            v-hasPermi="['music:anchor: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 { list, change, remove } from '@/api/music/anchor'
-import { platformMixin, onOrOffMixin } from '@/mixin/index'
+import { change, list, remove } from "@/api/music/anchor";
+import { onOrOffMixin, platformMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, onOrOffMixin],
   data() {
@@ -68,47 +129,47 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
       // 列表
-      tableData: []
-    }
+      tableData: [],
+    };
   },
   mounted() {
     // 获取资源平台
     this.getPlatform({
-      audioType: 12
-    })
-    this.getList()
+      audioType: 12,
+    });
+    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();
     },
 
     // 新增 查看 编辑
@@ -117,52 +178,59 @@ export default {
         path: `/music/anchor/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.nickname}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.nickname}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, status).then((res) => {
+            if (res.code === 0) {
+              this.$message.success(`${title}成功!`);
+              this.getList();
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.nickname}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.nickname}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(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);
     },
 
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
-    }
-  }
-}
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-</style>
+</style>

+ 19 - 13
src/views/music/blog/index.vue

@@ -1,3 +1,4 @@
+<!-- 音频管理 播客专辑 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -217,6 +218,7 @@ onOrOffMixin,
 payTypeMixin,
 platformMixin,
 } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [payTypeMixin, onOrOffMixin, platformMixin, blogClassMixin],
   data() {
@@ -304,18 +306,22 @@ export default {
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示", {
-        type: "warning",
-      })
-        .then(() => {
-          remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 多选
@@ -348,4 +354,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>

+ 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>

+ 286 - 111
src/views/music/choiceness/detail.vue

@@ -1,47 +1,106 @@
 <template>
   <div class="app-container">
-    <el-form class="form" :model="form" ref="form" :rules="rules" label-width="auto" :disabled="disabled">
+    <el-form
+      class="form"
+      :model="form"
+      ref="form"
+      :rules="rules"
+      label-width="auto"
+      :disabled="disabled"
+    >
       <el-form-item label="电台名称:" prop="name">
         <el-input v-model="form.name" placeholder="请输入电台名称" />
       </el-form-item>
       <el-form-item label="电台简介:" prop="description">
-        <el-input v-model="form.description" type="textarea" :autosize="{ minRows: 5, maxRows: 10 }" placeholder="请输入电台简介"
-          maxlength="300" show-word-limit />
+        <el-input
+          v-model="form.description"
+          type="textarea"
+          :autosize="{ minRows: 5, maxRows: 10 }"
+          placeholder="请输入电台简介"
+          maxlength="300"
+          show-word-limit
+        />
       </el-form-item>
       <el-form-item label="电台封面:" prop="thumb">
-        <Upload listType="picture-card" :url="form.thumb" @upload="upload" :disabled="disabled" />
+        <Upload
+          listType="picture-card"
+          :url="form.thumb"
+          @upload="upload"
+          :disabled="disabled"
+        />
       </el-form-item>
-      <el-form-item label="直播流:" prop="liveBrocastList" style="width: 100%;">
-        <el-button type="primary" icon="el-icon-plus" @click="getPush">添加</el-button>
+      <el-form-item label="直播流:" prop="liveBrocastList" style="width: 100%">
+        <el-button type="primary" icon="el-icon-plus" @click="getPush"
+          >添加</el-button
+        >
         <el-table :data="form.liveBrocastList">
           <el-table-column type="index" label="序号" align="center" />
-          <el-table-column label="电台名称" prop="subbroadcastName" align="center" show-overflow-tooltip />
-          <el-table-column label="节目名称" align="center" show-overflow-tooltip>
+          <el-table-column
+            label="电台名称"
+            prop="subbroadcastName"
+            align="center"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            label="节目名称"
+            align="center"
+            show-overflow-tooltip
+          >
             <template slot-scope="scope">
               <span v-if="disabled">{{ scope.row.name }}</span>
               <el-input v-else v-model="scope.row.name" />
             </template>
           </el-table-column>
-          <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="platformId"
+            align="center"
+            :formatter="platformFormatter"
+          />
+          <el-table-column
+            label="当前状态"
+            prop="status"
+            align="center"
+            :formatter="statusFormatter"
+          />
           <el-table-column label="开始时间" align="center">
             <template slot-scope="scope">
               <span v-if="disabled">{{ scope.row.startTime }}</span>
-              <el-time-picker v-else v-model="scope.row.startTime" start-placeholder="开始时间" end-placeholder="结束时间"
-                :readonly="readonly(scope.row)" value-format="HH:mm:ss" format="HH:mm:ss" />
+              <el-time-picker
+                v-else
+                v-model="scope.row.startTime"
+                start-placeholder="开始时间"
+                end-placeholder="结束时间"
+                :readonly="readonly(scope.row)"
+                value-format="HH:mm:ss"
+                format="HH:mm:ss"
+              />
             </template>
           </el-table-column>
           <el-table-column label="结束时间" align="center">
             <template slot-scope="scope">
               <span v-if="disabled">{{ scope.row.endTime }}</span>
-              <el-time-picker v-else v-model="scope.row.endTime" start-placeholder="开始时间" end-placeholder="结束时间"
-                :readonly="readonly(scope.row)" value-format="HH:mm:ss" format="HH:mm:ss" />
+              <el-time-picker
+                v-else
+                v-model="scope.row.endTime"
+                start-placeholder="开始时间"
+                end-placeholder="结束时间"
+                :readonly="readonly(scope.row)"
+                value-format="HH:mm:ss"
+                format="HH:mm:ss"
+              />
             </template>
           </el-table-column>
           <el-table-column label="操作" align="center" width="100px">
             <template slot-scope="scope">
-              <el-button type="text" @click="getDialog(scope.$index)">关联</el-button>
-              <el-button type="delete" @click="getDelete(scope.row, scope.$index)">删除</el-button>
+              <el-button type="text" @click="getDialog(scope.$index)"
+                >关联</el-button
+              >
+              <el-button
+                type="delete"
+                @click="getDelete(scope.row, scope.$index)"
+                >删除</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -49,26 +108,56 @@
     </el-form>
     <div class="form-btn">
       <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" @click="getSubmit" v-if="!disabled">确定</el-button>
+      <el-button type="primary" @click="getSubmit" v-if="!disabled"
+        >确定</el-button
+      >
     </div>
 
     <!-- 弹窗 -->
-    <el-dialog :visible.sync="dialogVisible" width="1000px" :before-close="beforeClose">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="1000px"
+      :before-close="beforeClose"
+    >
       <!-- 搜索 -->
       <el-form inline size="mini">
         <el-form-item label="资源平台:">
-          <el-select v-model="dialogForm.platformId" placeholder="请选择资源平台">
-            <el-option v-for="item in platformOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-select
+            v-model="dialogForm.platformId"
+            placeholder="请选择资源平台"
+          >
+            <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="dialogForm.addressClassifyId" placeholder="请选择地域分类">
-            <el-option v-for="item in addressOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-select
+            v-model="dialogForm.addressClassifyId"
+            placeholder="请选择地域分类"
+          >
+            <el-option
+              v-for="item in addressOptions"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="广播分类:">
-          <el-select v-model="dialogForm.contentClassifyId" placeholder="请选择广播分类">
-            <el-option v-for="item in contentOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-select
+            v-model="dialogForm.contentClassifyId"
+            placeholder="请选择广播分类"
+          >
+            <el-option
+              v-for="item in contentOptions"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="电台名称:">
@@ -78,41 +167,91 @@
           <el-input v-model="dialogForm.id" placeholder="请输入电台ID" />
         </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-refrash" @click="getRefrash">重置</el-button>
         </el-form-item>
       </el-form>
       <!-- 列表 -->
       <el-table :data="tableData" ref="table" v-loading="loading">
-        <el-table-column label="电台ID" prop="id" key="id" align="center" show-overflow-tooltip />
-        <el-table-column label="电台名称" prop="name" key="name" align="center" show-overflow-tooltip />
-        <el-table-column label="电台封面" key="thumb" align="center" width="100px">
+        <el-table-column
+          label="电台ID"
+          prop="id"
+          key="id"
+          align="center"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="电台名称"
+          prop="name"
+          key="name"
+          align="center"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="电台封面"
+          key="thumb"
+          align="center"
+          width="100px"
+        >
           <template slot-scope="scope">
             <el-image v-if="scope.row.thumb" :src="scope.row.thumb" />
           </template>
         </el-table-column>
-        <el-table-column label="地域分类" key="address" align="center" :formatter="addressFormatter" />
-        <el-table-column label="广播分类" key="content" align="center" :formatter="contentFormatter" />
-        <el-table-column label="当前状态" key="status" align="center" :formatter="statusFormatter" />
-        <el-table-column label="操作" key="checked" align="center" v-if="dialogForm.platformId === 4">
+        <el-table-column
+          label="地域分类"
+          key="address"
+          align="center"
+          :formatter="addressFormatter"
+        />
+        <el-table-column
+          label="广播分类"
+          key="content"
+          align="center"
+          :formatter="contentFormatter"
+        />
+        <el-table-column
+          label="当前状态"
+          key="status"
+          align="center"
+          :formatter="statusFormatter"
+        />
+        <el-table-column
+          label="操作"
+          key="checked"
+          align="center"
+          v-if="dialogForm.platformId === 4"
+        >
           <template slot-scope="scope">
-            <el-button type="text" @click="getChecked(scope.row)" :disabled="checked(scope.row)">
+            <el-button
+              type="text"
+              @click="getChecked(scope.row)"
+              :disabled="checked(scope.row)"
+            >
               选择
             </el-button>
           </template>
         </el-table-column>
       </el-table>
       <div slot="footer">
-        <pagination v-show="total > 0" :total="total" :page.sync="dialogForm.pageNum" :limit.sync="dialogForm.pageSize"
-          @pagination="getList" />
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="dialogForm.pageNum"
+          :limit.sync="dialogForm.pageSize"
+          @pagination="getList"
+        />
       </div>
     </el-dialog>
   </div>
 </template>
 
+
 <script>
-import { list, detail, submit } from '@/api/music/choiceness'
-import { addressMixin, contentMixin, onOrOffMixin } from '@/mixin/index'
+import { detail, list, submit } from "@/api/music/choiceness";
+import { addressMixin, contentMixin, onOrOffMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [addressMixin, contentMixin, onOrOffMixin],
   data() {
@@ -121,7 +260,7 @@ export default {
       loading: false,
       // 表单
       form: {
-        liveBrocastList: []
+        liveBrocastList: [],
       },
       // 弹窗
       dialogVisible: false,
@@ -129,7 +268,7 @@ export default {
       dialogForm: {
         pageNum: 1,
         pageSize: 10,
-        platformId: 4
+        platformId: 4,
       },
       total: 0,
       // 列表
@@ -139,96 +278,119 @@ export default {
       // 关联索引
       index: null,
       // 资源平台
-      platformOptions: [{
-        value: 4,
-        label: '海外电台'
-      }],
+      platformOptions: [
+        {
+          value: 4,
+          label: "海外电台",
+        },
+      ],
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入电台名称', trigger: 'blur'
-        }],
-        description: [{
-          required: true, message: '请输入电台简介', trigger: 'blur'
-        }],
-        thumb: [{
-          required: true, message: '请上传电台封面', trigger: 'change'
-        }],
-        liveBrocastList: [{
-          required: true, message: '请配置电台直播流', trigger: 'change'
-        }]
-      }
-    }
+        name: [
+          {
+            required: true,
+            message: "请输入电台名称",
+            trigger: "blur",
+          },
+        ],
+        description: [
+          {
+            required: true,
+            message: "请输入电台简介",
+            trigger: "blur",
+          },
+        ],
+        thumb: [
+          {
+            required: true,
+            message: "请上传电台封面",
+            trigger: "change",
+          },
+        ],
+        liveBrocastList: [
+          {
+            required: true,
+            message: "请配置电台直播流",
+            trigger: "change",
+          },
+        ],
+      },
+    };
   },
   mounted() {
-    this.getContent({ type: 1, platformId: 4})
+    this.getContent({ type: 1, platformId: 4 });
     if (this.$route.query.id) {
-      this.form.id = this.$route.query.id
-      this.disabled = Boolean(this.$route.query.disabled)
+      this.form.id = this.$route.query.id;
+      this.disabled = Boolean(this.$route.query.disabled);
       this.onOrOffOptions.push({
         value: 3,
-        label: '下架'
-      })
-      this.getDetail()
+        label: "下架",
+      });
+      this.getDetail();
     }
   },
   methods: {
     // 详情
     getDetail() {
-      detail(this.form.id).then(res => {
+      detail(this.form.id).then((res) => {
         if (res.code === 0) {
-          this.form = res.data
+          this.form = res.data;
         }
-      })
+      });
     },
 
     // 上传
     upload(e) {
-      this.form.thumb = e.file
+      this.form.thumb = e.file;
     },
 
     // 删除
     getDelete(row, index) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        this.form.liveBrocastList.splice(index, 1)
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            that.form.liveBrocastList.splice(index, 1);
+          });
+      });
     },
 
     // 新增直播流
     getPush() {
-      this.form.liveBrocastList.push({})
+      this.form.liveBrocastList.push({});
     },
 
-    // 弹窗 
+    // 弹窗
     getDialog(index) {
-      this.dialogVisible = true
-      this.index = index
-      this.getList()
+      this.dialogVisible = true;
+      this.index = index;
+      this.getList();
     },
 
     // 关闭弹窗
     beforeClose() {
-      this.dialogVisible = false
+      this.dialogVisible = false;
     },
 
     // 列表
     getList() {
-      this.loading = true
-      list(this.dialogForm).then(res => {
+      this.loading = true;
+      list(this.dialogForm).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.dialogForm.pageNum = 1
-      this.getList()
+      this.dialogForm.pageNum = 1;
+      this.getList();
     },
 
     // 重置
@@ -236,71 +398,84 @@ export default {
       this.dialogForm = {
         pageNum: 1,
         pageSize: 10,
-        platformId: this.dialogForm.platformId
-      }
-      this.getList()
+        platformId: this.dialogForm.platformId,
+      };
+      this.getList();
     },
 
     // 选择
     getChecked(row) {
-      let e = this.form.liveBrocastList[this.index]
-      this.$set(e, 'subbroadcastId', row.id)
-      this.$set(e, 'subbroadcastName', row.name)
-      this.$set(e, 'platformId', row.platformId)
-      this.$set(e, 'status', row.status)
+      let e = this.form.liveBrocastList[this.index];
+      this.$set(e, "subbroadcastId", row.id);
+      this.$set(e, "subbroadcastName", row.name);
+      this.$set(e, "platformId", row.platformId);
+      this.$set(e, "status", row.status);
     },
 
     // 取消
     cancel() {
-      this.$tab.closeOpenPage('/music/choiceness')
+      this.$tab.closeOpenPage("/music/choiceness");
     },
 
     // 提交
     getSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          submit(this.form).then(res => {
+          submit(this.form).then((res) => {
             if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.form.id ? this.getDetail() : this.cancel()
+              this.$message.success("提交成功!");
+              this.form.id ? this.getDetail() : this.cancel();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 字典翻译
     addressFormatter(row) {
-      return row.platformId === 1 ? this.selectDictLabel(this.addressOptions, row.addressClassifyId) : '/'
+      return row.platformId === 1
+        ? this.selectDictLabel(this.addressOptions, row.addressClassifyId)
+        : "/";
     },
     contentFormatter(row) {
-      return row.platformId === 1 ? this.selectDictLabel(this.contentOptions, row.contentClassifyId) : '/'
+      return row.platformId === 1
+        ? this.selectDictLabel(this.contentOptions, row.contentClassifyId)
+        : "/";
     },
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
     // 当前状态
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
     },
 
     // 是否只读
     readonly(row) {
-      return row.platformId === 1 ? true : false
+      return row.platformId === 1 ? true : false;
     },
 
     // 是否已选
     checked(row) {
-      return this.dialogForm.platformId === 1 ? this.form.liveBrocastList.findIndex(i => i.name === row.title) === -1 ? false : true : this.form.liveBrocastList.findIndex(i => i.subbroadcastId === row.id) === -1 ? false : true
-    }
-  }
-}
+      return this.dialogForm.platformId === 1
+        ? this.form.liveBrocastList.findIndex((i) => i.name === row.title) ===
+          -1
+          ? false
+          : true
+        : this.form.liveBrocastList.findIndex(
+            (i) => i.subbroadcastId === row.id
+          ) === -1
+        ? false
+        : true;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 .form .el-form-item {
   width: 500px;
 }
-</style>
+</style>

+ 125 - 62
src/views/music/choiceness/index.vue

@@ -1,3 +1,4 @@
+<!-- 音频管理 猫王精选电台 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -7,59 +8,116 @@
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态">
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :label="item.label" :value="item.value" clearable />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+            clearable
+          />
         </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-refrash" @click="getRefrash">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()"
-          v-hasPermi="['music:choiceness:add']">新增</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          @click="getDetail()"
+          v-hasPermi="['music:choiceness:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
-      <el-table-column label="电台ID" prop="id" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="电台ID"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="电台名称" prop="name" align="center" />
       <el-table-column label="电台封面" align="center" width="100px">
         <template slot-scope="scope">
           <el-image v-if="scope.row.thumb" :src="scope.row.thumb" />
         </template>
       </el-table-column>
-      <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="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="更新时间" align="center">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{
+            parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </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 v-if="scope.row.status === 1" type="text" @click="getChange(scope.row, 2)"
-            v-hasPermi="['music:choiceness:down']">下架</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            v-if="scope.row.status === 1"
+            type="text"
+            @click="getChange(scope.row, 2)"
+            v-hasPermi="['music:choiceness:down']"
+            >下架</el-button
+          >
           <span v-else>
-            <el-button type="text" style="margin-left: 10px" @click="getDetail(scope.row.id)"
-              v-hasPermi="['music:choiceness:edit']">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row, 1)" v-hasPermi="['music:choiceness:up']">
+            <el-button
+              type="text"
+              style="margin-left: 10px"
+              @click="getDetail(scope.row.id)"
+              v-hasPermi="['music:choiceness:edit']"
+              >编辑</el-button
+            >
+            <el-button
+              type="text"
+              @click="getChange(scope.row, 1)"
+              v-hasPermi="['music:choiceness:up']"
+            >
               上架
             </el-button>
-            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:choiceness:delete']">
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['music:choiceness:delete']"
+            >
               删除
             </el-button>
           </span>
         </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 { list, change, remove } from '@/api/music/choiceness'
-import { onOrOffMixin, platformMixin } from '@/mixin/index'
+import { change, list, remove } from "@/api/music/choiceness";
+import { onOrOffMixin, platformMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [onOrOffMixin, platformMixin],
   data() {
@@ -69,43 +127,43 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       total: 0,
       // 列表
-      tableData: []
-    }
+      tableData: [],
+    };
   },
   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();
     },
 
     // 重置
     getRefrash() {
       this.form = {
         pageNum: 1,
-        pageSize: 10
-      }
-      this.getList()
+        pageSize: 10,
+      };
+      this.getList();
     },
 
     // 详情
@@ -114,49 +172,54 @@ export default {
         path: `/music/choiceness/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
       }).then(() => {
-        change(row.id, status).then(res => {
+        change(row.id, status).then((res) => {
           if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
+            this.$message.success(`${title}成功!`);
+            this.getList();
           }
-        })
-      })
+        });
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`删除成功!`)
-            this.getList()
-          }
-        })
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success(`删除成功!`);
+                that.getList();
+              }
+            });
+          });
+      });
     },
 
     // 字典翻译
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformTypeOptions, row.platformId)
+      return this.selectDictLabel(this.platformTypeOptions, row.platformId);
     },
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
-    }
-  }
-}
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
+    },
+  },
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>

+ 186 - 80
src/views/music/list/index.vue

@@ -1,3 +1,4 @@
+<!-- 歌曲 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -9,39 +10,95 @@
         <el-input v-model="form.name" placeholder="请输入歌曲名称" clearable />
       </el-form-item>
       <el-form-item label="歌手名称:">
-        <el-input v-model="form.singerName" placeholder="请输入歌手名称" clearable />
+        <el-input
+          v-model="form.singerName"
+          placeholder="请输入歌手名称"
+          clearable
+        />
       </el-form-item>
       <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.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :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="['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 listType="mp3" multiple name="multipartFiles" @upload="getList()" style="margin-left: 10px;">批量上传</Upload>
+        <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
+          listType="mp3"
+          multiple
+          name="multipartFiles"
+          @upload="getList()"
+          style="margin-left: 10px"
+          >批量上传</Upload
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading="loading" @selection-change="handleSelect">
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      @selection-change="handleSelect"
+    >
       <el-table-column type="selection" align="center" />
       <el-table-column label="歌曲Id" prop="id" align="center" />
-      <el-table-column label="歌曲名称" prop="name" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="歌曲名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="歌手名称" align="center" show-overflow-tooltip>
         <template slot-scope="scope">
-          <span v-for="(item, index) in scope.row.singerResp" :key="item.singerId">
-            {{ item.singerName }} {{ index + 1 !== scope.row.singerResp.length ? ',' : '' }}
+          <span
+            v-for="(item, index) in scope.row.singerResp"
+            :key="item.singerId"
+          >
+            {{ item.singerName }}
+            {{ index + 1 !== scope.row.singerResp.length ? "," : "" }}
           </span>
         </template>
       </el-table-column>
@@ -52,43 +109,81 @@
       </el-table-column>
       <el-table-column label="播放时长" prop="playTime" align="center" />
       <el-table-column label="所属专辑" prop="songName" align="center" />
-      <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformIdFormatter" />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformIdFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="更新时间" prop="updateTime" align="center">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{
+            parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </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 === 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
+              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
+              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)" v-hasPermi="['music:list:down']">下架
+          <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>
-    <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 Audio from '@/components/Audio/index.vue'
-import { list, remove, change } from '@/api/music/list'
-import { platformMixin, onOrOffMixin } from '@/mixin/index'
+import { change, list, remove } from "@/api/music/list";
+import Audio from "@/components/Audio/index.vue";
+import { onOrOffMixin, platformMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, onOrOffMixin],
   components: {
-    Audio
+    Audio,
   },
   data() {
     return {
@@ -97,7 +192,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
@@ -107,47 +202,47 @@ export default {
       isPlay: true,
       // 批量上下架
       obj: {
-        id: '',
-        name: '已选数据'
-      }
+        id: "",
+        name: "已选数据",
+      },
     };
   },
   mounted() {
     // 获取资源平台
     this.getPlatform({
-      audioType: 11
-    })
-    this.getList()
+      audioType: 11,
+    });
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
+      this.loading = true;
       // 后端延迟
       setTimeout(() => {
-        list(this.form).then(res => {
+        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;
           }
-        })
+        });
       }, 1500);
     },
 
     // 搜索
     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();
     },
 
     // 新增 编辑
@@ -156,54 +251,65 @@ export default {
         path: `/music/musicList/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, status).then((res) => {
+            if (res.code === 0) {
+              this.$message.success(`${title}成功!`);
+              this.getList();
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
 
     // 多选
     handleSelect(e) {
-      this.obj.id = ''
-      e.map((item, index) => this.obj.id += item.id + ((index + 1) < e.length ? ',' : ''))
+      this.obj.id = "";
+      e.map(
+        (item, index) =>
+          (this.obj.id += item.id + (index + 1 < e.length ? "," : ""))
+      );
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
     },
 
     platformIdFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.platformOptions, row.platformId);
+    },
+  },
+};
+</script>

+ 195 - 80
src/views/music/menu/index.vue

@@ -1,3 +1,4 @@
+<!-- 音频管理 歌单 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -9,81 +10,184 @@
         <el-input v-model="form.name" placeholder="请输入歌单名称" clearable />
       </el-form-item>
       <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.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="付费类型:">
-        <el-select v-model="form.payType" placeholder="请选择付费类型" clearable>
-          <el-option v-for="item in payTypeOptions.slice(0, 2)" :key="item.value" :value="item.value"
-            :label="item.label" />
+        <el-select
+          v-model="form.payType"
+          placeholder="请选择付费类型"
+          clearable
+        >
+          <el-option
+            v-for="item in payTypeOptions.slice(0, 2)"
+            :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="['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-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>
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading="loading" @selection-change="handleSelect">
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      @selection-change="handleSelect"
+    >
       <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="歌单Id"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="歌单名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="歌单封面" align="center" width="100px">
         <template slot-scope="scope">
           <el-image v-if="scope.row.coverUrl" :src="scope.row.coverUrl" />
         </template>
       </el-table-column>
-      <el-table-column label="歌单创建者" prop="avatarNickName" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="歌单创建者"
+        prop="avatarNickName"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="创建者头像" align="center" width="100px">
         <template slot-scope="scope">
-          <el-image v-if="scope.row.avatarNickHead" :src="scope.row.avatarNickHead" />
+          <el-image
+            v-if="scope.row.avatarNickHead"
+            :src="scope.row.avatarNickHead"
+          />
         </template>
       </el-table-column>
-      <el-table-column label="付费类型" prop="payType" align="center" :formatter="freeFormatter" />
-      <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformFormatter" />
+      <el-table-column
+        label="付费类型"
+        prop="payType"
+        align="center"
+        :formatter="freeFormatter"
+      />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
       <el-table-column label="歌曲数量" prop="programCount" align="center" />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <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="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 === 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
+              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
+              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)" v-hasPermi="['music:menu:down']">下架
+          <el-button
+            v-else
+            type="text"
+            @click="getChange(scope.row, 2)"
+            v-hasPermi="['music:menu: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 { list, change, remove } from '@/api/music/menu'
-import { platformMixin, onOrOffMixin, payTypeMixin } from '@/mixin/index'
+import { change, list, remove } from "@/api/music/menu";
+import { onOrOffMixin, payTypeMixin, platformMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, onOrOffMixin, payTypeMixin],
   data() {
@@ -94,7 +198,7 @@ export default {
       form: {
         pageNum: 1,
         pageSize: 10,
-        type: 2
+        type: 2,
       },
       // 总数据
       total: 0,
@@ -102,38 +206,38 @@ export default {
       tableData: [],
       // 批量上下架
       obj: {
-        id: '',
-        name: '已选数据'
-      }
+        id: "",
+        name: "已选数据",
+      },
     };
   },
   mounted() {
     // 获取资源平台
     this.getPlatform({
-      audioType: 10
-    })
-    this.getList()
+      audioType: 10,
+    });
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
+      this.loading = true;
       // 后端延迟
       setTimeout(() => {
-        list(this.form).then(res => {
+        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;
           }
-        })
+        });
       }, 1500);
     },
 
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.getList()
+      this.form.pageNum = 1;
+      this.getList();
     },
 
     // 重置
@@ -141,9 +245,9 @@ export default {
       this.form = {
         pageNum: 1,
         pageSize: 10,
-        type: 2
-      }
-      this.getList()
+        type: 2,
+      };
+      this.getList();
     },
 
     // 新增 / 查看 / 编辑
@@ -152,58 +256,69 @@ export default {
         path: `/music/menu/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, 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(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 多选
     handleSelect(e) {
-      this.obj.id = ''
-      e.map((item, index) => this.obj.id += item.id + ((index + 1) < e.length ? ',' : ''))
+      this.obj.id = "";
+      e.map(
+        (item, index) =>
+          (this.obj.id += item.id + (index + 1 < e.length ? "," : ""))
+      );
     },
 
     // 字典翻译
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
 
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
     },
 
     freeFormatter(row) {
-      return this.selectDictLabel(this.payTypeOptions, row.payType)
-    }
+      return this.selectDictLabel(this.payTypeOptions, row.payType);
+    },
   },
 };
-</script>
+</script>

+ 193 - 80
src/views/music/program/index.vue

@@ -1,3 +1,4 @@
+<!-- 音频管理 节目 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -9,75 +10,177 @@
         <el-input v-model="form.name" placeholder="请选择节目名称" clearable />
       </el-form-item>
       <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.isFree" placeholder="请选择付费类型" clearable>
-          <el-option v-for="item in freeOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in freeOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :label="item.label" :value="item.value" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </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="['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-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>
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading="loading" @selection-change="handleSelect">
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      @selection-change="handleSelect"
+    >
       <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" width="100px" />
+      <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"
+        width="100px"
+      />
       <el-table-column label="原价 / 元" prop="price" align="center" />
-      <el-table-column label="折扣价 / 元" prop="discountedPrice" align="center" />
+      <el-table-column
+        label="折扣价 / 元"
+        prop="discountedPrice"
+        align="center"
+      />
       <el-table-column label="所属专辑" prop="podcastName" align="center" />
-      <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformFormatter" />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" width="100px" />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
+      <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>
+          <span>{{
+            parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </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 === 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>
+            <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)"
-            v-hasPermi="['music:program:down']">下架</el-button>
+          <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>
-    <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 Audio from '@/components/Audio/index.vue'
-import { list, change, remove } from '@/api/music/program'
-import { platformMixin, onOrOffMixin, isFreeMixin } from '@/mixin/index'
+import { change, list, remove } from "@/api/music/program";
+import Audio from "@/components/Audio/index.vue";
+import { isFreeMixin, onOrOffMixin, platformMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, onOrOffMixin, isFreeMixin],
   components: {
-    Audio
+    Audio,
   },
   data() {
     return {
@@ -86,7 +189,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
@@ -94,44 +197,44 @@ export default {
       tableData: [],
       // 批量上下架
       obj: {
-        id: '',
-        name: '已选数据'
-      }
+        id: "",
+        name: "已选数据",
+      },
     };
   },
   mounted() {
     // 获取资源平台
     this.getPlatform({
-      audioType: 6
-    })
-    this.getList()
+      audioType: 6,
+    });
+    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();
     },
 
     // 新增 / 查看 / 编辑
@@ -140,57 +243,67 @@ export default {
         path: `/music/program/detail`,
         query: {
           id: id,
-          disabled: boolean
+          disabled: boolean,
         },
       });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, 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(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
-
     // 多选
     handleSelect(e) {
-      this.obj.id = ''
-      e.map((item, index) => this.obj.id += item.id + ((index + 1) < e.length ? ',' : ''))
+      this.obj.id = "";
+      e.map(
+        (item, index) =>
+          (this.obj.id += item.id + (index + 1 < e.length ? "," : ""))
+      );
     },
 
     // 字典翻译
     freeFormatter(row) {
-      return this.selectDictLabel(this.freeOptions, row.isFree)
+      return this.selectDictLabel(this.freeOptions, row.isFree);
     },
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
-    }
-  }
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
+    },
+  },
 };
-</script>
+</script>

+ 234 - 93
src/views/music/radio/index.vue

@@ -1,3 +1,4 @@
+<!-- 音频管理 广播电台 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -6,82 +7,212 @@
         <el-input v-model="form.name" placeholder="请输入电台名称" clearable />
       </el-form-item>
       <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-cascader v-model="form.list" :options="mapOptions" placeholder="请选择省市区" clearable
-          :props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
+        <el-cascader
+          v-model="form.list"
+          :options="mapOptions"
+          placeholder="请选择省市区"
+          clearable
+          :props="{
+            value: 'id',
+            label: 'name',
+            children: 'childList',
+            checkStrictly: true,
+          }"
+        />
       </el-form-item>
       <el-form-item label="地域分类:">
-        <el-select v-model="form.addressClassifyId" placeholder="请选择地域分类" clearable>
-          <el-option v-for="item in addressOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.addressClassifyId"
+          placeholder="请选择地域分类"
+          clearable
+        >
+          <el-option
+            v-for="item in addressOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="广播分类:">
-        <el-select v-model="form.contentClassifyId" placeholder="请选择广播分类" clearable>
-          <el-option v-for="item in contentOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.contentClassifyId"
+          placeholder="请选择广播分类"
+          clearable
+        >
+          <el-option
+            v-for="item in contentOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :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="['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-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>
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading="loading" @selection-change="handleSelect">
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      @selection-change="handleSelect"
+    >
       <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="ID"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="电台名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="电台封面" align="center" width="100px">
         <template slot-scope="scope">
           <el-image v-if="scope.row.thumb" :src="scope.row.thumb" />
         </template>
       </el-table-column>
       <el-table-column label="地区" align="center" :formatter="areaFormatter" />
-      <el-table-column label="地域分类" prop="addressClassifyId" align="center" :formatter="addressFormatter" />
-      <el-table-column label="广播分类" prop="contentClassifyName" align="center" :formatter="contentFormatter" />
-      <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="addressClassifyId"
+        align="center"
+        :formatter="addressFormatter"
+      />
+      <el-table-column
+        label="广播分类"
+        prop="contentClassifyName"
+        align="center"
+        :formatter="contentFormatter"
+      />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <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 === 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>
+            <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)" v-hasPermi="['music:radio:down']">下架</el-button>
+          <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>
-    <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, onOrOffMixin, addressMixin, contentMixin, mapMixin } from '@/mixin/index'
-import { list, change, remove } from '@/api/music/radio'
-import Audio from '@/components/Audio/index.vue'
+import { change, list, remove } from "@/api/music/radio";
+import Audio from "@/components/Audio/index.vue";
+import {
+addressMixin,
+contentMixin,
+mapMixin,
+onOrOffMixin,
+platformMixin,
+} from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, onOrOffMixin, addressMixin, contentMixin, mapMixin],
   components: {
-    Audio
+    Audio,
   },
   data() {
     return {
@@ -90,7 +221,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
@@ -102,52 +233,52 @@ export default {
       addressOptions: [],
       // 批量上下架
       obj: {
-        id: '',
-        name: '已选数据'
-      }
-    }
+        id: "",
+        name: "已选数据",
+      },
+    };
   },
   watch: {
-    'form.list'(val) {
-      this.form.province = val[0]
-      this.form.city = val[1]
-      this.form.area = val[2]
-    }
+    "form.list"(val) {
+      this.form.province = val[0];
+      this.form.city = val[1];
+      this.form.area = val[2];
+    },
   },
   mounted() {
     // 获取资源平台
     this.getPlatform({
-      audioType: 2
-    })
-    this.getContent({ type: 1 })
-    this.getList()
+      audioType: 2,
+    });
+    this.getContent({ type: 1 });
+    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();
     },
 
     // 新增 / 查看 / 编辑
@@ -156,63 +287,73 @@ export default {
         path: `/music/radio/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, 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(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 多选
     handleSelect(e) {
-      this.obj.id = ''
-      e.map((item, index) => this.obj.id += item.id + ((index + 1) < e.length ? ',' : ''))
+      this.obj.id = "";
+      e.map(
+        (item, index) =>
+          (this.obj.id += item.id + (index + 1 < e.length ? "," : ""))
+      );
     },
 
     // 字典翻译
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
 
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
     },
 
     addressFormatter(row) {
-      return this.selectDictLabel(this.addressOptions, row.addressClassifyId)
+      return this.selectDictLabel(this.addressOptions, row.addressClassifyId);
     },
 
     contentFormatter(row) {
-      return this.selectDictLabel(this.contentOptions, row.contentClassifyId)
-    }
+      return this.selectDictLabel(this.contentOptions, row.contentClassifyId);
+    },
   },
-}
-</script>
+};
+</script>

+ 129 - 65
src/views/music/radioclass/index.vue

@@ -1,36 +1,81 @@
+<!-- 音频管理 内容分类 广播分类 -->
 <template>
   <div class="app-container">
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog('新增')"
-      v-hasPermi="['music:radioclass:add']">新增</el-button>
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDialog('新增')"
+      v-hasPermi="['music:radioclass:add']"
+      >新增</el-button
+    >
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
       <el-table-column label="分类名称" prop="title" align="center" />
-      <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformIdFormatter" />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformIdFormatter"
+      />
       <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:radioclass:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['music:radioclass:delete']">删除</el-button>
+          <el-button
+            type="text"
+            @click="getDialog('编辑', scope.row.id)"
+            v-hasPermi="['music:radioclass:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['music:radioclass: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="title" width="500px" :before-close="cancel">
-      <el-form :model="dialogForm" :rules="rules" ref="dialogForm" label-width="auto">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="cancel"
+    >
+      <el-form
+        :model="dialogForm"
+        :rules="rules"
+        ref="dialogForm"
+        label-width="auto"
+      >
         <el-form-item label="分类名称:" prop="title">
           <el-input v-model="dialogForm.title" placeholder="请输入分类名称" />
         </el-form-item>
         <el-form-item label="资源平台:" prop="platformId">
-          <el-select v-model="dialogForm.platformId" multiple placeholder="请选择资源平台">
-            <el-option v-for="item in platformOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-select
+            v-model="dialogForm.platformId"
+            multiple
+            placeholder="请选择资源平台"
+          >
+            <el-option
+              v-for="item in platformOptions"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            />
           </el-select>
         </el-form-item>
       </el-form>
@@ -42,9 +87,11 @@
   </div>
 </template>
 
+
 <script>
-import { list, submit, detail, remove } from '@/api/music/radioclass'
-import { platformMixin } from '@/mixin/index'
+import { detail, list, remove, submit } from "@/api/music/radioclass";
+import { platformMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin],
   data() {
@@ -54,7 +101,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
@@ -63,38 +110,47 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗名称
-      title: '新增',
+      title: "新增",
       // 弹窗表单
       dialogForm: {
-        platformId: []
+        platformId: [],
       },
       // 校验
       rules: {
-        title: [{
-          required: true, message: '请输入分类名称', trigger: 'blur'
-        }],
-        platformId: [{
-          type: 'array', required: true, message: '请选择资源平台', trigger: 'change'
-        }]
-      }
-    }
+        title: [
+          {
+            required: true,
+            message: "请输入分类名称",
+            trigger: "blur",
+          },
+        ],
+        platformId: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择资源平台",
+            trigger: "change",
+          },
+        ],
+      },
+    };
   },
   mounted() {
-    this.getPlatform({})
-    this.getList()
+    this.getPlatform({});
+    this.getList();
   },
   methods: {
     // 新增 编辑
     getDialog(title, id) {
-      this.dialogVisible = true
-      this.title = title
+      this.dialogVisible = true;
+      this.title = title;
       if (id) {
-        detail(id).then(res => {
+        detail(id).then((res) => {
           if (res.code === 0) {
-            this.dialogForm = res.data
-            this.dialogForm.platformId = JSON.parse(res.data.platformId)
+            this.dialogForm = res.data;
+            this.dialogForm.platformId = JSON.parse(res.data.platformId);
           }
-        })
+        });
       }
     },
 
@@ -102,56 +158,64 @@ export default {
     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.title}成功!`)
-              this.cancel()
-              this.getList()
+              this.$message.success(`${this.title}成功!`);
+              this.cancel();
+              this.getList();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 取消
     cancel() {
-      this.$refs.dialogForm.resetFields()
-      this.dialogForm = {}
-      this.dialogVisible = false
+      this.$refs.dialogForm.resetFields();
+      this.dialogForm = {};
+      this.dialogVisible = false;
     },
 
     // 列表
     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;
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.title}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.title}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     platformIdFormatter(row) {
-      return JSON.parse(row.platformId).map(i => this.selectDictLabel(this.platformOptions, i)).join(',')
-    }
-  }
-}
-</script>
+      return JSON.parse(row.platformId)
+        .map((i) => this.selectDictLabel(this.platformOptions, i))
+        .join(",");
+    },
+  },
+};
+</script>

+ 176 - 70
src/views/music/singer/index.vue

@@ -1,3 +1,4 @@
+<!-- 音频管理 歌手 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -6,69 +7,166 @@
         <el-input v-model="form.name" placeholder="请输入歌手名称" clearable />
       </el-form-item>
       <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.sex" placeholder="请选择歌手性别" clearable>
-          <el-option v-for="item in sexOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in sexOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="所属地区:">
-        <el-select v-model="form.singerArea" placeholder="请选择所属地区" clearable>
-          <el-option v-for="item in regionOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.singerArea"
+          placeholder="请选择所属地区"
+          clearable
+        >
+          <el-option
+            v-for="item in regionOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in onOrOffOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in onOrOffOptions"
+            :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="['music:singer:add']">新增</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>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
-      <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="ID"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="歌手名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="歌手头像" align="center" width="100px">
         <template slot-scope="scope">
           <el-image v-if="scope.row.coverUrl" :src="scope.row.coverUrl" />
         </template>
       </el-table-column>
-      <el-table-column label="歌手性别" prop="sex" align="center" :formatter="sexFormatter" />
-      <el-table-column label="所属地区" prop="singerArea" align="center" :formatter="areaFormatter" />
-      <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="sex"
+        align="center"
+        :formatter="sexFormatter"
+      />
+      <el-table-column
+        label="所属地区"
+        prop="singerArea"
+        align="center"
+        :formatter="areaFormatter"
+      />
+      <el-table-column
+        label="资源平台"
+        prop="platformId"
+        align="center"
+        :formatter="platformFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <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 === 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
+              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
+              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)" v-hasPermi="['music:singer:down']">下架
+          <el-button
+            type="text"
+            v-else
+            @click="getChange(scope.row, 2)"
+            v-hasPermi="['music:singer: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 { list, remove, change } from '@/api/music/singer'
-import { platformMixin, sexMixin, regionMixin, onOrOffMixin } from '@/mixin/index'
+import { change, list, remove } from "@/api/music/singer";
+import {
+onOrOffMixin,
+platformMixin,
+regionMixin,
+sexMixin,
+} from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [platformMixin, sexMixin, regionMixin, onOrOffMixin],
   data() {
@@ -78,47 +176,47 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
       // 列表
-      tableData: []
+      tableData: [],
     };
   },
   mounted() {
     // 获取资源平台
     this.getPlatform({
-      audioType: 9
-    })
-    this.getList()
+      audioType: 9,
+    });
+    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();
     },
 
     // 新增 编辑
@@ -127,56 +225,64 @@ export default {
         path: `/music/singer/detail`,
         query: {
           id: id,
-          disabled: boolean
-        }
-      })
+          disabled: boolean,
+        },
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 1 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 1 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, 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(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     sexFormatter(row) {
-      return this.selectDictLabel(this.sexOptions, row.sex)
+      return this.selectDictLabel(this.sexOptions, row.sex);
     },
 
     areaFormatter(row) {
-      return this.selectDictLabel(this.regionOptions, row.singerArea)
+      return this.selectDictLabel(this.regionOptions, row.singerArea);
     },
 
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
 
     statusFormatter(row) {
-      return this.selectDictLabel(this.onOrOffOptions, row.status)
-    }
+      return this.selectDictLabel(this.onOrOffOptions, row.status);
+    },
   },
 };
-</script>
+</script>

+ 135 - 80
src/views/ohplay/operation/index.vue

@@ -2,40 +2,76 @@
   <div class="app-container">
     <div style="width: 400px">
       <el-image :src="require('@/assets/images/ohplay/search.png')" />
-      <el-image :class="['border', active === item.id ? 'active' : '']" v-for="item in img" :key="item.id"
-        :src="item.url" @click="getActive(item.id)" />
+      <el-image
+        :class="['border', active === item.id ? 'active' : '']"
+        v-for="item in img"
+        :key="item.id"
+        :src="item.url"
+        @click="getActive(item.id)"
+      />
       <el-image :src="require('@/assets/images/ohplay/comment.png')" />
     </div>
 
     <keep-alive>
       <div class="isShow">
-        <el-button v-if="isShow()" type="primary" icon="el-icon-plus" @click="getAdd"
-          v-hasPermi="['ohplay:operation:add']">添加</el-button>
+        <el-button
+          v-if="isShow()"
+          type="primary"
+          icon="el-icon-plus"
+          @click="getAdd"
+          v-hasPermi="['ohplay:operation:add']"
+          >添加</el-button
+        >
         <el-form label-width="100px" v-for="(item, index) in list" :key="index">
-          <el-link :underline="false" class="close" icon="el-icon-close" @click="getDelete(item.id, index)" />
+          <el-link
+            :underline="false"
+            class="close"
+            icon="el-icon-close"
+            @click="getDelete(item.id, index)"
+          />
           <el-form-item :label="label + (index + 1)" />
           <el-form-item v-if="active === 3" label="文字:">
             <el-input v-model="item.script" placeholder="请输入快捷按钮文字" />
           </el-form-item>
           <el-form-item v-else label="Banner:">
-            <Upload listType="picture-card" :url="item.banner" :width="343" :height="140" @upload="getUpload($event, index)" />
+            <Upload
+              listType="picture-card"
+              :url="item.banner"
+              :width="343"
+              :height="140"
+              @upload="getUpload($event, index)"
+            />
           </el-form-item>
           <el-form-item label="选择日期:">
-            <el-date-picker v-model="item.date" size="small" type="datetimerange" start-placeholder="开始时间"
-              end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss" />
+            <el-date-picker
+              v-model="item.date"
+              size="small"
+              type="datetimerange"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              value-format="yyyy-MM-dd HH:mm:ss"
+            />
           </el-form-item>
           <el-form-item label="跳转:">
             <el-select v-model="item.skip" placeholder="请选择跳转页面">
-              <el-option v-for="item in typeOptions" :key="item.value" :label="item.label"
-                :value="Number(item.value)" />
+              <el-option
+                v-for="item in typeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="Number(item.value)"
+              />
             </el-select>
           </el-form-item>
           <el-form-item label="网址:">
             <el-input v-model="item.skipUrl" placeholder="请输入网址" />
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" @click="getSubmit(item, index)"
-              v-hasPermi="['ohplay:operation:submit']">确定</el-button>
+            <el-button
+              type="primary"
+              @click="getSubmit(item, index)"
+              v-hasPermi="['ohplay:operation:submit']"
+              >确定</el-button
+            >
           </el-form-item>
         </el-form>
       </div>
@@ -44,100 +80,119 @@
 </template>
 
 <script>
-import { create, edit, list, remove } from '@/api/ohplay/operation';
+import { create, edit, list, remove } from "@/api/ohplay/operation";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
-      img: [{
-        id: 1,
-        url: require('@/assets/images/ohplay/banner.png')
-      }, {
-        id: 2,
-        url: require('@/assets/images/ohplay/pop.png')
-      }, {
-        id: 3,
-        url: require('@/assets/images/ohplay/shortcut.png')
-      }],
+      img: [
+        {
+          id: 1,
+          url: require("@/assets/images/ohplay/banner.png"),
+        },
+        {
+          id: 2,
+          url: require("@/assets/images/ohplay/pop.png"),
+        },
+        {
+          id: 3,
+          url: require("@/assets/images/ohplay/shortcut.png"),
+        },
+      ],
       active: 1,
-      label: '广告位',
+      label: "广告位",
       // 列表
       list: [],
       // 跳转类型
-      typeOptions: [{
-        value: 0,
-        label: '指定页面'
-      }, {
-        value: 1,
-        label: '指定URL'
-      }]
-    }
+      typeOptions: [
+        {
+          value: 0,
+          label: "指定页面",
+        },
+        {
+          value: 1,
+          label: "指定URL",
+        },
+      ],
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 切换选中位置
     getActive(id) {
       if (this.active !== id) {
-        this.active = id
-        this.label = id === 1 ? '广告位' : id === 2 ? '推广位' : '快捷位'
-        this.getList()
+        this.active = id;
+        this.label = id === 1 ? "广告位" : id === 2 ? "推广位" : "快捷位";
+        this.getList();
       }
     },
 
     // 添加
     getAdd() {
-      this.list.push({})
+      this.list.push({});
     },
 
     // 隐藏添加按钮
     isShow() {
-      return this.active === 3 ? this.list.length < 4 ? true : false : this.list.length < 6 ? true : false
+      return this.active === 3
+        ? this.list.length < 4
+          ? true
+          : false
+        : this.list.length < 6
+        ? true
+        : false;
     },
 
     // 删除
     getDelete(id, index) {
-      if (id) {
-        this.$confirm('是否删除?', '提示', {
-          'confirmButtonText': '确定',
-          'cancelButtonText': '取消',
-          type: 'warning'
-        }).then(() => {
-          remove(id).then(res => {
-            if (res.code === 0) {
-              this.$message.success('删除成功!')
-              this.getList()
-            }
-          })
-        })
-      } else {
-        this.list.splice(index, 1)
-      }
+      var that = this;
+      dialogCallBack(that, function () {
+        if (id) {
+          that
+            .$confirm("是否删除?", "提示:", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            })
+            .then(() => {
+              remove(id).then((res) => {
+                if (res.code === 0) {
+                  that.$message.success("删除成功!");
+                  that.getList();
+                }
+              });
+            });
+        } else {
+          that.list.splice(index, 1);
+        }
+      });
     },
 
     // 列表
     getList() {
-      let type = this.active === 1 ? 2 : this.active === 2 ? 0 : 1
-      this.list = []
+      let type = this.active === 1 ? 2 : this.active === 2 ? 0 : 1;
+      this.list = [];
       list({
-        type: type
-      }).then(res => {
+        type: type,
+      }).then((res) => {
         if (res.code === 0) {
           if (res.data) {
-            res.data.map(i => {
+            res.data.map((i) => {
               this.list.push({
                 date: [i.startCreateTime, i.endCreateTime],
-                ...i
-              })
-            })
+                ...i,
+              });
+            });
           }
         }
-      })
+      });
     },
 
     // 上传图片
     getUpload(e, index) {
-      this.list[index].banner = e.file 
+      this.list[index].banner = e.file;
     },
 
     // 新增 编辑
@@ -150,27 +205,27 @@ export default {
         skip: item.skip,
         skipUrl: item.skipUrl,
         script: item.script,
-        banner: item.banner
-      }
+        banner: item.banner,
+      };
       if (item.id) {
-        form.id = item.id
-        edit(form).then(res => {
+        form.id = item.id;
+        edit(form).then((res) => {
           if (res.code === 0) {
-            this.$message.success('修改成功!')
-            this.getList()
+            this.$message.success("修改成功!");
+            this.getList();
           }
-        })
+        });
       } else {
-        create(form).then(res => {
+        create(form).then((res) => {
           if (res.code === 0) {
-            this.$message.success('创建成功!')
-            this.getList()
+            this.$message.success("创建成功!");
+            this.getList();
           }
-        })
+        });
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -216,7 +271,7 @@ export default {
 }
 
 .active::after {
-  content: '';
+  content: "";
   background: rgba(255, 255, 0, 0.3);
   position: absolute;
   top: 0;
@@ -224,4 +279,4 @@ export default {
   width: 100%;
   height: 100%;
 }
-</style>
+</style>

+ 21 - 17
src/views/operation/activity/index.vue

@@ -1,4 +1,4 @@
-<!-- 活动管理ß -->
+<!-- 运营管理 活动管理 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
@@ -199,8 +199,6 @@
               :value="item.value"
               :label="item.label"
             />
-
-            
           </el-select>
         </el-form-item>
       </el-form>
@@ -214,12 +212,13 @@
 
 <script>
 import {
-allNoDeleteList,
-change,
-doExchange,
-list,
+  allNoDeleteList,
+  change,
+  doExchange,
+  list,
 } from "@/api/operation/activity";
 import { currentMixin, devMixin, disabledMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [devMixin, currentMixin, disabledMixin],
   data() {
@@ -361,15 +360,20 @@ export default {
 
     // 删除
     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();
+              }
+            });
+          });
       });
     },
 
@@ -388,4 +392,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 128 - 78
src/views/operation/agreement/index.vue

@@ -1,30 +1,60 @@
+<!-- 运营管理 协议管理 -->
 <template>
-  <div class='app-container'>
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDetail()"
-      v-hasPermi="['operation:agreement:add']">新增</el-button>
+  <div class="app-container">
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDetail()"
+      v-hasPermi="['operation:agreement:add']"
+      >新增</el-button
+    >
+
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="序号" align="center" type="index" />
       <el-table-column label="协议名称" align="center" prop="name" />
-      <el-table-column label="协议类型" align="center" prop="type" :formatter="typeFormatter" />
+      <el-table-column
+        label="协议类型"
+        align="center"
+        prop="type"
+        :formatter="typeFormatter"
+      />
       <el-table-column label="更新时间" align="center" prop="updateTime" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <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="['operation:agreement:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)"
-            v-hasPermi="['operation:agreement:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['operation:agreement:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:agreement: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"
+    />
   </div>
 </template>
 
 <script>
-import { list, remove } from '@/api/operation/agreement'
+import { list, remove } from "@/api/operation/agreement";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -33,69 +63,83 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
       // 总数据
       total: 0,
       // 协议类型
-      typeOptions: [{
-        value: 0,
-        label: '用户协议'
-      }, {
-        value: 1,
-        label: '隐私协议'
-      }, {
-        value: 2,
-        label: '音乐服务许可协议'
-      }, {
-        value: 3,
-        label: '儿童隐私保护指南'
-      }, {
-        value: 4,
-        label: 'VIP音乐服务协议'
-      }, {
-        value: 5,
-        label: '爱听付费协议'
-      }, {
-        value: 6,
-        label: '关于我们'
-      }, {
-        value: 7,
-        label: '第三方信息共享清单'
-      },{
-        value: 8,
-        label: '已收集个人信息清单'
-      }, {
-        value: 9,
-        label: '连接设备提示'
-      }, {
-        value: 10,
-        label: '联通认证服务协议'
-      }, {
-        value: 11,
-        label: '电信认证服务协议'
-      }, {
-        value: 12,
-        label: '移动认证服务协议'
-      }]
-    }
+      typeOptions: [
+        {
+          value: 0,
+          label: "用户协议",
+        },
+        {
+          value: 1,
+          label: "隐私协议",
+        },
+        {
+          value: 2,
+          label: "音乐服务许可协议",
+        },
+        {
+          value: 3,
+          label: "儿童隐私保护指南",
+        },
+        {
+          value: 4,
+          label: "VIP音乐服务协议",
+        },
+        {
+          value: 5,
+          label: "爱听付费协议",
+        },
+        {
+          value: 6,
+          label: "关于我们",
+        },
+        {
+          value: 7,
+          label: "第三方信息共享清单",
+        },
+        {
+          value: 8,
+          label: "已收集个人信息清单",
+        },
+        {
+          value: 9,
+          label: "连接设备提示",
+        },
+        {
+          value: 10,
+          label: "联通认证服务协议",
+        },
+        {
+          value: 11,
+          label: "电信认证服务协议",
+        },
+        {
+          value: 12,
+          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;
         }
-      })
+      });
     },
 
     // 详情
@@ -104,29 +148,35 @@ export default {
         path: `/operation/agreement/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     typeFormatter(row) {
-      return this.selectDictLabel(this.typeOptions, row.type)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.typeOptions, row.type);
+    },
+  },
+};
+</script>

+ 17 - 10
src/views/operation/channel/index.vue

@@ -1,3 +1,4 @@
+<!-- 定制频道-->
 <template>
   <div class="app-container">
     <!-- 新增 -->
@@ -171,6 +172,7 @@ editPage,
 getRemove,
 page,
 } from "@/api/operation/channel";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   name: "Channel",
   data() {
@@ -264,15 +266,20 @@ export default {
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示", {
-        type: "warning",
-      }).then(() => {
-        getRemove(row.id).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("删除成功!");
-            this.getList();
-          }
-        });
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            getRemove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
       });
     },
 
@@ -372,4 +379,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 28 - 19
src/views/operation/channels/index.vue

@@ -1,4 +1,4 @@
-<!-- 多频多台 -->
+<!-- 运营管理 多频多台 -->
 <template>
   <div class="app-container">
     <el-button
@@ -9,6 +9,7 @@
       v-hasPermi="['operation:channels:add']"
       >新增多频多台</el-button
     >
+
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="频道名称" align="center" prop="name" />
       <el-table-column label="设备" align="center">
@@ -285,6 +286,8 @@ list,
 remove,
 submit,
 } from "@/api/operation/channels";
+
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -365,12 +368,15 @@ export default {
 
     // 删除频道规则
     getRemove(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示").then(() => {
-        remove(row.id).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("删除成功!");
-            this.getList();
-          }
+      var that = this;
+      dialogCallBack(that, function () {
+        that.$confirm(`是否删除${row.name}?`, "提示:").then(() => {
+          remove(row.id).then((res) => {
+            if (res.code === 0) {
+              that.$message.success("删除成功!");
+              that.getList();
+            }
+          });
         });
       });
     },
@@ -387,7 +393,6 @@ export default {
       }
     },
 
-    // console.log("列表弹窗展示===00===" + JSON.stringify(res));
     //弹窗 详情
     getDetail() {
       detail(this.row.id).then((res) => {
@@ -502,16 +507,20 @@ export default {
 
     // 删除
     getDelete(item) {
-      this.$confirm(`是否删除${item.channelTypeName}?`, "提示")
-        .then(() => {
-          classRemove(item.channelTypeId).then((res) => {
-            if (res.code === 0) {
-              this.$message.success("删除成功!");
-              this.getDetail();
-            }
-          });
-        })
-        .catch(() => {});
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${item.channelTypeName}?`, "提示:")
+          .then(() => {
+            classRemove(item.channelTypeId).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getDetail();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 12频道详情
@@ -549,4 +558,4 @@ export default {
     margin: 0 10px 10px 0;
   }
 }
-</style>
+</style>

+ 123 - 62
src/views/operation/feedbacktype/index.vue

@@ -1,28 +1,74 @@
+<!-- 运营管理 意见反馈 反馈类型 -->
 <template>
-  <div class='app-container'>
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog('新增')"
-      v-hasPermi="['operation:feedbacktype:add']">新增</el-button>
+  <div class="app-container">
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDialog('新增')"
+      v-hasPermi="['operation:feedbacktype:add']"
+      >新增</el-button
+    >
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
-      <el-table-column label="序号" type="index" align="center"></el-table-column>
-      <el-table-column label="排序" prop="sort" align="center"></el-table-column>
-      <el-table-column label="类型名称" prop="name" 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="sort"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="类型名称"
+        prop="name"
+        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="getDialog('编辑', scope.row.id)"
-            v-hasPermi="['operation:feedbacktype:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)"
-            v-hasPermi="['operation:feedbacktype:delete']">删除</el-button>
+          <el-button
+            type="text"
+            @click="getDialog('编辑', scope.row.id)"
+            v-hasPermi="['operation:feedbacktype:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:feedbacktype: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="title" width="500px" :before-close="close">
-      <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="100px">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="close"
+    >
+      <el-form
+        :model="dialogForm"
+        ref="dialogForm"
+        :rules="rules"
+        label-width="100px"
+      >
         <el-form-item label="类型名称:" prop="name">
           <el-input v-model="dialogForm.name" placeholder="请输入类型名称" />
         </el-form-item>
@@ -39,7 +85,8 @@
 </template>
 
 <script>
-import { list, detail, remove, submit } from '@/api/operation/feedbacktype'
+import { detail, list, remove, submit } from "@/api/operation/feedbacktype";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -48,7 +95,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
@@ -57,83 +104,97 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗标题
-      title: '新增',
+      title: "新增",
       // 弹窗表单
       dialogForm: {},
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入类型名称', trigger: 'blur'
-        }],
-        sort: [{
-          required: true, message: '请输入排序', trigger: 'blur'
-        }]
-      }
-    }
+        name: [
+          {
+            required: true,
+            message: "请输入类型名称",
+            trigger: "blur",
+          },
+        ],
+        sort: [
+          {
+            required: true,
+            message: "请输入排序",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
   },
   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;
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: "warning"
-      }).then(() => {
-        remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 弹窗
     getDialog(title, id) {
-      this.dialogVisible = true
-      this.title = title
+      this.dialogVisible = true;
+      this.title = title;
       if (id) {
-        detail(id).then(res => {
-          this.dialogForm = res.data
-        })
+        detail(id).then((res) => {
+          this.dialogForm = res.data;
+        });
       }
     },
 
     // 关闭
     close() {
-      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.close()
-              this.getList()
+              this.$message.success("提交成功!");
+              this.close();
+              this.getList();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
-    }
-  }
-}
-</script>
+      });
+    },
+  },
+};
+</script>

+ 99 - 52
src/views/operation/map/detail.vue

@@ -1,18 +1,39 @@
 <template>
-  <div class='app-container'>
-    <el-form :model="form" ref="form" :rules="rules" label-width="100px" :disabled="disabled">
+  <div class="app-container">
+    <el-form
+      :model="form"
+      ref="form"
+      :rules="rules"
+      label-width="100px"
+      :disabled="disabled"
+    >
       <el-form-item label="门店名称:" prop="name">
         <el-input v-model="form.name" placeholder="请输入门店名称" />
       </el-form-item>
       <el-form-item label="门店图片:" prop="icon">
-        <Upload list-type="picture-card" :url="form.icon" @upload="upload" :disabled="disabled" />
+        <Upload
+          list-type="picture-card"
+          :url="form.icon"
+          @upload="upload"
+          :disabled="disabled"
+        />
       </el-form-item>
       <el-form-item label="联系电话:">
         <el-input v-model="form.linkPhone" placeholder="请输入联系电话" />
       </el-form-item>
       <el-form-item label="城市筛选:" prop="cascader">
-        <el-cascader style="width: 100%" v-model="form.cascader" :options="mapOptions" placeholder="请选择省市区"
-          :props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
+        <el-cascader
+          style="width: 100%"
+          v-model="form.cascader"
+          :options="mapOptions"
+          placeholder="请选择省市区"
+          :props="{
+            value: 'id',
+            label: 'name',
+            children: 'childList',
+            checkStrictly: true,
+          }"
+        />
       </el-form-item>
       <el-form-item label="详细地址:" prop="address">
         <el-input v-model="form.address" placeholder="请输入详细地址" />
@@ -26,100 +47,126 @@
     </el-form>
     <div class="form-btn">
       <el-button @click="cancel">取消</el-button>
-      <el-button v-if="!disabled" type="primary" @click="getSubmit">确定</el-button>
+      <el-button v-if="!disabled" type="primary" @click="getSubmit"
+        >确定</el-button
+      >
     </div>
   </div>
 </template>
 
 <script>
-import { mapMixin } from '@/mixin/index'
-import { detail, submit } from '@/api/operation/map'
+import { detail, submit } from "@/api/operation/map";
+import { mapMixin } from "@/mixin/index";
 export default {
   mixins: [mapMixin],
   data() {
     return {
       // 表单
       form: {
-        icon: '',
-        status: 0
+        icon: "",
+        status: 0,
       },
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入门店名称', trigger: 'blur'
-        }],
-        icon: [{
-          required: true, message: '请上传门店图片', trigger: 'change'
-        }],
-        cascader: [{
-          required: true, message: '请选择省市区', trigger: 'change'
-        }],
-        address: [{
-          required: true, message: '请输入详细地址', trigger: 'blur'
-        }],
-        latitude: [{
-          required: true, message: '请输入纬度', trigger: 'blur'
-        }],
-        longitude: [{
-          required: true, message: '请输入经度', trigger: 'blur'
-        }]
+        name: [
+          {
+            required: true,
+            message: "请输入门店名称",
+            trigger: "blur",
+          },
+        ],
+        icon: [
+          {
+            required: true,
+            message: "请上传门店图片",
+            trigger: "change",
+          },
+        ],
+        cascader: [
+          {
+            required: true,
+            message: "请选择省市区",
+            trigger: "change",
+          },
+        ],
+        address: [
+          {
+            required: true,
+            message: "请输入详细地址",
+            trigger: "blur",
+          },
+        ],
+        latitude: [
+          {
+            required: true,
+            message: "请输入纬度",
+            trigger: "blur",
+          },
+        ],
+        longitude: [
+          {
+            required: true,
+            message: "请输入经度",
+            trigger: "blur",
+          },
+        ],
       },
       // 只读
-      disabled: false
-    }
+      disabled: false,
+    };
   },
   mounted() {
     if (this.$route.query.id) {
-      this.getDetail()
-      this.disabled = Boolean(this.$route.query.boolean)
+      this.getDetail();
+      this.disabled = Boolean(this.$route.query.boolean);
     }
   },
   methods: {
     // 详情
     getDetail() {
-      detail(this.$route.query.id).then(res => {
+      detail(this.$route.query.id).then((res) => {
         if (res.code === 0) {
-          this.form = res.data
-          this.$set(this.form, 'cascader', [res.data.province])
+          this.form = res.data;
+          this.$set(this.form, "cascader", [res.data.province]);
           if (res.data.city) {
-            this.form.cascader[1] = res.data.city
+            this.form.cascader[1] = res.data.city;
           }
           if (res.data.area) {
-            this.form.cascader[2] = res.data.area
+            this.form.cascader[2] = res.data.area;
           }
         }
-      })
+      });
     },
 
     // 上传
     upload(e) {
-      this.form.icon = e.file
+      this.form.icon = e.file;
     },
 
     cancel() {
-      this.$tab.closeOpenPage("/operation/map")
+      this.$tab.closeOpenPage("/operation/map");
     },
 
     // 提交
     getSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          this.form.province = this.form.cascader[0]
-          this.form.city = this.form.cascader[1] ? this.form.cascader[1] : null
-          this.form.area = this.form.cascader[2] ? this.form.cascader[2] : null
-          submit(this.form).then(res => {
+          this.form.province = this.form.cascader[0];
+          this.form.city = this.form.cascader[1] ? this.form.cascader[1] : null;
+          this.form.area = this.form.cascader[2] ? this.form.cascader[2] : null;
+          submit(this.form).then((res) => {
             if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.cancel()
+              this.$message.success("提交成功!");
+              this.cancel();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 146 - 71
src/views/operation/map/index.vue

@@ -1,33 +1,62 @@
+<!-- 运营管理 门店管理 -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="门店名称:">
         <el-input v-model="form.name" placeholder="请输入门店名称" clearable />
       </el-form-item>
       <el-form-item label="城市筛选:">
-        <el-cascader v-model="form.list" :options="mapOptions" placeholder="请选择省市区" clearable
-          :props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
+        <el-cascader
+          v-model="form.list"
+          :options="mapOptions"
+          placeholder="请选择省市区"
+          clearable
+          :props="{
+            value: 'id',
+            label: 'name',
+            children: 'childList',
+            checkStrictly: true,
+          }"
+        />
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </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" icon="el-icon-plus" plain @click="getDetail()"
-          v-hasPermi="['operation:map:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['operation:map: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 label="门店名称" prop="name" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="门店名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="联系电话" prop="linkPhone" align="center">
         <template slot-scope="scope">
-          {{ scope.row.linkPhone ? scope.row.linkPhone : '暂无联系电话' }}
+          {{ scope.row.linkPhone ? scope.row.linkPhone : "暂无联系电话" }}
         </template>
       </el-table-column>
       <el-table-column label="门店图片" align="center" width="100px">
@@ -36,31 +65,69 @@
         </template>
       </el-table-column>
       <el-table-column label="地区" align="center" :formatter="areaFormatter" />
-      <el-table-column label="详细地址" prop="address" align="center" show-overflow-tooltip />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="详细地址"
+        prop="address"
+        align="center"
+        show-overflow-tooltip
+      />
+      <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 v-if="scope.row.status === 0" type="text" @click="getChange(scope.row.id, 1, '禁用')"
-            v-hasPermi="['operation:map:down']">禁用</el-button>
-          <span v-else style="margin-left: 10px;">
-            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['operation:map:edit']">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row.id, 0, '启用')"
-              v-hasPermi="['operation:map:up']">启用</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['operation:map:delete']">删除</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.id, 1, '禁用')"
+            v-hasPermi="['operation:map:down']"
+            >禁用</el-button
+          >
+          <span v-else style="margin-left: 10px">
+            <el-button
+              type="text"
+              @click="getDetail(scope.row.id)"
+              v-hasPermi="['operation:map:edit']"
+              >编辑</el-button
+            >
+            <el-button
+              type="text"
+              @click="getChange(scope.row.id, 0, '启用')"
+              v-hasPermi="['operation:map:up']"
+              >启用</el-button
+            >
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['operation:map:delete']"
+              >删除</el-button
+            >
           </span>
         </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 { mapMixin } from '@/mixin/index'
-import { list, change, remove } from '@/api/operation/map'
+import { change, list, remove } from "@/api/operation/map";
+import { mapMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [mapMixin],
   data() {
@@ -71,58 +138,61 @@ export default {
       form: {
         pageNum: 1,
         pageSize: 10,
-        list: []
+        list: [],
       },
       // 总数据
       total: 0,
       // 列表
       tableData: [],
       // 当前状态
-      statusOptions: [{
-        value: 0,
-        label: '启用'
-      }, {
-        value: 1,
-        label: '禁用'
-      }]
-    }
+      statusOptions: [
+        {
+          value: 0,
+          label: "启用",
+        },
+        {
+          value: 1,
+          label: "禁用",
+        },
+      ],
+    };
   },
   watch: {
-    'form.list'(val) {
-      this.form.province = val[0]
-      this.form.city = val[1]
-      this.form.area = val[2]
-    }
+    "form.list"(val) {
+      this.form.province = val[0];
+      this.form.city = val[1];
+      this.form.area = val[2];
+    },
   },
   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();
     },
 
     // 新增、 编辑、 查看
@@ -131,39 +201,44 @@ export default {
         path: `/operation/map/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 启用 禁用
     getChange(id, status, title) {
-      change(id, status).then(res => {
+      change(id, status).then((res) => {
         if (res.code === 0) {
-          this.$message.success(`${title}成功!`)
-          this.getList()
+          this.$message.success(`${title}成功!`);
+          this.getList();
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
+      });
     },
 
     // 字典翻译
     statusFormatter(row) {
-      return this.selectDictLabel(this.statusOptions, row.status)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.statusOptions, row.status);
+    },
+  },
+};
+</script>

+ 181 - 93
src/views/operation/module/index.vue

@@ -1,46 +1,109 @@
+<!-- 运营管理 首页推荐 模块配置 -->
 <template>
   <div class="app-container">
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog('新增')"
-      v-hasPermi="['operation:module:add']">新增</el-button>
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDialog('新增')"
+      v-hasPermi="['operation:module:add']"
+      >新增</el-button
+    >
+
     <!-- 列表 -->
     <el-table :data="tableData">
-      <el-table-column label="序号" type="index" align="center"></el-table-column>
-      <el-table-column label="模块类型" prop="typeName" align="center"></el-table-column>
-      <el-table-column label="模块组件" align="center" :formatter="elementIdsFormatter" />
+      <el-table-column
+        label="序号"
+        type="index"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="模块类型"
+        prop="typeName"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="模块组件"
+        align="center"
+        :formatter="elementIdsFormatter"
+      />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog('查看', scope.row.typeId, true)">查看</el-button>
-          <el-button type="text" @click="getDialog('编辑', scope.row.typeId)"
-            v-hasPermi="['operation:module:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['operation:module:delete']">删除</el-button>
+          <el-button
+            type="text"
+            @click="getDialog('查看', scope.row.typeId, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDialog('编辑', scope.row.typeId)"
+            v-hasPermi="['operation:module:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:module: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="title" width="500px" :before-close="cancel">
-      <el-form :model="dialogForm" :rules="rules" ref="dialogForm" label-width="100px" :disabled="disabled">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="cancel"
+    >
+      <el-form
+        :model="dialogForm"
+        :rules="rules"
+        ref="dialogForm"
+        label-width="100px"
+        :disabled="disabled"
+      >
         <el-form-item label="模块类型:" prop="typeName">
-          <el-input v-model="dialogForm.typeName" placeholder="请输入模块类型名称" />
+          <el-input
+            v-model="dialogForm.typeName"
+            placeholder="请输入模块类型名称"
+          />
         </el-form-item>
         <el-form-item label="模块组件:" prop="elementIds">
-          <el-select v-model="dialogForm.elementIds" multiple placeholder="请选择模块组件">
-            <el-option v-for="item in mouldOptions" :key="item.value" :value="item.value.toString()"
-              :label="item.label" />
+          <el-select
+            v-model="dialogForm.elementIds"
+            multiple
+            placeholder="请选择模块组件"
+          >
+            <el-option
+              v-for="item in mouldOptions"
+              :key="item.value"
+              :value="item.value.toString()"
+              :label="item.label"
+            />
           </el-select>
         </el-form-item>
       </el-form>
       <div slot="footer">
         <el-button @click="cancel">取消</el-button>
-        <el-button v-if="!disabled" type="primary" @click="getSubmit">确定</el-button>
+        <el-button v-if="!disabled" type="primary" @click="getSubmit"
+          >确定</el-button
+        >
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { list, submit, detail, remove } from '@/api/operation/module'
+import { detail, list, remove, submit } from "@/api/operation/module";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -49,7 +112,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
@@ -58,124 +121,149 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗标题
-      title: '新增',
+      title: "新增",
       // 弹窗表单
       dialogForm: {
-        elementIds: []
+        elementIds: [],
       },
       // 模块选择
-      mouldOptions: [{
-        value: 1,
-        label: '标题'
-      }, {
-        value: 3,
-        label: '简介'
-      }, {
-        value: 4,
-        label: '内容'
-      }, {
-        value: 5,
-        label: '跳转方式'
-      }, {
-        value: 6,
-        label: '封面模式'
-      }, {
-        value: 7,
-        label: '图片'
-      }, {
-        value: 8,
-        label: '排序'
-      }, {
-        value: 9,
-        label: '列表'
-      }],
+      mouldOptions: [
+        {
+          value: 1,
+          label: "标题",
+        },
+        {
+          value: 3,
+          label: "简介",
+        },
+        {
+          value: 4,
+          label: "内容",
+        },
+        {
+          value: 5,
+          label: "跳转方式",
+        },
+        {
+          value: 6,
+          label: "封面模式",
+        },
+        {
+          value: 7,
+          label: "图片",
+        },
+        {
+          value: 8,
+          label: "排序",
+        },
+        {
+          value: 9,
+          label: "列表",
+        },
+      ],
       // 校验
       rules: {
-        typeName: [{
-          required: true, message: '请输入模块类型名称', trigger: 'blur'
-        }],
-        elementIds: [{
-          required: true, message: '请选择模块组件', trigger: 'change'
-        }]
+        typeName: [
+          {
+            required: true,
+            message: "请输入模块类型名称",
+            trigger: "blur",
+          },
+        ],
+        elementIds: [
+          {
+            required: true,
+            message: "请选择模块组件",
+            trigger: "change",
+          },
+        ],
       },
       // 只读
-      disabled: false
-    }
+      disabled: false,
+    };
   },
   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(title, id, boolean) {
-      this.dialogVisible = true
-      this.title = title
+      this.dialogVisible = true;
+      this.title = title;
       if (id) {
-        detail(id).then(res => {
+        detail(id).then((res) => {
           if (res.code === 0) {
-            this.dialogForm = res.data
+            this.dialogForm = res.data;
           }
-        })
+        });
       }
-      this.disabled = boolean
+      this.disabled = boolean;
     },
 
     // 取消
     cancel() {
-      this.dialogVisible = false
-      this.$refs.dialogForm.resetFields()
-      this.dialogForm = {}
+      this.dialogVisible = false;
+      this.$refs.dialogForm.resetFields();
+      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.getList()
-              this.$message.success(`${this.title}成功!`)
-              this.cancel()
+              this.getList();
+              this.$message.success(`${this.title}成功!`);
+              this.cancel();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.typeName}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.typeId).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.typeName}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.typeId).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     elementIdsFormatter(row) {
-      return row.elementIds.map(i => this.selectDictLabel(this.mouldOptions, i)).join(',')
-    }
-  }
-}
+      return row.elementIds
+        .map((i) => this.selectDictLabel(this.mouldOptions, i))
+        .join(",");
+    },
+  },
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>

+ 330 - 153
src/views/operation/recommend/index.vue

@@ -1,15 +1,30 @@
+<!-- 运营管理 首页推荐 推荐管理 -->
 <template>
   <div class="app-container">
     <!-- 列表 -->
-    <el-table :data="tableData" ref="tableData" row-key="id" :default-sort="{ prop: 'sort', order: 'ascending' }"
-      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
+    <el-table
+      :data="tableData"
+      ref="tableData"
+      row-key="id"
+      :default-sort="{ prop: 'sort', order: 'ascending' }"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+    >
       <el-table-column width="80px">
         <template slot-scope="scope">
-          <el-link v-if="scope.row.hidden" :underline="false" class="el-icon-arrow-right"
-            @click="getList(scope.row, scope.row.index)" />
+          <el-link
+            v-if="scope.row.hidden"
+            :underline="false"
+            class="el-icon-arrow-right"
+            @click="getList(scope.row, scope.row.index)"
+          />
         </template>
       </el-table-column>
-      <el-table-column label="导航名称" align="center" prop="name" show-overflow-tooltip>
+      <el-table-column
+        label="导航名称"
+        align="center"
+        prop="name"
+        show-overflow-tooltip
+      >
         <template slot-scope="scope">
           <span v-if="scope.row.lv === 1">{{ scope.row.name }}</span>
         </template>
@@ -19,10 +34,26 @@
           <span v-if="scope.row.lv === 2">{{ scope.row.sort }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="模块类型" align="center" prop="moduleTypeId" show-overflow-tooltip :formatter="typeFormatter" />
-      <el-table-column label="模块名称" align="center" prop="moduleName" show-overflow-tooltip />
+      <el-table-column
+        label="模块类型"
+        align="center"
+        prop="moduleTypeId"
+        show-overflow-tooltip
+        :formatter="typeFormatter"
+      />
+      <el-table-column
+        label="模块名称"
+        align="center"
+        prop="moduleName"
+        show-overflow-tooltip
+      />
       <el-table-column label="模块数量" align="center" prop="moduleNum" />
-      <el-table-column label="创建时间" align="center" prop="createTime" show-overflow-tooltip />
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+        show-overflow-tooltip
+      />
       <el-table-column label="有效时间" align="center" width="380px">
         <template slot-scope="scope">
           <span v-if="scope.row.lv === 3">
@@ -30,39 +61,101 @@
           </span>
         </template>
       </el-table-column>
-      <el-table-column label="当前状态" align="center" prop="isProgressStatus" :formatter="statusFormatter" />
+      <el-table-column
+        label="当前状态"
+        align="center"
+        prop="isProgressStatus"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
           <span v-if="scope.row.lv === 1">
-            <el-button type="text" @click="getDialog('新增', scope.row)"
-              v-hasPermi="['operation:recommend:add']">新增</el-button>
-            <el-button type="text" @click="getHistoryDialog(scope.row.id)">历史记录</el-button>
+            <el-button
+              type="text"
+              @click="getDialog('新增', scope.row)"
+              v-hasPermi="['operation:recommend:add']"
+              >新增</el-button
+            >
+            <el-button type="text" @click="getHistoryDialog(scope.row.id)"
+              >历史记录</el-button
+            >
           </span>
           <span v-else-if="scope.row.lv === 2">
-            <el-button type="text" @click="getDetail(scope.row)" v-hasPermi="['operation:recommend:add']">新增</el-button>
-            <el-button type="text" @click="getDialog('查看', scope.row)">查看</el-button>
-            <el-button type="text" @click="getDialog('编辑', scope.row)"
-              v-hasPermi="['operation:recommend:edit']">编辑</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)"
-              v-hasPermi="['operation:recommend:delete']">删除</el-button>
+            <el-button
+              type="text"
+              @click="getDetail(scope.row)"
+              v-hasPermi="['operation:recommend:add']"
+              >新增</el-button
+            >
+            <el-button type="text" @click="getDialog('查看', scope.row)"
+              >查看</el-button
+            >
+            <el-button
+              type="text"
+              @click="getDialog('编辑', scope.row)"
+              v-hasPermi="['operation:recommend:edit']"
+              >编辑</el-button
+            >
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['operation:recommend:delete']"
+              >删除</el-button
+            >
           </span>
           <span v-else>
-            <el-button type="text" @click="getDetail(scope.row, true)">查看</el-button>
-            <el-button type="text" @click="getDetail(scope.row)" v-hasPermi="['operation:recommend:edit']">编辑</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)"
-              v-hasPermi="['operation:recommend:delete']">删除</el-button>
-            <el-button type="text" @click="getCopy(scope.row)" v-hasPermi="['operation:recommend:copy']">复制</el-button>
+            <el-button type="text" @click="getDetail(scope.row, true)"
+              >查看</el-button
+            >
+            <el-button
+              type="text"
+              @click="getDetail(scope.row)"
+              v-hasPermi="['operation:recommend:edit']"
+              >编辑</el-button
+            >
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['operation:recommend:delete']"
+              >删除</el-button
+            >
+            <el-button
+              type="text"
+              @click="getCopy(scope.row)"
+              v-hasPermi="['operation:recommend:copy']"
+              >复制</el-button
+            >
           </span>
         </template>
       </el-table-column>
     </el-table>
 
     <!-- 弹窗 -->
-    <el-dialog :visible.sync="dialogVisible" :title="title" width="500px" :before-close="cancel">
-      <el-form :model="dialogForm" :rules="rules" ref="dialogForm" label-width="100px" :disabled="title === '查看'">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="cancel"
+    >
+      <el-form
+        :model="dialogForm"
+        :rules="rules"
+        ref="dialogForm"
+        label-width="100px"
+        :disabled="title === '查看'"
+      >
         <el-form-item label="模块类型:" prop="moduleTypeId">
-          <el-select v-model="dialogForm.moduleTypeId" placeholder="请选择模块类型" :disabled="title === '编辑'">
-            <el-option v-for="item in typeOptions" :key="item.typeId" :value="item.typeId" :label="item.typeName" />
+          <el-select
+            v-model="dialogForm.moduleTypeId"
+            placeholder="请选择模块类型"
+            :disabled="title === '编辑'"
+          >
+            <el-option
+              v-for="item in typeOptions"
+              :key="item.typeId"
+              :value="item.typeId"
+              :label="item.typeName"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="排序:" prop="sort">
@@ -71,50 +164,105 @@
       </el-form>
       <div slot="footer">
         <el-button @click="cancel">取消</el-button>
-        <el-button v-if="title !== '查看'" type="primary" @click="getSubmit">确定</el-button>
+        <el-button v-if="title !== '查看'" type="primary" @click="getSubmit"
+          >确定</el-button
+        >
       </div>
     </el-dialog>
 
     <!-- 历史记录 -->
-    <el-dialog :visible.sync="dialogVisible_list" title="历史记录" width="1200px">
+    <el-dialog
+      :visible.sync="dialogVisible_list"
+      title="历史记录"
+      width="1200px"
+    >
       <el-form inline size="mini">
         <el-form-item label="创建时间:">
-          <el-date-picker v-model="dialogForm_list.rsDates" type="datetimerange" start-placeholder="开始日期"
-            end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" />
+          <el-date-picker
+            v-model="dialogForm_list.rsDates"
+            type="datetimerange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            format="yyyy-MM-dd HH:mm:ss"
+          />
         </el-form-item>
         <el-form-item label="模块名称:">
-          <el-input v-model="dialogForm_list.moduleName" placeholder="请输入模块名称" clearable />
+          <el-input
+            v-model="dialogForm_list.moduleName"
+            placeholder="请输入模块名称"
+            clearable
+          />
         </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-form-item>
       </el-form>
       <el-table :data="dialogTableData" v-loading="loading">
-        <el-table-column label="模块名称" prop="moduleName" align="center" show-overflow-tooltip />
-        <el-table-column label="模块类型" prop="moduleTypeId" align="center" :formatter="typeFormatter" />
+        <el-table-column
+          label="模块名称"
+          prop="moduleName"
+          align="center"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="模块类型"
+          prop="moduleTypeId"
+          align="center"
+          :formatter="typeFormatter"
+        />
         <el-table-column label="模块数量" prop="moduleNum" align="center" />
         <el-table-column label="有效时间" align="center" width="380px">
           <template slot-scope="scope">
             <span>{{ scope.row.rsDates[0] }} - {{ scope.row.rsDates[1] }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="当前状态" prop="isProgressStatus" align="center" :formatter="statusFormatter" />
-        <el-table-column label="创建时间" prop="createTime" align="center" show-overflow-tooltip />
+        <el-table-column
+          label="当前状态"
+          prop="isProgressStatus"
+          align="center"
+          :formatter="statusFormatter"
+        />
+        <el-table-column
+          label="创建时间"
+          prop="createTime"
+          align="center"
+          show-overflow-tooltip
+        />
         <el-table-column label="操作" align="center">
           <template slot-scope="scope">
-            <el-button type="text" @click="getDetail(scope.row, true)">查看</el-button>
+            <el-button type="text" @click="getDetail(scope.row, true)"
+              >查看</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
-      <pagination v-show="total > 0" :total="total" :page.sync="dialogForm_list.pageNum"
-        :limit.sync="dialogForm_list.pageSize" @pagination="getHistoryList" />
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="dialogForm_list.pageNum"
+        :limit.sync="dialogForm_list.pageSize"
+        @pagination="getHistoryList"
+      />
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { tabList, typeList, list, submit, listDetail, remove, history, timeChange } from '@/api/operation/recommend'
+import {
+history,
+list,
+listDetail,
+remove,
+submit,
+tabList,
+timeChange,
+typeList,
+} from "@/api/operation/recommend";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -129,10 +277,10 @@ export default {
       dialogForm: {},
       dialogForm_list: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 弹窗title
-      title: '新增',
+      title: "新增",
       // 弹窗列表
       dialogTableData: [],
       // 总数据
@@ -143,117 +291,135 @@ export default {
       typeOptions: [],
       // 校验
       rules: {
-        categoryId: [{
-          required: true, message: '请选择导航', tigger: 'change'
-        }],
-        moduleTypeId: [{
-          required: true, message: '请选择模块类型', tigger: 'change'
-        }],
-        sort: [{
-          required: true, type: 'number', message: '请选择排序', tirgger: 'blur, change'
-        }]
+        categoryId: [
+          {
+            required: true,
+            message: "请选择导航",
+            tigger: "change",
+          },
+        ],
+        moduleTypeId: [
+          {
+            required: true,
+            message: "请选择模块类型",
+            tigger: "change",
+          },
+        ],
+        sort: [
+          {
+            required: true,
+            type: "number",
+            message: "请选择排序",
+            tirgger: "blur, change",
+          },
+        ],
       },
       // 当前状态
-      statusOptions: [{
-        value: 0,
-        label: '生效中'
-      }, {
-        value: 1,
-        label: '未生效'
-      }, {
-        value: 2,
-        label: '未配置时间'
-      }, {
-        value: 3,
-        label: '已失效'
-      }],
+      statusOptions: [
+        {
+          value: 0,
+          label: "生效中",
+        },
+        {
+          value: 1,
+          label: "未生效",
+        },
+        {
+          value: 2,
+          label: "未配置时间",
+        },
+        {
+          value: 3,
+          label: "已失效",
+        },
+      ],
       // 当前数据缓存
-      index: null
-    }
+      index: null,
+    };
   },
   mounted() {
-    this.getTabList()
-    this.getTypeList()
+    this.getTabList();
+    this.getTypeList();
   },
   methods: {
     // 导航列表
     getTabList() {
-      tabList().then(res => {
+      tabList().then((res) => {
         if (res.code === 0) {
           res.data.map((i, index) => {
-            i.index = index
-            i.hidden = true
-            i.children = []
-          })
-          this.tabOptions = res.data
-          this.tableData = res.data
+            i.index = index;
+            i.hidden = true;
+            i.children = [];
+          });
+          this.tabOptions = res.data;
+          this.tableData = res.data;
         }
-      })
+      });
     },
 
     // 模块列表
     getTypeList() {
-      typeList().then(res => {
+      typeList().then((res) => {
         if (res.code === 0) {
-          this.typeOptions = res.data
+          this.typeOptions = res.data;
         }
-      })
+      });
     },
 
     // 首次获取二级列表
     getList(row, index) {
-      let e = this.tableData[index]
-      list(row.id).then(res => {
+      let e = this.tableData[index];
+      list(row.id).then((res) => {
         if (res.code === 0) {
           if (res.data.length > 0) {
-            e.children = res.data
-            e.hidden = false
+            e.children = res.data;
+            e.hidden = false;
             this.$nextTick(() => {
-              this.$refs.tableData.toggleRowExpansion(row, true)
-            })
+              this.$refs.tableData.toggleRowExpansion(row, true);
+            });
           } else {
-            this.$message.warning('暂无模块!')
+            this.$message.warning("暂无模块!");
           }
         }
-      })
+      });
     },
 
     // 提交二级
     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.cancel()
-              this.getList(this.tableData[this.index], this.index)
+              this.$message.success("提交成功");
+              this.cancel();
+              this.getList(this.tableData[this.index], this.index);
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 取消
     cancel() {
-      this.dialogVisible = false
-      this.$refs.dialogForm.resetFields()
-      this.dialogForm = {}
+      this.dialogVisible = false;
+      this.$refs.dialogForm.resetFields();
+      this.dialogForm = {};
     },
 
     // 弹窗
     getDialog(title, row) {
-      this.index = this.tableData.findIndex(i => i.id == row.id)
-      this.title = title
-      this.dialogVisible = true
-      this.dialogForm.categoryId = row.id
+      this.index = this.tableData.findIndex((i) => i.id == row.id);
+      this.title = title;
+      this.dialogVisible = true;
+      this.dialogForm.categoryId = row.id;
       if (row.lv === 2) {
-        listDetail(row.id).then(res => {
+        listDetail(row.id).then((res) => {
           if (res.code === 0) {
-            this.dialogForm = res.data
+            this.dialogForm = res.data;
           }
-        })
+        });
       }
     },
 
@@ -261,55 +427,64 @@ export default {
     getDetail(row, boolean) {
       this.$router.push({
         path: `/operation/homePage/recommend/detail`,
-        query: row.lv === 2 ? {
-          secondId: row.id,
-          moduleTypeId: row.moduleTypeId
-        } : {
-          threeId: row.id,
-          moduleTypeId: row.moduleTypeId,
-          boolean: boolean
-        }
-      })
+        query:
+          row.lv === 2
+            ? {
+                secondId: row.id,
+                moduleTypeId: row.moduleTypeId,
+              }
+            : {
+                threeId: row.id,
+                moduleTypeId: row.moduleTypeId,
+                boolean: boolean,
+              },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除?`, '提醒', {
-        type: 'warning'
-      }).then(() => {
-        let index = this.tableData.findIndex(i => i.id == row.categoryId)
-        remove(row.lv, row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList(this.tableData[index], index)
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            let index = that.tableData.findIndex((i) => i.id == row.categoryId);
+            remove(row.lv, row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList(that.tableData[index], index);
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 历史记录
     getHistoryDialog(id) {
-      this.dialogVisible_list = true
-      this.loading = true
-      this.dialogForm_list.categoryId = id
-      this.getHistoryList()
+      this.dialogVisible_list = true;
+      this.loading = true;
+      this.dialogForm_list.categoryId = id;
+      this.getHistoryList();
     },
 
     // 历史记录列表
     getHistoryList() {
-      history(this.dialogForm_list).then(res => {
+      history(this.dialogForm_list).then((res) => {
         if (res.code === 0) {
-          this.dialogTableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.dialogTableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 搜索
     getSearch() {
-      this.dialogForm_list.pageNum = 1
-      this.getHistoryList()
+      this.dialogForm_list.pageNum = 1;
+      this.getHistoryList();
     },
 
     // 重置
@@ -317,22 +492,22 @@ export default {
       this.dialogForm_list = {
         pageNum: 1,
         pageSize: 10,
-        categoryId: this.dialogForm_list.categoryId
-      }
-      this.getHistoryList()
+        categoryId: this.dialogForm_list.categoryId,
+      };
+      this.getHistoryList();
     },
 
     // 有效时间
     getChange(row) {
       timeChange({
         moduleId: row.id,
-        timeList: row.rsDates
-      }).then(res => {
+        timeList: row.rsDates,
+      }).then((res) => {
         if (res.code === 0) {
-          this.$message.success('修改成功!')
-          this.getTabList()
+          this.$message.success("修改成功!");
+          this.getTabList();
         }
-      })
+      });
     },
 
     // 复制
@@ -341,21 +516,23 @@ export default {
         path: `/operation/homePage/recommend/detail`,
         query: {
           copyId: row.id,
-          moduleTypeId: row.moduleTypeId
-        }
-      })
+          moduleTypeId: row.moduleTypeId,
+        },
+      });
     },
 
     // 字典翻译
     statusFormatter(row) {
-      return this.selectDictLabel(this.statusOptions, row.isProgressStatus)
+      return this.selectDictLabel(this.statusOptions, row.isProgressStatus);
     },
 
     typeFormatter(row) {
-      return row.lv !== 1 ? this.typeOptions.find(i => i.typeId === row.moduleTypeId).typeName : ''
-    }
-  }
-}
+      return row.lv !== 1
+        ? this.typeOptions.find((i) => i.typeId === row.moduleTypeId).typeName
+        : "";
+    },
+  },
+};
 </script>
 
 <style lang="scss">
@@ -366,4 +543,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 135 - 73
src/views/operation/sceneTime/index.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="app-container">
-    <el-button type="primary" size="mini" icon="el-icon-plus" @click="getDialog('新增')"
-      v-hasPermi="['operation:sceneTime:add']">新增</el-button>
+    <el-button
+      type="primary"
+      size="mini"
+      icon="el-icon-plus"
+      @click="getDialog('新增')"
+      v-hasPermi="['operation:sceneTime:add']"
+      >新增</el-button
+    >
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
@@ -13,45 +19,81 @@
       <el-table-column label="时间段文案" prop="name" align="center" />
       <el-table-column label="时间Icon" width="100px" align="center">
         <template slot-scope="scope">
-          <el-image :src="scope.row.pic" style="background: #000;" />
+          <el-image :src="scope.row.pic" style="background: #000" />
         </template>
       </el-table-column>
       <el-table-column label="创建时间" prop="createtTime" align="center" />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog('查看', scope.row)">查看</el-button>
-          <el-button type="text" @click="getDialog('编辑', scope.row)"
-            v-hasPermi="['operation:sceneTime:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row, 2)"
-            v-hasPermi="['operation:sceneTime:delete']">删除</el-button>
+          <el-button type="text" @click="getDialog('查看', scope.row)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDialog('编辑', scope.row)"
+            v-hasPermi="['operation:sceneTime:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row, 2)"
+            v-hasPermi="['operation:sceneTime:delete']"
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
     <!-- 弹窗 -->
-    <el-dialog :visible.sync="dialogVisible" :title="title" width="500px" :before-close="cancel">
-      <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="110px" :disabled="disabled">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="cancel"
+    >
+      <el-form
+        :model="dialogForm"
+        ref="dialogForm"
+        :rules="rules"
+        label-width="110px"
+        :disabled="disabled"
+      >
         <el-form-item label="时间段:" prop="date">
-          <el-time-picker is-range v-model="dialogForm.date" start-placeholder="开始时间" end-placeholder="结束时间"
-            value-format="HH:mm:ss" format="HH:mm:ss" placeholder="选择时间范围" />
+          <el-time-picker
+            is-range
+            v-model="dialogForm.date"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+            value-format="HH:mm:ss"
+            format="HH:mm:ss"
+            placeholder="选择时间范围"
+          />
         </el-form-item>
         <el-form-item label="时间段文案:" prop="name">
           <el-input v-model="dialogForm.name" placeholder="请输入时间段文案" />
         </el-form-item>
         <el-form-item label="时间段Icon:" prop="pic">
-          <Upload listType="picture-card" :url="dialogForm.pic" @upload="upload" style="background: #000;"
-            :disabled="disabled" />
+          <Upload
+            listType="picture-card"
+            :url="dialogForm.pic"
+            @upload="upload"
+            style="background: #000"
+            :disabled="disabled"
+          />
         </el-form-item>
       </el-form>
       <div slot="footer">
         <el-button @click="cancel">取消</el-button>
-        <el-button v-if="!disabled" type="primary" @click="getSubmit">确定</el-button>
+        <el-button v-if="!disabled" type="primary" @click="getSubmit"
+          >确定</el-button
+        >
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { list, submit, change, detail } from '@/api/operation/sceneTime'
+import { change, detail, list, submit } from "@/api/operation/sceneTime";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -62,108 +104,128 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗title
-      title: '',
+      title: "",
       // 弹窗表单
       dialogForm: {},
       // 校验
       rules: {
-        date: [{
-          required: true, message: '请选择时间段', trigger: 'change'
-        }],
-        name: [{
-          required: true, message: '请输入时间段文案', trigger: 'blur'
-        }],
-        pic: [{
-          required: true, message: '请上传图片', trigger: 'change'
-        }]
+        date: [
+          {
+            required: true,
+            message: "请选择时间段",
+            trigger: "change",
+          },
+        ],
+        name: [
+          {
+            required: true,
+            message: "请输入时间段文案",
+            trigger: "blur",
+          },
+        ],
+        pic: [
+          {
+            required: true,
+            message: "请上传图片",
+            trigger: "change",
+          },
+        ],
       },
       // 只读
-      disabled: false
-    }
+      disabled: false,
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list().then(res => {
+      this.loading = true;
+      list().then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data
-          this.loading = false
+          this.tableData = res.data;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 弹窗
     getDialog(title, row) {
-      this.dialogVisible = true
-      this.title = title
-      this.disabled = title === '查看' ? true : false
+      this.dialogVisible = true;
+      this.title = title;
+      this.disabled = title === "查看" ? true : false;
       if (row) {
-        this.getDetail(row.id)
+        this.getDetail(row.id);
       }
     },
 
     // 详情
     getDetail(id) {
-      detail(id).then(res => {
+      detail(id).then((res) => {
         if (res.code === 0) {
-          this.dialogForm = res.data
-          this.$set(this.dialogForm, 'date', [res.data.startTime, res.data.endTime])
+          this.dialogForm = res.data;
+          this.$set(this.dialogForm, "date", [
+            res.data.startTime,
+            res.data.endTime,
+          ]);
         }
-      })
+      });
     },
 
     // 上传icon
     upload(e) {
-      this.dialogForm.pic = e.file
+      this.dialogForm.pic = e.file;
     },
 
     // 取消
     cancel() {
-      this.dialogVisible = false
+      this.dialogVisible = false;
       this.dialogForm = {
-        date: ['', ''],
-        name: '',
-        pic: ''
-      }
-      this.$refs.dialogForm.resetFields()
+        date: ["", ""],
+        name: "",
+        pic: "",
+      };
+      this.$refs.dialogForm.resetFields();
     },
 
     // 确定
     getSubmit() {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
-          this.dialogForm.startTime = this.dialogForm.date[0]
-          this.dialogForm.endTime = this.dialogForm.date[1]
-          delete this.dialogForm.date
-          submit(this.dialogForm).then(res => {
+          this.dialogForm.startTime = this.dialogForm.date[0];
+          this.dialogForm.endTime = this.dialogForm.date[1];
+          delete this.dialogForm.date;
+          submit(this.dialogForm).then((res) => {
             if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.getList()
-              this.cancel()
+              this.$message.success("提交成功!");
+              this.getList();
+              this.cancel();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     getDelete(row, status) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      })
-    }
-  }
-}
-</script>
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            change(row.id, status).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
+      });
+    },
+  },
+};
+</script>

+ 123 - 64
src/views/operation/startPage/index.vue

@@ -1,22 +1,45 @@
+<!-- 运营管理 启动页 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in currentOptions" :key="item.value" :label="item.label" :value="item.value" />
+          <el-option
+            v-for="item in currentOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="跳转页面:">
-        <el-select v-model="form.forwardType" placeholder="请选择跳转页面" clearable>
-          <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
+        <el-select
+          v-model="form.forwardType"
+          placeholder="请选择跳转页面"
+          clearable
+        >
+          <el-option
+            v-for="item in typeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </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" icon="el-icon-plus" plain @click="getDetail"
-          v-hasPermi="['operation:startPage:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail"
+          v-hasPermi="['operation:startPage:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
@@ -32,25 +55,52 @@
           <div>{{ scope.row.startTime }} 至 {{ scope.row.endTime }}</div>
         </template>
       </el-table-column>
-      <el-table-column label="跳转" prop="forwardType" align="center" :formatter="forwardFomatter" />
-      <el-table-column label="当前状态" prop="currentStatus" align="center" :formatter="currentFormatter" />
+      <el-table-column
+        label="跳转"
+        prop="forwardType"
+        align="center"
+        :formatter="forwardFomatter"
+      />
+      <el-table-column
+        label="当前状态"
+        prop="currentStatus"
+        align="center"
+        :formatter="currentFormatter"
+      />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDetail(scope.row, true)">查看</el-button>
-          <el-button type="text" @click="getDetail(scope.row)" v-hasPermi="['operation:startPage:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)"
-            v-hasPermi="['operation:startPage:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row)"
+            v-hasPermi="['operation:startPage:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:startPage: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"
+    />
   </div>
 </template>
 
 <script>
-import { page, remove } from '@/api/operation/startPage'
-import { currentMixin } from '@/mixin/index'
+import { page, remove } from "@/api/operation/startPage";
+import { currentMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [currentMixin],
   data() {
@@ -60,91 +110,100 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
       total: 0,
       // 跳转类型
-      typeOptions: [{
-        value: 0,
-        label: '指定页面'
-      }, {
-        value: 1,
-        label: '指定URL'
-      }]
-    }
+      typeOptions: [
+        {
+          value: 0,
+          label: "指定页面",
+        },
+        {
+          value: 1,
+          label: "指定URL",
+        },
+      ],
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.form.pageSize = 10
-      this.getList()
+      this.form.pageNum = 1;
+      this.form.pageSize = 10;
+      this.getList();
     },
 
     // 重置
     getRefresh() {
       this.form = {
         pageNum: 1,
-        pageSize: 10
-      }
-      this.getList()
+        pageSize: 10,
+      };
+      this.getList();
     },
 
     // 列表
     getList() {
-      this.loading = true
-      page(this.form).then(res => {
+      this.loading = true;
+      page(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(row, boolean) {
       this.$router.push({
-        path: '/operation/startPage/detail',
+        path: "/operation/startPage/detail",
         query: {
           id: row.id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}`, '提示', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        remove({
-          id: row.id
-        }).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => {
-        this.$message.info('取消删除!')
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}`, "提示:", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            remove({
+              id: row.id,
+            }).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {
+            that.$message.info("取消删除!");
+          });
+      });
     },
 
     // 字典翻译
     forwardFomatter(row) {
-      return this.selectDictLabel(this.typeOptions, row.forwardType)
+      return this.selectDictLabel(this.typeOptions, row.forwardType);
     },
     currentFormatter(row) {
-      return this.selectDictLabel(this.currentOptions, row.currentStatus)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.currentOptions, row.currentStatus);
+    },
+  },
+};
+</script>

+ 221 - 110
src/views/operation/tag/index.vue

@@ -8,58 +8,108 @@
       </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="getList">搜索</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="getList"
+          >搜索</el-button
+        >
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" plain icon="el-icon-plus" @click="getDialog('新增')"
-          v-hasPermi="['operation:tag:add']">新增</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          @click="getDialog('新增')"
+          v-hasPermi="['operation:tag:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
-    <el-table :data="tableData" row-key="id" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-      v-loading="loading">
+    <el-table
+      :data="tableData"
+      row-key="id"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+      v-loading="loading"
+    >
       <el-table-column label="标签名称" prop="label" show-overflow-tooltip />
-      <el-table-column label="标签Id" prop="id" align="center" show-overflow-tooltip>
+      <el-table-column
+        label="标签Id"
+        prop="id"
+        align="center"
+        show-overflow-tooltip
+      >
         <template slot-scope="scope">
-          <span>{{ scope.row.level === 3 ? scope.row.id : '-' }}</span>
+          <span>{{ scope.row.level === 3 ? scope.row.id : "-" }}</span>
         </template>
       </el-table-column>
       <el-table-column label="标签排序" prop="sort" align="center" />
       <el-table-column label="当前状态" prop="status" align="center">
         <template slot-scope="scope">
           <el-tag :type="scope.row.status === 1 ? 'danger' : ''">
-            {{ selectDictLabel(disabledOptions, scope.row.status) }}</el-tag>
+            {{ selectDictLabel(disabledOptions, scope.row.status) }}</el-tag
+          >
         </template>
       </el-table-column>
       <el-table-column label="菜单路径" align="center">
-        <template slot-scope="scope">{{ scope.row.meanWay ? scope.row.meanWay : '-' }}</template>
+        <template slot-scope="scope">{{
+          scope.row.meanWay ? scope.row.meanWay : "-"
+        }}</template>
       </el-table-column>
       <el-table-column label="创建时间" align="center">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{
+            parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog('查看', scope.row, true)">查看</el-button>
-          <el-button v-if="scope.row.level !== 3" type="text" @click="getDialog('新增', scope.row)"
-            v-hasPermi="['operation:tag:add']">
+          <el-button type="text" @click="getDialog('查看', scope.row, true)"
+            >查看</el-button
+          >
+          <el-button
+            v-if="scope.row.level !== 3"
+            type="text"
+            @click="getDialog('新增', scope.row)"
+            v-hasPermi="['operation:tag:add']"
+          >
             新增
           </el-button>
-          <el-button type="text" v-if="scope.row.status === 0" @click="getChange(scope.row, 1)"
-            v-hasPermi="['operation:tag:down']">下架</el-button>
+          <el-button
+            type="text"
+            v-if="scope.row.status === 0"
+            @click="getChange(scope.row, 1)"
+            v-hasPermi="['operation:tag:down']"
+            >下架</el-button
+          >
           <span v-else>
-            <el-button type="text" @click="getDialog('编辑', scope.row)" style="margin-left: 10px"
-              v-hasPermi="['operation:tag:edit']">
+            <el-button
+              type="text"
+              @click="getDialog('编辑', scope.row)"
+              style="margin-left: 10px"
+              v-hasPermi="['operation:tag:edit']"
+            >
               编辑
             </el-button>
-            <el-button type="text" @click="getChange(scope.row, 0)" v-hasPermi="['operation:tag:up']">
+            <el-button
+              type="text"
+              @click="getChange(scope.row, 0)"
+              v-hasPermi="['operation:tag:up']"
+            >
               上架
             </el-button>
-            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['operation:tag:delete']">
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['operation:tag:delete']"
+            >
               删除
             </el-button>
           </span>
@@ -67,19 +117,49 @@
       </el-table-column>
     </el-table>
     <!-- 弹窗 -->
-    <el-dialog :visible.sync="dialogVisible" :title="title" width="500px" :before-close="cancel">
-      <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="auto"
-        :disabled="title === '查看' ? true : false">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="cancel"
+    >
+      <el-form
+        :model="dialogForm"
+        ref="dialogForm"
+        :rules="rules"
+        label-width="auto"
+        :disabled="title === '查看' ? true : false"
+      >
         <el-form-item label="标签名称:" prop="name">
-          <el-input v-model="dialogForm.name" placeholder="请输入标签名称" maxlength="100" show-word-limit
-            :disabled="dialogForm.isEmpty === 0" />
+          <el-input
+            v-model="dialogForm.name"
+            placeholder="请输入标签名称"
+            maxlength="100"
+            show-word-limit
+            :disabled="dialogForm.isEmpty === 0"
+          />
         </el-form-item>
-        <el-form-item label="标签状态:" prop="isEmpty" v-if="createLevelTwo() || editLevelTwo()">
-          <el-checkbox v-model="dialogForm.isEmpty" :true-label="0" :false-label="1" @change="handleChange">
-            允许为空</el-checkbox>
+        <el-form-item
+          label="标签状态:"
+          prop="isEmpty"
+          v-if="createLevelTwo() || editLevelTwo()"
+        >
+          <el-checkbox
+            v-model="dialogForm.isEmpty"
+            :true-label="0"
+            :false-label="1"
+            @change="handleChange"
+          >
+            允许为空</el-checkbox
+          >
         </el-form-item>
         <el-form-item label="标签排序:" prop="sort">
-          <el-input-number v-model="dialogForm.sort" :min="1" :step="1" step-strictly />
+          <el-input-number
+            v-model="dialogForm.sort"
+            :min="1"
+            :step="1"
+            step-strictly
+          />
         </el-form-item>
       </el-form>
       <div slot="footer" v-if="title !== '查看'">
@@ -91,8 +171,16 @@
 </template>
 
 <script>
-import { change, detail, list, remove, submitFirst, submitSecond } from '@/api/operation/tag';
-import { disabledMixin } from '@/mixin/index';
+import {
+change,
+detail,
+list,
+remove,
+submitFirst,
+submitSecond,
+} from "@/api/operation/tag";
+import { disabledMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [disabledMixin],
   data() {
@@ -106,77 +194,92 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗标题
-      title: '新增',
+      title: "新增",
       // 当前层级
       level: 0,
       // 弹窗表单
       dialogForm: {},
       // 校验
       rules: {
-        sort: [{
-          required: true, message: '请选择标签排序', trigger: 'change'
-        }]
-      }
-    }
+        sort: [
+          {
+            required: true,
+            message: "请选择标签排序",
+            trigger: "change",
+          },
+        ],
+      },
+    };
   },
   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
-          this.loading = false
+          this.tableData = res.data;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 重置
     getRefresh() {
-      this.form = {}
-      this.getList()
+      this.form = {};
+      this.getList();
     },
 
     // 弹窗
     getDialog(title, row, boolean) {
-      this.title = title
-      this.level = row ? row.level : 0
-      if (this.detailLevelThree() || this.createLevelThree() || this.editLevelThree()) {
+      this.title = title;
+      this.level = row ? row.level : 0;
+      if (
+        this.detailLevelThree() ||
+        this.createLevelThree() ||
+        this.editLevelThree()
+      ) {
         this.$router.push({
-          path: '/operation/tag/detail',
-          query: this.createLevelThree() ? {
-            pid: row.id
-          } : {
-            id: row.id,
-            disabled: boolean
-          }
-        })
+          path: "/operation/tag/detail",
+          query: this.createLevelThree()
+            ? {
+                pid: row.id,
+              }
+            : {
+                id: row.id,
+                disabled: boolean,
+              },
+        });
       } else {
-        this.dialogVisible = true
+        this.dialogVisible = true;
       }
 
       // 查看 / 编辑获取详情
-      if (this.detailLevelOne() || this.detailLeveLTwo() || this.editLevelOne() || this.editLevelTwo()) {
-        detail(row.id).then(res => {
+      if (
+        this.detailLevelOne() ||
+        this.detailLeveLTwo() ||
+        this.editLevelOne() ||
+        this.editLevelTwo()
+      ) {
+        detail(row.id).then((res) => {
           if (res.code === 0) {
-            this.dialogForm = res.data
+            this.dialogForm = res.data;
           }
-        })
+        });
       }
 
       // 新增二级标签需传一级标签Id
       if (this.createLevelTwo()) {
-        this.dialogForm.pid = row.id
+        this.dialogForm.pid = row.id;
       }
     },
 
     // 当二级标签选择为空 清空标签名称
     handleChange(e) {
       if (e === 0) {
-        this.dialogForm.name = ''
+        this.dialogForm.name = "";
       }
     },
 
@@ -185,107 +288,115 @@ export default {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
           if (this.createLevelOne() || this.editLevelOne()) {
-            submitFirst(this.dialogForm).then(res => {
+            submitFirst(this.dialogForm).then((res) => {
               if (res.code === 0) {
-                this.$message.success(`${this.title}成功!`)
-                this.dialogVisible = false
-                this.getList()
+                this.$message.success(`${this.title}成功!`);
+                this.dialogVisible = false;
+                this.getList();
               }
-            })
+            });
           } else if (this.createLevelTwo() || this.editLevelTwo()) {
-            submitSecond(this.dialogForm).then(res => {
+            submitSecond(this.dialogForm).then((res) => {
               if (res.code === 0) {
-                this.$message.success(`${this.title}成功!`)
-                this.dialogVisible = false
-                this.getList()
+                this.$message.success(`${this.title}成功!`);
+                this.dialogVisible = false;
+                this.getList();
               }
-            })
+            });
           }
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 上下架
     getChange(row, status) {
-      let title = status === 0 ? '上架' : '下架'
-      this.$confirm(`是否${title}${row.label}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        change(row.id, status).then(res => {
-          if (res.code === 0) {
-            this.$message.success(`${title}成功!`)
-            this.getList()
-          }
+      let title = status === 0 ? "上架" : "下架";
+      this.$confirm(`是否${title}${row.label}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          change(row.id, status).then((res) => {
+            if (res.code === 0) {
+              this.$message.success(`${title}成功!`);
+              this.getList();
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.label}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.label}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 取消
     cancel() {
-      this.dialogVisible = false
-      this.$refs.dialogForm.resetFields()
+      this.dialogVisible = false;
+      this.$refs.dialogForm.resetFields();
     },
 
     // 新增一级标签
     createLevelOne() {
-      return this.title === '新增' && this.level === 0 ? true : false
+      return this.title === "新增" && this.level === 0 ? true : false;
     },
 
     // 编辑一级标签
     editLevelOne() {
-      return this.title === '编辑' && this.level === 1 ? true : false
+      return this.title === "编辑" && this.level === 1 ? true : false;
     },
 
     // 查看一级标签
     detailLevelOne() {
-      return this.title === '查看' && this.level === 1 ? true : false
+      return this.title === "查看" && this.level === 1 ? true : false;
     },
 
     // 新增二级标签
     createLevelTwo() {
-      return this.title === '新增' && this.level === 1 ? true : false
+      return this.title === "新增" && this.level === 1 ? true : false;
     },
 
     // 编辑二级标签
     editLevelTwo() {
-      return this.title === '编辑' && this.level === 2 ? true : false
+      return this.title === "编辑" && this.level === 2 ? true : false;
     },
 
     // 查看二级标签
     detailLeveLTwo() {
-      return this.title === '查看' && this.level === 2 ? true : false
+      return this.title === "查看" && this.level === 2 ? true : false;
     },
 
     // 新增三级标签
     createLevelThree() {
-      return this.title === '新增' && this.level === 2 ? true : false
+      return this.title === "新增" && this.level === 2 ? true : false;
     },
 
     // 编辑三级标签
     editLevelThree() {
-      return this.title === '编辑' && this.level === 3 ? true : false
+      return this.title === "编辑" && this.level === 3 ? true : false;
     },
 
     // 查看三级标签
     detailLevelThree() {
-      return this.title === '查看' && this.level === 3 ? true : false
-    }
-  }
-}
-</script>
+      return this.title === "查看" && this.level === 3 ? true : false;
+    },
+  },
+};
+</script>

+ 305 - 142
src/views/operation/waken/detail.vue

@@ -1,55 +1,120 @@
 <template>
   <div class="app-container">
-    <el-form :model="form" ref="form" :rules="rules" label-width="110px" :disabled="disabled">
+    <el-form
+      :model="form"
+      ref="form"
+      :rules="rules"
+      label-width="110px"
+      :disabled="disabled"
+    >
       <el-form-item label="唤醒音名称:" prop="name">
         <el-input v-model="form.name" placeholder="请输入唤醒音名称" />
       </el-form-item>
       <el-form-item label="频道属性:" prop="attributeType">
         <el-select v-model="form.attributeType" placeholder="请选择频道属性">
-          <el-option v-for="item in channelOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in channelOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="关联设备:" prop="deviceIds">
-        <el-select v-model="form.deviceIds" filterable multiple placeholder="请选择关联设备">
-          <el-option v-for="item in deviceOptions" :key="item.clientTypeId" :value="item.clientTypeId.toString()"
-            :label="item.name" />
+        <el-select
+          v-model="form.deviceIds"
+          filterable
+          multiple
+          placeholder="请选择关联设备"
+        >
+          <el-option
+            v-for="item in deviceOptions"
+            :key="item.clientTypeId"
+            :value="item.clientTypeId.toString()"
+            :label="item.name"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="唤醒音封面:" prop="pic">
-        <Upload listType="picture-card" :url="form.pic" @upload="upload" :disabled="disabled" />
+        <Upload
+          listType="picture-card"
+          :url="form.pic"
+          @upload="upload"
+          :disabled="disabled"
+        />
       </el-form-item>
       <el-form-item label="唤醒音内容:" style="width: 1000px">
-        <el-button type="primary" icon="el-icon-plus" :disabled="!form.attributeType" @click="getDialog">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          :disabled="!form.attributeType"
+          @click="getDialog"
+        >
           关联内容
         </el-button>
         <el-table :data="form.audioDefaultResp">
-          <el-table-column label="音频ID" align="center" prop="audioId" show-overflow-tooltip />
-          <el-table-column label="音频名称" align="center" prop="audioName" show-overflow-tooltip />
+          <el-table-column
+            label="音频ID"
+            align="center"
+            prop="audioId"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            label="音频名称"
+            align="center"
+            prop="audioName"
+            show-overflow-tooltip
+          />
           <el-table-column label="音频封面" align="center" width="100px">
             <template slot-scope="scope">
               <el-image :src="scope.row.audioPic" />
             </template>
           </el-table-column>
-          <el-table-column label="音频作者" align="center" show-overflow-tooltip>
+          <el-table-column
+            label="音频作者"
+            align="center"
+            show-overflow-tooltip
+          >
             <template slot-scope="scope">
               <span>
-                {{ scope.row.singerName ? scope.row.singerName : '-' }}
+                {{ scope.row.singerName ? scope.row.singerName : "-" }}
               </span>
             </template>
           </el-table-column>
-          <el-table-column label="专辑名称" prop="songName" align="center" show-overflow-tooltip>
+          <el-table-column
+            label="专辑名称"
+            prop="songName"
+            align="center"
+            show-overflow-tooltip
+          >
             <template slot-scope="scope">
               <span>
-                {{ scope.row.songName ? scope.row.songName : '-' }}
+                {{ scope.row.songName ? scope.row.songName : "-" }}
               </span>
             </template>
           </el-table-column>
-          <el-table-column label="付费类型" align="center" prop="isFree" :formatter="freeFormatter" />
-          <el-table-column label="资源平台" align="center" prop="platformId" :formatter="platfromFormatter" />
-          <el-table-column label="当前状态" align="center" :formatter="statusFormatter" />
+          <el-table-column
+            label="付费类型"
+            align="center"
+            prop="isFree"
+            :formatter="freeFormatter"
+          />
+          <el-table-column
+            label="资源平台"
+            align="center"
+            prop="platformId"
+            :formatter="platfromFormatter"
+          />
+          <el-table-column
+            label="当前状态"
+            align="center"
+            :formatter="statusFormatter"
+          />
           <el-table-column label="操作" align="center">
             <template slot-scope="scope">
-              <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
+              <el-button type="delete" @click="getDelete(scope.row)"
+                >删除</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -57,35 +122,76 @@
     </el-form>
     <div style="margin-left: 110px">
       <el-button @click="cancel">取消</el-button>
-      <el-button v-if="!disabled" type="primary" @click="getSubmit">确定</el-button>
+      <el-button v-if="!disabled" type="primary" @click="getSubmit"
+        >确定</el-button
+      >
     </div>
 
     <!-- 弹窗 -->
     <el-dialog :visible.sync="dialogVisible" title="关联内容" width="1100px">
-      <el-form inline size="mini" style="width:100%">
+      <el-form inline size="mini" style="width: 100%">
         <el-form-item label="音频类型:">
-          <el-select v-if="form.attributeType" v-model="dialogForm.audioType" placeholder="请选择音频类型">
-            <el-option v-for="item in channelOptions.find(i => i.value === form.attributeType).children" :key="item.value"
-              :value="item.value" :label="item.label" />
+          <el-select
+            v-if="form.attributeType"
+            v-model="dialogForm.audioType"
+            placeholder="请选择音频类型"
+          >
+            <el-option
+              v-for="item in channelOptions.find(
+                (i) => i.value === form.attributeType
+              ).children"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="资源平台:">
-          <el-select v-model="dialogForm.platformId" placeholder="请选择资源平台">
-            <el-option v-for="item in platformOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-select
+            v-model="dialogForm.platformId"
+            placeholder="请选择资源平台"
+          >
+            <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-input v-model="dialogForm.keyword" placeholder="请输入内容名称" />
         </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-refrash" @click="getRefrash">重置</el-button>
         </el-form-item>
       </el-form>
-      <el-table :data="tableData" ref="table" :row-key="getRowKey" @selection-change="getChange">
-        <el-table-column type="selection" align="center" :reserve-selection="true" />
-        <el-table-column label="音频ID" align="center" prop="audioId" show-overflow-tooltip />
-        <el-table-column label="音频名称" align="center" prop="audioName" show-overflow-tooltip />
+      <el-table
+        :data="tableData"
+        ref="table"
+        :row-key="getRowKey"
+        @selection-change="getChange"
+      >
+        <el-table-column
+          type="selection"
+          align="center"
+          :reserve-selection="true"
+        />
+        <el-table-column
+          label="音频ID"
+          align="center"
+          prop="audioId"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="音频名称"
+          align="center"
+          prop="audioName"
+          show-overflow-tooltip
+        />
         <el-table-column label="音频封面" align="center" width="100px">
           <template slot-scope="scope">
             <el-image :src="scope.row.audioPic" />
@@ -94,32 +200,52 @@
         <el-table-column label="音频作者" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             <span>
-              {{ scope.row.singerName ? scope.row.singerName : '-' }}
+              {{ scope.row.singerName ? scope.row.singerName : "-" }}
             </span>
           </template>
         </el-table-column>
-        <el-table-column label="专辑名称" prop="songName" align="center" show-overflow-tooltip>
+        <el-table-column
+          label="专辑名称"
+          prop="songName"
+          align="center"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
             <span>
-              {{ scope.row.songName ? scope.row.songName : '-' }}
+              {{ scope.row.songName ? scope.row.songName : "-" }}
             </span>
           </template>
         </el-table-column>
-        <el-table-column label="付费类型" align="center" prop="isFree" :formatter="freeFormatter" />
-        <el-table-column label="资源平台" align="center" prop="platformId" :formatter="platfromFormatter" />
+        <el-table-column
+          label="付费类型"
+          align="center"
+          prop="isFree"
+          :formatter="freeFormatter"
+        />
+        <el-table-column
+          label="资源平台"
+          align="center"
+          prop="platformId"
+          :formatter="platfromFormatter"
+        />
       </el-table>
       <div slot="footer">
-        <pagination v-show="total > 0" :total="total" :page.sync="dialogForm.pageNum" :limit.sync="dialogForm.pageSize"
-          @pagination="getList" />
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="dialogForm.pageNum"
+          :limit.sync="dialogForm.pageSize"
+          @pagination="getList"
+        />
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { list } from '@/api/operation/channel'
-import { detail, devices, submit } from '@/api/operation/waken'
-import { platformMixin, isFreeMixin, disabledMixin } from '@/mixin/index'
+import { list } from "@/api/operation/channel";
+import { detail, devices, submit } from "@/api/operation/waken";
+import { disabledMixin, isFreeMixin, platformMixin } from "@/mixin/index";
 export default {
   mixins: [platformMixin, isFreeMixin, disabledMixin],
   data() {
@@ -127,30 +253,38 @@ export default {
       // 表单
       form: {
         deviceIds: [],
-        pic: '',
-        audioDefaultResp: []
+        pic: "",
+        audioDefaultResp: [],
       },
       // 列表
       tableData: [],
       // 频道属性
-      channelOptions: [{
-        value: 1,
-        label: '广播',
-        children: [{
-          value: 2,
-          label: '广播电台'
-        }]
-      }, {
-        value: 3,
-        label: '节目',
-        children: [{
-          value: 6,
-          label: '节目'
-        }, {
-          value: 11,
-          label: '歌曲'
-        }]
-      }],
+      channelOptions: [
+        {
+          value: 1,
+          label: "广播",
+          children: [
+            {
+              value: 2,
+              label: "广播电台",
+            },
+          ],
+        },
+        {
+          value: 3,
+          label: "节目",
+          children: [
+            {
+              value: 6,
+              label: "节目",
+            },
+            {
+              value: 11,
+              label: "歌曲",
+            },
+          ],
+        },
+      ],
       // 关联设备
       deviceOptions: [],
       // 弹窗
@@ -161,7 +295,7 @@ export default {
         pageSize: 10,
         platformId: null,
         audioType: null,
-        status: 1
+        status: 1,
       },
       // 总数
       total: 0,
@@ -169,114 +303,137 @@ export default {
       tableData: [],
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入唤醒音名称', trigger: 'blur'
-        }],
-        attributeType: [{
-          required: true, message: '请选择频道属性', trigger: 'change'
-        }],
-        deviceIds: [{
-          required: true, message: '请选择关联设备', trigger: 'change'
-        }],
-        pic: [{
-          required: true, message: '请上传封面', trigger: 'change'
-        }]
+        name: [
+          {
+            required: true,
+            message: "请输入唤醒音名称",
+            trigger: "blur",
+          },
+        ],
+        attributeType: [
+          {
+            required: true,
+            message: "请选择频道属性",
+            trigger: "change",
+          },
+        ],
+        deviceIds: [
+          {
+            required: true,
+            message: "请选择关联设备",
+            trigger: "change",
+          },
+        ],
+        pic: [
+          {
+            required: true,
+            message: "请上传封面",
+            trigger: "change",
+          },
+        ],
       },
       // 只读
-      disabled: Boolean(this.$route.query.boolean)
-    }
+      disabled: Boolean(this.$route.query.boolean),
+    };
   },
   watch: {
-    'form.attributeType'(val) {
+    "form.attributeType"(val) {
       if (val) {
-        this.dialogForm.audioType = this.channelOptions.find(i => i.value === val).children[0].value
+        this.dialogForm.audioType = this.channelOptions.find(
+          (i) => i.value === val
+        ).children[0].value;
         this.getPlatform({
           audioType: this.dialogForm.audioType,
-          joinType: 3
-        })
+          joinType: 3,
+        });
       }
     },
-    async 'dialogForm.audioType'(val) {
+    async "dialogForm.audioType"(val) {
       if (this.dialogVisible) {
         await this.getPlatform({
           audioType: val,
-          joinType: 3
-        })
-        this.getRefrash()
+          joinType: 3,
+        });
+        this.getRefrash();
       }
-    }
+    },
   },
   mounted() {
-    this.getDevices()
-    this.getPlatform({})
+    this.getDevices();
+    this.getPlatform({});
     if (this.$route.query.id) {
-      this.form.id = this.$route.query.id
+      this.form.id = this.$route.query.id;
     }
   },
   methods: {
     // 关联设备
     getDevices() {
-      devices(2).then(res => {
+      devices(2).then((res) => {
         if (res.code === 0) {
-          this.deviceOptions = res.data
+          this.deviceOptions = res.data;
           if (this.form.id) {
-            this.getDetail()
+            this.getDetail();
           }
         }
-      })
+      });
     },
 
     // 详情
     getDetail() {
-      detail(this.form.id).then(res => {
+      detail(this.form.id).then((res) => {
         if (res.code === 0) {
-          this.form = res.data
-          this.form.deviceIds = res.data.deviceIds.split(',')
-          this.deviceOptions.unshift.apply(this.deviceOptions, res.data.deviceList)
+          this.form = res.data;
+          this.form.deviceIds = res.data.deviceIds.split(",");
+          this.deviceOptions.unshift.apply(
+            this.deviceOptions,
+            res.data.deviceList
+          );
         }
-      })
+      });
     },
 
     // 上传
     upload(e) {
-      this.form.pic = e.file
+      this.form.pic = e.file;
     },
 
     // 删除
     getDelete(row) {
-      this.form.audioDefaultResp = this.form.audioDefaultResp.filter(i => i.audioId !== row.audioId)
+      this.form.audioDefaultResp = this.form.audioDefaultResp.filter(
+        (i) => i.audioId !== row.audioId
+      );
     },
 
     // 弹窗
     getDialog() {
-      this.dialogForm.platformId = this.platformOptions[0].value
-      this.dialogVisible = true
-      this.getList()
+      this.dialogForm.platformId = this.platformOptions[0].value;
+      this.dialogVisible = true;
+      this.getList();
     },
 
     // 音频列表
     getList() {
-      list(this.dialogForm).then(res => {
+      list(this.dialogForm).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.$refs.table.clearSelection()
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.$refs.table.clearSelection();
           if (this.form.audioDefaultResp.length > 0) {
-            this.form.audioDefaultResp.map(i => {
-              let row = this.tableData.find(j => j.audioId === i.audioId)
+            this.form.audioDefaultResp.map((i) => {
+              let row = this.tableData.find((j) => j.audioId === i.audioId);
               if (row) {
-                this.$refs.table.toggleRowSelection(row, true)
+                this.$refs.table.toggleRowSelection(row, true);
               }
-            })
+            });
           }
         }
-      })
+      });
     },
 
     // 搜索
     getSearch() {
-      this.dialogForm.pageNum = 1
-      this.getList()
+      this.dialogForm.pageNum = 1;
+      this.getList();
     },
 
     // 重置
@@ -286,70 +443,76 @@ export default {
         pageSize: 10,
         platformId: this.platformOptions[0].value,
         audioType: this.dialogForm.audioType,
-        status: 1
-      }
-      this.getList()
+        status: 1,
+      };
+      this.getList();
     },
 
     getRowKey(row) {
-      return row.audioId
+      return row.audioId;
     },
 
     // 表格多选
     getChange(row) {
-      this.form.audioList = []
+      this.form.audioList = [];
       if (row.length > 0) {
-        row.map(i => {
-          if (this.form.audioDefaultResp.findIndex(j => j.audioId === i.audioId) === -1) {
-            this.form.audioDefaultResp.push(i)
+        row.map((i) => {
+          if (
+            this.form.audioDefaultResp.findIndex(
+              (j) => j.audioId === i.audioId
+            ) === -1
+          ) {
+            this.form.audioDefaultResp.push(i);
           }
-        })
+        });
       }
     },
 
     // 取消
     cancel() {
-      this.$tab.closeOpenPage('/operation/waken')
+      this.$tab.closeOpenPage("/operation/waken");
     },
 
     // 提交
     getSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          this.form.deviceIds = this.form.deviceIds.join(',')
-          this.form.audioList = []
-          this.form.audioDefaultResp.map(i => {
+          this.form.deviceIds = this.form.deviceIds.join(",");
+          this.form.audioList = [];
+          this.form.audioDefaultResp.map((i) => {
             this.form.audioList.push({
               audioId: i.audioId,
-              audioType: i.audioType
+              audioType: i.audioType,
+            });
+          });
+          submit(this.form)
+            .then((res) => {
+              if (res.code === 0) {
+                this.$message.success("提交成功!");
+                this.form.id ? this.getDevices() : this.cancel();
+              }
             })
-          })
-          submit(this.form).then(res => {
-            if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.form.id ? this.getDevices() : this.cancel()
-            }
-          }).catch(err => {
-            this.form.deviceIds = this.form.deviceIds.split(',')
-          })
+            .catch((err) => {
+              this.form.deviceIds = this.form.deviceIds.split(",");
+            });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 字典翻译
     platfromFormatter(row) {
-      return this.selectDictLabel(this.platformTypeOptions, row.platformId)
+      return this.selectDictLabel(this.platformTypeOptions, row.platformId);
     },
     freeFormatter(row) {
-      return this.selectDictLabel(this.freeOptions, row.isFree)
+      return this.selectDictLabel(this.freeOptions, row.isFree);
     },
     statusFormatter(row) {
-      return this.selectDictLabel(this.disabledOptions, row.status)
-    }
-  }
-}
+      return this.selectDictLabel(this.disabledOptions, row.status);
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 79 - 39
src/views/operation/waken/index.vue

@@ -1,25 +1,52 @@
+<!-- 运营管理 唤醒音 -->
 <template>
   <div class="app-container">
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDetail()"
-      v-hasPermi="['operation:waken:add']">新增换醒音</el-button>
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDetail()"
+      v-hasPermi="['operation:waken:add']"
+      >新增换醒音</el-button
+    >
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
-      <el-table-column label="唤醒音名称" align="center" prop="name" show-overflow-tooltip />
+      <el-table-column
+        label="唤醒音名称"
+        align="center"
+        prop="name"
+        show-overflow-tooltip
+      />
       <el-table-column label="唤醒音封面" align="center" width="100px">
         <template slot-scope="scope">
           <el-image :src="scope.row.pic" />
         </template>
       </el-table-column>
-      <el-table-column label="关联设备" align="center" :formatter="devFormatter" show-overflow-tooltip />
+      <el-table-column
+        label="关联设备"
+        align="center"
+        :formatter="devFormatter"
+        show-overflow-tooltip
+      />
       <el-table-column label="关联内容数" align="center" prop="num" />
       <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="['operation:waken:edit']">
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['operation:waken:edit']"
+          >
             编辑
           </el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['operation:waken:delete']">
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:waken:delete']"
+          >
             删除
           </el-button>
         </template>
@@ -29,7 +56,8 @@
 </template>
 
 <script>
-import { list, devices, remove } from '@/api/operation/waken'
+import { devices, list, remove } from "@/api/operation/waken";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -38,34 +66,34 @@ export default {
       // 列表
       tableData: [],
       // 设备列表
-      deviceOptions: []
-    }
+      deviceOptions: [],
+    };
   },
   mounted() {
-    this.getList()
-    this.getDevices()
+    this.getList();
+    this.getDevices();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list().then(res => {
+      this.loading = true;
+      list().then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data
-          this.loading = false
+          this.tableData = res.data;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 设备列表
     getDevices() {
       this.$nextTick(() => {
-        devices(1).then(res => {
+        devices(1).then((res) => {
           if (res.code === 0) {
-            this.deviceOptions = res.data
+            this.deviceOptions = res.data;
           }
-        })
-      })
+        });
+      });
     },
 
     // 详情
@@ -74,31 +102,43 @@ export default {
         path: `/operation/waken/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, `提示`, {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, `提示:`, {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
+      });
     },
 
     // 字典翻译
     devFormatter(row) {
-      return this.deviceOptions.length > 0 ? row.deviceIds.split(',').map(i => this.deviceOptions.find(j => j.clientTypeId == i).name).join(',') : ''
-    }
-  }
-}
+      return this.deviceOptions.length > 0
+        ? row.deviceIds
+            .split(",")
+            .map(
+              (i) => this.deviceOptions.find((j) => j.clientTypeId == i).name
+            )
+            .join(",")
+        : "";
+    },
+  },
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>

+ 145 - 64
src/views/push/dialog/index.vue

@@ -1,5 +1,6 @@
+ <!-- 推送弹窗 -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="弹窗名称:">
@@ -7,61 +8,131 @@
       </el-form-item>
       <el-form-item label="弹窗类型:">
         <el-select v-model="form.type" placeholder="请选择弹窗类型" clearable>
-          <el-option v-for="item in dialogTypeOptions" :key="item.value" :value="item.value" :label="item.label" />
+          <el-option
+            v-for="item in dialogTypeOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
-        <el-select v-model="form.effectiveState" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in currentOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.effectiveState"
+          placeholder="请选择当前状态"
+          clearable
+        >
+          <el-option
+            v-for="item in currentOptions"
+            :key="item.value"
+            :value="item.value"
+            :label="item.label"
+          />
         </el-select>
       </el-form-item>
       <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-date-picker>
       </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="['push:dialog:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['push:dialog: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 label="弹窗ID" prop="id" align="center" show-overflow-tooltip />
-      <el-table-column label="弹窗名称" prop="name" align="center" show-overflow-tooltip />
+      <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="弹窗图片" align="center" width="100px">
         <template slot-scope="scope">
           <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="type"
+        align="center"
+        :formatter="typeFormatter"
+      />
       <el-table-column label="优先级" prop="level" align="center" />
-      <el-table-column label="创建时间" prop="createTime" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="创建时间"
+        prop="createTime"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="生效时间" align="center" width="310px">
         <template slot-scope="scope">
           <span>{{ scope.row.startTime }} 至 {{ scope.row.endTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="当前状态" prop="effectiveState" align="center" :formatter="effectiveFormatter" />
+      <el-table-column
+        label="当前状态"
+        prop="effectiveState"
+        align="center"
+        :formatter="effectiveFormatter"
+      />
       <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="['push:dialog:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['push:dialog:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['push:dialog:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['push:dialog: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"
+    />
   </div>
 </template>
 
 <script>
-import { list, remove } from '@/api/push/dialog'
-import { currentMixin } from '@/mixin/index'
+import { list, remove } from "@/api/push/dialog";
+import { currentMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [currentMixin],
   data() {
@@ -71,54 +142,58 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
       // 总数据
       total: 0,
       // 弹窗类型
-      dialogTypeOptions: [{
-        value: 0,
-        label: '当天弹窗'
-      }, {
-        value: 1,
-        label: '启动弹窗'
-      }, {
-        value: 2,
-        label: '新用户弹窗'
-      }]
-    }
+      dialogTypeOptions: [
+        {
+          value: 0,
+          label: "当天弹窗",
+        },
+        {
+          value: 1,
+          label: "启动弹窗",
+        },
+        {
+          value: 2,
+          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;
         }
-      })
+      });
     },
 
     // 搜索
     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();
     },
 
     // 详情
@@ -127,33 +202,39 @@ export default {
         path: `/push/pushDialog/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id, 2).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(row.id, 2).then((res) => {
+              if (res.code === 0) {
+                that.$message.success(`删除成功!`);
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     effectiveFormatter(row) {
-      return this.selectDictLabel(this.currentOptions, row.effectiveState)
+      return this.selectDictLabel(this.currentOptions, row.effectiveState);
     },
 
     typeFormatter(row) {
-      return this.selectDictLabel(this.dialogTypeOptions, row.type)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.dialogTypeOptions, row.type);
+    },
+  },
+};
+</script>

+ 128 - 57
src/views/push/update/index.vue

@@ -1,46 +1,108 @@
+
+<!-- App升级 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
     <el-form size="mini" inline>
       <el-form-item label="版本号:">
-        <el-input v-model="form.lastVersion" placeholder="请输入版本号" clearable />
+        <el-input
+          v-model="form.lastVersion"
+          placeholder="请输入版本号"
+          clearable
+        />
       </el-form-item>
       <el-form-item label="升级系统:">
-        <el-select v-model="form.appType" placeholder="请选择升级系统" clearable>
-          <el-option v-for="item in systemOptions" :key="item.value" :value="item.value" :label="item.label" />
+        <el-select
+          v-model="form.appType"
+          placeholder="请选择升级系统"
+          clearable
+        >
+          <el-option
+            v-for="item in systemOptions"
+            :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" icon="el-icon-plus" plain @click="getDetail()" v-hasPermi="['push:update:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['push:update:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
-      <el-table-column label="升级标题" prop="updateTitle" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="升级标题"
+        prop="updateTitle"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="版本号" prop="lastVersion" align="center" />
-      <el-table-column label="下载路径" prop="downUrl" align="center" show-overflow-tooltip />
-      <el-table-column label="是否强制升级" prop="isForceUpdate" align="center" :formatter="typeFormatter" />
-      <el-table-column label="升级系统" prop="appType" align="center" :formatter="appTypeFormatter" />
+      <el-table-column
+        label="下载路径"
+        prop="downUrl"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="是否强制升级"
+        prop="isForceUpdate"
+        align="center"
+        :formatter="typeFormatter"
+      />
+      <el-table-column
+        label="升级系统"
+        prop="appType"
+        align="center"
+        :formatter="appTypeFormatter"
+      />
       <el-table-column label="更新时间" prop="updateTime" 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)" v-hasPermi="['push:update:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['push:update:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['push:update:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['push:update: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"
+    />
   </div>
 </template>
 
 <script>
-import { list, remove } from '@/api/push/update'
-import { systemMixin } from '@/mixin'
+import { list, remove } from "@/api/push/update";
+import { systemMixin } from "@/mixin";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [systemMixin],
   data() {
@@ -50,87 +112,96 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
       // 总数据
       total: 0,
       // 是否强制
-      typeOptions: [{
-        value: 0,
-        label: '否'
-      }, {
-        value: 1,
-        label: '是'
-      }]
-    }
+      typeOptions: [
+        {
+          value: 0,
+          label: "否",
+        },
+        {
+          value: 1,
+          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;
         }
-      })
+      });
     },
     // 搜索
     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();
     },
 
     // 新增 编辑
     getDetail(id, boolean) {
       this.$router.push({
-        path: '/push/update/detail',
+        path: "/push/update/detail",
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.updateTitle}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id, 1).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.updateTitle}?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id, 1).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     typeFormatter(row) {
-      return this.selectDictLabel(this.typeOptions, row.isForceUpdate)
+      return this.selectDictLabel(this.typeOptions, row.isForceUpdate);
     },
 
     appTypeFormatter(row) {
-      return this.selectDictLabel(this.systemOptions, row.appType)
-    }
-  }
-}
+      return this.selectDictLabel(this.systemOptions, row.appType);
+    },
+  },
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>

+ 193 - 95
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)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.currentOptions, row.currentStatus);
+    },
+  },
+};
+</script>

+ 147 - 81
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)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.rewardOptions, row.type);
+    },
+  },
+};
+</script>

+ 254 - 122
src/views/registration/regConfig/index.vue

@@ -1,43 +1,93 @@
+<!-- 签到管理 签到配置-->
 <template>
   <div class="app-container">
-    <el-form :model="form" ref="form" :rules="rules" label-width="auto" v-loading="loading"
-      :disabled="checkPermi(['registration:regConfig:change']) ? false : true">
+    <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-input
+          v-model="form.signTitle"
+          placeholder="请输入签到标题"
+          maxlength="50"
+          show-word-limit
+        />
       </el-form-item>
       <el-form-item label="签到周期:" prop="signDay">
-        <el-input-number v-model="form.signDay" :min="1" :max="99" placeholder="请输入签到周期" :controls="false"
-          @change="changeSignDay" />
+        <el-input-number
+          v-model="form.signDay"
+          :min="1"
+          :max="99"
+          placeholder="请输入签到周期"
+          :controls="false"
+          @change="changeSignDay"
+        />
         <span class="span">天</span>
       </el-form-item>
       <el-form-item label="基础积分:" prop="baseRewardPoint">
-        <el-input-number v-model="form.baseRewardPoint" :min="0" :controls="false" placeholder="请输入基础积分" />
+        <el-input-number
+          v-model="form.baseRewardPoint"
+          :min="0"
+          :controls="false"
+          placeholder="请输入基础积分"
+        />
         <span class="span">积分</span>
       </el-form-item>
 
       <el-form-item label="连续签到奖励:">
-        <el-popover placement="top" content="连续签到一定天数后,可以额外获得积分" trigger="hover">
-          <el-checkbox v-model="form.isContinueReward" :true-label="0" :false-label="1" slot="reference">
+        <el-popover
+          placement="top"
+          content="连续签到一定天数后,可以额外获得积分"
+          trigger="hover"
+        >
+          <el-checkbox
+            v-model="form.isContinueReward"
+            :true-label="0"
+            :false-label="1"
+            slot="reference"
+          >
             开启
           </el-checkbox>
         </el-popover>
-        <el-table v-if="form.isContinueReward === 0" :data="form.pointConfigContinueRList">
+        <el-table
+          v-if="form.isContinueReward === 0"
+          :data="form.pointConfigContinueRList"
+        >
           <el-table-column label="连续签到天数 / 天" align="center">
             <template slot-scope="scope">
-              <el-input-number class="input-number" v-model="scope.row.signDay" :min="1" :max="99"
-                :controls="false" @blur="checkSignDay(scope.row.signDay, scope.$index)" />
+              <el-input-number
+                class="input-number"
+                v-model="scope.row.signDay"
+                :min="1"
+                :max="99"
+                :controls="false"
+                @blur="checkSignDay(scope.row.signDay, scope.$index)"
+              />
             </template>
           </el-table-column>
           <el-table-column label="奖励积分 / 积分" align="center">
             <template slot-scope="scope">
-              <el-input-number class="input-number" v-model="scope.row.rewardPoint" :min="0"
-                :controls="false" />
+              <el-input-number
+                class="input-number"
+                v-model="scope.row.rewardPoint"
+                :min="0"
+                :controls="false"
+              />
             </template>
           </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)">
@@ -49,30 +99,59 @@
       </el-form-item>
 
       <el-form-item label="收听播放奖励:">
-        <el-popover placement="top" content="播放一定时间后,可以获得相应奖励" trigger="hover">
-          <el-select v-model="form.notifyRewardType" placeholder="请选择奖励类型" slot="reference"
-            style="width: 150px; margin-bottom: 10px">
-            <el-option v-for="item in rewardOptions" :key="item.value" :value="item.value"
-              :label="item.label" />
+        <el-popover
+          placement="top"
+          content="播放一定时间后,可以获得相应奖励"
+          trigger="hover"
+        >
+          <el-select
+            v-model="form.notifyRewardType"
+            placeholder="请选择奖励类型"
+            slot="reference"
+            style="width: 150px; margin-bottom: 10px"
+          >
+            <el-option
+              v-for="item in rewardOptions"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            />
           </el-select>
         </el-popover>
-        <el-table v-if="form.notifyRewardType" :data="form.pointConfigListenGoodList">
+        <el-table
+          v-if="form.notifyRewardType"
+          :data="form.pointConfigListenGoodList"
+        >
           <el-table-column label="播放时间 / 小时" align="center">
             <template slot-scope="scope">
-              <el-input-number class="input-number" v-model="scope.row.listenTime" :max="99" :controls="false"
-                @blur="checkListenTime(scope.row.listenTime, scope.$index)" />
+              <el-input-number
+                class="input-number"
+                v-model="scope.row.listenTime"
+                :max="99"
+                :controls="false"
+                @blur="checkListenTime(scope.row.listenTime, scope.$index)"
+              />
             </template>
           </el-table-column>
           <el-table-column label="奖励积分 / 积分" align="center">
             <template slot-scope="scope">
-              <el-input-number class="input-number" v-model="scope.row.rewardPoint" :min="0"
-                :controls="false" />
+              <el-input-number
+                class="input-number"
+                v-model="scope.row.rewardPoint"
+                :min="0"
+                :controls="false"
+              />
             </template>
           </el-table-column>
           <el-table-column align="center">
             <template #header>
-              <el-button type="text" icon="el-icon-plus" @click="handlerPush('播放奖励')"
-                :disabled="listenGoodPush">添加</el-button>
+              <el-button
+                type="text"
+                icon="el-icon-plus"
+                @click="handlerPush('播放奖励')"
+                :disabled="listenGoodPush"
+                >添加</el-button
+              >
             </template>
             <template slot-scope="scope">
               <el-button type="delete" @click="getDeleteListenGood(scope)">
@@ -83,24 +162,37 @@
         </el-table>
       </el-form-item>
       <el-form-item label="手机通知奖励:">
-        <el-input-number v-model="form.notifyRewardPoint" :min="0" :controls="false" />
+        <el-input-number
+          v-model="form.notifyRewardPoint"
+          :min="0"
+          :controls="false"
+        />
         <span class="span">积分</span>
       </el-form-item>
       <el-form-item label="签到规则:" prop="signRule">
-        <el-input v-model="form.signRule" type="textarea" :autosize="{minRows: 5, maxRows: 10}"
-          placeholder="请输入签到规则" />
+        <el-input
+          v-model="form.signRule"
+          type="textarea"
+          :autosize="{ minRows: 5, maxRows: 10 }"
+          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>
 </template>
 
 <script>
-import { list, submit, removeContinue, removeListenGood } from '@/api/registration/regConfig'
-import { checkPermi } from '@/utils/permission'
+import {
+list,
+removeContinue,
+removeListenGood,
+submit,
+} from "@/api/registration/regConfig";
+import { dialogCallBack } from "@/utils/DialogUtil";
+import { checkPermi } from "@/utils/permission";
 export default {
   data() {
     return {
@@ -108,7 +200,7 @@ export default {
       loading: false,
       // 表单
       form: {
-        pointConfigContinueRList: []
+        pointConfigContinueRList: [],
       },
       // 连续签到奖励 添加按钮禁止
       continuePush: false,
@@ -116,167 +208,207 @@ export default {
       listenGoodPush: false,
       // 校验
       rules: {
-        signTitle: [{
-          required: true, message: '请输入签到标题', trigger: 'blur'
-        }],
-        signDay: [{
-          required: true, message: '请输入签到周期', trigger: 'blur'
-        }],
-        baseRewardPoint: [{
-          required: true, message: '请输入基础积分', trigger: 'blur'
-        }],
-        signRule: [{
-          required: true, message: '请输入签到规则', trigger: 'blur'
-        }]
+        signTitle: [
+          {
+            required: true,
+            message: "请输入签到标题",
+            trigger: "blur",
+          },
+        ],
+        signDay: [
+          {
+            required: true,
+            message: "请输入签到周期",
+            trigger: "blur",
+          },
+        ],
+        baseRewardPoint: [
+          {
+            required: true,
+            message: "请输入基础积分",
+            trigger: "blur",
+          },
+        ],
+        signRule: [
+          {
+            required: true,
+            message: "请输入签到规则",
+            trigger: "blur",
+          },
+        ],
       },
       // 奖励类型
-      rewardOptions: [{
-        value: 4,
-        label: '积分'
-      }],
+      rewardOptions: [
+        {
+          value: 4,
+          label: "积分",
+        },
+      ],
       // 是否只读
-      disabled: false
-    }
+      disabled: false,
+    };
   },
   watch: {
-    'form.pointConfigContinueRList': {
+    "form.pointConfigContinueRList": {
       handler(val) {
         // 当连续签到已达基础签到周期上限则禁止添加新数据
-        this.continuePush = val.length < this.form.signDay ? val.findIndex(i => i.signDay === this.form.signDay) !== -1 ? true : false : true
+        this.continuePush =
+          val.length < this.form.signDay
+            ? val.findIndex((i) => i.signDay === this.form.signDay) !== -1
+              ? true
+              : false
+            : true;
       },
-      deep: true
+      deep: true,
+    },
+    "form.pointConfigListenGoodList"(val) {
+      this.listenGoodPush = val.length >= 10 ? true : false;
     },
-    'form.pointConfigListenGoodList'(val) {
-      this.listenGoodPush = val.length >= 10 ? true : false
-    }
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 详情
     getList() {
-      this.loading = true
-      list().then(res => {
+      this.loading = true;
+      list().then((res) => {
         if (res.code === 0) {
-          this.form = res.data
-          this.loading = false
+          this.form = res.data;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 签到周期改变 连续签到列表重置
     changeSignDay() {
-      let ids = ''
-      let arr = []
-      this.form.pointConfigContinueRList.map(i => {
+      let ids = "";
+      let arr = [];
+      this.form.pointConfigContinueRList.map((i) => {
         if (i.id) {
-          arr.push(i.id)
+          arr.push(i.id);
         }
-      })
-      ids = arr.join(',')
+      });
+      ids = arr.join(",");
       if (ids) {
-        removeContinue(ids).then(res => { })
+        removeContinue(ids).then((res) => {});
       }
-      this.form.pointConfigContinueRList = []
+      this.form.pointConfigContinueRList = [];
     },
 
     // 添加
     handlerPush(key) {
-      if (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
-        })
+          type: this.form.notifyRewardType,
+        });
       }
     },
 
     // 判断连续签到天数是否大于签到周期天数
     checkSignDay(e, index) {
       if (e > this.form.signDay) {
-        this.$message.error('连续签到天数不可大于签到周期!')
-        this.form.pointConfigContinueRList[index].signDay = undefined
+        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
+      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
+      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
+      var that = this;
+      dialogCallBack(that, function () {
+        let title = scope.row.signDay ? scope.row.signDay : "空";
+        that
+          .$confirm(`是否删除 连续签到天数为${title} 的数据?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            if (scope.row.id) {
+              removeContinue(scope.row.id).then((res) => {
+                if (res.code !== 0) {
+                  return false;
+                }
+              });
             }
+            that.$message.success("删除成功!");
+            that.form.pointConfigContinueRList.splice(scope.$index, 1);
           })
-        }
-        this.$message.success('删除成功!')
-        this.form.pointConfigContinueRList.splice(scope.$index, 1)
-      }).catch(() => { })
+          .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
+      var that = this;
+      dialogCallBack(that, function () {
+        let title = scope.row.listenTime ? scope.row.listenTime : "空";
+        that
+          .$confirm(`是否删除 播放时间为${title} 的数据?`, "提示:", {
+            type: "warning",
+          })
+          .then(() => {
+            if (scope.row.id) {
+              removeListenGood({
+                id: scope.row.id,
+              }).then((res) => {
+                if (res.code !== 0) {
+                  return false;
+                }
+              });
             }
+            that.$message.success("删除成功!");
+            that.form.pointConfigListenGoodList.splice(scope.$index, 1);
           })
-        }
-        this.$message.success('删除成功!')
-        this.form.pointConfigListenGoodList.splice(scope.$index, 1)
-      }).catch(() => { })
-
+          .catch(() => {});
+      });
     },
 
     // 确定
     getSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          submit(this.form).then(res => {
+          submit(this.form).then((res) => {
             if (res.code === 0) {
-              this.$message.success('修改成功!')
-              this.getList()
+              this.$message.success("修改成功!");
+              this.getList();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 监控权限
-    checkPermi
-  }
-}
+    checkPermi,
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -291,4 +423,4 @@ export default {
 .span {
   margin-left: 10px;
 }
-</style>
+</style>

+ 288 - 126
src/views/service/package/index.vue

@@ -1,78 +1,214 @@
+<!-- 服务管理 流量套餐 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
-      <el-form-item :label="form.typeList[0] === '13' ? '套餐名称:' : '流量名称:'">
+      <el-form-item
+        :label="form.typeList[0] === '13' ? '套餐名称:' : '流量名称:'"
+      >
         <el-input v-model="form.name" placeholder="请输入套餐名称" clearable />
       </el-form-item>
       <el-form-item v-if="form.typeList[0] !== '12'" label="资源平台:">
-        <el-select v-model="form.platformId" placeholder="请选择资源平台" clearable>
-          <el-option v-for="item in platformOptions" :key="item.value" :label="item.label" :value="item.value" />
+        <el-select
+          v-model="form.platformId"
+          placeholder="请选择资源平台"
+          clearable
+        >
+          <el-option
+            v-for="item in platformOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item v-else label="流量套餐:">
-        <el-select v-model="form.goodsId" placeholder="请选择流量套餐" clearable>
-          <el-option v-for="(item, index) in goodsOptions" :key="index" :label="item" :value="index" />
+        <el-select
+          v-model="form.goodsId"
+          placeholder="请选择流量套餐"
+          clearable
+        >
+          <el-option
+            v-for="(item, index) in goodsOptions"
+            :key="index"
+            :label="item"
+            :value="index"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="关联设备:">
-        <el-select v-model="form.deviceIds" filterable placeholder="请选择关联设备" clearable>
-          <el-option v-for="item in devOptions" :key="item.value" :label="item.label" :value="item.value" />
+        <el-select
+          v-model="form.deviceIds"
+          filterable
+          placeholder="请选择关联设备"
+          clearable
+        >
+          <el-option
+            v-for="item in devOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </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="['service:package:add']">新增</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          @click="getDetail()"
+          v-hasPermi="['service:package:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading="loading" :default-sort="{ prop: 'sort' }">
-      <el-table-column label="排序" align="center" prop="sort" key="sort" :formatter="sortFormatter" />
-      <el-table-column :label="form.typeList[0] === '13' ? '套餐名称' : '流量名称'" align="center" prop="name" key="name"
-        show-overflow-tooltip />
-      <el-table-column label="关联设备" align="center" prop="deviceIds" key="deviceIds" :formatter="devFormatter"
-        show-overflow-tooltip />
-      <el-table-column label="原价/元" align="center" prop="price" key="price" />
-      <el-table-column label="活动价/元" align="center" prop="discount" key="discount" />
-      <el-table-column v-if="form.typeList[0] === '12'" label="流量套餐" align="center" prop="intro" key="intro"
-        show-overflow-tooltip />
-      <el-table-column v-if="form.typeList[0] !== '12'" label="有效期" align="center" prop="indate" key="indate"
-        :formatter="timeFormatter" />
-      <el-table-column v-if="form.typeList[0] !== '12'" label="资源平台" align="center" prop="platformId" key="platformId"
-        :formatter="platformFormatter" />
-      <el-table-column v-if="form.typeList[0] !== '12'" label="栏目" align="center" prop="groupId" key="groupId"
-        :formatter="sceneFormatter" />
-      <el-table-column label="当前状态" align="center" prop="status" key="status" :formatter="statusFormatter" />
-      <el-table-column label="是否推荐" align="center" prop="isRecommend" key="isRecommend" :formatter="recommendFormatter" />
-      <el-table-column label="创建时间" align="center" prop="createTime" key="createTime" />
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      :default-sort="{ prop: 'sort' }"
+    >
+      <el-table-column
+        label="排序"
+        align="center"
+        prop="sort"
+        key="sort"
+        :formatter="sortFormatter"
+      />
+      <el-table-column
+        :label="form.typeList[0] === '13' ? '套餐名称' : '流量名称'"
+        align="center"
+        prop="name"
+        key="name"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="关联设备"
+        align="center"
+        prop="deviceIds"
+        key="deviceIds"
+        :formatter="devFormatter"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="原价/元"
+        align="center"
+        prop="price"
+        key="price"
+      />
+      <el-table-column
+        label="活动价/元"
+        align="center"
+        prop="discount"
+        key="discount"
+      />
+      <el-table-column
+        v-if="form.typeList[0] === '12'"
+        label="流量套餐"
+        align="center"
+        prop="intro"
+        key="intro"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        v-if="form.typeList[0] !== '12'"
+        label="有效期"
+        align="center"
+        prop="indate"
+        key="indate"
+        :formatter="timeFormatter"
+      />
+      <el-table-column
+        v-if="form.typeList[0] !== '12'"
+        label="资源平台"
+        align="center"
+        prop="platformId"
+        key="platformId"
+        :formatter="platformFormatter"
+      />
+      <el-table-column
+        v-if="form.typeList[0] !== '12'"
+        label="栏目"
+        align="center"
+        prop="groupId"
+        key="groupId"
+        :formatter="sceneFormatter"
+      />
+      <el-table-column
+        label="当前状态"
+        align="center"
+        prop="status"
+        key="status"
+        :formatter="statusFormatter"
+      />
+      <el-table-column
+        label="是否推荐"
+        align="center"
+        prop="isRecommend"
+        key="isRecommend"
+        :formatter="recommendFormatter"
+      />
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+        key="createTime"
+      />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['service:package:edit']">
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['service:package:edit']"
+          >
             编辑
           </el-button>
-          <el-button v-if="scope.row.status === 1" type="text" @click="getChange(scope.row)"
-            v-hasPermi="['service:package:down']">下架</el-button>
-          <el-button v-else type="delete" @click="getDelete(scope.row)"
-            v-hasPermi="['service:package:delete']">删除</el-button>
+          <el-button
+            v-if="scope.row.status === 1"
+            type="text"
+            @click="getChange(scope.row)"
+            v-hasPermi="['service:package:down']"
+            >下架</el-button
+          >
+          <el-button
+            v-else
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['service:package: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"
+    />
   </div>
 </template>
 
 <script>
-import { list, remove, shelve, goodsList } from '@/api/service/package'
-import { list as sceneList } from '@/api/operation/scene'
-import { devMixin, serviceTimeMixin } from '@/mixin/index'
+import { list as sceneList } from "@/api/operation/scene";
+import { goodsList, list, remove, shelve } from "@/api/service/package";
+import { devMixin, serviceTimeMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [devMixin, serviceTimeMixin],
   data() {
@@ -83,94 +219,104 @@ export default {
       form: {
         pageNum: 1,
         pageSize: 10,
-        typeList: this.$route.query.typeList.split(',')
+        typeList: this.$route.query.typeList.split(","),
       },
       // 列表
       tableData: [],
       // 总数据
       total: 0,
       // 是否推荐
-      recommendOptions: [{
-        value: 0,
-        label: '是'
-      }, {
-        value: 1,
-        label: '否'
-      }],
+      recommendOptions: [
+        {
+          value: 0,
+          label: "是",
+        },
+        {
+          value: 1,
+          label: "否",
+        },
+      ],
       // 当前状态
-      statusOptions: [{
-        value: 1,
-        label: '上架'
-      }, {
-        value: 4,
-        label: '下架'
-      }],
+      statusOptions: [
+        {
+          value: 1,
+          label: "上架",
+        },
+        {
+          value: 4,
+          label: "下架",
+        },
+      ],
       // 资源平台
-      platformOptions: [{
-        value: 6,
-        label: 'QQ音乐'
-      }, {
-        value: 9,
-        label: '酷狗音乐'
-      }, {
-        value: 10,
-        label: '爱听音乐'
-      }],
+      platformOptions: [
+        {
+          value: 6,
+          label: "QQ音乐",
+        },
+        {
+          value: 9,
+          label: "酷狗音乐",
+        },
+        {
+          value: 10,
+          label: "爱听音乐",
+        },
+      ],
       // 流量套餐
       goodsOptions: [],
       // 爱听专区
-      sceneOptions: []
-    }
+      sceneOptions: [],
+    };
   },
   mounted() {
-    if (this.form.typeList[0] === '12') {
-      this.getGoodSList(2)
+    if (this.form.typeList[0] === "12") {
+      this.getGoodSList(2);
     } else {
-      this.getSceneList()
+      this.getSceneList();
     }
-    this.getDevList()
-    this.getList()
+    this.getDevList();
+    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;
         }
-      })
+      });
     },
 
     // 流量套餐
     getGoodSList(e) {
-      goodsList(e).then(res => {
+      goodsList(e).then((res) => {
         if (res.code === 0) {
-          this.goodsOptions = res.data
+          this.goodsOptions = res.data;
         }
-      })
+      });
     },
 
     // 爱听专区
     getSceneList() {
-      sceneList().then(res => {
+      sceneList().then((res) => {
         if (res.code === 0) {
-          res.data.map(i => {
+          res.data.map((i) => {
             this.sceneOptions.push({
               value: i.id,
-              label: i.name
-            })
-          })
+              label: i.name,
+            });
+          });
         }
-      })
+      });
     },
 
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.getList()
+      this.form.pageNum = 1;
+      this.getList();
     },
 
     // 重置
@@ -178,9 +324,9 @@ export default {
       this.form = {
         pageNum: 1,
         pageSize: 10,
-        typeList: this.$route.query.typeList.split(',')
-      }
-      this.getList()
+        typeList: this.$route.query.typeList.split(","),
+      };
+      this.getList();
     },
 
     // 新增 / 编辑
@@ -189,68 +335,84 @@ export default {
         path: `/service/package/detail`,
         query: {
           id: id,
-          typeList: this.form.typeList.join(',')
-        }
-      })
-      this.$route.meta.activeMenu = this.$route.query.typeList.split(',')[0] === '13' ? '/service/musicPackage' : '/service/flowPackage'
+          typeList: this.form.typeList.join(","),
+        },
+      });
+      this.$route.meta.activeMenu =
+        this.$route.query.typeList.split(",")[0] === "13"
+          ? "/service/musicPackage"
+          : "/service/flowPackage";
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 下架
     getChange(row) {
-      this.$confirm(`是否下架${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        shelve(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('下架成功!')
-            this.getList()
-          }
+      this.$confirm(`是否下架${row.name}?`, "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          shelve(row.id).then((res) => {
+            if (res.code === 0) {
+              this.$message.success("下架成功!");
+              this.getList();
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
 
     // 字典翻译
     sortFormatter(row) {
-      return row.businessType === 5 ? row.sort : '/'
+      return row.businessType === 5 ? row.sort : "/";
     },
     // 资源平台
     platformFormatter(row) {
-      return this.selectDictLabel(this.platformOptions, row.platformId)
+      return this.selectDictLabel(this.platformOptions, row.platformId);
     },
     // 服务时间
     timeFormatter(row) {
-      return this.selectDictLabel(this.serviceTimeOptions, row.indate)
+      return this.selectDictLabel(this.serviceTimeOptions, row.indate);
     },
     // 当前状态
     statusFormatter(row) {
-      return this.selectDictLabel(this.statusOptions, row.status)
+      return this.selectDictLabel(this.statusOptions, row.status);
     },
     // 是否推荐
     recommendFormatter(row) {
-      return this.selectDictLabel(this.recommendOptions, row.isRecommend)
+      return this.selectDictLabel(this.recommendOptions, row.isRecommend);
     },
     // 关联设备
     devFormatter(row) {
-      return row.deviceIds ? row.deviceIds.split(',').map(i => this.selectDictLabel(this.devOptions, i)).join(',') : ''
+      return row.deviceIds
+        ? row.deviceIds
+            .split(",")
+            .map((i) => this.selectDictLabel(this.devOptions, i))
+            .join(",")
+        : "";
     },
     // 栏目
     sceneFormatter(row) {
-      return this.selectDictLabel(this.sceneOptions, row.groupId)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.sceneOptions, row.groupId);
+    },
+  },
+};
+</script>

+ 116 - 61
src/views/user/store/index.vue

@@ -1,25 +1,57 @@
+<!-- 用户管理 仓库账号 -->
 <template>
-  <div class='app-container'>
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="dialogVisible = true"
-      v-hasPermi="['user:store:add']">新增</el-button>
+  <div class="app-container">
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="dialogVisible = true"
+      v-hasPermi="['user:store:add']"
+      >新增</el-button
+    >
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="账号ID" align="center" prop="id" />
       <el-table-column label="账号名称" align="center" prop="name" />
       <el-table-column label="手机号" align="center" prop="phone" />
-      <el-table-column label="性别" align="center" prop="sex" :formatter="sexFormatter" />
+      <el-table-column
+        label="性别"
+        align="center"
+        prop="sex"
+        :formatter="sexFormatter"
+      />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['user:store:delete']">删除</el-button>
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['user:store: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="新增" width="500px" :before-close="cancel">
-      <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="100px">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      title="新增"
+      width="500px"
+      :before-close="cancel"
+    >
+      <el-form
+        :model="dialogForm"
+        ref="dialogForm"
+        :rules="rules"
+        label-width="100px"
+      >
         <el-form-item label="账号名称:" prop="name">
           <el-input v-model="dialogForm.name" placeholder="请输入账号名称" />
         </el-form-item>
@@ -28,7 +60,11 @@
         </el-form-item>
         <el-form-item label="性别:" prop="sex">
           <el-radio-group v-model="dialogForm.sex">
-            <el-radio v-for="item in sexOptions.slice(0, 2)" :key="item.value" :label="item.value">
+            <el-radio
+              v-for="item in sexOptions.slice(0, 2)"
+              :key="item.value"
+              :label="item.value"
+            >
               {{ item.label }}
             </el-radio>
           </el-radio-group>
@@ -43,30 +79,31 @@
 </template>
 
 <script>
-import { list, submit, remove } from '@/api/user/store'
-import { sexMixin } from '@/mixin/index'
+import { list, remove, submit } from "@/api/user/store";
+import { sexMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [sexMixin],
   data() {
     const checkPhone = (rule, value, callback) => {
       if (!value) {
-        return callback(new Error('请输入手机号'))
+        return callback(new Error("请输入手机号"));
       } else {
-        const reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
+        const reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
         if (reg.test(value)) {
-          callback()
+          callback();
         } else {
-          return callback(new Error('请输入正确的手机号'))
+          return callback(new Error("请输入正确的手机号"));
         }
       }
-    }
+    };
     return {
       // 遮罩层
       loading: false,
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
@@ -78,76 +115,94 @@ export default {
       dialogForm: {},
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入账户名称', trigger: 'blur'
-        }],
-        phone: [{
-          required: true, validator: checkPhone, trigger: 'blur'
-        }],
-        sex: [{
-          required: true, message: '请选择性别', trigger: 'change'
-        }]
-      }
-    }
+        name: [
+          {
+            required: true,
+            message: "请输入账户名称",
+            trigger: "blur",
+          },
+        ],
+        phone: [
+          {
+            required: true,
+            validator: checkPhone,
+            trigger: "blur",
+          },
+        ],
+        sex: [
+          {
+            required: true,
+            message: "请选择性别",
+            trigger: "change",
+          },
+        ],
+      },
+    };
   },
   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;
         }
-      })
+      });
     },
 
     // 取消
     cancel() {
-      this.$refs.dialogForm.resetFields()
-      this.dialogForm = {}
-      this.dialogVisible = false
+      this.$refs.dialogForm.resetFields();
+      this.dialogForm = {};
+      this.dialogVisible = false;
     },
 
     // 提交
     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.cancel()
-              this.getList()
+              this.$message.success("提交成功!");
+              this.cancel();
+              this.getList();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(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(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     sexFormatter(row) {
-      return this.selectDictLabel(this.sexOptions, row.sex)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.sexOptions, row.sex);
+    },
+  },
+};
+</script>