<template>
  <view class="page bg-w pt30">
    <up-grid :border="false" :col="gridCol">
      <up-grid-item class="mb25 mt25" v-for="(item, listIndex) in list" :key="listIndex" @click="goSystem(item.url)">
        <image style="width: 80px; height: 80px" :src="`/static/images/menus/${item.icon}.png`"></image>
        <text class="grid-text">{{ item.name }}</text>
      </up-grid-item>
    </up-grid>
  </view>
  <company-dept-dialog />
</template>
<script setup>
import { reactive, ref, computed, onMounted } from 'vue'
import nx from '@/nx'
import { useGridCol } from '@/nx/hooks/useGridCol'
let list = reactive([
  // { url: '/pages/lims/index/index', name: '设备管理', icon: '设备管理' },
  { url: '/pages/analysis/index/index', name: '分析管理', icon: 'fxgl' },
  { url: '/pages/sampleWarehouse/index/index', name: '样品库管理', icon: 'ypkgl' }
])

// const sysMenus = computed(() => nx.$store('user').sysMenus)
function goSystem(url) {
  uni.setStorageSync('defaultModule', url)
  uni.reLaunch({ url })
}
onMounted(async () => {
  await nx.$api.assayTask.getAssayTaskPage()
})
const { gridCol } = useGridCol([400, 600], [2, 3, 4])
</script>

<style lang="scss" scoped>
.grid-text {
  font-size: 24px;
}
</style>
