fzq #31

Closed
fanzhiqin wants to merge 215 commits from fzq into test
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 }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm) 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) this.dataForm = pick(res.data, dataFormKeys)
// LABEL: FILE_RELATED // LABEL: FILE_RELATED
/** 对文件下载进行分流 */ /** 对文件下载进行分流 */
this.fileList = {} this.fileList = {}
if (this.dataForm.files) { if (this.dataForm.files) {
console.log('files: ', this.dataForm.files) // console.log('files: ', this.dataForm.files)
this.dataForm.files.forEach(file => { this.dataForm.files.forEach(file => {
// const fileName = file.fileUrl.split('/').pop() // const fileName = file.fileUrl.split('/').pop()
/** [1] 处理 fileList */ /** [1] 处理 fileList */
@ -465,7 +465,7 @@ export default {
this.$set(this.dataForm, 'fileIds', fileIds) this.$set(this.dataForm, 'fileIds', fileIds)
} }
console.log('before send: ', this.dataForm) // console.log('before send: ', this.dataForm)
this.$http({ this.$http({
url: this.$http.adornUrl(urls[btn.name].url), 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.content = 'Alarm Content'
t.alarm.source = 'Alarm Source' t.alarm.source = 'Alarm Source'
t.alarm.det = 'Alarm Details' t.alarm.det = 'Alarm Details'
t.alarm.externalCode = 'External Code'
t.report = {} t.report = {}
t.report.name = 'Report Name' t.report.name = 'Report Name'

View File

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

View File

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