Parcourir la source

一大波修改

xia il y a 4 ans
Parent
commit
9294127cea

+ 1 - 1
src/layout/index.vue

@@ -45,7 +45,7 @@
           </template>
         </a-menu>
       </a-layout-sider>
-      <a-layout-content class="web-container">
+      <a-layout-content class="web-container" ref="container" id="container">
         <router-view v-slot="{ Component }">
           <transition name="fade-transform" mode="out-in">
             <component :is="Component" />

+ 2 - 0
src/plugins/install.ts

@@ -20,6 +20,7 @@ import {
   Drawer,
   Tooltip,
   InputNumber,
+  Affix,
   Descriptions
 } from "ant-design-vue";
 
@@ -47,6 +48,7 @@ const install = (app: App<Element>) => {
     .use(Tooltip)
     .use(Popconfirm)
     .use(Form)
+    .use(Affix)
     .use(Tabs)
     .use(Input)
     .use(Button)

+ 3 - 1
src/scss/antd.scss

@@ -8,7 +8,9 @@
     margin-bottom: 0;
   }
 }
-
+.ant-table-thead .ant-table-header-column .ant-table-column-title{
+  white-space:normal;
+}
 .ant-menu-vertical > .ant-menu-item,
 .ant-menu-vertical-left > .ant-menu-item,
 .ant-menu-vertical-right > .ant-menu-item,

+ 1 - 1
src/views/_pageOptions/table-put.ts

@@ -415,7 +415,7 @@ export const TableColumnOfPutAdPlan = [
     fixed: "left",
     title: "",
     dataIndex: "check",
-    width: 120,
+    width: 80,
     slots: {
       customRender: "switch",
     },

+ 1 - 1
src/views/account/account.vue

@@ -23,7 +23,7 @@
       :loading="loading"
       :pagination="tablePageOptions"
       :columns="columns"
-      :scroll="{ y: true }"
+      :scroll="{ y: 600 }"
       bordered
       :data-source="list"
       @change="onLoadOfficials"

+ 25 - 28
src/views/financial/index.vue

@@ -15,24 +15,24 @@
         />
       </template>
     </tool-bar>
-    <a-table :columns="columns" :data-source="list" :scroll="{ x: 1500,y:600 }" @change="handleTableChange" bordered>
-      <template #advertiser="{ text, record }">
-        <p>
-         账户名:{{ record.advertiser_name }}
-        </p>
-        <p>
-          账户ID:{{ record.advertiser_id }}
-        </p>
-      </template>
-      <template #agent="{ text, record }">
-        <p>
-          代理商名:{{ record.agent_name }}
-        </p>
-        <p>
-         代理商Id:{{ record.agent_id }}
-        </p>
-      </template>
-    </a-table>
+
+        <a-table
+          :columns="columns"
+          :data-source="list"
+          :scroll="{ x: 1500, y: 600 }"
+          @change="handleTableChange"
+          bordered
+        >
+          <template #advertiser="{ text, record }">
+            <p>账户名:{{ record.advertiser_name }}</p>
+            <p>账户ID:{{ record.advertiser_id }}</p>
+          </template>
+          <template #agent="{ text, record }">
+            <p>代理商名:{{ record.agent_name }}</p>
+            <p>代理商Id:{{ record.agent_id }}</p>
+          </template>
+        </a-table>
+
   </div>
 </template>
 
@@ -50,11 +50,9 @@ import ToolBar from "@/components/tool-bar/index.vue";
 import usePagination from "@/hooks/usePagination";
 import { getFinanceList } from "@/api";
 import { picker } from "@/helper/config/range";
-import { PageOptions,FinanceData} from "@/types/api";
+import { PageOptions, FinanceData } from "@/types/api";
 import moment from "moment";
-import {
-  TableColumnOfFinancial
-} from "../_pageOptions/table_financial";
+import { TableColumnOfFinancial } from "../_pageOptions/table_financial";
 
 const Finance = defineComponent({
   components: {
@@ -67,17 +65,17 @@ const Finance = defineComponent({
       inSearching: false,
       open: false,
       inConfirm: false,
-      list:ref<FinanceData[]>([]),
+      list: ref<FinanceData[]>([]),
       rangePick: picker,
       pickered: [moment().subtract(30, "d"), moment()],
       columns: TableColumnOfFinancial,
     });
 
     const onSearch = (fields: Record<string, string>) => {
-      getData({current: 1 });
+      getData({ current: 1 });
     };
 
-    const getData = async (query?: { current: number}) => {
+    const getData = async (query?: { current: number }) => {
       try {
         loading.value = true;
         let [begin_dates, end_dates] = state.pickered;
@@ -97,7 +95,6 @@ const Finance = defineComponent({
       }
     };
 
-
     const handleTableChange = (pagination: PageOptions) => {
       const { current, pageSize, total } = pagination;
       getData({ current: current });
@@ -110,11 +107,11 @@ const Finance = defineComponent({
       loading,
       tablePageOptions,
       onSearch,
-      handleTableChange
+      handleTableChange,
     };
   },
   methods: {
-      moment,
+    moment,
   },
 });
 

+ 2 - 0
src/views/put/ad-countdata.vue

@@ -15,6 +15,7 @@
         />
       </template>
     </tool-bar>
+
     <a-table
       :columns="columns"
       :data-source="list"
@@ -49,6 +50,7 @@
         />
       </template>
     </a-table>
+  
   </div>
 </template>
 <script lang="ts">

+ 3 - 1
src/views/put/ad-group.vue

@@ -16,6 +16,7 @@
         />
       </template>
     </tool-bar>
+
     <a-table
       :columns="columns"
       :data-source="list"
@@ -37,6 +38,7 @@
         />
       </template>
     </a-table>
+ 
   </div>
 </template>
 <script lang="ts">
@@ -160,7 +162,7 @@ const Adgroup = defineComponent({
     const goAdlgroup = (id: string, campaign_id: string) => {
       router.push({
         path: "/put/datas/ad-plan",
-        query: { advertiser_id: id, campaign_id },
+        query: { campaign_id },
       });
     };
     return {

+ 3 - 2
src/views/put/ad_datas.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="mian-contant">
+  <div class="main-contant">
     <div>
       <a-tabs default-active-key="1" @change="changeTab" v-model:activeKey="defaultKey">
         <a-tab-pane key="PutAdAcountL" tab="广告账户数据"> </a-tab-pane>
@@ -18,12 +18,13 @@ import { defineComponent,reactive,toRefs } from "vue";
 import { onBeforeRouteUpdate } from "vue-router";
 
 const PutDataIndex = defineComponent({
-  setup() {
+  setup(props,context) {
     const {  route,router } = useApp();
     const state = reactive({
       defaultKey:route.name
     })
     const changeTab = (key:string) => {
+      console.log(context)
       router.replace({name:key})
     };
     onBeforeRouteUpdate((to) => {

+ 2 - 2
src/views/put/put-ad-account.vue

@@ -2,7 +2,7 @@
   <div class="page-wrap page-wrap-put-books">
     <tool-bar
       :text="['email', 'account_id', 'account_name']"
-      :label="['邮箱', '账户ID', '用户名']"
+      :label="['邮箱', '账户名/ID', '用户名']"
       v-model:loading="inSearching"
       @confirm="onSearch"
     >
@@ -19,7 +19,7 @@
       :loading="loading.value"
       bordered
       @change="handleTableChange"
-      :scroll="{y: true }"
+      :scroll="{y: 600 }"
       rowKey="id"
     >
     </a-table>

+ 35 - 39
src/views/put/put-ad-plan.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="page-wrap page-wrap-account">
+    <a-button @click="getTest"> 测试啊</a-button>
     <tool-bar
       :text="['ad_id', 'advertiser_id', 'campaign_id']"
-      :label="['计划ID', '账号', '广告组名称']"
+      :label="['计划名/ID', '账号名/ID', '广告组名称/ID']"
       :defaultVal="defaultToolvalue"
       v-model:loading="inSearching"
       @confirm="onSearch"
@@ -45,6 +46,7 @@
         回本数据
       </a-button>
     </div>
+
     <a-table
       :columns="columns"
       :data-source="list"
@@ -53,7 +55,7 @@
       @change="handleTableChange"
       rowKey="id"
       bordered
-      :scroll="{ x: 1800,y:700 }"
+      :scroll="{ x: 1800, y: 700 }"
     >
       <template #switch="{ text, record }">
         <a-switch
@@ -204,7 +206,7 @@
     </a-table>
     <a-drawer
       title="操作日志"
-      placement="right" 
+      placement="right"
       :closable="false"
       v-model:visible="visible"
     >
@@ -229,13 +231,13 @@
       :closable="false"
       v-model:visible="lineVisable"
     >
-     <a-descriptions bordered title="扩展数据" size="small">
-         <a-descriptions-item :label="item.title" v-for="item in innerClomuns">
-           {{temData[item.dataIndex]}}
-         </a-descriptions-item>
-       </a-descriptions>
+      <a-descriptions bordered title="扩展数据" size="small">
+        <a-descriptions-item :label="item.title" v-for="item in innerClomuns">
+          {{ temData[item.dataIndex] }}
+        </a-descriptions-item>
+      </a-descriptions>
     </a-drawer>
-    
+
     <a-drawer
       title="注册用户"
       placement="right"
@@ -251,7 +253,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, reactive, toRefs, ref, unref,onMounted } from "vue";
+import { defineComponent, reactive, toRefs, ref, unref, onMounted } from "vue";
 import moment from "moment";
 import ToolBar from "@/components/tool-bar/index.vue";
 import PutData from "@/views/put/put-log.vue";
@@ -290,11 +292,11 @@ const PutAdPlan = defineComponent({
     InfoCircleOutlined,
     RegisterDatad,
   },
+
   setup() {
     let { loading, meta, tablePageOptions } = usePagination();
     const { router, route } = useApp();
 
-
     let list: any[] = [],
       opList: any[] = [],
       stList: any = [];
@@ -308,7 +310,7 @@ const PutAdPlan = defineComponent({
       picker: [],
       currentId: "",
       innerClomuns: ref<any[]>([]),
-      lineVisable:false,
+      lineVisable: false,
       defaultToolvalue: {},
       visible: false,
       popconfirmShow: false,
@@ -322,7 +324,7 @@ const PutAdPlan = defineComponent({
       pickerFilter: [moment(), moment()],
       tablePageOptions,
       columns: list,
-      temData:{},
+      temData: {},
       backData: {
         ids: "",
         begin_date: "",
@@ -342,6 +344,7 @@ const PutAdPlan = defineComponent({
           float_rate: 0,
         },
       ],
+      isInit: false,
       cost_order: 0,
       optionList: opList,
       statsList: stList,
@@ -353,13 +356,11 @@ const PutAdPlan = defineComponent({
 
     if (route.query && route.query.advertiser_id) {
       state.defaultToolvalue = {
-        advertiser_id: route.query.advertiser_id,
         campaign_id: route.query.campaign_id,
       };
       state.fields = {
-        advertiser_id: route.query.advertiser_id,
         campaign_id: route.query.campaign_id,
-      }
+      };
     }
 
     getAddStatus().then((res) => {
@@ -369,13 +370,13 @@ const PutAdPlan = defineComponent({
       });
       state.optionList = res.data;
     });
+
     const onSearch = async (fields: Record<string, string>) => {
       try {
-        const { ad_id, advertiser_id, campaign_id, status } = fields;
+        const { ad_id, campaign_id, status } = fields;
         state.fields = fields;
         const data = {
           ad_id,
-          advertiser_id,
           status: state.currentSelect,
           campaign_id,
           page: 1,
@@ -440,8 +441,8 @@ const PutAdPlan = defineComponent({
         "inventory_type",
         "convert_id",
         "external_actions",
-        "ad_create_time"
-      ]
+        "ad_create_time",
+      ];
       res.data.map((item: { desc: string; name: string }) => {
         let lolumnItem: {
           title: string;
@@ -449,35 +450,38 @@ const PutAdPlan = defineComponent({
           slots?: any;
           width?: string | number;
           sorter?: boolean;
-          ellipsis?:boolean;
+          ellipsis?: boolean;
         } = {
           title: item.desc,
           dataIndex: item.name,
-          width: 120,
+          width: 95,
           ellipsis: true,
         };
 
         if (item.name == "external_url") {
           lolumnItem.slots = { customRender: "external_url" };
         }
+
         if (item.name == "cpa_bid" || item.name == "budget") {
           lolumnItem.slots = { customRender: item.name };
+          lolumnItem.width = 130;
         }
         if (item.name == "cost") {
           lolumnItem.sorter = true;
         }
-        if(extendList.includes(item.name)){
-          state.innerClomuns.push(lolumnItem)
+        if (extendList.includes(item.name)) {
+          state.innerClomuns.push(lolumnItem);
         }
 
         columns.push(lolumnItem);
       });
 
-
       let newColunms = columns.filter(
-        (item) => !blackList.includes(item.dataIndex) && !extendList.includes(item.dataIndex)
+        (item) =>
+          !blackList.includes(item.dataIndex) &&
+          !extendList.includes(item.dataIndex)
       );
-    
+
       state.columns = [];
       state.columns.push(...state.defaultColumns);
       state.columns.push(...newColunms);
@@ -494,7 +498,6 @@ const PutAdPlan = defineComponent({
         slots: { customRender: "dayt" },
         width: 100,
       });
-      
     });
 
     const setSateSwitch = (val: string, name: string) => {
@@ -510,29 +513,25 @@ const PutAdPlan = defineComponent({
       }
     };
 
-
-
     const handleTableChange = (
       pagination: PageOptions,
       filters: any,
       sorter: any
     ) => {
-       if (sorter.columnKey == "cost") {
+      if (sorter.columnKey == "cost") {
         setSateSwitch(sorter.order, "cost_order");
       }
       const { current, pageSize, total } = pagination;
       getData({ page: current });
     };
 
-
     onMounted(() => {
       getData({
-        advertiser_id: route.query?.advertiser_id ?? "",
         campaign_id: route.query?.campaign_id ?? "",
         current: 1,
       });
     });
-    
+
     return { ...toRefs(state), handleTableChange, onSearch, switchDate };
   },
   methods: {
@@ -540,6 +539,7 @@ const PutAdPlan = defineComponent({
     onGo(record: any) {
       window.open(record.external_url);
     },
+    getTest() {},
     openDrawer(record: any) {
       this.visible = true;
       this.currentId = record.ad_id;
@@ -555,7 +555,7 @@ const PutAdPlan = defineComponent({
         this.popconfirmShow = true;
       }
     },
-    getmoreLineData(record:any){
+    getmoreLineData(record: any) {
       this.lineVisable = true;
       this.temData = record;
     },
@@ -635,10 +635,6 @@ const PutAdPlan = defineComponent({
       this.backData.field = this.currentStats;
       this.visible1 = true;
     },
-    handleClickChange() {
-      console.log(this.showPop);
-    },
-    backPost() {},
     getBackData(record: any) {
       getAdBackPlan({
         ad_lid: record.id,

+ 3 - 1
src/views/put/put-data.vue

@@ -30,14 +30,16 @@
         修改天数
       </a-button>
     </div>
+
     <a-table
       :columns="columns"
       :data-source="list"
-      :scroll="{ x: true,y:true }"
+      :scroll="{ x: 1200,y:600 }"
       @change="handleTableChange"
       bordered
     >
     </a-table>
+
   </div>
 </template>