您可以使用以下JavaScript代码来实现:

function getSettingValue(data, layoutName) {
  for (let i = 0; i < data.length; i++) {
    if (data[i].layoutName === layoutName) {
      return JSON.parse(data[i].insColumnDef.setTing);
    }
  }
  return null;
}

const data = [
  {
    "w": 24,
    "moved": false,
    "insColumnDef": {
      "createTime": null,
      "updateTime": "2023-09-07 14:25:59",
      "createBy": "1",
      "updateBy": "1",
      "createDepId": "2",
      "tenantId": "0",
      "companyId": "0",
      "colId": "1239838889297702914",
      "name": "消息盒子",
      "key": "newsColumn",
      "isDefault": "0",
      "templet": "<div class=\"msgBoxs\">\n    <ul class=\"msgUl\">\n        <li class=\"msgItme\"\n            :style=\"{width:listWidthFn}\"\n            v-for=\"(obj,index) of data\"\n          :key=\"index\">\n          <!-- @click=\"moreUrl(obj.url)\"-->\n        <div  class=\"contentBox\" :style=\"{'background': obj.color != ''?obj.color :'red'}\">\n            <div class=\"msgContent\">\n            <b>{{obj.count}}</b>\n            <p>{{obj.content}}</p >\n          </div>\n          <div class=\"header_icon\">\n                    <a-icon v-if=\"!obj.icon.includes('type')\" :type=\"obj.icon\" />\n                    <my-icon v-else-if=\"['customIcon','userCustomIcon'].includes(JSON.parse(obj.icon).type)\" :type=\"JSON.parse(obj.icon).icon\"></my-icon>\n                    <a-icon v-else=\"JSON.parse(obj.icon).type\" :type=\"JSON.parse(obj.icon).icon\"></a-icon>\n          </div>\n        </div>\n    </li>\n    </ul>\n</div>",
      "isPublic": "0",
      "type": "1230774411821621249",
      "isMobile": "0",
      "setTing": "{\"dataUrl\":\"\",\"function\":\"1235758510261506049\",\"newType\":\"\",\"tabgroups\":\"\",\"listCount\":4,\"newDIc\":\"\",\"funcType\":\"\",\"sqlName\":\"\",\"service\":\"\",\"calendarMode\":\"\"}",
      "icon": "iconxinjian",
      "appId": null,
      "typeName": "MessageBel",
      "listCount": 0,
      "pkId": "1239838889297702914"
    },
    "x": 0,
    "h": 12,
    "y": 0,
    "i": 1621236255245,
    "id": "byafwbl140672",
    "colId": "1239838889297702914",
    "config": {
      "name": "消息盒子",
      "colId": "1239838889297702914"
    },
    "layoutName": "消息盒子",
    "defConf": "column"
  },
  {
    "w": 15,
    "moved": false,
    "insColumnDef": {
      "createTime": null,
      "updateTime": "2021-06-29 14:48:32",
      "createBy": "1",
      "updateBy": "1",
      "createDepId": "2",
      "tenantId": "0",
      "companyId": "0",
      "colId": "1239839763151581185",
      "name": "待办已办",
      "key": "tabColumn",
      "isDefault": "0",
      "templet": "<div class=\"page-header-index-wide\">\n      <div class=\"salesCard\">\n        <a-tabs default-active-key=0 size=\"large\"  @change=\"changeKey\" style=\"height:100%;\" >\n          <div class=\"extra-wrapper\" slot=\"tabBarExtraContent\">\n              <div class=\"journalism_span\">\n             <span @click=\"moreUrl()\">更多</span>\n             <span @click=\"refresh\">刷新</span>\n           </div>\n          </div>\n          <a-tab-pane class=\"hetlist\" v-for=\"(obj,index) of data\"  :tab=\"obj.name\" :key=\"index\">\n             <portal-layoutview ref=\"innerLayout\" :insColumnDef=\"obj.insColumnDef\" > </portal-layoutview>\n          </a-tab-pane>\n        </a-tabs>\n      </div>\n  </div>",
      "isPublic": "0",
      "type": "1230774801220804610",
      "isMobile": "0",
      "setTing": "{\"dataUrl\":\"\",\"function\":\"\",\"isNews\":\"\",\"newType\":\"\",\"tabgroups\":{\"value\":\"1239834260509945858,1361616576253440002\",\"text\":\"待办事项,已办事项\"}}",
      "icon": null,
      "appId": null,
      "typeName": "TabBel",
      "listCount": 0,
      "pkId": "1239839763151581185"
    },
    "x": 9,
    "h": 33,
    "y": 12,
    "i": 1622021399023,
    "id": "fzykbly140672",
    "colId": "1239839763151581185",
    "config": {
      "name": "待办已办",
      "colId": "1239839763151581185"
    },
    "layoutName": "待办已办",
    "defConf": "column"
  },
  {
    "w": 24,
    "moved": false,
    "insColumnDef": {
      "createTime": null,
      "updateTime": "2021-06-29 10:51:36",
      "createBy": "1",
      "updateBy": "1",
      "createDepId": "1",
      "tenantId": "0",
      "companyId": "0",
      "colId": "1259742027670732801",
      "name": "常用应用",
      "key": "application",
      "isDefault": "0",
      "templet": "<div class=\"gridLayoutClass\">\n<div class=\"headPClass\">常用应用</div>\n<div class=\"bodyDivClass\">\n<ul class=\"application_ul\">\n        <li v-for=\"obj in data\">\n      <div v-if=\"obj.type ==='interior'\" @click=\"moreUrl(obj.url)\">\n            <a-icon v-if=\"!obj.icon.includes('type')\" :type=\"obj.icon\" />\n            <my-icon v-else-if=\"['customIcon','userCustomIcon'].includes(JSON.parse(obj.icon).type)\" :type=\"JSON.parse(obj.icon).

原文地址: http://www.cveoy.top/t/topic/i88e 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录