Commit e86980b6 by haojie

1

parent 6785be23
...@@ -29,7 +29,7 @@ export const chain_options = [ ...@@ -29,7 +29,7 @@ export const chain_options = [
{ {
label: 'ETH', label: 'ETH',
value: '/eth', value: '/eth',
img: '/images/svg/selectChain/ETT.svg', img: '/images/svg/selectChain/newEth.svg',
name: 'ETH', name: 'ETH',
fullName: 'ETHEREUM', fullName: 'ETHEREUM',
chain_id: 1, chain_id: 1,
...@@ -95,8 +95,7 @@ export const chain_options = [ ...@@ -95,8 +95,7 @@ export const chain_options = [
{ {
label: 'POL', label: 'POL',
value: '/pol', value: '/pol',
img: '/images/svg/selectChain/pol.svg', img: '/images/svg/selectChain/newpol.svg',
newImg: '/images/svg/selectChain/newpol.svg',
name: 'POL', name: 'POL',
fullName: 'POLYGON', fullName: 'POLYGON',
chain_id: 137, chain_id: 137,
...@@ -195,8 +194,7 @@ export const chain_options = [ ...@@ -195,8 +194,7 @@ export const chain_options = [
{ {
label: 'CRO', label: 'CRO',
value: '/cro', value: '/cro',
img: '/images/svg/selectChain/cro.svg', img: '/images/svg/selectChain/newCro.svg',
newImg: '/images/svg/selectChain/newCro.svg',
name: 'CRO', name: 'CRO',
fullName: 'CRONOS', fullName: 'CRONOS',
chain_id: 25, chain_id: 25,
...@@ -229,8 +227,7 @@ export const chain_options = [ ...@@ -229,8 +227,7 @@ export const chain_options = [
{ {
label: 'AUR', label: 'AUR',
value: '/aur', value: '/aur',
img: '/images/svg/selectChain/aur.svg', img: '/images/svg/selectChain/newAur.svg',
newImg: '/images/svg/selectChain/newAur.svg',
name: 'AUR', name: 'AUR',
fullName: 'AURORA', fullName: 'AURORA',
chain_id: 1313161554, chain_id: 1313161554,
...@@ -329,8 +326,7 @@ export const chain_options = [ ...@@ -329,8 +326,7 @@ export const chain_options = [
{ {
label: 'ARB', label: 'ARB',
value: '/arb', value: '/arb',
img: '/images/svg/selectChain/arb.svg', img: '/images/svg/selectChain/newArb.svg',
newImg: '/images/svg/selectChain/newArb.svg',
name: 'ARB', name: 'ARB',
fullName: 'ARBITRUM', fullName: 'ARBITRUM',
chain_id: 42161, chain_id: 42161,
...@@ -396,8 +392,7 @@ export const chain_options = [ ...@@ -396,8 +392,7 @@ export const chain_options = [
{ {
label: 'GNO', label: 'GNO',
value: '/gno', value: '/gno',
img: '/images/svg/selectChain/gno.svg', img: '/images/svg/selectChain/newGno.svg',
newImg: '/images/svg/selectChain/newGno.svg',
name: 'GNO', name: 'GNO',
fullName: 'GNOSIS CHAIN', fullName: 'GNOSIS CHAIN',
chain_id: 100, chain_id: 100,
...@@ -463,8 +458,7 @@ export const chain_options = [ ...@@ -463,8 +458,7 @@ export const chain_options = [
{ {
label: 'MET', label: 'MET',
value: '/met', value: '/met',
img: '/images/svg/selectChain/met.svg', img: '/images/svg/selectChain/newMet.svg',
newImg: '/images/svg/selectChain/newMet.svg',
name: 'MET', name: 'MET',
fullName: 'METIS', fullName: 'METIS',
chain_id: 1088, chain_id: 1088,
...@@ -530,8 +524,7 @@ export const chain_options = [ ...@@ -530,8 +524,7 @@ export const chain_options = [
{ {
label: 'AST', label: 'AST',
value: '/ast', value: '/ast',
img: '/images/svg/selectChain/ast.svg', img: '/images/svg/selectChain/newAst.svg',
newImg: '/images/svg/selectChain/newAst.svg',
name: 'AST', name: 'AST',
fullName: 'ASTAR', fullName: 'ASTAR',
chain_id: 592, chain_id: 592,
...@@ -598,8 +591,7 @@ export const chain_options = [ ...@@ -598,8 +591,7 @@ export const chain_options = [
{ {
label: 'NOV', label: 'NOV',
value: '/nov', value: '/nov',
img: '/images/svg/selectChain/nov.svg', img: '/images/svg/selectChain/newNov.svg',
newImg: '/images/svg/selectChain/newNov.svg',
name: 'NOV', name: 'NOV',
fullName: 'Arbitrum Nova', fullName: 'Arbitrum Nova',
chain_id: 42170, chain_id: 42170,
...@@ -632,8 +624,7 @@ export const chain_options = [ ...@@ -632,8 +624,7 @@ export const chain_options = [
{ {
label: 'TOM', label: 'TOM',
value: '/tom', value: '/tom',
img: '/images/svg/selectChain/tom.svg', img: '/images/svg/selectChain/newTom.svg',
newImg: '/images/svg/selectChain/newTom.svg',
name: 'TOM', name: 'TOM',
fullName: 'Tomb Chain', fullName: 'Tomb Chain',
chain_id: 6969, chain_id: 6969,
......
import viteCompression from "vite-plugin-compression"; import viteCompression from 'vite-plugin-compression';
// import visualizer from 'rollup-plugin-visualizer'; // import visualizer from 'rollup-plugin-visualizer';
// 筛选接口地址 // 筛选接口地址
let filterApi = "http://156.247.9.93:9501/"; let filterApi = 'http://156.247.9.93:9501/';
let loginApi = "http://156.247.9.93:8001/"; let loginApi = 'http://156.247.9.93:8001/';
export default defineNuxtConfig({ export default defineNuxtConfig({
// plugins: [], // plugins: [],
modules: ["nuxt-svgo", "@nuxtjs-alt/proxy"], modules: ['nuxt-svgo', '@nuxtjs-alt/proxy'],
proxy: { proxy: {
enableProxy: true, enableProxy: true,
proxies: { proxies: {
"/score": { '/score': {
target: filterApi, target: filterApi,
changeOrigin: true, changeOrigin: true,
}, },
"/v1": { '/v1': {
target: filterApi, target: filterApi,
changeOrigin: true, changeOrigin: true,
}, },
"/search": { '/search': {
target: filterApi, target: filterApi,
changeOrigin: true, changeOrigin: true,
}, },
"/favorites": { '/favorites': {
target: filterApi, target: filterApi,
changeOrigin: true, changeOrigin: true,
}, },
//api-ip是另外滴 //api-ip是另外滴
"/api": { '/api': {
target: loginApi, target: loginApi,
changeOrigin: true, changeOrigin: true,
}, },
...@@ -40,9 +40,9 @@ export default defineNuxtConfig({ ...@@ -40,9 +40,9 @@ export default defineNuxtConfig({
// }, // },
vite: { vite: {
plugins: [viteCompression()], plugins: [viteCompression()],
envDir: "~/env", envDir: '~/env',
build: { build: {
minify: "terser", // 混淆器,terser构建后文件体积更小 minify: 'terser', // 混淆器,terser构建后文件体积更小
// 构建后是否生成 source map 文件 // 构建后是否生成 source map 文件
// sourcemap: 'hidden', // sourcemap: 'hidden',
cssCodeSplit: true, // 如果设置为false,整个项目中的所有 CSS 将被提取到一个 CSS 文件中 cssCodeSplit: true, // 如果设置为false,整个项目中的所有 CSS 将被提取到一个 CSS 文件中
...@@ -60,8 +60,8 @@ export default defineNuxtConfig({ ...@@ -60,8 +60,8 @@ export default defineNuxtConfig({
rollupOptions: { rollupOptions: {
output: { output: {
manualChunks: { manualChunks: {
TdesignVueNext: ["tdesign-vue-next"], TdesignVueNext: ['tdesign-vue-next'],
CustomEcharts: ["echarts"], CustomEcharts: ['echarts'],
}, },
}, },
}, },
...@@ -72,11 +72,11 @@ export default defineNuxtConfig({ ...@@ -72,11 +72,11 @@ export default defineNuxtConfig({
// vendor-已被弃用 // vendor-已被弃用
// 第三方插件转es5 // 第三方插件转es5
transpile: transpile:
process.env.NODE_ENV === "production" process.env.NODE_ENV === 'production'
? ["tdesign-vue-next", "echarts", "vue-i18n"] ? ['tdesign-vue-next', 'echarts', 'vue-i18n']
: ["echarts"], : ['echarts'],
// cssSourceMap: true, // cssSourceMap: true,
// analyze: true, // analyze: true,
}, },
css: ["@/style/font-family.css"], css: ['@/style/font-family.css'],
}); });
<svg width="31" height="31" viewBox="0 0 31 31" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="31" height="31" fill="url(#pattern0)"/>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_4743_31269" transform="scale(0.015625)"/>
</pattern>
<image id="image0_4743_31269" width="64" height="64" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKmUExURQAAAGJ+6mJ+6WJ96WF96WJ96WF96WJ+6WJ96mJ96WF96mF96WF86WF+6mJ96WF96WJ96mJ96WJ+6mJ+6WF+6mJ96mJ96WF96mF96WF+6WF96mF96WJ+6mJ+6WF+6WF96mF96WJ+6mF+6mF+6WJ96mF96WJ+6mF+6mJ+6mJ+6WJ+6mJ96mF+6mJ+6mJ+6mJ+6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mCC"/>
</defs>
</svg>
\ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<th class="custom-before-line"> <th class="custom-before-line">
<div class="thead-sort-box"> <div class="thead-sort-box">
<template v-if="item.title == 'Pool'"> <template v-if="item.title == 'Pool'">
{{ $t("TableList.pool") + HeadTokenType }} {{ $t('TableList.pool') + HeadTokenType }}
</template> </template>
<template v-else> <template v-else>
{{ item.title }} {{ item.title }}
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<th class="custom-before-line" ref="tableTrOne"> <th class="custom-before-line" ref="tableTrOne">
<div class="thead-sort-box"> <div class="thead-sort-box">
<template v-if="item.title == 'Pool'"> <template v-if="item.title == 'Pool'">
{{ $t("TableList.pool") + HeadTokenType }} {{ $t('TableList.pool') + HeadTokenType }}
</template> </template>
<template v-else> <template v-else>
{{ item.title }} {{ item.title }}
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
<template v-if="!resultData.list.length"> <template v-if="!resultData.list.length">
<tr> <tr>
<td colspan="12"> <td colspan="12">
<div class="custom-no-list">{{ $t("filter.noList") }}</div> <div class="custom-no-list">{{ $t('filter.noList') }}</div>
</td> </td>
</tr> </tr>
</template> </template>
...@@ -189,23 +189,23 @@ ...@@ -189,23 +189,23 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { parsePercent, parseCoinAmount, parseNumberToK } from "@/utils/tool"; import { parsePercent, parseCoinAmount, parseNumberToK } from '@/utils/tool';
import { useI18n } from "vue-i18n"; import { useI18n } from 'vue-i18n';
import CustPagination from "./CustPagination.vue"; import CustPagination from './CustPagination.vue';
import request from "@/utils/request"; import request from '@/utils/request';
import { filterChainObj, getSwap } from "@/constants/UnifiedManagementChain"; import { filterChainObj, getSwap } from '@/constants/UnifiedManagementChain';
import JumpOther from "./JumpOther.vue"; import JumpOther from './JumpOther.vue';
import KLink from "/public/images/svg/table/k_link.svg"; import KLink from '/public/images/svg/table/k_link.svg';
import analysisSvg from "/public/images/svg/table/media.svg"; import analysisSvg from '/public/images/svg/table/media.svg';
import { webLogo } from "@/constants/logo"; import { webLogo } from '@/constants/logo';
import CustomTableSort from "./tableSort.vue"; import CustomTableSort from './tableSort.vue';
import { TableSort, TableSortAsc } from "@/utils/tool"; import { TableSort, TableSortAsc } from '@/utils/tool';
import CustomRadio from "../CustomComponent/radio.vue"; import CustomRadio from '../CustomComponent/radio.vue';
import BscChain from "/public/images/svg/selectChain/bsc.svg"; import BscChain from '/public/images/svg/selectChain/bsc.svg';
import SwapSvg from "/public/images/svg/socialInfoWrapper/bscTransaction.svg"; import SwapSvg from '/public/images/svg/socialInfoWrapper/bscTransaction.svg';
import CustomAvatar from "./avatar.vue"; import CustomAvatar from './avatar.vue';
import TokenAvatar from "./tokenAvatar.vue"; import TokenAvatar from './tokenAvatar.vue';
import useSwap from "@/hooks/useSwap"; import useSwap from '@/hooks/useSwap';
const { ChainObj, getCurSwap, getCurChainImg } = useSwap(); const { ChainObj, getCurSwap, getCurChainImg } = useSwap();
const route = useRoute(); const route = useRoute();
const LoadHead = ref(false); const LoadHead = ref(false);
...@@ -223,7 +223,7 @@ const GlbFilter = useCurFilter(); ...@@ -223,7 +223,7 @@ const GlbFilter = useCurFilter();
const CurrentTime = useCurrentTimeChange(); const CurrentTime = useCurrentTimeChange();
// 吸顶元素 // 吸顶元素
const affixedHeadRef = ref(null); const affixedHeadRef = ref(null);
const affixedTableWidth = ref(""); const affixedTableWidth = ref('');
// 当前选中的行数 // 当前选中的行数
const CurLineIndex = ref(0); const CurLineIndex = ref(0);
// 表格数据轮询 // 表格数据轮询
...@@ -247,121 +247,121 @@ const colGroupList = reactive({ ...@@ -247,121 +247,121 @@ const colGroupList = reactive({
const RightInfo = useCurrentRightInfo(); const RightInfo = useCurrentRightInfo();
// 吸顶表头左右跟随滑动 // 吸顶表头左右跟随滑动
const affixedHead = reactive({ const affixedHead = reactive({
left: "", left: '',
top: "", top: '',
height: "", height: '',
width: "", width: '',
}); });
// 当前排序状态 // 当前排序状态
const SortOptions = reactive({ const SortOptions = reactive({
up: { up: {
field: "up", field: 'up',
type: "all", type: 'all',
status: false, status: false,
}, },
pb: { pb: {
field: "pb", field: 'pb',
type: "all", type: 'all',
status: false, status: false,
}, },
vn: { vn: {
field: "vn", field: 'vn',
type: "all", type: 'all',
status: false, status: false,
}, },
txn: { txn: {
field: "txn", field: 'txn',
type: "all", type: 'all',
status: false, status: false,
}, },
r5m: { r5m: {
field: "r5m", field: 'r5m',
type: "all", type: 'all',
status: false, status: false,
}, },
r1h: { r1h: {
field: "r1h", field: 'r1h',
type: "all", type: 'all',
status: false, status: false,
}, },
r4h: { r4h: {
field: "r4h", field: 'r4h',
type: "all", type: 'all',
status: false, status: false,
}, },
r24h: { r24h: {
field: "r24h", field: 'r24h',
type: "all", type: 'all',
status: false, status: false,
}, },
}); });
const currentBtn = ref("default"); const currentBtn = ref('default');
const btns = computed(() => [ const btns = computed(() => [
{ {
label: t("filter.pairs"), label: t('filter.pairs'),
value: "default", value: 'default',
}, },
{ {
label: t("filter.updated"), label: t('filter.updated'),
value: "new", value: 'new',
}, },
{ {
label: t("filter.gainers"), label: t('filter.gainers'),
value: "max-up", value: 'max-up',
}, },
{ {
label: t("filter.losers"), label: t('filter.losers'),
value: "max-down", value: 'max-down',
}, },
{ {
label: t("filter.r24hVolume"), label: t('filter.r24hVolume'),
value: "txn", value: 'txn',
}, },
]); ]);
const onFilterChange = (value: string) => { const onFilterChange = (value: string) => {
if (value == "new") { if (value == 'new') {
GlbFilter.value.nt = 1; GlbFilter.value.nt = 1;
} else if (value == "default") { } else if (value == 'default') {
GlbFilter.value.nt = 0; GlbFilter.value.nt = 0;
} }
// 永远请求第一页 // 永远请求第一页
pageNum.value = 1; pageNum.value = 1;
if (value == "txn") { if (value == 'txn') {
GlbFilter.value.date_orderby = "txn"; GlbFilter.value.date_orderby = 'txn';
GlbFilter.value.sort = "desc"; GlbFilter.value.sort = 'desc';
} else if (value == "max-up") { } else if (value == 'max-up') {
// 最大涨幅 // 最大涨幅
GlbFilter.value.date_orderby = "r" + GlbFilter.value.range_date; GlbFilter.value.date_orderby = 'r' + GlbFilter.value.range_date;
GlbFilter.value.sort = "desc"; GlbFilter.value.sort = 'desc';
} else if (value == "max-down") { } else if (value == 'max-down') {
// 最大跌幅 // 最大跌幅
GlbFilter.value.date_orderby = "r" + GlbFilter.value.range_date; GlbFilter.value.date_orderby = 'r' + GlbFilter.value.range_date;
GlbFilter.value.sort = "asc"; GlbFilter.value.sort = 'asc';
} }
getTableList(); getTableList();
}; };
// 获取涨跌幅 // 获取涨跌幅
const getUpDown = (value: string) => { const getUpDown = (value: string) => {
if (value && value[0] == "-") { if (value && value[0] == '-') {
return `${value}%`; return `${value}%`;
} }
return `+${value}%`; return `+${value}%`;
}; };
// 获取涨跌幅颜色 // 获取涨跌幅颜色
const getUpDownColor = (value: string) => { const getUpDownColor = (value: string) => {
if (value && value[0] == "-") { if (value && value[0] == '-') {
// down // down
return "#f23645"; return '#f23645';
} }
// up // up
return "#23ab94"; return '#23ab94';
}; };
// 获取表格可视区域宽度 // 获取表格可视区域宽度
const getTableWidth = () => { const getTableWidth = () => {
if (CustomTable.value) { if (CustomTable.value) {
// 获取元素可视区域宽度 // 获取元素可视区域宽度
let width = CustomTable.value.clientWidth; let width = CustomTable.value.clientWidth;
affixedHead.width = width + "px"; affixedHead.width = width + 'px';
} }
}; };
// 排序事件 // 排序事件
...@@ -372,15 +372,15 @@ const submitSort = ({ sort, field }: any) => { ...@@ -372,15 +372,15 @@ const submitSort = ({ sort, field }: any) => {
SortOptions[item].type = sort; SortOptions[item].type = sort;
SortOptions[item].status = true; SortOptions[item].status = true;
} else { } else {
SortOptions[item].type = "all"; SortOptions[item].type = 'all';
SortOptions[item].status = false; SortOptions[item].status = false;
} }
}); });
// 开始排序 // 开始排序
if (sort === "asc") { if (sort === 'asc') {
// 升序 // 升序
resultData.list = TableSortAsc(resultData.list, field); resultData.list = TableSortAsc(resultData.list, field);
} else if (sort === "desc") { } else if (sort === 'desc') {
// 降序 // 降序
resultData.list = TableSort(resultData.list, field); resultData.list = TableSort(resultData.list, field);
} else { } else {
...@@ -391,16 +391,16 @@ const submitSort = ({ sort, field }: any) => { ...@@ -391,16 +391,16 @@ const submitSort = ({ sort, field }: any) => {
// 获取head的宽度赋给吸顶表头 // 获取head的宽度赋给吸顶表头
const getMinWidth = () => { const getMinWidth = () => {
if (CustomHead.value) { if (CustomHead.value) {
affixedTableWidth.value = CustomHead.value.clientWidth + "px"; affixedTableWidth.value = CustomHead.value.clientWidth + 'px';
} }
}; };
// 表格数据过滤方法 // 表格数据过滤方法
const TableFilter = (result: any) => { const TableFilter = (result: any) => {
if ("list" in result && result.list.length) { if ('list' in result && result.list.length) {
result.list.forEach((item: any, index: number) => { result.list.forEach((item: any, index: number) => {
item.index = index + 1; item.index = index + 1;
item.n_up = "$" + parseCoinAmount(item.up); item.n_up = '$' + parseCoinAmount(item.up);
item.n_vn = "$" + parseNumberToK(item.vn); item.n_vn = '$' + parseNumberToK(item.vn);
item.n_pb = parseNumberToK(item.pb); item.n_pb = parseNumberToK(item.pb);
item.n_r5m = parseFloat(item.r5m * 100).toFixed(2); item.n_r5m = parseFloat(item.r5m * 100).toFixed(2);
item.n_r1h = parseFloat(item.r1h * 100).toFixed(2); item.n_r1h = parseFloat(item.r1h * 100).toFixed(2);
...@@ -431,7 +431,7 @@ const getParams = () => { ...@@ -431,7 +431,7 @@ const getParams = () => {
}; };
if (CurrentTime.value) { if (CurrentTime.value) {
params.date = CurrentTime.value; params.date = CurrentTime.value;
} else if ("date" in params) { } else if ('date' in params) {
delete params.date; delete params.date;
} }
return params; return params;
...@@ -442,9 +442,9 @@ const getBaseUrl = () => { ...@@ -442,9 +442,9 @@ const getBaseUrl = () => {
// if (process.dev) { // if (process.dev) {
// return "http://156.247.9.93:9501"; // return "http://156.247.9.93:9501";
// } // }
return "http://apiv1.dexfilter.com/"; return 'http://apiv1.dexfilter.com/';
} else { } else {
return "/v1"; return '/v1';
} }
}; };
...@@ -452,9 +452,9 @@ const getBaseUrl = () => { ...@@ -452,9 +452,9 @@ const getBaseUrl = () => {
const { data, refresh } = await useFetch(() => `/v1${chain.value}/indexV1`, { const { data, refresh } = await useFetch(() => `/v1${chain.value}/indexV1`, {
params: getParams(), params: getParams(),
lazy: true, lazy: true,
method: "GET", method: 'GET',
mode: "cors", mode: 'cors',
credentials: "include", credentials: 'include',
baseURL: getBaseUrl(), baseURL: getBaseUrl(),
onRequest(context: any) {}, onRequest(context: any) {},
onResponse({ request, response, options }) { onResponse({ request, response, options }) {
...@@ -472,10 +472,10 @@ const { data, refresh } = await useFetch(() => `/v1${chain.value}/indexV1`, { ...@@ -472,10 +472,10 @@ const { data, refresh } = await useFetch(() => `/v1${chain.value}/indexV1`, {
return response._data; return response._data;
}, },
onRequestError({ error }) { onRequestError({ error }) {
console.log(error); console.log(error, '请求错误');
}, },
onResponseError(error) { onResponseError(error) {
console.log(error, "接口"); console.log(error, '返回的error');
}, },
}); });
...@@ -491,17 +491,17 @@ const getDefaultList = () => { ...@@ -491,17 +491,17 @@ const getDefaultList = () => {
}; };
const CustomgetRoute = () => { const CustomgetRoute = () => {
if (route.params.chain) { if (route.params.chain) {
let Obj = filterChainObj("name", route.params.chain); let Obj = filterChainObj('name', route.params.chain);
if (Obj) { if (Obj) {
ChainObj.value = Obj; ChainObj.value = Obj;
chain.value = Obj.value; chain.value = Obj.value;
HeadTokenType.value = ChainObj.value.Currency[0]; HeadTokenType.value = ChainObj.value.Currency[0];
} }
} else { } else {
ChainObj.value = filterChainObj("value", chain.value); ChainObj.value = filterChainObj('value', chain.value);
} }
if (route.params.page) { if (route.params.page) {
if (typeof parseInt(route.params.page) === "number") if (typeof parseInt(route.params.page) === 'number')
pageNum.value = parseInt(route.params.page); pageNum.value = parseInt(route.params.page);
GlbFilter.value.page = parseInt(route.params.page); GlbFilter.value.page = parseInt(route.params.page);
} }
...@@ -514,9 +514,9 @@ useHead({ ...@@ -514,9 +514,9 @@ useHead({
link: [webLogo], link: [webLogo],
meta: [ meta: [
{ {
name: "description", name: 'description',
content: content:
"DexFilter是一个链上过滤器,它对链上的所有数据进行统计、监控。可以通过过滤功能过滤出相应的链上项目。每个资金池都做了数据分析,深入分析资金池的涨跌趋势,方便用户做出判断,也方便用户查看资金池是否为貔貅。", 'DexFilter是一个链上过滤器,它对链上的所有数据进行统计、监控。可以通过过滤功能过滤出相应的链上项目。每个资金池都做了数据分析,深入分析资金池的涨跌趋势,方便用户做出判断,也方便用户查看资金池是否为貔貅。',
}, },
], ],
}); });
...@@ -527,7 +527,7 @@ const getColGroupWidth = () => { ...@@ -527,7 +527,7 @@ const getColGroupWidth = () => {
// 动态改变吸顶表头的th宽度 // 动态改变吸顶表头的th宽度
colGroupList.list.forEach((it: any) => { colGroupList.list.forEach((it: any) => {
tableTrOne.value.forEach((item: any, index: number) => { tableTrOne.value.forEach((item: any, index: number) => {
colGroupList.list[index] = item.clientWidth + "px"; colGroupList.list[index] = item.clientWidth + 'px';
}); });
}); });
}; };
...@@ -558,16 +558,16 @@ watch( ...@@ -558,16 +558,16 @@ watch(
CurLineIndex.value = 0; CurLineIndex.value = 0;
pageNum.value = 1; pageNum.value = 1;
// 修改title // 修改title
ChainObj.value = filterChainObj("value", chain.value); ChainObj.value = filterChainObj('value', chain.value);
getTableList(); getTableList();
} }
); );
// 判断是否需要加$ // 判断是否需要加$
const Judgment = () => { const Judgment = () => {
if (HeadTokenType.value === "USDT") { if (HeadTokenType.value === 'USDT') {
return "$"; return '$';
} else { } else {
return ""; return '';
} }
}; };
// tbName---流动池折线图传递参数 // tbName---流动池折线图传递参数
...@@ -582,11 +582,11 @@ const handleRowClick = (item: any, index: number) => { ...@@ -582,11 +582,11 @@ const handleRowClick = (item: any, index: number) => {
}; };
// 监听是否切出页面 // 监听是否切出页面
const listenerWindow = (fn: any) => { const listenerWindow = (fn: any) => {
document.addEventListener("visibilitychange", fn); document.addEventListener('visibilitychange', fn);
}; };
// 取消监听 // 取消监听
const closeListener = (fn: any) => { const closeListener = (fn: any) => {
document.removeEventListener("visibilitychange", fn); document.removeEventListener('visibilitychange', fn);
}; };
// 有数据,开启定时器 // 有数据,开启定时器
const Intervalfun = () => { const Intervalfun = () => {
...@@ -606,7 +606,7 @@ const closeInterVal = () => { ...@@ -606,7 +606,7 @@ const closeInterVal = () => {
const windowOpenFn = (e: any) => { const windowOpenFn = (e: any) => {
// ==visible代表在当前窗口 // ==visible代表在当前窗口
let isExist = e.target.visibilityState; let isExist = e.target.visibilityState;
if (isExist === "visible") { if (isExist === 'visible') {
// 先关再开 // 先关再开
closeInterVal(); closeInterVal();
Intervalfun(); Intervalfun();
...@@ -623,9 +623,9 @@ const onCurrentChange = (v) => { ...@@ -623,9 +623,9 @@ const onCurrentChange = (v) => {
}; };
const onScrollEvent = () => { const onScrollEvent = () => {
// 获取滚动元素dom // 获取滚动元素dom
BodyscrollDom.value = document.getElementById("layout-scroll"); BodyscrollDom.value = document.getElementById('layout-scroll');
if (BodyscrollDom.value) { if (BodyscrollDom.value) {
affixedHead.top = BodyscrollDom.value.offsetTop + "px"; affixedHead.top = BodyscrollDom.value.offsetTop + 'px';
BodyscrollDom.value.onscroll = function (e: any) { BodyscrollDom.value.onscroll = function (e: any) {
let client = CustomHead.value.getBoundingClientRect(); let client = CustomHead.value.getBoundingClientRect();
if (client.top <= BodyscrollDom.value.offsetTop) { if (client.top <= BodyscrollDom.value.offsetTop) {
...@@ -652,7 +652,7 @@ const onTableScroll = () => { ...@@ -652,7 +652,7 @@ const onTableScroll = () => {
}; };
const setColGroupList = () => { const setColGroupList = () => {
columnsChild.value.forEach((item: any) => { columnsChild.value.forEach((item: any) => {
colGroupList.list.push("0px"); colGroupList.list.push('0px');
}); });
}; };
onMounted(() => { onMounted(() => {
...@@ -705,79 +705,79 @@ onUnmounted(() => { ...@@ -705,79 +705,79 @@ onUnmounted(() => {
const columns = computed(() => { const columns = computed(() => {
return [ return [
{ {
title: t("TableList.tokenbase"), title: t('TableList.tokenbase'),
children: [ children: [
{ {
colKey: "index", colKey: 'index',
width: "auto", width: 'auto',
title: "#", title: '#',
}, },
{ {
colKey: "tn", colKey: 'tn',
title: t("TableList.token"), title: t('TableList.token'),
}, },
], ],
}, },
{ {
title: t("TableList.basic"), title: t('TableList.basic'),
children: [ children: [
{ {
colKey: "up", colKey: 'up',
title: t("TableList.price"), title: t('TableList.price'),
sort: true, sort: true,
}, },
{ {
colKey: "pb", colKey: 'pb',
title: "Pool", title: 'Pool',
sort: true, sort: true,
}, },
{ {
colKey: "vn", colKey: 'vn',
title: t("TableList.volume"), title: t('TableList.volume'),
sort: true, sort: true,
}, },
{ {
colKey: "txn", colKey: 'txn',
title: t("TableList.txns"), title: t('TableList.txns'),
sort: true, sort: true,
}, },
], ],
}, },
{ {
title: t("TableList.priceChange"), title: t('TableList.priceChange'),
children: [ children: [
{ {
colKey: "r5m", colKey: 'r5m',
title: t("TableList.time1"), title: t('TableList.time1'),
sort: true, sort: true,
}, },
{ {
colKey: "r1h", colKey: 'r1h',
title: t("TableList.time2"), title: t('TableList.time2'),
sort: true, sort: true,
}, },
{ {
colKey: "r4h", colKey: 'r4h',
title: t("TableList.time3"), title: t('TableList.time3'),
sort: true, sort: true,
}, },
{ {
colKey: "r24h", colKey: 'r24h',
title: t("TableList.time4"), title: t('TableList.time4'),
sort: true, sort: true,
}, },
], ],
}, },
{ {
title: t("TableList.others"), title: t('TableList.others'),
children: [ children: [
{ {
colKey: "operation", colKey: 'operation',
title: t("TableList.k_line"), title: t('TableList.k_line'),
}, },
{ {
colKey: "media", colKey: 'media',
title: t("TableList.mediaData"), title: t('TableList.mediaData'),
}, },
], ],
}, },
...@@ -797,21 +797,21 @@ const columnsChild = computed(() => { ...@@ -797,21 +797,21 @@ const columnsChild = computed(() => {
let arr1 = new Array(100); let arr1 = new Array(100);
for (let i = 0; i < arr1.length; i++) { for (let i = 0; i < arr1.length; i++) {
arr1[i] = { arr1[i] = {
one: "1", one: '1',
two: "2", two: '2',
three: "3", three: '3',
four: "4", four: '4',
five: "5", five: '5',
sex: "6", sex: '6',
seven: "7", seven: '7',
}; };
} }
</script> </script>
<style lang="less"> <style lang="less">
@import "@/style/variables.less"; @import '@/style/variables.less';
@import "@/style/line.less"; @import '@/style/line.less';
@import "@/style/flex.less"; @import '@/style/flex.less';
.custom-token-list { .custom-token-list {
margin-top: 8px; margin-top: 8px;
box-sizing: border-box; box-sizing: border-box;
...@@ -854,7 +854,7 @@ for (let i = 0; i < arr1.length; i++) { ...@@ -854,7 +854,7 @@ for (let i = 0; i < arr1.length; i++) {
font-size: 14px; font-size: 14px;
color: var(--td--main-btn-color-1); color: var(--td--main-btn-color-1);
white-space: nowrap; white-space: nowrap;
font-family: "bold"; font-family: 'bold';
padding: 4px 12px; padding: 4px 12px;
} }
.t-align-center { .t-align-center {
...@@ -877,7 +877,7 @@ for (let i = 0; i < arr1.length; i++) { ...@@ -877,7 +877,7 @@ for (let i = 0; i < arr1.length; i++) {
th { th {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
font-family: "Medium"; font-family: 'Medium';
border-bottom: 1px solid var(--new-border-4); border-bottom: 1px solid var(--new-border-4);
padding: 10px 12px; padding: 10px 12px;
.thead-sort-box { .thead-sort-box {
...@@ -919,7 +919,7 @@ for (let i = 0; i < arr1.length; i++) { ...@@ -919,7 +919,7 @@ for (let i = 0; i < arr1.length; i++) {
font-size: 14px; font-size: 14px;
color: var(--td--main-btn-color-1); color: var(--td--main-btn-color-1);
white-space: nowrap; white-space: nowrap;
font-family: "bold"; font-family: 'bold';
padding: 4px 12px; padding: 4px 12px;
} }
.t-align-center { .t-align-center {
...@@ -942,7 +942,7 @@ for (let i = 0; i < arr1.length; i++) { ...@@ -942,7 +942,7 @@ for (let i = 0; i < arr1.length; i++) {
th { th {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
font-family: "Medium"; font-family: 'Medium';
border-bottom: 1px solid var(--new-border-4); border-bottom: 1px solid var(--new-border-4);
padding: 10px 12px; padding: 10px 12px;
.thead-sort-box { .thead-sort-box {
...@@ -967,7 +967,7 @@ for (let i = 0; i < arr1.length; i++) { ...@@ -967,7 +967,7 @@ for (let i = 0; i < arr1.length; i++) {
border: none; border: none;
border-bottom: 1px solid var(--new-border-3); border-bottom: 1px solid var(--new-border-3);
background: var(--new-background-5); background: var(--new-background-5);
font-family: "Regular"; font-family: 'Regular';
padding: 10px 12px; padding: 10px 12px;
.custom-no-list { .custom-no-list {
.dja(); .dja();
...@@ -998,7 +998,7 @@ for (let i = 0; i < arr1.length; i++) { ...@@ -998,7 +998,7 @@ for (let i = 0; i < arr1.length; i++) {
color: var(--main-theme-color); color: var(--main-theme-color);
font-weight: 700; font-weight: 700;
font-size: 16px; font-size: 16px;
font-family: "bold"; font-family: 'bold';
} }
.symbol { .symbol {
color: var(--td-search-btn-back-1); color: var(--td-search-btn-back-1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment