liyongli il y a 6 mois
Parent
commit
9ab0e962d6
6 fichiers modifiés avec 241 ajouts et 28 suppressions
  1. 7 11
      src/api/index.ts
  2. 164 0
      src/tool/adList.js
  3. 0 16
      src/tool/adList.ts
  4. 16 0
      src/tool/index.html
  5. 32 1
      src/views/SitePage.vue
  6. 22 0
      src/views/SourceMaterialPage.vue

+ 7 - 11
src/api/index.ts

@@ -134,6 +134,13 @@ export const createAsTree = (data: CatalogTreeOri) => {
   return instance.post('/ad/catalog/create', data)
 }
 
+/**
+ * 栏目发布
+ */
+export const publishAsTree = (id: number) => {
+  return instance.get('/ad/catalog/publish?catalogId=' + id)
+}
+
 /**
  * 获取素材列表
  */
@@ -222,17 +229,6 @@ export const updateAdvertiserStatus = (data: { id: number; status: number }) =>
   return instance.post('/ad/advertiser/updateStatus', data)
 }
 
-// {
-//   "creativeIds": [1013], 创意id
-//   "stuffIds": [1008], 素材id
-//   "startDate": "2024-11-01",
-//   "endDate": "2024-12-30",
-//   "provinces": ["陕西省"],
-//   "cities": ["西安市"],
-//   "pageNum": 1,
-//   "pageSize": 10
-// }
-
 /**
  * 广告主日报表
  */

Fichier diff supprimé car celui-ci est trop grand
+ 164 - 0
src/tool/adList.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 16
src/tool/adList.ts


+ 16 - 0
src/tool/index.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script src="./adList.js"></script>
+</head>
+
+<body>
+    <div id="sxtv-ad-1"></div>
+    <div id="sxtv"></div>
+</body>
+
+</html>

+ 32 - 1
src/views/SitePage.vue

@@ -60,6 +60,14 @@
             <el-button link type="primary" size="small" @click="() => Add(scope.row, catalogData)">
               添加
             </el-button>
+            <el-popconfirm
+              @confirm="publishAsTreeFunc(scope.row.catalogId)"
+              title="确定发布该栏目吗?"
+            >
+              <template #reference>
+                <el-button link type="primary" size="small">发布</el-button>
+              </template>
+            </el-popconfirm>
             <el-popconfirm @confirm="deleteSiteFun(scope.row.catalogId)" title="确定删除该栏目吗?">
               <template #reference>
                 <el-button link type="primary" size="small">删除</el-button>
@@ -88,7 +96,14 @@ import type { SiteList } from '@/types/Site'
 import type { CatalogTreeOri } from '@/types/Catalog'
 import { reactive, ref } from 'vue'
 import { ElMessage } from 'element-plus'
-import { getSiteList, deleteAsTree, getAsTree, updateAsTree, createAsTree } from '@/api/index'
+import {
+  getSiteList,
+  deleteAsTree,
+  getAsTree,
+  updateAsTree,
+  createAsTree,
+  publishAsTree,
+} from '@/api/index'
 
 import { formatDateSite } from '@/tool/index'
 
@@ -174,6 +189,22 @@ const saveEdit = (row: CatalogTreeOri) => {
   })
 }
 
+const publishAsTreeFunc = (id: number) => {
+  loading.value = true
+  publishAsTree(id)
+    .then(() => {
+      loading.value = false
+      show(mediaId[0], mediaId[1])
+      ElMessage({
+        message: '发布成功',
+        type: 'success',
+      })
+    })
+    .catch(() => {
+      loading.value = false
+    })
+}
+
 const Add = (row: CatalogTreeOri, list: CatalogTreeOri[]) => {
   const sonItem: CatalogTreeOri = { isEdit: true, parentId: row.catalogId, mediaId: row.mediaId }
   for (let i = 0; i < list.length; i++) {

+ 22 - 0
src/views/SourceMaterialPage.vue

@@ -119,6 +119,9 @@
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="creatMaterial(ruleFormRef)">确定</el-button>
+        <el-button v-if="form.stuffId" type="primary" @click="addNewMaterial(ruleFormRef)">
+          添加到新创意
+        </el-button>
       </el-form-item>
     </el-form>
   </el-dialog>
@@ -228,6 +231,25 @@ const creatMaterial = (formEl: FormInstance | undefined) => {
   })
 }
 
+const addNewMaterial = (formEl: FormInstance | undefined) => {
+  if (!formEl) return
+  formEl.validate((valid) => {
+    if (!valid) return
+    const p = {
+      ...form.value,
+    }
+    delete p.stuffId
+    createMaterial(p).then(() => {
+      ElMessage({
+        message: '复制成功',
+        type: 'success',
+      })
+      onSubmit()
+      dialogVisible.value = false
+    })
+  })
+}
+
 const page = (val: number) => {
   pages.pageNum = val
   onSubmit()

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff