weixin_52219567 8 시간 전
부모
커밋
e62fb7c9b2
2개의 변경된 파일81개의 추가작업 그리고 1개의 파일을 삭제
  1. 79 0
      src/components/LinkSelector/index.vue
  2. 2 1
      src/views/diy/components/edit-many-goods-list.vue

+ 79 - 0
src/components/LinkSelector/index.vue

@@ -345,6 +345,39 @@
                 @pagination="getTableData7"
               />
             </div>
+            <!-- diy -->
+            <div v-if="boxpageKey == 'pcDiy'">
+              <div class="flex justify-between">
+                <el-input v-model="queryParams8.name" placeholder="请输入页面名称" clearable style="width: 300px; margin-bottom: 10px">
+                  <template #append>
+                    <el-button :icon="Search" @click="handleQuery8" />
+                  </template>
+                </el-input>
+                <div>
+                  <span class="mr-[5px]">是否新窗口打开</span>
+                  <el-switch v-model="switchVal" />
+                </div>
+              </div>
+              <el-table v-loading="loading8" border :data="tableData8" height="480">
+                <el-table-column width="80" align="center">
+                  <template #default="{ row }">
+                    <el-checkbox v-model="tableId8" :true-value="row.id" />
+                  </template>
+                </el-table-column>
+                <el-table-column label="页面名称" align="center" prop="title" min-width="200" show-overflow-tooltip>
+                  <template #default="scope">
+                    {{ scope.row.name }}
+                  </template>
+                </el-table-column>
+              </el-table>
+              <pagination
+                v-show="total8 > 0"
+                :total="total8"
+                v-model:page="queryParams8.pageNum"
+                v-model:limit="queryParams8.pageSize"
+                @pagination="getTableData8"
+              />
+            </div>
             <!-- 自定义 -->
             <div v-if="boxpageKey == 'zdy'">
               <div class="flex justify-between">
@@ -380,6 +413,7 @@ import { programList } from '@/api/pmsProduct/program';
 import { listTopics } from '@/api/product/topics';
 import { listServiceCase } from '@/api/product/serviceCase';
 import { listGiftNotice } from '@/api/product/giftNotice';
+import { pcDiyList } from '@/api/diy/index';
 
 interface Props {
   pageType?: any;
@@ -463,6 +497,17 @@ const queryParams7 = reactive({
   pageNum: 1,
   pageSize: 10
 });
+//diy
+const tableId8 = ref<any>(null);
+const total8 = ref(0);
+const loading8 = ref(true);
+const tableData8 = ref<any>([]);
+const queryParams8 = reactive({
+  pageNum: 1,
+  pageSize: 10,
+  type: 5,
+  name: ''
+});
 //自定义
 const input = ref('');
 
@@ -553,6 +598,9 @@ const onMenu = (res: any) => {
       if (boxpageKey.value == 'appnews') {
         handleQuery7();
       }
+      if (boxpageKey.value == 'pcDiy') {
+        handleQuery8();
+      }
       console.log(datas, 'datas');
     } else {
       if (menuData.value[list[0]].type == '4') {
@@ -712,6 +760,24 @@ const getTableData7 = async () => {
   }
 };
 
+//diy查询
+const handleQuery8 = () => {
+  queryParams8.pageNum = 1;
+  getTableData8();
+};
+
+/** 获取列表diy */
+const getTableData8 = async () => {
+  loading8.value = true;
+  try {
+    const res = await pcDiyList(queryParams8);
+    tableData8.value = res.rows || [];
+    total8.value = res.total || 0;
+  } finally {
+    loading8.value = false;
+  }
+};
+
 const onSelected = (item: any) => {
   selected.value = item.url;
 };
@@ -866,6 +932,19 @@ const onConfirm = () => {
         });
       }
     }
+    if (boxpageKey.value == 'pcDiy') {
+      if (tableId8.value) {
+        const url8 = '/pdIndex?id=' + tableId8.value;
+        emit('update:modelValue', url8);
+        showDialog.value = false;
+      } else {
+        ElMessage({
+          message: '请选择',
+          type: 'warning',
+          duration: 2000
+        });
+      }
+    }
   }
 };
 

+ 2 - 1
src/views/diy/components/edit-many-goods-list.vue

@@ -205,10 +205,11 @@ const addItem = () => {
     id: diyStore.generateRandom(),
     title: '分类',
     desc: '分类描述',
-    source: 'all',
+    source: 1,
     goods_category: '',
     goods_category_name: '请选择',
     goods_ids: [],
+    goodsIds: [],
     imageUrl: ''
   });
 };