fix: 取消节点style.hover.stroke
This commit is contained in:
parent
0ceb7cc233
commit
c53faef9fe
@ -7,9 +7,10 @@ VITE_APP_ENV = 'development'
|
||||
# 招商车研物联网平台/开发环境
|
||||
VITE_APP_BASE_API = '/dev-api'
|
||||
|
||||
VITE_API_URL = http://192.168.1.101:13080
|
||||
VITE_WS_URL = ws://192.168.1.101:13080/ws
|
||||
VITE_API_URL = http://192.168.1.222:13080
|
||||
VITE_WS_URL = ws://192.168.1.222:13080/ws
|
||||
|
||||
# explanation
|
||||
VITE_INSPECTION_TYPE = "inspection"
|
||||
VITE_INSPECTION_ALM_DEVICEID = "huayan_arm"
|
||||
VITE_INSPECTION_ARM_DEVICEID = "huayan_arm"
|
||||
VITE_INSPECTION_AGV_DEVICEID = "huayan_arm"
|
||||
@ -59,14 +59,14 @@ defineExpose({ confirmSave })
|
||||
// 保存成功 / 失败处理
|
||||
const handleSaveSuccess = () => {
|
||||
emitter.emit('setProperties', { id: props.data.id })
|
||||
emitter.emit("throwAnError", { id: props.data.id, hasError: false });
|
||||
emitter.emit("throwAnError", { id: props.data.id, hasError: false, type: props.data.type });
|
||||
// 无错误,关闭抽屉
|
||||
emits('close')
|
||||
}
|
||||
|
||||
const handleSaveError = () => {
|
||||
emitter.emit('setProperties', { id: props.data.id })
|
||||
emitter.emit("throwAnError", { id: props.data.id, hasError: true });
|
||||
emitter.emit("throwAnError", { id: props.data.id, hasError: true, type: props.data.type });
|
||||
emits('close')
|
||||
}
|
||||
|
||||
|
||||
@ -542,8 +542,8 @@ const initFlow = () => {
|
||||
keys: ["backspace", "delete"], // 覆盖删除键
|
||||
callback: () => {
|
||||
const activeElem = document.activeElement;
|
||||
if (activeElem.tagName === "INPUT" || activeElem.tagName === "TEXTAREA") {
|
||||
return; // 不处理输入框内的删除
|
||||
if (["INPUT", "TEXTAREA"].includes(activeElem.tagName)) {
|
||||
return false
|
||||
}
|
||||
|
||||
const { nodes, edges } = lf.getSelectElements();
|
||||
@ -555,7 +555,7 @@ const initFlow = () => {
|
||||
|
||||
if (hasProtectedNode) {
|
||||
lf.selectElementById(null); // 取消选中
|
||||
return; // 阻断删除
|
||||
return false; // 阻断删除
|
||||
}
|
||||
|
||||
// 默认删除逻辑
|
||||
@ -571,7 +571,7 @@ const initFlow = () => {
|
||||
// 删除节点所有的边
|
||||
lf.deleteEdgeByNodeId(node.id);
|
||||
});
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (nodes.length === 0 && edges.length > 0) {
|
||||
edges.forEach((node) => {
|
||||
@ -584,12 +584,12 @@ const initFlow = () => {
|
||||
{
|
||||
keys: ["ctrl+z"], // 自定义快捷键
|
||||
callback: () => {
|
||||
return false;
|
||||
return true;
|
||||
},
|
||||
},
|
||||
{
|
||||
keys: ["ctrl+shift+z"],
|
||||
callback: () => false,
|
||||
callback: () => true,
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -789,8 +789,23 @@ onMounted(() => {
|
||||
|
||||
emitter.on("throwAnError", (data) => {
|
||||
// 处理错误抛出逻辑
|
||||
const { id, hasError } = data;
|
||||
const element = document.getElementsByClassName(`node__container ${id}`)[0].parentElement;
|
||||
const { id, hasError, type } = data;
|
||||
let element
|
||||
if (type === 'loop') {
|
||||
const tt = document.getElementsByClassName(`group__container ${id}`)[0];
|
||||
if (tt?.parentElement) {
|
||||
element = tt.parentElement;
|
||||
} else {
|
||||
element = tt
|
||||
}
|
||||
} else {
|
||||
const tt = document.getElementsByClassName(`node__container ${id}`)[0]
|
||||
if (tt?.parentElement) {
|
||||
element = tt.parentElement;
|
||||
} else {
|
||||
element = tt
|
||||
}
|
||||
}
|
||||
if (hasError) {
|
||||
if (!nodeErrorList.value.includes(id)) {
|
||||
nodeErrorList.value.push(id);
|
||||
@ -889,10 +904,12 @@ onUnmounted(() => {
|
||||
|
||||
.node__container {
|
||||
border-color: #8dc99d;
|
||||
// pointer-events: none;
|
||||
}
|
||||
|
||||
.group__container {
|
||||
border-color: #8dc99d;
|
||||
// pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ class EndNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class ServiceNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ class StartNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = 'none';
|
||||
style.hover.stroke = 'none';
|
||||
// style.hover.stroke = 'none';
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class CodeNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ class CurrentLoopNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class HttpNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,6 @@ class loopBodyModel extends GroupNodeModel {
|
||||
// 计算子节点的包围盒(包含所有子节点的最小矩形区域)
|
||||
getChildrenBBox() {
|
||||
const children = this.getAllValidChildren(this.children, this.graphModel)
|
||||
console.log('children', children)
|
||||
// Array.from(this.children).forEach((id) => {
|
||||
// const node = this.graphModel.getNodeModelById(id)
|
||||
// if (node) {
|
||||
@ -109,14 +108,16 @@ class loopBodyModel extends GroupNodeModel {
|
||||
return [
|
||||
{
|
||||
x: x + width / 2 ,
|
||||
y: y + height / 2,
|
||||
// y: y + height / 2,
|
||||
y:y,
|
||||
name: "right",
|
||||
id: "".concat(this.id, "_1"),
|
||||
properties: { connectionType: "source" },
|
||||
},
|
||||
{
|
||||
x: x - width / 2,
|
||||
y: y + height / 2,
|
||||
// y: y + height / 2,
|
||||
y:y,
|
||||
name: "left",
|
||||
id: "".concat(this.id, "_3"),
|
||||
properties: { connectionType: "target" },
|
||||
@ -241,6 +242,13 @@ class loopBodyView extends HtmlNode {
|
||||
return svgH('g', {}, anchorShapes);
|
||||
}
|
||||
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 HTML 内容设置到指定的根元素上
|
||||
* @param rootEl 根元素
|
||||
|
||||
@ -87,13 +87,13 @@ onUnmounted(() => {
|
||||
.group__container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 420px;
|
||||
// min-height: 420px;
|
||||
background: #fff;
|
||||
padding: 12px;
|
||||
cursor: default;
|
||||
border-radius: 12px;
|
||||
border: 2px solid white;
|
||||
box-shadow: 0 5px 15px 0#00000008;
|
||||
// box-shadow: 0 5px 15px 0#00000008;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
@ -198,7 +198,7 @@ class SdAgentNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class SleepNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ class StopLoopHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ class SubEndNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ class SubStartNodeHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ class SwitchHtmlModel extends HtmlNodeModel {
|
||||
getOutlineStyle() {
|
||||
const style = super.getOutlineStyle();
|
||||
style.stroke = "none";
|
||||
style.hover.stroke = "none";
|
||||
// style.hover.stroke = "none";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,17 +110,52 @@
|
||||
<script setup>
|
||||
import LineChart from './components/LineChart.vue';
|
||||
import BarChart from './components/BarChart.vue';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
const lineSeries = ref([
|
||||
{
|
||||
name: '执行任务数',
|
||||
type: 'line',
|
||||
data: [120, 122, 101, 114, 90, 130, 110]
|
||||
color: '#3e95d8',
|
||||
data: [120, 122, 101, 114, 90, 130, 110],
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#3e95d8'
|
||||
},
|
||||
{
|
||||
offset: 0.2,
|
||||
color: '#d1efed'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: '#fff'
|
||||
}
|
||||
])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '通过率',
|
||||
type: 'line',
|
||||
data: [96.5, 97.3, 92.8, 95.8, 98.7, 96.8, 97.9]
|
||||
color: '#5becde',
|
||||
data: [96.5, 97.3, 92.8, 95.8, 98.7, 96.8, 97.9],
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#5becde'
|
||||
},
|
||||
{
|
||||
offset: 0.3,
|
||||
color: '#d1efed'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: '#fff'
|
||||
}
|
||||
])
|
||||
},
|
||||
}
|
||||
])
|
||||
|
||||
@ -129,6 +164,7 @@ const barSeries = ref([
|
||||
name: '已完成',
|
||||
type: 'bar',
|
||||
stack: 'Ad',
|
||||
color: '#53dbca',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
@ -138,6 +174,7 @@ const barSeries = ref([
|
||||
name: '运行中',
|
||||
type: 'bar',
|
||||
stack: 'Ad',
|
||||
color: '#5becde',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
@ -147,6 +184,7 @@ const barSeries = ref([
|
||||
name: '暂停中',
|
||||
type: 'bar',
|
||||
stack: 'Ad',
|
||||
color: '#d1efed',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
@ -156,6 +194,7 @@ const barSeries = ref([
|
||||
name: '异常',
|
||||
type: 'bar',
|
||||
stack: 'Ad',
|
||||
color: '#3e95d8',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
@ -206,6 +245,7 @@ const tableList = ref([])
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: #fff;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
@ -219,6 +259,7 @@ const tableList = ref([])
|
||||
|
||||
.compare {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -283,15 +324,15 @@ const tableList = ref([])
|
||||
}
|
||||
|
||||
.urgent {
|
||||
background: red;
|
||||
background: #51dcbe;
|
||||
}
|
||||
|
||||
.important {
|
||||
background: yellow;
|
||||
background: #51dcb9;
|
||||
}
|
||||
|
||||
.ordinary {
|
||||
background: blue;
|
||||
background: #4595dc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ const speed = ref(1) // 速度百分比,范围 0.1 - 5
|
||||
const getPose = async (robot) => {
|
||||
try {
|
||||
const res = await getPoseApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: robot.terminalId
|
||||
})
|
||||
if (res.code === 200) {
|
||||
@ -240,7 +240,7 @@ const move = async (axis, direction) => {
|
||||
}
|
||||
|
||||
speedLApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: props.robot.terminalId,
|
||||
duration: 60,
|
||||
acceleration: speed.value + 0.1,
|
||||
@ -253,7 +253,7 @@ const move = async (axis, direction) => {
|
||||
*/
|
||||
const stop = async () => {
|
||||
await stopMotionApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: props.robot.terminalId
|
||||
})
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ const handlerController = (value) => {
|
||||
if (value === 2) {
|
||||
// 开启机械臂使能
|
||||
torqueOnApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: activeBotData.value.terminalId
|
||||
})
|
||||
jointControls.value = urdfViewerRef.value.jointControls
|
||||
@ -198,7 +198,7 @@ const jointNamsMap = {
|
||||
const getJointState = async (robot) => {
|
||||
try {
|
||||
const res = await getJointStateApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: robot.terminalId
|
||||
})
|
||||
if (res.code === 200) {
|
||||
@ -225,7 +225,7 @@ const updateJoint = async (jointName, _dir) => {
|
||||
const index = jointControls.value.findIndex(joint => joint.name === jointName)
|
||||
velocities[index] = jointSpeed.value * (_dir === '+' ? 1 : -1)
|
||||
const res = await speedJApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: activeBotData.value.terminalId,
|
||||
acceleration: jointSpeed.value + 0.1,
|
||||
duration: 60,
|
||||
@ -238,7 +238,7 @@ const updateJoint = async (jointName, _dir) => {
|
||||
*/
|
||||
const stop = async () => {
|
||||
await stopMotionApi({
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ALM_DEVICEID,
|
||||
deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID,
|
||||
terminalId: activeBotData.value.terminalId
|
||||
})
|
||||
}
|
||||
|
||||
@ -130,7 +130,8 @@ const getRunningTask = async () => {
|
||||
taskType = '2'
|
||||
}
|
||||
const res = await getRunTaskList({
|
||||
taskType
|
||||
taskType,
|
||||
statusList: ['1', '3']
|
||||
})
|
||||
if (res.code === 200) {
|
||||
taskList.value = res.rows
|
||||
|
||||
Loading…
Reference in New Issue
Block a user