Browse Source

删除日期生成器

lifanagju_citu 11 tháng trước cách đây
mục cha
commit
8a42837f69

+ 0 - 3
src/views/resume/components/basicInfo.vue

@@ -98,7 +98,6 @@ import CtForm from '@/components/CtForm'
 import Snackbar from '@/plugins/snackbar'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { getTimeStamp, timesTampChange } from '@/utils/date'
-// import { getYearMonth20YearsAgo, generateYearMonthDataArray } from './../utils/generateYearMonthData'
 import { saveResumeBasicInfo } from '@/api/resume'
 import { useUserStore } from '@/store/user'
 import { ref, shallowRef } from 'vue';
@@ -109,8 +108,6 @@ const CtFormRef = ref()
 const isEdit = ref(false)
 const showIcon = ref(false)
 const isExpand = ref(false)
-// const defaultYearMonthValue = ref(getYearMonth20YearsAgo())
-// const yearMonth = ref(generateYearMonthDataArray())
 
 const welfareList = ref(['热情活泼', '理性冷静', '富有创新', '热爱生活', '有幽默感'])
 let baseInfo = ref({})

+ 0 - 36
src/views/resume/utils/generateYearMonthData.js

@@ -1,36 +0,0 @@
-// 近100年的YYYY-MM [{ label: '2024-05', value: 202405 }]
-export const generateYearMonthDataArray = () => {
-  const currentYear = new Date().getFullYear()
-  const yearMonthData = []
-  
-  for (let i = 0; i < 100; i++) {  
-    const year = currentYear - i
-    for (let month = 0; month < 12; month++) {  
-      const label = `${year}-${('0' + (month + 1)).slice(-2)}`; // 格式化为 "YYYY-MM"  
-      const value = parseInt(`${year}${('0' + (month + 1)).slice(-2)}`, 10); // 转换为整数格式 "YYYYMM"  
-      yearMonthData.push({ label, value })
-    }  
-  }  
-  
-  return yearMonthData; 
-}
-// 20年前的YYYYMM 返回:202405
-export const getYearMonth20YearsAgo = (num = 20) => {
-  // 获取当前日期  
-  const now = new Date()
-      
-  // 设置年份为20年前  
-  now.setFullYear(now.getFullYear() - num)
-    
-  // 需要注意的是,我们不能直接设置月份为0(因为月份是从0开始的),  
-  // 但由于我们只是要获取年和月,并不真正需要修改日期的月份部分,  
-  // 所以我们可以保持月份不变。  
-    
-  // 格式化年月为六位数的字符串  
-  const yearMonthString = `${now.getFullYear()}${('0' + (now.getMonth() + 1)).slice(-2)}`
-    
-  // 将字符串转换为数字类型  
-  const yearMonthNumber = parseInt(yearMonthString, 10)
-    
-  return yearMonthNumber
-}