Skip to content

Commit

Permalink
fix: 物模型延时缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed Jul 25, 2022
1 parent b29e14a commit c8dd9d4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/i18n/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ export default {
exportpro: '导出产品',
topoview: '组态大屏',
importpro: '导入产品',
productinterval: '物模型缓存延时(秒/s)',
},
scripttips: {
Pleaseinputproduct: '请输入产品',
Expand Down
11 changes: 10 additions & 1 deletion src/views/DeviceCloud/manage/home_index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
:disabled="form.type == 'edit' ? true : false"
placeholder="请选择产品"
style="width: 100%"
@change="selectChange"
>
<el-option
v-for="item in product"
Expand Down Expand Up @@ -641,7 +642,7 @@
} from '@/api/Device'
import { mapActions, mapGetters, mapMutations } from 'vuex'
import TableEdit from '@/views/DeviceCloud/empty/tableEdit'
import { queryProduct } from '@/api/Product'
import { getProduct, queryProduct } from '@/api/Product'
import {
BaiduMap,
BmCityList,
Expand Down Expand Up @@ -687,6 +688,7 @@
},
data() {
return {
productDetail: {},
activeName: '0',
commandInfo: {
dialog: false,
Expand Down Expand Up @@ -1041,6 +1043,11 @@
})
return name
},
async selectChange(productId) {
getProduct(productId).then((res) => {
this.productDetail = res
})
},
submitForm(formName, type) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
Expand Down Expand Up @@ -1072,6 +1079,8 @@
delete params.address
delete params.location
}
params.detail.devType = this.productDetail.devType
params.detail.category = this.productDetail.category.objectId
const { error = '', objectId = '' } = await postDevice(params)
if (error) {
this.$message({
Expand Down
12 changes: 12 additions & 0 deletions src/views/DeviceCloud/manage/js/proddetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
BmScale,
BmView,
} from 'vue-baidu-map'
import {putDevice} from "../../../../api/Device";

var editor
var editor1
Expand Down Expand Up @@ -898,6 +899,17 @@ export default {
this.subdialogtimer = null
},
methods: {
async blurinterval(productdetail) {
await putProduct(productdetail.objectId, {
config: productdetail.config,
})
this.$message({
message: '物模型缓存延时修改成功',
type: 'success',
showClose: true,
duration: 1500,
})
},
async handleAddressClose() {
this.dialog_address = !this.dialog_address
await putProduct(this.productObj.objectId, {
Expand Down
13 changes: 12 additions & 1 deletion src/views/DeviceCloud/manage/proddetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,17 @@
{{ amisproductInfo.length || 0 }}
</el-button>
</el-descriptions-item>
<el-descriptions-item
:label="$translateTitle('product.productinterval')"
>
<el-input
v-model="productdetail.config.interval"
size="mini"
style="margin: 0 auto"
type="number"
@blur="blurinterval(productdetail)"
/>
</el-descriptions-item>
<el-descriptions-item
:label="$translateTitle('equipment.address')"
>
Expand Down Expand Up @@ -2938,7 +2949,7 @@
</el-tab-pane>
<!--字典-->
<el-tab-pane :label="$translateTitle('product.dict')" name="dict">
<dgiot-dict :dict-form="dictForm" />
<dgiot-dict />
</el-tab-pane>
</el-tabs>
</div>
Expand Down

1 comment on commit c8dd9d4

@vercel
Copy link

@vercel vercel bot commented on c8dd9d4 Jul 25, 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-dgiot.vercel.app
dgiot-dashboard.vercel.app
dgiot-dashboard-git-master-dgiot.vercel.app

Please sign in to comment.