|
@@ -121,7 +121,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch } from 'vue'
|
|
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
import mainApi from '~api/project/gist'
|
|
|
import { deepClone, getArrValue, getObjValue, newDownBlob } from 'js-fast-way'
|
|
|
import dayjs from 'dayjs'
|
|
@@ -144,6 +144,12 @@ const props = defineProps({
|
|
|
//事件
|
|
|
const emit = defineEmits(['tap', 'check', 'change'])
|
|
|
|
|
|
+//时间处理
|
|
|
+const currentYear = ref('')
|
|
|
+onMounted(() => {
|
|
|
+ currentYear.value = new dayjs().format('YYYY')
|
|
|
+})
|
|
|
+
|
|
|
//监听权限
|
|
|
const isAdminAuth = ref(props.isAdmin)
|
|
|
watch(() => props.isAdmin, (admin) => {
|
|
@@ -244,12 +250,11 @@ 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++) {
|
|
|
const planYear = table[i].year
|
|
|
- if (planYear === currentYear) {
|
|
|
+ if (planYear === currentYear.value) {
|
|
|
yearIndex.value = i
|
|
|
yearKey.value = table[i].year
|
|
|
isIndex = true
|