首页:右键菜单添加 标杆风机设置或者取消按钮
This commit is contained in:
parent
dd967451fd
commit
dde8081959
@ -98,13 +98,13 @@
|
|||||||
<el-button
|
<el-button
|
||||||
class="control-btn"
|
class="control-btn"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click=""
|
@click="editstandard(1)"
|
||||||
v-if="realTimeData.standard == 0"
|
v-if="realTimeData.standard == 0"
|
||||||
>标杆设置</el-button>
|
>标杆设置</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
class="control-btn"
|
class="control-btn"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click=""
|
@click="editstandard(0)"
|
||||||
v-else
|
v-else
|
||||||
>标杆取消</el-button>
|
>标杆取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -120,6 +120,7 @@ import { adminBaseRoutePath } from '/@/router/static/adminBase'
|
|||||||
import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue'
|
import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue'
|
||||||
import { sendCommandReq, sendManualCommandReq } from '/@/api/backend/control/request'
|
import { sendCommandReq, sendManualCommandReq } from '/@/api/backend/control/request'
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
|
import {equipUpdate} from '/@/api/backend/index.ts'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -190,7 +191,9 @@ const realTimeData = ref<any>({
|
|||||||
locked: 0,
|
locked: 0,
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
name:'',
|
name:'',
|
||||||
standard:''
|
code:'',
|
||||||
|
standard:'',
|
||||||
|
iotModelId:''
|
||||||
})
|
})
|
||||||
const windContextMenu = (event: any,curnodeData) => {
|
const windContextMenu = (event: any,curnodeData) => {
|
||||||
contextMenuPos.value.x = event.pageX
|
contextMenuPos.value.x = event.pageX
|
||||||
@ -199,7 +202,9 @@ const windContextMenu = (event: any,curnodeData) => {
|
|||||||
realTimeData.value.locked=curnodeData.attributeMap.locked
|
realTimeData.value.locked=curnodeData.attributeMap.locked
|
||||||
realTimeData.value.deviceId=curnodeData.irn
|
realTimeData.value.deviceId=curnodeData.irn
|
||||||
realTimeData.value.name=curnodeData.name
|
realTimeData.value.name=curnodeData.name
|
||||||
|
realTimeData.value.code=curnodeData.deviceCode
|
||||||
realTimeData.value.standard=curnodeData.standard
|
realTimeData.value.standard=curnodeData.standard
|
||||||
|
realTimeData.value.iotModelId=curnodeData.modelId
|
||||||
OperateVisible.value = true
|
OperateVisible.value = true
|
||||||
}
|
}
|
||||||
const sendCommand = (type: 'setTurbineFastStart' | 'setTurbineStop' | 'setTurbineResetStatusCode') => {
|
const sendCommand = (type: 'setTurbineFastStart' | 'setTurbineStop' | 'setTurbineResetStatusCode') => {
|
||||||
@ -254,6 +259,31 @@ const sendManualCommand = (type: 1 | 0) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const editstandard = (type: 1 | 0) => {
|
||||||
|
const standardName = type === 0 ? '取消风机标杆' : '设置风机标杆'
|
||||||
|
ElMessageBox.confirm('确认' + standardName + '吗?', '', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}).then(() => {
|
||||||
|
equipUpdate({
|
||||||
|
id: realTimeData.value.deviceId,
|
||||||
|
code: realTimeData.value.code,
|
||||||
|
name:realTimeData.value.name,
|
||||||
|
iotModelId: realTimeData.value.iotModelId,
|
||||||
|
standard: type
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage.success('设置成功')
|
||||||
|
} else {
|
||||||
|
ElMessage.error('设置失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
Loading…
Reference in New Issue
Block a user