|
@@ -4,44 +4,23 @@
|
|
|
<a-card class="general-card" :title="$t('menu.taobao.list')">
|
|
<a-card class="general-card" :title="$t('menu.taobao.list')">
|
|
|
<a-row>
|
|
<a-row>
|
|
|
<a-col :flex="1">
|
|
<a-col :flex="1">
|
|
|
- <a-form
|
|
|
|
|
- :model="formModel"
|
|
|
|
|
- :label-col-props="{ span: 6 }"
|
|
|
|
|
- :wrapper-col-props="{ span: 18 }"
|
|
|
|
|
- label-align="left"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-form :model="formModel" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
|
|
|
|
|
+ label-align="left">
|
|
|
<a-row :gutter="16">
|
|
<a-row :gutter="16">
|
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
|
<a-form-item field="name" label="账号名">
|
|
<a-form-item field="name" label="账号名">
|
|
|
- <a-input
|
|
|
|
|
- v-model="formModel.name"
|
|
|
|
|
- placeholder="输入关键词搜索"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-input v-model="formModel.name" placeholder="输入关键词搜索" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
|
- <a-form-item
|
|
|
|
|
- field="lastTime"
|
|
|
|
|
- :label="$t('searchTable.form.lastTime')"
|
|
|
|
|
- >
|
|
|
|
|
- <a-range-picker
|
|
|
|
|
- v-model="formModel.lastTime"
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-form-item field="lastTime" :label="$t('searchTable.form.lastTime')">
|
|
|
|
|
+ <a-range-picker v-model="formModel.lastTime" style="width: 100%" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
|
- <a-form-item
|
|
|
|
|
- field="status"
|
|
|
|
|
- :label="$t('searchTable.form.status')"
|
|
|
|
|
- >
|
|
|
|
|
- <a-select
|
|
|
|
|
- v-model="formModel.status"
|
|
|
|
|
- :options="statusOptions"
|
|
|
|
|
- :placeholder="
|
|
|
|
|
- $t('searchTable.form.selectDefault')
|
|
|
|
|
- "
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-form-item field="status" :label="$t('searchTable.form.status')">
|
|
|
|
|
+ <a-select v-model="formModel.status" :options="statusOptions" :placeholder="$t('searchTable.form.selectDefault')
|
|
|
|
|
+ " />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
@@ -71,73 +50,45 @@
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
- <a-col
|
|
|
|
|
- :span="12"
|
|
|
|
|
- style="
|
|
|
|
|
|
|
+ <a-col :span="12" style="
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: end;
|
|
justify-content: end;
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ">
|
|
|
<a-tooltip :content="$t('searchTable.actions.refresh')">
|
|
<a-tooltip :content="$t('searchTable.actions.refresh')">
|
|
|
- <div class="action-icon" @click="search"
|
|
|
|
|
- ><icon-refresh size="18"
|
|
|
|
|
- /></div>
|
|
|
|
|
|
|
+ <div class="action-icon" @click="search"><icon-refresh size="18" /></div>
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
<a-dropdown @select="handleSelectDensity">
|
|
<a-dropdown @select="handleSelectDensity">
|
|
|
<a-tooltip :content="$t('searchTable.actions.density')">
|
|
<a-tooltip :content="$t('searchTable.actions.density')">
|
|
|
- <div class="action-icon"
|
|
|
|
|
- ><icon-line-height size="18"
|
|
|
|
|
- /></div>
|
|
|
|
|
|
|
+ <div class="action-icon"><icon-line-height size="18" /></div>
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
<template #content>
|
|
<template #content>
|
|
|
- <a-doption
|
|
|
|
|
- v-for="item in densityList"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- :class="{ active: item.value === size }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-doption v-for="item in densityList" :key="item.value" :value="item.value"
|
|
|
|
|
+ :class="{ active: item.value === size }">
|
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.name }}</span>
|
|
|
</a-doption>
|
|
</a-doption>
|
|
|
</template>
|
|
</template>
|
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
|
- <a-tooltip
|
|
|
|
|
- :content="$t('searchTable.actions.columnSetting')"
|
|
|
|
|
- >
|
|
|
|
|
- <a-popover
|
|
|
|
|
- trigger="click"
|
|
|
|
|
- position="bl"
|
|
|
|
|
- @popup-visible-change="popupVisibleChange"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="action-icon"
|
|
|
|
|
- ><icon-settings size="18"
|
|
|
|
|
- /></div>
|
|
|
|
|
|
|
+ <a-tooltip :content="$t('searchTable.actions.columnSetting')">
|
|
|
|
|
+ <a-popover trigger="click" position="bl" @popup-visible-change="popupVisibleChange">
|
|
|
|
|
+ <div class="action-icon"><icon-settings size="18" /></div>
|
|
|
<template #content>
|
|
<template #content>
|
|
|
<div id="tableSetting">
|
|
<div id="tableSetting">
|
|
|
- <div
|
|
|
|
|
- v-for="(item, index) in showColumns"
|
|
|
|
|
- :key="item.dataIndex"
|
|
|
|
|
- class="setting"
|
|
|
|
|
- >
|
|
|
|
|
- <div
|
|
|
|
|
- style="
|
|
|
|
|
|
|
+ <div v-for="(item, index) in showColumns" :key="item.dataIndex" class="setting">
|
|
|
|
|
+ <div style="
|
|
|
margin-right: 4px;
|
|
margin-right: 4px;
|
|
|
cursor: move;
|
|
cursor: move;
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ">
|
|
|
<icon-drag-arrow />
|
|
<icon-drag-arrow />
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <a-checkbox
|
|
|
|
|
- v-model="item.checked"
|
|
|
|
|
- @change="
|
|
|
|
|
- handleChange(
|
|
|
|
|
- $event,
|
|
|
|
|
- item as TableColumnData,
|
|
|
|
|
- index
|
|
|
|
|
- )
|
|
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-checkbox v-model="item.checked" @change="
|
|
|
|
|
+ handleChange(
|
|
|
|
|
+ $event,
|
|
|
|
|
+ item as TableColumnData,
|
|
|
|
|
+ index
|
|
|
|
|
+ )
|
|
|
|
|
+ ">
|
|
|
</a-checkbox>
|
|
</a-checkbox>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="title">
|
|
<div class="title">
|
|
@@ -155,57 +106,36 @@
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
|
|
|
|
|
- <a-table
|
|
|
|
|
- row-key="id"
|
|
|
|
|
- :loading="loading"
|
|
|
|
|
- :pagination="pagination"
|
|
|
|
|
- :columns="(cloneColumns as TableColumnData[])"
|
|
|
|
|
- :data="renderData"
|
|
|
|
|
- :bordered="false"
|
|
|
|
|
- :size="size"
|
|
|
|
|
- @page-change="onPageChange"
|
|
|
|
|
- >
|
|
|
|
|
- <template #index="{ rowIndex }">
|
|
|
|
|
- {{
|
|
|
|
|
- rowIndex +
|
|
|
|
|
- 1 +
|
|
|
|
|
- (pagination.current - 1) * pagination.pageSize
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ <a-table row-key="id" :loading="loading" :pagination="pagination"
|
|
|
|
|
+ :columns="(cloneColumns as TableColumnData[])" :data="renderData" :bordered="false" :size="size"
|
|
|
|
|
+ @page-change="onPageChange">
|
|
|
|
|
+ <template #index="{ record }">
|
|
|
|
|
+ {{ record.id }}
|
|
|
</template>
|
|
</template>
|
|
|
<template #name="{ record }">
|
|
<template #name="{ record }">
|
|
|
- <a-list-item-meta
|
|
|
|
|
- :title="record.name"
|
|
|
|
|
- :description="record.description"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-list-item-meta :title="record.company" :description="record.description" />
|
|
|
</template>
|
|
</template>
|
|
|
<template #daily_income_limit="{ record }">
|
|
<template #daily_income_limit="{ record }">
|
|
|
- <a-tag
|
|
|
|
|
- bordered
|
|
|
|
|
- :color="
|
|
|
|
|
- record.current_amt > record.daily_income_limit &&
|
|
|
|
|
- record.daily_income_limit > 0
|
|
|
|
|
- ? 'red'
|
|
|
|
|
- : ''
|
|
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-tag bordered :color="record.current_amt > record.daily_income_limit &&
|
|
|
|
|
+ record.daily_income_limit > 0
|
|
|
|
|
+ ? 'red'
|
|
|
|
|
+ : ''
|
|
|
|
|
+ ">
|
|
|
{{ record.current_amt }} /
|
|
{{ record.current_amt }} /
|
|
|
{{ record.daily_income_limit }}
|
|
{{ record.daily_income_limit }}
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
<template #status="{ record }">
|
|
<template #status="{ record }">
|
|
|
- <a-tag v-if="record.status" bordered color="green"
|
|
|
|
|
- >在线</a-tag
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-tag v-if="record.status" bordered color="green">在线</a-tag>
|
|
|
<a-tag v-else bordered color="">下线</a-tag>
|
|
<a-tag v-else bordered color="">下线</a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
<template #operations="{ record }">
|
|
<template #operations="{ record }">
|
|
|
- <a-button
|
|
|
|
|
- type="text"
|
|
|
|
|
- size="small"
|
|
|
|
|
- @click="changeItem(record)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-button type="text" size="small" @click="changeItem(record)">
|
|
|
更新
|
|
更新
|
|
|
</a-button>
|
|
</a-button>
|
|
|
|
|
+ <a-button type="text" size="small" @click="billView(record)">
|
|
|
|
|
+ 预计收益
|
|
|
|
|
+ </a-button>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</a-card>
|
|
</a-card>
|
|
@@ -213,279 +143,283 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
- import { useRouter } from 'vue-router';
|
|
|
|
|
- import { computed, ref, reactive, watch, nextTick } from 'vue';
|
|
|
|
|
- import { useI18n } from 'vue-i18n';
|
|
|
|
|
- import useLoading from '@/hooks/loading';
|
|
|
|
|
- import { queryTkPool, TkPoolRecord, TkPoolParams } from '@/api/taobao';
|
|
|
|
|
- import { Pagination } from '@/types/global';
|
|
|
|
|
- import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
|
|
|
- import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
|
|
|
- import cloneDeep from 'lodash/cloneDeep';
|
|
|
|
|
- import Sortable from 'sortablejs';
|
|
|
|
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
+import { computed, ref, reactive, watch, nextTick } from 'vue';
|
|
|
|
|
+import { useI18n } from 'vue-i18n';
|
|
|
|
|
+import useLoading from '@/hooks/loading';
|
|
|
|
|
+import { queryTkPool, TkPoolRecord, TkPoolParams } from '@/api/taobao';
|
|
|
|
|
+import { Pagination } from '@/types/global';
|
|
|
|
|
+import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
|
|
|
+import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
|
|
|
+import cloneDeep from 'lodash/cloneDeep';
|
|
|
|
|
+import Sortable from 'sortablejs';
|
|
|
|
|
|
|
|
- type SizeProps = 'mini' | 'small' | 'medium' | 'large';
|
|
|
|
|
- type Column = TableColumnData & { checked?: true };
|
|
|
|
|
|
|
+type SizeProps = 'mini' | 'small' | 'medium' | 'large';
|
|
|
|
|
+type Column = TableColumnData & { checked?: true };
|
|
|
|
|
|
|
|
- const generateFormModel = () => {
|
|
|
|
|
- return {
|
|
|
|
|
- name: '',
|
|
|
|
|
- lastTime: [],
|
|
|
|
|
- status: '',
|
|
|
|
|
- sort: 'status',
|
|
|
|
|
- order: 'descending',
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const generateFormModel = () => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ lastTime: [],
|
|
|
|
|
+ status: '',
|
|
|
|
|
+ sort: 'status',
|
|
|
|
|
+ order: 'descending',
|
|
|
};
|
|
};
|
|
|
- const router = useRouter();
|
|
|
|
|
|
|
+};
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
|
|
|
- const { loading, setLoading } = useLoading(true);
|
|
|
|
|
- const { t } = useI18n();
|
|
|
|
|
- const renderData = ref<TkPoolRecord[]>([]);
|
|
|
|
|
- const formModel = ref(generateFormModel());
|
|
|
|
|
- const cloneColumns = ref<Column[]>([]);
|
|
|
|
|
- const showColumns = ref<Column[]>([]);
|
|
|
|
|
|
|
+const { loading, setLoading } = useLoading(true);
|
|
|
|
|
+const { t } = useI18n();
|
|
|
|
|
+const renderData = ref<TkPoolRecord[]>([]);
|
|
|
|
|
+const formModel = ref(generateFormModel());
|
|
|
|
|
+const cloneColumns = ref<Column[]>([]);
|
|
|
|
|
+const showColumns = ref<Column[]>([]);
|
|
|
|
|
|
|
|
- const size = ref<SizeProps>('medium');
|
|
|
|
|
|
|
+const size = ref<SizeProps>('medium');
|
|
|
|
|
|
|
|
- const basePagination: Pagination = {
|
|
|
|
|
- current: 1,
|
|
|
|
|
- pageSize: 20,
|
|
|
|
|
- };
|
|
|
|
|
- const pagination = reactive({
|
|
|
|
|
- ...basePagination,
|
|
|
|
|
- });
|
|
|
|
|
- const densityList = computed(() => [
|
|
|
|
|
- {
|
|
|
|
|
- name: t('searchTable.size.mini'),
|
|
|
|
|
- value: 'mini',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: t('searchTable.size.small'),
|
|
|
|
|
- value: 'small',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: t('searchTable.size.medium'),
|
|
|
|
|
- value: 'medium',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: t('searchTable.size.large'),
|
|
|
|
|
- value: 'large',
|
|
|
|
|
- },
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+const basePagination: Pagination = {
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
|
+};
|
|
|
|
|
+const pagination = reactive({
|
|
|
|
|
+ ...basePagination,
|
|
|
|
|
+});
|
|
|
|
|
+const densityList = computed(() => [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: t('searchTable.size.mini'),
|
|
|
|
|
+ value: 'mini',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: t('searchTable.size.small'),
|
|
|
|
|
+ value: 'small',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: t('searchTable.size.medium'),
|
|
|
|
|
+ value: 'medium',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: t('searchTable.size.large'),
|
|
|
|
|
+ value: 'large',
|
|
|
|
|
+ },
|
|
|
|
|
+]);
|
|
|
|
|
|
|
|
- const columns = computed<TableColumnData[]>(() => [
|
|
|
|
|
- {
|
|
|
|
|
- title: '#',
|
|
|
|
|
- dataIndex: 'index',
|
|
|
|
|
- slotName: 'index',
|
|
|
|
|
- width: 50,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '账号名',
|
|
|
|
|
- dataIndex: 'name',
|
|
|
|
|
- slotName: 'name',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '创建时间',
|
|
|
|
|
- dataIndex: 'create_time',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '最后更新',
|
|
|
|
|
- dataIndex: 'last_time',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '每日收益限额',
|
|
|
|
|
- dataIndex: 'daily_income_limit',
|
|
|
|
|
- slotName: 'daily_income_limit',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '可提现余额',
|
|
|
|
|
- dataIndex: 'draw_balance',
|
|
|
|
|
- slotName: 'draw_balance',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '运行节点',
|
|
|
|
|
- dataIndex: 'nodeName',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '状态',
|
|
|
|
|
- dataIndex: 'status',
|
|
|
|
|
- slotName: 'status',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: '操作',
|
|
|
|
|
- dataIndex: 'operations',
|
|
|
|
|
- slotName: 'operations',
|
|
|
|
|
- },
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+const columns = computed<TableColumnData[]>(() => [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '#',
|
|
|
|
|
+ dataIndex: 'index',
|
|
|
|
|
+ slotName: 'index',
|
|
|
|
|
+ width: 50,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '账号名',
|
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
|
+ slotName: 'name',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '创建时间',
|
|
|
|
|
+ dataIndex: 'create_time',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '最后更新',
|
|
|
|
|
+ dataIndex: 'last_time',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '每日收益限额',
|
|
|
|
|
+ dataIndex: 'daily_income_limit',
|
|
|
|
|
+ slotName: 'daily_income_limit',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '可提现余额',
|
|
|
|
|
+ dataIndex: 'draw_balance',
|
|
|
|
|
+ slotName: 'draw_balance',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '运行节点',
|
|
|
|
|
+ dataIndex: 'nodeName',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '状态',
|
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
|
+ slotName: 'status',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '操作',
|
|
|
|
|
+ dataIndex: 'operations',
|
|
|
|
|
+ slotName: 'operations',
|
|
|
|
|
+ },
|
|
|
|
|
+]);
|
|
|
|
|
|
|
|
- const statusOptions = computed<SelectOptionData[]>(() => [
|
|
|
|
|
- {
|
|
|
|
|
- label: '全部',
|
|
|
|
|
- value: '',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '在线',
|
|
|
|
|
- value: 'online',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '下线',
|
|
|
|
|
- value: 'offline',
|
|
|
|
|
- },
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+const statusOptions = computed<SelectOptionData[]>(() => [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '全部',
|
|
|
|
|
+ value: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '在线',
|
|
|
|
|
+ value: 'online',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '下线',
|
|
|
|
|
+ value: 'offline',
|
|
|
|
|
+ },
|
|
|
|
|
+]);
|
|
|
|
|
|
|
|
- const fetchData = async (
|
|
|
|
|
- params: TkPoolParams = {
|
|
|
|
|
- current: 1,
|
|
|
|
|
- pageSize: 20,
|
|
|
|
|
- sort: 'status',
|
|
|
|
|
- order: 'descending',
|
|
|
|
|
- getTotal: true,
|
|
|
|
|
- }
|
|
|
|
|
- ) => {
|
|
|
|
|
- setLoading(true);
|
|
|
|
|
- try {
|
|
|
|
|
- const { data } = await queryTkPool(params);
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- if (!data) return;
|
|
|
|
|
- // const { data } = await queryTkPool(params);
|
|
|
|
|
- renderData.value = data.list;
|
|
|
|
|
- pagination.current = data.page;
|
|
|
|
|
- pagination.total = data.count;
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- } catch (err) {
|
|
|
|
|
- console.log(err);
|
|
|
|
|
- // you can report use errorHandler or other
|
|
|
|
|
- } finally {
|
|
|
|
|
- setLoading(false);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const fetchData = async (
|
|
|
|
|
+ params: TkPoolParams = {
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
|
+ sort: 'status',
|
|
|
|
|
+ order: 'descending',
|
|
|
|
|
+ getTotal: true,
|
|
|
|
|
+ }
|
|
|
|
|
+) => {
|
|
|
|
|
+ setLoading(true);
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { data } = await queryTkPool(params);
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ if (!data) return;
|
|
|
|
|
+ // const { data } = await queryTkPool(params);
|
|
|
|
|
+ renderData.value = data.list;
|
|
|
|
|
+ pagination.current = data.page;
|
|
|
|
|
+ pagination.total = data.count;
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.log(err);
|
|
|
|
|
+ // you can report use errorHandler or other
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ setLoading(false);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const changeItem = async (data: TkPoolRecord) => {
|
|
|
|
|
- router.push({ name: 'updateCookies' });
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const changeItem = async (data: TkPoolRecord) => {
|
|
|
|
|
+ router.push({ name: 'updateCookies' });
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const search = () => {
|
|
|
|
|
- fetchData({
|
|
|
|
|
- ...basePagination,
|
|
|
|
|
- ...formModel.value,
|
|
|
|
|
- } as unknown as TkPoolParams);
|
|
|
|
|
- };
|
|
|
|
|
- const onPageChange = (current: number) => {
|
|
|
|
|
- fetchData({ ...basePagination, current, getTotal: current === 1 });
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const billView = async (data: TkPoolRecord) => {
|
|
|
|
|
+ router.push({ name: 'taobao_bill_dailys',query:{ name: data.company } });
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- fetchData();
|
|
|
|
|
- const reset = () => {
|
|
|
|
|
- formModel.value = generateFormModel();
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const search = () => {
|
|
|
|
|
+ fetchData({
|
|
|
|
|
+ ...basePagination,
|
|
|
|
|
+ ...formModel.value,
|
|
|
|
|
+ } as unknown as TkPoolParams);
|
|
|
|
|
+};
|
|
|
|
|
+const onPageChange = (current: number) => {
|
|
|
|
|
+ fetchData({ ...basePagination, current, getTotal: current === 1 });
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleSelectDensity = (
|
|
|
|
|
- val: string | number | Record<string, any> | undefined,
|
|
|
|
|
- e: Event
|
|
|
|
|
- ) => {
|
|
|
|
|
- size.value = val as SizeProps;
|
|
|
|
|
- };
|
|
|
|
|
|
|
+fetchData();
|
|
|
|
|
+const reset = () => {
|
|
|
|
|
+ formModel.value = generateFormModel();
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const handleChange = (
|
|
|
|
|
- checked: boolean | (string | boolean | number)[],
|
|
|
|
|
- column: Column,
|
|
|
|
|
- index: number
|
|
|
|
|
- ) => {
|
|
|
|
|
- if (!checked) {
|
|
|
|
|
- cloneColumns.value = showColumns.value.filter(
|
|
|
|
|
- (item) => item.dataIndex !== column.dataIndex
|
|
|
|
|
- );
|
|
|
|
|
- } else {
|
|
|
|
|
- cloneColumns.value.splice(index, 0, column);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const handleSelectDensity = (
|
|
|
|
|
+ val: string | number | Record<string, any> | undefined,
|
|
|
|
|
+ e: Event
|
|
|
|
|
+) => {
|
|
|
|
|
+ size.value = val as SizeProps;
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const exchangeArray = <T extends Array<any>>(
|
|
|
|
|
- array: T,
|
|
|
|
|
- beforeIdx: number,
|
|
|
|
|
- newIdx: number,
|
|
|
|
|
- isDeep = false
|
|
|
|
|
- ): T => {
|
|
|
|
|
- const newArray = isDeep ? cloneDeep(array) : array;
|
|
|
|
|
- if (beforeIdx > -1 && newIdx > -1) {
|
|
|
|
|
- // 先替换后面的,然后拿到替换的结果替换前面的
|
|
|
|
|
- newArray.splice(
|
|
|
|
|
- beforeIdx,
|
|
|
|
|
- 1,
|
|
|
|
|
- newArray.splice(newIdx, 1, newArray[beforeIdx]).pop()
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- return newArray;
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const handleChange = (
|
|
|
|
|
+ checked: boolean | (string | boolean | number)[],
|
|
|
|
|
+ column: Column,
|
|
|
|
|
+ index: number
|
|
|
|
|
+) => {
|
|
|
|
|
+ if (!checked) {
|
|
|
|
|
+ cloneColumns.value = showColumns.value.filter(
|
|
|
|
|
+ (item) => item.dataIndex !== column.dataIndex
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cloneColumns.value.splice(index, 0, column);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- const popupVisibleChange = (val: boolean) => {
|
|
|
|
|
- if (val) {
|
|
|
|
|
- nextTick(() => {
|
|
|
|
|
- const el = document.getElementById(
|
|
|
|
|
- 'tableSetting'
|
|
|
|
|
- ) as HTMLElement;
|
|
|
|
|
- const sortable = new Sortable(el, {
|
|
|
|
|
- onEnd(e: any) {
|
|
|
|
|
- const { oldIndex, newIndex } = e;
|
|
|
|
|
- exchangeArray(cloneColumns.value, oldIndex, newIndex);
|
|
|
|
|
- exchangeArray(showColumns.value, oldIndex, newIndex);
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+const exchangeArray = <T extends Array<any>>(
|
|
|
|
|
+ array: T,
|
|
|
|
|
+ beforeIdx: number,
|
|
|
|
|
+ newIdx: number,
|
|
|
|
|
+ isDeep = false
|
|
|
|
|
+): T => {
|
|
|
|
|
+ const newArray = isDeep ? cloneDeep(array) : array;
|
|
|
|
|
+ if (beforeIdx > -1 && newIdx > -1) {
|
|
|
|
|
+ // 先替换后面的,然后拿到替换的结果替换前面的
|
|
|
|
|
+ newArray.splice(
|
|
|
|
|
+ beforeIdx,
|
|
|
|
|
+ 1,
|
|
|
|
|
+ newArray.splice(newIdx, 1, newArray[beforeIdx]).pop()
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ return newArray;
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- watch(
|
|
|
|
|
- () => columns.value,
|
|
|
|
|
- (val) => {
|
|
|
|
|
- cloneColumns.value = cloneDeep(val);
|
|
|
|
|
- cloneColumns.value.forEach((item, index) => {
|
|
|
|
|
- item.checked = true;
|
|
|
|
|
|
|
+const popupVisibleChange = (val: boolean) => {
|
|
|
|
|
+ if (val) {
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ const el = document.getElementById(
|
|
|
|
|
+ 'tableSetting'
|
|
|
|
|
+ ) as HTMLElement;
|
|
|
|
|
+ const sortable = new Sortable(el, {
|
|
|
|
|
+ onEnd(e: any) {
|
|
|
|
|
+ const { oldIndex, newIndex } = e;
|
|
|
|
|
+ exchangeArray(cloneColumns.value, oldIndex, newIndex);
|
|
|
|
|
+ exchangeArray(showColumns.value, oldIndex, newIndex);
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
- showColumns.value = cloneDeep(cloneColumns.value);
|
|
|
|
|
- },
|
|
|
|
|
- { deep: true, immediate: true }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => columns.value,
|
|
|
|
|
+ (val) => {
|
|
|
|
|
+ cloneColumns.value = cloneDeep(val);
|
|
|
|
|
+ cloneColumns.value.forEach((item, index) => {
|
|
|
|
|
+ item.checked = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ showColumns.value = cloneDeep(cloneColumns.value);
|
|
|
|
|
+ },
|
|
|
|
|
+ { deep: true, immediate: true }
|
|
|
|
|
+);
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
- export default {
|
|
|
|
|
- name: 'SearchTable',
|
|
|
|
|
- };
|
|
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'SearchTable',
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
<style scoped lang="less">
|
|
|
- .container {
|
|
|
|
|
- padding: 0 20px 20px 20px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.container {
|
|
|
|
|
+ padding: 0 20px 20px 20px;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- :deep(.arco-table-th) {
|
|
|
|
|
- &:last-child {
|
|
|
|
|
- .arco-table-th-item-title {
|
|
|
|
|
- margin-left: 16px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+:deep(.arco-table-th) {
|
|
|
|
|
+ &:last-child {
|
|
|
|
|
+ .arco-table-th-item-title {
|
|
|
|
|
+ margin-left: 16px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .action-icon {
|
|
|
|
|
- margin-left: 12px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.action-icon {
|
|
|
|
|
+ margin-left: 12px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .active {
|
|
|
|
|
- color: #0960bd;
|
|
|
|
|
- background-color: #e3f4fc;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.active {
|
|
|
|
|
+ color: #0960bd;
|
|
|
|
|
+ background-color: #e3f4fc;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .setting {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- width: 200px;
|
|
|
|
|
|
|
+.setting {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
|
|
|
- .title {
|
|
|
|
|
- margin-left: 12px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .title {
|
|
|
|
|
+ margin-left: 12px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|