Browse Source

组态阀门控制修改

develop
fuguobin 1 year ago
parent
commit
d03e38cb5a
  1. 4
      src/types/auto-imports.d.ts
  2. 2
      src/types/components.d.ts
  3. 1
      src/views/monitoring/components/header.vue
  4. 37
      src/views/monitoring/devicemanage/components/main.vue
  5. 4
      src/views/monitoring/devicemanage/index.scss

4
src/types/auto-imports.d.ts

@ -4,6 +4,8 @@ declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const ElNotification: typeof import('element-plus/es')['ElNotification']
const NEllipsis: typeof import('naive-ui')['NEllipsis']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']
@ -272,6 +274,8 @@ declare module 'vue' {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
readonly NEllipsis: UnwrapRef<typeof import('naive-ui')['NEllipsis']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>

2
src/types/components.d.ts

@ -47,6 +47,8 @@ declare module '@vue/runtime-core' {
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
NIcon: typeof import('naive-ui')['NIcon']
NInput: typeof import('naive-ui')['NInput']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NMenu: typeof import('naive-ui')['NMenu']
NModal: typeof import('naive-ui')['NModal']

1
src/views/monitoring/components/header.vue

@ -121,6 +121,7 @@
:current-page.sync="params.pageNum"
:page-size="params.pageSize"
:total="params.total"
hide-on-single-page
@current-change="handleCurrentChange"
/>
<div class="warClose" @click="warClose">

37
src/views/monitoring/devicemanage/components/main.vue

@ -147,15 +147,31 @@
<template #checked>Y</template>
<template #unchecked>N</template>
</n-switch>
<n-input-group v-if="res.ctrlpro.valueType != 'bool'">
<n-input-number
size="tiny"
v-model:value="res.value"
style="width: 100px; opacity: 0.9"
style="width: 80px; opacity: 0.9; text-align: center"
button-placement="both"
placeholder=""
@keyup.enter="handleBlur(res)"
/>
<n-input-group-label
size="tiny"
style="opacity: 0.9; text-align: center; cursor: pointer"
@click="handleBlur(res)"
>确定</n-input-group-label
>
</n-input-group>
<!-- <n-input-number
size="tiny"
v-model:value="res.value"
style="width: 100px; opacity: 0.9; text-align: center"
button-placement="both"
placeholder=""
@blur="handleBlur(res)"
v-if="res.ctrlpro.valueType != 'bool'"
/>
/> -->
</i>
</span>
</div>
@ -190,14 +206,22 @@
<template #checked>Y</template>
<template #unchecked>N</template>
</n-switch>
<n-input-group v-if="res.ctrlpro.valueType != 'bool'">
<n-input-number
size="tiny"
v-model:value="res.value"
style="width: 100px; opacity: 0.9"
style="width: 80px; opacity: 0.9; text-align: center"
button-placement="both"
placeholder=""
v-if="res.ctrlpro.valueType != 'bool'"
@keyup.enter="handleBlur(res)"
/>
<n-input-group-label
size="tiny"
style="opacity: 0.9; text-align: center; cursor: pointer"
@click="handleBlur(res)"
>确定</n-input-group-label
>
</n-input-group>
</i>
</span>
</div>
@ -288,8 +312,7 @@ function gitDevice() {
}
infoData.value = Object.keys(res.data).length === 0 ? [] : res.data.datas;
zoneType.value = Object.keys(res.data).length === 0 ? 0 : res.data.pCounts;
deviceImg.value =
Object.keys(res.data).length === 0 ? '' : 'src/assets/images/device/' + res.data.imgIndex + '.gif';
deviceImg.value = Object.keys(res.data).length === 0 ? '' : res.data.imgIndex;
console.log(deviceImg.value);
} else {
clearTimeout(timer.value);
@ -339,7 +362,7 @@ function handleBlur(data: any) {
sendCtrl(submitData).then((res: any) => {
if (res.code === 200) {
console.log(res.data);
ElMessage(res.data.msg);
ElNotification({ message: res.data.msg });
}
});
}

4
src/views/monitoring/devicemanage/index.scss

@ -502,6 +502,10 @@
.n-input-number {
display: flex;
align-items: center;
.n-input__prefix,
.n-input__suffix {
display: none;
}
}
}
.switch {

Loading…
Cancel
Save