diff --git a/src/components/base-dialog/addOrUpdate/index.vue b/src/components/base-dialog/addOrUpdate/index.vue
index ba96e3b..cd427fd 100644
--- a/src/components/base-dialog/addOrUpdate/index.vue
+++ b/src/components/base-dialog/addOrUpdate/index.vue
@@ -315,7 +315,9 @@ export default {
/** 提取url */
const urls = {}
this.configs.operations.map(item => {
- urls[item.name] = item.url
+ urls[item.name] = {}
+ urls[item.name].url = item.url
+ urls[item.name].extraFields = item.extraFields || {}
})
/** 操作 */
switch (btn.name) {
@@ -325,9 +327,9 @@ export default {
this.$refs['dataForm'].validate(valid => {
if (valid) {
this.$http({
- url: this.$http.adornUrl(urls[btn.name]),
+ url: this.$http.adornUrl(urls[btn.name].url),
method: btn.name === 'save' ? 'POST' : 'PUT',
- data: this.dataForm
+ data: { ...this.dataForm, ...urls[btn.name].extraFields}
})
.then(({ data: res }) => {
if (res && res.code === 0) {
diff --git a/src/views/modules/monitoring/equipmentGroup.vue b/src/views/modules/monitoring/equipmentGroup.vue
index 839b47c..bb2a3c0 100644
--- a/src/views/modules/monitoring/equipmentGroup.vue
+++ b/src/views/modules/monitoring/equipmentGroup.vue
@@ -64,7 +64,16 @@ const tableConfigs = [
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
-const addOrUpdateConfigs = {}
+const addOrUpdateConfigs = {
+ type: 'dialog',
+ infoUrl: '/monitoring/equipmentGroup',
+ fields: [{ name: 'name', label: '分组名称' }, { name: 'code', label: '分组编码' }, 'remark'],
+ operations: [
+ { name: 'cancel', showAlways: true },
+ { name: 'save', url: '/monitoring/equipmentGroup', permission: '', showOnEdit: false },
+ { name: 'update', url: '/monitoring/equipmentGroup', permission: '', showOnEdit: true }
+ ]
+}
export default {
data() {
@@ -132,7 +141,7 @@ export default {
handleOperations({ type, data: id }) {
switch (type) {
case 'view-alarm':
- const {name, code} = this.dataList.find(item => item.id === id)
+ const { name, code } = this.dataList.find(item => item.id === id)
this.$router.push({
name: 'monitoring-equipmentGroupAlarm',
params: {
diff --git a/src/views/modules/monitoring/equipmentGroupAlarm.vue b/src/views/modules/monitoring/equipmentGroupAlarm.vue
index d92dea9..c85c188 100644
--- a/src/views/modules/monitoring/equipmentGroupAlarm.vue
+++ b/src/views/modules/monitoring/equipmentGroupAlarm.vue
@@ -48,7 +48,7 @@
-->
-
+
{
+ if (item.extraFields) {
+ item.extraFields.equipmentGroupId = this.$route.params.id || null
+ }
+ })
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)