import { defineStore } from 'pinia'
import { reactive } from 'vue'
import { getNodeList } from '@/api/node'
export const nodeData = defineStore('node', () => {
  const nodeList = reactive([])
  const nodeListCondition = reactive({
    page: 1,
    pageSize: 10
  })
  const queryNodeList = () => {
    getNodeList(nodeListCondition).then(res => {
      if (res.code === 0) {
        console.log('节点列表', res.data)
        nodeList.length = 0
        nodeList.push(...res.data.list)
      }
    })
  }
  return {
    nodeList,
    queryNodeList
  }
})
