Commit 07058648 authored by 李纪文's avatar 李纪文

fix: 组态修改图片路径、增加交互脚本解析

parent 7c04f52e
dev
Tags unavailable
No related merge requests found
......@@ -55,9 +55,10 @@ const ConfigurationView = (props) => {
/** **********************************获取工艺图画板信息*********************** */
const getConfiguraList = async () => {
const url = globalConfig.mainserver ? globalConfig.mainserver : 'https://panda-water.cn/';
imgUrl = online
? 'https://panda-water.cn/PandaConfiguration/Raw/'
: `${globalConfig.baseURI}/PandaConfiguration/Raw/`;
? `${url}PandaMonitor/Monitor/`
: `${globalConfig.baseURI}/PandaMonitor/Monitor/`;
// 获取画板信息
const drawInfo = await getSketchPadList({
name: props.name,
......@@ -1031,7 +1032,7 @@ const ConfigurationView = (props) => {
go.Picture,
{ name: 'animateSvg', width: 56, height: 56, column: 0, scale: 1, source: '' },
new go.Binding('source', 'imgSrc', (v) => {
return `${imgUrl}File/ModelManage/ModelFilePreview/${encodeURIComponent(v)}`;
return `${imgUrl}Model/Preview/${encodeURIComponent(v)}`;
}),
new go.Binding('scale', 'scale').makeTwoWay(),
new go.Binding('width', 'width').makeTwoWay(),
......
......@@ -83,9 +83,10 @@ const ConfigurationView = (props) => {
/** **********************************获取工艺图画板信息*********************** */
const getConfiguraList = async () => {
const url = globalConfig.mainserver ? globalConfig.mainserver : 'https://panda-water.cn/';
imgUrl = online
? 'https://panda-water.cn/PandaConfiguration/Raw/'
: `${globalConfig.baseURI}/PandaConfiguration/Raw/`;
? `${url}PandaMonitor/Monitor/`
: `${globalConfig.baseURI}/PandaMonitor/Monitor/`;
// 获取画板信息
const drawInfo = await getSketchPadList({
name: props.name,
......@@ -1146,6 +1147,17 @@ const ConfigurationView = (props) => {
}
};
/** **************************************交互脚本****************************************** */
const interactiveScript = (data) => {
try {
const opRule = JSON.parse(data.opRule);
const script = opRule && opRule.script ? opRule.script : '';
new Function('diagram', 'list', 'props', script)(myDiagram, data, props);
} catch (e) {
// console.log(e)
}
};
/** **************************************跳转方法****************************************** */
const menuJumpMethod = (data) => {
const opRule = JSON.parse(data.opRule);
......@@ -1406,6 +1418,7 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......@@ -1439,7 +1452,7 @@ const ConfigurationView = (props) => {
go.Picture,
{ name: 'animateSvg', width: 56, height: 56, column: 0, scale: 1, source: '' },
new go.Binding('source', 'imgSrc', (v) => {
return `${imgUrl}File/ModelManage/ModelFilePreview/${encodeURIComponent(v)}`;
return `${imgUrl}Model/Preview/${encodeURIComponent(v)}`;
}),
new go.Binding('scale', 'scale').makeTwoWay(),
new go.Binding('width', 'width').makeTwoWay(),
......@@ -1469,6 +1482,7 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......@@ -1596,6 +1610,7 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......@@ -1669,6 +1684,7 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment