Skip to content

Commit

Permalink
fix(低代码): 修复低代码表单查询问题i
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed Jun 14, 2022
1 parent a634f26 commit 849e8a5
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 43 deletions.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
charset="utf-8"
src="https://hm.baidu.com/hm.js?24f17767262929947cc3631f99bfd274"
></script>
<script charset="utf-8" src="https://hm.baidu.com/hm.js?14a3ca1e5efce6db3e1335af61bdabc3"></script>
<!-- pump-->
<script
charset="utf-8"
Expand Down
62 changes: 46 additions & 16 deletions src/views/CloudFunction/engine/components/DynamicForms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/>
</el-form-item>
<el-form-item :label="$translateTitle('rule.Remarks')">
<el-input v-model="formInline.remarks" type="text" />
<el-input v-model="formInline.remarks" type="text"/>
</el-form-item>
<el-divider content-position="left">触发器(Trigger)</el-divider>
<el-row :gutter="24">
Expand Down Expand Up @@ -141,7 +141,12 @@
:key="item.objectId"
:label="item.name"
:value="item.objectId"
/>
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ item.objectId }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
Expand Down Expand Up @@ -169,7 +174,12 @@
:key="deviceName.objectId"
:label="deviceName.name"
:value="deviceName.objectId"
/>
>
<span style="float: left">{{ deviceName.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ deviceName.objectId }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
Expand Down Expand Up @@ -243,7 +253,12 @@
:key="item.objectId"
:label="item.name"
:value="item.objectId"
/>
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ item.objectId }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
Expand Down Expand Up @@ -271,11 +286,16 @@
placeholder="请选择设备信息"
>
<el-option
v-for="device in filtersDevice(item.params.productKey)"
:key="device.objectId"
:label="device.name"
:value="device.objectId"
/>
v-for="deviceName in filtersDevice(item.params.productKey)"
:key="deviceName.objectId"
:label="deviceName.name"
:value="deviceName.objectId"
>
<span style="float: left">{{ deviceName.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ deviceName.objectId }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
Expand Down Expand Up @@ -412,7 +432,7 @@
</el-row>
</el-col>
</el-row>
<el-divider />
<el-divider/>

<el-divider content-position="left">执行条件(Conditions)</el-divider>
<el-row :gutter="24">
Expand Down Expand Up @@ -534,7 +554,12 @@
:key="item.objectId"
:label="item.name"
:value="item.objectId"
/>
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ item.objectId }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
Expand Down Expand Up @@ -563,11 +588,16 @@
placeholder="请选择设备信息"
>
<el-option
v-for="item in filtersDevice(condition.params.productKey)"
:key="item.objectId"
:label="item.name"
:value="item.objectId"
/>
v-for="deviceName in filtersDevice(condition.params.productKey)"
:key="deviceName.objectId"
:label="deviceName.name"
:value="deviceName.objectId"
>
<span style="float: left">{{ deviceName.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ deviceName.objectId }}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
Expand Down
57 changes: 45 additions & 12 deletions src/views/CloudFunction/lowcode/components/ViewEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@
>
<el-option
v-for="item in Types"
:key="item"
:label="item"
:value="item"
/>
:key="item.label"
:label="item.label"
:value="item.value"
>
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ item.value }}
</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$translateTitle('home.language')">
Expand Down Expand Up @@ -155,14 +160,42 @@
upKey: new Date().getMilliseconds(),
DbaTable: [],
Types: [
'amis',
'deviceInfo',
'amis_view',
'topo',
'profile',
'content',
'notification',
'reportFrom',
{
value: 'amis',
label: '低代码',
},
{
value: 'notification',
label: '告警联动',
},
{
value: 'reportFrom',
label: '报告表单',
},
{
value: 'deviceInfo',
label: '设备信息',
},
{
value: 'amis_view',
label: '低代码预览',
},
{
value: 'topo',
label: '组态',
},
{
value: 'profile',
label: '设备控制',
},
{
value: 'content',
label: '数据展示',
},
{
value: 'sms_template',
label: '短信模板',
},
],
keys: [],
activeName: 'first',
Expand Down
57 changes: 45 additions & 12 deletions src/views/CloudFunction/lowcode/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@
>
<el-option
v-for="item in Types"
:key="item"
:label="item"
:value="item"
/>
:key="item.label"
:label="item.label"
:value="item.value"
>
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ item.value }}
</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="key">
Expand Down Expand Up @@ -358,14 +363,42 @@
{ label: '日本語', value: 'jp' },
],
Types: [
'amis',
'deviceInfo',
'amis_view',
'topo',
'profile',
'content',
'notification',
'reportFrom',
{
value: 'amis',
label: '低代码',
},
{
value: 'notification',
label: '告警联动',
},
{
value: 'reportFrom',
label: '报告表单',
},
{
value: 'deviceInfo',
label: '设备信息',
},
{
value: 'amis_view',
label: '低代码预览',
},
{
value: 'topo',
label: '组态',
},
{
value: 'profile',
label: '设备控制',
},
{
value: 'content',
label: '数据展示',
},
{
value: 'sms_template',
label: '短信模板',
},
],
DbaTable: [],
keys: [],
Expand Down
5 changes: 3 additions & 2 deletions src/views/CloudPressure/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@
const params = {
reportid: row.objectId,
templateUrl: row.basedata.templateUrl,
// grafanaHost: location.hostname,
// parseHost: location.hostname,
grafanaHost: location.hostname,
parseHost: location.hostname,
}
const res = await axios.post('/grafana/generateReport', params, {
Expand Down Expand Up @@ -795,6 +795,7 @@
})
if (product?.[0]?.objectId) {
this.product = product?.[0]?.objectId
localStorage.setItem('product_objectid', this.product)
this.fetchData()
}
},
Expand Down
4 changes: 3 additions & 1 deletion src/views/DeviceCloud/manage/devicelist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@
},
async info(row) {
localStorage.setItem('parse_objectid', row.objectId)
localStorage.setItem('product_objectid', row.product.objectId)
const { results = [] } = await queryView({
where: {
class: 'Product',
Expand All @@ -1009,10 +1010,11 @@
},
async command(row) {
localStorage.setItem('parse_objectid', row.objectId)
localStorage.setItem('product_objectid', row.product.objectId)
const { results = [] } = await queryView({
where: {
class: 'Product',
type: 'amis',
type: { $in: ['amis', 'profile', 'content'] },
key: row.product.objectId,
},
})
Expand Down
2 changes: 2 additions & 0 deletions src/views/DeviceCloud/manage/js/devicesDetailLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ export default {
},
mounted() {
// this.deviceInfo.product.objectId = this.$route.query.productid
localStorage.setItem('product_objectid', this.$route.query.productid)
this.getDeviceInfo(this.$route.query.deviceid)
this.setTreeFlag(false)
this.params.style = this.chartType[0].type
Expand All @@ -416,6 +417,7 @@ export default {
this.topicKey = this.$dgiotBus.topicKey(this.router, this.subtopic) // dgiot-mqtt topicKey 唯一标识
// if (this.$route.query.deviceid) {
this.deviceid = this.$route.query.deviceid
localStorage.setItem('parse_objectid', deviceid)
this.subRealtimedata()
this.initChart()
window.addEventListener('resize', this.resizeTheChart)
Expand Down
1 change: 1 addition & 0 deletions src/views/DeviceCloud/manage/js/proddetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ export default {
},
async queryProductInfo(productId) {
const res = await getProduct(productId)
localStorage.setItem('product_objectid', productId)
const { thing = { properties: [], events: [], services: [], tags: [] } } =
res
_.merge({ properties: [], events: [], services: [], tags: [] }, thing)
Expand Down

0 comments on commit 849e8a5

Please sign in to comment.