guhongwei 2 年之前
父節點
當前提交
ce04b06c42
共有 2 個文件被更改,包括 24 次插入3 次删除
  1. 7 2
      src/views/tvadmin/add.vue
  2. 17 1
      src/views/tvadmin/index.vue

+ 7 - 2
src/views/tvadmin/add.vue

@@ -7,6 +7,9 @@
         </el-col>
         <el-col :span="24" class="two">
           <data-form :fields="fields" :form="form" :rules="{}" @save="toSave">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
             <template #is_use>
               <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
             </template>
@@ -18,7 +21,7 @@
 </template>
 
 <script>
-import { is_use } from '@common/src/layout/site';
+import { is_use, pro_type } from '@common/src/layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('program');
 export default {
@@ -28,15 +31,17 @@ export default {
   data: function () {
     return {
       fields: [
+        { label: '节目类型', model: 'type', type: 'select' },
         { label: '名称', model: 'name' },
         { label: '简介', model: 'brief', type: 'textarea' },
         { label: '视频流', model: 'path' },
         { label: '排序', model: 'sort', type: 'number' },
-
         { label: '是否启用', model: 'is_use', type: 'select' },
       ],
       form: {},
       is_useList: is_use,
+      // 节目类型
+      typeList: pro_type,
     };
   },
   created() {

+ 17 - 1
src/views/tvadmin/index.vue

@@ -4,6 +4,9 @@
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="one">
           <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            </template>
             <template #is_use>
               <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
             </template>
@@ -21,7 +24,7 @@
 </template>
 
 <script>
-import { is_use } from '@common/src/layout/site';
+import { is_use, pro_type } from '@common/src/layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('program');
 export default {
@@ -36,6 +39,17 @@ export default {
       total: 0,
       fields: [
         { label: '序号', options: { type: 'index' } },
+        {
+          label: '节目类型',
+          model: 'type',
+          type: 'select',
+          format: (i) => {
+            let data = this.typeList.find((r) => r.dict_value == i);
+            if (data) return data.dict_label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
         { label: '名称', model: 'name', isSearch: true },
         { label: '视频流', model: 'path', isSearch: true },
         { label: '排序', model: 'sort', isSearch: true },
@@ -57,6 +71,8 @@ export default {
         { label: '删除', method: 'del', confirm: true, type: 'danger' },
       ],
       is_useList: is_use,
+      // 节目类型
+      typeList: pro_type,
     };
   },
   created() {