Skip to content

Commit

Permalink
feat: add 数据配置”
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed Sep 4, 2023
1 parent 2e85ab9 commit cf8d74b
Show file tree
Hide file tree
Showing 8 changed files with 557 additions and 438 deletions.
314 changes: 174 additions & 140 deletions CHANGELOG.EN.md

Large diffs are not rendered by default.

314 changes: 174 additions & 140 deletions CHANGELOG.ZH.md

Large diffs are not rendered by default.

314 changes: 174 additions & 140 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ const actions = {
let background = tag.companyinfo?.backgroundimage || '' //大屏背景图
localStorage.setItem('homeScreen', homeScreen)
localStorage.setItem('background', background)
localStorage.setItem('rolename', roles[0].name)
// console.log('不是pc端', isPC())
if (!isPC()) {
window.jstoken?.setJsToken(
Expand Down
9 changes: 5 additions & 4 deletions src/utils/konva/core/amis.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const amis = {
fontFamily: 'Calibri',
fontSize: 12,
padding: 5,
fill: 'white',
fill: 'rgba(255,255,255,1)',
width: 300,
scaleX: saleInfo.scaleX,
scaleY: saleInfo.scaleY,
Expand Down Expand Up @@ -146,7 +146,7 @@ const amis = {
})
simpleLabel.add(
new Konva.Tag({
fill: '#ccc',
fill: 'rgb(0,0,0)',
attrs: {
name: 'dblclick',
},
Expand All @@ -161,10 +161,11 @@ const amis = {
lineHeight: 1.2,
padding: 10,
fontFamily: 'Calibri',
fill: 'white',
fill: 'rgba(255,255,255,1)',
type: thing.type,
})
)
console.log(simpleLabel)

return simpleLabel
},
createdamis(args) {
Expand Down
9 changes: 1 addition & 8 deletions src/utils/konva/core/topoBasic.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ const topoBasic = {
* @param text
*/
create(thing, saleInfo, randomXy) {
console.log('传递内容', thing)

console.log('传递内容', thing)
const Axis = {
x: thing.x ? thing.x : randomXy(600, 30),
Expand Down Expand Up @@ -191,7 +189,7 @@ const topoBasic = {
height: 35,
padding: 10,
fontFamily: 'Calibri',
fill: '#e63f32',
fill: '#ffffff',
type: thing.type,
})
)
Expand Down Expand Up @@ -430,7 +428,6 @@ const topoBasic = {
// args.path,
args
)
console.log(args)
if (args.data.src) {
let src = args.data.src
// if (src.indexOf('http') < 0) {
Expand All @@ -440,9 +437,6 @@ const topoBasic = {
var imageObj = new Image()
imageObj.src = src
// imageObj.onload = () => {

console.log(args.data.id)

var simpleImage = new Konva.Image({
id: args.data.id || 'amis_component_' + topoId,
x: 100,
Expand All @@ -460,7 +454,6 @@ const topoBasic = {
simpleImage.setAttrs({
src: src,
})
console.log(simpleImage)
return simpleImage
}
let vueComponet = ''
Expand Down
22 changes: 22 additions & 0 deletions src/views/CloudFunction/topo/components/TopoTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,21 @@
实时数据源
</el-button>
<el-divider />
<el-button
draggable="true"
size="mini"
type="primary"
@click.native="
createAmis({
productid: $route.query.productid,
hidden: false,
type: 'data_config',
})
"
>
数据配置
</el-button>
<el-divider />
<el-button
draggable="true"
size="mini"
Expand All @@ -300,6 +315,7 @@
>
数据卡片
</el-button>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">
历史统计图表
</div>
Expand Down Expand Up @@ -397,6 +413,7 @@
})
"
/>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">
在离线饼图
</div>
Expand Down Expand Up @@ -493,6 +510,7 @@
})
"
/>
<el-divider />
<!-- <el-button
draggable="true"
size="mini"
Expand Down Expand Up @@ -549,6 +567,7 @@
})
"
/>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">
工单列表
</div>
Expand Down Expand Up @@ -710,6 +729,7 @@
})
"
/>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">
设备数量
</div>
Expand Down Expand Up @@ -745,6 +765,7 @@
})
"
/>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">
告警数量
</div>
Expand Down Expand Up @@ -780,6 +801,7 @@
})
"
/>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">
工单数量
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/views/CloudFunction/topo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,11 @@
</el-select>
</el-form-item>
<div
v-if="editNode.attrs.type == 'realdata'"
v-if="editNode.attrs.type == 'realdata' || editNode.attrs.type == 'data_config'"
style="border-top: 1px solid #000"
>
<h3 style="font-weight: 600; margin: 10px">数据源绑定</h3>
<el-form-item v-if="editNode.attrs.type == 'realdata'">
<el-form-item v-if="editNode.attrs.type == 'realdata' || editNode.attrs.type == 'data_config'">
<span slot="label">
<span style="color: red">产品选择</span>
</span>
Expand All @@ -559,7 +559,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="editNode.attrs.type == 'realdata'">
<el-form-item v-if="editNode.attrs.type == 'realdata' || editNode.attrs.type == 'data_config'">
<span slot="label">
<span style="color: red">设备选择</span>
</span>
Expand Down Expand Up @@ -1066,7 +1066,7 @@
console.log('接收到编辑节点消息', node)
this.editNode = node
this.editFlag = true
if (node.attrs.type == 'realdata') {
if (node.attrs.type == 'realdata' || node.attrs.type == 'data_config') {
this.screen_productid = node.attrs.screen_productid || ''
this.screen_deviceid = node.attrs.screen_deviceid || ''
this.screen_wmxid = node.attrs.screen_wmxid || ''
Expand Down Expand Up @@ -1258,8 +1258,8 @@
async handleQueryDeviceList(id) {
let params = {
skip: 0,
limit: 100,
order: '-createdAt',
limit: 1000,
order: 'name',
count: 'objectId',
where: { product: id },
}
Expand Down

0 comments on commit cf8d74b

Please sign in to comment.