Explorar el Código

style(整个项目): 更新变量命名、删除无用代码

更新文件中的变量拼写错误;更新部分函数的注释描述;删除无用代码;
fxs hace 6 meses
padre
commit
ee361be2f8
Se han modificado 52 ficheros con 526 adiciones y 788 borrados
  1. 30 43
      src/components/Table.vue
  2. 5 4
      src/components/common/Dialog.vue
  3. 36 50
      src/components/common/WithIconSelect.vue
  4. 1 2
      src/components/dataAnalysis/DropDownSelection.vue
  5. 6 31
      src/components/dataAnalysis/HeaderCard.vue
  6. 3 11
      src/components/dataAnalysis/StatisticText.vue
  7. 5 21
      src/components/dataAnalysis/TemporalTrend.vue
  8. 14 21
      src/components/echarts/TimeLineChart.vue
  9. 5 5
      src/components/form/CustomFilter.vue
  10. 7 16
      src/components/form/FileUpload.vue
  11. 13 19
      src/components/form/Form.vue
  12. 22 25
      src/components/form/MyInput.vue
  13. 46 46
      src/components/table/TableFieldText.vue
  14. 1 1
      src/components/toolsBtn/FilterPopover.vue
  15. 5 2
      src/hooks/useAnalysis.ts
  16. 1 3
      src/hooks/useDialog.ts
  17. 7 7
      src/hooks/useForm.ts
  18. 3 3
      src/hooks/usePage.ts
  19. 3 4
      src/hooks/useRequest.ts
  20. 6 7
      src/hooks/useTable.ts
  21. 5 5
      src/main.ts
  22. 0 1
      src/router/home.ts
  23. 1 2
      src/router/index.ts
  24. 17 20
      src/stores/useCommon.ts
  25. 4 4
      src/types/dataAnalysis.ts
  26. 0 6
      src/types/res.ts
  27. 17 17
      src/types/table.ts
  28. 1 1
      src/types/tableText.ts
  29. 12 9
      src/utils/axios/axiosInstance.ts
  30. 42 67
      src/utils/common/index.ts
  31. 7 36
      src/utils/localStorage/localStorage.ts
  32. 4 5
      src/utils/resource/index.ts
  33. 9 12
      src/utils/table/table.ts
  34. 15 22
      src/utils/token/token.ts
  35. 4 4
      src/views/AppManage/BaseInfoView.vue
  36. 17 30
      src/views/AppManage/EventDetailsView.vue
  37. 47 53
      src/views/AppManage/EventManageView.vue
  38. 10 14
      src/views/AppManage/EventMangeTable.vue
  39. 6 11
      src/views/AppManage/UserConversionDetail.vue
  40. 2 2
      src/views/AppManage/UserConversionTable.vue
  41. 2 2
      src/views/Home/Analysis/AdvertisingUsers.vue
  42. 3 4
      src/views/Home/Analysis/EventAnalysisDetail.vue
  43. 8 11
      src/views/Home/Analysis/EventAnalysisTable.vue
  44. 6 8
      src/views/Home/Analysis/EventAnalysisView.vue
  45. 5 10
      src/views/Home/Analysis/KeepView.vue
  46. 3 4
      src/views/Home/Analysis/UserBehavior.vue
  47. 7 17
      src/views/Home/Analysis/UserTrendView.vue
  48. 4 5
      src/views/Home/InfoManage/GameManageView.vue
  49. 7 11
      src/views/Home/InfoManage/PlayerManageView.vue
  50. 1 8
      src/views/Home/Overview/OverView.vue
  51. 30 54
      src/views/Index.vue
  52. 11 12
      src/views/Login/LoginView.vue

+ 30 - 43
src/components/Table.vue

@@ -3,7 +3,6 @@
  * @Date: 2024-08-20 18:16:18
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-11-27
- * @FilePath: \SqueezeTheBusc:\Users\NINGMEI\Desktop\Manage\Game-Backstage-Management-System\src\components\Table.vue
  * @Description: 
  * 
 -->
@@ -14,19 +13,19 @@ import type { FormInstance } from 'element-plus'
 import { FilterType } from '@/types/table'
 import { FieldSpecialEffectType } from '@/types/tableText'
 
-import { initLoadResouce } from '@/utils/resource'
+import { initLoadResource } from '@/utils/resource'
 import { fuzzySearch, throttleFunc } from '@/utils/common'
-import { computed, onMounted, reactive, ref, toRaw, watch } from 'vue'
+import { useCustomFilter } from '@/hooks/useCustomFilter.ts'
 import { useTable } from '@/hooks/useTable'
 import { useRequest } from '@/hooks/useRequest'
+import { computed, onMounted, reactive, ref, toRaw, watch } from 'vue'
 import { Filter } from '@element-plus/icons-vue'
-import { useCustomFilter } from '@/hooks/useCustomFilter.ts'
 
 import CustomFilter from './form/CustomFilter.vue'
 import FilterPopover from './toolsBtn/FilterPopover.vue'
 import RefreshBtn from './toolsBtn/RefreshBtn.vue'
-import axiosInstance from '@/utils/axios/axiosInstance'
 import TableFieldText from './table/TableFieldText.vue'
+import axiosInstance from '@/utils/axios/axiosInstance'
 
 type CustomFilterRef = InstanceType<typeof CustomFilter>
 
@@ -64,7 +63,7 @@ const props = withDefaults(defineProps<PropsParams>(), {
   openPageQuery: false,
   needUpload: false,
   needDownLoad: false,
-  openRemoteinquiry: false
+  openRemoteQuery: false
 })
 
 // 父组件触发的方法
@@ -93,11 +92,11 @@ const paginationConfig = reactive<TablePaginationSetting>({
   currentPage: 1,
   limit: 0,
   total: 0,
-  pagesizeList: []
+  pageSizeList: []
 })
 
 // 请求配置
-const reqconfig = reactive<ReqConfig>({
+const reqConfig = reactive<ReqConfig>({
   url: '',
   otherOptions: {}
 })
@@ -188,13 +187,14 @@ const loadTableData = async (): Promise<boolean> => {
         try {
           // 如果开启了分页查询,那么要计算出需要展示的页码位置所对应的偏移量
           // 同时要将查询的条数改为对应的用户选择的展示条数
+
           if (props.openPageQuery) {
-            reqconfig.otherOptions.offset =
+            reqConfig.otherOptions.offset =
               (paginationConfig.currentPage - 1) * paginationConfig.limit
-            reqconfig.otherOptions.limit = paginationConfig.limit
+            reqConfig.otherOptions.limit = paginationConfig.limit
           }
-          // console.log(reqconfig.otherOptions)
-          await getTableData(reqconfig.url, reqconfig.otherOptions, props.openPageQuery)
+          // console.log(reqConfig.otherOptions)
+          await getTableData(reqConfig.url, reqConfig.otherOptions, props.openPageQuery)
 
           backupTableData.splice(0, backupTableData.length, ...tableData)
           resolve(true)
@@ -281,15 +281,13 @@ const resetTableData = () => {
  * @description: 按条件查询,如果开启了分页查询,那么会直接重新查询数据,否则,会根据现有数据进行查询
  */
 const queryTableData = () => {
-  if (props.openRemoteinquiry && props.requestConfig) {
-    // delUnusedCustomFilter()
-    // console.log('--------')
-    // console.log(props.requestConfig.otherOptions, queryFormData)
-    // console.log('-----------')
-    reqconfig.otherOptions = { ...props.requestConfig.otherOptions, ...queryFormData }
+  console.log(props.openRemoteQuery, props.requestConfig)
+  if (props.openRemoteQuery && props.requestConfig) {
+    reqConfig.otherOptions = { ...props.requestConfig.otherOptions, ...queryFormData }
     // 需要在查询前清除掉目前的数据,不然会导致之前缓存的数据混入
     //  比如第一页已经缓存了,在第二页重新查询,在切回第一页,还是显示查询前的数据,因为缓存没被清除
     tableData.splice(0, tableData.length)
+    console.log('执行')
     getData()
   } else {
     let filteredTable: any[]
@@ -321,13 +319,11 @@ const resetQueryFormData = () => {
     JSON.stringify(backupQueryFormData, (_, v) => (typeof v === 'undefined' ? '' : v))
   )
   Object.assign(queryFormData, data)
-  reqconfig.otherOptions = backupReqOtherOptions // 要把请求的参数也重置一次,不然切换平台等操作,会带着原来的查询参数请求
+  reqConfig.otherOptions = backupReqOtherOptions // 要把请求的参数也重置一次,不然切换平台等操作,会带着原来的查询参数请求
 }
 
 /**
  * @description: 重置整个查询表单,重置后,再请求一次全部表格
- * @param {*} formEl  表单对象
- * @return {*}
  */
 const resetQueryForm = () => {
   resetQueryFormData()
@@ -380,17 +376,8 @@ const tableCellStyle = (info: any) => {
 }
 
 /**
- *
- *
- *
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!严重BUG!!!!!!!!!!!!!!!!
- *
- *
- *
- *
- *
- *
- * @description: 监听litmit,currentpage的变化,改变后去重新请求数据
+
+ * @description: 监听limit,currentPage的变化,改变后去重新请求数据
  * 如果是limit的变化,则需要把当前页置为1
 
  */
@@ -414,7 +401,7 @@ const watchLimit = watch(
 )
 
 /**
- * 监听currentpage的变化,如果开启了分页查询,并且当前页发生变化,并且当前页的数据不存在,则重新请求数据
+ * 监听currentPage的变化,如果开启了分页查询,并且当前页发生变化,并且当前页的数据不存在,则重新请求数据
  */
 const watchCurPage = watch(
   () => paginationConfig.currentPage,
@@ -444,7 +431,7 @@ watch(
     if (newGid != oldGid) {
       // resetQueryForm(false)
       resetQueryFormData()
-      reqconfig.otherOptions.gid = newGid
+      reqConfig.otherOptions.gid = newGid
 
       getData()
     }
@@ -459,7 +446,7 @@ const watchPf = watch(
     if (newPf != oldPf) {
       // resetQueryForm(false)
       resetQueryFormData()
-      reqconfig.otherOptions.pf = newPf
+      reqConfig.otherOptions.pf = newPf
       getData()
     }
   },
@@ -513,7 +500,7 @@ if (!props.dataList) {
 /**
  * @description: 拷贝一份配置文件
  */
-const initpageConfig = () => {
+const initPageConfig = () => {
   Object.assign(paginationConfig, props.paginationConfig)
 }
 
@@ -521,7 +508,7 @@ const initpageConfig = () => {
  * @description: 初始化请求配置,用于把拷贝一份新的数据
  */
 const initReqConfig = () => {
-  Object.assign(reqconfig, props.requestConfig)
+  Object.assign(reqConfig, props.requestConfig)
 }
 
 /**
@@ -547,7 +534,7 @@ const tableSortChange = (data: { column: any; prop: string; order: any }) => {
   if (order === 'ascending') order = 'asc'
   else if (order === 'descending') order = 'desc'
   else order = ''
-  reqconfig.otherOptions.order = order
+  reqConfig.otherOptions.order = order
   getData()
 }
 
@@ -610,11 +597,11 @@ defineExpose({
 })
 
 onMounted(() => {
-  initpageConfig()
+  initPageConfig()
   initReqConfig()
   initFormData()
   initCustomFilterInfo(customFieldsList)
-  backupReqOtherOptions = reqconfig.otherOptions // 备份一份请求参数
+  backupReqOtherOptions = reqConfig.otherOptions // 备份一份请求参数
   // registerWatchProps()
   if (props.loadingState !== undefined) {
     loading.value = props.loadingState
@@ -623,7 +610,7 @@ onMounted(() => {
   // 但是这里又必须请求一次,因为有的页面数据是没有变化的
   getData()
   // 去加载所有需要的资源
-  initLoadResouce(resourceInfo).then((data) => {
+  initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
 })
@@ -818,7 +805,7 @@ onMounted(() => {
             align="center"
             show-overflow-tooltip
             v-if="item.isShow"
-            :sortable="item.needSort ? 'custorm' : false"
+            :sortable="item.needSort ? 'custom' : false"
           >
             <template v-slot="scope">
               <!-- 头像类 -->
@@ -887,7 +874,7 @@ onMounted(() => {
           class="userTablePagination"
           background
           :page-size="paginationConfig.limit"
-          :page-sizes="paginationConfig.pagesizeList"
+          :page-sizes="paginationConfig.pageSizeList"
           table-layout="fixed"
           layout="prev, pager, next ,jumper ,sizes,total,"
           :total="paginationConfig.total"

+ 5 - 4
src/components/common/Dialog.vue

@@ -49,8 +49,10 @@ const dialogConfig = reactive({
   type: 0 // 0 是新增 1是修改
 })
 
-// 游戏配置提交
-const submiteGameChange = () => {
+/**
+ * 游戏配置提交
+ */
+const submitGameChange = () => {
   dialogFormRef.value
     ?.submitFormData()
     .then(() => {
@@ -96,7 +98,6 @@ onMounted(() => {
  * @param {*} fields  字段名
  * @param {*} useFormField  是否对表单的字段加密
  * @param {*} encryptMsg  加密的消息
- * @return {*}
  */
 const encrypt = (fields: string, useFormField: boolean, encryptMsg: Array<string>) => {
   dialogFormRef.value?.encryptData(fields, useFormField, encryptMsg).finally(() => {
@@ -139,7 +140,7 @@ defineExpose({
         <div class="dialog-footer">
           <slot name="otherBtn"></slot>
           <slot name="btnGroup">
-            <el-button class="dialogBtn" type="primary" @click="submiteGameChange()">
+            <el-button class="dialogBtn" type="primary" @click="submitGameChange()">
               {{ configBtnText }}
             </el-button>
             <el-button class="dialogBtn" @click="closeDialog">取消</el-button>

+ 36 - 50
src/components/common/WithIconSelect.vue

@@ -3,14 +3,14 @@ import type { DropdownInstance } from 'element-plus'
 import type { IconDropdownItem } from '@/types/dataAnalysis'
 
 import { onMounted, ref, reactive, watch } from 'vue'
-import { initLoadResouce } from '@/utils/resource'
+import { initLoadResource } from '@/utils/resource'
 import { useCommonStore } from '@/stores/useCommon'
 
-const { selectInfo, tempMultipleChioce, saveSelectInfo, saveTempMultipleChioce } = useCommonStore()
+const { selectInfo, tempMultipleChoice, saveSelectInfo, saveTempMultipleChoice } = useCommonStore()
 
 interface DropdownInfo {
   isRadio?: boolean // 是否是单选
-  slectInfo: Array<IconDropdownItem>
+  selectInfo: Array<IconDropdownItem>
 }
 
 // props
@@ -19,20 +19,20 @@ const props = withDefaults(defineProps<DropdownInfo>(), {
 })
 
 // 下拉框
-const dromDownMenu = ref()
+const dropDownMenu = ref()
 
 /**
  * @description:  初始化选择信息
  * @return {*}
  */
 const selectBaseInfo = reactive<Array<IconDropdownItem>>(
-  JSON.parse(JSON.stringify(props.slectInfo))
+  JSON.parse(JSON.stringify(props.selectInfo))
 )
 
 // 判断是不是通过确认框关闭的。主要服务于多选的情况
 // 原理是因为点击确认关闭的话,确认事件会先触发,然后再触发关闭事件
 // 由此来去判断是否需要把多选框的信息恢复
-const isConfimClose = ref<Boolean>(false)
+const isConfirmClose = ref<Boolean>(false)
 
 // emits
 const emits = defineEmits(['changePf'])
@@ -57,11 +57,10 @@ const backupInfo = reactive<Array<IconDropdownItem>>([])
 
 /**
  * @description: 确认选择
- * 这里主要用于多选的情况使用,对于单选,即使点击确认按钮也不会有二次请求,因为seleinfo没有改变
- * @return {*}
+ * 这里主要用于多选的情况使用,对于单选,即使点击确认按钮也不会有二次请求,因为selectInfo没有改变
  */
 const confirmSelect = () => {
-  isConfimClose.value = true // 通过确认事件关闭
+  isConfirmClose.value = true // 通过确认事件关闭
   // 如果没有选中任何平台,则直接返回,不进行任何操作
   if (selectBaseInfo.filter((item) => item.isSelected).length === 0) {
     dropDownRef.value?.handleClose()
@@ -73,16 +72,15 @@ const confirmSelect = () => {
   if (props.isRadio) return
 
   // 去把state的数据更新一下
-  tempMultipleChioce.pf = selectBaseInfo.filter((item) => item.isSelected).map((item) => item.value)
+  tempMultipleChoice.pf = selectBaseInfo.filter((item) => item.isSelected).map((item) => item.value)
 
-  saveTempMultipleChioce() // 保存到本地
+  saveTempMultipleChoice() // 保存到本地
 }
 
 /**
  * @description: 取消选择,当取消选择后,需要恢复到原来的状态
- * @return {*}
  */
-const cancleSelect = () => {
+const cancelSelect = () => {
   dropDownRef.value?.handleClose()
   Object.assign(selectBaseInfo, backupInfo)
 }
@@ -90,7 +88,6 @@ const cancleSelect = () => {
 /**
  * @description: 下拉框出现与消失的处理
  * @param {*} state 展示状态,值为true或者false,代表打开或者关闭
- * @return {*}
  */
 const dropdownVis = (state: boolean) => {
   if (state) {
@@ -99,20 +96,22 @@ const dropdownVis = (state: boolean) => {
   } else {
     // 关闭的时候,如果一个都没有选中,那么就需要把备份的信息恢复回去
     // 这里只针对于多选情况,因为单选的逻辑中不存在一个都没有选中的情况,因为无法取消已经选中
-    // 而多选的情况下,因为即使可以取消,也不会立即改变selectInfo中的信息,只有点击了确认按钮才会改变,所以这里只需要恢复props的selectinfo就行了
+    // 而多选的情况下,因为即使可以取消,也不会立即改变selectInfo中的信息,只有点击了确认按钮才会改变,所以这里只需要恢复props的selectInfo就行了
 
     // 不是点击确认按钮关闭的多选框,且是多选按钮,也需要恢复
-    if (!selectBaseInfo.find((item) => item.isSelected) || (!isConfimClose.value && !props.isRadio))
+    if (
+      !selectBaseInfo.find((item) => item.isSelected) ||
+      (!isConfirmClose.value && !props.isRadio)
+    )
       Object.assign(selectBaseInfo, backupInfo)
 
-    if (isConfimClose.value) isConfimClose.value = false // 把状态重置
+    if (isConfirmClose.value) isConfirmClose.value = false // 把状态重置
   }
 }
 
 /**
  * @description: 选择事件,当目前可以选择或者是这个选项已经被选中的时候,就允许改变他的状态
  * @param {*} item  当前的选项信息
- * @return {*}
  */
 const selectPf = (item: any) => {
   if (props.isRadio) {
@@ -127,8 +126,7 @@ const selectPf = (item: any) => {
 }
 
 /**
- * @description: 同步selectinfo的信息到页面上
- * @return {*}
+ * @description: 同步selectInfo的信息到页面上
  */
 const syncSelectInfo = () => {
   selectBaseInfo.forEach((item) => {
@@ -137,18 +135,16 @@ const syncSelectInfo = () => {
 }
 
 /**
- * @description: 同步tempMultipleChioce的信息到页面上
- * @return {*}
+ * @description: 同步tempMultipleChoice的信息到页面上
  */
-const syncTempMultipleChioce = () => {
+const syncTempMultipleChoice = () => {
   selectBaseInfo.forEach((item) => {
-    item.isSelected = tempMultipleChioce.pf.includes(item.value)
+    item.isSelected = tempMultipleChoice.pf.includes(item.value)
   })
 }
 
 /**
- * @description: 监听selectinfo的变化,然后同步到页面上
- * @return {*}
+ * @description: 监听selectInfo的变化,然后同步到页面上
  */
 const watchSelectPf = watch(
   () => selectInfo.pf,
@@ -159,28 +155,26 @@ const watchSelectPf = watch(
 )
 
 /**
- * @description:  监听tempMultipleChioce的变化,然后同步到页面上
- * @return {*}
+ * @description:  监听tempMultipleChoice的变化,然后同步到页面上
  */
-const watchTempMultipleChioce = watch(
-  () => tempMultipleChioce.pf,
+const watchTempMultipleChoice = watch(
+  () => tempMultipleChoice.pf,
   () => {
-    syncTempMultipleChioce()
+    syncTempMultipleChoice()
   },
   { deep: true }
 )
 
 /**
- * @description: 根据本地保存的方案信息,去初始化selectinfo的信息
- * @return {*}
+ * @description: 根据本地保存的方案信息,去初始化selectInfo的信息
  */
 const initSelectInfo = () => {
   if (props.isRadio) {
-    watchTempMultipleChioce() // 如果是单选进来的,在这儿把多选的事件取消掉
+    watchTempMultipleChoice() // 如果是单选进来的,在这儿把多选的事件取消掉
     syncSelectInfo() // 同步一下数据
   } else {
     watchSelectPf() // 与上面同理
-    syncTempMultipleChioce() // 同理
+    syncTempMultipleChoice() // 同理
   }
 }
 
@@ -190,7 +184,7 @@ initSelectInfo()
 onMounted(() => {
   // isTourShowed.value = getPfSelectTourShowState() ?? false
   // 去加载所有需要的资源
-  initLoadResouce(resourceInfo).then((data) => {
+  initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
 })
@@ -204,7 +198,7 @@ onMounted(() => {
       :hide-on-click="props.isRadio"
       ref="dropDownRef"
     >
-      <span class="displayBox">
+      <div class="displayBox">
         <div class="displayIcon">
           <span class="iconItem" v-for="item in selectBaseInfo">
             <el-image
@@ -219,9 +213,9 @@ onMounted(() => {
         <el-icon class="el-icon--right">
           <arrow-down />
         </el-icon>
-      </span>
+      </div>
       <template #dropdown>
-        <el-dropdown-menu ref="dromDownMenu" :class="{ radioMenu: isRadio }">
+        <el-dropdown-menu ref="dropDownMenu" :class="{ radioMenu: isRadio }">
           <el-dropdown-item
             v-for="item in selectBaseInfo"
             :key="item.value"
@@ -235,14 +229,14 @@ onMounted(() => {
               :fit="'cover'"
             />
             <!-- 禁用掉原生的点击事件,自己实现点击 -->
-            <el-checkbox v-model="item.isSelected" size="small" @click.native.prevent="return" />
+            <el-checkbox v-model="item.isSelected" size="small" @click.native.prevent />
           </el-dropdown-item>
         </el-dropdown-menu>
         <span class="btnGroup" v-if="!isRadio">
           <el-button class="btnItem" size="small" type="primary" @click="confirmSelect"
             >确认</el-button
           >
-          <el-button class="btnItem" size="small" @click="cancleSelect">取消</el-button>
+          <el-button class="btnItem" size="small" @click="cancelSelect">取消</el-button>
         </span>
       </template>
     </el-dropdown>
@@ -255,7 +249,7 @@ onMounted(() => {
       :mask="false"
     >
       <el-tour-step
-        :target="dromDownMenu?.$el"
+        :target="dropDownMenu?.$el"
         title="多选框"
         placement="right-start"
         description="多选框需要点击确定后才会发送请求."
@@ -283,12 +277,4 @@ onMounted(() => {
   margin-right: 4px;
   margin-left: 4px;
 }
-
-.radioMenu > .selectItem {
-  padding-right: 15px !important;
-}
-
-.disabledSelect {
-  cursor: not-allowed !important;
-}
 </style>

+ 1 - 2
src/components/dataAnalysis/DropDownSelection.vue

@@ -18,8 +18,7 @@ const selectVal = ref()
 
 /**
  * @description: 改变选择,通知父组件
- * @param {*} val
- * @return {*}
+ * @param {*} val 新的选择值
  */
 const changeSelect = (val: any) => {
   emits('changeSelect', val)

+ 6 - 31
src/components/dataAnalysis/HeaderCard.vue

@@ -80,9 +80,8 @@ const pfSelectInfo = reactive<Array<IconDropdownItem>>([
 const breadcrumbCanClick = computed(() => breadcrumbList.length > 1)
 
 /**
- * @description: 返回总览,同时清除当前下标及之后的面包屑
+ * 返回总览,同时清除当前下标及之后的面包屑
  * @param {*} index 当前面包屑的下标
- * @return {*}
  */
 const goBack = (index: number) => {
   if (breadcrumbCanClick) {
@@ -93,9 +92,8 @@ const goBack = (index: number) => {
 }
 
 /**
- * @description: 日期改变通知父组件
+ * 日期改变通知父组件
  * @param {*} val 新日期
- * @return {*}
  */
 const dateChange = (val: Array<Date>) => {
   changeDateRange(val)
@@ -103,19 +101,17 @@ const dateChange = (val: Array<Date>) => {
 }
 
 /**
- * @description: 禁止选取今天之后的日期
- * @param {*} date
- * @return {*}
+ * 禁用日期
+ * @param time 时间
  */
 const disableDate = (time: Date) => {
   return time.getTime() > Date.now()
 }
 
 /**
- * @description: 添加导航栏的信息
+ * 添加导航栏的信息
  * @param {*} title 标题
  * @param {*} pathName 对应的路由name
- * @return {*}
  */
 const addPath = (title: string, pathName: string) => {
   breadcrumbList.push({ title, pathName })
@@ -123,7 +119,6 @@ const addPath = (title: string, pathName: string) => {
 
 /**
  * @description: 当跳转到其他页面的时候,就需要清除掉这里的面包屑导航
- * @return {*}
  */
 const clearBreadcrumb = () => {
   let nowName = router.currentRoute.value.name
@@ -139,8 +134,6 @@ const clearBreadcrumb = () => {
 
 /**
  * @description: 监控当前路由,每次路由改变都要去执行clearBreadcrumb,来判断是否需要清除当前面包屑
- * @param {*} watch
- * @return {*}
  */
 const watchRoute = watch(
   () => [router.currentRoute.value],
@@ -191,7 +184,7 @@ onMounted(() => {
     <div class="selectBox" v-if="props.needPfSelect">
       <el-divider direction="vertical" />
       <div class="selectItem">
-        <WithIconSelect :is-radio="props.isRadio" :slect-info="pfSelectInfo"></WithIconSelect>
+        <WithIconSelect :is-radio="props.isRadio" :select-info="pfSelectInfo"></WithIconSelect>
       </div>
     </div>
     <div v-if="props.openDateSelect" class="datePicker">
@@ -264,24 +257,6 @@ onMounted(() => {
   border-radius: 4%;
 }
 
-.canSelect {
-  background-color: #cce3f8;
-  color: black;
-}
-
-.selected {
-  background-color: #2d8cf0;
-}
-
-.disableSelect {
-  color: #c7c9cc;
-  background-color: white;
-}
-
-.disableSelect:hover {
-  cursor: no-drop;
-}
-
 .divLine {
   margin: 0 5px;
 }

+ 3 - 11
src/components/dataAnalysis/StatisticText.vue

@@ -17,7 +17,6 @@ const dataState = ref(false) // 数据是否加载成功
  * @description: 创建dataList数组
  * @param {*} fieldsInfo 字段信息
  * @param {*} getValue 获取值的函数
- * @return {*}
  */
 const createDataList = (fieldsInfo: Array<StaticField>, getValue: (item: StaticField) => any) => {
   return fieldsInfo.map((item) => ({
@@ -29,7 +28,6 @@ const createDataList = (fieldsInfo: Array<StaticField>, getValue: (item: StaticF
 
 /**
  * @description: 用于获取数据
- * @return {*}
  */
 const getData = async () => {
   try {
@@ -57,7 +55,7 @@ const getData = async () => {
 }
 
 /**
- * @description: 监听requesconfig的变化,一旦变化就重新请求
+ * @description: 监听requestConfig的变化,一旦变化就重新请求
  * @return {*}
  */
 watch(
@@ -91,7 +89,7 @@ onMounted(() => {
           <span :class="titleClass ? titleClass : 'dataTitle'">{{ item.cnName }}</span>
         </div>
         <div class="body">
-          <span :class="valueClass ? valueClass : 'value'">{{ item.value }}</span>
+          <span :class="valueClass ? valueClass : 'chartStaticValue'">{{ item.value }}</span>
           <span class="compare" v-if="item.compareVal">
             <span>
               {{ decimalToPercentage((item.value - item.compareVal) / item.compareVal) }}
@@ -140,18 +138,12 @@ onMounted(() => {
   line-height: 16px;
 }
 
-.value {
+.chartStaticValue {
   font-size: 28px;
   padding-right: 12px;
   line-height: 48px;
 }
 
-.chartStaticValue {
-  font-size: 24px;
-  color: #1c2438;
-  font-weight: 500;
-}
-
 .compare {
   font-size: 12px;
   box-sizing: border-box;

+ 5 - 21
src/components/dataAnalysis/TemporalTrend.vue

@@ -62,8 +62,7 @@ const initPageConfig = {
   limit: 6, // 每页展示个数
   currentPage: 1, // 当前页码
   total: 0, // 数据总数
-  pagesizeList: [6], // 页数大小列表
-  hasLodingData: 0 // 已经加载的数据
+  pageSizeList: [6] // 页数大小列表
 }
 
 // 配置表格分页数据
@@ -92,7 +91,6 @@ let chartInfo = reactive<OptionsProps>({
 /**
  * @description: 改变图表形式,当是表格的时候,去执行表格的获取数据方法,拿到最新的数据
  * @param {*} type 图表的展现形式,可以使table或者trend,1为图,2为表
- * @return {*}
  */
 const changeSelectShape = (type: number) => {
   if (selectShape.value === type) return
@@ -106,7 +104,6 @@ const changeSelectShape = (type: number) => {
 
 /**
  * @description: 生成表格字段信息,必须要调用,因为legend的字段也依赖这里
- * @return {*}
  */
 
 const createTableField = () => {
@@ -128,7 +125,6 @@ const createTableField = () => {
 /**
  * @description: 生成表格需要的信息,包括表格的字段信息及表格数据
  * @param {*} data  返回的data数据
- * @return {*} 返回生成x轴信息和所有的数据
  */
 const createTableData = (data: any) => {
   // 图表的x轴信息
@@ -164,7 +160,6 @@ const createTableData = (data: any) => {
 /**
  * @description: 生成图表的信息
  * @param {*} data 返回的数据
- * @return {*}
  */
 const createOptions = (data: any) => {
   const valInfo: any = {}
@@ -191,7 +186,6 @@ const createOptions = (data: any) => {
 
 /**
  * @description: 有tab页的情况下对数据进行缓存
- * @return {*}
  */
 
 const setCacheData = (isUse: boolean = false) => {
@@ -219,7 +213,6 @@ const setCacheData = (isUse: boolean = false) => {
 
 /**
  * @description: 清除缓存数据
- * @return {*}
  */
 const clearCacheData = () => {
   Object.keys(cacheData).forEach((key) => delete cacheData[key])
@@ -228,7 +221,6 @@ const clearCacheData = () => {
 /**
  * @description: 监测数据是否合法,看其中的x轴信息和折线图数据是否齐全
  * @param {*} data  返回的数据
- * @return {*}
  */
 const isLegalData = (data: any): boolean => {
   let x = data[props.resDataFieldsInfo['xAxis']]
@@ -239,7 +231,6 @@ const isLegalData = (data: any): boolean => {
 /**
  * @description: 获取数据,如果有tab页的话同时缓存数据
  * @param {*} type  如果有type的话,type为请求的不同类型的数据
- * @return {*}
  */
 const getData = async (type: number) => {
   loadDataState.state = false
@@ -299,8 +290,7 @@ const getData = async (type: number) => {
 
 /**
  * @description: 当标签页切换的时候,重新获取数据,如果有缓存数据则直接使用缓存数据
- * @param {*} tabName 对应的tabName,去tabinfo中找到对应的url
- * @return {*}
+ * @param {*} tabName 对应的tabName,去tabInfo中找到对应的url
  */
 const tabChange = async (tabName: string) => {
   if (props.tabInfo) {
@@ -314,7 +304,7 @@ const tabChange = async (tabName: string) => {
   }
 }
 
-// 在挂载之前给requestinfo赋值,不然会导致watch在挂载的时候执行一次
+// 在挂载之前给requestInfo赋值,不然会导致watch在挂载的时候执行一次
 Object.assign(requestInfo, props.requestConfig)
 
 /**
@@ -368,7 +358,7 @@ onMounted(() => {
         </span>
 
         <div class="chartContent" v-if="selectShape === 1">
-          <div class="yesterDayDataBox">
+          <div class="yesterdayDataBox">
             <StatisticText
               v-if="staticFields && loadDataState.state"
               :fields-info="statisticFieldsInfo"
@@ -443,13 +433,7 @@ onMounted(() => {
   position: relative;
 }
 
-.tabItem {
-  position: relative;
-  width: 100%;
-  height: 365px;
-}
-
-.yesterDayDataBox {
+.yesterdayDataBox {
   position: absolute;
   left: 24px;
   top: 0;

+ 14 - 21
src/components/echarts/TimeLineChart.vue

@@ -14,7 +14,7 @@ const props = defineProps<OptionsProps>()
 const attrs = useAttrs()
 
 // 图表实例
-const linechart = shallowRef()
+const lineChart = shallowRef()
 
 // 图表Ref
 const chart = ref()
@@ -53,7 +53,7 @@ const formatterTooltip = (params: Array<any>) => {
 // 尺寸变化
 const changeSize = () => {
   nextTick(() => {
-    linechart.value?.resize()
+    lineChart.value?.resize()
   })
 }
 
@@ -114,21 +114,21 @@ const initOptions = () => {
     smooth: true
   }
 
-  linechart.value.clear()
+  lineChart.value.clear()
 
   if (props.seriesData.length) {
-    // 最终的siries数组
+    // 最终的series数组
     let finalSeriesList: any = []
 
     props.legendData.map((item, index) => {
       const seriesClone = JSON.parse(JSON.stringify(baseSeries))
       // 设置克隆的属性
       seriesClone.name = item
-      let reuslt = props.seriesData.find((val) => {
+      let result = props.seriesData.find((val) => {
         return val.name === item
       })
 
-      seriesClone.data = Object.values(reuslt.data)
+      seriesClone.data = Object.values(result.data)
       seriesClone.itemStyle.borderColor = colorList[index]
       seriesClone.lineStyle.color = colorList[index]
 
@@ -153,13 +153,13 @@ const initOptions = () => {
     }
   }
 
-  linechart.value.setOption(options, true)
+  lineChart.value.setOption(options, true)
 }
 
 // 改变加载状态
 const changeLoading = (state: boolean) => {
-  if (state) linechart.value.showLoading()
-  else linechart.value.hideLoading()
+  if (state) lineChart.value.showLoading()
+  else lineChart.value.hideLoading()
 }
 
 // 监听options信息的变化
@@ -173,8 +173,8 @@ watch(
 
 watch(
   () => attrs['loading-state'] as boolean,
-  (newval: boolean) => {
-    changeLoading(newval)
+  (newVal: boolean) => {
+    changeLoading(newVal)
   },
   { deep: true }
 )
@@ -182,13 +182,13 @@ watch(
 onMounted(() => {
   nextTick(() => {
     // 开始的时候,不要去直接初始化,先展示加载状态,等到数据加载完状态改变,再去设置
-    linechart.value = echarts.init(chart.value)
+    lineChart.value = echarts.init(chart.value)
 
     if (!attrs['loading-state']) initOptions()
 
     /**
      * @description: 只监听window会导致当侧边栏缩放时,dom大小变化但无法resize
-     *              所以需要使用ovserver对整个dom进行监听
+     *              所以需要使用observer对整个dom进行监听
      * @return {*}
      */
     // window.addEventListener('resize', debounceFunc(changeSize, 500))
@@ -203,11 +203,4 @@ onMounted(() => {
   <div class="chart" ref="chart" style="width: 100%; height: 365px"></div>
 </template>
 
-<style scoped>
-.t {
-  color: red;
-  display: inline-block;
-  box-sizing: border-box;
-  padding-right: 20px;
-}
-</style>
+<style scoped></style>

+ 5 - 5
src/components/form/CustomFilter.vue

@@ -113,7 +113,7 @@ defineExpose({
 </script>
 
 <template>
-  <div class="custromFilter">
+  <div class="customFilter">
     <div class="filterHeader">
       <div class="filterTool">
         <el-button
@@ -125,7 +125,7 @@ defineExpose({
         >
       </div>
     </div>
-    <div class="filterContiner">
+    <div class="filterContainer">
       <div class="filterItem" v-for="(item, index) in filterList">
         <div class="filterCondition">
           <el-select
@@ -197,7 +197,7 @@ defineExpose({
 </template>
 
 <style scoped>
-.custromFilter {
+.customFilter {
   position: relative;
 }
 
@@ -207,7 +207,7 @@ defineExpose({
   justify-content: flex-end;
 }
 
-.filterContiner {
+.filterContainer {
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -216,7 +216,7 @@ defineExpose({
 
 .filterItem {
   width: 80%;
-  margin: 10 auto;
+  margin: 10px auto;
   padding: 24px;
   display: flex;
   /* justify-content: space-around; */

+ 7 - 16
src/components/form/FileUpload.vue

@@ -15,7 +15,7 @@ const loading = ref(false)
 const uploadRef = ref<UploadInstance>()
 
 // 侧边弹出框组件
-const tipVisisble = ref(false)
+const tipVisible = ref(false)
 
 // 上传成功的对外回调
 const emits = defineEmits(['uploadSuccess'])
@@ -25,7 +25,6 @@ defineProps<UploadProps>()
 
 /**
  * @description: 上传文件相关的所有信息
- * @return {*}
  */
 const uploadInfo = reactive({
   uploadVisible: false
@@ -33,7 +32,6 @@ const uploadInfo = reactive({
 
 /**
  * @description: 上传前对文件的处理
- * @return {*}
  */
 const beforeUpload = (file: UploadRawFile) => {
   if (!file) return false // 取消上传
@@ -43,9 +41,9 @@ const beforeUpload = (file: UploadRawFile) => {
   reader.readAsText(file)
   reader.onload = function () {
     try {
-      const finnalResult = reader.result as string
+      const finalResult = reader.result as string
 
-      emits('uploadSuccess', JSON.parse(finnalResult))
+      emits('uploadSuccess', JSON.parse(finalResult))
       state = true
     } catch {
       ElMessage.error('文件内容不是JSON格式,上传失败')
@@ -56,7 +54,6 @@ const beforeUpload = (file: UploadRawFile) => {
 
 /**
  * @description: 准备开始上传
- * @return {*}
  */
 const startUpload = () => {
   uploadInfo.uploadVisible = true
@@ -64,7 +61,6 @@ const startUpload = () => {
 
 /**
  * @description: 取消上传
- * @return {*}
  */
 const cancelUpload = () => {
   uploadInfo.uploadVisible = false
@@ -72,7 +68,6 @@ const cancelUpload = () => {
 
 /**
  * @description: 确认上传
- * @return {*}
  */
 const confirmUpload = () => {
   uploadRef.value?.submit()
@@ -81,7 +76,6 @@ const confirmUpload = () => {
 /**
  * @description:处理超出文件数量限制后的方法,这里是直接覆盖掉
  * @param {*} files 上传的文件
- * @return {*}
  */
 const handleExceed = (files: UploadRawFile[]) => {
   uploadRef.value!.clearFiles()
@@ -92,15 +86,13 @@ const handleExceed = (files: UploadRawFile[]) => {
 
 /**
  * @description: 打开提示
- * @return {*}
  */
 const openTip = () => {
-  tipVisisble.value = true
+  tipVisible.value = true
 }
 
 /**
  * @description: 关闭掉上传组件
- * @return {*}
  */
 const closeUpload = () => {
   uploadRef.value?.clearFiles()
@@ -110,7 +102,6 @@ const closeUpload = () => {
 
 /**
  * @description: 上传结束的回调
- * @return {*}
  */
 const uploadCallback = () => {
   uploadInfo.uploadVisible = false // 关闭上传框
@@ -164,7 +155,7 @@ defineExpose({
         </div>
       </template>
     </el-dialog>
-    <el-drawer v-model="tipVisisble" :direction="'rtl'">
+    <el-drawer v-model="tipVisible" :direction="'rtl'">
       <template #header>
         <h4>上传文件格式</h4>
       </template>
@@ -228,12 +219,12 @@ defineExpose({
             }
         ],
         // 新增
-        // 如果不存在这个actionid则视为新增
+        // 如果不存在这个actionId则视为新增
         "888":[
             {
               "actionId": 456,
                 "optionId": "ba",
-                "optionName": "bgbb",
+                "optionName": "test",
                 "optionType": "int",
                 "status": 0
             }

+ 13 - 19
src/components/form/Form.vue

@@ -6,7 +6,8 @@ import { FormFieldType } from '@/types/form'
 import { reactive, ref } from 'vue'
 import { useForm } from '@/hooks/useForm'
 
-import CryptoJS from 'crypto-js'
+// import CryptoJS from 'crypto-js'
+import { HmacMD5 } from 'crypto-js'
 
 const { submitForm } = useForm()
 interface FormProp {
@@ -32,22 +33,21 @@ const backupData = reactive<Record<string, any>>({})
 
 /**
  * @description: 表单数据提交
- * @return {*}
  */
 const submitFormData = (otherOption?: any) => {
-  return new Promise((reslove, reject) => {
+  return new Promise((resolve, reject) => {
     Object.assign(formData, props.config.reqConfig.otherOptions.formData)
     for (let item in formData) {
       if (typeof formData[item] === 'string') {
         formData[item] = formData[item].trim()
       }
     }
-    formRef.value?.validate(async (vaild: boolean) => {
-      if (vaild) {
+    formRef.value?.validate(async (valid: boolean) => {
+      if (valid) {
         submitForm(formRef.value, props.config.reqConfig.url, { ...formData, ...otherOption })
           .then(() => {
             emits('subForm', JSON.parse(JSON.stringify(formData)))
-            reslove(true)
+            resolve(true)
           })
           .catch((err) => {
             reject(err)
@@ -61,7 +61,6 @@ const submitFormData = (otherOption?: any) => {
 
 /**
  * @description: 重置表单为空
- * @return {*}
  */
 const resetForm = () => {
   formRef.value?.resetFields()
@@ -70,7 +69,6 @@ const resetForm = () => {
 /**
  * @description: 填充表单
  * @param {*} row 传过来的数据
- * @return {*}
  */
 const fillForm = (row: any) => {
   Object.assign(formData, row)
@@ -78,7 +76,6 @@ const fillForm = (row: any) => {
 
 /**
  * @description: 开启编辑的时候备份一下data
- * @return {*}
  */
 const backupFormData = () => {
   Object.assign(backupData, formData)
@@ -86,7 +83,6 @@ const backupFormData = () => {
 
 /**
  * @description: 恢复表单数据
- * @return {*}
  */
 const resumeFormData = () => {
   Object.assign(formData, backupData)
@@ -94,7 +90,6 @@ const resumeFormData = () => {
 
 /**
  * @description: 清除表单的验证信息
- * @return {*}
  */
 const clearValid = () => {
   formRef.value?.clearValidate()
@@ -107,19 +102,18 @@ const clearValid = () => {
  * @param {*} fields  加密的字段
  * @param {*} useFormField  是否使用表单的数据生成加密消息
  * @param {*} encryptMsg  加密的消息或者是需要加密的表单的字段名
- * @return {*}
  */
 const encryptData = (fields: string, useFormField: boolean, encryptMsg: Array<string>) => {
-  return new Promise((reslove, reject) => {
+  return new Promise((resolve, reject) => {
     let message = ``
-    let fieldData = ``
+    let fieldData: string = ''
     encryptMsg.map((item) => {
       message += useFormField ? formData[item] : item
     })
-    fieldData = CryptoJS.HmacMD5(message, formData[fields]).toString()
+    fieldData = HmacMD5(message, formData[fields]).toString()
     submitFormData({ [fields]: fieldData })
       .then(() => {
-        reslove(true)
+        resolve(true)
       })
       .catch((err) => {
         reject(err)
@@ -129,7 +123,7 @@ const encryptData = (fields: string, useFormField: boolean, encryptMsg: Array<st
 
 /**
  * @description: 获取表单的数据
- * @return {*}
+
  */
 const getFormData = () => {
   return JSON.parse(JSON.stringify(formData))
@@ -165,7 +159,7 @@ defineExpose({
         <el-form-item
           :prop="item.name"
           :label="item.cnName"
-          :class="['formItem', item.type === FormFieldType.RICHTEXT ? 'richtextItem' : '']"
+          :class="['formItem', item.type === FormFieldType.RICHTEXT ? 'richTextItem' : '']"
         >
           <el-input
             style="width: 300px"
@@ -229,7 +223,7 @@ defineExpose({
   justify-content: center;
 }
 
-.richtextItem {
+.richTextItem {
   flex-basis: 100%;
 }
 </style>

+ 22 - 25
src/components/form/MyInput.vue

@@ -13,36 +13,37 @@ import type { RuleInfo } from '@/types/input'
 import { onMounted, ref } from 'vue'
 
 interface InputInfo {
-  modelValue: string
   pInputType: string
-  pinputRules: RuleInfo
+  inputRules: RuleInfo
   placeholder: string
 }
 
+// 双向绑定值
+const model = defineModel()
+
 const props = defineProps<InputInfo>()
 
 // 通过update去更新props上的v-model数据
-const emits = defineEmits(['validateInput', 'update:modelValue'])
+const emits = defineEmits(['validateInput'])
 
-let inputType = ref(props.pInputType) // 主要用于更改pasword框的类型,因为props的type是只读的,所以额外创建一个
+let inputType = ref(props.pInputType) // 主要用于更改password框的类型,因为props的type是只读的,所以额外创建一个
 
 const isPassword = ref(false) // 是否时password框
 
 const inputDivRef = ref() // input框外的整个div
 const inputRef = ref() // input框
 
-let passwordVisiable = ref(false) // 密码是否可见
+let passwordVisible = ref(false) // 密码是否可见
 let activeClass = ref(false) // 是否被选中
 let showTip = ref(false) // 是否展示提示框
 let errorMsg = ref('') // 提示的内容
 
 /**
  * @description: 改变密码框可见性
- * @return {*}
  */
 const changeVisible = () => {
-  passwordVisiable.value = !passwordVisiable.value
-  if (passwordVisiable.value) {
+  passwordVisible.value = !passwordVisible.value
+  if (passwordVisible.value) {
     inputType.value = 'text'
   } else {
     inputType.value = 'password'
@@ -51,31 +52,28 @@ const changeVisible = () => {
 
 /**
  * @description: 验证input框是否符合规则
- * @param {*} let
- * @return {*}
  */
 const verifyIpt = () => {
-  let rulesInfo = props.pinputRules
+  let rulesInfo = props.inputRules
   if (rulesInfo) {
-    let vaild = rulesInfo.rules.every((item) => {
+    let valid = rulesInfo.rules.every((item) => {
       errorMsg.value = item.errMsg
 
       return item.validator()
     })
 
-    showTip.value = !vaild
-    if (vaild) errorMsg.value = ''
+    showTip.value = !valid
+    if (valid) errorMsg.value = ''
   }
 }
 
 /**
  * @description: 同步input框数据
  * @param {*} val
- * @return {*}
  */
-const updateValue = (val: any) => {
-  emits('update:modelValue', val.target.value)
-}
+// const updateValue = (val: any) => {
+//   emits('update:modelValue', val.target.value)
+// }
 
 onMounted(() => {
   // 点击输入框则聚焦,并给边框
@@ -108,16 +106,16 @@ onMounted(() => {
         <div class="inputContent">
           <input
             ref="inputRef"
-            :class="['inputBody', { txtTopassword: inputType === 'password' }]"
+            :class="['inputBody', { txtTopPassword: inputType === 'password' }]"
             type="text"
-            @input="updateValue"
+            v-model="model"
             @blur="verifyIpt"
             :placeholder="placeholder"
           />
         </div>
 
-        <div class="inputVisble" v-if="props.pInputType === 'password'" @click="changeVisible">
-          <el-icon v-if="passwordVisiable" class="iconItem">
+        <div class="inputVisible" v-if="props.pInputType === 'password'" @click="changeVisible">
+          <el-icon v-if="passwordVisible" class="iconItem">
             <icon-ic-baseline-visibility></icon-ic-baseline-visibility>
           </el-icon>
           <el-icon v-else class="iconItem">
@@ -144,7 +142,6 @@ onMounted(() => {
   cursor: text;
   border: 1px solid transparent;
   display: flex;
-  align-items: center;
   box-sizing: border-box;
   transition: background-color 0.2s;
 }
@@ -194,14 +191,14 @@ onMounted(() => {
   height: 100%;
 }
 
-.inputVisble {
+.inputVisible {
   height: 100%;
   padding-left: 12px;
   cursor: pointer;
 }
 
 /* 需要生成密码框的时候,将输入文字改为点状 */
-.txtTopassword {
+.txtTopPassword {
   -webkit-text-security: disc;
 }
 

+ 46 - 46
src/components/table/TableFieldText.vue

@@ -5,7 +5,7 @@ import { TagType, TextType } from '@/types/tableText'
 import { computed } from 'vue'
 
 const props = defineProps<{
-  specialEffect: SpecialEffectText
+  specialEffect?: SpecialEffectText
   value: any
 }>()
 
@@ -30,13 +30,14 @@ function formatDateToYYYYMMDD(dateInput: string | Date): string {
 
   return `${year}-${month}-${day}`
 }
+
 /**
  * 判断是否存在特殊效果信息。
  *
  * @returns {boolean} 如果 `specialEffect` 存在则返回 `true`,否则返回 `false`。
  */
 const hasSpecialEffect = (): boolean => {
-  return props.specialEffect !== undefined
+  return !!props.specialEffect
 }
 
 /**
@@ -45,7 +46,7 @@ const hasSpecialEffect = (): boolean => {
  * @returns {boolean} 如果 `specialEffect` 存在且包含 `translateMap`,则返回 `true`,否则返回 `false`。
  */
 const hasTranslateMap = (): boolean => {
-  return hasSpecialEffect() && props.specialEffect.otherInfo.translateMap !== undefined
+  return hasSpecialEffect() && props.specialEffect!.otherInfo.translateMap !== undefined
 }
 
 /**
@@ -54,7 +55,7 @@ const hasTranslateMap = (): boolean => {
  * @returns {boolean} 如果 `translateMap` 存在且为数组类型,则返回 `true`,否则返回 `false`。
  */
 const isArrTranslateMap = (): boolean => {
-  return hasTranslateMap() && Array.isArray(props.specialEffect.otherInfo.translateMap)
+  return hasTranslateMap() && Array.isArray(props.specialEffect!.otherInfo.translateMap)
 }
 
 /**
@@ -63,7 +64,7 @@ const isArrTranslateMap = (): boolean => {
  * @returns {boolean} 如果 `specialEffect` 存在且包含 `color` 属性,则返回 `true`,否则返回 `false`。
  */
 const hasColor = (): boolean => {
-  return hasSpecialEffect() && props.specialEffect.otherInfo.color !== undefined
+  return hasSpecialEffect() && props.specialEffect!.otherInfo.color !== undefined
 }
 
 /**
@@ -72,7 +73,7 @@ const hasColor = (): boolean => {
  * @returns {boolean} 如果 `color` 存在且为数组类型,则返回 `true`,否则返回 `false`。
  */
 const isArrColor = (): boolean => {
-  return hasColor() && Array.isArray(props.specialEffect.otherInfo.color)
+  return hasColor() && Array.isArray(props.specialEffect!.otherInfo.color)
 }
 
 /**
@@ -81,7 +82,7 @@ const isArrColor = (): boolean => {
  * @returns {boolean} 如果 `specialEffect` 存在且包含 `tagType` 属性,则返回 `true`,否则返回 `false`。
  */
 const hasTag = (): boolean => {
-  return hasSpecialEffect() && props.specialEffect.otherInfo.tagType !== undefined
+  return hasSpecialEffect() && props.specialEffect!.otherInfo.tagType !== undefined
 }
 
 /**
@@ -102,11 +103,11 @@ const getTableTextFieldVal = (): any => {
   if (hasSpecialEffect() && hasTranslateMap()) {
     if (isArrTranslateMap()) {
       // 处理数组情况:根据 `val` 的布尔值选择翻译映射中的第一个或第二个元素
-      let translateMap = props.specialEffect.otherInfo.translateMap!
+      let translateMap = props.specialEffect!.otherInfo.translateMap!
       val = Boolean(val) ? translateMap[0] : translateMap[1]
     } else {
       // 处理对象情况:根据 `val` 获取 `translateMap` 中对应的键值
-      val = props.specialEffect.otherInfo.translateMap![val]
+      val = props.specialEffect!.otherInfo.translateMap![val]
     }
   }
 
@@ -115,14 +116,14 @@ const getTableTextFieldVal = (): any => {
 
 /**
  * 是否需要禁用文本颜色
- * 不传disabelTextcolor字段或者传入false,都不禁用
+ * 不传disableTextColor字段或者传入false,都不禁用
  * 当启用了前缀图标、没有传入特殊效果、设置为true的情况下都禁用
  * @returns 是否禁用文本颜色
  */
-const isdisabledTextColor = (): boolean => {
+const disabledTextColor = (): boolean => {
   if (!hasSpecialEffect()) return true
-  if (props.specialEffect.otherInfo.needPreIcon) return true
-  let result = props.specialEffect.otherInfo.disabledTextColor
+  if (props.specialEffect!.otherInfo.needPreIcon) return true
+  let result = props.specialEffect!.otherInfo.disabledTextColor
   return Boolean(result)
 }
 
@@ -132,29 +133,28 @@ const isdisabledTextColor = (): boolean => {
  */
 const formatterText = computed<string>(() => {
   let result: string = getTableTextFieldVal()
-  switch (props.specialEffect.otherInfo.textType) {
-    case TextType.DATE:
-      {
-        result = formatDateToYYYYMMDD(result)
-      }
-      break
-    case TextType.FLoat:
-      {
-        result = String(parseFloat(result))
-      }
-      break
-    case TextType.INT:
-      {
-        result = String(parseInt(result))
-      }
-      break
-    case TextType.PERCENT:
-      {
-        result = String(result) + '%'
-      }
-      break
-    default: {
-      result = result
+  if (hasSpecialEffect()) {
+    switch (props.specialEffect!.otherInfo.textType) {
+      case TextType.DATE:
+        {
+          result = formatDateToYYYYMMDD(result)
+        }
+        break
+      case TextType.FLOAT:
+        {
+          result = String(parseFloat(result))
+        }
+        break
+      case TextType.INT:
+        {
+          result = String(parseInt(result))
+        }
+        break
+      case TextType.PERCENT:
+        {
+          result = String(result) + '%'
+        }
+        break
     }
   }
 
@@ -173,13 +173,13 @@ const tableTextColor = computed<string>(() => {
   let val = props.value
   if (hasSpecialEffect() && hasColor()) {
     if (isArrColor()) {
-      let colorList = props.specialEffect.otherInfo.color! as Array<string>
+      let colorList = props.specialEffect!.otherInfo.color! as Array<string>
       color = Boolean(val) ? colorList[0] : colorList[1]
     } else if (typeof val === 'string') {
-      color = props.specialEffect.otherInfo.color as string
+      color = props.specialEffect!.otherInfo.color as string
     } else {
       color = (
-        props.specialEffect.otherInfo.color as {
+        props.specialEffect!.otherInfo.color as {
           [key: string]: string
         }
       )[val as string]
@@ -197,7 +197,7 @@ const tableTag = computed<TagType>(() => {
   let tagType = TagType.SUCCESS
   let val = props.value
   if (hasSpecialEffect() && hasTag()) {
-    let tagList = props.specialEffect.otherInfo.tagType!
+    let tagList = props.specialEffect!.otherInfo.tagType!
     tagType = Boolean(val) ? tagList[0] : tagList[1]
   }
   return tagType
@@ -207,23 +207,23 @@ const tableTag = computed<TagType>(() => {
 <template>
   <div class="fieldTextItem">
     <el-icon
-      v-if="props.specialEffect.otherInfo.needPreIcon"
+      v-if="props.specialEffect?.otherInfo.needPreIcon"
       style="padding-right: 8px"
       :color="tableTextColor"
       ><icon-tabler-point-filled></icon-tabler-point-filled
     ></el-icon>
     <span
-      :style="{ color: isdisabledTextColor() ? '' : tableTextColor }"
-      v-if="specialEffect.otherInfo.textType === TextType.TEXT"
+      :style="{ color: disabledTextColor() ? '' : tableTextColor }"
+      v-if="specialEffect?.otherInfo.textType === TextType.TEXT"
     >
       {{ formatterText }}
     </span>
     <el-link
-      :style="{ color: isdisabledTextColor() ? '' : tableTextColor }"
-      v-if="specialEffect.otherInfo.textType === TextType.LINK"
+      :style="{ color: disabledTextColor() ? '' : tableTextColor }"
+      v-if="specialEffect?.otherInfo.textType === TextType.LINK"
       >{{ formatterText }}</el-link
     >
-    <el-tag :type="tableTag" v-if="specialEffect.otherInfo.textType === TextType.TAG">{{
+    <el-tag :type="tableTag" v-if="specialEffect?.otherInfo.textType === TextType.TAG">{{
       formatterText
     }}</el-tag>
   </div>

+ 1 - 1
src/components/toolsBtn/FilterPopover.vue

@@ -18,7 +18,7 @@ defineProps<SettingInfo>()
         <template #reference>
           <el-icon :size="iconSize" class="rightToolsItem"><Setting /></el-icon>
         </template>
-        <!-- 这里不是使用vlue是v-model去绑定数据 -->
+        <!-- 这里不是使用value是v-model去绑定数据 -->
         <!-- 这里有点奇怪,按理说是不能这样绑定的 -->
         <el-checkbox v-for="item in tableFieldsInfo" :label="item.cnName" v-model="item.isShow" />
       </el-popover>

+ 5 - 2
src/hooks/useAnalysis.ts

@@ -11,8 +11,11 @@ import type { ReqConfig } from '@/types/dataAnalysis'
 
 export function useAnalysis() {
   /**
-   * @description: 更新请求参数
-   * @return {*}
+   *
+   * @description: 用于更新请求配置
+   *
+   * @param config 请求配置
+   * @param newVal 新值
    */
   const updateReqConfig = (config: ReqConfig, newVal: any) => {
     Object.keys(newVal).map((k) => {

+ 1 - 3
src/hooks/useDialog.ts

@@ -21,7 +21,6 @@ export function useDialog() {
    * @description: 对话框关闭
    * @param {InstanceType} formEl 表单对象
    * @param {DialogSetting} dialogConfig 对话框配置
-   * @return {*}
    */
   const dialogClose = (
     formEl: InstanceType<typeof Form> | undefined,
@@ -38,7 +37,6 @@ export function useDialog() {
    * @param {any} row 行数据
    * @param {any} formData 表单数据
    * @param {DialogSetting} dialogConfig 对话框配置
-   * @return {*}
    */
   const handleEdit = (row: any, formData: any, dialogConfig: DialogSetting) => {
     dialogConfig.type = 1
@@ -46,7 +44,7 @@ export function useDialog() {
 
     // 这里放到nextTick,因为resetFields原理是将表单重置到dom刚渲染时的数据
     // 而这个表单,如果第一次使用就点击编辑的话,会将初始值直接设置为这行的数据,导致无法重置
-    nextTick(() => {
+    void nextTick(() => {
       for (const key in row) {
         if (key in formData) {
           formData[key] = row[key]

+ 7 - 7
src/hooks/useForm.ts

@@ -17,7 +17,7 @@ import axiosInstance from '@/utils/axios/axiosInstance'
 
 const { analysisResCode } = useRequest()
 export function useForm() {
-  const vaildForm = async (formEl: FormInstance | undefined): Promise<boolean> => {
+  const validForm = async (formEl: FormInstance | undefined): Promise<boolean> => {
     if (!formEl) {
       console.log('找不到表单实例')
       return false
@@ -27,7 +27,7 @@ export function useForm() {
 
   // 对话框提交
   const submitForm = (formEl: FormInstance | undefined, url: string, formData: any) => {
-    return new Promise((reslove, reject) => {
+    return new Promise((resolve, reject) => {
       ElMessageBox.confirm('确认提交吗?', '警告', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
@@ -36,14 +36,14 @@ export function useForm() {
       })
         .then(async () => {
           try {
-            let vaild = await vaildForm(formEl)
-            if (!vaild) throw new Error('表单校验不通过')
+            let valid = await validForm(formEl)
+            if (!valid) throw new Error('表单校验不通过')
 
             let result = await axiosInstance.post(url, formData)
             let info = JSON.parse(JSON.stringify(result))
 
             await analysisResCode(info)
-            reslove(true)
+            resolve(true)
           } catch (err) {
             console.log(err)
             ElMessage({
@@ -64,7 +64,7 @@ export function useForm() {
   const editForm = (row: any, formData: any) => {
     // 这里放到nextTick,因为resetFields原理是将表单重置到dom刚渲染时的数据
     // 而这个表单,如果第一次使用就点击编辑的话,会将初始值直接设置为这行的数据,导致无法重置
-    nextTick(() => {
+    void nextTick(() => {
       for (const key in row) {
         if (key in formData) {
           formData[key] = row[key]
@@ -75,5 +75,5 @@ export function useForm() {
     })
   }
 
-  return { submitForm, editForm, vaildForm }
+  return { submitForm, editForm, validForm: validForm }
 }

+ 3 - 3
src/hooks/usePage.ts

@@ -13,7 +13,7 @@ import { compareWatchData, saveWatchData } from '@/utils/common'
 export function usePage() {
   const watchPageChange = (
     watchData: () => Array<any>,
-    bakcupData: any,
+    backupData: any,
     cb: (...argus: any[]) => void
   ) => {
     let watchStop: (() => void) | null = null
@@ -21,7 +21,7 @@ export function usePage() {
     onActivated(() => {
       const currentData = watchData()
 
-      if (!compareWatchData(bakcupData, currentData)) {
+      if (!compareWatchData(backupData, currentData)) {
         cb(...currentData)
       }
 
@@ -39,7 +39,7 @@ export function usePage() {
     onDeactivated(() => {
       if (watchStop) {
         const currentData = watchData()
-        saveWatchData(currentData, bakcupData)
+        saveWatchData(currentData, backupData)
         watchStop()
         watchStop = null
       }

+ 3 - 4
src/hooks/useRequest.ts

@@ -3,7 +3,6 @@
  * @Date: 2024-08-20 17:24:06
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-11-27
- * @FilePath: \SqueezeTheBusc:\Users\NINGMEI\Desktop\Manage\Game-Backstage-Management-System\src\hooks\useRequest.ts
  * @Description:
  *
  */
@@ -71,9 +70,9 @@ export function useRequest() {
 
   /**
    * @description: 根据返回码给出提示
-   * @param {AxiosResponse} data 返回的数据
-   * @param {string} kind 请求类型
-   * @return {*}
+   * @param data 返回的数据
+   * @param kind 提示类型
+   * @param showMsg 是否显示提示
    */
   const analysisResCode = (
     data: AxiosResponse,

+ 6 - 7
src/hooks/useTable.ts

@@ -3,14 +3,13 @@
  * @Date: 2024-08-20 17:15:49
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-10-16 10:54:55
- * @FilePath: \Quantity-Creation-Management-Systemc:\Users\NINGMEI\Desktop\Game-Backstage-Management-System\src\hooks\useTable.ts
  * @Description:
  *
  */
 import type { ResponseInfo } from '@/types/res'
 import type { TablePaginationSetting } from '@/types/table'
 
-import { initLoadResouce } from '@/utils/resource'
+import { initLoadResource } from '@/utils/resource'
 import { reactive } from 'vue'
 
 import axiosInstance from '../utils/axios/axiosInstance'
@@ -24,7 +23,7 @@ const resourceInfo: Record<string, string> = {
 const blobUrlInfo = reactive<Record<string, string>>({})
 
 // 初始化资源
-initLoadResouce(resourceInfo).then((data) => {
+initLoadResource(resourceInfo).then((data) => {
   Object.assign(blobUrlInfo, data)
 })
 
@@ -48,14 +47,14 @@ export function useTable(tableData: Array<any>, paginationSetting: TablePaginati
    * @param {string} url 请求地址
    * @param {any} option 请求参数
    * @param {boolean} isPagination 是否开启分页
-   * @return {*}
    */
   const getTableData = (url: string, option: any, isPagination: boolean = false) => {
-    return new Promise(async (reslove, reject) => {
+    return new Promise(async (resolve, reject) => {
       try {
         await axiosInstance.post(url, option).then(async (result) => {
           let info = JSON.parse(JSON.stringify(result)) as ResponseInfo
           let data = info.data
+          console.log('执行了')
 
           // 没有数据则直接置为空
           if (!data) {
@@ -64,13 +63,13 @@ export function useTable(tableData: Array<any>, paginationSetting: TablePaginati
           } else {
             paginationSetting.total = info.count ?? data.length
             data = setDefaultHead(data)
-            // 如果开启了分页,那么默认这个tabledata是一个二维数组,每个位置对应当页的一个数据数组
+            // 如果开启了分页,那么默认这个tableData是一个二维数组,每个位置对应当页的一个数据数组
             // 没开启则是一个一维数组,直接赋值
             if (isPagination) tableData[paginationSetting.currentPage] = data
             else tableData.splice(0, tableData.length, ...data)
           }
 
-          reslove(true)
+          resolve(true)
         })
       } catch (err) {
         console.log(err)

+ 5 - 5
src/main.ts

@@ -17,11 +17,11 @@ app.use(createPinia())
 app.use(router)
 
 /**
- * @description:  全局异常捕获,此处只用于调试
- * @param {*} err 错误对象
- * @param {*} instance 触发该错误的组件实例
- * @param {*} info 错误来源类型信息
- * @return {*}
+ * 全局异常捕获,此处只用于调试
+ *
+ * @param  err 错误对象
+ * @param  instance 触发该错误的组件实例
+ * @param  info 错误来源类型信息
  */
 app.config.errorHandler = (err, instance, info) => {
   console.log('-----------------')

+ 0 - 1
src/router/home.ts

@@ -3,7 +3,6 @@
  * @Date: 2024-08-20 14:24:58
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-11-25
- * @FilePath: \SqueezeTheBusc:\Users\NINGMEI\Desktop\Manage\Game-Backstage-Management-System\src\router\home.ts
  * @Description:
  *
  */

+ 1 - 2
src/router/index.ts

@@ -3,7 +3,6 @@
  * @Date: 2024-08-20 14:06:49
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-10-11 16:42:42
- * @FilePath: \无标题 (工作区)c:\Users\NINGMEI\Desktop\Game-Backstage-Management-System\src\router\index.ts
  * @Description:
  *
  */
@@ -47,7 +46,7 @@ router.beforeEach((to, _from, next) => {
     if (authLogin()) {
       next()
     } else {
-      router.push('login')
+      void router.push('login')
     }
   }
 })

+ 17 - 20
src/stores/useCommon.ts

@@ -10,7 +10,7 @@
 import { reactive } from 'vue'
 import { defineStore } from 'pinia'
 import { getLocalInfo, saveLocalInfo } from '@/utils/localStorage/localStorage'
-import { createDateRange, invaildDateRange } from '@/utils/common'
+import { createDateRange, invalidDateRange } from '@/utils/common'
 
 interface SelectInfo {
   gid: string
@@ -19,7 +19,7 @@ interface SelectInfo {
   endTime: Date
 }
 
-interface MultipleChioce {
+interface MultipleChoice {
   gid: string
   pf: Array<string>
 }
@@ -47,7 +47,7 @@ const getSelectInfo = (): SelectInfo => {
 
   gid = gid ? gid : defaultGid
   pf = pf ? [pf[0]] : defaultPf
-  if (invaildDateRange(localStartTime, localEndTime)) {
+  if (invalidDateRange(localStartTime, localEndTime)) {
     startTime = new Date(localStartTime)
     endTime = new Date(localEndTime)
   }
@@ -58,8 +58,8 @@ const getSelectInfo = (): SelectInfo => {
  * @description: 获取多选的pf
  * @return {{ tempPf: string[] }} 多选pf
  */
-const getMultipleChioce = (): { tempPf: string[] } => {
-  let tempPf = getLocalInfo('tempMultipleChioce', 'pf') as string[]
+const getMultipleChoice = (): { tempPf: string[] } => {
+  let tempPf = getLocalInfo('tempMultipleChoice', 'pf') as string[]
   tempPf = tempPf ? tempPf : defaultPf
   return { tempPf }
 }
@@ -67,16 +67,15 @@ const getMultipleChioce = (): { tempPf: string[] } => {
 /**
  * @description: 初始化两种选择器
  * @param {SelectInfo} selectInfo 单选的选择器
- * @param {SelectInfo} tempMultipleChioce 多选的选择器
- * @return {*}
+ * @param {SelectInfo} tempMultipleChoice 多选的选择器
  */
-const initSelect = (selectInfo: SelectInfo, tempMultipleChioce: MultipleChioce) => {
+const initSelect = (selectInfo: SelectInfo, tempMultipleChoice: MultipleChoice) => {
   const { gid, pf, startTime, endTime } = getSelectInfo()
-  const { tempPf } = getMultipleChioce()
+  const { tempPf } = getMultipleChoice()
   Object.assign(selectInfo, { gid, pf, startTime, endTime })
-  Object.assign(tempMultipleChioce, { gid, pf: tempPf })
+  Object.assign(tempMultipleChoice, { gid, pf: tempPf })
   saveLocalInfo('selectInfo', selectInfo)
-  saveLocalInfo('tempMultipleChioce', tempMultipleChioce)
+  saveLocalInfo('tempMultipleChoice', tempMultipleChoice)
 }
 
 export const useCommonStore = defineStore('commonStore', () => {
@@ -89,27 +88,25 @@ export const useCommonStore = defineStore('commonStore', () => {
   })
 
   // 临时用来保存多选平台,因为目前业务只有部分页面需要多选,后续可能会改为全部多选
-  const tempMultipleChioce = reactive<MultipleChioce>({
+  const tempMultipleChoice = reactive<MultipleChoice>({
     gid: defaultGid,
     pf: defaultPf
   })
 
-  initSelect(selectInfo, tempMultipleChioce)
+  initSelect(selectInfo, tempMultipleChoice)
 
   /**
    * @description: 保存现有的selectInfo
-   * @return {*}
    */
   const saveSelectInfo = () => {
     localStorage.setItem('selectInfo', JSON.stringify(selectInfo))
   }
 
   /**
-   * @description: 保存现有的tempMultipleChioce
-   * @return {*}
+   * @description: 保存现有的tempMultipleChoice
    */
-  const saveTempMultipleChioce = () => {
-    localStorage.setItem('tempMultipleChioce', JSON.stringify(tempMultipleChioce))
+  const saveTempMultipleChoice = () => {
+    localStorage.setItem('tempMultipleChoice', JSON.stringify(tempMultipleChoice))
   }
 
   const changeDateRange = (date: Array<Date>) => {
@@ -125,9 +122,9 @@ export const useCommonStore = defineStore('commonStore', () => {
   return {
     selectInfo,
     allGameInfo,
-    tempMultipleChioce,
+    tempMultipleChoice: tempMultipleChoice,
     saveSelectInfo,
-    saveTempMultipleChioce,
+    saveTempMultipleChoice: saveTempMultipleChoice,
     changeDateRange
   }
 })

+ 4 - 4
src/types/dataAnalysis.ts

@@ -44,7 +44,7 @@ export interface StaticField {
 
 // 数据分析页面头部数据所需要的props
 // 其中如果配置了请求参数,那么会使用url去查询,然后赋值
-// 如果没有则直接使用fieldinfo里的value
+// 如果没有则直接使用fieldInfo里的value
 export interface StaticDataInfo {
   requestConfig?: ReqConfig // 请求参数配置
   fieldsInfo: Array<StaticField> //字段信息
@@ -60,12 +60,12 @@ export interface TabInfo {
 }
 
 /**
- * @description: 图表所需要的props,其中的legnedData毓seriesData的length要一致
- *              series中的name依赖毓lengdata
+ * @description: 图表所需要的props,其中的leanedData毓seriesData的length要一致
+ *              series中的name依赖毓leanedData
  * @return {*}
  */
 export interface OptionsProps {
-  xAxisData: Array<any> // x轴的刻度lable
+  xAxisData: Array<any> // x轴的刻度label
   legendData: Array<any> // 图例的信息
   seriesData: Array<any> // 数据
 }

+ 0 - 6
src/types/res.ts

@@ -4,12 +4,6 @@ export interface ResponseInfo {
   data?: any
   count?: number
 }
-
-export interface ErrorResInfo {
-  code: number
-  msg: string
-}
-
 export enum MessageType {
   Success = 'success',
   Warning = 'warning',

+ 17 - 17
src/types/table.ts

@@ -12,29 +12,29 @@ import type { ValueTypes } from './form'
 import type { SpecialEffect } from './tableText'
 
 // 颜色类型
-export enum ColorType {
-  PRIMARY = 'primary',
-  SUCCESS = 'success',
-  INFO = 'info',
-  WARNING = 'warning',
-  DANGER = 'danger'
-}
+// export enum ColorType {
+//   PRIMARY = 'primary',
+//   SUCCESS = 'success',
+//   INFO = 'info',
+//   WARNING = 'warning',
+//   DANGER = 'danger'
+// }
 
-export interface GameTableData {
-  gameName: string //游戏名称
-  gid: string //游戏ID
-  ttAppid: string //游戏 tt 平台id
-  ttSecret: string //游戏 tt 平台密钥
-  wxAppid: string //游戏 微信平台 id
-  wxSecret: string // 游戏 微信 平台密钥
-}
+// export interface GameTableData {
+//   gameName: string //游戏名称
+//   gid: string //游戏ID
+//   ttAppid: string //游戏 tt 平台id
+//   ttSecret: string //游戏 tt 平台密钥
+//   wxAppid: string //游戏 微信平台 id
+//   wxSecret: string // 游戏 微信 平台密钥
+// }
 
 // 表格分页的数据类型
 export interface TablePaginationSetting {
   limit: number // 每页展示个数
   currentPage: number // 当前页码
   total: number // 数据总数
-  pagesizeList: Array<number> // 页数大小列表
+  pageSizeList: Array<number> // 页数大小列表
 }
 
 // 表格信息过滤时,需要用到的过滤类型
@@ -76,7 +76,7 @@ export interface PropsParams {
   needRightTools?: boolean // 是否需要右侧工具栏
   openFilterQuery?: boolean // 是否开启上方查询功能
   openPageQuery?: boolean // 是否开启分页查询
-  openRemoteinquiry?: boolean // 是否开启远程查询
+  openRemoteQuery?: boolean // 是否开启远程查询
 
   dataList?: Array<any> // 表格数据,可以直接传入,也可以给请求地址来请求
   queryInfo?: Array<QueryInfo> // 上方查询功能所需要的信息

+ 1 - 1
src/types/tableText.ts

@@ -13,7 +13,7 @@ enum TextType {
   LINK = 'link', // 链接
   DATE = 'date', // 日期
   INT = 'int', // 整数,
-  FLoat = 'float', // 浮点数
+  FLOAT = 'float', // 浮点数
   PERCENT = 'percent', // 百分比
   TAG = 'tag' // 标签
 }

+ 12 - 9
src/utils/axios/axiosInstance.ts

@@ -12,7 +12,7 @@
 import { ElMessage } from 'element-plus'
 import { useRequest } from '@/hooks/useRequest'
 import { MessageType } from '@/types/res'
-import { getToken, refreshToken, setToken, removeAllToeken } from '../token/token'
+import { getToken, refreshToken, setToken, removeAllToken } from '../token/token'
 import { setLoginState } from '../localStorage/localStorage'
 
 import axios from 'axios'
@@ -39,20 +39,23 @@ let requestQueue: any[] = [] // 存储请求队列
 
 /**
  * @description: 未登录的情况下展示的信息
- * @param {*} ElMessage
- * @return {*}
+ * @param msg 提示信息
  */
-const showUnloginInfo = (msg: string = '请先登录') => {
+const showUncloggingInfo = (msg: string = '请先登录') => {
   ElMessage({
     type: MessageType.Warning,
     message: msg,
     duration: 1500
   })
-  removeAllToeken()
+  removeAllToken()
   setLoginState(false)
-  router.push('/login')
+  void router.push('/login')
 }
 
+// axiosInstance.interceptors.request.use((info) => {
+//   // console.log(info)
+// })
+
 // 添加响应拦截器
 axiosInstance.interceptors.response.use(
   async function (response) {
@@ -60,7 +63,7 @@ axiosInstance.interceptors.response.use(
 
     // -2是token为空的情况
     if (code === -2) {
-      showUnloginInfo()
+      showUncloggingInfo()
     }
     // -1是token过期的情况
     if (code === -1) {
@@ -78,12 +81,12 @@ axiosInstance.interceptors.response.use(
               requestQueue = []
               return axiosInstance(config)
             } else {
-              showUnloginInfo('登录已过期,请重新登陆')
+              showUncloggingInfo('登录已过期,请重新登陆')
             }
           })
           .catch((err) => {
             console.log(err)
-            showUnloginInfo('登录已过期,请重新登陆')
+            showUncloggingInfo('登录已过期,请重新登陆')
           })
           .finally(() => {
             isRefreshing = false

+ 42 - 67
src/utils/common/index.ts

@@ -3,7 +3,6 @@
  * @Date: 2024-08-26 15:46:42
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-11-27
- * @FilePath: \SqueezeTheBusc:\Users\NINGMEI\Desktop\Manage\Game-Backstage-Management-System\src\utils\common\index.ts
  * @Description:
  *
  */
@@ -11,10 +10,10 @@
 import { ElMessage } from 'element-plus'
 
 /**
- * @description:  包装防抖函数
+ *  包装防抖函数
+ *
  * @param {array} func 函数
  * @param {number} delay 时间
- * @return {*}
  */
 export function debounceFunc<T extends (...args: any[]) => any>(
   func: T,
@@ -30,10 +29,10 @@ export function debounceFunc<T extends (...args: any[]) => any>(
 }
 
 /**
- * @description: 包装节流函数
- * @param {T} func 函数
- * @param {number} delay 时间
- * @return {*}
+ *  节流函数
+ *
+ * @param func 函数
+ * @param delay 延迟
  */
 export function throttleFunc<T extends (...args: any[]) => any>(
   func: T,
@@ -51,7 +50,12 @@ export function throttleFunc<T extends (...args: any[]) => any>(
   }
 }
 
-// 小数转百分比
+/**
+ * 将小数转换为百分比字符串
+ *
+ * @param decimal 小数
+ * @param decimalPlaces 保留几位小数
+ */
 export function decimalToPercentage(decimal: number, decimalPlaces: number = 0): string {
   // Convert the decimal to a percentage by multiplying by 100
   const percentage = decimal * 100
@@ -63,16 +67,11 @@ export function decimalToPercentage(decimal: number, decimalPlaces: number = 0):
   return `${formattedPercentage}%`
 }
 
-// 生成时间刻度
-export function generateHourlyArray(count: number) {
-  const result = []
-  for (let i = 0; i <= count; i++) {
-    result.push(`${i}:00`)
-  }
-  return result
-}
-
-// 格式化时间,20240816=>2024-8-16
+/**
+ * 格式化时间,如20240816=>2024-8-16
+ *
+ * @param dateString
+ */
 export function formatDate(dateString: string) {
   // 从字符串中提取年份、月份和日期
   const year = dateString.slice(0, 4)
@@ -90,7 +89,11 @@ export function formatDate(dateString: string) {
   return `${year}-${formattedMonth}-${formattedDay}`
 }
 
-// 将date对象转为yaer-month-day的格式
+/**
+ * 将时间转为year-month-day的格式
+ *
+ * @param dateTime Date对象
+ */
 export function resetTimeToMidnight(dateTime: Date): string {
   // 创建一个 Date 对象来解析输入的日期时间字符串
 
@@ -107,9 +110,9 @@ export function resetTimeToMidnight(dateTime: Date): string {
 }
 
 /**
- * @description: 创建一个日期范围
+ * 创建一个日期范围
+ *
  * @param {*} day 天数
- * @return {*}
  */
 export const createDateRange = (day: number): Array<Date> => {
   const end = new Date()
@@ -119,12 +122,12 @@ export const createDateRange = (day: number): Array<Date> => {
 }
 
 /**
- * @description:  判断日期范围是否有效
+ * 判断日期范围是否有效
+ *
  * @param {string} startTime 开始时间
  * @param {string} endTime 结束时间
- * @return {boolean} 返回是否有效
  */
-export const invaildDateRange = (startTime: string, endTime: string): boolean => {
+export const invalidDateRange = (startTime: string, endTime: string): boolean => {
   const start = new Date(startTime).getTime()
   const end = new Date(endTime).getTime()
   // 判断日期是否有效,`isNaN` 判断生成的时间是否为 "Invalid Date"
@@ -132,20 +135,13 @@ export const invaildDateRange = (startTime: string, endTime: string): boolean =>
 }
 
 /**
- * 获取当前时间戳,单位为毫秒或秒
- * @param dateString 时间字符串
- * @param inMilliseconds 是否返回毫秒,true 表示返回毫秒级别时间戳,false(默认)返回秒级时间戳。
+ * 将时间戳转为日期字符串yyyy-MM-dd HH:mm:ss
+ *
+ * 根据isMilliseconds参数判断是否为毫秒,默认为秒级时间戳
+ *
+ * @param timestamp 时间戳
+ * @param isMilliseconds 是否为毫秒级时间戳
  */
-export const toUnixTimestamp = (dateString: string, inMilliseconds: boolean = false): number => {
-  const date = new Date(dateString)
-
-  if (isNaN(date.getTime())) {
-    throw new Error('Invalid date string format')
-  }
-
-  return inMilliseconds ? date.getTime() : Math.floor(date.getTime() / 1000)
-}
-
 export const formatTimestamp = (timestamp: number, isMilliseconds: boolean = false): string => {
   // 将秒级时间戳转换为毫秒级时间戳
   const adjustedTimestamp = isMilliseconds ? timestamp : timestamp * 1000
@@ -164,21 +160,12 @@ export const formatTimestamp = (timestamp: number, isMilliseconds: boolean = fal
 }
 
 /**
- * @description: 生成一个打包后可以使用的url
- * @param {string} url  传入一个assets文件夹下的文件名
- * @return {*}
- */
-export const getAssetsImageUrl = (url: string) => {
-  return new URL(`../../assets/${url}`, import.meta.url).href
-}
-
-/**
- * @description: 复制文字到剪贴板
+ * 复制文字到剪贴板
+ *
  * @param {string} text
- * @return {*}
  */
 export const copyText = (text: string) => {
-  return new Promise((reslove, reject) => {
+  return new Promise((resolve, reject) => {
     navigator.clipboard
       .writeText(text)
       .then(() => {
@@ -186,7 +173,7 @@ export const copyText = (text: string) => {
           type: 'success',
           message: '复制成功'
         })
-        reslove(true)
+        resolve(true)
       })
       .catch((err) => {
         ElMessage({
@@ -200,21 +187,10 @@ export const copyText = (text: string) => {
 }
 
 /**
- * @description: 用于清除reactive对象的所有属性并保持响应式
- * @param {Record} data 传入的对象
- * @return {*}
- */
-export const clearReactiveData = (data: Record<string, any>) => {
-  Object.keys(data).forEach((key) => {
-    delete data[key]
-  })
-}
-
-/**
- * @description: 用于保存watch切换之前的数据
+ * 用于保存watch切换之前的数据
+ *
  * @param {any} data  需要保存的数据
  * @param {any} store 需要保存到的对象
- * @return {*}
  */
 export const saveWatchData = (data: any, store: any) => {
   if (Array.isArray(data)) {
@@ -226,21 +202,20 @@ export const saveWatchData = (data: any, store: any) => {
 }
 
 /**
- * @description: 用于比较watch切换之前的数据
+ * 用于比较watch切换之前的数据
+ *
  * @param {any} data 需要比较的数据
  * @param {any} store 需要比较到的对象
- * @return {*}  boolean
  */
 export const compareWatchData = (data: any, store: any): boolean => {
   return JSON.stringify(data) === JSON.stringify(store)
 }
 
 /**
- * @description:   模糊查询
+ *   模糊查询
  * @param {string} pattern 需要匹配的模式,即正则表达式
  * @param {string} text   需要被搜索的目标字符串
  * @param {boolean} matchCase 是否区分大小写,默认为true,即不区分大小写
- * @return {boolean} 返回匹配结果
  */
 export const fuzzySearch = (pattern: string, text: string, matchCase: boolean = true): boolean => {
   const regex = new RegExp(pattern, matchCase ? 'i' : '') // 'i' 标志表示忽略大小写

+ 7 - 36
src/utils/localStorage/localStorage.ts

@@ -1,8 +1,7 @@
 /**
- * @description: 从本地拿数据
- * @param {string} name locastorage的key
+ * 从localstorage获取数据
+ * @param {string} name localstorage的key
  * @param {string} prop 属性名,不传就返回整个对象
- * @return {string | string[]} 本地信息
  */
 const getLocalInfo = (name: string, prop?: string): string | string[] => {
   let info = localStorage.getItem(name)
@@ -18,11 +17,10 @@ const getLocalInfo = (name: string, prop?: string): string | string[] => {
 }
 
 /**
- * @description: 保存到本地
- * @param {string} name locastorage的key
+ * 保存到本地
+ * @param {string} name localstorage的key
  * @param {any} value 值
  * @param {string} prop 属性名
- * @return {*}
  */
 const saveLocalInfo = (name: string, value: any, prop?: string) => {
   let info = localStorage.getItem(name)
@@ -36,45 +34,18 @@ const saveLocalInfo = (name: string, value: any, prop?: string) => {
 }
 
 /**
- * @description: 设置登陆状态
+ * 设置登陆状态
  * @param {boolean} state 登录状态
- * @return {*}
  */
 const setLoginState = (state: boolean) => {
   localStorage.setItem('loginState', JSON.stringify(state))
 }
 
 /**
- * @description: 获取当前登录状态
- * @return {boolean}
+ * 获取当前登录状态
  */
 const getLoginState = (): boolean => {
   return JSON.parse(localStorage.getItem('loginState') as string) as boolean
 }
 
-/**
- * @description: 设置平台选择下拉框的引导层的显示状态
- * @param {boolean} state 状态
- * @return {*}
- */
-const setPfSelectTourShowState = (state: boolean) => {
-  localStorage.setItem('pfSelectTourShowState', JSON.stringify(state))
-}
-
-/**
- * @description:
- * @param {*} boolean
- * @return {*}
- */
-const getPfSelectTourShowState = (): boolean => {
-  return JSON.parse(localStorage.getItem('pfSelectTourShowState') as string)
-}
-
-export {
-  getLocalInfo,
-  saveLocalInfo,
-  setLoginState,
-  getLoginState,
-  setPfSelectTourShowState,
-  getPfSelectTourShowState
-}
+export { getLocalInfo, saveLocalInfo, setLoginState, getLoginState }

+ 4 - 5
src/utils/resource/index.ts

@@ -24,7 +24,7 @@ export const loadResource = async (url: string): Promise<string> => {
     return Promise.resolve(resourceCache[url])
   }
 
-  // 如果没有缓存则去请求这个资源,并将他转为bolb对象,并且缓存blob对象的ulr
+  // 如果没有缓存则去请求这个资源,并将他转为blob对象,并且缓存blob对象的ulr
   try {
     const resourceBlob = await fetch(url)
     if (!resourceBlob.ok) throw new Error(`资源加载失败: ${url}`)
@@ -39,11 +39,10 @@ export const loadResource = async (url: string): Promise<string> => {
 }
 
 /**
- * @description: 初始化加载所有的资源
- * @param {Record} resourceObj  请求的url对象,键值都为string,key为资源的名称,值为资源的请求地址
- * @return {*} 返回一个包含了key和blobURL的对象,用来表示所有资源的请求情况
+ *  初始化加载所有的资源
+ * @param resourceObj
  */
-export const initLoadResouce = (
+export const initLoadResource = async (
   resourceObj: Record<string, string>
 ): Promise<Record<string, string>> => {
   // 获取所有的 URL 列表

+ 9 - 12
src/utils/table/table.ts

@@ -6,10 +6,9 @@ import axiosInstance from '../axios/axiosInstance'
 const { AllApi } = useRequest()
 
 /**
- * @description: 格式化游戏信息
+ * 格式化游戏信息
  * @param {Array} data 获取到的表格数据
  * @param {number} code 状态码
- * @return {*}
  */
 const formatGameInfo = (data: Array<any>, code: number): Array<any> => {
   const returnData: Array<any> = []
@@ -26,8 +25,7 @@ const formatGameInfo = (data: Array<any>, code: number): Array<any> => {
 }
 
 /**
- * @description: 获取所有游戏信息
- * @return {*}
+ * 获取所有游戏信息
  */
 export const getAllGameInfo = async () => {
   try {
@@ -42,7 +40,7 @@ export const getAllGameInfo = async () => {
     const result = JSON.parse(JSON.stringify(response))
     const data = result.data
     const returnData: Array<any> = formatGameInfo(data, result.code)
-    tableStore.setGameInfo(returnData) // 格式化后的数据放到tablestore中
+    tableStore.setGameInfo(returnData) // 格式化后的数据放到tableStore中
 
     return returnData
   } catch (err) {
@@ -52,19 +50,18 @@ export const getAllGameInfo = async () => {
 }
 
 /**
- * @description: 根据路由的name判断这个组件是否需要监听事件
- * @param {string} routeName 路由name,类型是来自RouteRecordNameGeneric类型
- * @return {*}
+ * 根据路由的name判断这个组件是否需要监听事件
+ * @param routeName 当前路由name
+ * @param matchName 匹配的路由name
  */
-export const shouldListenToEvent = (routeName: string | symbol | undefined, mathName: string) => {
-  return routeName === mathName
+export const shouldListenToEvent = (routeName: string | symbol | undefined, matchName: string) => {
+  return routeName === matchName
 }
 
 /**
- * @description: 下载文件信息
+ * 下载文件信息
  * @param {string} fileName 指定文件名
  * @param {any} info  需要下载的信息
- * @return {*}
  */
 export const downLoadData = (fileName: string, info: any) => {
   let result = {

+ 15 - 22
src/utils/token/token.ts

@@ -8,77 +8,70 @@ const TokenKey = 'token' // token的key
 const RefreshTokenKey = 'refreshToken' // 刷新token的key
 
 /**
- * @description: 获取token
- * @return {*}
+ * 获取token
  */
 const getToken = () => {
   return localStorage.getItem(TokenKey)
 }
 
 /**
- * @description: 设置token
+ *  设置token
  * @param {string} token token
- * @return {*}
  */
 const setToken = (token: string) => {
   localStorage.setItem(TokenKey, token)
 }
 
 /**
- * @description: 获取刷新Token
- * @return {*}
+ *  获取刷新Token
  */
-const getrefreshToken = () => {
+const getRefreshToken = () => {
   return localStorage.getItem(RefreshTokenKey)
 }
 
 /**
- * @description: 设置刷新Token
+ * 设置刷新Token
  * @param {string} refreshToken 刷新token
- * @return {*}
  */
 const setRefreshToken = (refreshToken: string) => {
   localStorage.setItem(RefreshTokenKey, refreshToken)
 }
 
 /**
- * @description: 刷新Token
- * @return {*}
+ * 刷新Token
  */
 const refreshToken = async () => {
-  // 这里不要用实例去请求,如果refreshtoken也返回-1的话,会导致程序卡死
+  // 这里不要用实例去请求,如果refreshToken也返回-1的话,会导致程序卡死
   return await axios.post(
     `${baseURL}${AllApi.getRefreshToken}`,
     {},
     {
       headers: {
-        Authorization: `${getrefreshToken()}`
+        Authorization: `${getRefreshToken()}`
       }
     }
   )
 }
 
 /**
- * @description: 移除token
- * @return {*}
+ *  移除token
  */
 const removeToken = () => {
   localStorage.removeItem(TokenKey)
 }
 
 /**
- * @description: 移除refreshtoken
- * @return {*}
+ * 移除refreshToken
+ *
  */
 const removeRefreshToken = () => {
   localStorage.removeItem(RefreshTokenKey)
 }
 
 /**
- * @description: 移除所有token
- * @return {*}
+ *  移除所有token
  */
-const removeAllToeken = () => {
+const removeAllToken = () => {
   removeToken()
   removeRefreshToken()
 }
@@ -86,10 +79,10 @@ const removeAllToeken = () => {
 export {
   getToken,
   setToken,
-  getrefreshToken,
+  getRefreshToken,
   setRefreshToken,
   refreshToken,
   removeToken,
   removeRefreshToken,
-  removeAllToeken
+  removeAllToken
 }

+ 4 - 4
src/views/AppManage/BaseInfoView.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import { reactive, onMounted, ref, watch } from 'vue'
-import { initLoadResouce } from '@/utils/resource'
+import { initLoadResource } from '@/utils/resource'
 import { copyText } from '@/utils/common'
 import { useRequest } from '@/hooks/useRequest'
 import { useCommonStore } from '@/stores/useCommon'
@@ -98,7 +98,7 @@ watch(
 
 onMounted(() => {
   // 去加载所有需要的资源
-  initLoadResouce(resourceInfo).then((data) => {
+  initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
 
@@ -112,7 +112,7 @@ onMounted(() => {
     <div class="body">
       <div class="info">
         <div class="infoItem" v-for="[key, val] in Object.entries(fieldsInfo)">
-          <span class="itmeTitle">{{ val }}</span>
+          <span class="itemTitle">{{ val }}</span>
           <span class="text" :ref="key">{{ appInfo[key as keyof AppInfo] }}</span>
           <span class="copy" v-if="key === 'gid'" @click="copyGid">复制</span>
         </div>
@@ -171,7 +171,7 @@ onMounted(() => {
   margin-bottom: 15px;
 }
 
-.itmeTitle {
+.itemTitle {
   display: inline-block;
   width: 110px;
   text-align: left;

+ 17 - 30
src/views/AppManage/EventDetailsView.vue

@@ -36,7 +36,7 @@ const optionTableRef = ref()
 const isAdd = ref(true)
 
 // 事件ID,这里的actionID,在获取事件详情的时候传入的字段是id字段,但是在获取
-// 参数列表的时候,传入的是actionid字段。。。。。。
+// 参数列表的时候,传入的是actionId字段
 const actionId = ref()
 
 // 编辑状态
@@ -79,11 +79,6 @@ const rules = reactive<FormRules<typeof ruleForm>>({
 
 // 表单字段信息
 const FormFields: Array<FormField> = [
-  // {
-  //   name: 'actionId',
-  //   cnName: '事件ID',
-  //   type: FormFieldType.INPUT
-  // },
   {
     name: 'actionName',
     cnName: '事件名',
@@ -102,7 +97,7 @@ const FormFields: Array<FormField> = [
           value: 0
         },
         {
-          name: 'abled',
+          name: 'able',
           label: '启用',
           value: 1
         }
@@ -137,7 +132,7 @@ const pageConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -226,7 +221,7 @@ const dialogReqConfig = reactive<ReqConfig>({
 })
 
 // 对话框表单规则字段
-const dilogRuleForm = reactive({
+const dialogRuleForm = reactive({
   optionName: '',
   optionId: '',
   status: 1,
@@ -234,7 +229,7 @@ const dilogRuleForm = reactive({
 })
 
 // 表单规则
-const dialogRules = reactive<FormRules<typeof dilogRuleForm>>({
+const dialogRules = reactive<FormRules<typeof dialogRuleForm>>({
   optionName: [{ required: true, message: '选项名称是必填项', trigger: 'change', type: 'string' }],
   optionId: [{ required: true, message: '选项ID是必填项', trigger: 'change', type: 'string' }],
   status: [{ required: true, message: '选项状态是必填项', trigger: 'change', type: 'number' }],
@@ -272,7 +267,7 @@ const dialogFormFields: Array<FormField> = [
           value: 0 // 对应int型状态
         },
         {
-          name: 'abled',
+          name: 'able',
           label: '启用',
           value: 1 // 对应int型状态
         }
@@ -315,9 +310,8 @@ const dialogConfig = reactive<DialogConfig>({
 })
 
 /**
- * @description: 获取事件详情
+ *  获取事件详情
  * @param {*} id 这个id还是路由参数中query传过来的id
- * @return {*}
  */
 const getEventInfo = (id: number) => {
   axiosInstance
@@ -351,8 +345,7 @@ const changeEditState = (state: boolean) => {
 }
 
 /**
- * @description: 取消编辑,同时把数据恢复
- * @return {*}
+ * 取消编辑,同时把数据恢复
  */
 const cancelEdit = () => {
   changeEditState(false)
@@ -362,8 +355,7 @@ const cancelEdit = () => {
 }
 
 /**
- * @description: 保存编辑,提交表单,只有表单验证通过了才能更改编辑状态
- * @return {*}
+ * 保存编辑,提交表单,只有表单验证通过了才能更改编辑状态
  */
 const saveEdit = () => {
   eventFormRef.value
@@ -377,8 +369,7 @@ const saveEdit = () => {
 }
 
 /**
- * @description: 开始编辑,备份一份现有的表单数据
- * @return {*}
+ * 开始编辑,备份一份现有的表单数据
  */
 const startEdit = () => {
   changeEditState(true)
@@ -386,24 +377,21 @@ const startEdit = () => {
 }
 
 /**
- * @description: 接受到表单提交事件后,需要去重新请求一下表格的数据
- * @return {*}
+ * 接受到表单提交事件后,需要去重新请求一下表格的数据
  */
 const formSub = () => {
   optionTableRef.value.getData()
 }
 
 /**
- * @description: 修改选项
- * @return {*}
+ * 修改选项
  */
 const editOption = (row: any) => {
   attrDialog.value.editForm(row, AllApi.updateGameActionOption)
 }
 
 /**
- * @description: 删除选项
- * @return {*}
+ * 删除选项
  */
 const delOption = (row: any) => {
   ElMessageBox.confirm('确认删除该配置吗', '警告', {
@@ -418,11 +406,10 @@ const delOption = (row: any) => {
 }
 
 /**
- * @description: 初始化一些参数
- *  加载时如果有actionid,则代表是修改页面,需要去请求数据,没有则是新增页面
- * 这里的actionid,是返回参数中id、actionID中的前者,在这个页面会被用于请求事件详情和相关的参数列表
+ *  初始化参数
+ *  加载时如果有actionId,则代表是修改页面,需要去请求数据,没有则是新增页面
+ * 这里的actionId,是返回参数中id、actionID中的前者,在这个页面会被用于请求事件详情和相关的参数列表
  * 在请求的时候,他们的名字不同,但传入的都是这个id
- * @return {*}
  */
 const initParams = () => {
   const routes = useRoute()
@@ -518,7 +505,7 @@ onUnmounted(() => {
       </Table>
     </div>
   </div>
-  <div class="addAttrDialo">
+  <div class="addAttrDialog">
     <Dialog ref="attrDialog" :config="dialogConfig" @form-submit="formSub"></Dialog>
   </div>
   <div class="uploadFileBox">

+ 47 - 53
src/views/AppManage/EventManageView.vue

@@ -10,13 +10,11 @@
 <script setup lang="ts">
 import type { ResponseInfo } from '@/types/res'
 
-import { ref, reactive, computed } from 'vue'
+import { computed, reactive, ref } from 'vue'
 import { useRequest } from '@/hooks/useRequest'
 import { useCommonStore } from '@/stores/useCommon'
-import { downLoadData } from '@/utils/table/table'
-import { resetTimeToMidnight } from '@/utils/common'
-import { shouldListenToEvent } from '@/utils/table/table'
-import { throttleFunc } from '@/utils/common'
+import { downLoadData, shouldListenToEvent } from '@/utils/table/table'
+import { resetTimeToMidnight, throttleFunc } from '@/utils/common'
 
 import HeaderCard from '@/components/dataAnalysis/HeaderCard.vue'
 import router from '@/router'
@@ -96,9 +94,8 @@ const uploadInfo = reactive({
 const nowRouteName = computed(() => router.currentRoute.value.name)
 
 /**
- * @description: 进入详情页,触发headercard的添加事件,增加一个面包屑导航
+ * 进入详情页,触发headerCard的添加事件,增加一个面包屑导航
  * @param {*} info 传入的信息
- * @return {*}
  */
 const headerAddPath = (info: any) => {
   const { name, pathName } = info
@@ -107,10 +104,11 @@ const headerAddPath = (info: any) => {
 }
 
 /**
- * @description:  展示上传之后的反馈信息
- * @param {*} state 这个状态只表示是否全部成功,其余情况皆为false
- * @param {*} name 区分是事件还是选项
- * @return {*}
+ * 展示上传之后的反馈信息
+ *
+ * @param failedCount 失败的数量
+ * @param totalCount 总数量
+ * @param name 上传的任务名
  */
 const showUploadMsg = (failedCount: number, totalCount: number, name: string): boolean => {
   if (failedCount < 0) throw new Error('Error!FailedCount < 0')
@@ -153,24 +151,23 @@ const showUploadMsg = (failedCount: number, totalCount: number, name: string): b
  * @return {*}
  */
 const submitUpload = async (reqList: Array<Promise<boolean>>, msg: string): Promise<boolean> => {
-  const result = await Promise.allSettled(reqList).then((res) => {
+  return await Promise.allSettled(reqList).then((res) => {
     const failedList = res.filter((item: any) => item.value === false)
     const failedCount = failedList.length
     const totalCount = res.length
-    let state = showUploadMsg(failedCount, totalCount, msg)
-    return state
+    return showUploadMsg(failedCount, totalCount, msg)
   })
-
-  return result
 }
 
 /**
- * @description: 请求表格数据,如果一次请求没有拿到所有的数据,则再请求一次
- * @param {*} url 请求地址
- * @param {*} otherInfo 请求参数
- * @param {*} offset 偏移量
- * @param {*} limit 请求数量
- * @return {*}
+ * 请求表格数据
+ *
+ * 如果一次没有请求到所有数据,则会再次请求
+ *
+ * @param url 请求地址
+ * @param otherInfo 请求参数
+ * @param offset 偏移
+ * @param limit 请求数量
  */
 const getTableData = async (
   url: string,
@@ -179,8 +176,8 @@ const getTableData = async (
   limit = 10000
 ): Promise<Array<any>> => {
   let total = limit + offset // 目前请求到的总数
-  let finalResult = []
-  finalResult = await axiosInstance
+
+  return await axiosInstance
     .post(url, {
       offset,
       limit,
@@ -200,15 +197,13 @@ const getTableData = async (
       console.log(err)
       return []
     })
-  return finalResult
 }
 
 /**
- * @description:  批量请求选项数据
+ * 批量请求选项数据
  * @param {*} url 请求的地址
- * @param {*} reqParams 请求的参数列表,主要是actionid
+ * @param {*} reqParams 请求的参数列表,主要是actionId
  * @param {*} eventTable 事件列表
- * @return {Promise<Object>}  返回一个最终的结果,其中key是每个事件的actionid,值是选项列表
  */
 const batReqOptionsData = async (
   url: string,
@@ -237,7 +232,7 @@ const batReqOptionsData = async (
 }
 
 /**
- * @description: 拿到事件数据和选项数据,首先需要拿到所有的事件列表,然后将他们的actionId抽出来形成一个列表,这个列表去作为optin的查询参数批量查询
+ * @description: 拿到事件数据和选项数据,首先需要拿到所有的事件列表,然后将他们的actionId抽出来形成一个列表,这个列表去作为option的查询参数批量查询
  * @return {*} 返回事件数据和选项数据
  */
 const getAllTable = async <T extends 'all' | 'event' | 'option' = 'all'>(
@@ -270,8 +265,7 @@ const getAllTable = async <T extends 'all' | 'event' | 'option' = 'all'>(
 }
 
 /**
- * @description: 开始上传
- * @return {*}
+ *  开始上传
  */
 const startUpload = async () => {
   if (uploadRef.value) {
@@ -280,12 +274,11 @@ const startUpload = async () => {
 }
 
 /**
- * @description: 获取事件列表和选项列表的数据,开始下载
- * @return {*}
+ * 获取事件列表和选项列表的数据,开始下载
  */
 const startDownload = async () => {
   let { allEventTable, allOptionsInfo } = await getAllTable()
-  downLoadData(`allevents_${resetTimeToMidnight(new Date())}`, {
+  downLoadData(`allEvents_${resetTimeToMidnight(new Date())}`, {
     allEventTable,
     allOptionsInfo
   })
@@ -345,25 +338,24 @@ const uploadEvent = async (
 }
 
 /**
- * @description: 上传所有选项
+ * 上传所有选项
  * @param {*} uploadOptionsInfo 上传的选项列表
- * @return {*}
  */
-const uploadOpiton = async (uploadOptionsInfo: { [key: string]: Array<UploadOption> }) => {
+const uploadOption = async (uploadOptionsInfo: { [key: string]: Array<UploadOption> }) => {
   const { allEventTable, allOptionsInfo } = await getAllTable() // 重新获取所有事件列表和选项列表
   let optionsReqList: Array<Promise<boolean>> = []
   if (Object.keys(uploadOptionsInfo).length) {
     // 开始上传选项
     allEventTable.map((item) => {
-      // 在上传的事件列表中,找到有对应的事件的actionid的那一组数据
+      // 在上传的事件列表中,找到有对应的事件的actionId的那一组数据
       let uploadOptionItem = uploadOptionsInfo[item.actionId]
-      // 在现有的事件列表中,找到对应事件的actionid的那一组数据
+      // 在现有的事件列表中,找到对应事件的actionId的那一组数据
       let nowOptionItem = allOptionsInfo[item.actionId] // 找到所有在已有事件列表中的选项列表
 
-      // 如果有已存在的事件,并且上传的选项列表中也有对应的actionid,则开始上传
+      // 如果有已存在的事件,并且上传的选项列表中也有对应的actionId,则开始上传
       if (uploadOptionItem) {
         // 对找到的那一组数据进行循环,区分出来哪些是已有的,哪些是新上传的
-        // 新上传的需要给他加上actionid,然后上传,这个actionid其实是事件列表的id字段
+        // 新上传的需要给他加上actionId,然后上传,这个actionId其实是事件列表的id字段
         uploadOptionItem.map((i) => {
           const { id, actionId: originalActionId, ...otherInfo } = i // 上传参数拆分出来
           const isUpdate = nowOptionItem.some((k) => k.id === id) // 判断是否是更新选项
@@ -402,16 +394,17 @@ const uploadOpiton = async (uploadOptionsInfo: { [key: string]: Array<UploadOpti
   }
 }
 
-// 上传选项的时候,选项的键要设置为actionid
-// 需要先上传事件,然后上传完了,用上传的选项中的第一个(如果有)的actionid去找到对应的事件的ID(不是actionid),然后作为选项上传的id
 /**
- * @description: 当文件添加后,开始进行上传前的处理
- *  首先需要上传事件,如果现有上传的列表中的actionid已经包含在了现有列表中,那么判定为更新,否则为新增
+ *  当文件添加后,开始进行上传前的处理
+ *  首先需要上传事件,如果现有上传的列表中的actionId已经包含在了现有列表中,那么判定为更新,否则为新增
+ *
  *  上传完成后,需要首先获取一次新的数据,然后再开始上传选项。
- *  分别在上传和已有的选项列表中,找到对应的acionID的那一组选项,对这一组数据,如果已经存在对应的id,那么就是更新,否则为新增
+ *
+ *  分别在上传和已有的选项列表中,找到对应的actionID的那一组选项,对这一组数据,如果已经存在对应的id,那么就是更新,否则为新增
+ *
  *  然后上传,上传完毕后,整体列表刷新,关闭弹框
- * @param {*} data 上传的文件数据,里面包含allEventTable:所有的事件列表,allOptionsInfo:所有选项列表
- * @return {*}
+ *
+ * @param data 上传的文件数据,里面包含allEventTable:所有的事件列表,allOptionsInfo:所有选项列表
  */
 const uploadSuccess = async (data: {
   allEventTable: Array<uploadEvent>
@@ -433,7 +426,7 @@ const uploadSuccess = async (data: {
     eventUploadResult = await uploadEvent(uploadEventTable, allEventTable)
     // 如果事件上传全部失败,那么就不要再上传选项了
     if (eventUploadResult) {
-      uploadOpiton(uploadOptionsInfo)
+      await uploadOption(uploadOptionsInfo)
     }
   } else {
     ElNotification({
@@ -451,7 +444,7 @@ const uploadSuccess = async (data: {
 </script>
 
 <template>
-  <div class="enventManage">
+  <div class="eventManage">
     <div class="breadcrumbBox">
       <HeaderCard
         ref="headerCard"
@@ -470,7 +463,7 @@ const uploadSuccess = async (data: {
     <div class="eventTableBox">
       <!-- 监听表格的跳转事件 -->
       <router-view v-slot="{ Component, route }">
-        <!-- 是eventtable组件就去监听enterdetail事件 -->
+        <!-- 是eventTable组件就去监听enterDetail事件 -->
         <!-- 注释也不要写到keep-alive里面,会报错 -->
 
         <component
@@ -496,7 +489,7 @@ const uploadSuccess = async (data: {
 </template>
 
 <style scoped>
-.enventManage {
+.eventManage {
   width: 98%;
   margin: 1% auto;
   background-color: white;
@@ -517,7 +510,7 @@ const uploadSuccess = async (data: {
 
 .eventTableBox {
   box-sizing: border-box;
-  padding: 0px 24px;
+  padding: 0 24px;
 }
 
 .handleEvent {
@@ -537,6 +530,7 @@ const uploadSuccess = async (data: {
 .fileGroup {
   width: 100%;
 }
+
 .fileBtn {
   margin-right: 10px;
 }

+ 10 - 14
src/views/AppManage/EventMangeTable.vue

@@ -32,7 +32,7 @@ const pagingConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -117,7 +117,7 @@ const eventStatus: Array<SelectInfo> = [
     value: '1'
   },
   {
-    name: 'nouse',
+    name: 'unUse',
     cnName: '禁用',
     value: '0'
   }
@@ -143,7 +143,7 @@ const queryInfo: Array<QueryInfo> = [
 ]
 
 // 对话框表单规则字段
-const dilogRuleForm = reactive({
+const dialogRuleForm = reactive({
   actionId: '',
   actionName: '',
   remark: '',
@@ -151,7 +151,7 @@ const dilogRuleForm = reactive({
 })
 
 // 对话表单规则
-const dialogRules = reactive<FormRules<typeof dilogRuleForm>>({
+const dialogRules = reactive<FormRules<typeof dialogRuleForm>>({
   actionId: [
     { required: true, message: '事件ID是必填项', trigger: 'blur' },
     { min: 1, max: 10, message: '事件ID长度必须在1到10之间', trigger: 'blur' }
@@ -210,7 +210,7 @@ const FormFields: Array<FormField> = [
           value: 1
         },
         {
-          name: 'nouse',
+          name: 'unUse',
           label: '禁用',
           value: 0
         }
@@ -228,9 +228,8 @@ const dialogInfo = reactive<DialogConfig>({
 })
 
 /**
- * @description: 查看详情,同时触发事件给面包屑导航
+ * 查看详情,同时触发事件给面包屑导航
  * @param {*} row 行信息
- * @return {*}
  */
 const viewDetails = (row: any) => {
   if (row.id) {
@@ -249,16 +248,14 @@ const viewDetails = (row: any) => {
 }
 
 /**
- * @description: 触发新增
- * @return {*}
+ * 触发新增
  */
 const addNewEvent = () => {
   eventDialog.value.addForm()
 }
 
 /**
- * @description: 表单提交
- * @return {*}
+ * 表单提交
  */
 const subForm = () => {
   if (eventTable.value) {
@@ -267,8 +264,7 @@ const subForm = () => {
 }
 
 /**
- * @description: 更新表格数据
- * @return {*}
+ *  更新表格数据
  */
 const updateData = () => {
   eventTable.value?.getData()
@@ -300,7 +296,7 @@ defineExpose({
       :need-left-tools="true"
       :open-filter-query="true"
       :need-right-tools="true"
-      :open-remoteinquiry="true"
+      :open-remote-query="true"
       @add-new-item="addNewEvent"
     >
       <template #tableOperation>

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

@@ -187,11 +187,9 @@ const rules = reactive<FormRules<FormData>>({
 const disableEditField = ['pid', 'gid', 'aid', 'type']
 
 /**
- * @description: 格式化输入,主要是对数字处理
- * @param {*} val 值
- * @param {*} key 键
- * @param {*} valueType 值类型
- * @return {*}
+ * 格式化输入
+ * @param val 值
+ * @param valueType 值类型
  */
 const formatInput = (val: any, valueType: ValueTypes | undefined): any => {
   let newVal: any = ''
@@ -215,17 +213,15 @@ const formatInput = (val: any, valueType: ValueTypes | undefined): any => {
 }
 
 /**
- * @description: 重置表单
- * @return {*}
+ * 重置表单
  */
 const resetForm = () => {
   formRef.value?.resetFields()
 }
 
 /**
- * @description: 提交表单
+ *  提交表单
  * @param {*} formEl 表单实例
- * @return {*}
  */
 const subForm = (formEl: FormInstance | undefined) => {
   if (!formEl) return
@@ -257,8 +253,7 @@ const subForm = (formEl: FormInstance | undefined) => {
 }
 
 /**
- * @description: 初始化表单数据,根据查询参数来
- * @return {*}
+ *  初始化表单数据,根据查询参数来
  */
 const initFormData = () => {
   let query = route.query

+ 2 - 2
src/views/AppManage/UserConversionTable.vue

@@ -31,7 +31,7 @@ const pagingConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -160,7 +160,7 @@ const goDetail = (data: any) => {
       :query-info="queryInfo"
       :open-filter-query="true"
       :need-left-tools="true"
-      :open-remoteinquiry="true"
+      :open-remote-query="true"
       @add-new-item="goDetail"
     >
       <template #tableOperation>

+ 2 - 2
src/views/Home/Analysis/AdvertisingUsers.vue

@@ -151,7 +151,7 @@ const pagingConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -250,7 +250,7 @@ watchPageChange(() => [selectInfo.pf, selectInfo.gid], backupSelect, updateAllRe
         :query-info="filterInfo"
         :pagination-config="pagingConfig"
         :table-fields-info="tableFieldsInfo"
-        :open-remoteinquiry="true"
+        :open-remote-query="true"
         :open-page-query="true"
         :open-filter-query="true"
       ></Table>

+ 3 - 4
src/views/Home/Analysis/EventAnalysisDetail.vue

@@ -28,7 +28,7 @@ import Table from '@/components/Table.vue'
 import TemporalTrend from '@/components/dataAnalysis/TemporalTrend.vue'
 import router from '@/router'
 
-const { selectInfo, tempMultipleChioce } = useCommonStore()
+const { selectInfo, tempMultipleChoice } = useCommonStore()
 const { updateReqConfig } = useAnalysis()
 
 interface eventDetailProps {
@@ -69,7 +69,7 @@ const pagingConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -175,7 +175,6 @@ const chartProps = reactive<TemporalTrendProps>({
  * @param {*} pf 平台
  * @param {*} startTime 开始时间
  * @param {*} endTime 结束时间
- * @return {*}
  */
 const updateSelectInfo = (gid: string, pf: Array<string>, startTime: string, endTime: string) => {
   updateReqConfig(chartReqConfig, { pf, gid, startTime, endTime })
@@ -187,7 +186,7 @@ const updateSelectInfo = (gid: string, pf: Array<string>, startTime: string, end
  * @return {*}
  */
 watch(
-  () => [selectInfo.gid, tempMultipleChioce.pf, props.startTime, props.endTime],
+  () => [selectInfo.gid, tempMultipleChoice.pf, props.startTime, props.endTime],
   ([gid, pf, startTime, endTime]) => {
     updateSelectInfo(gid as string, pf as Array<string>, startTime as string, endTime as string)
   },

+ 8 - 11
src/views/Home/Analysis/EventAnalysisTable.vue

@@ -18,7 +18,7 @@ const { updateReqConfig } = useAnalysis()
 const { watchPageChange } = usePage()
 
 const { AllApi } = useRequest()
-const { selectInfo, tempMultipleChioce } = useCommonStore()
+const { selectInfo, tempMultipleChoice } = useCommonStore()
 
 const eventTable = ref<InstanceType<typeof Table>>()
 
@@ -43,7 +43,7 @@ const pagingConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -108,9 +108,8 @@ const eventTableFilterInfo: Array<QueryInfo> = [
 ]
 
 /**
- * @description: 查看详情
+ * 查看详情
  * @param {*} row 行信息
- * @return {*}
  */
 const viewDetails = (row: any) => {
   emits('enterAnalysisDetail', {
@@ -126,10 +125,9 @@ const viewDetails = (row: any) => {
 }
 
 /**
- * @description: 更新时间
+ *  更新时间
  * @param {*} startTime 开始时间
  * @param {*} endTime 结束时间
- * @return {*}
  */
 const updateDate = (startTime: string, endTime: string) => {
   requestConfig.otherOptions.startTime = startTime
@@ -137,9 +135,9 @@ const updateDate = (startTime: string, endTime: string) => {
 }
 
 /**
- * @description: 更新Gid
- * @param {*} newGid 新的gid
- * @return {*}
+ * 更新请求配置
+ * @param gid 游戏ID
+ * @param pf 平台
  */
 const updateGid = (gid: string, pf: any) => {
   pf = isSinglePf ? pf[0] : pf
@@ -150,7 +148,7 @@ const backupDate = reactive([])
 const backupSelect = reactive([])
 
 // 这里特殊一点,监听pf的时候去监听临时的pf,但是gid还是和其他一样
-watchPageChange(() => [selectInfo.gid, tempMultipleChioce.pf], backupSelect, updateGid)
+watchPageChange(() => [selectInfo.gid, tempMultipleChoice.pf], backupSelect, updateGid)
 
 watchPageChange(() => [props.startTime, props.endTime], backupDate, updateDate)
 </script>
@@ -168,7 +166,6 @@ watchPageChange(() => [props.startTime, props.endTime], backupDate, updateDate)
         :table-fields-info="tableFieldsInfo"
         :need-left-tools="false"
         :need-right-tools="true"
-        :open-remoteinquiry="false"
       >
         <template #tableOperation>
           <el-table-column label="操作" align="center">

+ 6 - 8
src/views/Home/Analysis/EventAnalysisView.vue

@@ -31,9 +31,8 @@ const startTime = ref()
 const endTime = ref()
 
 /**
- * @description: 进入详情页,触发headercard的添加事件,增加一个面包屑导航
+ * 增加面包屑导航
  * @param {*} info 传入的信息
- * @return {*}
  */
 const headerAddPath = (info: any) => {
   const { name, pathName } = info
@@ -42,9 +41,8 @@ const headerAddPath = (info: any) => {
 }
 
 /**
- * @description: 时间改变
- * @param {*} newDate
- * @return {*}
+ * 更新日期
+ * @param {*} newDate 新的日期
  */
 const dateChange = (newDate: Array<Date>) => {
   startTime.value = resetTimeToMidnight(newDate[0])
@@ -59,7 +57,7 @@ const dateChange = (newDate: Array<Date>) => {
         :title="headerProps.title"
         :open-date-select="headerProps.openDateSelect"
         :need-breadcrumb="true"
-        :need-pf-select="true"
+        :need-pf-select="false"
         :is-radio="false"
         @change-date="dateChange"
       ></HeaderCard>
@@ -69,8 +67,8 @@ const dateChange = (newDate: Array<Date>) => {
     <div class="content" v-if="startTime && endTime">
       <!-- 监听表格的跳转事件 -->
       <router-view v-slot="{ Component, route }" :startTime="startTime" :endTime="endTime">
-        <!-- 是eventtable组件就去监听enterdetail事件 -->
-        <!-- 这个keepalive不要去掉,因为里面的table的监听事件是放在onactive中 -->
+        <!-- 是eventTable组件就去监听enterDetail事件 -->
+        <!-- 这个keepalive不要去掉,因为里面的table的监听事件是放在onActive中 -->
         <keep-alive>
           <component
             :is="Component"

+ 5 - 10
src/views/Home/Analysis/KeepView.vue

@@ -3,7 +3,6 @@
  * @Date: 2024-08-27 17:11:23
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-11-25
- * @FilePath: \SqueezeTheBusc:\Users\NINGMEI\Desktop\Manage\Game-Backstage-Management-System\src\views\Home\Analysis\KeepView.vue
  * @Description: 
  * 
 -->
@@ -44,8 +43,7 @@ const keepDataTableInfo = reactive<{
     limit: 15, // 每页展示个数
     currentPage: 1, // 当前页码
     total: 0, // 数据总数
-    pagesizeList: [15, 30], // 页数大小列表
-    hasLodingData: 0 // 已经加载的数据
+    pageSizeList: [15, 30] // 页数大小列表
   }),
   requestConfig: {
     url: AllApi.userRemainDataBydDay,
@@ -130,9 +128,8 @@ const keepDataTableInfo = reactive<{
 const keepTableData = reactive<Array<any>>([])
 
 /**
- * @description: 当日期改变,需要去更新三个组件的请求参数
- * @param {*} date
- * @return {*}
+ * 更新请求配置
+ * @param {*} date 新的日期
  */
 const changeDate = (date: Array<Date>) => {
   updateReqConfig(keepDataTableInfo.requestConfig, {
@@ -147,8 +144,7 @@ const headerCardInfo: HeaderCardProps = {
 }
 
 /**
- * @description: 获取detail表格的数据
- * @return {*}
+ * 获取detail表格的数据
  */
 const getTableData = () => {
   axiosInstance
@@ -180,10 +176,9 @@ const getTableData = () => {
 }
 
 /**
- * @description: 更新所有监听req的参数
+ * 更新请求配置
  * @param {*} pf  新pf
  * @param {*} gid 新gid
- * @return {*}
  */
 const updateAllReq = (pf: string, gid: string) => {
   pf = isSinglePf ? pf[0] : pf

+ 3 - 4
src/views/Home/Analysis/UserBehavior.vue

@@ -166,7 +166,7 @@ const pagingConfig = reactive<TablePaginationSetting>({
   limit: 20,
   currentPage: 1,
   total: 0,
-  pagesizeList: [20, 30]
+  pageSizeList: [20, 30]
 })
 
 // 表格字段信息
@@ -261,10 +261,9 @@ const headerCardInfo: HeaderCardProps = {
 }
 
 /**
- * @description: 更新所有监听req的参数
+ * 更新所有请求配置
  * @param {*} pf  新pf
  * @param {*} gid 新gid
- * @return {*}
  */
 const updateAllReq = (pf: string, gid: string) => {
   pf = isSinglePf ? pf[0] : pf
@@ -288,7 +287,7 @@ watchPageChange(() => [selectInfo.pf, selectInfo.gid], backupSelect, updateAllRe
         :query-info="filterInfo"
         :pagination-config="pagingConfig"
         :table-fields-info="tableFieldsInfo"
-        :open-remoteinquiry="true"
+        :open-remote-query="true"
         :open-page-query="true"
         :open-filter-query="true"
       ></Table>

+ 7 - 17
src/views/Home/Analysis/UserTrendView.vue

@@ -206,8 +206,7 @@ const detailDataTableInfo = reactive<{
     limit: 15, // 每页展示个数
     currentPage: 1, // 当前页码
     total: 0, // 数据总数
-    pagesizeList: [15, 30], // 页数大小列表
-    hasLodingData: 0 // 已经加载的数据
+    pageSizeList: [15, 30] // 页数大小列表
   }),
   requestConfig: {
     url: AllApi.userDataTradesDetail,
@@ -268,9 +267,8 @@ const detailDataTableInfo = reactive<{
 const detailDataTableData = reactive<Array<any>>([])
 
 /**
- * @description: 当日期改变,需要去更新三个组件的请求参数
- * @param {*} date
- * @return {*}
+ * 日期改变,更新请求参数
+ * @param {*} date 日期
  */
 const changeDate = (date: Array<Date>) => {
   updateReqConfig(userTrendDataReqConfig, {
@@ -290,8 +288,7 @@ const changeDate = (date: Array<Date>) => {
 }
 
 /**
- * @description: 获取detail表格的数据
- * @return {*}
+ * 获取detail表格的数据
  */
 const getDetailData = () => {
   axiosInstance
@@ -316,10 +313,9 @@ const getDetailData = () => {
 }
 
 /**
- * @description: 更新所有监听req的参数
+ * 更新请求参数
  * @param {*} pf  新pf
  * @param {*} gid 新gid
- * @return {*}
  */
 const updateAllReq = (pf: string, gid: string) => {
   pf = isSinglePf ? pf[0] : pf
@@ -328,11 +324,6 @@ const updateAllReq = (pf: string, gid: string) => {
   updateReqConfig(detailDataTableInfo.requestConfig, { pf, gid })
 }
 
-/**
- * @description: 监听变化,去手动更新数据
- * @return {*}
- */
-
 const backupReq = reactive([]) // 保存请求参数
 
 const backupSelect = reactive([]) // 保存选择数据
@@ -372,7 +363,7 @@ watchPageChange(() => [detailDataTableInfo.requestConfig], backupReq, getDetailD
         :tabInfo="dataTrendInfo.tabList"
       ></TemporalTrend>
     </div>
-    <div class="onedetailDataTrendBox">
+    <div class="detailDataTrendBox">
       <div class="boxHeader">
         <span class="headerTitle">数据详情</span>
       </div>
@@ -399,8 +390,7 @@ watchPageChange(() => [detailDataTableInfo.requestConfig], backupReq, getDetailD
 
 .header,
 .staticBox,
-.dataTrendTrendBox,
-.onedetailDataTrendBox {
+.detailDataTrendBox {
   box-sizing: border-box;
   background-color: white;
   width: 100%;

+ 4 - 5
src/views/Home/InfoManage/GameManageView.vue

@@ -13,7 +13,6 @@ import { useCommonStore } from '@/stores/useCommon'
 import Dialog from '@/components/common/Dialog.vue'
 import Table from '@/components/Table.vue'
 import { FieldSpecialEffectType } from '@/types/tableText.ts'
-import { formatDate } from '@/utils/common'
 
 const { allGameInfo, selectInfo } = useCommonStore()
 const { AllApi } = useRequest()
@@ -35,11 +34,11 @@ const paginationConfig: TablePaginationSetting = {
   limit: 15, // 每页展示个数
   currentPage: 1, // 当前页码
   total: 0, // 数据总数
-  pagesizeList: [15, 30] // 页数大小列表
+  pageSizeList: [15, 30] // 页数大小列表
 }
 
 // 字段信息
-const filedsInfo = reactive<Array<TableFieldInfo>>([
+const fieldsInfo = reactive<Array<TableFieldInfo>>([
   {
     name: 'gameName',
     cnName: '游戏名',
@@ -301,7 +300,7 @@ const formSub = (formData: any, type: number) => {
 watch(
   () => selectInfo.gid,
   () => {
-    gameTableRef.value?.resetQueryForm(false)
+    gameTableRef.value?.resetQueryForm()
   },
   {
     deep: true
@@ -323,7 +322,7 @@ onMounted(() => {
       :open-filter-query="true"
       :open-page-query="false"
       :query-info="queryInfo"
-      :table-fields-info="filedsInfo"
+      :table-fields-info="fieldsInfo"
       :request-config="requestConfig"
       :pagination-config="paginationConfig"
       @addNewItem="addNewItem"

+ 7 - 11
src/views/Home/InfoManage/PlayerManageView.vue

@@ -37,7 +37,7 @@ const paginationConfig: TablePaginationSetting = {
   limit: 15, // 每页展示个数
   currentPage: 1, // 当前页码
   total: 0, // 数据总数
-  pagesizeList: [15, 30] // 页数大小列表
+  pageSizeList: [15, 30] // 页数大小列表
 }
 
 // 配置请求参数
@@ -86,7 +86,7 @@ const queryInfo = reactive<Array<QueryInfo>>([
 ])
 
 // 字段信息
-const filedsInfo = reactive<Array<TableFieldInfo>>([
+const fieldsInfo = reactive<Array<TableFieldInfo>>([
   {
     name: 'gid',
     cnName: '游戏ID',
@@ -238,8 +238,7 @@ const blockedPlayer = (row: any) => {
 }
 
 /**
- * @description: 加密字段
- * @return {*}
+ * 加密字段
  */
 const encrypt = () => {
   playerDialogFormRef.value.encrypt('option', true, ['gid', 'userId', 'pf'])
@@ -253,6 +252,7 @@ const updateSelect = (gid: any) => {
 const backupSelect = reactive([])
 
 import { usePage } from '@/hooks/usePage'
+
 const { watchPageChange } = usePage()
 
 watchPageChange(() => [selectInfo.gid], backupSelect, updateSelect)
@@ -267,11 +267,11 @@ watchPageChange(() => [selectInfo.gid], backupSelect, updateSelect)
       :need-left-tools="false"
       :open-page-query="true"
       :open-filter-query="true"
-      :table-fields-info="filedsInfo"
+      :table-fields-info="fieldsInfo"
       :query-info="queryInfo"
       :request-config="requestConfig"
       :pagination-config="paginationConfig"
-      :open-remoteinquiry="true"
+      :open-remote-query="true"
     >
       <template #tableOperation>
         <el-table-column label="操作" align="center">
@@ -304,7 +304,7 @@ watchPageChange(() => [selectInfo.gid], backupSelect, updateSelect)
         :config="optionDialogConfig"
       >
         <template #otherBtn>
-          <el-button class="operationBtn" type="warning" @click="encrypt"> 加密上传 </el-button>
+          <el-button class="operationBtn" type="warning" @click="encrypt"> 加密上传</el-button>
         </template>
       </Dialog>
     </div>
@@ -319,10 +319,6 @@ watchPageChange(() => [selectInfo.gid], backupSelect, updateSelect)
   border: 1px solid #e5e6eb;
 }
 
-.subBtnItem {
-  margin-right: 1%;
-}
-
 .operationBtn {
   margin-right: 10px;
 }

+ 1 - 8
src/views/Home/Overview/OverView.vue

@@ -264,10 +264,9 @@ const monthInfo = reactive<TemporalTrendInfo>({
 })
 
 /**
- * @description: 更新所有的请求接口
+ *  更新请求配置
  * @param {*} pf 平台
  * @param {*} gid 游戏id
- * @return {*}
  */
 const updateAllReq = (pf: string, gid: string) => {
   pf = isSinglePf ? pf[0] : pf
@@ -276,12 +275,6 @@ const updateAllReq = (pf: string, gid: string) => {
   updateReqConfig(monthInfo.dataReqConfig, { pf, gid })
 }
 
-/**
- * @description: 监听pf和gid的变化,数据变化后立即重新请求所有相关数据
- *    当没有激活时,则取消监听
- * @tip watch监听reactive的数据时,必须以getter形式,不然会警告
- * @return {*}
- */
 const backupSelect = reactive([])
 watchPageChange(() => [selectInfo.pf, selectInfo.gid], backupSelect, updateAllReq)
 </script>

+ 30 - 54
src/views/Index.vue

@@ -3,7 +3,6 @@
  * @Date: 2024-08-20 14:06:49
  * @LastEditors: fxs bjnsfxs@163.com
  * @LastEditTime: 2024-11-27
- * @FilePath: \SqueezeTheBusc:\Users\NINGMEI\Desktop\Manage\Game-Backstage-Management-System\src\views\Index.vue
  * @Description: 
  * 
 -->
@@ -18,9 +17,9 @@ import { ElMessage } from 'element-plus'
 import { getAllGameInfo } from '@/utils/table/table'
 
 import { useCommonStore } from '@/stores/useCommon'
-import { initLoadResouce } from '@/utils/resource'
+import { initLoadResource } from '@/utils/resource'
 import { setLoginState } from '@/utils/localStorage/localStorage'
-import { removeAllToeken } from '@/utils/token/token'
+import { removeAllToken } from '@/utils/token/token'
 
 import router from '@/router'
 import DropDownSelection from '@/components/dataAnalysis/DropDownSelection.vue'
@@ -30,8 +29,8 @@ const { selectInfo, allGameInfo, saveSelectInfo } = useCommonStore()
 
 const isCollapse = ref(false)
 const navBarSelect = ref<string>('Home')
-const siderBarOpened = ref<Array<string>>(['数据总览'])
-const siderBar = ref()
+// const sideBarOpened = ref<Array<string>>(['数据总览'])
+// const sideBar = ref()
 const loadingState = ref(false) // 用来标记必要信息的加载状态
 
 // 路由信息,同时也是侧边栏生成的依据信息
@@ -56,14 +55,17 @@ const navBarMenuList = [
 ]
 
 /**
- * @description: 侧边栏折叠改变
- * @return {*}
+ * 侧边栏折叠改变
  */
 const changeCollapse = () => {
   isCollapse.value = !isCollapse.value
 }
 
-// 登出
+/**
+ * 退出登录
+ *
+ * 清除登录信息,跳转到登录页
+ */
 const logOut = () => {
   ElMessage({
     type: 'success',
@@ -71,7 +73,7 @@ const logOut = () => {
     duration: 1000
   })
   setLoginState(false)
-  removeAllToeken()
+  removeAllToken()
   router.push('/login')
 }
 
@@ -83,29 +85,28 @@ const gameSelectInfo = reactive<DropDownInfo>({
 })
 
 /**
- * @description: 更新整个页面的游戏选择
+ * 更新整个页面的游戏选择
  * @param {*} gid 游戏id
- * @return {*}
  */
-const changeGame = (gid: any) => {
+const changeGame = (gid: string) => {
   selectInfo.gid = gid
   saveSelectInfo()
 }
 
 /**
- * @description: 头部导航栏改变
+ * 更新头部导航栏,跳转到对应页面
  * @param {*} val 对应的name
- * @return {*}
  */
 const changeNavBar = (val: string) => {
   navBarSelect.value = val
 
   router.push(`/${val}`)
   createdMenuList()
-  let title = navBarMenuList.find((item) => item.name === val)?.title
-  if (title) {
-    siderBarOpened.value.splice(0, 1, title)
-  }
+  // 如果存在这个顶级导航栏
+  // let title = navBarMenuList.find((item) => item.name === val)?.title
+  // if (title) {
+  //   sideBarOpened.value.splice(0, 1, title)
+  // }
 }
 
 // 资源的加载路径
@@ -121,8 +122,7 @@ const blobUrlInfo = reactive<Record<string, string>>({})
 const basePath = ref<string | undefined>()
 
 /**
- * @description: 创建侧边栏menu
- * @return {*}
+ * 创建侧边栏菜单
  */
 const createdMenuList = () => {
   let routes = router.options.routes // 获取路由信息
@@ -135,9 +135,7 @@ const createdMenuList = () => {
 }
 
 /**
- * @description: 当路由地址改变的时候,去获取最新的导航栏位置,并且重新生成侧边栏,不然刷新后,侧边栏会无法选中
- * @param {*} router
- * @return {*}
+ * 当路由地址改变的时候,去获取最新的导航栏位置,并且重新生成侧边栏,不然刷新后,侧边栏会无法选中
  */
 watch(
   () => [router.currentRoute.value.fullPath],
@@ -156,8 +154,7 @@ watch(
 )
 
 /**
- * @description: 获取所有游戏列表
- * @return {*}
+ * 获取所有游戏列表
  */
 const getGameInfo = () => {
   getAllGameInfo()
@@ -192,8 +189,10 @@ const getGameInfo = () => {
 }
 
 /**
- * @description: 监听游戏列表的变化
- * @return {*}
+ * 监听游戏列表的变化
+ *
+ * 此处只是声明,在后续加载完成后,会被赋值唯一一个监听器
+ *
  */
 let watchGameListChange: () => void = () => {}
 
@@ -205,6 +204,7 @@ const watchLoadingState = watch(
   () => loadingState,
   (newVal) => {
     if (newVal) {
+      // 用来监听游戏列表的变化
       watchGameListChange = watch(
         () => allGameInfo,
         (newGameInfo: Array<any>) => {
@@ -231,7 +231,7 @@ const watchLoadingState = watch(
 getGameInfo()
 onMounted(() => {
   // 去加载所有需要的资源
-  initLoadResouce(resourceInfo).then((data) => {
+  initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
 })
@@ -291,12 +291,8 @@ onMounted(() => {
       </div>
       <!-- 侧边栏 -->
       <div class="sideBarBox">
-        <el-menu
-          :default-active="defaultActive"
-          class="sideBar"
-          :collapse="isCollapse"
-          ref="siderBar"
-        >
+        <el-menu :default-active="defaultActive" class="sideBar" :collapse="isCollapse">
+          <!--          ref="sideBar"-->
           <template v-for="(item, index) in menuList">
             <el-sub-menu :index="`${index}`" v-if="item.children && item.showChild">
               <template #title>
@@ -377,30 +373,11 @@ onMounted(() => {
   overflow: scroll;
 }
 
-/* 设置弹出层的样式 */
-.el-popper > .logoText {
-  width: 100px;
-  font-size: 16px;
-  /* color: red; */
-}
-
 .logoImg {
   display: flex;
   align-items: center;
   width: 33px;
   margin-right: 10px;
-  /* margin-right: 20px; */
-  /* height: 50px; */
-}
-
-.logoText {
-  width: 80%;
-  height: 100%;
-  margin-left: 15%;
-  display: flex;
-  font-size: 18px;
-  align-items: center;
-  /* background-color: lightcoral; */
 }
 
 .logoTitle {
@@ -527,7 +504,6 @@ onMounted(() => {
 .headPopper {
   padding: 0 !important;
   border: 1px solid #e5e6eb;
-
   background-color: white;
 }
 .el-menu--horizontal.el-menu {

+ 11 - 12
src/views/Login/LoginView.vue

@@ -3,7 +3,7 @@ import type { RuleInfo } from '@/types/input'
 
 import { onMounted, reactive, ref } from 'vue'
 import { useRequest } from '@/hooks/useRequest'
-import { initLoadResouce } from '@/utils/resource'
+import { initLoadResource } from '@/utils/resource'
 import { setToken, setRefreshToken } from '@/utils/token/token'
 import { setLoginState } from '@/utils/localStorage/localStorage'
 
@@ -25,7 +25,7 @@ const loginInfo = reactive<LoginInfoType>({
 })
 
 // 判断目前是否在登陆
-const isLogining = ref(false)
+const isLogin = ref(false)
 
 const formFieldsRules = reactive<{
   [key: string]: RuleInfo
@@ -89,13 +89,12 @@ const validLoginInfo = (loginInfo: LoginInfoType): boolean => {
 
 /**
  * @description: 用户登录
- * @return {*}
  */
 const userLogin = async () => {
-  if (isLogining.value) return
-  isLogining.value = true
-  let vaild = validLoginInfo(loginInfo)
-  if (vaild) {
+  if (isLogin.value) return
+  isLogin.value = true
+  let valid = validLoginInfo(loginInfo)
+  if (valid) {
     try {
       let data = await axiosInstance.post(AllApi.userLogin, loginInfo)
       let result = JSON.parse(JSON.stringify(data))
@@ -104,18 +103,18 @@ const userLogin = async () => {
       setRefreshToken(result.refreshToken)
       setLoginState(true)
       axiosInstance.defaults.headers['Authorization'] = result.token // 需要在这里设置,不然又会触发拦截器
-      router.push('/')
+      void router.push('/')
     } catch (err) {
       console.log(err)
     } finally {
-      isLogining.value = false
+      isLogin.value = false
     }
   }
 }
 
 onMounted(() => {
   // 去加载所有需要的资源
-  initLoadResouce(resourceInfo).then((data) => {
+  initLoadResource(resourceInfo).then((data) => {
     Object.assign(blobUrlInfo, data)
   })
 })
@@ -142,7 +141,7 @@ onMounted(() => {
             <div class="loginFormItem">
               <MyInput
                 :p-input-type="'text'"
-                :pinput-rules="formFieldsRules.userName"
+                :input-rules="formFieldsRules.userName"
                 :placeholder="formFieldsRules.userName.placeholder"
                 v-model="loginInfo.userName"
                 class="userName"
@@ -155,7 +154,7 @@ onMounted(() => {
             <div class="loginFormItem">
               <MyInput
                 :p-input-type="'password'"
-                :pinput-rules="formFieldsRules.password"
+                :input-rules="formFieldsRules.password"
                 :placeholder="formFieldsRules.password.placeholder"
                 v-model="loginInfo.password"
                 class="password"