Skip to content

Commit

Permalink
fix(equipmentCloud): 字典修复
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed Aug 4, 2022
1 parent 76928b4 commit 24a9690
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 83 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.EN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [4.5.7](https://github.com/dgiot/dgiot-dashboard/compare/v4.5.6...v4.5.7) (2022-07-29)
## [4.5.7](https://github.com/dgiot/dgiot-dashboard/compare/v4.5.6...v4.5.7) (2022-08-04)


### Bug Fixes
Expand All @@ -10,6 +10,7 @@

### Features

* **cloudTest:** 检测项 ([76928b4](https://github.com/dgiot/dgiot-dashboard/commit/76928b4114b12cfd50afc5cc077f21f145e1f98e))
* dgiot_amis ([8c91153](https://github.com/dgiot/dgiot-dashboard/commit/8c91153c8ad5b6b32d91c57a36fe55fefa3da721))


Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.ZH.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [4.5.7](https://github.com/dgiot/dgiot-dashboard/compare/v4.5.6...v4.5.7) (2022-07-29)
## [4.5.7](https://github.com/dgiot/dgiot-dashboard/compare/v4.5.6...v4.5.7) (2022-08-04)


### Bug Fixes
Expand All @@ -10,6 +10,7 @@

### Features

* **cloudTest:** 检测项 ([76928b4](https://github.com/dgiot/dgiot-dashboard/commit/76928b4114b12cfd50afc5cc077f21f145e1f98e))
* dgiot_amis ([8c91153](https://github.com/dgiot/dgiot-dashboard/commit/8c91153c8ad5b6b32d91c57a36fe55fefa3da721))


Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [4.5.7](https://github.com/dgiot/dgiot-dashboard/compare/v4.5.6...v4.5.7) (2022-07-29)
## [4.5.7](https://github.com/dgiot/dgiot-dashboard/compare/v4.5.6...v4.5.7) (2022-08-04)


### Bug Fixes
Expand All @@ -10,6 +10,7 @@

### Features

* **cloudTest:** 检测项 ([76928b4](https://github.com/dgiot/dgiot-dashboard/commit/76928b4114b12cfd50afc5cc077f21f145e1f98e))
* dgiot_amis ([8c91153](https://github.com/dgiot/dgiot-dashboard/commit/8c91153c8ad5b6b32d91c57a36fe55fefa3da721))


Expand Down
143 changes: 72 additions & 71 deletions src/views/CloudFunction/dict/components/dgiotDict.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,64 @@
* @DocumentLink:
-->
<template>
<div>
<el-form ref="data" label-width="100px" :model="data">
<el-button
class="mt-3"
icon="el-icon-plus"
size="small"
type="primary"
@click.native="addparam"
<div style="margin-left: 30px; margin-right: 30px">
<el-button
class="mt-3"
icon="el-icon-plus"
size="small"
type="primary"
@click.native="addparam"
>
<!-- 新增 -->
{{ $translateTitle('product.newlyadded') }}
</el-button>
<h1></h1>
<el-table
border
:cell-style="{ 'text-align': 'center' }"
:data="dataform.params"
:header-cell-style="{ 'text-align': 'center' }"
style="width: 100%"
>
<el-table-column
:label="$translateTitle('equipment.serialnumber')"
prop="order"
/>
<el-table-column
:label="$translateTitle('deviceLog.identifier')"
prop="identifier"
/>
<el-table-column :label="$translateTitle('equipment.name')" prop="name" />
<el-table-column :label="$translateTitle('rule.Type')" prop="type" />
<el-table-column
align="center"
:label="$translateTitle('task.Operation')"
width="160"
>
<!-- 新增 -->
{{ $translateTitle('product.newlyadded') }}
</el-button>
<el-table :data="data.params" style="width: 100%; text-align: center">
<el-table-column
:label="$translateTitle('equipment.serialnumber')"
prop="order"
/>
<el-table-column
:label="$translateTitle('deviceLog.identifier')"
prop="identifier"
/>
<el-table-column
:label="$translateTitle('equipment.name')"
prop="name"
/>
<el-table-column :label="$translateTitle('rule.Type')" prop="type" />
<el-table-column
align="center"
:label="$translateTitle('task.Operation')"
width="160"
>
<template #default="{ row, $index }">
<el-button
plain
size="mini"
:title="$translateTitle('task.Edit')"
type="info"
@click.native="editRow($index, row)"
>
<!-- 编辑 -->
{{ $translateTitle('task.Edit') }}
</el-button>
<el-button
plain
size="mini"
:title="$translateTitle('task.Delete')"
type="danger"
@click.native="delRow($index)"
>
<!-- 删除 -->
{{ $translateTitle('task.Delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-form-item size="mini" style="text-align: center">
<el-button type="primary" @click.native="submitdata">
<!-- 提交 -->
{{ $translateTitle('application.submit') }}
</el-button>
<el-button @click="dict_temp_dialog = false">
<!-- 取消 -->
{{ $translateTitle('developer.cancel') }}
</el-button>
</el-form-item>
</el-form>
<template #default="{ row, $index }">
<el-button
plain
size="mini"
:title="$translateTitle('task.Edit')"
type="info"
@click.native="editRow($index, row)"
>
<!-- 编辑 -->
{{ $translateTitle('task.Edit') }}
</el-button>
<el-button
plain
size="mini"
:title="$translateTitle('task.Delete')"
type="danger"
@click.native="delRow($index)"
>
<!-- 删除 -->
{{ $translateTitle('task.Delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-drawer
ref="param"
v-drawerDrag
Expand Down Expand Up @@ -166,10 +158,19 @@
required: true,
type: String,
},
data: {
default: function () {
return {
params: [],
}
},
required: true,
type: Object,
},
},
data() {
return {
data: { params: [] },
dataform: this.data,
param: {},
rules: {
name: [
Expand Down Expand Up @@ -227,7 +228,7 @@
})
},
delRow(index) {
this.data.params.splice(index, 1)
this.dataform.params.splice(index, 1)
this.saveDict()
},
editRow(index, row) {
Expand All @@ -251,32 +252,32 @@
this.$refs[param].validate(async (valid) => {
if (valid) {
if (this.editIndexId != undefined) {
this.data.params[this.editIndexId] = this.param
this.dataform.params[this.editIndexId] = this.param
this.$message({
showClose: true,
duration: 2000,
message: '编辑成功',
type: 'success',
})
} else {
this.data.params.push(this.param)
this.dataform.params.push(this.param)
this.$message({
showClose: true,
duration: 2000,
message: '新增成功',
type: 'success',
})
}
console.log('this.data', this.data)
this.saveDict()
}
})
},
saveDict() {
this.$dgiotBus.$emit('saveDict', {
id: this.objectId,
data: { data: this.data },
data: { data: this.dataform },
})
this.edit_param_dialog = false
},
}, //如果页面有keep-alive缓存功能,这个函数会触发
}
Expand Down
8 changes: 3 additions & 5 deletions src/views/CloudFunction/dict/components/dgiotWord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,7 @@
}
},
computed: {},
mounted() {
console.log('this.data', this.data)
console.log('this.dataform', this.dataform)
},
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
Expand Down Expand Up @@ -395,6 +392,7 @@
type: 'success',
})
} else {
this.dataform.params = this.dataform.params || []
this.dataform.params.push(this.param)
this.$message({
showClose: true,
Expand All @@ -404,7 +402,6 @@
})
}
this.saveDict()
this.edit_param_dialog = false
}
})
},
Expand All @@ -413,6 +410,7 @@
id: this.objectId,
data: { data: this.dataform },
})
this.edit_param_dialog = false
},
}, //如果页面有keep-alive缓存功能,这个函数会触发
}
Expand Down
5 changes: 1 addition & 4 deletions src/views/CloudFunction/dict/components/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
title="字典"
:visible.sync="dictFlag"
>
<dgiot-dict :object-id="dictId" />
<dgiot-dict :data="data" :object-id="dictId" />
</el-drawer>
</div>
<div class="drawerCode-content">
Expand Down Expand Up @@ -94,9 +94,6 @@
async designDict(type, objectId, data) {
this.dictId = objectId
this.data = data
console.log('data', data)
console.log('objectId', objectId)
console.log('type', type)
switch (type) {
case 'word':
this.wordFlag = true
Expand Down

1 comment on commit 24a9690

@vercel
Copy link

@vercel vercel bot commented on 24a9690 Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dgiot-dashboard – ./

dgiot-dashboard.vercel.app
dgiot-dashboard-git-master-dgiot.vercel.app
dgiot-dashboard-dgiot.vercel.app

Please sign in to comment.