From 0e13ed72c0cfa7bae5b92bdb09dd8664daca78d0 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 13 Oct 2023 16:35:00 +0800 Subject: [PATCH] =?UTF-8?q?bug=E5=A4=84=E7=90=86=E7=AC=AC2=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- .env.production | 4 +- src/api/model/device.js | 8 ++ src/main.js | 3 +- src/utils/request.js | 29 ++++ src/views/model/alert/deviceparamalert.vue | 57 ++++---- src/views/model/alert/logicconfig.vue | 87 ++++++++++-- src/views/model/alert/method.vue | 71 ++++++++-- src/views/model/alert/model.vue | 59 ++++++-- src/views/model/alert/policy.vue | 157 +++++++++++++++++---- src/views/model/device/index.vue | 116 ++++++++++++--- src/views/model/params/index.vue | 84 ++++++++--- vite.config.js | 2 +- 13 files changed, 540 insertions(+), 141 deletions(-) diff --git a/.env.development b/.env.development index 87db258..218ef3c 100644 --- a/.env.development +++ b/.env.development @@ -5,5 +5,5 @@ VITE_APP_TITLE = 联美运营系统 VITE_APP_ENV = 'development' # 联美运营系统/开发环境 -VITE_APP_BASE_API = 'http://localhost:9000' -VITE_APP_BASE_API_IMAGE = 'http://localhost:9000' +VITE_APP_BASE_API = 'http://localhost:9010' +VITE_APP_BASE_API_IMAGE = 'http://localhost:9010' diff --git a/.env.production b/.env.production index c23fb43..2a6e755 100644 --- a/.env.production +++ b/.env.production @@ -5,8 +5,8 @@ VITE_APP_TITLE = 联美管理驾驶舱 VITE_APP_ENV = 'production' # 若依管理系统/生产环境 -VITE_APP_BASE_API = 'http://10.10.10.56:9000' -VITE_APP_BASE_API_IMAGE = 'http://10.10.10.56:9000' +VITE_APP_BASE_API = 'http://10.10.10.56:9010' +VITE_APP_BASE_API_IMAGE = 'http://10.10.10.56:9010' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/src/api/model/device.js b/src/api/model/device.js index de0a582..39d144b 100644 --- a/src/api/model/device.js +++ b/src/api/model/device.js @@ -84,3 +84,11 @@ export function listWithFilterColumn(data){ data: data }); } + +//获取最大排序 +export function selectDcBaseDeviceinfoMaxSort(){ + return request({ + url: '/model/dcBaseDeviceinfo/selectDcBaseDeviceinfoMaxSort', + method: 'get' + }); +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 7773509..707ca28 100644 --- a/src/main.js +++ b/src/main.js @@ -15,7 +15,7 @@ import directive from './directive' // directive // 注册指令 import plugins from './plugins' // plugins -import { download } from '@/utils/request' +import { download,newDownload } from '@/utils/request' // svg图标 import 'virtual:svg-icons-register' @@ -54,6 +54,7 @@ app.config.warnHandler = () => null // 全局方法挂载 app.config.globalProperties.useDict = useDict app.config.globalProperties.download = download +app.config.globalProperties.newDownload = newDownload app.config.globalProperties.parseTime = parseTime app.config.globalProperties.resetForm = resetForm app.config.globalProperties.handleTree = handleTree diff --git a/src/utils/request.js b/src/utils/request.js index dc1c3b9..8cca458 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -145,4 +145,33 @@ export function download(url, params, filename, config) { }) } + +// 新通用下载方法 +export function newDownload(url, params, filename, config) { + downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, JSON.stringify(params), { + headers: { 'Content-Type': 'application/json' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isBlob = blobValidate(data); + if (isBlob) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + ElMessage.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + ElMessage.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + + + export default service diff --git a/src/views/model/alert/deviceparamalert.vue b/src/views/model/alert/deviceparamalert.vue index e38df3b..0451942 100644 --- a/src/views/model/alert/deviceparamalert.vue +++ b/src/views/model/alert/deviceparamalert.vue @@ -280,7 +280,7 @@ @@ -306,30 +306,7 @@ - + @@ -357,7 +334,7 @@ import {listPolicyInfo,updatePolicy,updatePolicyBatch,addPolicy,addPolicyBatch,l import lock from "@/assets/icons/svg/lock.svg"; const { proxy } = getCurrentInstance(); const router = useRouter(); -const { operator_sign,dc_param_value_type,dc_alert_level,dc_device_partion } = proxy.useDict('operator_sign','dc_param_value_type','dc_alert_level','dc_device_partion'); +const { dc_operator_sign,dc_param_value_type,dc_alert_level,dc_device_partion } = proxy.useDict('dc_operator_sign','dc_param_value_type','dc_alert_level','dc_device_partion'); const alertList = ref([]); const open = ref(false); const openPolicy = ref(false); @@ -643,7 +620,6 @@ function submitForm() { addAlert(form.value).then(response => { proxy.$modal.msgSuccess("新增成功"); open.value = false; - debugger getList(); handlePolicy(response.data); }); @@ -1157,11 +1133,28 @@ const isInvalid = (value,row) => { }; function changeEnabled(row){ - let param = { - id:row.id, - enabled:row.enabled - } - updateAlert(param); + ElMessageBox.confirm('确定修改该告警状态吗', '提示', { + distinguishCancelAndClose: true, + confirmButtonText: '确定', + cancelButtonText: '取消', + }) + .then(() => { + console.log("确定"); + let param = { + id:row.id, + enabled:row.enabled + } + updateAlert(param); + }) + .catch((action) => { + console.log("取消"); + if(row.enabled == 0){ + row.enabled = 1 + }else{ + row.enabled = 0 + } + }) + } function levelChange(value){ diff --git a/src/views/model/alert/logicconfig.vue b/src/views/model/alert/logicconfig.vue index 833f0ab..29ac8fd 100644 --- a/src/views/model/alert/logicconfig.vue +++ b/src/views/model/alert/logicconfig.vue @@ -52,13 +52,13 @@ @click="handleAdd" >新增 - + - +