diff --git a/src/views/dashboard/demo/components/ProjectCard.vue b/src/views/dashboard/demo/components/ProjectCard.vue index 5a7b135..4c07732 100644 --- a/src/views/dashboard/demo/components/ProjectCard.vue +++ b/src/views/dashboard/demo/components/ProjectCard.vue @@ -10,54 +10,13 @@ const props = defineProps({ default: () => {}, }, }) -const gridData = ref([]) - watch( () => props.data, (newValue, oldValue) => { // 下方信息不会打印在控制台中 console.log('a has changed', newValue, oldValue) - getNewData() }, ) -async function getNewData() { - const rows = props.data.Content || [] - for (const item of rows) { - try { - const param = item.Point - const res = await getExaNow(param) - - let ifColor: boolean = false - if (res != null) - ifColor = res === '1' - - gridData.value.push(Object.assign({}, item, { ifColor })) - } - catch (e) { - } - } -} - -// 页面挂载时批量请求并更新数据(避免在模板中调用异步) -// onMounted(async () => { -// const rows = props.data.Content || [] -// for (const item of rows) { -// try { -// const param = item.Point -// const res = await getExaNow(param) - -// let ifColor: boolean = false -// if (res != null) -// ifColor = res === '1' - -// gridData.value.push(Object.assign({}, item, { ifColor })) - -// console.log(gridData.value) -// } -// catch (e) { -// } -// } -// }) - +
diff --git a/src/views/dashboard/demo/index.vue b/src/views/dashboard/demo/index.vue index 81ceedd..322560b 100644 --- a/src/views/dashboard/demo/index.vue +++ b/src/views/dashboard/demo/index.vue @@ -1,7 +1,6 @@