Browse Source

改读取服务端返回的配置列表

ssvfdn 3 tháng trước cách đây
mục cha
commit
6a9eeb2db2

+ 5 - 0
apps/web-antd/src/api/global/config.ts

@@ -0,0 +1,5 @@
+import {requestClient} from "#/api/request";
+
+export async function getConfigApi() {
+    return await requestClient.get('/globals_config/info');
+}

+ 10 - 0
apps/web-antd/src/store/auth.ts

@@ -7,17 +7,23 @@ import { LOGIN_PATH } from '@vben/constants';
 import { preferences } from '@vben/preferences';
 import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
 
+import {useConfigStore} from '#/store/config';
+
+
 import { notification, message } from 'ant-design-vue';
 import { defineStore } from 'pinia';
 
 import { getAccessCodesApi, getUserInfoApi, loginApi, logoutApi } from '#/api';
 import { $t } from '#/locales';
+import {getConfigApi} from "#/api/global/config";
 
 export const useAuthStore = defineStore('auth', () => {
   const accessStore = useAccessStore();
   const userStore = useUserStore();
   const router = useRouter();
 
+  const configStore = useConfigStore();
+
   const loginLoading = ref(false);
 
   /**
@@ -108,6 +114,10 @@ export const useAuthStore = defineStore('auth', () => {
     let userInfo: any | UserInfo = null;
     userInfo = await getUserInfoApi();
     userStore.setUserInfo(userInfo);
+
+    const config = await getConfigApi();
+    configStore.setConfigInfo(config);
+
     return userInfo;
   }
 

+ 14 - 0
apps/web-antd/src/store/config.js

@@ -0,0 +1,14 @@
+import {defineStore} from "pinia";
+
+/**
+ * @zh_CN 用户信息相关
+ */
+export const useConfigStore = defineStore('core-config', {
+    actions: {
+        setConfigInfo(config) {
+            // 设置用户信息
+            this.config = config;
+        },
+    },
+	state: () => ({ config: null }),
+});

+ 1 - 1
apps/web-antd/src/views/game_control/auto_rtp/config/index.vue

@@ -20,7 +20,7 @@ const gridOptions = {
 		{ field: 'float_rate', title: $t('game_control.auto_rtp.float_rate'), minWidth: 300, slots: {default:"float_rate"} },
 		{ field: 'rtp_check', title: $t('game_control.auto_rtp.rtp_check'), minWidth: 140},
 		{ field: 'rtp_float', title: $t('game_control.auto_rtp.rtp_float'), minWidth: 200, slots: {default:"rtp_float"} },
-		{ field: 'status', title: $t('game_control.auto_rtp.status'), slots: {default:'status'}},
+		{ field: 'status', title: $t('game_control.auto_rtp.status'), minWidth: 100, slots: {default:'status'}},
 		{ title: $t('game_control.auto_rtp.auto_rtp_desc'), minWidth: 200, slots: {default:'auto_rtp_desc'}},
 		{ fixed: 'right', title: $t('common.action'),minWidth:150, slots: {default:'action'}},
 	],

+ 8 - 3
apps/web-antd/src/views/game_control/auto_rtp/config/info.vue

@@ -8,6 +8,9 @@ import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {updateAutoRtpInfo} from "#/api/game_control/auto_rtp.js";
 
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
 const is_edit = ref(false);
 let form = reactive({
 	rtp_kill_data: [],
@@ -111,19 +114,21 @@ const [Modal, modalApi] = useVbenModal({
 
 
 const userNumberList = [];
-[50, 60, 70, 80, 90, 100, 150, 200, 300, 400, 500].forEach((value) => {
+config.game_rounds.forEach((value) => {
 	userNumberList.push({
 		'label': value + '局',
 		'value': value,
 	})
 })
+
 const floatRateList = [];
-for(let i=1;i<=15;i++) {
+config.game_max_rtp.forEach((i) => {
 	floatRateList.push({
 		'label': i + '%',
 		'value': i,
 	})
-}
+})
+
 
 
 const [Form, formApi] = useVbenForm({

+ 14 - 11
apps/web-antd/src/views/game_control/feed_user/global/create.vue

@@ -10,18 +10,21 @@ import dayjs from "dayjs";
 import {updateFeedUserGlobalInfo, updateFeedUserGlobalStatus} from "#/api/game_control/feed_user_global.js";
 const title = ref('查看');
 
-let netIncomeList = [10, 20, 30, 50, 70, 100, 200, 500, 1000, 1500, 2000, 3000, 5000, 10000, 50000, 100000, 500000, 1000000];
-let turnoverMultipleList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 50, 100, 500, 1000, 5000];
-let evaluationPeriodList = [
-	{'label':'每日','value':1},
-	{'label':'每周','value':2},
-	{'label':'每月','value':3},
-	{'label':'终生','value':4},
-	{'label':'自选时间段','value':5},
-];
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
 
-let effectiveCountList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 50, 100, 1000];
-let triggerIntervalRoundsList = [5, 10, 15, 20, 30, 40, 50, 60, 80, 100, 150, 200, 300];
+let netIncomeList = config.net_income;
+let turnoverMultipleList = config.turnover_multiple;
+let evaluationPeriodList = [];
+for(let key in config.evaluation_period) {
+	evaluationPeriodList.push({
+		'value': key * 1,
+		'label': config.evaluation_period[key],
+	})
+}
+
+let effectiveCountList = config.effective_count;
+let triggerIntervalRoundsList = config.triggerInterval_rounds;
 
 // 添加或更新 {"uname":"115","net_income":100,"turnover_multiple":5,"evaluation_period":4,"effective_count":6,"trigger_interval_rounds":300}
 

+ 14 - 11
apps/web-antd/src/views/game_control/feed_user/list/create.vue

@@ -9,18 +9,21 @@ import {updateFeedUserInfo} from "#/api/game_control/feed_user_list.js";
 import dayjs from "dayjs";
 const title = ref('查看');
 
-let netIncomeList = [10, 20, 30, 50, 70, 100, 200, 500, 1000, 1500, 2000, 3000, 5000, 10000, 50000, 100000, 500000, 1000000];
-let turnoverMultipleList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 50, 100, 500, 1000, 5000];
-let evaluationPeriodList = [
-	{'label':'每日','value':1},
-	{'label':'每周','value':2},
-	{'label':'每月','value':3},
-	{'label':'终生','value':4},
-	{'label':'自选时间段','value':5},
-];
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
 
-let effectiveCountList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 50, 100, 1000];
-let triggerIntervalRoundsList = [5, 10, 15, 20, 30, 40, 50, 60, 80, 100, 150, 200, 300];
+let netIncomeList = config.net_income;
+let turnoverMultipleList = config.turnover_multiple;
+let evaluationPeriodList = [];
+for(let key in config.evaluation_period) {
+	evaluationPeriodList.push({
+		'value': key * 1,
+		'label': config.evaluation_period[key],
+	})
+}
+
+let effectiveCountList = config.effective_count;
+let triggerIntervalRoundsList = config.triggerInterval_rounds;
 
 // 添加或更新 {"uname":"115","net_income":100,"turnover_multiple":5,"evaluation_period":4,"effective_count":6,"trigger_interval_rounds":300}
 

+ 14 - 3
apps/web-antd/src/views/game_control/feed_user/record/index.vue

@@ -7,6 +7,18 @@ import dayjs from "dayjs";
 import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {getFeedUserList} from "#/api/game_control/feed_user_list.js";
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
+let recordStatusList = [];
+for(let key in config.record_status) {
+	recordStatusList.push({
+		'label': config.record_status[key],
+		'value': key
+	})
+}
+recordStatusList.reverse();
+
 // 列表筛选
 const filterData = reactive({
 	'search_type':"uname",
@@ -47,9 +59,8 @@ const formOptions = {
 				filterOption: true,
 				name:'status',
 				options: [
-					{'label':"全部","value":""},
-					{'label':"生效中","value":"1"},
-					{'label':"已结束","value":"0"},
+					{'label':$t('common.all'),"value":""},
+					...recordStatusList
 				],
 				placeholder: $t('common.placeholder_select'),
 				defaultValue: ""

+ 11 - 15
apps/web-antd/src/views/game_control/game_config/game_info.vue

@@ -7,6 +7,9 @@ import {getGameInfo, updateGameDetail} from "#/api/game_control/game_config.js";
 import { message } from 'ant-design-vue';
 const [messageApi, contextHolder] = message.useMessage();
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
 
 import { createIconifyIcon } from '@vben-core/icons';
 const AddIcon = createIconifyIcon('solar:add-circle-outline');
@@ -64,15 +67,8 @@ const [Modal, modalApi] = useVbenModal({
 	},
 });
 
-const rtpList = ref([70, 75, 80, 85, 90, 92, 93, 94, 95, 96, 96.5, 97, 98, 99, 102]);
-const maxGmList = ref([]);
-let diff = 50;
-for(let gm = 50; gm <= 100000; gm += diff) {
-	maxGmList.value.push(gm);
-	if(gm >= 1000) {
-		diff = 100;
-	}
-}
+const rtpList =  ref(config.rtp_config);
+const maxGmList = ref(config.max_multiple);
 
 // 添加押注金额
 const addDepositList = (value, idx) => {
@@ -103,12 +99,12 @@ const updateDefaultDeposit = () => {
 				</Select>
 				(设置玩家在游戏内的回报率)
 			</FormItem>
-			<FormItem label="返奖体验">
-				<Select style="width:30%;" v-model:value="form.rtp_type">
-					<SelectOption :value="2">仿正版</SelectOption>
-					<SelectOption :value="3">AI数值</SelectOption>
-				</Select>
-			</FormItem>
+<!--			<FormItem label="返奖体验">-->
+<!--				<Select style="width:30%;" v-model:value="form.rtp_type">-->
+<!--					<SelectOption :value="2">仿正版</SelectOption>-->
+<!--					<SelectOption :value="3">AI数值</SelectOption>-->
+<!--				</Select>-->
+<!--			</FormItem>-->
 			<FormItem label="止损止赢功能">
 				<Switch v-model:checked="form.terminal_spin" checked-children="开启" un-checked-children="关闭"></Switch>
 				(slot的AUTO附加功能,开启后,玩家在游戏内自动旋转时,可以设定条件,达到输赢条件停止自动旋转)

+ 4 - 3
apps/web-antd/src/views/game_control/player_control/list/create_player.vue

@@ -8,6 +8,9 @@ import {updatePlayerControlInfo} from "#/api/game_control/player_control.js";
 import { message } from 'ant-design-vue';
 const [messageApi, contextHolder] = message.useMessage();
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
 
 const filterGameList = ref([]);
 getGameMinList().then((data) => {
@@ -51,9 +54,7 @@ const [Modal, modalApi] = useVbenModal({
 });
 
 
-const rtpList = [
-	70, 75, 80, 85, 90, 92, 93, 94, 95, 96, 96.5, 97, 99, 102
-];
+const rtpList = config.rtp_config;
 let rtpSelectList = [];
 rtpList.forEach((value, index) => {
 	rtpSelectList.push({

+ 13 - 2
apps/web-antd/src/views/log/agent/login/index.vue

@@ -7,6 +7,18 @@ import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {Card, Input, InputGroup, Select, SelectOption, Tag} from "ant-design-vue";
 import {getLogUserLoginList} from "#/api/log/log_login.js";
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
+let loginStatusList = [];
+for(let key in config.login_status) {
+	loginStatusList.push({
+		'value': key,
+		'label': config.login_status[key]
+	})
+}
+loginStatusList.reverse();
+
 const disabledDate = (current) => {
 	return current && current > dayjs().endOf('day');
 };
@@ -51,8 +63,7 @@ const formOptions = {
 				name:'login_status',
 				options: [
 					{label: $t('common.all'), value: ""},
-					{label: $t('common.success'), value: "1"},
-					{label: $t('common.error'), value: "0"},
+					...loginStatusList
 				],
 				placeholder: $t('common.placeholder_select'),
 				// showSearch: true,

+ 13 - 2
apps/web-antd/src/views/log/agent/operation/index.vue

@@ -7,6 +7,18 @@ import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {Card, Input, InputGroup, Select, SelectOption, Tag} from "ant-design-vue";
 import {getLogBehaviorList} from "#/api/log/log_operation.js";
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
+let behaviorStatusList = [];
+for(let key in config.behavior_status) {
+	behaviorStatusList.push({
+		'value': key,
+		'label': config.behavior_status[key]
+	})
+}
+behaviorStatusList.reverse();
+
 const disabledDate = (current) => {
 	return current && current > dayjs().endOf('day');
 };
@@ -52,8 +64,7 @@ const formOptions = {
 				name:'behavior_status',
 				options: [
 					{label: $t('common.all'), value: ""},
-					{label: $t('common.success'), value: "1"},
-					{label: $t('common.error'), value: "0"},
+					...behaviorStatusList
 				],
 				placeholder: $t('common.placeholder_select'),
 			},

+ 13 - 3
apps/web-antd/src/views/player_data/funds_change/index.vue

@@ -9,6 +9,18 @@ import {useVbenForm} from "#/adapter/form.js";
 import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {getGameOrderList} from "#/api/player/funds_change.js";
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
+let orderStatusList = [];
+for(let key in config.order_status) {
+	orderStatusList.push({
+		'value':key,
+		'label': config.order_status[key]
+	});
+}
+orderStatusList.reverse();
+
 
 // 列表筛选
 const filterData = reactive({
@@ -89,9 +101,7 @@ const formOptions = {
 				name:'order_status',
 				options: [
 					{label: $t('common.all'), value: ""},
-					{label: $t('common.success'), value: "2"},
-					{label: $t('common.abnormal'), value: "0"},
-					{label: $t('common.warn'), value: "1"},
+					...orderStatusList,
 				],
 				placeholder: $t('common.placeholder_select'),
 				// showSearch: true,

+ 14 - 4
apps/web-antd/src/views/player_data/game_records/index.vue

@@ -10,6 +10,19 @@ import {getGameMinList} from "#/api/game_control/game_config.js";
 import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {getGameRecordList} from "#/api/player/game_records.js";
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
+
+let playTypeList = [];
+for(let key in config.play_type) {
+	playTypeList.push({
+		'value':key,
+		'label': config.play_type[key]
+	});
+}
+
+
+
 // 列表筛选
 const filterData = reactive({
 	'search_type':"uname",
@@ -89,10 +102,7 @@ const formOptions = {
 				name:'bet_game_play_type',
 				options: [
 					{label: $t('common.all'), value: ""},
-					{label: $t('player_data.gameRecords.eliminate'), value: "1"},
-					{label: $t('player_data.gameRecords.free_rotate'), value: "2"},
-					{label: $t('player_data.gameRecords.re_turn'), value: "3"},
-					{label: $t('player_data.gameRecords.high_gm'), value: "4"},
+					...playTypeList
 				],
 				placeholder: $t('common.placeholder_select'),
 				// showSearch: true,

+ 10 - 3
apps/web-antd/src/views/player_data/transform_records/index.vue

@@ -8,7 +8,16 @@ import {useVbenForm} from "#/adapter/form.js";
 import {getTransferLogList} from "#/api/player/transfer_log.js";
 import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 
+import {useConfigStore} from '#/store/config';
+const {config} = useConfigStore();
 
+let transformStatusList = [];
+for(let key in config.transform_status) {
+	transformStatusList.push({
+		'value':key,
+		'label': config.transform_status[key]
+	});
+}
 // 列表筛选
 const filterData = reactive({
 	'search_type':"uname",
@@ -52,9 +61,7 @@ const formOptions = {
 				name:'status',
 				options: [
 					{label: $t('common.all'), value: ""},
-					{label: $t('common.success'), value: "1"},
-					{label: $t('common.error'), value: "0"},
-					{label: $t('common.warning'), value: "2"},
+					...transformStatusList
 				],
 				placeholder: $t('common.placeholder_select'),
 				// showSearch: true,