Просмотр исходного кода

🐞 fix(广告转换条件表单及游戏管理提交修改表单): 更改广告转化条件表单和游戏管理表单规则

广告转换条件表单中,广告id不再必填;
游戏管理表单中游戏ID限制为1-10个字符;
fxs 6 месяцев назад
Родитель
Сommit
2eff6f2f2e

+ 13 - 6
src/components/table/TableFieldText.vue

@@ -85,20 +85,27 @@ const hasTag = (): boolean => {
 }
 
 /**
- * 获取到对应的文本
- * 如果没有特殊效果,或者没有对应的翻译文本,则直接为原始版本
- * 否则按照对象或者数组的方式,分别处理
- * 数组直接按布尔值来确定,对象则根据传入值在翻译信息中的键来确定
- * @returns 转译后的文本
+ * 获取对应的文本值。
+ *
+ * 该函数根据 `specialEffect` 信息,返回适当的文本值:
+ * - 如果没有特殊效果或对应的翻译映射,则直接返回原始值。
+ * - 如果有特殊效果且存在 `translateMap`,则分两种情况处理:
+ *   - 如果 `translateMap` 是数组:根据布尔值决定返回数组中的第一个或第二个元素。
+ *   - 如果 `translateMap` 是对象:则根据 `val` 的值,获取 `translateMap` 中对应的键值。
+ *
+ * @returns {any} 转换后的文本值。若无翻译映射,返回原始 `val`;若有,则返回对应的翻译文本。
  */
 const getTableTextFieldVal = (): any => {
   let val = props.value
-  // console.log(JSON.parse(JSON.stringify(val)))
+
+  // 检查是否具有特殊效果以及翻译映射
   if (hasSpecialEffect() && hasTranslateMap()) {
     if (isArrTranslateMap()) {
+      // 处理数组情况:根据 `val` 的布尔值选择翻译映射中的第一个或第二个元素
       let translateMap = props.specialEffect.otherInfo.translateMap!
       val = Boolean(val) ? translateMap[0] : translateMap[1]
     } else {
+      // 处理对象情况:根据 `val` 获取 `translateMap` 中对应的键值
       val = props.specialEffect.otherInfo.translateMap![val]
     }
   }

+ 3 - 3
src/router/appManage.ts

@@ -2,8 +2,8 @@
  * @Author: fxs bjnsfxs@163.com
  * @Date: 2024-08-20 14:24:58
  * @LastEditors: fxs bjnsfxs@163.com
- * @LastEditTime: 2024-11-06 18:07:30
- * @FilePath: \Quantity-Creation-Management-Systemc:\Users\NINGMEI\Desktop\Game-Backstage-Management-System\src\router\appManage.ts
+ * @LastEditTime: 2024-11-21
+ * @FilePath: \Game-Backstage-Management-System\src\router\appManage.ts
  * @Description:
  *
  */
@@ -68,7 +68,7 @@ export default [
         name: 'UserConversion',
         icon: 'Crop',
         cnName: '广告转化条件',
-        component: () => import('@/views/AppManage/useConversionView.vue'),
+        component: () => import('@/views/AppManage/UseConversionView.vue'),
         meta: {
           activeMenu: 'userConversion',
           needKeepAlive: false

+ 7 - 6
src/views/AppManage/UserConversionDetail.vue

@@ -57,12 +57,7 @@ const fieldsInfo: Array<FormField> = [
     type: FormFieldType.INPUT,
     valueType: 'string'
   },
-  {
-    name: 'aid',
-    cnName: '广告ID',
-    type: FormFieldType.INPUT,
-    valueType: 'int'
-  },
+
   {
     name: 'type',
     cnName: '广告类型',
@@ -85,6 +80,12 @@ const fieldsInfo: Array<FormField> = [
     }
   },
   {
+    name: 'aid',
+    cnName: '广告ID',
+    type: FormFieldType.INPUT,
+    valueType: 'int'
+  },
+  {
     name: 'pid',
     cnName: '广告父ID',
     type: FormFieldType.INPUT,

+ 5 - 4
src/views/AppManage/UserConversionTable.vue

@@ -42,15 +42,16 @@ const tableFieldsInfo = reactive<Array<TableFieldInfo>>([
     isShow: true,
     needSort: false
   },
+
   {
-    name: 'aid',
-    cnName: '广告ID',
+    name: 'type',
+    cnName: '类型',
     isShow: true,
     needSort: false
   },
   {
-    name: 'type',
-    cnName: '类型',
+    name: 'aid',
+    cnName: '广告ID',
     isShow: true,
     needSort: false
   },

+ 2 - 2
src/views/Home/InfoManage/GameManageView.vue

@@ -118,9 +118,9 @@ const gameRules = reactive<FormRules<typeof gameFormRule>>({
     },
     {
       min: 1,
-      max: 64,
+      max: 10,
       trigger: 'blur',
-      message: '最短1位,最长64位'
+      message: '最短1位,最长10位'
     }
   ],
   ttAppid: [

+ 1 - 1
src/views/Home/InfoManage/PlayerManageView.vue

@@ -4,7 +4,7 @@ import type { FormRules } from 'element-plus'
 import type { FormField } from '@/types/form'
 import type { DialogConfig } from '@/types/dialog'
 
-import { FilterType, ColorType } from '@/types/table'
+import { FilterType } from '@/types/table'
 import { FieldSpecialEffectType, TagType, TextType } from '@/types/tableText'
 import { reactive, ref } from 'vue'
 import { ElMessageBox } from 'element-plus'

+ 2 - 2
vite.config.ts

@@ -2,7 +2,7 @@
  * @Author: fxs bjnsfxs@163.com
  * @Date: 2024-08-20 14:06:49
  * @LastEditors: fxs bjnsfxs@163.com
- * @LastEditTime: 2024-09-13 16:43:31
+ * @LastEditTime: 2024-11-14
  * @FilePath: \Game-Backstage-Management-System\vite.config.ts
  * @Description:
  *
@@ -101,7 +101,7 @@ export default defineConfig(({ mode }) => {
       }
     },
     esbuild: {
-      drop: mode === 'production' ? ['console', 'debugger'] : []
+      drop: mode === 'production' || mode === 'test' ? ['console', 'debugger'] : []
     },
     plugins: [
       vue(),