diff --git a/src/app.vue b/src/app.vue index 9f69a44..1a9b861 100644 --- a/src/app.vue +++ b/src/app.vue @@ -9,13 +9,13 @@ onMounted(async () => { const res = await getStatus() console.log(res) console.log(systemStore.systemStatus) - // systemStore.updateSystemStatus(res) + systemStore.updateSystemStatus(res) startProgress() }) socket.init((data: System.SystemStatus) => { console.log(data) - // systemStore.updateSystemStatus(data) + systemStore.updateSystemStatus(data) }, 'status') const progress = ref(0) diff --git a/src/assets/images/background.svg b/src/assets/images/background.svg index e69de29..27a17e5 100644 --- a/src/assets/images/background.svg +++ b/src/assets/images/background.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/common/FTTable/index.vue b/src/components/common/FTTable/index.vue index 3126599..d4c1093 100644 --- a/src/components/common/FTTable/index.vue +++ b/src/components/common/FTTable/index.vue @@ -43,6 +43,7 @@ interface TableColumn { width?: number // 列宽 fixed?: 'left' | 'right' | undefined // 是否固定列 render?: (row: any) => VNode // 内容自定义 + selectable?: (row: any) => boolean } interface Btn { @@ -62,8 +63,8 @@ interface Search { } interface TableProp { - columns: TableColumn[] - getDataFn: (params: any) => Promise // 表格数据的接口 + columns?: TableColumn[] + getDataFn?: (params: any) => Promise // 表格数据的接口 mustInit?: boolean // 是否在mounted里执行getDataFn hasHeader?: boolean hasPage?: boolean @@ -165,6 +166,7 @@ defineExpose({ :width="column.width" :type="column.type" :fixed="column.fixed" + :selectable="column.selectable" > diff --git a/src/components/home/SetTemperature/index.vue b/src/components/home/SetTemperature/index.vue index 8623580..ebf4d2f 100644 --- a/src/components/home/SetTemperature/index.vue +++ b/src/components/home/SetTemperature/index.vue @@ -19,8 +19,8 @@ const validateHandle = (rule: any, value: any, callback: any) => { if (!value) { callback(new Error('请输入目标温度')) } - else if (value < 0 || value > 260) { - callback(new Error('目标温度范围0℃-260℃')) + else if (value < 0 || value > 300) { + callback(new Error('目标温度范围0℃-300℃')) } else { callback() diff --git a/src/components/home/StartHeat/index.vue b/src/components/home/StartHeat/index.vue index 3bba87a..ca2c516 100644 --- a/src/components/home/StartHeat/index.vue +++ b/src/components/home/StartHeat/index.vue @@ -22,8 +22,8 @@ const validateHandle = (rule: any, value: any, callback: any) => { if (!value) { callback(new Error('请输入目标温度')) } - else if (value < 0 || value > 260) { - callback(new Error('目标温度范围0℃-260℃')) + else if (value < 0 || value > 300) { + callback(new Error('目标温度范围0℃-300℃')) } else { callback() diff --git a/src/components/user/Edit/index.vue b/src/components/user/Edit/index.vue new file mode 100644 index 0000000..b5db879 --- /dev/null +++ b/src/components/user/Edit/index.vue @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 31fcdb4..b630ea0 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -22,10 +22,23 @@ watch(() => currentTime.value, () => { systemStore.currentTime = currentTime.value }) +watch(() => systemStore.systemStatus, () => { + if (!systemStore.systemStatus.currentUser) { + router.push('/login') + } + if (!systemStore.systemStatus.selfTest && systemStore.systemStatus.currentUser && systemStore.systemStatus.currentUser?.username !== 'test') { + isCheck.value = true + } +}) + onMounted(async () => { - if (!systemStore.systemStatus.selfTest && systemStore.systemStatus.currentUser?.username !== 'test') { + if (!systemStore.systemStatus.selfTest && systemStore.systemStatus.currentUser && systemStore.systemStatus.currentUser?.username !== 'test') { isCheck.value = true } + if (!systemStore.systemStatus.currentUser) { + console.log(11233) + await router.push('/login') + } }) onUnmounted(() => { diff --git a/src/views/user/index.vue b/src/views/user/index.vue index bcfe1b8..37ea562 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -1,223 +1,89 @@ - - - - 添加用户 - - - 编辑用户 - - - 删除用户 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + -