Mr.Zhang
2023-08-22 e37485d41550b3e7e22423875d31401a8470e0b7
公共数据
已修改2个文件
23 ■■■■■ 文件已修改
screen_standard/src/App.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/components/AppLayout.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/App.vue
@@ -1,15 +1,19 @@
<script setup>
import AppLayout from './components/AppLayout.vue'
import { useCounterStore } from '@/stores/counter.js'
import { useRoute } from 'vue-router'
// import { useRoute } from 'vue-router'
const enterprise = useCounterStore()
const route = useRoute()
// const route = useRoute()
let query = window.location.href.split('?')[1].split('&')
let data = { companyId: enterprise.companyId }
query.forEach(item => {
  let subQuery = item.split('=')
  data[subQuery[0]] = subQuery[1]
})
console.log(route.query)
enterprise.setCompanyId(data.companyId)
// enterprise.setCompanyId(8)
// enterprise.setDepartId(111)
</script>
<template>
screen_standard/src/components/AppLayout.vue
@@ -55,8 +55,9 @@
import { getAssets } from '@/utils'
import { getDepartmentList } from '@/utils/apis.js'
import { reactive, toRefs, ref, onMounted } from 'vue';
import { useCounterStore } from '@/stores/counter.js'
import { RouterView } from 'vue-router'
const enterprise = useCounterStore()
const layoutList = [
  { bgImg: 'bg_zhixingzhong@2x.png', name: '执行中计划数(个)', logo: 'ic_zhixingzhong@2x.png' },
  { bgImg: 'bg_yanqijihua@2x.png', name: '延期计划数(个)', logo: 'ic_yanqijihua@2x.png' },
@@ -64,6 +65,7 @@
  { bgImg: 'bg_jinrishebei@2x.png', name: '今日生产设备(台)', logo: 'ic_jinrishebei@2x.png' },
  { bgImg: 'bg_jinribuliang@2x.png', name: '今日不良品率(%)', logo: 'ic_jinribuliang@2x.png' },
]
const data = reactive({
  tempCom: { name: '豆米科技' },
  isFull: false,
@@ -78,7 +80,9 @@
let { tempCom, isFull, tempDate, comList } = toRefs(data)
const selectCom = (item, index) => {
  console.log(item);
  data.tempCom = item
  enterprise.setDepartId(data.tempCom.id)
}
const fullChange = () => {
@@ -110,10 +114,11 @@
}
onMounted(() => {
  getDepartmentList(8)
  getDepartmentList(enterprise.companyId)
    .then(res => {
      data.comList = res
      data.tempCom = res[0]
      enterprise.setDepartId(data.tempCom.id)
    })
    .catch(err => {})
  const week = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日',]