Explorar o código

修改项目列表

ZaiZai hai 1 ano
pai
achega
c7a470b2b9

+ 1 - 1
src/views/project/modules/gist-list.vue

@@ -143,7 +143,6 @@ const props = defineProps({
 
 //事件
 const emit = defineEmits(['tap', 'check', 'change'])
-const currentYear = new dayjs().format('YYYY')
 
 //监听权限
 const isAdminAuth = ref(props.isAdmin)
@@ -245,6 +244,7 @@ const getDetailData = async (id) => {
     res.table = table
     yearData.value = res
     //设置默认数据
+    const currentYear = new dayjs().format('YYYY')
     if (table.length > 0) {
         let isIndex = false
         for (let i = 0; i < table.length; i++) {

+ 1 - 1
src/views/project/modules/project-list.vue

@@ -283,7 +283,6 @@ watch(() => props.isAdmin, (admin) => {
 
 //渲染完成
 const isAfterRender = ref(false)
-const currentYear = new dayjs().format('YYYY')
 onMounted(() => {
     //表格太复杂,渲染较慢,等页面先加载完成,再渲染表格,不然会卡住一下不动。
     //因为表头涉及到年份,如果年份很多,那么会更卡。
@@ -364,6 +363,7 @@ const getDetailData = async (id) => {
     rowDetail.value = res
     yearData.value = res
     //设置默认数据
+    const currentYear = new dayjs().format('YYYY')
     if (list.length > 0) {
         let isIndex = false
         for (let i = 0; i < list.length; i++) {