Ver código fonte

feat: 处理、文章管理、广播分类、音乐专辑、猫王精选电台详情、多添加一层谨慎操作提示

Damon 9 meses atrás
pai
commit
75da1371b5

+ 1 - 0
src/router/index.js

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

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

+ 18 - 12
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(() => {});
+      });
     },
 
     // 多选

+ 285 - 110
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,67 +398,80 @@ 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>

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

+ 2 - 2
src/views/operation/agreement/index.vue

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

+ 2 - 2
src/views/operation/feedbacktype/index.vue

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