|
|
@@ -1,6 +1,6 @@
|
|
|
<script setup>
|
|
|
import { requestClient } from '#/api/request';
|
|
|
-import { Button, message, Form, InputNumber, RadioGroup, Radio, Drawer } from 'ant-design-vue';
|
|
|
+import { Button, message, Form, InputNumber, RadioGroup, Radio, Drawer, Input } from 'ant-design-vue';
|
|
|
import { ref, reactive, computed, watch, onMounted, onUnmounted } from 'vue';
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
@@ -20,6 +20,7 @@ const updateTimer = ref(null);
|
|
|
const minProfitRate = ref(2);
|
|
|
const marketType = ref(-1);
|
|
|
const dataType = ref(0);
|
|
|
+const searchValue = ref('');
|
|
|
const updateLoaderHide = ref(null);
|
|
|
|
|
|
const totalProfitVisible = ref(false);
|
|
|
@@ -52,8 +53,9 @@ const getSolutions = async () => {
|
|
|
const win_min = minProfitRate.value * 100;
|
|
|
const mk = marketType.value;
|
|
|
const tp = dataType.value;
|
|
|
+ const sk = searchValue.value.trim();
|
|
|
const with_events = true;
|
|
|
- const data = await requestClient.get('/pstery/get_games_solutions', { params: { win_min, mk, tp, with_events } });
|
|
|
+ const data = await requestClient.get('/pstery/get_games_solutions', { params: { win_min, mk, tp, sk, with_events } });
|
|
|
return data;
|
|
|
}
|
|
|
catch (error) {
|
|
|
@@ -141,6 +143,16 @@ const getLocalStorage = (key) => {
|
|
|
return value ? JSON.parse(value) : null;
|
|
|
}
|
|
|
|
|
|
+watch(searchValue, (newVal, oldVal) => {
|
|
|
+ if (newVal.trim() == oldVal.trim()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ clearTimeout(updateTimer.value);
|
|
|
+ updateTimer.value = setTimeout(() => {
|
|
|
+ updateSolutions();
|
|
|
+ }, 1000);
|
|
|
+});
|
|
|
+
|
|
|
watch(minProfitRate, (newVal) => {
|
|
|
clearTimeout(updateTimer.value);
|
|
|
updateTimer.value = setTimeout(() => {
|
|
|
@@ -218,8 +230,11 @@ onUnmounted(() => {
|
|
|
<Radio :value="2">大小</Radio>
|
|
|
</RadioGroup>
|
|
|
</Form.Item>
|
|
|
- <Form.Item label="最小利润率(%)" class="sol-opt-item">
|
|
|
- <InputNumber style="width: 60px" size="small" max="100" min="-100" step="0.1" placeholder="最小利润率(%)" v-model:value="minProfitRate"/>
|
|
|
+ <Form.Item label="最小利润率(%)" class="sol-opt-item input-item">
|
|
|
+ <InputNumber class="number-input" size="small" max="100" min="-100" step="0.1" placeholder="最小利润率(%)" v-model:value="minProfitRate"/>
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item class="sol-opt-item input-item">
|
|
|
+ <Input class="search-input" placeholder="搜索" :allowClear="true" v-model:value="searchValue"/>
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
</div>
|
|
|
@@ -278,9 +293,23 @@ onUnmounted(() => {
|
|
|
margin-inline-start: auto;
|
|
|
}
|
|
|
&:nth-child(n+3) {
|
|
|
- padding-inline-start: 15px;
|
|
|
- border-left: 1px solid hsl(var(--border));
|
|
|
-}
|
|
|
+ padding-inline-start: 15px;
|
|
|
+ border-left: 1px solid hsl(var(--border));
|
|
|
+ }
|
|
|
+ &.input-item:not(:last-child) {
|
|
|
+ padding-inline-end: 15px;
|
|
|
+ }
|
|
|
+ .search-input, .number-input {
|
|
|
+ height: 28px;
|
|
|
+ }
|
|
|
+ .search-input {
|
|
|
+ width: 150px;
|
|
|
+ }
|
|
|
+ .number-input {
|
|
|
+ display: inline-flex;
|
|
|
+ width: 60px;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.solution-header {
|