Skip to content

Commit

Permalink
feat: template
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxiaoyin committed Jul 15, 2024
1 parent 6f1bc81 commit 3484162
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 158 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.EN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [4.8.7](https://github.com/dgiot/iotStudio/compare/v4.8.6...v4.8.7) (2024-05-31)


### Features

* import modbusxtcp ([6f1bc81](https://github.com/dgiot/iotStudio/commit/6f1bc81511d09ee2be0d62c3baa8f370b48e7589))
* import wmx ([83c0b64](https://github.com/dgiot/iotStudio/commit/83c0b64afa28d6332765a3efc962c0e5ca238a74))



## [4.8.6](https://github.com/dgiot/iotStudio/compare/v4.7.2...v4.8.6) (2023-11-03)


Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.ZH.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [4.8.7](https://github.com/dgiot/iotStudio/compare/v4.8.6...v4.8.7) (2024-05-31)


### Features

* import modbusxtcp ([6f1bc81](https://github.com/dgiot/iotStudio/commit/6f1bc81511d09ee2be0d62c3baa8f370b48e7589))
* import wmx ([83c0b64](https://github.com/dgiot/iotStudio/commit/83c0b64afa28d6332765a3efc962c0e5ca238a74))



## [4.8.6](https://github.com/dgiot/iotStudio/compare/v4.7.2...v4.8.6) (2023-11-03)


Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [4.8.7](https://github.com/dgiot/iotStudio/compare/v4.8.6...v4.8.7) (2024-05-31)


### Features

* import modbusxtcp ([6f1bc81](https://github.com/dgiot/iotStudio/commit/6f1bc81511d09ee2be0d62c3baa8f370b48e7589))
* import wmx ([83c0b64](https://github.com/dgiot/iotStudio/commit/83c0b64afa28d6332765a3efc962c0e5ca238a74))



## [4.8.6](https://github.com/dgiot/iotStudio/compare/v4.7.2...v4.8.6) (2023-11-03)


Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dgiot/dgiot-dashboard",
"version": "4.8.6",
"author": "xxb",
"version": "4.8.7",
"author": "dgiot",
"license": "MPL-2.0",
"private": false,
"homepage": "https://github.com/dgiot/iotStudio.git",
Expand Down
2 changes: 1 addition & 1 deletion src/api/Export/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function ExportParse(className, params) {
console.log('_token', _token)
// eslint-disable-next-line no-undef
return axios
.post(`iotapi/export_data?classname=${className}`, params, {
.post(`/iotapi/export_data?classname=${className}`, params, {
responseType: 'blob',
headers: {
Accept: 'application/json',
Expand Down
8 changes: 4 additions & 4 deletions src/config/developer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ module.exports = {
*/
{
path: 'iotapi',
target: 'https://dev.dgiotcloud.cn',
target: 'http://192.168.1.150',
},
/**
* @description 静态资源目录。开发使用
*/
{
path: 'dgiot_dashboard',
target: 'https://dev.dgiotcloud.cn',
target: 'http://192.168.1.150',
},
/**
* @description dgiot_file文件资源目录。开发使用
*/
{
path: 'dgiot_file',
target: 'https://dev.dgiotcloud.cn',
target: 'http://192.168.1.150',
},
/**
* @description dgiot_file文件资源目录。开发使用
*/
{
path: 'upload',
target: 'http://dev.dgiotcloud.cn',
target: 'http://192.168.1.150',
},
/**
* @description amis server 开发使用
Expand Down
1 change: 0 additions & 1 deletion src/views/CloudFunction/topo/topo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<el-main class="konva-container-main">
<el-row :gutter="gutter.gutter">
<!-- 明诚发布注释18 到 27 行-->
<el-col
class="hidden-xs-only konva-container-main-allocation"
:lg="isDevice ? 0 : 4"
Expand Down
2 changes: 1 addition & 1 deletion src/views/DeviceCloud/manage/js/proddetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ export default {
},
// 物模型提交
submitForm(obj) {
dgiotlog.log('obj', obj)
console.log('obj', obj)
let data = {
item: obj,
productid: this.productId,
Expand Down
161 changes: 12 additions & 149 deletions src/views/DeviceCloud/manage/profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@
:title="wmxSituation + '自定义属性'"
top="5vh"
:visible.sync="wmxdialogVisible"
width="60%"
width="80%"
>
<dgiot-wmx
:key="upKey"
ref="sizeForm"
:moduletype="moduletype"
:size-form1="sizeForm"
@addDas="addDas"
@addDomain="addDomain"
Expand Down Expand Up @@ -418,6 +420,7 @@
import { postDict } from '@/api/Dict'
import { getHashClass } from '@/api/Hash'
import { getTable } from '@/api/Dba'
import {postThing, putThing} from '@/api/Product/index'
import {
delProductTemplet,
getProductTemplet,
Expand All @@ -432,6 +435,7 @@
import { post_tree } from '@/api/Logs'
import dgiotViews from '@/views/CloudFunction/lowcode'
import { getRule } from '@/api/Rules'
import {dgiotlog} from "@/utils/dgiotLog";

const context = require.context('./component/profile', true, /\.vue$/)
let res_components = {}
Expand All @@ -450,6 +454,8 @@
props: {},
data() {
return {
moduletype: 'properties',
upKey: moment.now(),
engineData: [],
Notification: {
show: false,
Expand Down Expand Up @@ -1952,173 +1958,30 @@
}
},
// 物模型提交
submitFormwmx(sizeForm) {
var das = []
sizeForm.daslist.map((items) => {
var newval = items['addr']
das.push(newval)
})
dgiotlog.log('sizeForm', sizeForm)
var obj = {
name: sizeForm.name,
devicetype: sizeForm.devicetype,
dataForm: {
round: sizeForm.round,
data: sizeForm.dinumber,
address: sizeForm.dis,
rate: sizeForm.rate,
offset: sizeForm.offset,
order: sizeForm.order,
protocol: sizeForm.protocol,
operatetype: sizeForm.operatetype,
originaltype: sizeForm.originaltype,
slaveid: sizeForm.slaveid,
collection: sizeForm.collection,
control: sizeForm.control,
strategy: sizeForm.strategy,
iscount: sizeForm.iscount,
countstrategy: sizeForm.countstrategy,
countround: sizeForm.countround,
countcollection: sizeForm.countcollection,
},
ico: sizeForm.ico,
required: true,
accessMode: sizeForm.isread,
isshow: sizeForm.isshow,
identifier: sizeForm.identifier,
}
// 提交之前需要先判断类型
if (
sizeForm.type == 'float' ||
sizeForm.type == 'double' ||
sizeForm.type == 'int' ||
sizeForm.type == 'long'
) {
var obj1 = {
dataType: {
type: sizeForm.type.toLowerCase(),
specs: {
max: sizeForm.endnumber,
min: sizeForm.startnumber,
step: sizeForm.step,
precision: Number(sizeForm.precision),
unit: sizeForm.unit == '' ? '' : sizeForm.unit,
},
das: das,
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'image') {
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
imagevalue: sizeForm.imagevalue,
specs: {},
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'bool') {
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
specs: {
0: sizeForm.false,
1: sizeForm.true,
},
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'enum') {
var specs = {}
sizeForm.struct.map((items) => {
var newkey = items['attribute']
specs[newkey] = items['attributevalue']
})
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
specs: specs,
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'struct') {
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
specs: sizeForm.struct,
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'text') {
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
size: sizeForm.string,
specs: {},
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'date') {
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
specs: {},
},
}
Object.assign(obj, obj1)
} else if (sizeForm.type == 'geopoint') {
obj1 = {
dataType: {
das: das,
type: sizeForm.type.toLowerCase(),
gpstype: sizeForm.gpstype,
specs: {},
},
}
Object.assign(obj, obj1)
}
delete obj.index
dgiotlog.log('obj', obj)
submitFormwmx(obj) {
// 检测到
// if (this.wmxSituation == '新增') {
// dgiotlog.log("新增");
if (this.wmxSituation == '新增') {
// dgiotlog.log("新增");
console.log("新增");
this.productDetail.thing.properties.unshift(obj)
} else if (this.wmxSituation == '编辑') {
// dgiotlog.log("编辑", obj);
console.log('编辑')
this.productDetail.thing.properties[this.modifyIndex] = obj
this.thingKey = moment(new Date()).valueOf().toString()
}
dgiotlog.log(this.wmxSituation, this.productDetail.thing.properties)
console.log(this.wmxSituation, this.productDetail.thing.properties)
let data = {
thing: { properties: this.productDetail.thing.properties },
}
putProductTemplet(this.producttempId, data).then((res) => {
if (res.updatedAt) {
this.$message({
type: 'success',
showClose: true,
duration: 2000,
type: 'success',
message: this.wmxSituation + '成功',
})
// this.getProDetail()
} else {
this.$message({
type: 'warning',
showClose: true,
duration: 2000,
message: this.wmxSituation + '失败',
})
}
})
// }
this.wmxdialogVisible = false
},
// 查看物模型模板
Expand Down

0 comments on commit 3484162

Please sign in to comment.