Browse Source

RING:素材库基础页面

ringcode 3 years ago
parent
commit
73f4ad6726

+ 37 - 2
src/router/async.ts

@@ -174,7 +174,6 @@ export const Performance: RouteConfig = {
   // children: [PutAdAcountL, PutAdGroup, PutAdPlan],
   component: () => import("@/views/data/performance.vue")
 };
-
 export const DataAnalysis: RouteConfig = {
   name: "DataAnalysis",
   path: "/data",
@@ -187,6 +186,42 @@ export const DataAnalysis: RouteConfig = {
   ],
   component: () => import("@/views/data/index.vue")
 };
+export const VideoMaterial: RouteConfig = {
+  name: "VideoMaterial",
+  path: "/material/video",
+  meta: {
+    title: "视频库",
+    noMenu: true
+  },
+  // children: [PutAdAcountL, PutAdGroup, PutAdPlan],
+  component: () => import("@/views/material/video.vue")
+};
+export const PictureMaterial: RouteConfig = {
+  name: "PictureMaterial",
+  path: "/material/picture",
+  meta: {
+    title: "图片库",
+    noMenu: true
+  },
+  // children: [PutAdAcountL, PutAdGroup, PutAdPlan],
+  component: () => import("@/views/material/picture.vue")
+};
+
+
+export const MaterialCenter: RouteConfig = {
+  name: "MaterialCenter",
+  path: "/material",
+  icon: "DesktopOutlined",
+  meta: {
+    title: "素材中心"
+  },
+  children: [
+    VideoMaterial,
+    PictureMaterial,
+  ],
+  component: () => import("@/views/material/index.vue")
+};
+
 
 export const ForgetPwd: RouteConfig = {
   name: "ForgetPwd",
@@ -200,6 +235,6 @@ export const ForgetPwd: RouteConfig = {
 
 
 
-const asyncRoutes: RouteConfig[] = [AccountManager, PutManager, Financial, QuickApp, ForgetPwd, DataAnalysis];
+const asyncRoutes: RouteConfig[] = [AccountManager, DataAnalysis, PutManager, Financial, QuickApp, ForgetPwd, MaterialCenter];
 
 export default asyncRoutes;

+ 1 - 1
src/views/404.vue

@@ -1,5 +1,5 @@
 <template>
   <div class="about">
-    <h1>This is an about page</h1>
+    <h1>404</h1>
   </div>
 </template>

+ 2 - 13
src/views/data/performance.vue

@@ -22,7 +22,7 @@ import {
   deletePromotion,
 } from "@/api";
 import { message } from "ant-design-vue";
-const PutDataIndex = defineComponent({
+const Performance = defineComponent({
   components: {},
   setup() {
     let { tablePageOptions } = usePagination();
@@ -50,17 +50,6 @@ const PutDataIndex = defineComponent({
       rate: 0, // 设置回传配置
       channelId: "",
       loading: false,
-      rules: {
-        channel_id: [
-          { required: true, message: "请输入推广链接ID", trigger: "change" },
-        ],
-        channel_name: [
-          { required: true, message: "请输入渠道名", trigger: "change" },
-        ],
-        book_name: [
-          { required: true, message: "请输入作品名", trigger: "change" },
-        ],
-      },
     });
     return { ...toRefs(state), formRef, tablePageOptions };
   },
@@ -148,7 +137,7 @@ const PutDataIndex = defineComponent({
   },
 });
 
-export default PutDataIndex;
+export default Performance;
 </script>
 <style lang="scss" scoped>
 @import "@/assets/common-style/frame.scss";

+ 21 - 0
src/views/material/index.vue

@@ -0,0 +1,21 @@
+<template>
+  <router-view></router-view>
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+
+import useStore from "@/hooks/useStore";
+
+import { getOfficialSimpleAccount } from "@/api";
+import { ActionType } from "@/store/modules/app/_type";
+
+const materialIndex = defineComponent({
+  setup() {
+    const store = useStore();
+    store.dispatch(ActionType.doSaveOfficial);
+  },
+});
+
+export default materialIndex;
+</script>

+ 146 - 0
src/views/material/picture.vue

@@ -0,0 +1,146 @@
+<template>
+  <div class="performance">
+    <div class="title-box">
+      <h3>图片库</h3>
+    </div>
+    <div class="padding-box">
+      <div class="search-box"></div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import usePagination from "@/hooks/usePagination";
+import { defineComponent, reactive, toRefs, ref } from "vue";
+import { onBeforeRouteUpdate } from "vue-router";
+// import { TableColumnOfYuewen } from "../_pageOptions/table_yuewen";
+//getPromotionList
+import {
+  getPromotionList,
+  addPromotionLInk,
+  updateReportConfig,
+  deletePromotion,
+} from "@/api";
+import { message } from "ant-design-vue";
+const PictureLibrary = defineComponent({
+  components: {},
+  setup() {
+    let { tablePageOptions } = usePagination();
+    const formRef = ref();
+    const state = reactive({
+      search: {
+        name: "", // 推广员名称
+        days: "", // 自定义天数 1~30天 无默认
+        months: "", // 自定义月数 默认一个月
+        dateType: "month", // 按月查询month/按天查询date
+        month_range: "", // 按月查询 月范围
+        date_range: "", // 按天查询 日期范围
+      },
+      addLink: {
+        channel_id: "", // 推广链接id
+        channel_name: "", // 渠道名
+        book_name: "", // 作品名
+      },
+      list: ref<any[]>([]),
+      visible: false, // 添加派单链接dialog
+      rateVisible: false, // 添加派单链接dialog
+      drawerVisible: false,
+      confirmLoading: false, // 提交链接loading
+      // columns: TableColumnOfYuewen,
+      rate: 0, // 设置回传配置
+      channelId: "",
+      loading: false,
+    });
+    return { ...toRefs(state), formRef, tablePageOptions };
+  },
+  mounted() {
+    this.getList({ current: 1 });
+  },
+  methods: {
+    // 重置搜索条件
+    resetSearch() {
+      // this.search.book_name = "";
+      // this.search.channel_name = "";
+      // this.search.channel_id = "";
+    },
+    // 获取推广链接数据
+    async getList(page?: any) {
+      // this.loading = true;
+      // let { data } = await getPromotionList({
+      //   page: page ? page.current : 1,
+      //   ...this.search,
+      // });
+      // this.loading = false;
+      // this.list = data.list;
+    },
+    // 点击添加链接
+    onAddLink() {
+      this.addLink.channel_id = "";
+      this.addLink.channel_name = "";
+      this.addLink.book_name = "";
+      this.visible = true;
+    },
+    // 确认增加派单链接
+    async onEmitLink() {
+      this.formRef.validate().then(() => {});
+      if (!this.addLink.channel_name) return message.warn("请输入渠道名称");
+      if (!this.addLink.channel_id) return message.warn("请输入链接ID");
+      if (!this.addLink.book_name) return message.warn("请输入推广作品");
+      try {
+        await addPromotionLInk(this.addLink);
+        message.success("新增成功");
+        this.getList({ current: 1 });
+        this.visible = false;
+      } catch (err) {
+        console.log("ERROR:", err);
+      }
+    },
+    // 删除
+    async onDelete(val: any) {
+      try {
+        await deletePromotion({ channel_id: val.channel_id });
+        this.getList({ current: 1 });
+        message.success("删除成功");
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    // 点击回传配置
+    onRateConfig(val: any) {
+      this.channelId = val.channel_id;
+      this.rateVisible = true;
+      this.rate = val.rate;
+    },
+    // 提交回传配置
+    async onEmitRate() {
+      if (this.rate > 100 || this.rate < 0)
+        return message.error("回传比例应在0~100之间");
+      if (parseInt(this.rate) !== parseFloat(this.rate))
+        return message.warn("请输入整数");
+      try {
+        await updateReportConfig({
+          channel_id: this.channelId,
+          rate: this.rate,
+        });
+        message.success("修改成功");
+        this.getList({ current: 1 });
+        this.rateVisible = false;
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    // 查看注册用户
+    openUserDrawer(val: any) {
+      this.channelId = val.channel_id;
+      this.drawerVisible = true;
+    },
+  },
+});
+
+export default PictureLibrary;
+</script>
+<style lang="scss" scoped>
+@import "@/assets/common-style/frame.scss";
+// .performance {
+// }
+</style>

+ 146 - 0
src/views/material/video.vue

@@ -0,0 +1,146 @@
+<template>
+  <div class="performance">
+    <div class="title-box">
+      <h3>视频库</h3>
+    </div>
+    <div class="padding-box">
+      <div class="search-box"></div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+import usePagination from "@/hooks/usePagination";
+import { defineComponent, reactive, toRefs, ref } from "vue";
+import { onBeforeRouteUpdate } from "vue-router";
+// import { TableColumnOfYuewen } from "../_pageOptions/table_yuewen";
+//getPromotionList
+import {
+  getPromotionList,
+  addPromotionLInk,
+  updateReportConfig,
+  deletePromotion,
+} from "@/api";
+import { message } from "ant-design-vue";
+const VideoLibrary = defineComponent({
+  components: {},
+  setup() {
+    let { tablePageOptions } = usePagination();
+    const formRef = ref();
+    const state = reactive({
+      search: {
+        name: "", // 推广员名称
+        days: "", // 自定义天数 1~30天 无默认
+        months: "", // 自定义月数 默认一个月
+        dateType: "month", // 按月查询month/按天查询date
+        month_range: "", // 按月查询 月范围
+        date_range: "", // 按天查询 日期范围
+      },
+      addLink: {
+        channel_id: "", // 推广链接id
+        channel_name: "", // 渠道名
+        book_name: "", // 作品名
+      },
+      list: ref<any[]>([]),
+      visible: false, // 添加派单链接dialog
+      rateVisible: false, // 添加派单链接dialog
+      drawerVisible: false,
+      confirmLoading: false, // 提交链接loading
+      // columns: TableColumnOfYuewen,
+      rate: 0, // 设置回传配置
+      channelId: "",
+      loading: false,
+    });
+    return { ...toRefs(state), formRef, tablePageOptions };
+  },
+  mounted() {
+    this.getList({ current: 1 });
+  },
+  methods: {
+    // 重置搜索条件
+    resetSearch() {
+      // this.search.book_name = "";
+      // this.search.channel_name = "";
+      // this.search.channel_id = "";
+    },
+    // 获取推广链接数据
+    async getList(page?: any) {
+      // this.loading = true;
+      // let { data } = await getPromotionList({
+      //   page: page ? page.current : 1,
+      //   ...this.search,
+      // });
+      // this.loading = false;
+      // this.list = data.list;
+    },
+    // 点击添加链接
+    onAddLink() {
+      this.addLink.channel_id = "";
+      this.addLink.channel_name = "";
+      this.addLink.book_name = "";
+      this.visible = true;
+    },
+    // 确认增加派单链接
+    async onEmitLink() {
+      this.formRef.validate().then(() => {});
+      if (!this.addLink.channel_name) return message.warn("请输入渠道名称");
+      if (!this.addLink.channel_id) return message.warn("请输入链接ID");
+      if (!this.addLink.book_name) return message.warn("请输入推广作品");
+      try {
+        await addPromotionLInk(this.addLink);
+        message.success("新增成功");
+        this.getList({ current: 1 });
+        this.visible = false;
+      } catch (err) {
+        console.log("ERROR:", err);
+      }
+    },
+    // 删除
+    async onDelete(val: any) {
+      try {
+        await deletePromotion({ channel_id: val.channel_id });
+        this.getList({ current: 1 });
+        message.success("删除成功");
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    // 点击回传配置
+    onRateConfig(val: any) {
+      this.channelId = val.channel_id;
+      this.rateVisible = true;
+      this.rate = val.rate;
+    },
+    // 提交回传配置
+    async onEmitRate() {
+      if (this.rate > 100 || this.rate < 0)
+        return message.error("回传比例应在0~100之间");
+      if (parseInt(this.rate) !== parseFloat(this.rate))
+        return message.warn("请输入整数");
+      try {
+        await updateReportConfig({
+          channel_id: this.channelId,
+          rate: this.rate,
+        });
+        message.success("修改成功");
+        this.getList({ current: 1 });
+        this.rateVisible = false;
+      } catch (err) {
+        console.log(err);
+      }
+    },
+    // 查看注册用户
+    openUserDrawer(val: any) {
+      this.channelId = val.channel_id;
+      this.drawerVisible = true;
+    },
+  },
+});
+
+export default VideoLibrary;
+</script>
+<style lang="scss" scoped>
+@import "@/assets/common-style/frame.scss";
+// .performance {
+// }
+</style>