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: "", name: "",
config: { config: {
markerClick: (extData, item) => { markerClick: (extData, item) => {
const formData = (extData?.otherConfig && typeof extData?.otherConfig !== 'string') // 兼容不同的返回类型
? JSON.parse(extData.otherConfig) let formData = extData.otherConfig;
: null; 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"] // 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 = { this.dialogConfig = {
component, component,
data: { data: {
...extData, ...extData,
formData, formData,
parseOtherConfig: JSON.parse((extData.otherConfig && typeof extData.otherConfig !== 'string')|| "{}"), parseOtherConfig: formData,
_itemData: item, _itemData: item,
}, },
}; };

Loading…
Cancel
Save