@wibetter/json-utils 5.2.2 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +3036 -1691
- package/dist/index.esm.min.js +5292 -2
- package/dist/index.js +2389 -1
- package/dist/index.js.LICENSE.txt +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2390 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONUtils=t():e.JSONUtils=t()}(this,(function(){return function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataSourceTypeList:function(){return x},EventTypeDataList:function(){return S},KeyWordList:function(){return ve},TypeDataList:function(){return O},dataRoute2dataPath:function(){return se},dynamicDataAnalyzer:function(){return ce},evalExpression:function(){return s},getCurPosition:function(){return Q},getDefaultOptionVal:function(){return ae},getExpectType:function(){return z},getJsonDataByKeyRoute:function(){return d},getNextIndexRoute:function(){return ee},getParentIndexRoute:function(){return G},getParentIndexRoute_CurIndex:function(){return te},getParentKeyRoute:function(){return fe},getParentKeyRoute_CurKey:function(){return be},getSchemaByIndexRoute:function(){return y},getSchemaByKeyRoute:function(){return f},hasProperties:function(){return u},indexRoute2keyRoute:function(){return b},isArray:function(){return k},isBoolean:function(){return N},isColor:function(){return M},isContainerSchema:function(){return Y},isDateStr:function(){return R},isDateTimeStr:function(){return q},isEmptySchema:function(){return W},isEqual:function(){return p},isFunction:function(){return _},isNewSchemaData:function(){return X},isNumber:function(){return D},isObject:function(){return P},isQuantity:function(){return I},isSameParent:function(){return H},isSelect:function(){return F},isString:function(){return T},isStructuredSchema:function(){return Z},isTimeStr:function(){return E},isURL:function(){return w},json2schema:function(){return A},json2treeData:function(){return de},keyRoute2indexRoute:function(){return v},metaElemAnalyzer:function(){return V},moveBackward:function(){return ie},moveForward:function(){return re},objClone:function(){return o},oldSchemaToNewSchema:function(){return $},oldSchemaToNewSchemaV1:function(){return L},registerExpectType:function(){return U},schema2conditionValue:function(){return ye},schema2json:function(){return pe},schemaMetaList:function(){return ue},truncate:function(){return c},urlParse:function(){return l},urlStringify:function(){return n}});var r=require("lodash"),i=require("qs"),a=e.n(i);function l(){var e={};return location.search&&(e=a().parse(location.search.substring(1))),e}function n(e){var t="";return url&&(t=a().stringify(e)),t}function o(e){return(0,r.cloneDeep)(e)}function p(e,t){return(0,r.isEqual)(e,t)}function u(e){var t=!1;return null!=e&&(t=!0),t}function c(e,t){return(0,r.truncate)(e,t)}function s(e,t){var r=t||{};if(!e)return!1;var i=new Function("data","with(data) { return ("+e+");}"),a="";try{a=i(r)}catch(t){return console.warn("表达式运算出错: "+e+",报错信息:",t),a}return a}function d(e,t,r){var i=t;if(r&&(i=o(t)),e)for(var a=e.split("-"),l=0,n=a.length;l<n;l++){var p=a[l];p&&(i=i&&i[p])}return i}function y(e,t,r){var i=t;if(r&&(i=o(t)),e)for(var a=e.split("-"),l=0,n=a.length;l<n;l++){var p=a[l];if("0"!==p||"array"!==i.type&&"radio"!==i.type&&"select"!==i.type&&"checkboxes"!==i.type||!i.options&&!i.items){if(p){var u="0";i.propertyOrder?u=i.propertyOrder[p]:i.properties&&(u=Object.keys(i.properties)[p]),i=i.properties[u]}}else i=i.options||i.items}return i}function f(e,t,r){var i=t;if(r&&(i=o(t)),e&&i)for(var a=e.split("-"),l=0,n=a.length;l<n;l++){var p=a[l];p&&i.properties&&(i=i.properties[p])}return i}function b(e,t){for(var r=t,i="",a=e.split("-"),l=0,n=a.length;l<n;l++){var o=a[l];if("0"===o&&r.items)r=r.items,i=i?i+"-items":"items";else if("0"===o&&r.options)r=r.options,i=i?i+"-options":"options";else if(o){var p="0";r.propertyOrder?p=r.propertyOrder[o]:r.properties&&(p=Object.keys(r.properties)[o]),r=r.properties[p],i=i?i+"-"+p:p}}return i}function v(e,t){for(var r=t,i="",a=e.split("-"),l=0,n=a.length;l<n;l++){var o=a[l];if(o){var p=-1;r.propertyOrder?(p=r.propertyOrder.indexOf(o),r=r.properties[o]):r.properties?(p=Object.keys(r.properties).indexOf(o),r=r.properties[o]):r.items?(p=0,r=r.items):r.options&&(p=0,r=r.options),i=i?i+"-"+p:p.toString()}}return i}var m,h={type:"event",title:"事件",isContainer:!1,properties:{type:{default:"emit",type:"select",options:[{label:"on",value:"on"},{label:"emit",value:"emit"}],title:"事件类型"},trigger:{type:"input",default:"eventName",title:"触发事件",description:"用于输入触发事件的名称",placeholder:"请输入触发事件的名称"},eventData:{title:"事件数据",type:"json",default:"{}",description:"传递给触发事件的数据对象"}},propertyOrder:["type","trigger","eventData"]},g={type:"datasource",title:"数据源",isContainer:!1,properties:{type:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据源类型"},data:{title:"本地json数据",placeholder:"请输入静态json数据",type:"json",default:"{}",description:"用于设置本地的静态json数据",isRequired:!0},filter:{title:"过滤器",type:"codearea",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},propertyOrder:["type","data","filter"]},C=((m={type:"object"}).type="datasource",m.title="数据源",m.isContainer=!1,m.properties={type:{type:"select",default:"remote",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据源类型"},data:{type:"url",title:"远程json数据",placeholder:"请输入远程json数据源地址",default:"http://xxx",isRequired:!0,description:"用于设置获取元素数据的请求地址"},filter:{type:"codearea",title:"过滤器",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},m.propertyOrder=["type","data","filter"],m),j={type:"local",config:{dataName:"",body:{},filter:"return data;"},data:"{}",localFilter:"return data;"},O={jsonschema:{type:"object",title:"jsonSchemaObject",properties:{func:{type:"object",title:"功能设置",properties:{a:{title:"单文本框",type:"input",default:"",description:"",placeholder:"",isRequired:!1}},propertyOrder:["a"]},style:{type:"object",title:"样式设置",properties:{b:{title:"单文本框",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["b"]},data:{type:"data",title:"数据设置",properties:{c:{title:"单文本框",type:"input",default:"",description:"",placeholder:"",isRequired:!1}},propertyOrder:["c"]}},propertyOrder:["func","style","data"]},input:{title:"单文本框",type:"input",default:"",description:"",placeholder:""},boolean:{type:"boolean",title:"布尔值",default:!1,description:""},object:{type:"object",title:"对象Object",description:"",properties:{a:{type:"input",title:"单文本框",default:"",description:"",placeholder:""}},propertyOrder:["a"]},array:{type:"array",title:"数组Array",description:"",items:{type:"object",title:"数组项",description:"",properties:{name:{type:"input",title:"名字",default:"",description:"",placeholder:""}},propertyOrder:["name"]}},"empty-array":{type:"array",title:"数组Array",description:"",default:[],items:{type:"object",title:"数组项",description:"",properties:{}}},"empty-object":{type:"object",title:"对象Object",description:"",properties:{}},url:{type:"url",title:"链接地址url",default:"",description:"",placeholder:""},textarea:{type:"textarea",title:"多行文本框",default:"",description:"",placeholder:""},color:{type:"color",title:"颜色color",default:"#ffffff",description:""},image:{title:"图片",type:"image",default:"",description:"上传图片",imgWidth:200,imgHeight:200,imgRatioReadOnly:!0},number:{type:"number",title:"数量number",default:1,minimum:0,maximum:1e3,description:""},"input-image":{title:"图片地址",type:"input-image",description:"",accept:".jpeg,.jpg,.png",multiple:!0},json:{title:"json数据",type:"json",default:"{}",description:""},codearea:{type:"codearea",title:"函数类型",placeholder:"请输入函数方法",default:'function func() { console.log("hello, world!"); }',description:"用于定义函数方法"},htmlarea:{title:"富文本",type:"htmlarea",placeholder:"请输入html代码片段",default:"<p>hello,world!</p>",description:"用于放置html代码片段"},"text-editor":{type:"text-editor",title:"富文本",default:"",description:"",placeholder:""},date:{type:"date",title:"日期Date",default:"",description:"",placeholder:""},"date-time":{type:"date-time",title:"日期时间",default:"",description:"",placeholder:""},time:{type:"time",title:"时间Time",default:"",description:"",placeholder:""},quantity:{type:"quantity",title:"单位计量",isContainer:!1,properties:{unit:{type:"number",title:"单位数值",default:50,minimum:0,maximum:1e3,description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["unit","quantity"]},"box-style":{type:"box-style",title:"盒子模型",isContainer:!1,properties:{unit:{title:"单位数值",type:"input",default:"0",description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["unit","quantity"]},"padding-margin":{type:"padding-margin",title:"边距设置",isContainer:!1,properties:{margin:{title:"外边距",type:"input",default:"0",description:""},padding:{title:"内边距",type:"input",default:"0",description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["margin","padding","quantity"]},radio:{type:"radio",title:"单选",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:""},select:{type:"select",title:"下拉选择",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:""},cascader:{type:"cascader",title:"级联选择",options:[{value:"zhejiang",label:"Zhejiang",children:[{value:"hangzhou",label:"Hangzhou",children:[{value:"xihu",label:"West Lake"}]}]},{value:"jiangsu",label:"Jiangsu",children:[{value:"nanjing",label:"Nanjing",children:[{value:"zhonghuamen",label:"Zhong Hua Men"}]}]}],default:"a",description:"",showSearch:!0,allowClear:!0},checkboxes:{type:"checkboxes",title:"多选",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],default:["a"],description:""},"dynamic-data":{type:"dynamic-data",title:"动态数据源",isContainer:!1,properties:{type:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据类型"},config:{title:"接口配置",type:"object",description:"用于存放接口的配置数据(url、请求参数等)",isRequired:!0,properties:{dataName:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据类型"},body:{type:"object",title:"请求参数配置",description:"用于配置当前接口的请求参数数值",isRequired:!0},filter:{title:"过滤器函数体",type:"codearea",default:"return data;",description:"用于定义过滤接口数据",isRequired:!0}},propertyOrder:["dataName","body","filter"]},data:{title:"数据内容",type:"json",default:"{}",description:"用于存放DynamicData的数据内容",isRequired:!0},localFilter:{title:"过滤器",type:"codearea",default:"return data;",description:"用于定义过滤本地数据",isRequired:!0}},propertyOrder:["type","config","data","localFilter"]},datasource:g,event:h,"dynamic-config":{type:"dynamic-config",title:"动态配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"内容Meta数据",value:"Content"},{label:"全局配置数据",value:"RuntimeConst"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},value:{title:"数据值",type:"input",default:"",description:"",placeholder:"",onShow:'type === "DevDefaults" || type === "Content" || type === "RuntimeConst"'},description:{title:"属性名称",type:"input",default:"",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},valueType:{type:"radio",title:"配置方式",options:[{label:"填写",value:"string"},{label:"选择",value:"select"}],default:"string",isConditionProp:!0,description:'在MP后台或资源中心配置时的交互方式,推荐使用"选择"',onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},range:{type:"select",title:"可选项",multiple:!0,options:[],onShow:'(type === "ContentStaticConfig" || type === "ResourceCenter") && valueType === "select"',description:"这里会使用value中的配置选项作为options"}},propertyOrder:["type","value","description","valueType","range"],showCodeViewBtn:!1},"dynamic-object":{type:"dynamic-object",title:"动态配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"内容Meta数据",value:"Content"},{label:"全局配置数据",value:"RuntimeConst"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置: 在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置: 选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据: 支持内容meta数据的获取,页面meta数据。 4)全局配置数据: 目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},value:{title:"数据值",type:"input",default:"",description:"",placeholder:"",onShow:'type === "Content" || type === "RuntimeConst"'},description:{title:"自定义配置名称",type:"input",default:"主题包配置",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},attrs:{type:"array",title:"属性列表",description:"Tab需要配置的属性",items:{type:"object",title:"数组项",description:"",properties:{attr:{type:"input",title:"属性Key",default:"",description:"",placeholder:""},description:{title:"描述",type:"input",default:"",description:"",placeholder:""},value:{title:"数值",typeOn:"type === 'image' ? 'input-image' : type === 'number' ? 'number' : 'input'",default:"",description:"",placeholder:""},type:{type:"select",title:"属性类型",options:[{label:"图片类型",value:"image"},{label:"字符串",value:"string"},{label:"数字",value:"number"}],default:"string",description:""}},propertyOrder:["attr","description","type","value"]},"minimum-child":1,showCodeViewBtn:!1,onShow:'type === "DevDefaults" || type === "ContentStaticConfig" || type === "ResourceCenter"'}},propertyOrder:["type","description","attrs","value"],showCodeViewBtn:!1,showKey:!0},"dynamic-array":{type:"dynamic-array",title:"动态数组",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},description:{title:"自定义配置名称",type:"input",default:"Tab全局配置",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},tabNums:{title:"Tab配置数",type:"number",default:1,description:"需要配置的Tab数量",placeholder:"",onShow:"type === 'ContentStaticConfig' || type === 'ResourceCenter'"},attrs:{type:"array",title:"Tab属性",description:"Tab需要配置的属性",items:{type:"object",title:"数组项",description:"",properties:{attr:{type:"input",title:"属性Key",default:"",description:"",placeholder:""},description:{title:"描述",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["attr","description"]},"minimum-child":1,onShow:"type === 'ContentStaticConfig' || type === 'ResourceCenter'",showCodeViewBtn:!1},value:{type:"array",title:"Tab配置",description:"",items:{type:"object",title:"数组项",description:"",properties:{title:{type:"input",title:"名称",default:"",description:"",placeholder:""},id:{title:"id",type:"input",default:"",description:"",placeholder:""},value:{title:"数值",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["title","value","id"]},"minimum-child":1,onShow:"type === 'DevDefaults'",showCodeViewBtn:!1}},propertyOrder:["type","value","description","tabNums","attrs"],showCodeViewBtn:!1,showKey:!0},"sohu-source":{type:"sohu-source",title:"组件动态数据",description:"",isContainer:!1,properties:{mainConfig:{type:"object",title:"主要配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",isConditionProp:!0,options:[{label:"模板自定义数据源",value:"RuntimeDataSelfDefine"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"请求当前页面数据",value:"RuntimeDataSelfContent"},{label:"资源中心配置",value:"ResourceCenter"}],default:"RuntimeDataSelfDefine",description:""},description:{title:"数据源名称",type:"input",description:"",placeholder:"",onShow:'type === "ContentStaticConfig"'},dataType:{type:"radio",title:"请求方式",default:!1,options:[{label:"批量请求",value:"FROMCIS"},{label:"组件内部请求",value:"FROMCOMPCIS"},{label:"不请求",value:!1}],description:""},CONTENTID:{title:"数据源ID",type:"input",description:"",placeholder:"",onShow:'type === "RuntimeDataSelfDefine"'},CONTENTTYPE:{type:"select",title:"数据源类型",options:[{label:"channel",value:"channel"},{label:"topic",value:"topic"},{label:"block",value:"block"}],description:"",onShow:'type === "RuntimeDataSelfDefine"'}},propertyOrder:["type","description","dataType","CONTENTID","CONTENTTYPE"],showCodeViewBtn:!1},outConfig:{type:"object",title:"出流配置",description:"",isContainer:!1,properties:{PRO:{type:"select",title:"内容类型",options:[{label:"置顶+加精",value:"4"},{label:"长效置顶",value:"5"}],description:""},FEEDTYPE:{type:"select",title:"排序类型",options:[{label:"综合",value:"XTOPIC_SYNTHETICAL"},{label:"最新",value:"XTOPIC_LATEST"},{label:"相关",value:"XTOPIC_RELATED"}],description:""},VIEW:{type:"select",title:"数据裁剪",options:[{label:"相关推荐模式",value:"articleFeedMode"},{label:"文字链裁剪方式",value:"textMode"},{label:"短内容摘录方式",value:"excerptMode"},{label:"互动(点赞/评论)裁剪方式",value:"interactMode"},{label:"评论文字链裁剪方式",value:"commentTextMode"},{label:"摘录方式(无点赞)",value:"excerptCommentMode"},{label:"无限流卡片模式",value:"dynamicFeedMode"},{label:"时间线模式",value:"timeLineMode"},{label:"复合内容流模式",value:"multiFeedMode"},{label:"搜狐号推荐模式",value:"recommendFeedMode"},{label:"作者页内容流模式",value:"operateFeedMode"},{label:"标签内容流模式",value:"tagsFeedMode"},{label:"评论链裁剪方式",value:"commentMode"},{label:"标签摘录方式",value:"excerptTagsMode"},{label:"内容流模式",value:"feedMode"}],description:""},CONTENTCONTEXT:{type:"select",title:"mKey参数",options:[{label:"作者ID+栏目ID",value:"authorColumnId_${#authorColumnId}"},{label:"账号ID",value:"accountId_${#contentData_account_id}"},{label:"mkeyID",value:"mid_${#mkeyConst_mid}"},{label:"mkey名称",value:"mname_${#mkeyConst_mname}"},{label:"城市Code码",value:"cityCode_${#cityInfo_cityCode}"},{label:"城市名称",value:"cityName_${#cityInfo_cityName}"},{label:"焦点城市Code码",value:"focusCityCode_${#focusCityInfo_cityCode}"}],description:""},CONTENTPARAMS:{title:"动态参数",type:"json",description:"请填写JSON格式的参数",placeholder:""}},propertyOrder:["PRO","FEEDTYPE","VIEW","CONTENTCONTEXT","CONTENTPARAMS"],showCodeViewBtn:!1},otherConfig:{type:"object",title:"选配内容",description:"",isContainer:!1,properties:{SIZE:{type:"number",title:"容量",minimum:0,maximum:1e3,description:"该位置区块需要的内容条数"},TITLE:{title:"标题",type:"input",description:"",placeholder:""},URL:{type:"url",title:"跳转链接",description:"",placeholder:""},CODE:{title:"Code参数",type:"input",description:"",placeholder:"",onShow:!1}},propertyOrder:["SIZE","TITLE","URL","CODE"],showCodeViewBtn:!1}},propertyOrder:["mainConfig","otherConfig","outConfig"],showCodeViewBtn:!1},"sohu-event":{type:"sohu-event",title:"sohu组件事件",showCodeViewBtn:!1,isContainer:!1,properties:{globalEventMap:{type:"object",title:"全局事件Map",description:"",properties:{eventCode:{type:"input",title:"事件名称",default:"",description:"",placeholder:"",readOnly:!0}},propertyOrder:["eventCode"],showCodeViewBtn:!1},event:{type:"array",title:"监听事件",description:"当前组件监听事件列表",default:[],items:{type:"object",title:"数组项",description:"",properties:{name:{type:"input",title:"事件",default:"",description:"",placeholder:""},code:{title:"事件code",type:"input",default:"",description:"",placeholder:""},listenName:{title:"事件名称",type:"input",default:"",description:"",placeholder:""},desc:{title:"事件描述",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["name","code","listenName","desc"]},showCodeViewBtn:!1}},propertyOrder:["globalEventMap","event"]},"sohu-ad":{type:"object",title:"广告配置",description:"",properties:{type:{type:"select",title:"数据源类型",isConditionProp:!0,options:[{label:"模板直接设置",value:"DevDefaults"},{label:"资源中心配置",value:"ResourceCenter"}],description:""},value:{type:"object",title:"广告规则",description:"",onShow:'type === "DevDefaults"',properties:{id:{title:"广告ID",type:"number",description:"",placeholder:""},rule:{type:"radio",title:"规则类型",isConditionProp:!0,options:[{label:"固定位置",value:1},{label:"隔几出几",value:2},{label:"固定位置隔几出几",value:3}],description:""},fixArray:{type:"select",title:"固定位置",description:"",multiple:!0,onShow:"rule === 1 || rule === 3",options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"15",value:15},{label:"16",value:16},{label:"17",value:17},{label:"18",value:18},{label:"19",value:19},{label:"20",value:20},{label:"21",value:21},{label:"22",value:22},{label:"23",value:23},{label:"24",value:24},{label:"25",value:25},{label:"26",value:26},{label:"27",value:27},{label:"28",value:28},{label:"29",value:29},{label:"30",value:30},{label:"31",value:31},{label:"32",value:32},{label:"33",value:33},{label:"34",value:34},{label:"35",value:35},{label:"36",value:36},{label:"37",value:37},{label:"38",value:38},{label:"39",value:39},{label:"40",value:40},{label:"41",value:41},{label:"42",value:42},{label:"43",value:43},{label:"44",value:44},{label:"45",value:45},{label:"46",value:46},{label:"47",value:47},{label:"48",value:48},{label:"49",value:49},{label:"50",value:50}]},begin:{type:"number",title:"开始位置",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},turn:{type:"number",title:"间隔/隔",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},number:{type:"number",title:"间隔/出",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},mergeType:{type:"radio",title:"插入规则",options:[{label:"覆盖",value:0},{label:"插入",value:1}],description:""}},propertyOrder:["id","rule","fixArray","begin","turn","number","mergeType"]},range:{type:"array",title:"广告规则列表",description:"",onShow:'type === "ResourceCenter"',items:{type:"object",title:"数组项",description:"",properties:{rule:{type:"radio",title:"规则类型",isConditionProp:!0,options:[{label:"固定位置",value:1},{label:"隔几出几",value:2},{label:"固定位置隔几出几",value:3}],description:""},fixArray:{type:"select",title:"固定位置",description:"",onShow:"rule === 1 || rule === 3",multiple:!0,options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"15",value:15},{label:"16",value:16},{label:"17",value:17},{label:"18",value:18},{label:"19",value:19},{label:"20",value:20},{label:"21",value:21},{label:"22",value:22},{label:"23",value:23},{label:"24",value:24},{label:"25",value:25},{label:"26",value:26},{label:"27",value:27},{label:"28",value:28},{label:"29",value:29},{label:"30",value:30},{label:"31",value:31},{label:"32",value:32},{label:"33",value:33},{label:"34",value:34},{label:"35",value:35},{label:"36",value:36},{label:"37",value:37},{label:"38",value:38},{label:"39",value:39},{label:"40",value:40},{label:"41",value:41},{label:"42",value:42},{label:"43",value:43},{label:"44",value:44},{label:"45",value:45},{label:"46",value:46},{label:"47",value:47},{label:"48",value:48},{label:"49",value:49},{label:"50",value:50}]},begin:{type:"number",title:"开始位置",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},turn:{type:"number",title:"间隔/隔",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},number:{type:"number",title:"间隔/出",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},mergeType:{type:"radio",title:"插入规则",options:[{label:"覆盖",value:0},{label:"插入",value:1}],description:""}},propertyOrder:["rule","fixArray","begin","turn","number","mergeType"]}}},propertyOrder:["type","value","range"]}},S={on:{type:"event",title:"事件",isContainer:!1,properties:{type:{default:"on",type:"select",options:[{label:"on",value:"on"},{label:"emit",value:"emit"}],title:"事件类型"},register:{type:"input",default:"eventName",title:"注册事件",description:"用于输入注册事件的名称",placeholder:"请输入注册事件的名称"},actionFunc:{title:"执行函数",type:"codearea",default:"() => {}",description:""}},propertyOrder:["type","register","actionFunc"]},emit:h},x={local:g,remote:C};function w(e){return/^http[s]?:\/\/.*/.test(e)}function T(e){return"String"===Object.prototype.toString.call(e).slice(8,-1)}function D(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function N(e){return"Boolean"===Object.prototype.toString.call(e).slice(8,-1)}function R(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}function q(e){return/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e)||/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)}function E(e){return/^\d{2}:\d{2}:\d{2}$/.test(e)||/^\d{2}:\d{2}$/.test(e)}function k(e){var t=!1;return"Array"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function F(e){if(!k(e))return!1;for(var t=0,r=e.length;t<r;t++)if(!T(e[t]))return!1;return!0}function P(e){var t=!1;return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function I(e){var t=!1;return O.quantity.properties.quantity.enum.indexOf(e)>=0&&(t=!0),t}function M(e){return/^#[0-9a-f]{6}$/.test(e)||/^#[0-9a-f]{3}$/.test(e)}function _(e){var t=!1;return"Function"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function A(e){var t;return t=e&&P(e)?function(e){var t;if(P(e)){var r=Object.keys(e);e.data&&e.filter&&2===r.length?t=k(e.data)||P(e.data)?o(x.local):o(x.remote):e.trigger&&e.eventData&&2===r.length?t=o(S.emit):e.register&&e.actionFunc&&2===r.length?t=o(S.on):e.quantity&&I(e.quantity)&&2===r.length?t=o(O.quantity):(t=o(O["empty-object"]),Object.keys(e).map((function(r){var i=e[r];t.properties[r]=A(i)})))}return t}(e):e&&k(e)?function(e){var t;if(e&&k(e))if(F(e)){(t=o(O.select)).items.enum=e;var r=t.items.enumextra.length,i=e.length;if(i>r)for(var a=r,l=i;a<l;a++)t.items.enumextra.push("选项"+e(a))}else{t=o(O["empty-array"]);var n=A(e[0]);t.items.properties=n.properties}return t}(e):function(e){var t="";if(N(e))t=o(O.boolean);else if(D(e))t=o(O.number);else if(w(e))t=o(O.url);else if(R(e))t=o(O.date);else if(q(e))t=o(O["date-time"]);else if(E(e))t=o(O.time);else if(M(e))t=o(O.color);else try{t=D(JSON.parse(e))?o(O.input):o(O.json)}catch(r){t=e&&e.length>30?o(O.textarea):o(O.input)}return t}(e),t}function B(e,t){var r=t||{};return P(e)&&"object"===getExpectType(e.type)&&e.properties&&(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(t){var i=e.properties[t];r=V(i,r)})),r}function V(e,t){var r=!t,i=t||{};if(e&&"{}"!==JSON.stringify(e)){var a=e.type;"object"===a||"func"===a||"style"===a||"data"===a?(!r&&i.object?i.object+=1:r||(i.object=1),i=B(e,i)):"array"===a?(!r&&i.array?i.array+=1:r||(i.array=1),i=B(e=e.items,i)):!r&&i[a]?i[a]+=1:r||(i[a]=1)}return i}function L(e){var t=o(e);if(!t.title&&t.description&&(t.title=t.description),t.type||(t.type=t.format),"quantity"!==t.type&&"array"!==t.type&&"datasource"!==t.type&&"event"!==t.type&&"object"!==t.type||!u(t.default)||delete t.default,"radio"===t.type&&(t.type="string",t.enum&&t.enumextra&&(t.items={type:"string",enum:o(t.enum),enumextra:o(t.enumextra)},delete t.enum,delete t.enumextra)),"quantity"===t.type){var r=t.properties,i=o(O.quantity);if(r.quantity&&P(r.quantity)&&r.quantity.default){var a=r.quantity.default;i.properties.quantity.default="percent"===a?"%":a}t=i}if("datasource"===t.type){var l=t.properties,n=l.type&&l.type.default,p=l.data&&l.data.default,c=l.filter&&l.filter.default;"local"===n?(t=o(x.local)).properties.data.default=p?o(p):"{}":(t=o(x.remote)).properties.data.default=p?o(p):"http://xxx",t.properties.filter.default=c?o(c):"() => {}"}if("event"===t.type){var s=t.properties,d=s.type&&s.type.default;if("in"===d||"on"===d){var y=s.filter&&s.filter.default||"() => {}";t=o(S.on),s.actionFunc&&P(s.actionFunc)&&(t.properties.actionFunc.default=s.actionFunc.default||o(y))}else{var f=s.filter&&s.filter.default||"{}";t=o(S.emit),s.eventData&&P(s.eventData)&&(t.properties.eventData.default=s.eventData.default||o(f))}}return t.properties&&(t.propertyOrder||(t.propertyOrder=Object.keys(t.properties)),t.propertyOrder.map((function(e){t.properties[e]=$(t.properties[e])}))),t.items&&(t.items=$(t.items)),t}function $(e){var t=o(e);return t.required||delete t.required,t.type&&t.type&&(t.type=t.type),"quantity"!==t.type&&"array"!==t.type&&"datasource"!==t.type&&"event"!==t.type&&"object"!==t.type||!u(t.default)||delete t.default,"radio"!==t.type&&"checkboxes"!==t.type&&"select"!==t.type||t.items&&t.items.enum&&t.items.enumextra&&(t.options=[],t.items.enum.forEach((function(e,r){t.options.push({label:t.items.enumextra[r]||e,value:e})})),delete t.items),t.properties&&(t.propertyOrder||(t.propertyOrder=Object.keys(t.properties)),t.propertyOrder.map((function(e){t.properties[e]=$(t.properties[e])}))),"array"===t.type&&t.items&&(t.items=$(t.items)),t}require("mobx");var J,K=((J={array:"array",boolean:"boolean","box-style":"object","padding-margin":"object",codearea:"string",color:"string",datasource:"object",date:"string","date-time":"string","dynamic-data":"object",event:"object","func-body":"string",htmlarea:"string",image:"string",input:"string",json:"string",number:"number","input-image":"string",object:"object",quantity:"object",radio:"string",select:"array"}).select="string",J.textarea="string",J["text-editor"]="string",J.time="string",J.url="string",J["dynamic-config"]="object",J["dynamic-object"]="object",J["dynamic-array"]="object",J["sohu-source"]="object",J["sohu-event"]="object",J);function z(e){return K[e]||e}function U(e,t){K[e]?console.warn("当前已经存在"+e+"("+K[e]+"),暂时不支持覆盖。"):K[e]=t}function W(e){var t=!0;if(!e)return t;var r=e.type;return("object"===r&&e.properties&&e.propertyOrder&&e.propertyOrder.length>0||"array"===r&&e.items&&e.items.properties&&e.items.propertyOrder&&e.items.propertyOrder.length>0||e.type&&"array"!==e.type&&"object"!==e.type||e.type)&&(t=!1),t}function X(e){var t=!1,r=e.lastUpdateTime,i=new Date("2024-10-05T00:01:00.691Z").getTime();return r&&new Date(r).getTime()>=i&&(t=!0),t}function Y(e){var t=!1,r=z(e.type),i=void 0===e.isContainer||e.isContainer;return"object"===r&&i&&(t=!0),t}function Z(e){var t=!0;return"object"===e.type&&e.propertyOrder&&e.properties?e.propertyOrder.map((function(r){var i=e.properties[r];"object"===e.type&&i.propertyOrder&&i.properties||(t=!1)})):t=!1,t}function H(e,t){var r=e.split("-"),i=t.split("-");return r.pop(),i.pop(),r.join("-")===i.join("-")}function Q(e,t){for(var r=e.split("-"),i=t.split("-"),a="before",l=0,n=(r.length>i.length?i:r).length;l<n;l+=1)Number(r[l])>Number(i[l])&&(a="after");return a}function G(e){var t=e.split("-");return t.pop(),t.join("-")}function ee(e){var t=e.split("-"),r=t.pop(),i=Number(r)+1;return t.push(""+i),t.join("-")}function te(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}function re(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)-1),t.join("-")}function ie(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)+1),t.join("-")}function ae(e,t){var r="",i=!1;if(!1!==e.defaultActiveFirstOption&&e.defaultActiveFirstOption)return e.options&&e.options[0]&&(r=e.options[0].value,i=!0),(t||e.multiple)&&(r=i?[r]:[]),r}function le(e,t){var r,i,a=void 0,l=t;u(l)&&u(e.default)&&(typeof l!=typeof e.default||(r=l,i=e.default,P(r)+"-"+k(r)!=P(i)+"-"+k(i)))&&(l=void 0);var n=u(l)?l:e.default;switch(e.type){case"select":case"radio":a=null!=n?n:ae(e);break;case"checkboxes":a=null!=n?n:ae(e,!0);break;case"color":"#fff"!==n&&"#FFF"!==n||(n="#ffffff"),a=u(n)?n:"#ffffff";break;case"boolean":a=!!u(n)&&n;break;case"number":a=u(n)?n:void 0;break;case"json":var o="";if(P(n)||k(n))o=n;else if(_(n)||""===n)o={};else try{o=JSON.parse(n)}catch(e){o={}}a=o;break;default:a="input"===e.type&&"0"===e.default?n||e.default:u(n)?n:void 0}return a}function ne(e,t){var r={},i=e.type;if(P(e)&&"object"===z(e.type)){var a=e,l=t;u(l)&&(u(a.default)&&typeof l!=typeof e.default||!P(l))&&(l=void 0);var n=u(l)?l:a.default;"dynamic-data"===i?(r=o(j),n&&P(n)&&"{}"!==JSON.stringify(n)&&(r=Object.assign(r,n))):"datasource"===i?a.properties&&a.properties.type&&a.properties.type.default&&"local"===a.properties.type.default?(r={data:"{}",filter:"() => {}"},n&&n.data&&(r.data=n.data),n&&n.filter&&(r.filter=n.filter),"http://xxx"===r.data&&(r.data="{}")):(r={data:"http://xxx",filter:"() => {}"},n&&n.data&&(r.data=n.data),n&&n.filter&&(r.filter=n.filter),"{}"===r.data&&(r.data="http://xxx")):"event"===i?a.properties&&a.properties.type&&a.properties.type.default&&"emit"===a.properties.type.default?n&&"out"===n.type?r={trigger:n&&n.filter||"eventName",eventData:"{}"}:(r={trigger:"eventName",eventData:"{}"},n&&n.trigger&&(r.trigger=n.trigger),n&&n.eventData&&(r.eventData=n.eventData)):n&&"in"===n.type?r={register:"eventName",actionFunc:n&&n.filter||"() => {}"}:(r={register:"eventName",actionFunc:"() => {}"},n&&n.register&&(r.register=n.register),n&&n.actionFunc&&(r.actionFunc=n.actionFunc)):!1===e.isContainer&&n&&P(n)&&"{}"!==JSON.stringify(n)?r=Object.assign(r,n):void 0===l&&a.default&&P(a.default)?r=a.default:e.properties&&(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(i){var a=e.properties[i],l=t&&t[i];switch(z(a.type)){case"array":r[i]=oe(a,l);break;case"object":r[i]=ne(a,l);break;default:r[i]=le(a,l)}}))}return r}function oe(e,t){var r=[];if(e&&"array"===z(e.type)){var i=t;u(i)&&(u(e.default)&&typeof i!=typeof e.default||!k(i))&&(i=void 0);var a=u(i)?i:e.default;if("array"===z(e.type))if(k(a))a.map((function(t){r.push(ne(e.items,t))}));else if(a)r=a;else{var l=ne(e.items,a);r.push(l)}else r=u(a)?a:[]}return r}function pe(e,t){return"object"===z(e.type)?ne(e,t):"array"===z(e.type)?oe(e,t):le(e,t)}var ue=O;function ce(e,t){var r=t||[];if(e&&"{}"!==JSON.stringify(e))if(P(e))if(e.type&&"remote"===e.type&&e.config&&P(e.config)&&e.config.dataName&&u(e.localFilter)&&u(e.data)){var i=e.config.body;if(i&&!P(i))try{i=JSON.parse(i)}catch(e){i={}}r.push({id:e.config.id,dataName:e.config.dataName,body:i})}else Object.keys(e).map((function(t){ce(e[t],r)}));else k(e)&&e.map((function(e){ce(e,r)}));return r}function se(e,t){var r=t||"data";return e.split("-").map((function(e){r=/^\d+$/.test(e)?r+"["+e+"]":r+"."+e})),r}function de(e,t){var r=[];return P(e)?Object.keys(e).map((function(i){var a=e[i],l=t?t+"-"+i:i;P(a)||k(a)?r.push({title:i,value:l,key:l,children:de(a,l)}):r.push({title:i,value:l,key:l})})):k(e)&&e.map((function(e,i){var a=i.toString(),l=t?t+"-"+i:a;P(e)||k(e)?r.push({title:a,value:l,key:l,children:de(e,l)}):r.push({title:a,value:l,key:l})})),r}function ye(e,t){var r="";return"object"===z(e.type)&&e.properties&&(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(i){var a=e.properties[i],l=t[i];"array"===z(a.type)&&"object"===z(a.type)||l&&a.isConditionProp&&(r.indexOf("-")>0?r+="-"+l:r=l)})),r}function fe(e){var t=e.split("-");return t.pop(),t.join("-")}function be(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}var ve=["key","enum","enumextra","items","input","boolean","number","color","url","textarea","text-editor","radio","select","checkboxes","date","date-time","time","json","codearea","htmlarea","quantity","box-style","dynamic-data","datasource","event","array","object"];return t}()}));
|
|
2
|
+
!(function (e, t) {
|
|
3
|
+
'object' == typeof exports && 'object' == typeof module
|
|
4
|
+
? (module.exports = t())
|
|
5
|
+
: 'function' == typeof define && define.amd
|
|
6
|
+
? define([], t)
|
|
7
|
+
: 'object' == typeof exports
|
|
8
|
+
? (exports.JSONUtils = t())
|
|
9
|
+
: (e.JSONUtils = t());
|
|
10
|
+
})(this, function () {
|
|
11
|
+
return (function () {
|
|
12
|
+
'use strict';
|
|
13
|
+
var e = {
|
|
14
|
+
n: function (t) {
|
|
15
|
+
var r =
|
|
16
|
+
t && t.__esModule
|
|
17
|
+
? function () {
|
|
18
|
+
return t.default;
|
|
19
|
+
}
|
|
20
|
+
: function () {
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
return e.d(r, { a: r }), r;
|
|
24
|
+
},
|
|
25
|
+
d: function (t, r) {
|
|
26
|
+
for (var i in r)
|
|
27
|
+
e.o(r, i) &&
|
|
28
|
+
!e.o(t, i) &&
|
|
29
|
+
Object.defineProperty(t, i, { enumerable: !0, get: r[i] });
|
|
30
|
+
},
|
|
31
|
+
o: function (e, t) {
|
|
32
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
33
|
+
},
|
|
34
|
+
r: function (e) {
|
|
35
|
+
'undefined' != typeof Symbol &&
|
|
36
|
+
Symbol.toStringTag &&
|
|
37
|
+
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
|
|
38
|
+
Object.defineProperty(e, '__esModule', { value: !0 });
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
t = {};
|
|
42
|
+
e.r(t),
|
|
43
|
+
e.d(t, {
|
|
44
|
+
DataSourceTypeList: function () {
|
|
45
|
+
return x;
|
|
46
|
+
},
|
|
47
|
+
EventTypeDataList: function () {
|
|
48
|
+
return S;
|
|
49
|
+
},
|
|
50
|
+
KeyWordList: function () {
|
|
51
|
+
return ve;
|
|
52
|
+
},
|
|
53
|
+
TypeDataList: function () {
|
|
54
|
+
return O;
|
|
55
|
+
},
|
|
56
|
+
dataRoute2dataPath: function () {
|
|
57
|
+
return se;
|
|
58
|
+
},
|
|
59
|
+
dynamicDataAnalyzer: function () {
|
|
60
|
+
return ce;
|
|
61
|
+
},
|
|
62
|
+
evalExpression: function () {
|
|
63
|
+
return s;
|
|
64
|
+
},
|
|
65
|
+
getCurPosition: function () {
|
|
66
|
+
return Q;
|
|
67
|
+
},
|
|
68
|
+
getDefaultOptionVal: function () {
|
|
69
|
+
return ae;
|
|
70
|
+
},
|
|
71
|
+
getExpectType: function () {
|
|
72
|
+
return z;
|
|
73
|
+
},
|
|
74
|
+
getJsonDataByKeyRoute: function () {
|
|
75
|
+
return d;
|
|
76
|
+
},
|
|
77
|
+
getNextIndexRoute: function () {
|
|
78
|
+
return ee;
|
|
79
|
+
},
|
|
80
|
+
getParentIndexRoute: function () {
|
|
81
|
+
return G;
|
|
82
|
+
},
|
|
83
|
+
getParentIndexRoute_CurIndex: function () {
|
|
84
|
+
return te;
|
|
85
|
+
},
|
|
86
|
+
getParentKeyRoute: function () {
|
|
87
|
+
return fe;
|
|
88
|
+
},
|
|
89
|
+
getParentKeyRoute_CurKey: function () {
|
|
90
|
+
return be;
|
|
91
|
+
},
|
|
92
|
+
getSchemaByIndexRoute: function () {
|
|
93
|
+
return y;
|
|
94
|
+
},
|
|
95
|
+
getSchemaByKeyRoute: function () {
|
|
96
|
+
return f;
|
|
97
|
+
},
|
|
98
|
+
hasProperties: function () {
|
|
99
|
+
return u;
|
|
100
|
+
},
|
|
101
|
+
indexRoute2keyRoute: function () {
|
|
102
|
+
return b;
|
|
103
|
+
},
|
|
104
|
+
isArray: function () {
|
|
105
|
+
return k;
|
|
106
|
+
},
|
|
107
|
+
isBoolean: function () {
|
|
108
|
+
return N;
|
|
109
|
+
},
|
|
110
|
+
isColor: function () {
|
|
111
|
+
return M;
|
|
112
|
+
},
|
|
113
|
+
isContainerSchema: function () {
|
|
114
|
+
return Y;
|
|
115
|
+
},
|
|
116
|
+
isDateStr: function () {
|
|
117
|
+
return R;
|
|
118
|
+
},
|
|
119
|
+
isDateTimeStr: function () {
|
|
120
|
+
return q;
|
|
121
|
+
},
|
|
122
|
+
isEmptySchema: function () {
|
|
123
|
+
return W;
|
|
124
|
+
},
|
|
125
|
+
isEqual: function () {
|
|
126
|
+
return p;
|
|
127
|
+
},
|
|
128
|
+
isFunction: function () {
|
|
129
|
+
return _;
|
|
130
|
+
},
|
|
131
|
+
isNewSchemaData: function () {
|
|
132
|
+
return X;
|
|
133
|
+
},
|
|
134
|
+
isNumber: function () {
|
|
135
|
+
return D;
|
|
136
|
+
},
|
|
137
|
+
isObject: function () {
|
|
138
|
+
return P;
|
|
139
|
+
},
|
|
140
|
+
isQuantity: function () {
|
|
141
|
+
return I;
|
|
142
|
+
},
|
|
143
|
+
isSameParent: function () {
|
|
144
|
+
return H;
|
|
145
|
+
},
|
|
146
|
+
isSelect: function () {
|
|
147
|
+
return F;
|
|
148
|
+
},
|
|
149
|
+
isString: function () {
|
|
150
|
+
return T;
|
|
151
|
+
},
|
|
152
|
+
isStructuredSchema: function () {
|
|
153
|
+
return Z;
|
|
154
|
+
},
|
|
155
|
+
isTimeStr: function () {
|
|
156
|
+
return E;
|
|
157
|
+
},
|
|
158
|
+
isURL: function () {
|
|
159
|
+
return w;
|
|
160
|
+
},
|
|
161
|
+
json2schema: function () {
|
|
162
|
+
return A;
|
|
163
|
+
},
|
|
164
|
+
json2treeData: function () {
|
|
165
|
+
return de;
|
|
166
|
+
},
|
|
167
|
+
keyRoute2indexRoute: function () {
|
|
168
|
+
return v;
|
|
169
|
+
},
|
|
170
|
+
metaElemAnalyzer: function () {
|
|
171
|
+
return V;
|
|
172
|
+
},
|
|
173
|
+
moveBackward: function () {
|
|
174
|
+
return ie;
|
|
175
|
+
},
|
|
176
|
+
moveForward: function () {
|
|
177
|
+
return re;
|
|
178
|
+
},
|
|
179
|
+
objClone: function () {
|
|
180
|
+
return o;
|
|
181
|
+
},
|
|
182
|
+
oldSchemaToNewSchema: function () {
|
|
183
|
+
return $;
|
|
184
|
+
},
|
|
185
|
+
oldSchemaToNewSchemaV1: function () {
|
|
186
|
+
return L;
|
|
187
|
+
},
|
|
188
|
+
registerExpectType: function () {
|
|
189
|
+
return U;
|
|
190
|
+
},
|
|
191
|
+
schema2conditionValue: function () {
|
|
192
|
+
return ye;
|
|
193
|
+
},
|
|
194
|
+
schema2json: function () {
|
|
195
|
+
return pe;
|
|
196
|
+
},
|
|
197
|
+
schemaMetaList: function () {
|
|
198
|
+
return ue;
|
|
199
|
+
},
|
|
200
|
+
truncate: function () {
|
|
201
|
+
return c;
|
|
202
|
+
},
|
|
203
|
+
urlParse: function () {
|
|
204
|
+
return l;
|
|
205
|
+
},
|
|
206
|
+
urlStringify: function () {
|
|
207
|
+
return n;
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
var r = require('lodash'),
|
|
211
|
+
i = require('qs'),
|
|
212
|
+
a = e.n(i);
|
|
213
|
+
function l() {
|
|
214
|
+
var e = {};
|
|
215
|
+
return (
|
|
216
|
+
location.search && (e = a().parse(location.search.substring(1))), e
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
function n(e) {
|
|
220
|
+
var t = '';
|
|
221
|
+
return url && (t = a().stringify(e)), t;
|
|
222
|
+
}
|
|
223
|
+
function o(e) {
|
|
224
|
+
return (0, r.cloneDeep)(e);
|
|
225
|
+
}
|
|
226
|
+
function p(e, t) {
|
|
227
|
+
return (0, r.isEqual)(e, t);
|
|
228
|
+
}
|
|
229
|
+
function u(e) {
|
|
230
|
+
var t = !1;
|
|
231
|
+
return null != e && (t = !0), t;
|
|
232
|
+
}
|
|
233
|
+
function c(e, t) {
|
|
234
|
+
return (0, r.truncate)(e, t);
|
|
235
|
+
}
|
|
236
|
+
function s(e, t) {
|
|
237
|
+
var r = t || {};
|
|
238
|
+
if (!e) return !1;
|
|
239
|
+
var i = new Function('data', 'with(data) { return (' + e + ');}'),
|
|
240
|
+
a = '';
|
|
241
|
+
try {
|
|
242
|
+
a = i(r);
|
|
243
|
+
} catch (t) {
|
|
244
|
+
return console.warn('表达式运算出错: ' + e + ',报错信息:', t), a;
|
|
245
|
+
}
|
|
246
|
+
return a;
|
|
247
|
+
}
|
|
248
|
+
function d(e, t, r) {
|
|
249
|
+
var i = t;
|
|
250
|
+
if ((r && (i = o(t)), e))
|
|
251
|
+
for (var a = e.split('-'), l = 0, n = a.length; l < n; l++) {
|
|
252
|
+
var p = a[l];
|
|
253
|
+
p && (i = i && i[p]);
|
|
254
|
+
}
|
|
255
|
+
return i;
|
|
256
|
+
}
|
|
257
|
+
function y(e, t, r) {
|
|
258
|
+
var i = t;
|
|
259
|
+
if ((r && (i = o(t)), e))
|
|
260
|
+
for (var a = e.split('-'), l = 0, n = a.length; l < n; l++) {
|
|
261
|
+
var p = a[l];
|
|
262
|
+
if (
|
|
263
|
+
'0' !== p ||
|
|
264
|
+
('array' !== i.type &&
|
|
265
|
+
'radio' !== i.type &&
|
|
266
|
+
'select' !== i.type &&
|
|
267
|
+
'checkboxes' !== i.type) ||
|
|
268
|
+
(!i.options && !i.items)
|
|
269
|
+
) {
|
|
270
|
+
if (p) {
|
|
271
|
+
var u = '0';
|
|
272
|
+
i.propertyOrder
|
|
273
|
+
? (u = i.propertyOrder[p])
|
|
274
|
+
: i.properties && (u = Object.keys(i.properties)[p]),
|
|
275
|
+
(i = i.properties[u]);
|
|
276
|
+
}
|
|
277
|
+
} else i = i.options || i.items;
|
|
278
|
+
}
|
|
279
|
+
return i;
|
|
280
|
+
}
|
|
281
|
+
function f(e, t, r) {
|
|
282
|
+
var i = t;
|
|
283
|
+
if ((r && (i = o(t)), e && i))
|
|
284
|
+
for (var a = e.split('-'), l = 0, n = a.length; l < n; l++) {
|
|
285
|
+
var p = a[l];
|
|
286
|
+
p && i.properties && (i = i.properties[p]);
|
|
287
|
+
}
|
|
288
|
+
return i;
|
|
289
|
+
}
|
|
290
|
+
function b(e, t) {
|
|
291
|
+
for (
|
|
292
|
+
var r = t, i = '', a = e.split('-'), l = 0, n = a.length;
|
|
293
|
+
l < n;
|
|
294
|
+
l++
|
|
295
|
+
) {
|
|
296
|
+
var o = a[l];
|
|
297
|
+
if ('0' === o && r.items)
|
|
298
|
+
(r = r.items), (i = i ? i + '-items' : 'items');
|
|
299
|
+
else if ('0' === o && r.options)
|
|
300
|
+
(r = r.options), (i = i ? i + '-options' : 'options');
|
|
301
|
+
else if (o) {
|
|
302
|
+
var p = '0';
|
|
303
|
+
r.propertyOrder
|
|
304
|
+
? (p = r.propertyOrder[o])
|
|
305
|
+
: r.properties && (p = Object.keys(r.properties)[o]),
|
|
306
|
+
(r = r.properties[p]),
|
|
307
|
+
(i = i ? i + '-' + p : p);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return i;
|
|
311
|
+
}
|
|
312
|
+
function v(e, t) {
|
|
313
|
+
for (
|
|
314
|
+
var r = t, i = '', a = e.split('-'), l = 0, n = a.length;
|
|
315
|
+
l < n;
|
|
316
|
+
l++
|
|
317
|
+
) {
|
|
318
|
+
var o = a[l];
|
|
319
|
+
if (o) {
|
|
320
|
+
var p = -1;
|
|
321
|
+
r.propertyOrder
|
|
322
|
+
? ((p = r.propertyOrder.indexOf(o)), (r = r.properties[o]))
|
|
323
|
+
: r.properties
|
|
324
|
+
? ((p = Object.keys(r.properties).indexOf(o)),
|
|
325
|
+
(r = r.properties[o]))
|
|
326
|
+
: r.items
|
|
327
|
+
? ((p = 0), (r = r.items))
|
|
328
|
+
: r.options && ((p = 0), (r = r.options)),
|
|
329
|
+
(i = i ? i + '-' + p : p.toString());
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return i;
|
|
333
|
+
}
|
|
334
|
+
var m,
|
|
335
|
+
h = {
|
|
336
|
+
type: 'event',
|
|
337
|
+
title: '事件',
|
|
338
|
+
isContainer: !1,
|
|
339
|
+
properties: {
|
|
340
|
+
type: {
|
|
341
|
+
default: 'emit',
|
|
342
|
+
type: 'select',
|
|
343
|
+
options: [
|
|
344
|
+
{ label: 'on', value: 'on' },
|
|
345
|
+
{ label: 'emit', value: 'emit' },
|
|
346
|
+
],
|
|
347
|
+
title: '事件类型',
|
|
348
|
+
},
|
|
349
|
+
trigger: {
|
|
350
|
+
type: 'input',
|
|
351
|
+
default: 'eventName',
|
|
352
|
+
title: '触发事件',
|
|
353
|
+
description: '用于输入触发事件的名称',
|
|
354
|
+
placeholder: '请输入触发事件的名称',
|
|
355
|
+
},
|
|
356
|
+
eventData: {
|
|
357
|
+
title: '事件数据',
|
|
358
|
+
type: 'json',
|
|
359
|
+
default: '{}',
|
|
360
|
+
description: '传递给触发事件的数据对象',
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
propertyOrder: ['type', 'trigger', 'eventData'],
|
|
364
|
+
},
|
|
365
|
+
g = {
|
|
366
|
+
type: 'datasource',
|
|
367
|
+
title: '数据源',
|
|
368
|
+
isContainer: !1,
|
|
369
|
+
properties: {
|
|
370
|
+
type: {
|
|
371
|
+
default: 'local',
|
|
372
|
+
type: 'select',
|
|
373
|
+
options: [
|
|
374
|
+
{ label: '本地数据', value: 'local' },
|
|
375
|
+
{ label: '接口数据', value: 'remote' },
|
|
376
|
+
],
|
|
377
|
+
title: '数据源类型',
|
|
378
|
+
},
|
|
379
|
+
data: {
|
|
380
|
+
title: '本地json数据',
|
|
381
|
+
placeholder: '请输入静态json数据',
|
|
382
|
+
type: 'json',
|
|
383
|
+
default: '{}',
|
|
384
|
+
description: '用于设置本地的静态json数据',
|
|
385
|
+
isRequired: !0,
|
|
386
|
+
},
|
|
387
|
+
filter: {
|
|
388
|
+
title: '过滤器',
|
|
389
|
+
type: 'codearea',
|
|
390
|
+
default: '() => {}',
|
|
391
|
+
description: '用于定义过滤当前数据的函数',
|
|
392
|
+
isRequired: !0,
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
propertyOrder: ['type', 'data', 'filter'],
|
|
396
|
+
},
|
|
397
|
+
C =
|
|
398
|
+
(((m = { type: 'object' }).type = 'datasource'),
|
|
399
|
+
(m.title = '数据源'),
|
|
400
|
+
(m.isContainer = !1),
|
|
401
|
+
(m.properties = {
|
|
402
|
+
type: {
|
|
403
|
+
type: 'select',
|
|
404
|
+
default: 'remote',
|
|
405
|
+
options: [
|
|
406
|
+
{ label: '本地数据', value: 'local' },
|
|
407
|
+
{ label: '接口数据', value: 'remote' },
|
|
408
|
+
],
|
|
409
|
+
title: '数据源类型',
|
|
410
|
+
},
|
|
411
|
+
data: {
|
|
412
|
+
type: 'url',
|
|
413
|
+
title: '远程json数据',
|
|
414
|
+
placeholder: '请输入远程json数据源地址',
|
|
415
|
+
default: 'http://xxx',
|
|
416
|
+
isRequired: !0,
|
|
417
|
+
description: '用于设置获取元素数据的请求地址',
|
|
418
|
+
},
|
|
419
|
+
filter: {
|
|
420
|
+
type: 'codearea',
|
|
421
|
+
title: '过滤器',
|
|
422
|
+
default: '() => {}',
|
|
423
|
+
description: '用于定义过滤当前数据的函数',
|
|
424
|
+
isRequired: !0,
|
|
425
|
+
},
|
|
426
|
+
}),
|
|
427
|
+
(m.propertyOrder = ['type', 'data', 'filter']),
|
|
428
|
+
m),
|
|
429
|
+
j = {
|
|
430
|
+
type: 'local',
|
|
431
|
+
config: { dataName: '', body: {}, filter: 'return data;' },
|
|
432
|
+
data: '{}',
|
|
433
|
+
localFilter: 'return data;',
|
|
434
|
+
},
|
|
435
|
+
O = {
|
|
436
|
+
jsonschema: {
|
|
437
|
+
type: 'object',
|
|
438
|
+
title: 'jsonSchemaObject',
|
|
439
|
+
properties: {
|
|
440
|
+
func: {
|
|
441
|
+
type: 'object',
|
|
442
|
+
title: '功能设置',
|
|
443
|
+
properties: {
|
|
444
|
+
a: {
|
|
445
|
+
title: '单文本框',
|
|
446
|
+
type: 'input',
|
|
447
|
+
default: '',
|
|
448
|
+
description: '',
|
|
449
|
+
placeholder: '',
|
|
450
|
+
isRequired: !1,
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
propertyOrder: ['a'],
|
|
454
|
+
},
|
|
455
|
+
style: {
|
|
456
|
+
type: 'object',
|
|
457
|
+
title: '样式设置',
|
|
458
|
+
properties: {
|
|
459
|
+
b: {
|
|
460
|
+
title: '单文本框',
|
|
461
|
+
type: 'input',
|
|
462
|
+
default: '',
|
|
463
|
+
description: '',
|
|
464
|
+
placeholder: '',
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
propertyOrder: ['b'],
|
|
468
|
+
},
|
|
469
|
+
data: {
|
|
470
|
+
type: 'data',
|
|
471
|
+
title: '数据设置',
|
|
472
|
+
properties: {
|
|
473
|
+
c: {
|
|
474
|
+
title: '单文本框',
|
|
475
|
+
type: 'input',
|
|
476
|
+
default: '',
|
|
477
|
+
description: '',
|
|
478
|
+
placeholder: '',
|
|
479
|
+
isRequired: !1,
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
propertyOrder: ['c'],
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
propertyOrder: ['func', 'style', 'data'],
|
|
486
|
+
},
|
|
487
|
+
input: {
|
|
488
|
+
title: '单文本框',
|
|
489
|
+
type: 'input',
|
|
490
|
+
default: '',
|
|
491
|
+
description: '',
|
|
492
|
+
placeholder: '',
|
|
493
|
+
},
|
|
494
|
+
boolean: {
|
|
495
|
+
type: 'boolean',
|
|
496
|
+
title: '布尔值',
|
|
497
|
+
default: !1,
|
|
498
|
+
description: '',
|
|
499
|
+
},
|
|
500
|
+
object: {
|
|
501
|
+
type: 'object',
|
|
502
|
+
title: '对象Object',
|
|
503
|
+
description: '',
|
|
504
|
+
properties: {
|
|
505
|
+
a: {
|
|
506
|
+
type: 'input',
|
|
507
|
+
title: '单文本框',
|
|
508
|
+
default: '',
|
|
509
|
+
description: '',
|
|
510
|
+
placeholder: '',
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
propertyOrder: ['a'],
|
|
514
|
+
},
|
|
515
|
+
array: {
|
|
516
|
+
type: 'array',
|
|
517
|
+
title: '数组Array',
|
|
518
|
+
description: '',
|
|
519
|
+
items: {
|
|
520
|
+
type: 'object',
|
|
521
|
+
title: '数组项',
|
|
522
|
+
description: '',
|
|
523
|
+
properties: {
|
|
524
|
+
name: {
|
|
525
|
+
type: 'input',
|
|
526
|
+
title: '名字',
|
|
527
|
+
default: '',
|
|
528
|
+
description: '',
|
|
529
|
+
placeholder: '',
|
|
530
|
+
},
|
|
531
|
+
},
|
|
532
|
+
propertyOrder: ['name'],
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
'empty-array': {
|
|
536
|
+
type: 'array',
|
|
537
|
+
title: '数组Array',
|
|
538
|
+
description: '',
|
|
539
|
+
default: [],
|
|
540
|
+
items: {
|
|
541
|
+
type: 'object',
|
|
542
|
+
title: '数组项',
|
|
543
|
+
description: '',
|
|
544
|
+
properties: {},
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
'empty-object': {
|
|
548
|
+
type: 'object',
|
|
549
|
+
title: '对象Object',
|
|
550
|
+
description: '',
|
|
551
|
+
properties: {},
|
|
552
|
+
},
|
|
553
|
+
url: {
|
|
554
|
+
type: 'url',
|
|
555
|
+
title: '链接地址url',
|
|
556
|
+
default: '',
|
|
557
|
+
description: '',
|
|
558
|
+
placeholder: '',
|
|
559
|
+
},
|
|
560
|
+
textarea: {
|
|
561
|
+
type: 'textarea',
|
|
562
|
+
title: '多行文本框',
|
|
563
|
+
default: '',
|
|
564
|
+
description: '',
|
|
565
|
+
placeholder: '',
|
|
566
|
+
},
|
|
567
|
+
color: {
|
|
568
|
+
type: 'color',
|
|
569
|
+
title: '颜色color',
|
|
570
|
+
default: '#ffffff',
|
|
571
|
+
description: '',
|
|
572
|
+
},
|
|
573
|
+
image: {
|
|
574
|
+
title: '图片',
|
|
575
|
+
type: 'image',
|
|
576
|
+
default: '',
|
|
577
|
+
description: '上传图片',
|
|
578
|
+
imgWidth: 200,
|
|
579
|
+
imgHeight: 200,
|
|
580
|
+
imgRatioReadOnly: !0,
|
|
581
|
+
},
|
|
582
|
+
number: {
|
|
583
|
+
type: 'number',
|
|
584
|
+
title: '数量number',
|
|
585
|
+
default: 1,
|
|
586
|
+
minimum: 0,
|
|
587
|
+
maximum: 1e3,
|
|
588
|
+
description: '',
|
|
589
|
+
},
|
|
590
|
+
'input-image': {
|
|
591
|
+
title: '图片地址',
|
|
592
|
+
type: 'input-image',
|
|
593
|
+
description: '',
|
|
594
|
+
accept: '.jpeg,.jpg,.png',
|
|
595
|
+
multiple: !0,
|
|
596
|
+
},
|
|
597
|
+
json: {
|
|
598
|
+
title: 'json数据',
|
|
599
|
+
type: 'json',
|
|
600
|
+
default: '{}',
|
|
601
|
+
description: '',
|
|
602
|
+
},
|
|
603
|
+
codearea: {
|
|
604
|
+
type: 'codearea',
|
|
605
|
+
title: '函数类型',
|
|
606
|
+
placeholder: '请输入函数方法',
|
|
607
|
+
default: 'function func() { console.log("hello, world!"); }',
|
|
608
|
+
description: '用于定义函数方法',
|
|
609
|
+
},
|
|
610
|
+
htmlarea: {
|
|
611
|
+
title: '富文本',
|
|
612
|
+
type: 'htmlarea',
|
|
613
|
+
placeholder: '请输入html代码片段',
|
|
614
|
+
default: '<p>hello,world!</p>',
|
|
615
|
+
description: '用于放置html代码片段',
|
|
616
|
+
},
|
|
617
|
+
'text-editor': {
|
|
618
|
+
type: 'text-editor',
|
|
619
|
+
title: '富文本',
|
|
620
|
+
default: '',
|
|
621
|
+
description: '',
|
|
622
|
+
placeholder: '',
|
|
623
|
+
},
|
|
624
|
+
date: {
|
|
625
|
+
type: 'date',
|
|
626
|
+
title: '日期Date',
|
|
627
|
+
default: '',
|
|
628
|
+
description: '',
|
|
629
|
+
placeholder: '',
|
|
630
|
+
},
|
|
631
|
+
'date-time': {
|
|
632
|
+
type: 'date-time',
|
|
633
|
+
title: '日期时间',
|
|
634
|
+
default: '',
|
|
635
|
+
description: '',
|
|
636
|
+
placeholder: '',
|
|
637
|
+
},
|
|
638
|
+
time: {
|
|
639
|
+
type: 'time',
|
|
640
|
+
title: '时间Time',
|
|
641
|
+
default: '',
|
|
642
|
+
description: '',
|
|
643
|
+
placeholder: '',
|
|
644
|
+
},
|
|
645
|
+
quantity: {
|
|
646
|
+
type: 'quantity',
|
|
647
|
+
title: '单位计量',
|
|
648
|
+
isContainer: !1,
|
|
649
|
+
properties: {
|
|
650
|
+
unit: {
|
|
651
|
+
type: 'number',
|
|
652
|
+
title: '单位数值',
|
|
653
|
+
default: 50,
|
|
654
|
+
minimum: 0,
|
|
655
|
+
maximum: 1e3,
|
|
656
|
+
description: '',
|
|
657
|
+
},
|
|
658
|
+
quantity: {
|
|
659
|
+
type: 'select',
|
|
660
|
+
default: 'px',
|
|
661
|
+
options: [
|
|
662
|
+
{ label: 'px', value: 'px' },
|
|
663
|
+
{ label: 'rem', value: 'rem' },
|
|
664
|
+
{ label: 'em', value: 'em' },
|
|
665
|
+
{ label: '%', value: '%' },
|
|
666
|
+
],
|
|
667
|
+
title: '单位类型',
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
propertyOrder: ['unit', 'quantity'],
|
|
671
|
+
},
|
|
672
|
+
'box-style': {
|
|
673
|
+
type: 'box-style',
|
|
674
|
+
title: '盒子模型',
|
|
675
|
+
isContainer: !1,
|
|
676
|
+
properties: {
|
|
677
|
+
unit: {
|
|
678
|
+
title: '单位数值',
|
|
679
|
+
type: 'input',
|
|
680
|
+
default: '0',
|
|
681
|
+
description: '',
|
|
682
|
+
},
|
|
683
|
+
quantity: {
|
|
684
|
+
type: 'select',
|
|
685
|
+
default: 'px',
|
|
686
|
+
options: [
|
|
687
|
+
{ label: 'px', value: 'px' },
|
|
688
|
+
{ label: 'rem', value: 'rem' },
|
|
689
|
+
{ label: 'em', value: 'em' },
|
|
690
|
+
{ label: '%', value: '%' },
|
|
691
|
+
],
|
|
692
|
+
title: '单位类型',
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
propertyOrder: ['unit', 'quantity'],
|
|
696
|
+
},
|
|
697
|
+
'padding-margin': {
|
|
698
|
+
type: 'padding-margin',
|
|
699
|
+
title: '边距设置',
|
|
700
|
+
isContainer: !1,
|
|
701
|
+
properties: {
|
|
702
|
+
margin: {
|
|
703
|
+
title: '外边距',
|
|
704
|
+
type: 'input',
|
|
705
|
+
default: '0',
|
|
706
|
+
description: '',
|
|
707
|
+
},
|
|
708
|
+
padding: {
|
|
709
|
+
title: '内边距',
|
|
710
|
+
type: 'input',
|
|
711
|
+
default: '0',
|
|
712
|
+
description: '',
|
|
713
|
+
},
|
|
714
|
+
quantity: {
|
|
715
|
+
type: 'select',
|
|
716
|
+
default: 'px',
|
|
717
|
+
options: [
|
|
718
|
+
{ label: 'px', value: 'px' },
|
|
719
|
+
{ label: 'rem', value: 'rem' },
|
|
720
|
+
{ label: 'em', value: 'em' },
|
|
721
|
+
{ label: '%', value: '%' },
|
|
722
|
+
],
|
|
723
|
+
title: '单位类型',
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
propertyOrder: ['margin', 'padding', 'quantity'],
|
|
727
|
+
},
|
|
728
|
+
radio: {
|
|
729
|
+
type: 'radio',
|
|
730
|
+
title: '单选',
|
|
731
|
+
options: [
|
|
732
|
+
{ label: '选项a', value: 'a' },
|
|
733
|
+
{ label: '选项b', value: 'b' },
|
|
734
|
+
{ label: '选项c', value: 'c' },
|
|
735
|
+
],
|
|
736
|
+
description: '',
|
|
737
|
+
},
|
|
738
|
+
select: {
|
|
739
|
+
type: 'select',
|
|
740
|
+
title: '下拉选择',
|
|
741
|
+
options: [
|
|
742
|
+
{ label: '选项a', value: 'a' },
|
|
743
|
+
{ label: '选项b', value: 'b' },
|
|
744
|
+
{ label: '选项c', value: 'c' },
|
|
745
|
+
],
|
|
746
|
+
description: '',
|
|
747
|
+
},
|
|
748
|
+
cascader: {
|
|
749
|
+
type: 'cascader',
|
|
750
|
+
title: '级联选择',
|
|
751
|
+
options: [
|
|
752
|
+
{
|
|
753
|
+
value: 'zhejiang',
|
|
754
|
+
label: 'Zhejiang',
|
|
755
|
+
children: [
|
|
756
|
+
{
|
|
757
|
+
value: 'hangzhou',
|
|
758
|
+
label: 'Hangzhou',
|
|
759
|
+
children: [{ value: 'xihu', label: 'West Lake' }],
|
|
760
|
+
},
|
|
761
|
+
],
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
value: 'jiangsu',
|
|
765
|
+
label: 'Jiangsu',
|
|
766
|
+
children: [
|
|
767
|
+
{
|
|
768
|
+
value: 'nanjing',
|
|
769
|
+
label: 'Nanjing',
|
|
770
|
+
children: [{ value: 'zhonghuamen', label: 'Zhong Hua Men' }],
|
|
771
|
+
},
|
|
772
|
+
],
|
|
773
|
+
},
|
|
774
|
+
],
|
|
775
|
+
default: 'a',
|
|
776
|
+
description: '',
|
|
777
|
+
showSearch: !0,
|
|
778
|
+
allowClear: !0,
|
|
779
|
+
},
|
|
780
|
+
checkboxes: {
|
|
781
|
+
type: 'checkboxes',
|
|
782
|
+
title: '多选',
|
|
783
|
+
options: [
|
|
784
|
+
{ label: '选项a', value: 'a' },
|
|
785
|
+
{ label: '选项b', value: 'b' },
|
|
786
|
+
{ label: '选项c', value: 'c' },
|
|
787
|
+
],
|
|
788
|
+
default: ['a'],
|
|
789
|
+
description: '',
|
|
790
|
+
},
|
|
791
|
+
'dynamic-data': {
|
|
792
|
+
type: 'dynamic-data',
|
|
793
|
+
title: '动态数据源',
|
|
794
|
+
isContainer: !1,
|
|
795
|
+
properties: {
|
|
796
|
+
type: {
|
|
797
|
+
default: 'local',
|
|
798
|
+
type: 'select',
|
|
799
|
+
options: [
|
|
800
|
+
{ label: '本地数据', value: 'local' },
|
|
801
|
+
{ label: '接口数据', value: 'remote' },
|
|
802
|
+
],
|
|
803
|
+
title: '数据类型',
|
|
804
|
+
},
|
|
805
|
+
config: {
|
|
806
|
+
title: '接口配置',
|
|
807
|
+
type: 'object',
|
|
808
|
+
description: '用于存放接口的配置数据(url、请求参数等)',
|
|
809
|
+
isRequired: !0,
|
|
810
|
+
properties: {
|
|
811
|
+
dataName: {
|
|
812
|
+
default: 'local',
|
|
813
|
+
type: 'select',
|
|
814
|
+
options: [
|
|
815
|
+
{ label: '本地数据', value: 'local' },
|
|
816
|
+
{ label: '接口数据', value: 'remote' },
|
|
817
|
+
],
|
|
818
|
+
title: '数据类型',
|
|
819
|
+
},
|
|
820
|
+
body: {
|
|
821
|
+
type: 'object',
|
|
822
|
+
title: '请求参数配置',
|
|
823
|
+
description: '用于配置当前接口的请求参数数值',
|
|
824
|
+
isRequired: !0,
|
|
825
|
+
},
|
|
826
|
+
filter: {
|
|
827
|
+
title: '过滤器函数体',
|
|
828
|
+
type: 'codearea',
|
|
829
|
+
default: 'return data;',
|
|
830
|
+
description: '用于定义过滤接口数据',
|
|
831
|
+
isRequired: !0,
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
propertyOrder: ['dataName', 'body', 'filter'],
|
|
835
|
+
},
|
|
836
|
+
data: {
|
|
837
|
+
title: '数据内容',
|
|
838
|
+
type: 'json',
|
|
839
|
+
default: '{}',
|
|
840
|
+
description: '用于存放DynamicData的数据内容',
|
|
841
|
+
isRequired: !0,
|
|
842
|
+
},
|
|
843
|
+
localFilter: {
|
|
844
|
+
title: '过滤器',
|
|
845
|
+
type: 'codearea',
|
|
846
|
+
default: 'return data;',
|
|
847
|
+
description: '用于定义过滤本地数据',
|
|
848
|
+
isRequired: !0,
|
|
849
|
+
},
|
|
850
|
+
},
|
|
851
|
+
propertyOrder: ['type', 'config', 'data', 'localFilter'],
|
|
852
|
+
},
|
|
853
|
+
datasource: g,
|
|
854
|
+
event: h,
|
|
855
|
+
'dynamic-config': {
|
|
856
|
+
type: 'dynamic-config',
|
|
857
|
+
title: '动态配置',
|
|
858
|
+
description: '',
|
|
859
|
+
isContainer: !1,
|
|
860
|
+
properties: {
|
|
861
|
+
type: {
|
|
862
|
+
type: 'select',
|
|
863
|
+
title: '数据来源',
|
|
864
|
+
options: [
|
|
865
|
+
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
866
|
+
{ label: 'mp后台配置', value: 'ContentStaticConfig' },
|
|
867
|
+
{ label: '内容Meta数据', value: 'Content' },
|
|
868
|
+
{ label: '全局配置数据', value: 'RuntimeConst' },
|
|
869
|
+
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
870
|
+
],
|
|
871
|
+
default: 'DevDefaults',
|
|
872
|
+
isConditionProp: !0,
|
|
873
|
+
description:
|
|
874
|
+
'目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst',
|
|
875
|
+
},
|
|
876
|
+
value: {
|
|
877
|
+
title: '数据值',
|
|
878
|
+
type: 'input',
|
|
879
|
+
default: '',
|
|
880
|
+
description: '',
|
|
881
|
+
placeholder: '',
|
|
882
|
+
onShow:
|
|
883
|
+
'type === "DevDefaults" || type === "Content" || type === "RuntimeConst"',
|
|
884
|
+
},
|
|
885
|
+
description: {
|
|
886
|
+
title: '属性名称',
|
|
887
|
+
type: 'input',
|
|
888
|
+
default: '',
|
|
889
|
+
description: '',
|
|
890
|
+
placeholder: '',
|
|
891
|
+
onShow:
|
|
892
|
+
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
893
|
+
},
|
|
894
|
+
valueType: {
|
|
895
|
+
type: 'radio',
|
|
896
|
+
title: '配置方式',
|
|
897
|
+
options: [
|
|
898
|
+
{ label: '填写', value: 'string' },
|
|
899
|
+
{ label: '选择', value: 'select' },
|
|
900
|
+
],
|
|
901
|
+
default: 'string',
|
|
902
|
+
isConditionProp: !0,
|
|
903
|
+
description: '在MP后台或资源中心配置时的交互方式,推荐使用"选择"',
|
|
904
|
+
onShow:
|
|
905
|
+
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
906
|
+
},
|
|
907
|
+
range: {
|
|
908
|
+
type: 'select',
|
|
909
|
+
title: '可选项',
|
|
910
|
+
multiple: !0,
|
|
911
|
+
options: [],
|
|
912
|
+
onShow:
|
|
913
|
+
'(type === "ContentStaticConfig" || type === "ResourceCenter") && valueType === "select"',
|
|
914
|
+
description: '这里会使用value中的配置选项作为options',
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
propertyOrder: ['type', 'value', 'description', 'valueType', 'range'],
|
|
918
|
+
showCodeViewBtn: !1,
|
|
919
|
+
},
|
|
920
|
+
'dynamic-object': {
|
|
921
|
+
type: 'dynamic-object',
|
|
922
|
+
title: '动态配置',
|
|
923
|
+
description: '',
|
|
924
|
+
isContainer: !1,
|
|
925
|
+
properties: {
|
|
926
|
+
type: {
|
|
927
|
+
type: 'select',
|
|
928
|
+
title: '数据来源',
|
|
929
|
+
options: [
|
|
930
|
+
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
931
|
+
{ label: 'mp后台配置', value: 'ContentStaticConfig' },
|
|
932
|
+
{ label: '内容Meta数据', value: 'Content' },
|
|
933
|
+
{ label: '全局配置数据', value: 'RuntimeConst' },
|
|
934
|
+
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
935
|
+
],
|
|
936
|
+
default: 'DevDefaults',
|
|
937
|
+
isConditionProp: !0,
|
|
938
|
+
description:
|
|
939
|
+
'目前支持的数据来源包括: 1)模版直接设置: 在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置: 选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据: 支持内容meta数据的获取,页面meta数据。 4)全局配置数据: 目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst',
|
|
940
|
+
},
|
|
941
|
+
value: {
|
|
942
|
+
title: '数据值',
|
|
943
|
+
type: 'input',
|
|
944
|
+
default: '',
|
|
945
|
+
description: '',
|
|
946
|
+
placeholder: '',
|
|
947
|
+
onShow: 'type === "Content" || type === "RuntimeConst"',
|
|
948
|
+
},
|
|
949
|
+
description: {
|
|
950
|
+
title: '自定义配置名称',
|
|
951
|
+
type: 'input',
|
|
952
|
+
default: '主题包配置',
|
|
953
|
+
description: '',
|
|
954
|
+
placeholder: '',
|
|
955
|
+
onShow:
|
|
956
|
+
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
957
|
+
},
|
|
958
|
+
attrs: {
|
|
959
|
+
type: 'array',
|
|
960
|
+
title: '属性列表',
|
|
961
|
+
description: 'Tab需要配置的属性',
|
|
962
|
+
items: {
|
|
963
|
+
type: 'object',
|
|
964
|
+
title: '数组项',
|
|
965
|
+
description: '',
|
|
966
|
+
properties: {
|
|
967
|
+
attr: {
|
|
968
|
+
type: 'input',
|
|
969
|
+
title: '属性Key',
|
|
970
|
+
default: '',
|
|
971
|
+
description: '',
|
|
972
|
+
placeholder: '',
|
|
973
|
+
},
|
|
974
|
+
description: {
|
|
975
|
+
title: '描述',
|
|
976
|
+
type: 'input',
|
|
977
|
+
default: '',
|
|
978
|
+
description: '',
|
|
979
|
+
placeholder: '',
|
|
980
|
+
},
|
|
981
|
+
value: {
|
|
982
|
+
title: '数值',
|
|
983
|
+
typeOn:
|
|
984
|
+
"type === 'image' ? 'input-image' : type === 'number' ? 'number' : 'input'",
|
|
985
|
+
default: '',
|
|
986
|
+
description: '',
|
|
987
|
+
placeholder: '',
|
|
988
|
+
},
|
|
989
|
+
type: {
|
|
990
|
+
type: 'select',
|
|
991
|
+
title: '属性类型',
|
|
992
|
+
options: [
|
|
993
|
+
{ label: '图片类型', value: 'image' },
|
|
994
|
+
{ label: '字符串', value: 'string' },
|
|
995
|
+
{ label: '数字', value: 'number' },
|
|
996
|
+
],
|
|
997
|
+
default: 'string',
|
|
998
|
+
description: '',
|
|
999
|
+
},
|
|
1000
|
+
},
|
|
1001
|
+
propertyOrder: ['attr', 'description', 'type', 'value'],
|
|
1002
|
+
},
|
|
1003
|
+
'minimum-child': 1,
|
|
1004
|
+
showCodeViewBtn: !1,
|
|
1005
|
+
onShow:
|
|
1006
|
+
'type === "DevDefaults" || type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
1007
|
+
},
|
|
1008
|
+
},
|
|
1009
|
+
propertyOrder: ['type', 'description', 'attrs', 'value'],
|
|
1010
|
+
showCodeViewBtn: !1,
|
|
1011
|
+
showKey: !0,
|
|
1012
|
+
},
|
|
1013
|
+
'dynamic-array': {
|
|
1014
|
+
type: 'dynamic-array',
|
|
1015
|
+
title: '动态数组',
|
|
1016
|
+
description: '',
|
|
1017
|
+
isContainer: !1,
|
|
1018
|
+
properties: {
|
|
1019
|
+
type: {
|
|
1020
|
+
type: 'select',
|
|
1021
|
+
title: '数据来源',
|
|
1022
|
+
options: [
|
|
1023
|
+
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
1024
|
+
{ label: 'mp后台配置', value: 'ContentStaticConfig' },
|
|
1025
|
+
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
1026
|
+
],
|
|
1027
|
+
default: 'DevDefaults',
|
|
1028
|
+
isConditionProp: !0,
|
|
1029
|
+
description:
|
|
1030
|
+
'目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst',
|
|
1031
|
+
},
|
|
1032
|
+
description: {
|
|
1033
|
+
title: '自定义配置名称',
|
|
1034
|
+
type: 'input',
|
|
1035
|
+
default: 'Tab全局配置',
|
|
1036
|
+
description: '',
|
|
1037
|
+
placeholder: '',
|
|
1038
|
+
onShow:
|
|
1039
|
+
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
1040
|
+
},
|
|
1041
|
+
tabNums: {
|
|
1042
|
+
title: 'Tab配置数',
|
|
1043
|
+
type: 'number',
|
|
1044
|
+
default: 1,
|
|
1045
|
+
description: '需要配置的Tab数量',
|
|
1046
|
+
placeholder: '',
|
|
1047
|
+
onShow:
|
|
1048
|
+
"type === 'ContentStaticConfig' || type === 'ResourceCenter'",
|
|
1049
|
+
},
|
|
1050
|
+
attrs: {
|
|
1051
|
+
type: 'array',
|
|
1052
|
+
title: 'Tab属性',
|
|
1053
|
+
description: 'Tab需要配置的属性',
|
|
1054
|
+
items: {
|
|
1055
|
+
type: 'object',
|
|
1056
|
+
title: '数组项',
|
|
1057
|
+
description: '',
|
|
1058
|
+
properties: {
|
|
1059
|
+
attr: {
|
|
1060
|
+
type: 'input',
|
|
1061
|
+
title: '属性Key',
|
|
1062
|
+
default: '',
|
|
1063
|
+
description: '',
|
|
1064
|
+
placeholder: '',
|
|
1065
|
+
},
|
|
1066
|
+
description: {
|
|
1067
|
+
title: '描述',
|
|
1068
|
+
type: 'input',
|
|
1069
|
+
default: '',
|
|
1070
|
+
description: '',
|
|
1071
|
+
placeholder: '',
|
|
1072
|
+
},
|
|
1073
|
+
},
|
|
1074
|
+
propertyOrder: ['attr', 'description'],
|
|
1075
|
+
},
|
|
1076
|
+
'minimum-child': 1,
|
|
1077
|
+
onShow:
|
|
1078
|
+
"type === 'ContentStaticConfig' || type === 'ResourceCenter'",
|
|
1079
|
+
showCodeViewBtn: !1,
|
|
1080
|
+
},
|
|
1081
|
+
value: {
|
|
1082
|
+
type: 'array',
|
|
1083
|
+
title: 'Tab配置',
|
|
1084
|
+
description: '',
|
|
1085
|
+
items: {
|
|
1086
|
+
type: 'object',
|
|
1087
|
+
title: '数组项',
|
|
1088
|
+
description: '',
|
|
1089
|
+
properties: {
|
|
1090
|
+
title: {
|
|
1091
|
+
type: 'input',
|
|
1092
|
+
title: '名称',
|
|
1093
|
+
default: '',
|
|
1094
|
+
description: '',
|
|
1095
|
+
placeholder: '',
|
|
1096
|
+
},
|
|
1097
|
+
id: {
|
|
1098
|
+
title: 'id',
|
|
1099
|
+
type: 'input',
|
|
1100
|
+
default: '',
|
|
1101
|
+
description: '',
|
|
1102
|
+
placeholder: '',
|
|
1103
|
+
},
|
|
1104
|
+
value: {
|
|
1105
|
+
title: '数值',
|
|
1106
|
+
type: 'input',
|
|
1107
|
+
default: '',
|
|
1108
|
+
description: '',
|
|
1109
|
+
placeholder: '',
|
|
1110
|
+
},
|
|
1111
|
+
},
|
|
1112
|
+
propertyOrder: ['title', 'value', 'id'],
|
|
1113
|
+
},
|
|
1114
|
+
'minimum-child': 1,
|
|
1115
|
+
onShow: "type === 'DevDefaults'",
|
|
1116
|
+
showCodeViewBtn: !1,
|
|
1117
|
+
},
|
|
1118
|
+
},
|
|
1119
|
+
propertyOrder: ['type', 'value', 'description', 'tabNums', 'attrs'],
|
|
1120
|
+
showCodeViewBtn: !1,
|
|
1121
|
+
showKey: !0,
|
|
1122
|
+
},
|
|
1123
|
+
'sohu-source': {
|
|
1124
|
+
type: 'sohu-source',
|
|
1125
|
+
title: '数据源',
|
|
1126
|
+
description: '',
|
|
1127
|
+
isContainer: !1,
|
|
1128
|
+
properties: {
|
|
1129
|
+
mainConfig: {
|
|
1130
|
+
type: 'object',
|
|
1131
|
+
title: '主要配置',
|
|
1132
|
+
description: '',
|
|
1133
|
+
isContainer: !1,
|
|
1134
|
+
properties: {
|
|
1135
|
+
type: {
|
|
1136
|
+
type: 'select',
|
|
1137
|
+
title: '数据来源',
|
|
1138
|
+
isConditionProp: !0,
|
|
1139
|
+
options: [
|
|
1140
|
+
{
|
|
1141
|
+
label: '模板自定义数据源',
|
|
1142
|
+
value: 'RuntimeDataSelfDefine',
|
|
1143
|
+
},
|
|
1144
|
+
{ label: 'mp后台配置', value: 'ContentStaticConfig' },
|
|
1145
|
+
{
|
|
1146
|
+
label: '请求当前页面数据',
|
|
1147
|
+
value: 'RuntimeDataSelfContent',
|
|
1148
|
+
},
|
|
1149
|
+
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
1150
|
+
],
|
|
1151
|
+
default: 'RuntimeDataSelfDefine',
|
|
1152
|
+
description: '',
|
|
1153
|
+
},
|
|
1154
|
+
description: {
|
|
1155
|
+
title: '数据源名称',
|
|
1156
|
+
type: 'input',
|
|
1157
|
+
description: '',
|
|
1158
|
+
placeholder: '',
|
|
1159
|
+
onShow: 'type === "ContentStaticConfig"',
|
|
1160
|
+
},
|
|
1161
|
+
dataType: {
|
|
1162
|
+
type: 'radio',
|
|
1163
|
+
title: '请求方式',
|
|
1164
|
+
default: !1,
|
|
1165
|
+
options: [
|
|
1166
|
+
{ label: '批量请求', value: 'FROMCIS' },
|
|
1167
|
+
{ label: '组件内部请求', value: 'FROMCOMPCIS' },
|
|
1168
|
+
{ label: '不请求', value: !1 },
|
|
1169
|
+
],
|
|
1170
|
+
description: '',
|
|
1171
|
+
},
|
|
1172
|
+
CONTENTID: {
|
|
1173
|
+
title: '数据源ID',
|
|
1174
|
+
type: 'input',
|
|
1175
|
+
description: '',
|
|
1176
|
+
placeholder: '',
|
|
1177
|
+
onShow: 'type === "RuntimeDataSelfDefine"',
|
|
1178
|
+
},
|
|
1179
|
+
CONTENTTYPE: {
|
|
1180
|
+
type: 'select',
|
|
1181
|
+
title: '数据源类型',
|
|
1182
|
+
options: [
|
|
1183
|
+
{ label: 'channel', value: 'channel' },
|
|
1184
|
+
{ label: 'topic', value: 'topic' },
|
|
1185
|
+
{ label: 'block', value: 'block' },
|
|
1186
|
+
],
|
|
1187
|
+
description: '',
|
|
1188
|
+
onShow: 'type === "RuntimeDataSelfDefine"',
|
|
1189
|
+
},
|
|
1190
|
+
},
|
|
1191
|
+
propertyOrder: [
|
|
1192
|
+
'type',
|
|
1193
|
+
'description',
|
|
1194
|
+
'dataType',
|
|
1195
|
+
'CONTENTID',
|
|
1196
|
+
'CONTENTTYPE',
|
|
1197
|
+
],
|
|
1198
|
+
showCodeViewBtn: !1,
|
|
1199
|
+
},
|
|
1200
|
+
outConfig: {
|
|
1201
|
+
type: 'object',
|
|
1202
|
+
title: '出流配置',
|
|
1203
|
+
description: '',
|
|
1204
|
+
isContainer: !1,
|
|
1205
|
+
properties: {
|
|
1206
|
+
PRO: {
|
|
1207
|
+
type: 'select',
|
|
1208
|
+
title: '内容类型',
|
|
1209
|
+
options: [
|
|
1210
|
+
{ label: '置顶+加精', value: '4' },
|
|
1211
|
+
{ label: '长效置顶', value: '5' },
|
|
1212
|
+
],
|
|
1213
|
+
description: '',
|
|
1214
|
+
},
|
|
1215
|
+
FEEDTYPE: {
|
|
1216
|
+
type: 'select',
|
|
1217
|
+
title: '排序类型',
|
|
1218
|
+
options: [
|
|
1219
|
+
{ label: '综合', value: 'XTOPIC_SYNTHETICAL' },
|
|
1220
|
+
{ label: '最新', value: 'XTOPIC_LATEST' },
|
|
1221
|
+
{ label: '相关', value: 'XTOPIC_RELATED' },
|
|
1222
|
+
],
|
|
1223
|
+
description: '',
|
|
1224
|
+
},
|
|
1225
|
+
VIEW: {
|
|
1226
|
+
type: 'select',
|
|
1227
|
+
title: '数据裁剪',
|
|
1228
|
+
options: [
|
|
1229
|
+
{ label: '相关推荐模式', value: 'articleFeedMode' },
|
|
1230
|
+
{ label: '文字链裁剪方式', value: 'textMode' },
|
|
1231
|
+
{ label: '短内容摘录方式', value: 'excerptMode' },
|
|
1232
|
+
{
|
|
1233
|
+
label: '互动(点赞/评论)裁剪方式',
|
|
1234
|
+
value: 'interactMode',
|
|
1235
|
+
},
|
|
1236
|
+
{ label: '评论文字链裁剪方式', value: 'commentTextMode' },
|
|
1237
|
+
{
|
|
1238
|
+
label: '摘录方式(无点赞)',
|
|
1239
|
+
value: 'excerptCommentMode',
|
|
1240
|
+
},
|
|
1241
|
+
{ label: '无限流卡片模式', value: 'dynamicFeedMode' },
|
|
1242
|
+
{ label: '时间线模式', value: 'timeLineMode' },
|
|
1243
|
+
{ label: '复合内容流模式', value: 'multiFeedMode' },
|
|
1244
|
+
{ label: '搜狐号推荐模式', value: 'recommendFeedMode' },
|
|
1245
|
+
{ label: '作者页内容流模式', value: 'operateFeedMode' },
|
|
1246
|
+
{ label: '标签内容流模式', value: 'tagsFeedMode' },
|
|
1247
|
+
{ label: '评论链裁剪方式', value: 'commentMode' },
|
|
1248
|
+
{ label: '标签摘录方式', value: 'excerptTagsMode' },
|
|
1249
|
+
{ label: '内容流模式', value: 'feedMode' },
|
|
1250
|
+
],
|
|
1251
|
+
description: '',
|
|
1252
|
+
},
|
|
1253
|
+
CONTENTCONTEXT: {
|
|
1254
|
+
type: 'select',
|
|
1255
|
+
title: 'mKey参数',
|
|
1256
|
+
options: [
|
|
1257
|
+
{
|
|
1258
|
+
label: '作者ID+栏目ID',
|
|
1259
|
+
value: 'authorColumnId_${#authorColumnId}',
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
label: '账号ID',
|
|
1263
|
+
value: 'accountId_${#contentData_account_id}',
|
|
1264
|
+
},
|
|
1265
|
+
{ label: 'mkeyID', value: 'mid_${#mkeyConst_mid}' },
|
|
1266
|
+
{ label: 'mkey名称', value: 'mname_${#mkeyConst_mname}' },
|
|
1267
|
+
{
|
|
1268
|
+
label: '城市Code码',
|
|
1269
|
+
value: 'cityCode_${#cityInfo_cityCode}',
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
label: '城市名称',
|
|
1273
|
+
value: 'cityName_${#cityInfo_cityName}',
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
label: '焦点城市Code码',
|
|
1277
|
+
value: 'focusCityCode_${#focusCityInfo_cityCode}',
|
|
1278
|
+
},
|
|
1279
|
+
],
|
|
1280
|
+
description: '',
|
|
1281
|
+
},
|
|
1282
|
+
CONTENTPARAMS: {
|
|
1283
|
+
title: '动态参数',
|
|
1284
|
+
type: 'json',
|
|
1285
|
+
description: '请填写JSON格式的参数',
|
|
1286
|
+
placeholder: '',
|
|
1287
|
+
},
|
|
1288
|
+
},
|
|
1289
|
+
propertyOrder: [
|
|
1290
|
+
'PRO',
|
|
1291
|
+
'FEEDTYPE',
|
|
1292
|
+
'VIEW',
|
|
1293
|
+
'CONTENTCONTEXT',
|
|
1294
|
+
'CONTENTPARAMS',
|
|
1295
|
+
],
|
|
1296
|
+
showCodeViewBtn: !1,
|
|
1297
|
+
},
|
|
1298
|
+
otherConfig: {
|
|
1299
|
+
type: 'object',
|
|
1300
|
+
title: '选配内容',
|
|
1301
|
+
description: '',
|
|
1302
|
+
isContainer: !1,
|
|
1303
|
+
properties: {
|
|
1304
|
+
SIZE: {
|
|
1305
|
+
type: 'number',
|
|
1306
|
+
title: '容量',
|
|
1307
|
+
minimum: 0,
|
|
1308
|
+
maximum: 1e3,
|
|
1309
|
+
description: '该位置区块需要的内容条数',
|
|
1310
|
+
},
|
|
1311
|
+
TITLE: {
|
|
1312
|
+
title: '标题',
|
|
1313
|
+
type: 'input',
|
|
1314
|
+
description: '',
|
|
1315
|
+
placeholder: '',
|
|
1316
|
+
},
|
|
1317
|
+
URL: {
|
|
1318
|
+
type: 'url',
|
|
1319
|
+
title: '更多跳转链接',
|
|
1320
|
+
description: '该区块下点击“更多或箭头图标”后的跳转链接',
|
|
1321
|
+
placeholder: '',
|
|
1322
|
+
},
|
|
1323
|
+
CODE: {
|
|
1324
|
+
title: 'Code参数',
|
|
1325
|
+
type: 'input',
|
|
1326
|
+
description: '',
|
|
1327
|
+
placeholder: '',
|
|
1328
|
+
onShow: !1,
|
|
1329
|
+
},
|
|
1330
|
+
},
|
|
1331
|
+
propertyOrder: ['SIZE', 'TITLE', 'URL', 'CODE'],
|
|
1332
|
+
showCodeViewBtn: !1,
|
|
1333
|
+
},
|
|
1334
|
+
},
|
|
1335
|
+
propertyOrder: ['mainConfig', 'otherConfig', 'outConfig'],
|
|
1336
|
+
showCodeViewBtn: !1,
|
|
1337
|
+
},
|
|
1338
|
+
'sohu-event': {
|
|
1339
|
+
type: 'sohu-event',
|
|
1340
|
+
title: 'sohu组件事件',
|
|
1341
|
+
showCodeViewBtn: !1,
|
|
1342
|
+
isContainer: !1,
|
|
1343
|
+
properties: {
|
|
1344
|
+
globalEventMap: {
|
|
1345
|
+
type: 'object',
|
|
1346
|
+
title: '全局事件Map',
|
|
1347
|
+
description: '',
|
|
1348
|
+
properties: {
|
|
1349
|
+
eventCode: {
|
|
1350
|
+
type: 'input',
|
|
1351
|
+
title: '事件名称',
|
|
1352
|
+
default: '',
|
|
1353
|
+
description: '',
|
|
1354
|
+
placeholder: '',
|
|
1355
|
+
readOnly: !0,
|
|
1356
|
+
},
|
|
1357
|
+
},
|
|
1358
|
+
propertyOrder: ['eventCode'],
|
|
1359
|
+
showCodeViewBtn: !1,
|
|
1360
|
+
},
|
|
1361
|
+
event: {
|
|
1362
|
+
type: 'array',
|
|
1363
|
+
title: '监听事件',
|
|
1364
|
+
description: '当前组件监听事件列表',
|
|
1365
|
+
default: [],
|
|
1366
|
+
items: {
|
|
1367
|
+
type: 'object',
|
|
1368
|
+
title: '数组项',
|
|
1369
|
+
description: '',
|
|
1370
|
+
properties: {
|
|
1371
|
+
name: {
|
|
1372
|
+
type: 'input',
|
|
1373
|
+
title: '事件',
|
|
1374
|
+
default: '',
|
|
1375
|
+
description: '',
|
|
1376
|
+
placeholder: '',
|
|
1377
|
+
},
|
|
1378
|
+
code: {
|
|
1379
|
+
title: '事件code',
|
|
1380
|
+
type: 'input',
|
|
1381
|
+
default: '',
|
|
1382
|
+
description: '',
|
|
1383
|
+
placeholder: '',
|
|
1384
|
+
},
|
|
1385
|
+
listenName: {
|
|
1386
|
+
title: '事件名称',
|
|
1387
|
+
type: 'input',
|
|
1388
|
+
default: '',
|
|
1389
|
+
description: '',
|
|
1390
|
+
placeholder: '',
|
|
1391
|
+
},
|
|
1392
|
+
desc: {
|
|
1393
|
+
title: '事件描述',
|
|
1394
|
+
type: 'input',
|
|
1395
|
+
default: '',
|
|
1396
|
+
description: '',
|
|
1397
|
+
placeholder: '',
|
|
1398
|
+
},
|
|
1399
|
+
},
|
|
1400
|
+
propertyOrder: ['name', 'code', 'listenName', 'desc'],
|
|
1401
|
+
},
|
|
1402
|
+
showCodeViewBtn: !1,
|
|
1403
|
+
},
|
|
1404
|
+
},
|
|
1405
|
+
propertyOrder: ['globalEventMap', 'event'],
|
|
1406
|
+
},
|
|
1407
|
+
'sohu-ad': {
|
|
1408
|
+
type: 'object',
|
|
1409
|
+
title: '广告配置',
|
|
1410
|
+
description: '',
|
|
1411
|
+
properties: {
|
|
1412
|
+
type: {
|
|
1413
|
+
type: 'select',
|
|
1414
|
+
title: '数据源类型',
|
|
1415
|
+
isConditionProp: !0,
|
|
1416
|
+
options: [
|
|
1417
|
+
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
1418
|
+
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
1419
|
+
],
|
|
1420
|
+
description: '',
|
|
1421
|
+
},
|
|
1422
|
+
value: {
|
|
1423
|
+
type: 'object',
|
|
1424
|
+
title: '广告规则',
|
|
1425
|
+
description: '',
|
|
1426
|
+
onShow: 'type === "DevDefaults"',
|
|
1427
|
+
properties: {
|
|
1428
|
+
id: {
|
|
1429
|
+
title: '广告ID',
|
|
1430
|
+
type: 'number',
|
|
1431
|
+
description: '',
|
|
1432
|
+
placeholder: '',
|
|
1433
|
+
},
|
|
1434
|
+
rule: {
|
|
1435
|
+
type: 'radio',
|
|
1436
|
+
title: '规则类型',
|
|
1437
|
+
isConditionProp: !0,
|
|
1438
|
+
options: [
|
|
1439
|
+
{ label: '固定位置', value: 1 },
|
|
1440
|
+
{ label: '隔几出几', value: 2 },
|
|
1441
|
+
{ label: '固定位置隔几出几', value: 3 },
|
|
1442
|
+
],
|
|
1443
|
+
description: '',
|
|
1444
|
+
},
|
|
1445
|
+
fixArray: {
|
|
1446
|
+
type: 'select',
|
|
1447
|
+
title: '固定位置',
|
|
1448
|
+
description: '',
|
|
1449
|
+
multiple: !0,
|
|
1450
|
+
onShow: 'rule === 1 || rule === 3',
|
|
1451
|
+
options: [
|
|
1452
|
+
{ label: '1', value: 1 },
|
|
1453
|
+
{ label: '2', value: 2 },
|
|
1454
|
+
{ label: '3', value: 3 },
|
|
1455
|
+
{ label: '4', value: 4 },
|
|
1456
|
+
{ label: '5', value: 5 },
|
|
1457
|
+
{ label: '6', value: 6 },
|
|
1458
|
+
{ label: '7', value: 7 },
|
|
1459
|
+
{ label: '8', value: 8 },
|
|
1460
|
+
{ label: '9', value: 9 },
|
|
1461
|
+
{ label: '10', value: 10 },
|
|
1462
|
+
{ label: '11', value: 11 },
|
|
1463
|
+
{ label: '12', value: 12 },
|
|
1464
|
+
{ label: '13', value: 13 },
|
|
1465
|
+
{ label: '14', value: 14 },
|
|
1466
|
+
{ label: '15', value: 15 },
|
|
1467
|
+
{ label: '16', value: 16 },
|
|
1468
|
+
{ label: '17', value: 17 },
|
|
1469
|
+
{ label: '18', value: 18 },
|
|
1470
|
+
{ label: '19', value: 19 },
|
|
1471
|
+
{ label: '20', value: 20 },
|
|
1472
|
+
{ label: '21', value: 21 },
|
|
1473
|
+
{ label: '22', value: 22 },
|
|
1474
|
+
{ label: '23', value: 23 },
|
|
1475
|
+
{ label: '24', value: 24 },
|
|
1476
|
+
{ label: '25', value: 25 },
|
|
1477
|
+
{ label: '26', value: 26 },
|
|
1478
|
+
{ label: '27', value: 27 },
|
|
1479
|
+
{ label: '28', value: 28 },
|
|
1480
|
+
{ label: '29', value: 29 },
|
|
1481
|
+
{ label: '30', value: 30 },
|
|
1482
|
+
{ label: '31', value: 31 },
|
|
1483
|
+
{ label: '32', value: 32 },
|
|
1484
|
+
{ label: '33', value: 33 },
|
|
1485
|
+
{ label: '34', value: 34 },
|
|
1486
|
+
{ label: '35', value: 35 },
|
|
1487
|
+
{ label: '36', value: 36 },
|
|
1488
|
+
{ label: '37', value: 37 },
|
|
1489
|
+
{ label: '38', value: 38 },
|
|
1490
|
+
{ label: '39', value: 39 },
|
|
1491
|
+
{ label: '40', value: 40 },
|
|
1492
|
+
{ label: '41', value: 41 },
|
|
1493
|
+
{ label: '42', value: 42 },
|
|
1494
|
+
{ label: '43', value: 43 },
|
|
1495
|
+
{ label: '44', value: 44 },
|
|
1496
|
+
{ label: '45', value: 45 },
|
|
1497
|
+
{ label: '46', value: 46 },
|
|
1498
|
+
{ label: '47', value: 47 },
|
|
1499
|
+
{ label: '48', value: 48 },
|
|
1500
|
+
{ label: '49', value: 49 },
|
|
1501
|
+
{ label: '50', value: 50 },
|
|
1502
|
+
],
|
|
1503
|
+
},
|
|
1504
|
+
begin: {
|
|
1505
|
+
type: 'number',
|
|
1506
|
+
title: '开始位置',
|
|
1507
|
+
minimum: '1',
|
|
1508
|
+
maximum: '50',
|
|
1509
|
+
description: '',
|
|
1510
|
+
onShow: 'rule === 2 || rule === 3',
|
|
1511
|
+
},
|
|
1512
|
+
turn: {
|
|
1513
|
+
type: 'number',
|
|
1514
|
+
title: '间隔/隔',
|
|
1515
|
+
minimum: '1',
|
|
1516
|
+
maximum: '50',
|
|
1517
|
+
description: '',
|
|
1518
|
+
onShow: 'rule === 2 || rule === 3',
|
|
1519
|
+
},
|
|
1520
|
+
number: {
|
|
1521
|
+
type: 'number',
|
|
1522
|
+
title: '间隔/出',
|
|
1523
|
+
minimum: '1',
|
|
1524
|
+
maximum: '50',
|
|
1525
|
+
description: '',
|
|
1526
|
+
onShow: 'rule === 2 || rule === 3',
|
|
1527
|
+
},
|
|
1528
|
+
mergeType: {
|
|
1529
|
+
type: 'radio',
|
|
1530
|
+
title: '插入规则',
|
|
1531
|
+
options: [
|
|
1532
|
+
{ label: '覆盖', value: 0 },
|
|
1533
|
+
{ label: '插入', value: 1 },
|
|
1534
|
+
],
|
|
1535
|
+
description: '',
|
|
1536
|
+
},
|
|
1537
|
+
},
|
|
1538
|
+
propertyOrder: [
|
|
1539
|
+
'id',
|
|
1540
|
+
'rule',
|
|
1541
|
+
'fixArray',
|
|
1542
|
+
'begin',
|
|
1543
|
+
'turn',
|
|
1544
|
+
'number',
|
|
1545
|
+
'mergeType',
|
|
1546
|
+
],
|
|
1547
|
+
},
|
|
1548
|
+
range: {
|
|
1549
|
+
type: 'array',
|
|
1550
|
+
title: '广告规则列表',
|
|
1551
|
+
description: '',
|
|
1552
|
+
onShow: 'type === "ResourceCenter"',
|
|
1553
|
+
items: {
|
|
1554
|
+
type: 'object',
|
|
1555
|
+
title: '数组项',
|
|
1556
|
+
description: '',
|
|
1557
|
+
properties: {
|
|
1558
|
+
rule: {
|
|
1559
|
+
type: 'radio',
|
|
1560
|
+
title: '规则类型',
|
|
1561
|
+
isConditionProp: !0,
|
|
1562
|
+
options: [
|
|
1563
|
+
{ label: '固定位置', value: 1 },
|
|
1564
|
+
{ label: '隔几出几', value: 2 },
|
|
1565
|
+
{ label: '固定位置隔几出几', value: 3 },
|
|
1566
|
+
],
|
|
1567
|
+
description: '',
|
|
1568
|
+
},
|
|
1569
|
+
fixArray: {
|
|
1570
|
+
type: 'select',
|
|
1571
|
+
title: '固定位置',
|
|
1572
|
+
description: '',
|
|
1573
|
+
onShow: 'rule === 1 || rule === 3',
|
|
1574
|
+
multiple: !0,
|
|
1575
|
+
options: [
|
|
1576
|
+
{ label: '1', value: 1 },
|
|
1577
|
+
{ label: '2', value: 2 },
|
|
1578
|
+
{ label: '3', value: 3 },
|
|
1579
|
+
{ label: '4', value: 4 },
|
|
1580
|
+
{ label: '5', value: 5 },
|
|
1581
|
+
{ label: '6', value: 6 },
|
|
1582
|
+
{ label: '7', value: 7 },
|
|
1583
|
+
{ label: '8', value: 8 },
|
|
1584
|
+
{ label: '9', value: 9 },
|
|
1585
|
+
{ label: '10', value: 10 },
|
|
1586
|
+
{ label: '11', value: 11 },
|
|
1587
|
+
{ label: '12', value: 12 },
|
|
1588
|
+
{ label: '13', value: 13 },
|
|
1589
|
+
{ label: '14', value: 14 },
|
|
1590
|
+
{ label: '15', value: 15 },
|
|
1591
|
+
{ label: '16', value: 16 },
|
|
1592
|
+
{ label: '17', value: 17 },
|
|
1593
|
+
{ label: '18', value: 18 },
|
|
1594
|
+
{ label: '19', value: 19 },
|
|
1595
|
+
{ label: '20', value: 20 },
|
|
1596
|
+
{ label: '21', value: 21 },
|
|
1597
|
+
{ label: '22', value: 22 },
|
|
1598
|
+
{ label: '23', value: 23 },
|
|
1599
|
+
{ label: '24', value: 24 },
|
|
1600
|
+
{ label: '25', value: 25 },
|
|
1601
|
+
{ label: '26', value: 26 },
|
|
1602
|
+
{ label: '27', value: 27 },
|
|
1603
|
+
{ label: '28', value: 28 },
|
|
1604
|
+
{ label: '29', value: 29 },
|
|
1605
|
+
{ label: '30', value: 30 },
|
|
1606
|
+
{ label: '31', value: 31 },
|
|
1607
|
+
{ label: '32', value: 32 },
|
|
1608
|
+
{ label: '33', value: 33 },
|
|
1609
|
+
{ label: '34', value: 34 },
|
|
1610
|
+
{ label: '35', value: 35 },
|
|
1611
|
+
{ label: '36', value: 36 },
|
|
1612
|
+
{ label: '37', value: 37 },
|
|
1613
|
+
{ label: '38', value: 38 },
|
|
1614
|
+
{ label: '39', value: 39 },
|
|
1615
|
+
{ label: '40', value: 40 },
|
|
1616
|
+
{ label: '41', value: 41 },
|
|
1617
|
+
{ label: '42', value: 42 },
|
|
1618
|
+
{ label: '43', value: 43 },
|
|
1619
|
+
{ label: '44', value: 44 },
|
|
1620
|
+
{ label: '45', value: 45 },
|
|
1621
|
+
{ label: '46', value: 46 },
|
|
1622
|
+
{ label: '47', value: 47 },
|
|
1623
|
+
{ label: '48', value: 48 },
|
|
1624
|
+
{ label: '49', value: 49 },
|
|
1625
|
+
{ label: '50', value: 50 },
|
|
1626
|
+
],
|
|
1627
|
+
},
|
|
1628
|
+
begin: {
|
|
1629
|
+
type: 'number',
|
|
1630
|
+
title: '开始位置',
|
|
1631
|
+
minimum: '1',
|
|
1632
|
+
maximum: '50',
|
|
1633
|
+
description: '',
|
|
1634
|
+
onShow: 'rule === 2 || rule === 3',
|
|
1635
|
+
},
|
|
1636
|
+
turn: {
|
|
1637
|
+
type: 'number',
|
|
1638
|
+
title: '间隔/隔',
|
|
1639
|
+
minimum: '1',
|
|
1640
|
+
maximum: '50',
|
|
1641
|
+
description: '',
|
|
1642
|
+
onShow: 'rule === 2 || rule === 3',
|
|
1643
|
+
},
|
|
1644
|
+
number: {
|
|
1645
|
+
type: 'number',
|
|
1646
|
+
title: '间隔/出',
|
|
1647
|
+
minimum: '1',
|
|
1648
|
+
maximum: '50',
|
|
1649
|
+
description: '',
|
|
1650
|
+
onShow: 'rule === 2 || rule === 3',
|
|
1651
|
+
},
|
|
1652
|
+
mergeType: {
|
|
1653
|
+
type: 'radio',
|
|
1654
|
+
title: '插入规则',
|
|
1655
|
+
options: [
|
|
1656
|
+
{ label: '覆盖', value: 0 },
|
|
1657
|
+
{ label: '插入', value: 1 },
|
|
1658
|
+
],
|
|
1659
|
+
description: '',
|
|
1660
|
+
},
|
|
1661
|
+
},
|
|
1662
|
+
propertyOrder: [
|
|
1663
|
+
'rule',
|
|
1664
|
+
'fixArray',
|
|
1665
|
+
'begin',
|
|
1666
|
+
'turn',
|
|
1667
|
+
'number',
|
|
1668
|
+
'mergeType',
|
|
1669
|
+
],
|
|
1670
|
+
},
|
|
1671
|
+
},
|
|
1672
|
+
},
|
|
1673
|
+
propertyOrder: ['type', 'value', 'range'],
|
|
1674
|
+
},
|
|
1675
|
+
},
|
|
1676
|
+
S = {
|
|
1677
|
+
on: {
|
|
1678
|
+
type: 'event',
|
|
1679
|
+
title: '事件',
|
|
1680
|
+
isContainer: !1,
|
|
1681
|
+
properties: {
|
|
1682
|
+
type: {
|
|
1683
|
+
default: 'on',
|
|
1684
|
+
type: 'select',
|
|
1685
|
+
options: [
|
|
1686
|
+
{ label: 'on', value: 'on' },
|
|
1687
|
+
{ label: 'emit', value: 'emit' },
|
|
1688
|
+
],
|
|
1689
|
+
title: '事件类型',
|
|
1690
|
+
},
|
|
1691
|
+
register: {
|
|
1692
|
+
type: 'input',
|
|
1693
|
+
default: 'eventName',
|
|
1694
|
+
title: '注册事件',
|
|
1695
|
+
description: '用于输入注册事件的名称',
|
|
1696
|
+
placeholder: '请输入注册事件的名称',
|
|
1697
|
+
},
|
|
1698
|
+
actionFunc: {
|
|
1699
|
+
title: '执行函数',
|
|
1700
|
+
type: 'codearea',
|
|
1701
|
+
default: '() => {}',
|
|
1702
|
+
description: '',
|
|
1703
|
+
},
|
|
1704
|
+
},
|
|
1705
|
+
propertyOrder: ['type', 'register', 'actionFunc'],
|
|
1706
|
+
},
|
|
1707
|
+
emit: h,
|
|
1708
|
+
},
|
|
1709
|
+
x = { local: g, remote: C };
|
|
1710
|
+
function w(e) {
|
|
1711
|
+
return /^http[s]?:\/\/.*/.test(e);
|
|
1712
|
+
}
|
|
1713
|
+
function T(e) {
|
|
1714
|
+
return 'String' === Object.prototype.toString.call(e).slice(8, -1);
|
|
1715
|
+
}
|
|
1716
|
+
function D(e) {
|
|
1717
|
+
return (
|
|
1718
|
+
'number' == typeof e ||
|
|
1719
|
+
'[object Number]' === Object.prototype.toString.call(e)
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
function N(e) {
|
|
1723
|
+
return 'Boolean' === Object.prototype.toString.call(e).slice(8, -1);
|
|
1724
|
+
}
|
|
1725
|
+
function R(e) {
|
|
1726
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(e);
|
|
1727
|
+
}
|
|
1728
|
+
function q(e) {
|
|
1729
|
+
return (
|
|
1730
|
+
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e) ||
|
|
1731
|
+
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)
|
|
1732
|
+
);
|
|
1733
|
+
}
|
|
1734
|
+
function E(e) {
|
|
1735
|
+
return /^\d{2}:\d{2}:\d{2}$/.test(e) || /^\d{2}:\d{2}$/.test(e);
|
|
1736
|
+
}
|
|
1737
|
+
function k(e) {
|
|
1738
|
+
var t = !1;
|
|
1739
|
+
return (
|
|
1740
|
+
'Array' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
|
|
1741
|
+
t
|
|
1742
|
+
);
|
|
1743
|
+
}
|
|
1744
|
+
function F(e) {
|
|
1745
|
+
if (!k(e)) return !1;
|
|
1746
|
+
for (var t = 0, r = e.length; t < r; t++) if (!T(e[t])) return !1;
|
|
1747
|
+
return !0;
|
|
1748
|
+
}
|
|
1749
|
+
function P(e) {
|
|
1750
|
+
var t = !1;
|
|
1751
|
+
return (
|
|
1752
|
+
'Object' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
|
|
1753
|
+
t
|
|
1754
|
+
);
|
|
1755
|
+
}
|
|
1756
|
+
function I(e) {
|
|
1757
|
+
var t = !1;
|
|
1758
|
+
return O.quantity.properties.quantity.enum.indexOf(e) >= 0 && (t = !0), t;
|
|
1759
|
+
}
|
|
1760
|
+
function M(e) {
|
|
1761
|
+
return /^#[0-9a-f]{6}$/.test(e) || /^#[0-9a-f]{3}$/.test(e);
|
|
1762
|
+
}
|
|
1763
|
+
function _(e) {
|
|
1764
|
+
var t = !1;
|
|
1765
|
+
return (
|
|
1766
|
+
'Function' === Object.prototype.toString.call(e).slice(8, -1) &&
|
|
1767
|
+
(t = !0),
|
|
1768
|
+
t
|
|
1769
|
+
);
|
|
1770
|
+
}
|
|
1771
|
+
function A(e) {
|
|
1772
|
+
var t;
|
|
1773
|
+
return (
|
|
1774
|
+
(t =
|
|
1775
|
+
e && P(e)
|
|
1776
|
+
? (function (e) {
|
|
1777
|
+
var t;
|
|
1778
|
+
if (P(e)) {
|
|
1779
|
+
var r = Object.keys(e);
|
|
1780
|
+
e.data && e.filter && 2 === r.length
|
|
1781
|
+
? (t = k(e.data) || P(e.data) ? o(x.local) : o(x.remote))
|
|
1782
|
+
: e.trigger && e.eventData && 2 === r.length
|
|
1783
|
+
? (t = o(S.emit))
|
|
1784
|
+
: e.register && e.actionFunc && 2 === r.length
|
|
1785
|
+
? (t = o(S.on))
|
|
1786
|
+
: e.quantity && I(e.quantity) && 2 === r.length
|
|
1787
|
+
? (t = o(O.quantity))
|
|
1788
|
+
: ((t = o(O['empty-object'])),
|
|
1789
|
+
Object.keys(e).map(function (r) {
|
|
1790
|
+
var i = e[r];
|
|
1791
|
+
t.properties[r] = A(i);
|
|
1792
|
+
}));
|
|
1793
|
+
}
|
|
1794
|
+
return t;
|
|
1795
|
+
})(e)
|
|
1796
|
+
: e && k(e)
|
|
1797
|
+
? (function (e) {
|
|
1798
|
+
var t;
|
|
1799
|
+
if (e && k(e))
|
|
1800
|
+
if (F(e)) {
|
|
1801
|
+
(t = o(O.select)).items.enum = e;
|
|
1802
|
+
var r = t.items.enumextra.length,
|
|
1803
|
+
i = e.length;
|
|
1804
|
+
if (i > r)
|
|
1805
|
+
for (var a = r, l = i; a < l; a++)
|
|
1806
|
+
t.items.enumextra.push('选项' + e(a));
|
|
1807
|
+
} else {
|
|
1808
|
+
t = o(O['empty-array']);
|
|
1809
|
+
var n = A(e[0]);
|
|
1810
|
+
t.items.properties = n.properties;
|
|
1811
|
+
}
|
|
1812
|
+
return t;
|
|
1813
|
+
})(e)
|
|
1814
|
+
: (function (e) {
|
|
1815
|
+
var t = '';
|
|
1816
|
+
if (N(e)) t = o(O.boolean);
|
|
1817
|
+
else if (D(e)) t = o(O.number);
|
|
1818
|
+
else if (w(e)) t = o(O.url);
|
|
1819
|
+
else if (R(e)) t = o(O.date);
|
|
1820
|
+
else if (q(e)) t = o(O['date-time']);
|
|
1821
|
+
else if (E(e)) t = o(O.time);
|
|
1822
|
+
else if (M(e)) t = o(O.color);
|
|
1823
|
+
else
|
|
1824
|
+
try {
|
|
1825
|
+
t = D(JSON.parse(e)) ? o(O.input) : o(O.json);
|
|
1826
|
+
} catch (r) {
|
|
1827
|
+
t = e && e.length > 30 ? o(O.textarea) : o(O.input);
|
|
1828
|
+
}
|
|
1829
|
+
return t;
|
|
1830
|
+
})(e)),
|
|
1831
|
+
t
|
|
1832
|
+
);
|
|
1833
|
+
}
|
|
1834
|
+
function B(e, t) {
|
|
1835
|
+
var r = t || {};
|
|
1836
|
+
return (
|
|
1837
|
+
P(e) &&
|
|
1838
|
+
'object' === getExpectType(e.type) &&
|
|
1839
|
+
e.properties &&
|
|
1840
|
+
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
1841
|
+
function (t) {
|
|
1842
|
+
var i = e.properties[t];
|
|
1843
|
+
r = V(i, r);
|
|
1844
|
+
},
|
|
1845
|
+
),
|
|
1846
|
+
r
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
function V(e, t) {
|
|
1850
|
+
var r = !t,
|
|
1851
|
+
i = t || {};
|
|
1852
|
+
if (e && '{}' !== JSON.stringify(e)) {
|
|
1853
|
+
var a = e.type;
|
|
1854
|
+
'object' === a || 'func' === a || 'style' === a || 'data' === a
|
|
1855
|
+
? (!r && i.object ? (i.object += 1) : r || (i.object = 1),
|
|
1856
|
+
(i = B(e, i)))
|
|
1857
|
+
: 'array' === a
|
|
1858
|
+
? (!r && i.array ? (i.array += 1) : r || (i.array = 1),
|
|
1859
|
+
(i = B((e = e.items), i)))
|
|
1860
|
+
: !r && i[a]
|
|
1861
|
+
? (i[a] += 1)
|
|
1862
|
+
: r || (i[a] = 1);
|
|
1863
|
+
}
|
|
1864
|
+
return i;
|
|
1865
|
+
}
|
|
1866
|
+
function L(e) {
|
|
1867
|
+
var t = o(e);
|
|
1868
|
+
if (
|
|
1869
|
+
(!t.title && t.description && (t.title = t.description),
|
|
1870
|
+
t.type || (t.type = t.format),
|
|
1871
|
+
('quantity' !== t.type &&
|
|
1872
|
+
'array' !== t.type &&
|
|
1873
|
+
'datasource' !== t.type &&
|
|
1874
|
+
'event' !== t.type &&
|
|
1875
|
+
'object' !== t.type) ||
|
|
1876
|
+
!u(t.default) ||
|
|
1877
|
+
delete t.default,
|
|
1878
|
+
'radio' === t.type &&
|
|
1879
|
+
((t.type = 'string'),
|
|
1880
|
+
t.enum &&
|
|
1881
|
+
t.enumextra &&
|
|
1882
|
+
((t.items = {
|
|
1883
|
+
type: 'string',
|
|
1884
|
+
enum: o(t.enum),
|
|
1885
|
+
enumextra: o(t.enumextra),
|
|
1886
|
+
}),
|
|
1887
|
+
delete t.enum,
|
|
1888
|
+
delete t.enumextra)),
|
|
1889
|
+
'quantity' === t.type)
|
|
1890
|
+
) {
|
|
1891
|
+
var r = t.properties,
|
|
1892
|
+
i = o(O.quantity);
|
|
1893
|
+
if (r.quantity && P(r.quantity) && r.quantity.default) {
|
|
1894
|
+
var a = r.quantity.default;
|
|
1895
|
+
i.properties.quantity.default = 'percent' === a ? '%' : a;
|
|
1896
|
+
}
|
|
1897
|
+
t = i;
|
|
1898
|
+
}
|
|
1899
|
+
if ('datasource' === t.type) {
|
|
1900
|
+
var l = t.properties,
|
|
1901
|
+
n = l.type && l.type.default,
|
|
1902
|
+
p = l.data && l.data.default,
|
|
1903
|
+
c = l.filter && l.filter.default;
|
|
1904
|
+
'local' === n
|
|
1905
|
+
? ((t = o(x.local)).properties.data.default = p ? o(p) : '{}')
|
|
1906
|
+
: ((t = o(x.remote)).properties.data.default = p
|
|
1907
|
+
? o(p)
|
|
1908
|
+
: 'http://xxx'),
|
|
1909
|
+
(t.properties.filter.default = c ? o(c) : '() => {}');
|
|
1910
|
+
}
|
|
1911
|
+
if ('event' === t.type) {
|
|
1912
|
+
var s = t.properties,
|
|
1913
|
+
d = s.type && s.type.default;
|
|
1914
|
+
if ('in' === d || 'on' === d) {
|
|
1915
|
+
var y = (s.filter && s.filter.default) || '() => {}';
|
|
1916
|
+
(t = o(S.on)),
|
|
1917
|
+
s.actionFunc &&
|
|
1918
|
+
P(s.actionFunc) &&
|
|
1919
|
+
(t.properties.actionFunc.default = s.actionFunc.default || o(y));
|
|
1920
|
+
} else {
|
|
1921
|
+
var f = (s.filter && s.filter.default) || '{}';
|
|
1922
|
+
(t = o(S.emit)),
|
|
1923
|
+
s.eventData &&
|
|
1924
|
+
P(s.eventData) &&
|
|
1925
|
+
(t.properties.eventData.default = s.eventData.default || o(f));
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
return (
|
|
1929
|
+
t.properties &&
|
|
1930
|
+
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
1931
|
+
t.propertyOrder.map(function (e) {
|
|
1932
|
+
t.properties[e] = $(t.properties[e]);
|
|
1933
|
+
})),
|
|
1934
|
+
t.items && (t.items = $(t.items)),
|
|
1935
|
+
t
|
|
1936
|
+
);
|
|
1937
|
+
}
|
|
1938
|
+
function $(e) {
|
|
1939
|
+
var t = o(e);
|
|
1940
|
+
return (
|
|
1941
|
+
t.required || delete t.required,
|
|
1942
|
+
t.type && t.type && (t.type = t.type),
|
|
1943
|
+
('quantity' !== t.type &&
|
|
1944
|
+
'array' !== t.type &&
|
|
1945
|
+
'datasource' !== t.type &&
|
|
1946
|
+
'event' !== t.type &&
|
|
1947
|
+
'object' !== t.type) ||
|
|
1948
|
+
!u(t.default) ||
|
|
1949
|
+
delete t.default,
|
|
1950
|
+
('radio' !== t.type &&
|
|
1951
|
+
'checkboxes' !== t.type &&
|
|
1952
|
+
'select' !== t.type) ||
|
|
1953
|
+
(t.items &&
|
|
1954
|
+
t.items.enum &&
|
|
1955
|
+
t.items.enumextra &&
|
|
1956
|
+
((t.options = []),
|
|
1957
|
+
t.items.enum.forEach(function (e, r) {
|
|
1958
|
+
t.options.push({ label: t.items.enumextra[r] || e, value: e });
|
|
1959
|
+
}),
|
|
1960
|
+
delete t.items)),
|
|
1961
|
+
t.properties &&
|
|
1962
|
+
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
1963
|
+
t.propertyOrder.map(function (e) {
|
|
1964
|
+
t.properties[e] = $(t.properties[e]);
|
|
1965
|
+
})),
|
|
1966
|
+
'array' === t.type && t.items && (t.items = $(t.items)),
|
|
1967
|
+
t
|
|
1968
|
+
);
|
|
1969
|
+
}
|
|
1970
|
+
require('mobx');
|
|
1971
|
+
var J,
|
|
1972
|
+
K =
|
|
1973
|
+
(((J = {
|
|
1974
|
+
array: 'array',
|
|
1975
|
+
boolean: 'boolean',
|
|
1976
|
+
'box-style': 'object',
|
|
1977
|
+
'padding-margin': 'object',
|
|
1978
|
+
codearea: 'string',
|
|
1979
|
+
color: 'string',
|
|
1980
|
+
datasource: 'object',
|
|
1981
|
+
date: 'string',
|
|
1982
|
+
'date-time': 'string',
|
|
1983
|
+
'dynamic-data': 'object',
|
|
1984
|
+
event: 'object',
|
|
1985
|
+
'func-body': 'string',
|
|
1986
|
+
htmlarea: 'string',
|
|
1987
|
+
image: 'string',
|
|
1988
|
+
input: 'string',
|
|
1989
|
+
json: 'string',
|
|
1990
|
+
number: 'number',
|
|
1991
|
+
'input-image': 'string',
|
|
1992
|
+
object: 'object',
|
|
1993
|
+
quantity: 'object',
|
|
1994
|
+
radio: 'string',
|
|
1995
|
+
select: 'array',
|
|
1996
|
+
}).select = 'string'),
|
|
1997
|
+
(J.textarea = 'string'),
|
|
1998
|
+
(J['text-editor'] = 'string'),
|
|
1999
|
+
(J.time = 'string'),
|
|
2000
|
+
(J.url = 'string'),
|
|
2001
|
+
(J['dynamic-config'] = 'object'),
|
|
2002
|
+
(J['dynamic-object'] = 'object'),
|
|
2003
|
+
(J['dynamic-array'] = 'object'),
|
|
2004
|
+
(J['sohu-source'] = 'object'),
|
|
2005
|
+
(J['sohu-event'] = 'object'),
|
|
2006
|
+
J);
|
|
2007
|
+
function z(e) {
|
|
2008
|
+
return K[e] || e;
|
|
2009
|
+
}
|
|
2010
|
+
function U(e, t) {
|
|
2011
|
+
K[e]
|
|
2012
|
+
? console.warn('当前已经存在' + e + '(' + K[e] + '),暂时不支持覆盖。')
|
|
2013
|
+
: (K[e] = t);
|
|
2014
|
+
}
|
|
2015
|
+
function W(e) {
|
|
2016
|
+
var t = !0;
|
|
2017
|
+
if (!e) return t;
|
|
2018
|
+
var r = e.type;
|
|
2019
|
+
return (
|
|
2020
|
+
(('object' === r &&
|
|
2021
|
+
e.properties &&
|
|
2022
|
+
e.propertyOrder &&
|
|
2023
|
+
e.propertyOrder.length > 0) ||
|
|
2024
|
+
('array' === r &&
|
|
2025
|
+
e.items &&
|
|
2026
|
+
e.items.properties &&
|
|
2027
|
+
e.items.propertyOrder &&
|
|
2028
|
+
e.items.propertyOrder.length > 0) ||
|
|
2029
|
+
(e.type && 'array' !== e.type && 'object' !== e.type) ||
|
|
2030
|
+
e.type) &&
|
|
2031
|
+
(t = !1),
|
|
2032
|
+
t
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
function X(e) {
|
|
2036
|
+
var t = !1,
|
|
2037
|
+
r = e.lastUpdateTime,
|
|
2038
|
+
i = new Date('2024-10-05T00:01:00.691Z').getTime();
|
|
2039
|
+
return r && new Date(r).getTime() >= i && (t = !0), t;
|
|
2040
|
+
}
|
|
2041
|
+
function Y(e) {
|
|
2042
|
+
var t = !1,
|
|
2043
|
+
r = z(e.type),
|
|
2044
|
+
i = void 0 === e.isContainer || e.isContainer;
|
|
2045
|
+
return 'object' === r && i && (t = !0), t;
|
|
2046
|
+
}
|
|
2047
|
+
function Z(e) {
|
|
2048
|
+
var t = !0;
|
|
2049
|
+
return (
|
|
2050
|
+
'object' === e.type && e.propertyOrder && e.properties
|
|
2051
|
+
? e.propertyOrder.map(function (r) {
|
|
2052
|
+
var i = e.properties[r];
|
|
2053
|
+
('object' === e.type && i.propertyOrder && i.properties) ||
|
|
2054
|
+
(t = !1);
|
|
2055
|
+
})
|
|
2056
|
+
: (t = !1),
|
|
2057
|
+
t
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
function H(e, t) {
|
|
2061
|
+
var r = e.split('-'),
|
|
2062
|
+
i = t.split('-');
|
|
2063
|
+
return r.pop(), i.pop(), r.join('-') === i.join('-');
|
|
2064
|
+
}
|
|
2065
|
+
function Q(e, t) {
|
|
2066
|
+
for (
|
|
2067
|
+
var r = e.split('-'),
|
|
2068
|
+
i = t.split('-'),
|
|
2069
|
+
a = 'before',
|
|
2070
|
+
l = 0,
|
|
2071
|
+
n = (r.length > i.length ? i : r).length;
|
|
2072
|
+
l < n;
|
|
2073
|
+
l += 1
|
|
2074
|
+
)
|
|
2075
|
+
Number(r[l]) > Number(i[l]) && (a = 'after');
|
|
2076
|
+
return a;
|
|
2077
|
+
}
|
|
2078
|
+
function G(e) {
|
|
2079
|
+
var t = e.split('-');
|
|
2080
|
+
return t.pop(), t.join('-');
|
|
2081
|
+
}
|
|
2082
|
+
function ee(e) {
|
|
2083
|
+
var t = e.split('-'),
|
|
2084
|
+
r = t.pop(),
|
|
2085
|
+
i = Number(r) + 1;
|
|
2086
|
+
return t.push('' + i), t.join('-');
|
|
2087
|
+
}
|
|
2088
|
+
function te(e) {
|
|
2089
|
+
var t = e.split('-'),
|
|
2090
|
+
r = t.pop();
|
|
2091
|
+
return [t.join('-'), r];
|
|
2092
|
+
}
|
|
2093
|
+
function re(e) {
|
|
2094
|
+
var t = e.split('-'),
|
|
2095
|
+
r = t.pop();
|
|
2096
|
+
return t.push(Number(r) - 1), t.join('-');
|
|
2097
|
+
}
|
|
2098
|
+
function ie(e) {
|
|
2099
|
+
var t = e.split('-'),
|
|
2100
|
+
r = t.pop();
|
|
2101
|
+
return t.push(Number(r) + 1), t.join('-');
|
|
2102
|
+
}
|
|
2103
|
+
function ae(e, t) {
|
|
2104
|
+
var r = '',
|
|
2105
|
+
i = !1;
|
|
2106
|
+
if (!1 !== e.defaultActiveFirstOption && e.defaultActiveFirstOption)
|
|
2107
|
+
return (
|
|
2108
|
+
e.options && e.options[0] && ((r = e.options[0].value), (i = !0)),
|
|
2109
|
+
(t || e.multiple) && (r = i ? [r] : []),
|
|
2110
|
+
r
|
|
2111
|
+
);
|
|
2112
|
+
}
|
|
2113
|
+
function le(e, t) {
|
|
2114
|
+
var r,
|
|
2115
|
+
i,
|
|
2116
|
+
a = void 0,
|
|
2117
|
+
l = t;
|
|
2118
|
+
u(l) &&
|
|
2119
|
+
u(e.default) &&
|
|
2120
|
+
(typeof l != typeof e.default ||
|
|
2121
|
+
((r = l), (i = e.default), P(r) + '-' + k(r) != P(i) + '-' + k(i))) &&
|
|
2122
|
+
(l = void 0);
|
|
2123
|
+
var n = u(l) ? l : e.default;
|
|
2124
|
+
switch (e.type) {
|
|
2125
|
+
case 'select':
|
|
2126
|
+
case 'radio':
|
|
2127
|
+
a = null != n ? n : ae(e);
|
|
2128
|
+
break;
|
|
2129
|
+
case 'checkboxes':
|
|
2130
|
+
a = null != n ? n : ae(e, !0);
|
|
2131
|
+
break;
|
|
2132
|
+
case 'color':
|
|
2133
|
+
('#fff' !== n && '#FFF' !== n) || (n = '#ffffff'),
|
|
2134
|
+
(a = u(n) ? n : '#ffffff');
|
|
2135
|
+
break;
|
|
2136
|
+
case 'boolean':
|
|
2137
|
+
a = !!u(n) && n;
|
|
2138
|
+
break;
|
|
2139
|
+
case 'number':
|
|
2140
|
+
a = u(n) ? n : void 0;
|
|
2141
|
+
break;
|
|
2142
|
+
case 'json':
|
|
2143
|
+
var o = '';
|
|
2144
|
+
if (P(n) || k(n)) o = n;
|
|
2145
|
+
else if (_(n) || '' === n) o = {};
|
|
2146
|
+
else
|
|
2147
|
+
try {
|
|
2148
|
+
o = JSON.parse(n);
|
|
2149
|
+
} catch (e) {
|
|
2150
|
+
o = {};
|
|
2151
|
+
}
|
|
2152
|
+
a = o;
|
|
2153
|
+
break;
|
|
2154
|
+
default:
|
|
2155
|
+
a =
|
|
2156
|
+
'input' === e.type && '0' === e.default
|
|
2157
|
+
? n || e.default
|
|
2158
|
+
: u(n)
|
|
2159
|
+
? n
|
|
2160
|
+
: void 0;
|
|
2161
|
+
}
|
|
2162
|
+
return a;
|
|
2163
|
+
}
|
|
2164
|
+
function ne(e, t) {
|
|
2165
|
+
var r = {},
|
|
2166
|
+
i = e.type;
|
|
2167
|
+
if (P(e) && 'object' === z(e.type)) {
|
|
2168
|
+
var a = e,
|
|
2169
|
+
l = t;
|
|
2170
|
+
u(l) &&
|
|
2171
|
+
((u(a.default) && typeof l != typeof e.default) || !P(l)) &&
|
|
2172
|
+
(l = void 0);
|
|
2173
|
+
var n = u(l) ? l : a.default;
|
|
2174
|
+
'dynamic-data' === i
|
|
2175
|
+
? ((r = o(j)),
|
|
2176
|
+
n &&
|
|
2177
|
+
P(n) &&
|
|
2178
|
+
'{}' !== JSON.stringify(n) &&
|
|
2179
|
+
(r = Object.assign(r, n)))
|
|
2180
|
+
: 'datasource' === i
|
|
2181
|
+
? a.properties &&
|
|
2182
|
+
a.properties.type &&
|
|
2183
|
+
a.properties.type.default &&
|
|
2184
|
+
'local' === a.properties.type.default
|
|
2185
|
+
? ((r = { data: '{}', filter: '() => {}' }),
|
|
2186
|
+
n && n.data && (r.data = n.data),
|
|
2187
|
+
n && n.filter && (r.filter = n.filter),
|
|
2188
|
+
'http://xxx' === r.data && (r.data = '{}'))
|
|
2189
|
+
: ((r = { data: 'http://xxx', filter: '() => {}' }),
|
|
2190
|
+
n && n.data && (r.data = n.data),
|
|
2191
|
+
n && n.filter && (r.filter = n.filter),
|
|
2192
|
+
'{}' === r.data && (r.data = 'http://xxx'))
|
|
2193
|
+
: 'event' === i
|
|
2194
|
+
? a.properties &&
|
|
2195
|
+
a.properties.type &&
|
|
2196
|
+
a.properties.type.default &&
|
|
2197
|
+
'emit' === a.properties.type.default
|
|
2198
|
+
? n && 'out' === n.type
|
|
2199
|
+
? (r = {
|
|
2200
|
+
trigger: (n && n.filter) || 'eventName',
|
|
2201
|
+
eventData: '{}',
|
|
2202
|
+
})
|
|
2203
|
+
: ((r = { trigger: 'eventName', eventData: '{}' }),
|
|
2204
|
+
n && n.trigger && (r.trigger = n.trigger),
|
|
2205
|
+
n && n.eventData && (r.eventData = n.eventData))
|
|
2206
|
+
: n && 'in' === n.type
|
|
2207
|
+
? (r = {
|
|
2208
|
+
register: 'eventName',
|
|
2209
|
+
actionFunc: (n && n.filter) || '() => {}',
|
|
2210
|
+
})
|
|
2211
|
+
: ((r = { register: 'eventName', actionFunc: '() => {}' }),
|
|
2212
|
+
n && n.register && (r.register = n.register),
|
|
2213
|
+
n && n.actionFunc && (r.actionFunc = n.actionFunc))
|
|
2214
|
+
: !1 === e.isContainer && n && P(n) && '{}' !== JSON.stringify(n)
|
|
2215
|
+
? (r = Object.assign(r, n))
|
|
2216
|
+
: void 0 === l && a.default && P(a.default)
|
|
2217
|
+
? (r = a.default)
|
|
2218
|
+
: e.properties &&
|
|
2219
|
+
(e.propertyOrder
|
|
2220
|
+
? e.propertyOrder
|
|
2221
|
+
: Object.keys(e.properties)
|
|
2222
|
+
).map(function (i) {
|
|
2223
|
+
var a = e.properties[i],
|
|
2224
|
+
l = t && t[i];
|
|
2225
|
+
switch (z(a.type)) {
|
|
2226
|
+
case 'array':
|
|
2227
|
+
r[i] = oe(a, l);
|
|
2228
|
+
break;
|
|
2229
|
+
case 'object':
|
|
2230
|
+
r[i] = ne(a, l);
|
|
2231
|
+
break;
|
|
2232
|
+
default:
|
|
2233
|
+
r[i] = le(a, l);
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
return r;
|
|
2238
|
+
}
|
|
2239
|
+
function oe(e, t) {
|
|
2240
|
+
var r = [];
|
|
2241
|
+
if (e && 'array' === z(e.type)) {
|
|
2242
|
+
var i = t;
|
|
2243
|
+
u(i) &&
|
|
2244
|
+
((u(e.default) && typeof i != typeof e.default) || !k(i)) &&
|
|
2245
|
+
(i = void 0);
|
|
2246
|
+
var a = u(i) ? i : e.default;
|
|
2247
|
+
if ('array' === z(e.type))
|
|
2248
|
+
if (k(a))
|
|
2249
|
+
a.map(function (t) {
|
|
2250
|
+
r.push(ne(e.items, t));
|
|
2251
|
+
});
|
|
2252
|
+
else if (a) r = a;
|
|
2253
|
+
else {
|
|
2254
|
+
var l = ne(e.items, a);
|
|
2255
|
+
r.push(l);
|
|
2256
|
+
}
|
|
2257
|
+
else r = u(a) ? a : [];
|
|
2258
|
+
}
|
|
2259
|
+
return r;
|
|
2260
|
+
}
|
|
2261
|
+
function pe(e, t) {
|
|
2262
|
+
return 'object' === z(e.type)
|
|
2263
|
+
? ne(e, t)
|
|
2264
|
+
: 'array' === z(e.type)
|
|
2265
|
+
? oe(e, t)
|
|
2266
|
+
: le(e, t);
|
|
2267
|
+
}
|
|
2268
|
+
var ue = O;
|
|
2269
|
+
function ce(e, t) {
|
|
2270
|
+
var r = t || [];
|
|
2271
|
+
if (e && '{}' !== JSON.stringify(e))
|
|
2272
|
+
if (P(e))
|
|
2273
|
+
if (
|
|
2274
|
+
e.type &&
|
|
2275
|
+
'remote' === e.type &&
|
|
2276
|
+
e.config &&
|
|
2277
|
+
P(e.config) &&
|
|
2278
|
+
e.config.dataName &&
|
|
2279
|
+
u(e.localFilter) &&
|
|
2280
|
+
u(e.data)
|
|
2281
|
+
) {
|
|
2282
|
+
var i = e.config.body;
|
|
2283
|
+
if (i && !P(i))
|
|
2284
|
+
try {
|
|
2285
|
+
i = JSON.parse(i);
|
|
2286
|
+
} catch (e) {
|
|
2287
|
+
i = {};
|
|
2288
|
+
}
|
|
2289
|
+
r.push({ id: e.config.id, dataName: e.config.dataName, body: i });
|
|
2290
|
+
} else
|
|
2291
|
+
Object.keys(e).map(function (t) {
|
|
2292
|
+
ce(e[t], r);
|
|
2293
|
+
});
|
|
2294
|
+
else
|
|
2295
|
+
k(e) &&
|
|
2296
|
+
e.map(function (e) {
|
|
2297
|
+
ce(e, r);
|
|
2298
|
+
});
|
|
2299
|
+
return r;
|
|
2300
|
+
}
|
|
2301
|
+
function se(e, t) {
|
|
2302
|
+
var r = t || 'data';
|
|
2303
|
+
return (
|
|
2304
|
+
e.split('-').map(function (e) {
|
|
2305
|
+
r = /^\d+$/.test(e) ? r + '[' + e + ']' : r + '.' + e;
|
|
2306
|
+
}),
|
|
2307
|
+
r
|
|
2308
|
+
);
|
|
2309
|
+
}
|
|
2310
|
+
function de(e, t) {
|
|
2311
|
+
var r = [];
|
|
2312
|
+
return (
|
|
2313
|
+
P(e)
|
|
2314
|
+
? Object.keys(e).map(function (i) {
|
|
2315
|
+
var a = e[i],
|
|
2316
|
+
l = t ? t + '-' + i : i;
|
|
2317
|
+
P(a) || k(a)
|
|
2318
|
+
? r.push({ title: i, value: l, key: l, children: de(a, l) })
|
|
2319
|
+
: r.push({ title: i, value: l, key: l });
|
|
2320
|
+
})
|
|
2321
|
+
: k(e) &&
|
|
2322
|
+
e.map(function (e, i) {
|
|
2323
|
+
var a = i.toString(),
|
|
2324
|
+
l = t ? t + '-' + i : a;
|
|
2325
|
+
P(e) || k(e)
|
|
2326
|
+
? r.push({ title: a, value: l, key: l, children: de(e, l) })
|
|
2327
|
+
: r.push({ title: a, value: l, key: l });
|
|
2328
|
+
}),
|
|
2329
|
+
r
|
|
2330
|
+
);
|
|
2331
|
+
}
|
|
2332
|
+
function ye(e, t) {
|
|
2333
|
+
var r = '';
|
|
2334
|
+
return (
|
|
2335
|
+
'object' === z(e.type) &&
|
|
2336
|
+
e.properties &&
|
|
2337
|
+
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
2338
|
+
function (i) {
|
|
2339
|
+
var a = e.properties[i],
|
|
2340
|
+
l = t[i];
|
|
2341
|
+
('array' === z(a.type) && 'object' === z(a.type)) ||
|
|
2342
|
+
(l &&
|
|
2343
|
+
a.isConditionProp &&
|
|
2344
|
+
(r.indexOf('-') > 0 ? (r += '-' + l) : (r = l)));
|
|
2345
|
+
},
|
|
2346
|
+
),
|
|
2347
|
+
r
|
|
2348
|
+
);
|
|
2349
|
+
}
|
|
2350
|
+
function fe(e) {
|
|
2351
|
+
var t = e.split('-');
|
|
2352
|
+
return t.pop(), t.join('-');
|
|
2353
|
+
}
|
|
2354
|
+
function be(e) {
|
|
2355
|
+
var t = e.split('-'),
|
|
2356
|
+
r = t.pop();
|
|
2357
|
+
return [t.join('-'), r];
|
|
2358
|
+
}
|
|
2359
|
+
var ve = [
|
|
2360
|
+
'key',
|
|
2361
|
+
'enum',
|
|
2362
|
+
'enumextra',
|
|
2363
|
+
'items',
|
|
2364
|
+
'input',
|
|
2365
|
+
'boolean',
|
|
2366
|
+
'number',
|
|
2367
|
+
'color',
|
|
2368
|
+
'url',
|
|
2369
|
+
'textarea',
|
|
2370
|
+
'text-editor',
|
|
2371
|
+
'radio',
|
|
2372
|
+
'select',
|
|
2373
|
+
'checkboxes',
|
|
2374
|
+
'date',
|
|
2375
|
+
'date-time',
|
|
2376
|
+
'time',
|
|
2377
|
+
'json',
|
|
2378
|
+
'codearea',
|
|
2379
|
+
'htmlarea',
|
|
2380
|
+
'quantity',
|
|
2381
|
+
'box-style',
|
|
2382
|
+
'dynamic-data',
|
|
2383
|
+
'datasource',
|
|
2384
|
+
'event',
|
|
2385
|
+
'array',
|
|
2386
|
+
'object',
|
|
2387
|
+
];
|
|
2388
|
+
return t;
|
|
2389
|
+
})();
|
|
2390
|
+
});
|