Browse Source

兼容不同类型的返回值

wangqin
王钦 7 months ago
parent
commit
2f0931f74b
  1. 14
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

14
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -112,17 +112,21 @@ function resolveDataOptions(data, config, component, isDefault) {
name: "",
config: {
markerClick: (extData, item) => {
const formData = (extData?.otherConfig && typeof extData?.otherConfig !== 'string')
? JSON.parse(extData.otherConfig)
: null;
// 兼容不同的返回类型
let formData = extData.otherConfig;
try{
formData = JSON.parse(otherConfig)
}catch(e){
formData = null;
}
// formData.pictures = ["https://pic1.zhimg.com/80/v2-c00beaae1f6e3c09a6d77c16c70002fe_1440w.webp?source=1def8aca","https://pic1.zhimg.com/80/v2-c56626621906417a453d262ac11f3385_1440w.webp?source=1def8aca"]
console.log(component, "DialogComponent");
// console.log(component, "DialogComponent",extData);
this.dialogConfig = {
component,
data: {
...extData,
formData,
parseOtherConfig: JSON.parse((extData.otherConfig && typeof extData.otherConfig !== 'string')|| "{}"),
parseOtherConfig: formData,
_itemData: item,
},
};

Loading…
Cancel
Save