|
@@ -181,6 +181,26 @@
|
|
|
优惠券
|
|
优惠券
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <span style="margin: 5px;">
|
|
|
|
|
+ <a-tag v-if="record.enable_sync_revenue" size="small" bordered color="blue"
|
|
|
|
|
+ @click="changeAttr(record.id, 'enable_sync_revenue', false)">
|
|
|
|
|
+ 同步收益
|
|
|
|
|
+ </a-tag>
|
|
|
|
|
+ <a-tag v-else size="small" bordered color=""
|
|
|
|
|
+ @click="changeAttr(record.id, 'enable_sync_revenue', true)">
|
|
|
|
|
+ 同步收益
|
|
|
|
|
+ </a-tag>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span style="margin: 5px;">
|
|
|
|
|
+ <a-tag v-if="record.enable_sync_order" size="small" bordered color="blue"
|
|
|
|
|
+ @click="changeAttr(record.id, 'enable_sync_order', false)">
|
|
|
|
|
+ 同步订单
|
|
|
|
|
+ </a-tag>
|
|
|
|
|
+ <a-tag v-else size="small" bordered color=""
|
|
|
|
|
+ @click="changeAttr(record.id, 'enable_sync_order', true)">
|
|
|
|
|
+ 同步订单
|
|
|
|
|
+ </a-tag>
|
|
|
|
|
+ </span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #time="{ record }">
|
|
<template #time="{ record }">
|
|
|
<div style="color:gray;">
|
|
<div style="color:gray;">
|
|
@@ -190,6 +210,11 @@
|
|
|
登录:{{ dayjs(record.login_time).format('MM-DD HH:mm') }}</div>
|
|
登录:{{ dayjs(record.login_time).format('MM-DD HH:mm') }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
|
+ <a-button type="text" size="small" @click="openCookieModal(record)">
|
|
|
|
|
+ 更新cookie
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ </template>
|
|
|
<template #summary-cell="{ column, record }">
|
|
<template #summary-cell="{ column, record }">
|
|
|
<div style="margin:10px auto" v-if="column.slotName == 'hourly_calls_limit'">
|
|
<div style="margin:10px auto" v-if="column.slotName == 'hourly_calls_limit'">
|
|
|
{{ numberFormat(record.current_hourly_calls) }}
|
|
{{ numberFormat(record.current_hourly_calls) }}
|
|
@@ -240,6 +265,29 @@
|
|
|
|
|
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Cookie 更新 Modal -->
|
|
|
|
|
+ <a-modal
|
|
|
|
|
+ v-model:visible="cookieModalVisible"
|
|
|
|
|
+ title="更新Cookie"
|
|
|
|
|
+ @ok="handleCookieUpdate"
|
|
|
|
|
+ @cancel="handleCookieCancel"
|
|
|
|
|
+ :confirm-loading="cookieLoading"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-form ref="cookieFormRef" :model="cookieFormData">
|
|
|
|
|
+ <a-form-item
|
|
|
|
|
+ field="cookie"
|
|
|
|
|
+ label="Cookie"
|
|
|
|
|
+ :rules="[{ required: true, message: '请输入Cookie' }]"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-textarea
|
|
|
|
|
+ v-model="cookieFormData.cookie"
|
|
|
|
|
+ placeholder="请粘贴Cookie内容"
|
|
|
|
|
+ :auto-size="{ minRows: 10, maxRows: 20 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-form>
|
|
|
|
|
+ </a-modal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -249,11 +297,12 @@ import { computed, ref, reactive, watch, nextTick } from 'vue';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
import useLoading from '@/hooks/loading';
|
|
import useLoading from '@/hooks/loading';
|
|
|
-import { queryPddPool, PddPoolRecord, PddPoolParams, PddUpdateAccountModel, PddUpdateAccount } from '@/api/pdd';
|
|
|
|
|
|
|
+import { queryPddPool, PddPoolRecord, PddPoolParams, PddUpdateAccountModel, PddUpdateAccount, UpdateCookieWithIdModel, updateCookiesWithId } from '@/api/pdd';
|
|
|
import { Pagination } from '@/types/global';
|
|
import { Pagination } from '@/types/global';
|
|
|
import { Modal, Message } from '@arco-design/web-vue';
|
|
import { Modal, Message } from '@arco-design/web-vue';
|
|
|
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
|
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
|
|
|
+import { FormInstance } from '@arco-design/web-vue/es/form';
|
|
|
import cloneDeep from 'lodash/cloneDeep';
|
|
import cloneDeep from 'lodash/cloneDeep';
|
|
|
import Sortable from 'sortablejs';
|
|
import Sortable from 'sortablejs';
|
|
|
import { numberFormat, amountFormat } from '@/utils/util';
|
|
import { numberFormat, amountFormat } from '@/utils/util';
|
|
@@ -285,6 +334,16 @@ const showColumns = ref<Column[]>([]);
|
|
|
|
|
|
|
|
const size = ref<SizeProps>('small');
|
|
const size = ref<SizeProps>('small');
|
|
|
|
|
|
|
|
|
|
+// Cookie modal related data
|
|
|
|
|
+const cookieModalVisible = ref(false);
|
|
|
|
|
+const cookieLoading = ref(false);
|
|
|
|
|
+const cookieFormRef = ref<FormInstance>();
|
|
|
|
|
+const cookieFormData = ref<UpdateCookieWithIdModel>({
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ cookie: '',
|
|
|
|
|
+});
|
|
|
|
|
+const currentRecord = ref<PddPoolRecord | null>(null);
|
|
|
|
|
+
|
|
|
const basePagination: Pagination = {
|
|
const basePagination: Pagination = {
|
|
|
current: 1,
|
|
current: 1,
|
|
|
pageSize: 500,
|
|
pageSize: 500,
|
|
@@ -377,6 +436,11 @@ const columns = computed<TableColumnData[]>(() => [
|
|
|
slotName: 'time',
|
|
slotName: 'time',
|
|
|
width: 170,
|
|
width: 170,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '操作',
|
|
|
|
|
+ slotName: 'action',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ },
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
const statusOptions = computed<SelectOptionData[]>(() => [
|
|
const statusOptions = computed<SelectOptionData[]>(() => [
|
|
@@ -578,6 +642,48 @@ const popupVisibleChange = (val: boolean) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// Cookie modal methods
|
|
|
|
|
+const openCookieModal = (record: PddPoolRecord) => {
|
|
|
|
|
+ currentRecord.value = record;
|
|
|
|
|
+ cookieFormData.value = {
|
|
|
|
|
+ id: record.id,
|
|
|
|
|
+ cookie: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ cookieModalVisible.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleCookieUpdate = async () => {
|
|
|
|
|
+ const res = await cookieFormRef.value?.validate();
|
|
|
|
|
+ if (!res) {
|
|
|
|
|
+ cookieLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { data } = await updateCookiesWithId(cookieFormData.value);
|
|
|
|
|
+ const msg = data.msg || '更新成功!';
|
|
|
|
|
+ if (data.success) {
|
|
|
|
|
+ Message.success(msg);
|
|
|
|
|
+ cookieModalVisible.value = false;
|
|
|
|
|
+ fetchData(); // 刷新列表
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Message.error(data.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ Message.error('更新失败');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ cookieLoading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleCookieCancel = () => {
|
|
|
|
|
+ cookieModalVisible.value = false;
|
|
|
|
|
+ cookieFormData.value = {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ cookie: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ cookieFormRef.value?.resetFields();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
watch(
|
|
watch(
|
|
|
() => columns.value,
|
|
() => columns.value,
|
|
|
(val) => {
|
|
(val) => {
|