ソースを参照

又是一次提交

xia 4 年 前
コミット
6620bc778a

+ 3 - 3
src/views/_pageOptions/table-account.ts

@@ -37,11 +37,11 @@ export const TableColumnOfAccount = [
       customRender: "rate",
     },
   },
-  {
+  /* {
     title: "操作",
     dataIndex: "operte",
     slots: {
       customRender: "operte",
-    },
-  },
+    }, 
+  },*/
 ];

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

@@ -41,14 +41,14 @@
         <p>起:{{ record.start_time }}</p>
         <p>止:{{ record.end_time }}</p>
       </template>
-      <template #operte="{ text, record }">
+      <!-- <template #operte="{ text, record }">
         <p
           v-clipboard:copy="record.fans_add_monitor_link"
           v-clipboard:success="copySuccess"
         >
           <a>复制监测链接</a>
         </p>
-      </template>
+      </template> -->
     </a-table>
   </div>
 </template>

+ 201 - 192
src/views/put/put-ad-plan.vue

@@ -52,164 +52,166 @@
         自定义列
       </a-button>
     </div>
-
-    <a-table
-      :columns="columns"
-      :data-source="list"
-      :pagination="tablePageOptions"
-      :loading="loading.value"
-      @change="handleTableChange"
-      rowKey="id"
-      bordered
-      :scroll="{ x: 'max-content', y: 700 }"
-    >
-      <template #switch="{ text, record }">
-        <a-switch
-          v-model:checked="record.enable"
-          @change="switchMethod(record)"
-        />
-      </template>
-      <template #external_url="{ text, record }">
-        <p @click="onGo(record)"><a>前往落地页链接</a></p>
-      </template>
-      <template #ad_name="{ text, record }">
-        <p>账户名:{{ record.account_name }}</p>
-        <p>广告名:{{ record.ad_name }}</p>
-        <p>广告ID:{{ record.ad_id }}</p>
-      </template>
-
-      <template #dayt="{ text, record }">
-        <a-popover title="回传配置" placement="left" trigger="click">
-          <template #content>
-            <div class="tab-list" style="width: 220px">
-              <a-tabs size="small" @change="tabChangeBack">
-                <a-tab-pane
-                  v-for="(d, i) in popForm"
-                  :key="i"
-                  :tab="d.desc"
-                ></a-tab-pane>
-              </a-tabs>
-            </div>
-            <div class="hover-content">
-              <span class="label">回传条件</span
-              ><a-select
-                style="width: 150px"
-                size="small"
-                v-model:value="popForm[currentTbs].condition"
-              >
-                <a-select-option
-                  :value="item.name"
-                  v-for="item in popForm[currentTbs].report_conditions"
+    <template v-if="showTable">
+      <a-table
+        :columns="columns"
+        :data-source="list"
+        :pagination="tablePageOptions"
+        :loading="loading.value"
+        @change="handleTableChange"
+        rowKey="id"
+        bordered
+        :scroll="{ x: 'max-content', y: scrollY }"
+      >
+        <template #switch="{ text, record }">
+          <a-switch
+            v-model:checked="record.enable"
+            @change="switchMethod(record)"
+          />
+        </template>
+        <template #external_url="{ text, record }">
+          <p @click="onGo(record)"><a>前往落地页链接</a></p>
+        </template>
+        <template #ad_name="{ text, record }">
+          <p>账户名:{{ record.account_name }}</p>
+          <p>广告名:{{ record.ad_name }}</p>
+          <p>广告ID:{{ record.ad_id }}</p>
+        </template>
+
+        <template #dayt="{ text, record }">
+          <a-popover title="回传配置" placement="left" trigger="click">
+            <template #content>
+              <div class="tab-list" style="width: 220px">
+                <a-tabs size="small" @change="tabChangeBack">
+                  <a-tab-pane
+                    v-for="(d, i) in popForm"
+                    :key="i"
+                    :tab="d.desc"
+                  ></a-tab-pane>
+                </a-tabs>
+              </div>
+              <div class="hover-content">
+                <span class="label">回传条件</span
+                ><a-select
+                  style="width: 150px"
+                  size="small"
+                  v-model:value="popForm[currentTbs].condition"
                 >
-                  {{ item.desc }}
-                </a-select-option>
-              </a-select>
-            </div>
-            <div class="hover-content">
-              <span class="label">回传开关</span>
-              <a-switch
-                v-model:checked="popForm[currentTbs].back_on"
-                checked-children="开"
-                un-checked-children="关"
-              />
-            </div>
-            <div class="hover-content">
-              <span class="label">回传比例</span
-              ><a-input
-                v-model:value="popForm[currentTbs].rate"
-                size="small"
-                style="width: 150px"
-                type="number"
-                placeholder="回传比例"
-              >
-                <template #suffix>
-                  <a-tooltip title="比例0-100">
-                    <info-circle-outlined style="color: rgba(0,0,0,.45)" />
-                  </a-tooltip>
-                </template>
-              </a-input>
-            </div>
-            <div class="hover-content">
-              <span class="label">回传平台</span
-              ><a-input
-                v-model:value="popForm[currentTbs].back_platform"
-                disabled
-                size="small"
-                style="width: 150px"
-              />
-            </div>
-            <div
-              class="hover-content"
-              v-if="popForm[currentTbs].report_type == 'recharge'"
-            >
-              <span class="label">回传付费最低金额</span
-              ><a-input
-                v-model:value="popForm[currentTbs].price"
-                size="small"
-                style="width: 150px"
-                type="number"
-                placeholder="回传付费最低金额"
-              />
-            </div>
-            <div class="hover-content">
-              <span class="label">浮动回传比例</span
-              ><a-input
-                v-model:value="popForm[currentTbs].float_rate"
-                size="small"
-                style="width: 150px"
-                type="number"
-                placeholder="浮动回传比例"
-              >
-                <template #suffix>
-                  <a-tooltip title="浮动比例小于固定回传比例">
-                    <info-circle-outlined style="color: rgba(0,0,0,.45)" />
-                  </a-tooltip>
-                </template>
-              </a-input>
-            </div>
-            <div class="footer-slot">
-              <a-popconfirm
-                title="是否要修改回传配置?"
-                ok-text="是"
-                cancel-text="否"
-                @confirm="confirmEdit"
+                  <a-select-option
+                    :value="item.name"
+                    v-for="item in popForm[currentTbs].report_conditions"
+                  >
+                    {{ item.desc }}
+                  </a-select-option>
+                </a-select>
+              </div>
+              <div class="hover-content">
+                <span class="label">回传开关</span>
+                <a-switch
+                  v-model:checked="popForm[currentTbs].back_on"
+                  checked-children="开"
+                  un-checked-children="关"
+                />
+              </div>
+              <div class="hover-content">
+                <span class="label">回传比例</span
+                ><a-input
+                  v-model:value="popForm[currentTbs].rate"
+                  size="small"
+                  style="width: 150px"
+                  type="number"
+                  placeholder="回传比例"
+                >
+                  <template #suffix>
+                    <a-tooltip title="比例0-100">
+                      <info-circle-outlined style="color: rgba(0,0,0,.45)" />
+                    </a-tooltip>
+                  </template>
+                </a-input>
+              </div>
+              <div class="hover-content">
+                <span class="label">回传平台</span
+                ><a-input
+                  v-model:value="popForm[currentTbs].back_platform"
+                  disabled
+                  size="small"
+                  style="width: 150px"
+                />
+              </div>
+              <div
+                class="hover-content"
+                v-if="popForm[currentTbs].report_type == 'recharge'"
               >
-                <a-button
-                  type="primary"
+                <span class="label">回传付费最低金额</span
+                ><a-input
+                  v-model:value="popForm[currentTbs].price"
+                  size="small"
+                  style="width: 150px"
+                  type="number"
+                  placeholder="回传付费最低金额"
+                />
+              </div>
+              <div class="hover-content">
+                <span class="label">浮动回传比例</span
+                ><a-input
+                  v-model:value="popForm[currentTbs].float_rate"
                   size="small"
-                  :disabled="!hasPopFormData"
-                  @click="editBackConfig"
+                  style="width: 150px"
+                  type="number"
+                  placeholder="浮动回传比例"
                 >
-                  修改
-                </a-button>
-              </a-popconfirm>
-            </div>
-          </template>
-          <p @click="getBackData(record)"><a>回传</a></p>
-        </a-popover>
-        <p @click="getregister(record)"><a>注册用户</a></p>
-        <p @click="getmoreLineData(record)"><a>更多数据</a></p>
-      </template>
-
-      <template #cpa_bid="{ text, record }">
-        <editable-cell
-          :text="`${text}`"
-          title="预算"
-          @change="(val) => onCellChange(record, 'cpa_bid', val)"
-        />
-      </template>
+                  <template #suffix>
+                    <a-tooltip title="浮动比例小于固定回传比例">
+                      <info-circle-outlined style="color: rgba(0,0,0,.45)" />
+                    </a-tooltip>
+                  </template>
+                </a-input>
+              </div>
+              <div class="footer-slot">
+                <a-popconfirm
+                  title="是否要修改回传配置?"
+                  ok-text="是"
+                  cancel-text="否"
+                  @confirm="confirmEdit"
+                >
+                  <a-button
+                    type="primary"
+                    size="small"
+                    :disabled="!hasPopFormData"
+                    @click="editBackConfig"
+                  >
+                    修改
+                  </a-button>
+                </a-popconfirm>
+              </div>
+            </template>
+            <p @click="getBackData(record)"><a>回传</a></p>
+          </a-popover>
+          <p @click="getregister(record)"><a>注册用户</a></p>
+          <p @click="getmoreLineData(record)"><a>更多数据</a></p>
+        </template>
+
+        <template #cpa_bid="{ text, record }">
+          <editable-cell
+            :text="`${text}`"
+            title="预算"
+            @change="(val) => onCellChange(record, 'cpa_bid', val)"
+          />
+        </template>
+
+        <template #budget="{ text, record }">
+          <editable-cell
+            :text="`${text}`"
+            title="出价"
+            @change="(val) => onCellChange(record, 'budget', val)"
+          />
+        </template>
+        <template #opertate="{ text, record }">
+          <p @click="openDrawer(record)"><a>操作日志</a></p>
+        </template>
+      </a-table>
+    </template>
 
-      <template #budget="{ text, record }">
-        <editable-cell
-          :text="`${text}`"
-          title="出价"
-          @change="(val) => onCellChange(record, 'budget', val)"
-        />
-      </template>
-      <template #opertate="{ text, record }">
-        <p @click="openDrawer(record)"><a>操作日志</a></p>
-      </template>
-    </a-table>
     <a-drawer
       title="操作日志"
       placement="right"
@@ -326,10 +328,12 @@ const PutAdPlan = defineComponent({
       innerClomuns: ref<any[]>([]),
       lineVisable: false,
       defaultToolvalue: {},
+      scrollY:600,
       visible: false,
       popconfirmShow: false,
       showPop: false,
       visible1: false,
+      showTable:false,
       registerVisable: false,
       columnShow: false,
       register: {
@@ -458,46 +462,48 @@ const PutAdPlan = defineComponent({
         "external_actions",
         "ad_create_time",
       ];
-      res.data.map((item: { desc: string; name: string;width?:number | string}) => {
-        let lolumnItem: {
-          title: string;
-          dataIndex: string;
-          slots?: any;
-          width?: string | number;
-          sorter?: boolean;
-          ellipsis?: boolean;
-        } = {
-          title: item.desc,
-          dataIndex: item.name,
-          width: item.width || 95,
-          ellipsis: true,
-        };
-
-        if (item.name == "external_url") {
-          lolumnItem.slots = { customRender: "external_url" };
-        }
-
-        if (item.name == "cpa_bid") {
-          lolumnItem.slots = { customRender: item.name };
-          lolumnItem.width = 130;
-        }
-        if (item.name == "cost") {
-          lolumnItem.sorter = true;
-           //  lolumnItem.width = 9;
+      res.data.map(
+        (item: { desc: string; name: string; width?: number | string }) => {
+          let lolumnItem: {
+            title: string;
+            dataIndex: string;
+            slots?: any;
+            width?: string | number;
+            sorter?: boolean;
+            ellipsis?: boolean;
+          } = {
+            title: item.desc,
+            dataIndex: item.name,
+            width: item.width || 95,
+            ellipsis: true,
+          };
+
+          if (item.name == "external_url") {
+            lolumnItem.slots = { customRender: "external_url" };
+          }
+
+          if (item.name == "cpa_bid") {
+            lolumnItem.slots = { customRender: item.name };
+            lolumnItem.width = 130;
+          }
+          if (item.name == "cost") {
+            lolumnItem.sorter = true;
+            //  lolumnItem.width = 9;
+          }
+          if (item.name == "budget") {
+            delete lolumnItem.width;
+          }
+          if (extendList.includes(item.name)) {
+            state.innerClomuns.push(lolumnItem);
+          }
+
+          columns.push(lolumnItem);
         }
-        if(  item.name == "budget"){
-          delete lolumnItem.width;
-        }
-        if (extendList.includes(item.name)) {
-          state.innerClomuns.push(lolumnItem);
-        }
-
-        columns.push(lolumnItem);
-      });
+      );
 
       let newColunms = columns.filter(
         (item) => !blackList.includes(item.dataIndex)
-          /* !blackList.includes(item.dataIndex) &&
+        /* !blackList.includes(item.dataIndex) &&
           !extendList.includes(item.dataIndex) */
       );
 
@@ -545,7 +551,6 @@ const PutAdPlan = defineComponent({
     };
 
     onMounted(() => {
-
       getData({
         campaign_id: route.query?.campaign_id ?? "",
         current: 1,
@@ -554,8 +559,12 @@ const PutAdPlan = defineComponent({
 
     return { ...toRefs(state), handleTableChange, onSearch, switchDate };
   },
-  mounted(){
-    console.log(this.$root)
+  mounted() {
+    console.log( document.querySelector('.ant-table-wrapper')?.getBoundingClientRect())
+    let winHeight = document.documentElement.clientHeight || document.body.clientHeight;
+    this.scrollY = winHeight - 352;
+    console.log(this.scrollY);
+    this.showTable = true;
   },
   methods: {
     moment,