Skip to content

Commit

Permalink
feat: add ScrollList and Pie
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxiaobo1010 committed Sep 2, 2022
1 parent 72efcfc commit f7234d3
Show file tree
Hide file tree
Showing 18 changed files with 650 additions and 39 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"vue-audio-visual": "^2.4.0",
"vue-contextmenu": "1.5.11",
"vue-infinite-scroll": "^2.0.2",
"vue-seamless-scroll": "^1.1.23",
"vuera": "0.2.7"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/jp.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export default {
newlyadded: '新增',
yes: '是',
no: '否',
pleaseselectyourapp: '请选择所属应用',
pleaseselectyourapp: '请选择所属部门',
pleaseselectyourcate: '请选择所属分类',
selected: '已选',
qdsczg: '确定删除这个',
Expand Down Expand Up @@ -787,7 +787,7 @@ export default {
applicationname: '应用名称',
scaleofservice: '服务规模',
industrytype: '所属行业',
applicationtype: '所属应用',
applicationtype: '所属部门',
createtime: '创建时间',
newapplication: '新建应用',
secretkey: '密钥',
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ export default {
newlyadded: '新增',
yes: '是',
no: '否',
pleaseselectyourapp: '请选择所属应用',
pleaseselectyourapp: '请选择所属部门',
pleaseselectyourcate: '请选择所属分类',
selected: '已选',
qdsczg: '确定删除这个',
Expand Down Expand Up @@ -775,7 +775,7 @@ export default {
applicationname: '应用名称',
scaleofservice: '服务规模',
industrytype: '所属行业',
applicationtype: '所属应用',
applicationtype: '所属部门',
createtime: '创建时间',
newapplication: '新建应用',
secretkey: '密钥',
Expand Down
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import 'amis/lib/themes/ang.css'
import 'amis/lib/helper.css'
import 'amis/sdk/sdk.css'
import 'amis-editor/dist/style.css'

//列表自动滚动
import scroll from 'vue-seamless-scroll'
Vue.use(scroll)

// import 'amis-core/lib/index.js'
Vue.use(VueAmisSdk)
Vue.use(VuePlugin)
Expand Down
26 changes: 22 additions & 4 deletions src/store/modules/topo.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,18 @@ const mutations = {
'handler',
handler,
canvas.contextmenu,
canvas.contextmenu.getParent()
canvas.handlerArgs
// canvas.contextmenu.getParent()
)
id = id.slice(0, id.length - 5)
console.log('寻找', canvas.stage.find(`#${id}`))
// id = id.slice(0, id.length - 5)
// console.log('寻找', canvas.stage.find(`#${id}`))
// canvas.contextmenu.findAncestors(
// `#${}`
// )
if (canvas.contextmenu.attrs.id == 'bg') return
if (handler == 'remove') {
let contextmenu = ''
console.log('当前节点', canvas.contextmenu)
if (canvas.contextmenu.attrs.id == 'bg') return
if (
canvas.contextmenu.attrs.name == 'evidence' ||
canvas.contextmenu.attrs.name == 'konvaimage' ||
Expand All @@ -228,6 +229,22 @@ const mutations = {
handler,
})
} else {
if (handler == 'moveToTop') {
// canvas.contextmenu 所选node 节点
if (
canvas.contextmenu.attrs.type == 'static' ||
canvas.contextmenu.attrs.id.indexOf('text') >= 0
) {
canvas.contextmenu.parent.zIndex(
canvas.contextmenu.parent.parent.children.length - 1
)
return
}
console.log('索引层级', canvas.contextmenu.parent.children.length - 1)
canvas.contextmenu.zIndex(canvas.contextmenu.parent.children.length - 1)
return
}
console.log('操作', handler)
addNodeEvent({
type: 'contextMenu',
stage: canvas.stage,
Expand Down Expand Up @@ -313,6 +330,7 @@ const mutations = {
_.merge(canvas.handlerArgs, {
type: 'createStaticImage',
image: thing.image,
data: thing.data,
productid: thing.productid,
})
)
Expand Down
5 changes: 3 additions & 2 deletions src/utils/konva/core/topoBasic.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,16 @@ const topoBasic = {
x: Axis.x,
y: Axis.y,
image: imageObj,
width: 106,
height: 118,
width: args.data.width,
height: args.data.height,
type: 'staticimage',
// handler: 'dblclick',
draggable: true,
})
simpleImage.setAttrs({
src: args.image,
})
// simpleImage.zIndex(1)
// } else if (args.type == 'gifimage') {

// }
Expand Down
10 changes: 5 additions & 5 deletions src/views/CloudFunction/engine/channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -728,14 +728,14 @@
applicationtText: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'change',
},
],
roles: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'blur',
},
],
Expand Down Expand Up @@ -1391,14 +1391,14 @@
applicationtText: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'change',
},
],
roles: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'blur',
},
],
Expand Down Expand Up @@ -1466,7 +1466,7 @@
}
})
// }
// 读取acl列表,获取所属应用名称
// 读取acl列表,获取所属部门名称
if (this.channelrow) {
for (var key in this.channelrow.ACL) {
obj.applicationtText = key ? key.substr(5) : ''
Expand Down
8 changes: 4 additions & 4 deletions src/views/CloudFunction/engine/createchannel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
</el-form-item>
</el-col>
<el-col v-if="active == 2" :span="12">
<el-form-item label="所属应用" prop="applicationtText">
<el-form-item label="所属部门" prop="applicationtText">
<el-input
v-model="addchannel.applicationtText"
readonly
Expand Down Expand Up @@ -368,7 +368,7 @@
applicationtText: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'change',
},
],
Expand Down Expand Up @@ -636,7 +636,7 @@
applicationtText: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'change',
},
],
Expand Down Expand Up @@ -745,7 +745,7 @@
}
})
}
// 读取acl列表,获取所属应用名称
// 读取acl列表,获取所属部门名称
if (this.channelrow) {
for (var key in this.channelrow.ACL) {
obj.applicationtText = key ? key.substr(5) : ''
Expand Down
12 changes: 6 additions & 6 deletions src/views/CloudFunction/engine/dict.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
:rules1="[
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'blur',
},
]"
label="所属应用"
label="所属部门"
> -->
<el-form-item
:label="$translateTitle('application.applicationtype')"
Expand All @@ -112,7 +112,7 @@
>
<!-- <el-input
v-model="addDictForm.applicationtText"
placeholder="请选择所属应用"
placeholder="请选择所属部门"
readonly
> -->
<el-input
Expand Down Expand Up @@ -1288,7 +1288,7 @@
rolesObj: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'change',
},
],
Expand Down Expand Up @@ -1474,7 +1474,7 @@
rolesObj: [
{
required: true,
message: '请选择所属应用',
message: '请选择所属部门',
trigger: 'change',
},
],
Expand All @@ -1484,7 +1484,7 @@
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (!this.addDictForm.applicationtText) {
this.$message('请选择所属应用')
this.$message('请选择所属部门')
return
}
if (valid) {
Expand Down
80 changes: 79 additions & 1 deletion src/views/CloudFunction/topo/components/TopoTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,42 @@
createBasicThing({
productid: $route.query.productid,
type: 'staticimage',
data: {
width: 180,
height: 200,
},
image:
'https://mp0.usr.cn/uploads/drawimg/1612317616625_0334.png',
hidden: false,
})
"
/>
<img
draggable="true"
size="mini"
src=" https://ucloud-web-sh.oss-cn-shanghai.aliyuncs.com/cloud/web/prod/screen/assets/1650512783877_0362.png"
style="
width: 60px;
height: 20px;
display: inline-block;
margin-left: 20px;
"
type="primary"
@click="
createBasicThing({
productid: $route.query.productid,
type: 'staticimage',
data: {
width: 420,
height: 35,
},
image:
' https://ucloud-web-sh.oss-cn-shanghai.aliyuncs.com/cloud/web/prod/screen/assets/1650512783877_0362.png',
hidden: false,
})
"
/>
<!-- -->
<el-divider />
<el-button
draggable="true"
Expand All @@ -186,6 +216,7 @@
精灵图
</el-button>
<el-divider />
<div style="text-align: left; margin: 10px; font-weight: 600">组件</div>
<el-button
draggable="true"
size="mini"
Expand All @@ -194,7 +225,12 @@
createBasicThing({
productid: $route.query.productid,
type: 'vuecomponent',
data: {},
data: {
width: 400,
height: 260,
fill: 'rgba(30, 30, 30,0.7)',
text: '折线图',
},
chart: 'line',
hidden: false,
})
Expand Down Expand Up @@ -223,6 +259,48 @@
>
数据卡片
</el-button>
<el-button
draggable="true"
size="mini"
type="primary"
@click.native="
createBasicThing({
productid: $route.query.productid,
type: 'vuecomponent',
data: {
width: 240,
height: 240,
fill: 'rgba(30, 30, 30, 0.7)',
text: '饼图',
},
chart: 'pie',
hidden: false,
})
"
>
饼图
</el-button>
<el-button
draggable="true"
size="mini"
type="primary"
@click.native="
createBasicThing({
productid: $route.query.productid,
type: 'vuecomponent',
data: {
width: 420,
height: 260,
fill: 'rgba(30, 30, 30, 0.7)',
text: '轮播告警列表',
},
chart: 'carousel',
hidden: false,
})
"
>
轮播告警列表
</el-button>
<el-divider />
<!-- http://dev.iotn2n.com/dgiot_file/topo/png/pump.png -->
</a-collapse-panel>
Expand Down
2 changes: 2 additions & 0 deletions src/views/CloudFunction/topo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@
this.setTreeFlag(false)
},
async destroyed() {
console.log('this.topotopic', this.topotopic)
this.$dgiotBus.$off('$dg/user/konva')
if (!_.isEmpty(localStorage.getItem('konvaStale')))
localStorage.setItem('konvaStale', JSON.stringify(canvas.stageJson))
await this.$unSubscribe(this.topotopic)
Expand Down
Loading

0 comments on commit f7234d3

Please sign in to comment.