diff --git a/src/api/ems/dzjk.js b/src/api/ems/dzjk.js index feee88d..0d768b8 100644 --- a/src/api/ems/dzjk.js +++ b/src/api/ems/dzjk.js @@ -174,3 +174,40 @@ export function getAmmeterData({siteId,deviceId,dateTime}) { }) } + +//策略列表 +export function strategyRunningList(siteId) { + return request({ + url: `/system/strategyRunning/list?siteId=${siteId}`, + method: 'get' + }) +} +//停止策略 +export function stopStrategyRunning(siteId) { + return request({ + url: `/system/strategyRunning/stop?siteId=${siteId}`, + method: 'get' + }) +} +// 获取所有主策略 +export function getMainStrategyList(siteId) { + return request({ + url: `/system/strategyRunning/getMainStrategyList?siteId=${siteId}`, + method: 'get' + }) +} +//获取所有辅助策略 +export function getAuxStrategyList() { + return request({ + url: `/system/strategyRunning/getAuxStrategyList`, + method: 'get' + }) +} +//配置策略 +export function configStrategy(data) { + return request({ + url: `/system/strategyRunning/configStrategy`, + method: 'post', + data + }) +} diff --git a/src/api/ems/site.js b/src/api/ems/site.js index 4ba8bab..e1b3f5a 100644 --- a/src/api/ems/site.js +++ b/src/api/ems/site.js @@ -16,9 +16,41 @@ export function getDeviceInfoList({siteId,pageSize,pageNum}) { } // 设备详情 -export function getDeviceDetailInfo(deviceId) { +export function getDeviceDetailInfo(id) { return request({ - url: `/ems/siteConfig/getDeviceDetailInfo?deviceId=${deviceId}`, + url: `/ems/siteConfig/getDeviceDetailInfo?id=${id}`, method: 'get' }) } + +// 获取所有设备类别 +export function getDeviceCategory() { + return request({ + url: `/ems/siteConfig/getDeviceCategory`, + method: 'get' + }) +} + +// 新增设备 +export function addDevice(data) { + return request({ + url: `/ems/siteConfig/addDevice`, + method: 'post', + data + }) +} +// 编辑设备 +export function updateDevice(data) { + return request({ + url: `/ems/siteConfig/updateDevice`, + method: 'post', + data + }) +} +// 删除设备 +export function deleteService(id) { + return request({ + url: `/ems/siteConfig/deleteService/`+id, + method: 'delete', + }) +} diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index 6b24f6e..b3545b3 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -196,7 +196,9 @@ export default { // 上传成功回调 handleUploadSuccess(res, file) { if (res.code === 200) { - this.uploadList.push({ name: res.fileName, url: res.fileName }) + this.uploadList.push({ name: res.fileName, url: res.url }) + // todo + // this.uploadList.push({ name: res.fileName, url: res.fileName }) this.uploadedSuccessfully() } else { this.number-- @@ -256,7 +258,7 @@ export default { ::v-deep .el-upload-list--picture-card.is-disabled + .el-upload--picture-card { display: none !important; -} +} // 去掉动画效果 ::v-deep .el-list-enter-active, diff --git a/src/store/modules/ems.js b/src/store/modules/ems.js index 03dad0f..d801777 100644 --- a/src/store/modules/ems.js +++ b/src/store/modules/ems.js @@ -11,7 +11,8 @@ const ems = { alarmLevelOptions:{'A':'提示','B':'一般','C':'严重','D':'紧急'},//告警等级 alarmStatusOptions:{'0':'待处理','1':'已处理','2':'处理中'},//告警状态 deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型 - ticketStatusOptions:{0:'待处理', 1:'已处理', 2:'处理中'}//工单处理状态 + ticketStatusOptions:{0:'待处理', 1:'已处理', 2:'处理中'},//工单处理状态 + strategyStatusOptions:{'0':'未启用', 1:'已运行', 2:'已暂停', 3:'禁用', 4:'删除'},//策略状态 }, mutations: { SET_ZD_LIST(state, list) { diff --git a/src/utils/validate.js b/src/utils/validate.js index 6a4c0c5..7c5c1e1 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -11,7 +11,7 @@ export function isPathMatch(pattern, path) { } /** - * 判断value字符串是否为空 + * 判断value字符串是否为空 * @param {string} value * @returns {Boolean} */ @@ -23,7 +23,7 @@ export function isEmpty(value) { } /** - * 判断url是否是http或https + * 判断url是否是http或https * @param {string} url * @returns {Boolean} */ @@ -112,3 +112,13 @@ export function isArray(arg) { } return Array.isArray(arg) } + +/** + * @param {string} + * @returns {Boolean} + * 只能输入中文、英文、数字、特殊字符!@#$%^&*-,./ + */ +export function validText(text) { + const reg = /^[a-zA-Z0-9\u4e00-\u9fa5!@#$%^&*-,.]+$/ + return reg.test(text) +} diff --git a/src/views/ems/dzjk/clpz/clyx/index.vue b/src/views/ems/dzjk/clpz/clyx/index.vue index 21a23ef..dac5456 100644 --- a/src/views/ems/dzjk/clpz/clyx/index.vue +++ b/src/views/ems/dzjk/clpz/clyx/index.vue @@ -21,14 +21,19 @@ + diff --git a/src/views/ems/site/sblb/index.vue b/src/views/ems/site/sblb/index.vue index 53845c7..eaaa7c9 100644 --- a/src/views/ems/site/sblb/index.vue +++ b/src/views/ems/site/sblb/index.vue @@ -12,6 +12,7 @@ 重置 + 新增设备 + width="240"> @@ -80,19 +93,24 @@ +