Commit 0cafef083ff9005e0fd4d95c6e1af140dcae012b
Merge branch 'sqy_dev' into 'main'
开发右侧操作栏的页面 See merge request huang/thingskit-drawio!4
Showing
2 changed files
with
147 additions
and
12 deletions
src/main/webapp/images/edit20.png
0 → 100644
570 Bytes
... | ... | @@ -4287,18 +4287,14 @@ DataFormatPanel.prototype.addDataFont = function (container) |
4287 | 4287 | deviceStylePanel.style.paddingBottom = '8px'; |
4288 | 4288 | mxUtils.write(deviceStylePanel, "选择设备"); |
4289 | 4289 | container.appendChild(deviceStylePanel); |
4290 | - var deviceSelect = document.createElement('input'); | |
4290 | + var deviceSelect = document.createElement('select'); | |
4291 | 4291 | deviceSelect.setAttribute('id','device'); |
4292 | 4292 | deviceStylePanel.appendChild(deviceSelect) |
4293 | + | |
4294 | + | |
4295 | + | |
4296 | + | |
4293 | 4297 | |
4294 | - // 删除父节点下的所有子节点 | |
4295 | - function deleteAllChild(element) { | |
4296 | - var first = element.firstElementChild; | |
4297 | - while (first) { | |
4298 | - first.remove(); | |
4299 | - first = element.firstElementChild; | |
4300 | - } | |
4301 | - } | |
4302 | 4298 | // 根据组织id获取组织下的设备列表--在点击组织时调用 |
4303 | 4299 | function getDevicesByOrganizationId(organizationId){ |
4304 | 4300 | if(organizationId){ |
... | ... | @@ -4323,7 +4319,7 @@ DataFormatPanel.prototype.addDataFont = function (container) |
4323 | 4319 | mxUtils.write(attributeStylePanel, "选择属性"); |
4324 | 4320 | |
4325 | 4321 | container.appendChild(attributeStylePanel); |
4326 | - var attributeSelect = document.createElement("input"); | |
4322 | + var attributeSelect = document.createElement("select"); | |
4327 | 4323 | attributeSelect.setAttribute('id','attribute'); |
4328 | 4324 | attributeStylePanel.appendChild(attributeSelect); |
4329 | 4325 | |
... | ... | @@ -4347,6 +4343,21 @@ DataFormatPanel.prototype.addDataFont = function (container) |
4347 | 4343 | } |
4348 | 4344 | } |
4349 | 4345 | |
4346 | + // 异步此处才能生效,设置默认select和样式 | |
4347 | + setTimeout(()=>{ | |
4348 | + const options = { | |
4349 | + data: [], | |
4350 | + width: 150, | |
4351 | + editable: false, | |
4352 | + panelMaxHeight:200 | |
4353 | + } | |
4354 | + $("#device").combobox(options); | |
4355 | + $("#attribute").combobox(options); | |
4356 | + $('.textbox').css({ | |
4357 | + "margin-left":"6px" | |
4358 | + }) | |
4359 | + }) | |
4360 | + | |
4350 | 4361 | // Adds writing direction options |
4351 | 4362 | // LATER: Handle reselect of same option in all selects (change event |
4352 | 4363 | // is not fired for same option so have opened state on click) and |
... | ... | @@ -4354,16 +4365,140 @@ DataFormatPanel.prototype.addDataFont = function (container) |
4354 | 4365 | |
4355 | 4366 | // NOTE: For automatic we use the value null since automatic |
4356 | 4367 | // requires the text to be non formatted and non-wrapped |
4368 | + | |
4369 | + // 数据交互模块 | |
4357 | 4370 | var interactionStylePanel = this.createPanel(); |
4358 | 4371 | container.appendChild(interactionStylePanel); |
4359 | - | |
4360 | 4372 | var dataInteractiveTitle = this.createTitle("数据交互"); |
4361 | 4373 | dataInteractiveTitle.style.padding = '6px 0px 6px 6px'; |
4362 | 4374 | container.appendChild(dataInteractiveTitle); |
4363 | 4375 | |
4376 | + var press = stylePanel.cloneNode(false); | |
4377 | + press.style.marginLeft = '0px'; | |
4378 | + press.style.paddingTop = '8px'; | |
4379 | + press.style.paddingBottom = '8px'; | |
4380 | + const pressInput = document.createElement('input'); | |
4381 | + const pressEdit = document.createElement('i'); | |
4382 | + pressEdit.style.display="inline-block" | |
4383 | + pressEdit.style.marginLeft="80px" | |
4384 | + pressEdit.style.width="20px" | |
4385 | + pressEdit.style.height="20px"; | |
4386 | + pressEdit.style.backgroundImage="url('images/edit20.png')"; | |
4387 | + pressEdit.style.cursor="pointer" | |
4388 | + pressEdit.setAttribute('id','pressEdit') | |
4389 | + pressInput.setAttribute('id','press') | |
4390 | + press.appendChild(pressInput) | |
4391 | + press.appendChild(pressEdit) | |
4392 | + container.appendChild(press); | |
4393 | + | |
4394 | + | |
4395 | + | |
4396 | + var uplift = stylePanel.cloneNode(false); | |
4397 | + uplift.style.marginLeft = "0px"; | |
4398 | + uplift.style.paddingTop = "8px"; | |
4399 | + uplift.style.paddingBottom = "8px"; | |
4400 | + const upliftInput = document.createElement("input"); | |
4401 | + const upliftEdit = document.createElement("i"); | |
4402 | + upliftEdit.style.display = "inline-block"; | |
4403 | + upliftEdit.style.marginLeft = "80px"; | |
4404 | + upliftEdit.style.width = "20px"; | |
4405 | + upliftEdit.style.height = "20px"; | |
4406 | + upliftEdit.style.backgroundImage = "url('images/edit20.png')"; | |
4407 | + upliftEdit.style.cursor = "pointer"; | |
4408 | + upliftEdit.setAttribute('id','upliftEdit') | |
4409 | + upliftInput.setAttribute("id", "uplift"); | |
4410 | + uplift.appendChild(upliftInput); | |
4411 | + uplift.appendChild(upliftEdit); | |
4412 | + container.appendChild(uplift); | |
4413 | + | |
4414 | + | |
4415 | + | |
4416 | + var click = stylePanel.cloneNode(false); | |
4417 | + click.style.marginLeft = "0px"; | |
4418 | + click.style.paddingTop = "8px"; | |
4419 | + click.style.paddingBottom = "8px"; | |
4420 | + const clickInput = document.createElement("input"); | |
4421 | + const clickEdit = document.createElement("i"); | |
4422 | + | |
4423 | + clickEdit.style.display = "inline-block"; | |
4424 | + clickEdit.style.marginLeft = "80px"; | |
4425 | + clickEdit.style.width = "20px"; | |
4426 | + clickEdit.style.height = "20px"; | |
4427 | + clickEdit.style.backgroundImage = "url('images/edit20.png')"; | |
4428 | + clickEdit.style.cursor = "pointer"; | |
4429 | + clickEdit.setAttribute('id','clickEdit') | |
4430 | + clickInput.setAttribute("id", "click"); | |
4431 | + click.appendChild(clickInput); | |
4432 | + click.appendChild(clickEdit); | |
4433 | + container.appendChild(click); | |
4434 | + | |
4435 | + | |
4436 | + | |
4437 | + var doubleClick = stylePanel.cloneNode(false); | |
4438 | + doubleClick.style.marginLeft = "0px"; | |
4439 | + doubleClick.style.paddingTop = "8px"; | |
4440 | + doubleClick.style.paddingBottom = "8px"; | |
4441 | + const doubleClickInput = document.createElement("input"); | |
4442 | + const doubleEdit = document.createElement("i"); | |
4443 | + | |
4444 | + doubleEdit.style.display = "inline-block"; | |
4445 | + doubleEdit.style.marginLeft = "80px"; | |
4446 | + doubleEdit.style.width = "20px"; | |
4447 | + doubleEdit.style.height = "20px"; | |
4448 | + doubleEdit.style.backgroundImage = "url('images/edit20.png')"; | |
4449 | + doubleEdit.style.cursor = "pointer"; | |
4450 | + doubleEdit.setAttribute('id','doubleEdit') | |
4451 | + doubleClickInput.setAttribute("id", "dbclick"); | |
4452 | + doubleClick.appendChild(doubleClickInput); | |
4453 | + doubleClick.appendChild(doubleEdit); | |
4454 | + container.appendChild(doubleClick); | |
4455 | + setTimeout(() => { | |
4456 | + | |
4457 | + $("#press").checkbox({ | |
4458 | + label: "按下", | |
4459 | + value: "press", | |
4460 | + labelPosition: "after", | |
4461 | + }); | |
4462 | + $('#pressEdit').click(()=>{ | |
4463 | + console.log('按下编辑') | |
4464 | + }) | |
4465 | + | |
4466 | + $("#uplift").checkbox({ | |
4467 | + label: "抬起", | |
4468 | + value: "press", | |
4469 | + labelPosition: "after", | |
4470 | + }); | |
4471 | + $('#upliftEdit').click(()=>{ | |
4472 | + console.log('抬起编辑') | |
4473 | + }) | |
4474 | + | |
4475 | + $("#click").checkbox({ | |
4476 | + label: "单击", | |
4477 | + value: "press", | |
4478 | + labelPosition: "after", | |
4479 | + }); | |
4480 | + $('#clickEdit').click(()=>{ | |
4481 | + console.log('单击编辑') | |
4482 | + }) | |
4483 | + | |
4484 | + $("#dbclick").checkbox({ | |
4485 | + label: "双击", | |
4486 | + value: "press", | |
4487 | + labelPosition: "after", | |
4488 | + }); | |
4489 | + $('#doubleEdit').click(()=>{ | |
4490 | + console.log('双击编辑') | |
4491 | + }) | |
4492 | + | |
4493 | + | |
4494 | + | |
4495 | + | |
4496 | + }); | |
4497 | + | |
4498 | + | |
4499 | + // 数据动效模块 | |
4364 | 4500 | var effectStylePanel = this.createPanel(); |
4365 | 4501 | container.appendChild(effectStylePanel); |
4366 | - | |
4367 | 4502 | var dataEffectStylePanelTitle = this.createTitle("数据动效"); |
4368 | 4503 | dataEffectStylePanelTitle.style.padding = '6px 0px 6px 6px'; |
4369 | 4504 | container.appendChild(dataEffectStylePanelTitle); | ... | ... |