Selaa lähdekoodia

feat: 音乐专辑内能调整配置内容顺序

Damon 11 kuukautta sitten
vanhempi
commit
b19f4649b4

+ 1 - 1
src/views/device/category/index.vue

@@ -1,4 +1,4 @@
-<!-- 设备分类 -->
+<!-- 设备分类 详情 -->
 <template>
   <div class="app-container">
     <!-- 搜索 -->

+ 29 - 3
src/views/music/album/detail.vue

@@ -1,4 +1,4 @@
-<!-- 专辑专辑 详情 -->
+<!-- 音乐专辑 详情 -->
 <template>
   <div class="app-container">
     <el-form
@@ -130,9 +130,8 @@
                 type="text"
                 icon="el-icon-caret-bottom"
                 @click="getChangeSort(scope.$index, scope.$index + 1)"
-                :disabled="scope.$index > form.list.length - 2"
+                :disabled="scope.$index > form.programList.length - 2"
               />
-
             </template>
           </el-table-column>
         </el-table>
@@ -374,12 +373,39 @@ export default {
     }
   },
   methods: {
+    // 排序
+    getChangeSort(row, sort) {
+      const rowBean = this.form.programList[row];
+      const sortBean = this.form.programList[sort];
+      this.form.programList[row] = sortBean;
+      this.form.programList[sort] = rowBean;
+
+      let arr = [];
+      const formTemp = this.form;
+      formTemp.programList.map((i) => {
+        arr.push(i.id);
+      });
+      formTemp.programList = arr;
+      console.log("获取数据==请求参数=" + JSON.stringify(formTemp.programList));
+
+      submit(formTemp).then((res) => {
+        if (res.code === 0) {
+          let title = "修改成功!";
+          this.$message.success(`${title}`);
+          this.getDetail();
+        }
+      });
+    },
+
     // 详情
     getDetail() {
       this.form_loading = true;
       detail(this.form.id).then((res) => {
         if (res.code === 0) {
           this.form = res.data;
+          console.log(
+            "获取数据==回应参数=" + JSON.stringify(this.form.programList)
+          );
           this.form_loading = false;
         }
       });

+ 2 - 3
src/views/music/blog/detail.vue

@@ -162,10 +162,9 @@
                 type="text"
                 icon="el-icon-caret-bottom"
                 @click="getChangeSort(scope.$index, scope.$index + 1)"
-                :disabled="
-                  scope.$index > form.adminPodCastProgramDetailResp.length - 2
-                "
+                :disabled="scope.$index > form.adminPodCastProgramDetailResp.length - 2"
               />
+              
             </template>
           </el-table-column>
         </el-table>