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 EffectScope: typeof import('vue')['EffectScope']
const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] 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 asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed'] const computed: typeof import('vue')['computed']
@ -272,6 +274,8 @@ declare module 'vue' {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']> readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']> 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 asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']> readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']> 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'] NDrawerContent: typeof import('naive-ui')['NDrawerContent']
NIcon: typeof import('naive-ui')['NIcon'] NIcon: typeof import('naive-ui')['NIcon']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
NInputNumber: typeof import('naive-ui')['NInputNumber'] NInputNumber: typeof import('naive-ui')['NInputNumber']
NMenu: typeof import('naive-ui')['NMenu'] NMenu: typeof import('naive-ui')['NMenu']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']

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

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

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

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

Loading…
Cancel
Save