lb #6

Merged
gtz217 merged 10 commits from lb into develop 2022-09-29 09:38:37 +08:00
4 changed files with 36 additions and 15 deletions
Showing only changes of commit 1b670dc0ac - Show all commits

View File

@ -383,14 +383,14 @@ export default {
}).then(({ data: res }) => {
if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm)
console.log('data form keys: ', dataFormKeys, pick(res.data, dataFormKeys))
// console.log('data form keys: ', dataFormKeys, pick(res.data, dataFormKeys))
this.dataForm = pick(res.data, dataFormKeys)
// LABEL: FILE_RELATED
/** 对文件下载进行分流 */
this.fileList = {}
if (this.dataForm.files) {
console.log('files: ', this.dataForm.files)
// console.log('files: ', this.dataForm.files)
this.dataForm.files.forEach(file => {
// const fileName = file.fileUrl.split('/').pop()
/** [1] 处理 fileList */
@ -465,7 +465,7 @@ export default {
this.$set(this.dataForm, 'fileIds', fileIds)
}
console.log('before send: ', this.dataForm)
// console.log('before send: ', this.dataForm)
this.$http({
url: this.$http.adornUrl(urls[btn.name].url),

View File

@ -208,6 +208,7 @@ t.alarm.level = 'Alarm Level'
t.alarm.content = 'Alarm Content'
t.alarm.source = 'Alarm Source'
t.alarm.det = 'Alarm Details'
t.alarm.externalCode = 'External Code'
t.report = {}
t.report.name = 'Report Name'

View File

@ -214,6 +214,7 @@ t.alarm.level = '报警级别'
t.alarm.content = '报警内容'
t.alarm.source = '报警来源'
t.alarm.det = '报警详细内容'
t.alarm.externalCode = '外部编码'
t.report = {}
t.report.name = '报表名称'

View File

@ -2,26 +2,38 @@
<div class="mod-config">
<el-form :inline="true" :model="dataForm">
<el-form-item :label="$t('eq.groupname')">
<strong>{{ $route.params.groupName }}</strong></el-form-item
<strong>{{ $route.params.groupName || '--' }}</strong></el-form-item
>
<el-form-item :label="$t('eq.groupcode')">
<strong>{{ $route.params.groupCode }}</strong>
<strong>{{ $route.params.groupCode || '--' }}</strong>
</el-form-item>
<!-- <el-form-item>
<el-input v-model="dataForm.key" :placeholder="$t('parameter')" clearable></el-input>
</el-form-item> -->
<br />
<el-form-item>
<!-- <el-button @click="currentChangeHandle(1)">{{ $t('query') }}</el-button> -->
<el-button v-if="$hasPermission('monitoring:equipmentgroupalarm:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<!-- 报警编码/内容检索 -->
<el-input :placeholder="$t('alarm.code') + '/' + $t('alarm.content')" v-model="dataForm.key" clearable />
</el-form-item>
<el-form-item>
<el-button @click="currentChangeHandle(1)">{{ $t('query') }}</el-button>
<el-button v-if="$route.params.id && $hasPermission('monitoring:equipmentgroupalarm:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<!-- <el-button v-if="$hasPermission('monitoring:equipmentgroupalarm:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">
批量删除
</el-button> -->
</el-form-item>
</el-form>
<base-table :page="pageIndex" :size="pageSize" :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" />
<base-table
:page="pageIndex"
:size="pageSize"
:data="dataList"
:table-head-configs="tableConfigs"
:max-height="calcMaxHeight(8)"
@operate-event="handleOperations"
@refreshDataList="getDataList"
/>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
@ -64,6 +76,7 @@ const tableConfigs = [
{ prop: 'typeDictValue', name: i18n.t('alarm.type'), filter: dictFilter(dictEntries.alarmType.value) },
{ prop: 'gradeDictValue', name: i18n.t('alarm.level'), filter: dictFilter(dictEntries.alarmLevel.value) },
{ prop: 'alarmContent', name: i18n.t('alarm.content') },
{ prop: 'externalCode', name: i18n.t('alarm.externalCode') },
{ prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
@ -71,10 +84,11 @@ const addOrUpdateConfigs = {
type: 'dialog',
infoUrl: '/monitoring/equipmentGroupAlarm',
fields: [
{ name: 'code', label: i18n.t('alarm.code'), required: true },
{ name: 'code', label: i18n.t('alarm.code'), api: '/monitoring/equipmentGroupAlarm/getCode', required: true },
{ name: 'typeDictValue', label: i18n.t('alarm.type'), type: 'select', options: [] },
{ name: 'gradeDictValue', label: i18n.t('alarm.level'), type: 'select', options: [] },
{ name: 'alarmContent', label: i18n.t('alarm.content'), required: true }
{ name: 'alarmContent', label: i18n.t('alarm.content'), required: true },
{ name: 'externalCode', label: i18n.t('alarm.externalCode') }
],
operations: [
{ name: 'cancel', showAlways: true },
@ -129,14 +143,19 @@ export default {
//
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/monitoring/equipmentGroupAlarm/page'),
method: 'get',
params: this.$http.adornParams({
const queryParams = {
page: this.pageIndex,
limit: this.pageSize,
groupId: this.$route.params.id
})
}
if (this.dataForm.key && this.dataForm.key.trim() !== '') queryParams.key = this.dataForm.key
this.$http({
url: this.$http.adornUrl('/monitoring/equipmentGroupAlarm/page'),
method: 'get',
params: this.$http.adornParams(queryParams)
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.data.list