DESKTOP-O04BTUJ\muzen 3 gadi atpakaļ
vecāks
revīzija
4627a4477a

+ 0 - 27
src/api/channel/official.js

@@ -1,27 +0,0 @@
-import request from '@/utils/request'
-
-// 查询12个频道
-export function getChannelPage() {
-    return request({
-        url: `/device/channel/page`,
-        method: 'get'
-    })
-}
-
-// 编辑12频道信息
-export function getChannelEdit(data) {
-    return request({
-        url: `/device/channel/edit`,
-        method: 'post',
-        data: data
-    })
-}
-
-// 频道内容列表
-export function getChannelAudioPage(query) {
-    return request({
-        url: `/device/channel/audio/page`,
-        method: 'get',
-        params: query
-    })
-}

+ 0 - 167
src/views/channel/official/detail.vue

@@ -1,167 +0,0 @@
-<template>
-  <div class="app-container">
-    <!-- 提交表单 -->
-    <el-form :model="form1" :rules="rules" :ref="form1" class="form" label-width="100px" :disabled="disabled">
-      <el-row>
-        <el-col :span="12">
-          <el-form-item prop="pic" label="频道封面:">
-            <Upload listType="picture-card" :url="form1.pic" @upload="handleUploadImg" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item prop="aliasName" label="频道名称:">
-            <el-input v-model="form1.aliasName" placeholder="请输入频道名称" />
-          </el-form-item>
-          <el-form-item prop="description" label="频道简介:" style="width: 900px">
-            <el-input v-model="form1.description" type="textarea" rows="4" placeholder="请输入频道简介" />
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-form-item label="频道详情:" style="width: 1200px">
-        <!-- <el-button type="primary" @click="getPageList">关联</el-button> -->
-        <el-table :data="tableData2" ref="tableData2" :row-key="getRowKey"
-          @selection-change="handleSelectionChange" height="500px">
-          <el-table-column type="selection" align="center" reserve-selection />
-          <el-table-column prop="id" label="ID" align="center" />
-          <el-table-column prop="audioName" label="音频名称" align="center" show-overflow-tooltip />
-          <el-table-column prop="audioPic" label="音频封面图" width="100px">
-            <template slot-scope="scope">
-              <el-image :src="scope.row.audioPic" :preview-src-list="[scope.row.audioPic]" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="audioTypeText" label="音频类型" align="center" />
-          <el-table-column prop="audioInfo" label="音频信息" align="center" show-overflow-tooltip />
-          <el-table-column prop="free" label="付费类型" align="center" :formatter="freeFormatter" />
-        </el-table>
-        <pagination v-show="total>0" :total="total" :page.sync="form2.pageNum" :limit.sync="form2.pageSize"
-          @pagination="getPageList" />
-        <!-- <el-table :data="tableData1" height="400">
-          <el-table-column prop="id" label="ID" align="center" />
-          <el-table-column prop="audioName" label="音频名称" align="center" show-overflow-tooltip />
-          <el-table-column prop="audioPic" label="音频封面图" width="100px">
-            <template slot-scope="scope">
-              <el-image :src="scope.row.audioPic" :preview-src-list="[scope.row.audioPic]" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="audioTypeText" label="音频类型" align="center" />
-          <el-table-column prop="audioInfo" label="音频信息" align="center" show-overflow-tooltip />
-          <el-table-column prop="free" label="付费类型" align="center" :formatter="freeFormatter" />
-        </el-table> -->
-      </el-form-item>
-    </el-form>
-    <div class="form-btn">
-      <el-button @click="getCancel">取消</el-button>
-      <el-button v-if="disabled === false" type="primary" @click="getSubmit">提交</el-button>
-    </div>
-    <!-- 弹窗 -->
-    <el-dialog title="关联" :visible.sync="dialogVisible" width="1000px">
-      <!-- <el-form inline label-width="100px" size="mini">
-        <el-form-item label="当前状态:">
-          <el-select placeholder="请选择当前状态:">
-            <el-option />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="付费类型:">
-          <el-select placeholder="请选择付费类型"></el-select>
-        </el-form-item>
-        <el-form-item label="ID:">
-          <el-input placeholder="请输入ID" />
-        </el-form-item>
-        <el-form-item>
-          <el-button icon="el-icon-search" type="primary">搜索</el-button>
-          <el-button icon="el-icon-refresh">重置</el-button>
-        </el-form-item>
-      </el-form>-->
-
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getChannelEdit, getChannelAudioPage } from "@/api/channel/official";
-import Upload from "@/components/Upload/index";
-export default {
-  components: {
-    Upload,
-  },
-  dicts: ["free_yes_no"],
-  data() {
-    return {
-      // 频道详情列表
-      tableData1: [],
-      // 遮罩层
-      loading: true,
-      // 弹窗
-      dialogVisible: false,
-      // 提交表单
-      form1: {},
-      // 表单验证
-      rules: {},
-      // 关联表单
-      form2: {
-        channelId: this.$route.query.row.channelId,
-        pageNum: 1,
-        pageSize: 10,
-      },
-      // 关联列表总数
-      total: 0,
-      // 关联列表
-      tableData2: [],
-      // 查看不可修改
-      disabled: true
-    };
-  },
-  mounted() {
-    this.form1 = this.$route.query.row
-    this.disabled = this.$route.query.key === '查看' ? true : false
-    this.getPageList()
-  },
-  methods: {
-    // 关联列表
-    getPageList() {
-      // this.dialogVisible = true;
-      getChannelAudioPage(this.form2).then((res) => {
-        if (res.code === 0) {
-          this.tableData2 = res.data.records;
-          this.total = res.data.total;
-        }
-      });
-    },
-    // 上传频道封面
-    handleUploadImg(e) {
-      this.form1.pic = e.file;
-    },
-
-    // 多选
-    handleSelectionChange(e) {
-      this.tableData1 = e;
-    },
-    getRowKey(row) {
-      return row.id;
-    },
-
-    // 取消
-    getCancel() {
-      this.$tab.closeOpenPage("/channel/official");
-    },
-
-    // 提交
-    getSubmit() {
-      getChannelEdit(this.form1).then((res) => {
-        console.log(res);
-      });
-    },
-
-    // 字典翻译
-    freeFormatter(row) {
-      return this.selectDictLabel(this.dict.type.free_yes_no, row.free);
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.form {
-  width: 600px;
-}
-</style>

+ 0 - 160
src/views/channel/official/index.vue

@@ -1,160 +0,0 @@
-<template>
-  <div class="app-container">
-    <!-- 搜索 -->
-    <el-form inline label-width="100px" size="mini">
-      <el-form-item label="设备型号:">
-        <el-input placeholder="请输入设备型号"></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
-        <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-      </el-form-item>
-    </el-form>
-    <!-- 列表 -->
-    <el-tabs v-model="tabActive" addable closable type="card" @tab-add="dialogVisible = true"
-      @tab-remove="getRemove" v-loading="loading">
-      <el-tab-pane v-for="item in tabOptions" :key="item.value" :label="item.label" :name="item.value">
-        <el-form label-width="100px">
-          <el-form-item label="关联设备:">
-            <el-checkbox-group v-model="value">
-              <el-checkbox v-for="item in options" :key="item.value" :label="item.label" />
-            </el-checkbox-group>
-          </el-form-item>
-        </el-form>
-        <el-table :data="tableData">
-          <el-table-column type="index" label="序号" align="center"></el-table-column>
-          <el-table-column prop="aliasName" label="频道名称" align="center"></el-table-column>
-          <el-table-column label="频道封面" align="center" width="100px">
-            <template slot-scope="scope">
-              <el-image :src="scope.row.pic" :preview-src-list="[scope.row.pic]" fit="scale-down" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="description" label="频道简介" align="center"></el-table-column>
-          <el-table-column label="频道详情" align="center">
-            <template slot-scope="scope">
-              <el-button type="text" @click="getEdit(scope.row, '查看')">查看</el-button>
-              <el-button v-if="scope.row.channelId !== 1 && scope.row.channelId !== 2" type="text"
-                @click="getEdit(scope.row)">编辑</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </el-tab-pane>
-    </el-tabs>
-    <!-- 弹窗 -->
-    <el-dialog title="新增" :visible.sync="dialogVisible" width="500px">
-      <el-form label-width="100px">
-        <el-form-item label="列表名称:" :rules="[{required: true, message:'请输入列表名称', trigger: 'blur'}]">
-          <el-input v-model="listName" placeholder="请输入列表名称" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer">
-        <el-button>取消</el-button>
-        <el-button type="primary" @click="getAdd">确定</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getChannelPage } from "@/api/channel/official";
-export default {
-  data() {
-    return {
-      // 遮罩层
-      loading: false,
-      options: [
-        {
-          value: "1",
-          label: "野性mini",
-        },
-        {
-          value: "2",
-          label: "小王子",
-        },
-        {
-          value: "3",
-          label: "原子唱机",
-        },
-        {
-          value: "4",
-          label: "mate系列",
-        },
-        {
-          value: "5",
-          label: "小确幸",
-        },
-        {
-          value: "6",
-          label: "灵感手表",
-        },
-        {
-          value: "7",
-          label: "机械光域",
-        },
-      ],
-      value: ['野性mini', '小王子', '原子唱机', 'mate系列', '小确幸', '灵感手表', '机械光域'],
-      //   标签页
-      tabOptions: [
-        {
-          label: "默认频道",
-          value: "1",
-        },
-      ],
-      tabActive: "1",
-      listName: "",
-      // 列表
-      tableData: [],
-      //  弹窗
-      dialogVisible: false,
-    };
-  },
-  mounted() {
-    this.getList();
-  },
-  methods: {
-    // 搜索
-    getSearch() {
-
-    },
-    // 重置
-    getRefresh() {
-
-    },
-    // 列表
-    getList() {
-      this.loading = true
-      getChannelPage().then((res) => {
-        if (res.code === 0) {
-          this.tableData = res.data;
-          this.loading = false
-        }
-      });
-    },
-    // 编辑 / 查看
-    getEdit(row, key) {
-      this.$router.push({
-        path: `/channel/official/detail`,
-        query: {
-          row: row,
-          key: key
-        },
-      });
-    },
-    getRemove(e){
-      this.tabOptions.splice(e - 1, 1)
-    },
-    // 新建列表
-    getAdd() {
-      let index = this.tabOptions.length;
-      this.tabOptions.push({
-        label: this.listName,
-        value: ++index,
-      });
-      this.dialogVisible = false;
-    },
-  },
-};
-</script>
-
-<style>
-</style>