diff --git a/src/layouts/admin/components/navMenus.vue b/src/layouts/admin/components/navMenus.vue
index 818afe6..e6773da 100644
--- a/src/layouts/admin/components/navMenus.vue
+++ b/src/layouts/admin/components/navMenus.vue
@@ -51,7 +51,6 @@
-
@@ -69,6 +68,7 @@ import html2canvas from 'html2canvas'
import PopupPwd from './popup/password.vue'
import AdminInfo from './popup/adminInfo.vue'
import { useNavTabs } from '@/stores/navTabs'
+
const adminInfo = useAdminInfo()
const navTabs = useNavTabs()
const configStore = useConfig()
@@ -114,6 +114,8 @@ const handleCommand = (key: string) => {
break
case 'layout':
navTabs.closeTabs()
+ window.localStorage.clear()
+ adminInfo.reset()
router.push({ name: 'login' })
break
default:
diff --git a/src/stores/adminInfo.ts b/src/stores/adminInfo.ts
index d049068..d720dbd 100644
--- a/src/stores/adminInfo.ts
+++ b/src/stores/adminInfo.ts
@@ -47,6 +47,46 @@ export const useAdminInfo = defineStore('adminInfo', {
dataFill(state: AdminInfo) {
this.$state = { ...this.$state, ...state }
},
+ reset() {
+ this.$state = {
+ access_token: '',
+ token_type: '',
+ refresh_token: '',
+ expires_in: 0,
+ scope: '',
+ nickname: '',
+ userType: 0,
+ deptIndex: '',
+ userIndex: '',
+ client_id: '',
+ headSculpture: '',
+ jti: '',
+ name: '',
+ deptId: '',
+ phone: '',
+ email: '',
+ limitIpStart: '',
+ limitIpEnd: '',
+ limitTime: '',
+ casualUser: 0,
+ type: 0,
+ smsNotice: 0,
+ emailNotice: 0,
+ role: [],
+ devCode: '',
+ id: '',
+ loginName: '',
+ state: 0,
+ registerTime: '',
+ loginTime: '',
+ deptName: '',
+ areaId: '',
+ areaName: '',
+ deptLevel: 0,
+ roleList: [],
+ roleCode: []
+ }
+ },
removeToken() {
this.access_token = ''
this.refresh_token = ''
diff --git a/src/views/govern/device/control/detail.vue b/src/views/govern/device/control/detail.vue
index 995f20b..de96a23 100644
--- a/src/views/govern/device/control/detail.vue
+++ b/src/views/govern/device/control/detail.vue
@@ -13,11 +13,21 @@
-
+
+
+
+
+
+
查询
@@ -36,11 +46,15 @@ import MyEchart from '@/components/echarts/MyEchart.vue'
interface Props {
detail: anyObj
+ dataLevel: string
}
const props = withDefaults(defineProps(), {
detail: () => {
return {}
+ },
+ dataLevel: () => {
+ return ''
}
})
const datePickerRef = ref()
@@ -54,26 +68,52 @@ const form: any = reactive({
remark: '',
routeName: '',
sort: 100,
- type: 0,
- dataLevel: ''
+ dataLevel: '',
+ statMethod: 'avg'
})
+const typeOptions = [
+ {
+ name: '平均值',
+ id: 'avg'
+ },
+ {
+ name: '最大值',
+ id: 'max'
+ },
+ {
+ name: '最小值',
+ id: 'min'
+ },
+ {
+ name: 'CP95值',
+ id: 'cp95'
+ }
+]
const echartsData = ref(null)
const dialogVisible = ref(false)
const loading = ref(true)
onMounted(() => {
- form.dataLevel = props.detail.dataLevel
+ if (props.dataLevel == 'Secondary') {
+ form.dataLevel = 'Primary'
+ }else{
+ form.dataLevel=props.dataLevel
+ }
init()
})
const init = () => {
echartsData.value = null
loading.value = true
+ console.log(props.detail.children, 'props.detail.children')
+ let statisticalParams = props.detail.children
+ statisticalParams[0].statMethod = form.statMethod
getDeviceDataTrend({
devId: props.detail.devId,
endTime: datePickerRef.value.timeValue[1],
lineId: props.detail.lineId,
startTime: datePickerRef.value.timeValue[0],
- statisticalParams: props.detail.children,
- dataLevel: form.dataLevel
+ statisticalParams: statisticalParams,
+ dataLevel: form.dataLevel,
+ statMethod: form.statMethod
}).then(res => {
if (res.data.length && res.data[0].length) {
let arr: any[] = []
diff --git a/src/views/govern/device/control/index.vue b/src/views/govern/device/control/index.vue
index dfc7e57..1134248 100644
--- a/src/views/govern/device/control/index.vue
+++ b/src/views/govern/device/control/index.vue
@@ -91,7 +91,7 @@
-
+
@@ -248,7 +248,7 @@
-
+
@@ -382,6 +382,9 @@ const nodeClick = async (e: anyObj) => {
deviceData.value = res.data
formInline.dataLevel = res.data.dataLevel
dataLevel.value = res.data.dataLevel
+ if (dataLevel.value == 'Secondary') {
+ formInline.dataLevel = 'Primary'
+ }
if (!res.data.dataSetList) {
dataSet.value = ''
tableData.value = []
diff --git a/src/views/govern/device/planData/components/device_back.vue b/src/views/govern/device/planData/components/device_back.vue
index 1eda561..121e822 100644
--- a/src/views/govern/device/planData/components/device_back.vue
+++ b/src/views/govern/device/planData/components/device_back.vue
@@ -66,7 +66,7 @@
@cancel="cancelDelete"
>
- 删除
+ 删除
diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue
index 8fcc716..23de86b 100644
--- a/src/views/govern/device/planData/index.vue
+++ b/src/views/govern/device/planData/index.vue
@@ -5,8 +5,8 @@
- 新增方案
-
+ 新增方案
+
数据导出
@@ -83,10 +83,10 @@
{{ item.location }}
-
-
@@ -150,7 +150,7 @@
- 查询
+ 查询