mirror of
https://github.com/Ssl1S/json-schema-editor-vue.git
synced 2025-12-30 01:37:55 +08:00
Merge branch '2.1.0'
This commit is contained in:
@@ -18,7 +18,7 @@ A json-schema editor of high efficient and easy-to-use, base on Vue
|
||||
<img width="100%" src="https://github.com/zyqwst/json-schema-editor-vue/raw/master/examples/assets/capture.png">
|
||||
</p>
|
||||
|
||||
**支持自定义属性,满足特殊的需求*
|
||||
**支持自定义属性,满足特殊的需求**
|
||||
|
||||
<p align="center">
|
||||
<img width="100%" src="https://github.com/zyqwst/json-schema-editor-vue/raw/master/examples/assets/custom.png">
|
||||
@@ -30,14 +30,12 @@ A json-schema editor of high efficient and easy-to-use, base on Vue
|
||||
**[国内Demo](http://json-schema-editor.sviip.com)**
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
```bash
|
||||
# vue2
|
||||
npm install json-schema-editor-vue
|
||||
# vue3
|
||||
npm install json-schema-editor-vue3
|
||||
```
|
||||
```
|
||||
|
||||
```vue
|
||||
import JsonSchemaEditor from 'json-schema-editor-vue'
|
||||
|
||||
@@ -1 +1 @@
|
||||
*{padding:0;margin:0;box-sizing:border-box}.title{text-align:center;font-size:40px;font-weight:700;height:100px;line-height:100px}.desc{padding:20px;padding:0 3em;font-size:1.2em}.container,.desc{width:80vw;min-width:800px;margin:auto}.container{display:flex;padding:20px;justify-content:center;height:calc(100vh - 150px)}.code-container{max-height:600px;overflow:auto}.schema{margin-left:20px;width:50%;height:100%;overflow-y:auto;overflow-x:hidden;border:1px solid rgba(0,0,0,.1);border-radius:8px;padding:12px}.CodeMirror{height:100%!important}.vue-codemirror{flex:1;margin:0 24px;border:1px solid rgba(0,0,0,.1);min-height:300px;overflow:auto;border-radius:6px}.json-schema-editor .row[data-v-3b2b9f56]{display:flex;margin:12px}.json-schema-editor .row .ant-col-name .ant-col-name-c[data-v-3b2b9f56],.json-schema-editor .row .ant-col-name[data-v-3b2b9f56]{display:flex;align-items:center}.json-schema-editor .row .ant-col-name .ant-col-name-required[data-v-3b2b9f56]{flex:0 0 24px;text-align:center}.json-schema-editor .row .ant-col-type[data-v-3b2b9f56]{width:100%}.json-schema-editor .row .ant-col-setting[data-v-3b2b9f56]{display:inline-block}.json-schema-editor .row .setting-icon[data-v-3b2b9f56]{color:rgba(0,0,0,.45);border:none}.json-schema-editor .row .plus-icon[data-v-3b2b9f56]{border:none}.json-schema-editor .row .close-icon[data-v-3b2b9f56]{color:#888;border:none}.json-schema-editor-advanced-modal{color:rgba(0,0,0,.65);min-width:600px}.json-schema-editor-advanced-modal pre{font-family:monospace;height:100%;overflow-y:auto;border:1px solid rgba(0,0,0,.1);border-radius:4px;padding:12px;width:50%}.json-schema-editor-advanced-modal h3{display:block;border-left:3px solid #1890ff;padding:0 8px}.json-schema-editor-advanced-modal .ant-advanced-search-form .ant-form-item{display:flex}.json-schema-editor-advanced-modal .ant-advanced-search-form .ant-form-item .ant-form-item-control-wrapper{flex:1}
|
||||
*{padding:0;margin:0;box-sizing:border-box}.title{text-align:center;font-size:40px;font-weight:700;height:100px;line-height:100px}.desc{padding:20px;padding:0 3em;font-size:1.2em}.container,.desc{width:80vw;min-width:800px;margin:auto}.container{display:flex;padding:20px;justify-content:center;height:calc(100vh - 150px)}.code-container{max-height:600px;overflow:auto}.schema{margin-left:20px;width:50%;height:100%;overflow-y:auto;overflow-x:hidden;border:1px solid rgba(0,0,0,.1);border-radius:8px;padding:12px}.CodeMirror{height:100%!important}.vue-codemirror{flex:1;margin:0 24px;border:1px solid rgba(0,0,0,.1);min-height:300px;overflow:auto;border-radius:6px}.json-schema-editor .row[data-v-43dcb7a8]{display:flex;margin:12px}.json-schema-editor .row .ant-col-name .ant-col-name-c[data-v-43dcb7a8],.json-schema-editor .row .ant-col-name[data-v-43dcb7a8]{display:flex;align-items:center}.json-schema-editor .row .ant-col-name .ant-col-name-required[data-v-43dcb7a8]{flex:0 0 24px;text-align:center}.json-schema-editor .row .ant-col-type[data-v-43dcb7a8]{width:100%}.json-schema-editor .row .ant-col-setting[data-v-43dcb7a8]{display:inline-block}.json-schema-editor .row .setting-icon[data-v-43dcb7a8]{color:rgba(0,0,0,.45);border:none}.json-schema-editor .row .plus-icon[data-v-43dcb7a8]{border:none}.json-schema-editor .row .close-icon[data-v-43dcb7a8]{color:#888;border:none}.json-schema-editor-advanced-modal{color:rgba(0,0,0,.65);min-width:600px}.json-schema-editor-advanced-modal pre{font-family:monospace;height:100%;overflow-y:auto;border:1px solid rgba(0,0,0,.1);border-radius:4px;padding:12px;width:50%}.json-schema-editor-advanced-modal h3{display:block;border-left:3px solid #1890ff;padding:0 8px}.json-schema-editor-advanced-modal .ant-advanced-search-form .ant-form-item{display:flex}.json-schema-editor-advanced-modal .ant-advanced-search-form .ant-form-item .ant-form-item-control-wrapper{flex:1}
|
||||
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -105,4 +105,4 @@
|
||||
-o-transform: rotate(10deg);
|
||||
transform: rotate(10deg);
|
||||
}
|
||||
}</style><link href=css/chunk-vendors.8b9389a0.css rel=preload as=style><link href=css/index.a7ff23e2.css rel=preload as=style><link href=js/chunk-vendors.c7856cab.js rel=preload as=script><link href=js/index.1ed40fda.js rel=preload as=script><link href=css/chunk-vendors.8b9389a0.css rel=stylesheet><link href=css/index.a7ff23e2.css rel=stylesheet></head><body><a href=https://github.com/zyqwst/json-schema-editor-vue class=github-corner target=_blank title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width=80 height=80 viewBox="0 0 250 250" style="fill:#008000; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden=true><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill=currentColor style="transform-origin: 130px 106px;" class=octo-arm></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill=currentColor class=octo-body></path></svg></a><noscript><strong>We're sorry but json-schema-editor-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><footer style=text-align:center;margin-bottom:16px;><a href="" target=_blank style="color: #999">Github</a><a href="" target=_blank style="color: #999;margin-left:16px;">Gitee</a><span style=margin-left:16px>©Zhangyq</span></footer><script src=js/chunk-vendors.c7856cab.js></script><script src=js/index.1ed40fda.js></script></body></html>
|
||||
}</style><link href=css/chunk-vendors.8b9389a0.css rel=preload as=style><link href=css/index.d0c18547.css rel=preload as=style><link href=js/chunk-vendors.c7856cab.js rel=preload as=script><link href=js/index.86bb32a6.js rel=preload as=script><link href=css/chunk-vendors.8b9389a0.css rel=stylesheet><link href=css/index.d0c18547.css rel=stylesheet></head><body><a href=https://github.com/zyqwst/json-schema-editor-vue class=github-corner target=_blank title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width=80 height=80 viewBox="0 0 250 250" style="fill:#008000; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden=true><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill=currentColor style="transform-origin: 130px 106px;" class=octo-arm></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill=currentColor class=octo-body></path></svg></a><noscript><strong>We're sorry but json-schema-editor-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><footer style=text-align:center;margin-bottom:16px;><a href="" target=_blank style="color: #999">Github</a><a href="" target=_blank style="color: #999;margin-left:16px;">Gitee</a><span style=margin-left:16px>©Zhangyq</span></footer><script src=js/chunk-vendors.c7856cab.js></script><script src=js/index.86bb32a6.js></script></body></html>
|
||||
1
dist/js/index.1ed40fda.js
vendored
1
dist/js/index.1ed40fda.js
vendored
File diff suppressed because one or more lines are too long
1
dist/js/index.86bb32a6.js
vendored
Normal file
1
dist/js/index.86bb32a6.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -8672,17 +8672,6 @@ module.exports = has;
|
||||
})));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "38ce":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b08a");
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* unused harmony reexport * */
|
||||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "393a":
|
||||
@@ -14476,6 +14465,17 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "4e37":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8fb2");
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* unused harmony reexport * */
|
||||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "4e71":
|
||||
@@ -24826,6 +24826,13 @@ function copyObject(source, props, object, customizer) {
|
||||
module.exports = copyObject;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "8fb2":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "9020":
|
||||
@@ -28518,13 +28525,6 @@ function baseUnary(func) {
|
||||
module.exports = baseUnary;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "b08a":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "b0c0":
|
||||
@@ -41794,18 +41794,18 @@ function _objectSpread2(target) {
|
||||
|
||||
return target;
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"61d6070a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/json-schema-editor/main.vue?vue&type=template&id=3b2b9f56&scoped=true&
|
||||
var mainvue_type_template_id_3b2b9f56_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"json-schema-editor"},[_c('a-row',{staticClass:"row",attrs:{"gutter":10}},[_c('a-col',{staticClass:"ant-col-name",attrs:{"span":8}},[_c('div',{staticClass:"ant-col-name-c",style:({marginLeft:((20*_vm.deep) + "px")})},[(_vm.pickValue.type==='object')?_c('a-button',{staticStyle:{"color":"rgba(0,0,0,.65)"},attrs:{"type":"link","icon":_vm.hidden?'caret-right':'caret-down'},on:{"click":function($event){_vm.hidden = !_vm.hidden}}}):_c('span',{staticStyle:{"width":"32px","display":"inline-block"}}),_c('a-input',{staticClass:"ant-col-name-input",attrs:{"disabled":_vm.disabled || _vm.root,"value":_vm.pickKey},on:{"blur":_vm.onInputName}})],1),(_vm.root)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['checked_all'])},slot:"title"},[_vm._v("全选")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":!_vm.isObject && !_vm.isArray},on:{"change":_vm.onRootCheck}})],1):_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['required'])},slot:"title"},[_vm._v("是否必填")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":_vm.isItem,"checked":_vm.checked},on:{"change":_vm.onCheck}})],1)],1),_c('a-col',{attrs:{"span":4}},[_c('a-select',{staticClass:"ant-col-type",attrs:{"disabled":_vm.disabledType,"getPopupContainer":function (triggerNode) {
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"61d6070a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/json-schema-editor/main.vue?vue&type=template&id=43dcb7a8&scoped=true&
|
||||
var mainvue_type_template_id_43dcb7a8_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"json-schema-editor"},[_c('a-row',{staticClass:"row",attrs:{"gutter":10}},[_c('a-col',{staticClass:"ant-col-name",attrs:{"span":8}},[_c('div',{staticClass:"ant-col-name-c",style:({marginLeft:((20*_vm.deep) + "px")})},[(_vm.pickValue.type==='object')?_c('a-button',{staticStyle:{"color":"rgba(0,0,0,.65)"},attrs:{"type":"link","icon":_vm.hidden?'caret-right':'caret-down'},on:{"click":function($event){_vm.hidden = !_vm.hidden}}}):_c('span',{staticStyle:{"width":"32px","display":"inline-block"}}),_c('a-input',{staticClass:"ant-col-name-input",attrs:{"disabled":_vm.disabled || _vm.root,"value":_vm.pickKey},on:{"blur":_vm.onInputName}})],1),(_vm.root)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['checked_all'])},slot:"title"},[_vm._v("全选")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":!_vm.isObject && !_vm.isArray},on:{"change":_vm.onRootCheck}})],1):_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['required'])},slot:"title"},[_vm._v("是否必填")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":_vm.isItem,"checked":_vm.checked},on:{"change":_vm.onCheck}})],1)],1),_c('a-col',{attrs:{"span":4}},[_c('a-select',{staticClass:"ant-col-type",attrs:{"disabled":_vm.disabledType,"getPopupContainer":function (triggerNode) {
|
||||
return triggerNode.parentNode || _vm.document.body;
|
||||
}},on:{"change":_vm.onChangeType},model:{value:(_vm.pickValue.type),callback:function ($$v) {_vm.$set(_vm.pickValue, "type", $$v)},expression:"pickValue.type"}},_vm._l((_vm.TYPE_NAME),function(t){return _c('a-select-option',{key:t},[_vm._v(" "+_vm._s(t)+" ")])}),1)],1),_c('a-col',[_c('a-input',{staticClass:"ant-col-title",attrs:{"placeholder":_vm.local['title']},model:{value:(_vm.pickValue.title),callback:function ($$v) {_vm.$set(_vm.pickValue, "title", $$v)},expression:"pickValue.title"}})],1),_c('a-col',{staticClass:"ant-col-setting",attrs:{"span":6}},[_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['adv_setting'])},slot:"title"},[_vm._v("高级设置")]),_c('a-button',{staticClass:"setting-icon",attrs:{"type":"link","icon":"setting"},on:{"click":_vm.onSetting}})],1),(_vm.isObject)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['add_child_node'])},slot:"title"},[_vm._v("添加子节点")]),_c('a-button',{staticClass:"plus-icon",attrs:{"type":"link","icon":"plus"},on:{"click":_vm.addChild}})],1):_vm._e(),(!_vm.root && !_vm.isItem)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['remove_node'])},slot:"title"},[_vm._v("删除节点")]),_c('a-button',{staticClass:"close-icon ant-btn-icon-only",attrs:{"type":"link"},on:{"click":_vm.removeNode}},[_c('i',{staticClass:"anticon anticon-plus",attrs:{"aria-label":"icon: plus"}},[_c('svg',{attrs:{"viewBox":"64 64 896 896","data-icon":"plus","width":"1em","height":"1em","fill":"currentColor","aria-hidden":"true","focusable":"false"}},[_c('path',{attrs:{"d":"M810.666667 273.493333L750.506667 213.333333 512 451.84 273.493333 213.333333 213.333333 273.493333 451.84 512 213.333333 750.506667 273.493333 810.666667 512 572.16 750.506667 810.666667 810.666667 750.506667 572.16 512z","p-id":"1142"}})])])])],1):_vm._e()],1)],1),(!_vm.hidden&&_vm.pickValue.properties && !_vm.isArray)?_vm._l((_vm.pickValue.properties),function(item,key,index){
|
||||
var _obj;
|
||||
return _c('json-schema-editor',{key:index,staticClass:"children",attrs:{"value":( _obj = {}, _obj[key] = item, _obj ),"parent":_vm.pickValue,"deep":_vm.deep+1,"root":false,"lang":_vm.lang,"custom":_vm.custom}})}):_vm._e(),(_vm.isArray)?[_c('json-schema-editor',{staticClass:"children",attrs:{"value":{items:_vm.pickValue.items},"deep":_vm.deep+1,"disabled":"","isItem":"","root":false,"lang":_vm.lang,"custom":_vm.custom}})]:_vm._e(),(_vm.modalVisible)?_c('a-modal',{attrs:{"title":_vm.local['adv_setting'],"maskClosable":false,"okText":_vm.local['ok'],"cancelText":_vm.local['cancel'],"width":"800px","dialogClass":"json-schema-editor-advanced-modal"},on:{"ok":_vm.handleOk},model:{value:(_vm.modalVisible),callback:function ($$v) {_vm.modalVisible=$$v},expression:"modalVisible"}},[_c('h3',{domProps:{"textContent":_vm._s(_vm.local['base_setting'])}},[_vm._v("基础设置")]),_c('a-form',{staticClass:"ant-advanced-search-form",model:{value:(_vm.advancedValue),callback:function ($$v) {_vm.advancedValue=$$v},expression:"advancedValue"}},[_c('a-row',{attrs:{"gutter":6}},_vm._l((_vm.advancedValue),function(item,key){return _c('a-col',{key:key,attrs:{"span":8}},[_c('a-form-item',[_c('span',[_vm._v(_vm._s(_vm.local[key]))]),(_vm.advancedAttr[key].type === 'integer' || _vm.advancedAttr[key].type === 'number')?_c('a-input-number',{staticStyle:{"width":"100%"},attrs:{"placeholder":key},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}}):(_vm.advancedAttr[key].type === 'boolean')?_c('span',{staticStyle:{"display":"inline-block","width":"100%"}},[_c('a-switch',{model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}})],1):(key === 'enum')?_c('a-textarea',{attrs:{"value":_vm.enumText,"rows":2,"placeholder":_vm.local['enum_msg']},on:{"blur":_vm.changeEnumValue}}):(_vm.advancedAttr[key].type === 'array')?_c('a-select',{staticStyle:{"width":"100%"},attrs:{"getPopupContainer":function (triggerNode) {
|
||||
return triggerNode.parentNode || _vm.document.body;
|
||||
},"placeholder":_vm.local[key]},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}},[_c('a-select-option',{attrs:{"value":""}},[_vm._v(_vm._s(_vm.local['nothing']))]),_vm._l((_vm.advancedAttr[key].enums),function(t){return _c('a-select-option',{key:t},[_vm._v(" "+_vm._s(t)+" ")])})],2):_c('a-input',{staticStyle:{"width":"100%"},attrs:{"placeholder":key},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}})],1)],1)}),1)],1),_c('h3',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],domProps:{"textContent":_vm._s(_vm.local['add_custom'])}},[_vm._v("添加自定义属性")]),_c('a-form',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],staticClass:"ant-advanced-search-form"},[_c('a-row',{attrs:{"gutter":6}},[_vm._l((_vm.customProps),function(item){return _c('a-col',{key:item.key,attrs:{"span":8}},[_c('a-form-item',{attrs:{"label":item.key}},[_c('a-input',{staticStyle:{"width":"calc(100% - 30px)"},model:{value:(item.value),callback:function ($$v) {_vm.$set(item, "value", $$v)},expression:"item.value"}}),_c('a-button',{staticStyle:{"width":"30px"},attrs:{"icon":"close","type":"link"},on:{"click":function($event){_vm.customProps.splice(_vm.customProps.indexOf(item),1)}}})],1)],1)}),_c('a-col',{directives:[{name:"show",rawName:"v-show",value:(_vm.addProp.key != undefined),expression:"addProp.key != undefined"}],attrs:{"span":8}},[_c('a-form-item',[_c('a-input',{staticStyle:{"width":"100px"},attrs:{"slot":"label"},slot:"label",model:{value:(_vm.addProp.key),callback:function ($$v) {_vm.$set(_vm.addProp, "key", $$v)},expression:"addProp.key"}}),_c('a-input',{staticStyle:{"width":"100%"},model:{value:(_vm.addProp.value),callback:function ($$v) {_vm.$set(_vm.addProp, "value", $$v)},expression:"addProp.value"}})],1)],1),_c('a-col',{attrs:{"span":8}},[_c('a-form-item',[(_vm.customing)?_c('a-button',{attrs:{"icon":"check","type":"link"},on:{"click":function($event){return _vm.confirmAddCustomNode(null)}}}):_c('a-tooltip',{attrs:{"title":_vm.local['add_custom']}},[_c('a-button',{attrs:{"icon":"plus","type":"link"},on:{"click":_vm.addCustomNode}})],1)],1)],1)],2)],1),_c('h3',{domProps:{"textContent":_vm._s(_vm.local['preview'])}},[_vm._v("预览")]),_c('pre',{staticStyle:{"width":"100%"}},[_vm._v(_vm._s(_vm.completeNodeValue))])],1):_vm._e()],2)}
|
||||
},"placeholder":_vm.local[key]},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}},[_c('a-select-option',{attrs:{"value":""}},[_vm._v(_vm._s(_vm.local['nothing']))]),_vm._l((_vm.advancedAttr[key].enums),function(t){return _c('a-select-option',{key:t},[_vm._v(" "+_vm._s(t)+" ")])})],2):_c('a-input',{staticStyle:{"width":"100%"},attrs:{"placeholder":key},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}})],1)],1)}),1)],1),_c('h3',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],domProps:{"textContent":_vm._s(_vm.local['add_custom'])}},[_vm._v("添加自定义属性")]),_c('a-form',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],staticClass:"ant-advanced-search-form"},[_c('a-row',{attrs:{"gutter":6}},[_vm._l((_vm.customProps),function(item){return _c('a-col',{key:item.key,attrs:{"span":8}},[_c('a-form-item',{attrs:{"label":item.key}},[_c('a-input',{staticStyle:{"width":"calc(100% - 30px)"},model:{value:(item.value),callback:function ($$v) {_vm.$set(item, "value", $$v)},expression:"item.value"}}),_c('a-button',{staticStyle:{"width":"30px"},attrs:{"icon":"close","type":"link"},on:{"click":function($event){return _vm.removeCustomNode(item.key)}}})],1)],1)}),_c('a-col',{directives:[{name:"show",rawName:"v-show",value:(_vm.addProp.key != undefined),expression:"addProp.key != undefined"}],attrs:{"span":8}},[_c('a-form-item',[_c('a-input',{staticStyle:{"width":"100px"},attrs:{"slot":"label"},slot:"label",model:{value:(_vm.addProp.key),callback:function ($$v) {_vm.$set(_vm.addProp, "key", $$v)},expression:"addProp.key"}}),_c('a-input',{staticStyle:{"width":"100%"},model:{value:(_vm.addProp.value),callback:function ($$v) {_vm.$set(_vm.addProp, "value", $$v)},expression:"addProp.value"}})],1)],1),_c('a-col',{attrs:{"span":8}},[_c('a-form-item',[(_vm.customing)?_c('a-button',{attrs:{"icon":"check","type":"link"},on:{"click":function($event){return _vm.confirmAddCustomNode(null)}}}):_c('a-tooltip',{attrs:{"title":_vm.local['add_custom']}},[_c('a-button',{attrs:{"icon":"plus","type":"link"},on:{"click":_vm.addCustomNode}})],1)],1)],1)],2)],1),_c('h3',{domProps:{"textContent":_vm._s(_vm.local['preview'])}},[_vm._v("预览")]),_c('pre',{staticStyle:{"width":"100%"}},[_vm._v(_vm._s(_vm.completeNodeValue))])],1):_vm._e()],2)}
|
||||
var staticRenderFns = []
|
||||
|
||||
|
||||
// CONCATENATED MODULE: ./packages/json-schema-editor/main.vue?vue&type=template&id=3b2b9f56&scoped=true&
|
||||
// CONCATENATED MODULE: ./packages/json-schema-editor/main.vue?vue&type=template&id=43dcb7a8&scoped=true&
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
|
||||
var es_array_concat = __webpack_require__("99af");
|
||||
@@ -41849,6 +41849,21 @@ var es_string_split = __webpack_require__("1276");
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
|
||||
var web_dom_collections_iterator = __webpack_require__("ddb0");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
|
||||
var es_symbol_description = __webpack_require__("e01a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
|
||||
var es_symbol_iterator = __webpack_require__("d28b");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
|
||||
var es_array_from = __webpack_require__("a630");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
|
||||
var es_array_slice = __webpack_require__("fb6a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
|
||||
var es_regexp_to_string = __webpack_require__("25f0");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
||||
function _arrayLikeToArray(arr, len) {
|
||||
if (len == null || len > arr.length) len = arr.length;
|
||||
@@ -41859,37 +41874,6 @@ function _arrayLikeToArray(arr, len) {
|
||||
|
||||
return arr2;
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
||||
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
|
||||
var es_symbol_description = __webpack_require__("e01a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
|
||||
var es_symbol_iterator = __webpack_require__("d28b");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
|
||||
var es_array_from = __webpack_require__("a630");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
|
||||
var es_array_slice = __webpack_require__("fb6a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
|
||||
var es_regexp_to_string = __webpack_require__("25f0");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
||||
|
||||
|
||||
@@ -41906,18 +41890,6 @@ function _unsupportedIterableToArray(o, minLen) {
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js
|
||||
|
||||
|
||||
@@ -41982,6 +41954,34 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
||||
}
|
||||
};
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
||||
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/ant-design-vue/es/style/index.css
|
||||
var es_style = __webpack_require__("b550");
|
||||
|
||||
@@ -62760,6 +62760,7 @@ var langs = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
@@ -62972,6 +62973,9 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
advancedAttr: function advancedAttr() {
|
||||
return TYPE[this.pickValue.type].attr;
|
||||
},
|
||||
ownProps: function ownProps() {
|
||||
return ['type', 'title', 'properties', 'items', 'required'].concat(_toConsumableArray(Object.keys(this.advancedAttr)));
|
||||
},
|
||||
advancedNotEmptyValue: function advancedNotEmptyValue() {
|
||||
var jsonNode = Object.assign({}, this.advancedValue);
|
||||
|
||||
@@ -62984,6 +62988,8 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
completeNodeValue: function completeNodeValue() {
|
||||
var t = {};
|
||||
|
||||
var basicValue = _objectSpread2({}, this.pickValue);
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(this.customProps),
|
||||
_step;
|
||||
|
||||
@@ -62998,7 +63004,11 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return Object.assign({}, this.pickValue, this.advancedNotEmptyValue, t);
|
||||
this._pickDiffKey().forEach(function (key) {
|
||||
return delete basicValue[key];
|
||||
});
|
||||
|
||||
return Object.assign({}, basicValue, t, this.advancedNotEmptyValue);
|
||||
},
|
||||
enumText: function enumText() {
|
||||
var t = this.advancedValue['enum'];
|
||||
@@ -63022,17 +63032,6 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
parseCustomProps: function parseCustomProps() {
|
||||
var _this = this;
|
||||
|
||||
var ownProps = ['type', 'title', 'properties', 'items', 'required'].concat(_toConsumableArray(Object.keys(this.advancedAttr)));
|
||||
Object.keys(this.pickValue).forEach(function (key) {
|
||||
ownProps.indexOf(key) === -1 && _this.confirmAddCustomNode({
|
||||
key: key,
|
||||
value: _this.pickValue[key]
|
||||
});
|
||||
});
|
||||
},
|
||||
onInputName: function onInputName(e) {
|
||||
var oldKey = this.pickKey;
|
||||
var newKey = e.target.value;
|
||||
@@ -63052,12 +63051,12 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
}
|
||||
},
|
||||
onChangeType: function onChangeType() {
|
||||
var _this2 = this;
|
||||
var _this = this;
|
||||
|
||||
this.parseCustomProps(); // 删除自定义属性
|
||||
|
||||
this.customProps.forEach(function (item) {
|
||||
_this2.$delete(_this2.pickValue, item.key);
|
||||
_this.$delete(_this.pickValue, item.key);
|
||||
});
|
||||
this.customProps = [];
|
||||
this.$delete(this.pickValue, 'properties');
|
||||
@@ -63098,17 +63097,17 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
}
|
||||
},
|
||||
_deepCheck: function _deepCheck(checked, node) {
|
||||
var _this3 = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (node.type === 'object' && node.properties) {
|
||||
checked ? this.$set(node, 'required', Object.keys(node.properties)) : this.$delete(node, 'required');
|
||||
Object.keys(node.properties).forEach(function (key) {
|
||||
return _this3._deepCheck(checked, node.properties[key]);
|
||||
return _this2._deepCheck(checked, node.properties[key]);
|
||||
});
|
||||
} else if (node.type === 'array' && node.items.type === 'object') {
|
||||
checked ? this.$set(node.items, 'required', Object.keys(node.items.properties)) : this.$delete(node.items, 'required');
|
||||
Object.keys(node.items.properties).forEach(function (key) {
|
||||
return _this3._deepCheck(checked, node.items.properties[key]);
|
||||
return _this2._deepCheck(checked, node.items.properties[key]);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -63137,13 +63136,45 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
type: type
|
||||
});
|
||||
},
|
||||
parseCustomProps: function parseCustomProps() {
|
||||
var _this3 = this;
|
||||
|
||||
var ownProps = this.ownProps;
|
||||
Object.keys(this.pickValue).forEach(function (key) {
|
||||
if (ownProps.indexOf(key) === -1) {
|
||||
_this3.confirmAddCustomNode({
|
||||
key: key,
|
||||
value: _this3.pickValue[key]
|
||||
}); // this.$delete(this.pickValue,key)
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
addCustomNode: function addCustomNode() {
|
||||
this.$set(this.addProp, 'key', this._joinName());
|
||||
this.$set(this.addProp, 'value', '');
|
||||
this.customing = true;
|
||||
},
|
||||
removeCustomNode: function removeCustomNode(key) {
|
||||
var _this4 = this;
|
||||
|
||||
this.customProps.forEach(function (item, index) {
|
||||
if (item.key === key) {
|
||||
_this4.customProps.splice(index, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmAddCustomNode: function confirmAddCustomNode(prop) {
|
||||
var p = prop || this.addProp;
|
||||
var existKey = false;
|
||||
this.customProps.forEach(function (item) {
|
||||
if (item.key === prop.key) {
|
||||
existKey = true;
|
||||
}
|
||||
});
|
||||
if (existKey) return;
|
||||
this.customProps.push(p);
|
||||
this.addProp = {};
|
||||
this.customing = false;
|
||||
@@ -63168,12 +63199,16 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
this.advancedValue = _objectSpread2({}, this.advanced.value);
|
||||
|
||||
for (var k in this.advancedValue) {
|
||||
if (this.pickValue[k]) this.advancedValue[k] = this.pickValue[k];
|
||||
if (this.pickValue[k]) {
|
||||
this.advancedValue[k] = this.pickValue[k];
|
||||
}
|
||||
}
|
||||
|
||||
this.parseCustomProps();
|
||||
},
|
||||
handleOk: function handleOk() {
|
||||
var _this5 = this;
|
||||
|
||||
this.modalVisible = false;
|
||||
|
||||
for (var key in this.advancedValue) {
|
||||
@@ -63184,6 +63219,12 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
}
|
||||
}
|
||||
|
||||
var diffKey = this._pickDiffKey();
|
||||
|
||||
diffKey.forEach(function (key) {
|
||||
return _this5.$delete(_this5.pickValue, key);
|
||||
});
|
||||
|
||||
var _iterator2 = _createForOfIteratorHelper(this.customProps),
|
||||
_step2;
|
||||
|
||||
@@ -63197,13 +63238,21 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
},
|
||||
_pickDiffKey: function _pickDiffKey() {
|
||||
var _this6 = this;
|
||||
|
||||
var keys = Object.keys(this.pickValue);
|
||||
return keys.filter(function (item) {
|
||||
return _this6.ownProps.indexOf(item) === -1;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// CONCATENATED MODULE: ./packages/json-schema-editor/main.vue?vue&type=script&lang=js&
|
||||
/* harmony default export */ var json_schema_editor_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
|
||||
// EXTERNAL MODULE: ./packages/json-schema-editor/main.vue?vue&type=style&index=0&id=3b2b9f56&scoped=true&lang=css&
|
||||
var mainvue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css_ = __webpack_require__("38ce");
|
||||
// EXTERNAL MODULE: ./packages/json-schema-editor/main.vue?vue&type=style&index=0&id=43dcb7a8&scoped=true&lang=css&
|
||||
var mainvue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css_ = __webpack_require__("4e37");
|
||||
|
||||
// EXTERNAL MODULE: ./packages/json-schema-editor/main.vue?vue&type=style&index=1&lang=css&
|
||||
var mainvue_type_style_index_1_lang_css_ = __webpack_require__("6dc4");
|
||||
@@ -63320,11 +63369,11 @@ function normalizeComponent (
|
||||
|
||||
var main_component = normalizeComponent(
|
||||
json_schema_editor_mainvue_type_script_lang_js_,
|
||||
mainvue_type_template_id_3b2b9f56_scoped_true_render,
|
||||
mainvue_type_template_id_43dcb7a8_scoped_true_render,
|
||||
staticRenderFns,
|
||||
false,
|
||||
null,
|
||||
"3b2b9f56",
|
||||
"43dcb7a8",
|
||||
null
|
||||
|
||||
)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8681,17 +8681,6 @@ module.exports = has;
|
||||
})));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "38ce":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b08a");
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* unused harmony reexport * */
|
||||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "393a":
|
||||
@@ -14485,6 +14474,17 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "4e37":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8fb2");
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* unused harmony reexport * */
|
||||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "4e71":
|
||||
@@ -24835,6 +24835,13 @@ function copyObject(source, props, object, customizer) {
|
||||
module.exports = copyObject;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "8fb2":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "9020":
|
||||
@@ -28527,13 +28534,6 @@ function baseUnary(func) {
|
||||
module.exports = baseUnary;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "b08a":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "b0c0":
|
||||
@@ -41803,18 +41803,18 @@ function _objectSpread2(target) {
|
||||
|
||||
return target;
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"61d6070a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/json-schema-editor/main.vue?vue&type=template&id=3b2b9f56&scoped=true&
|
||||
var mainvue_type_template_id_3b2b9f56_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"json-schema-editor"},[_c('a-row',{staticClass:"row",attrs:{"gutter":10}},[_c('a-col',{staticClass:"ant-col-name",attrs:{"span":8}},[_c('div',{staticClass:"ant-col-name-c",style:({marginLeft:((20*_vm.deep) + "px")})},[(_vm.pickValue.type==='object')?_c('a-button',{staticStyle:{"color":"rgba(0,0,0,.65)"},attrs:{"type":"link","icon":_vm.hidden?'caret-right':'caret-down'},on:{"click":function($event){_vm.hidden = !_vm.hidden}}}):_c('span',{staticStyle:{"width":"32px","display":"inline-block"}}),_c('a-input',{staticClass:"ant-col-name-input",attrs:{"disabled":_vm.disabled || _vm.root,"value":_vm.pickKey},on:{"blur":_vm.onInputName}})],1),(_vm.root)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['checked_all'])},slot:"title"},[_vm._v("全选")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":!_vm.isObject && !_vm.isArray},on:{"change":_vm.onRootCheck}})],1):_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['required'])},slot:"title"},[_vm._v("是否必填")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":_vm.isItem,"checked":_vm.checked},on:{"change":_vm.onCheck}})],1)],1),_c('a-col',{attrs:{"span":4}},[_c('a-select',{staticClass:"ant-col-type",attrs:{"disabled":_vm.disabledType,"getPopupContainer":function (triggerNode) {
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"61d6070a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/json-schema-editor/main.vue?vue&type=template&id=43dcb7a8&scoped=true&
|
||||
var mainvue_type_template_id_43dcb7a8_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"json-schema-editor"},[_c('a-row',{staticClass:"row",attrs:{"gutter":10}},[_c('a-col',{staticClass:"ant-col-name",attrs:{"span":8}},[_c('div',{staticClass:"ant-col-name-c",style:({marginLeft:((20*_vm.deep) + "px")})},[(_vm.pickValue.type==='object')?_c('a-button',{staticStyle:{"color":"rgba(0,0,0,.65)"},attrs:{"type":"link","icon":_vm.hidden?'caret-right':'caret-down'},on:{"click":function($event){_vm.hidden = !_vm.hidden}}}):_c('span',{staticStyle:{"width":"32px","display":"inline-block"}}),_c('a-input',{staticClass:"ant-col-name-input",attrs:{"disabled":_vm.disabled || _vm.root,"value":_vm.pickKey},on:{"blur":_vm.onInputName}})],1),(_vm.root)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['checked_all'])},slot:"title"},[_vm._v("全选")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":!_vm.isObject && !_vm.isArray},on:{"change":_vm.onRootCheck}})],1):_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['required'])},slot:"title"},[_vm._v("是否必填")]),_c('a-checkbox',{staticClass:"ant-col-name-required",attrs:{"disabled":_vm.isItem,"checked":_vm.checked},on:{"change":_vm.onCheck}})],1)],1),_c('a-col',{attrs:{"span":4}},[_c('a-select',{staticClass:"ant-col-type",attrs:{"disabled":_vm.disabledType,"getPopupContainer":function (triggerNode) {
|
||||
return triggerNode.parentNode || _vm.document.body;
|
||||
}},on:{"change":_vm.onChangeType},model:{value:(_vm.pickValue.type),callback:function ($$v) {_vm.$set(_vm.pickValue, "type", $$v)},expression:"pickValue.type"}},_vm._l((_vm.TYPE_NAME),function(t){return _c('a-select-option',{key:t},[_vm._v(" "+_vm._s(t)+" ")])}),1)],1),_c('a-col',[_c('a-input',{staticClass:"ant-col-title",attrs:{"placeholder":_vm.local['title']},model:{value:(_vm.pickValue.title),callback:function ($$v) {_vm.$set(_vm.pickValue, "title", $$v)},expression:"pickValue.title"}})],1),_c('a-col',{staticClass:"ant-col-setting",attrs:{"span":6}},[_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['adv_setting'])},slot:"title"},[_vm._v("高级设置")]),_c('a-button',{staticClass:"setting-icon",attrs:{"type":"link","icon":"setting"},on:{"click":_vm.onSetting}})],1),(_vm.isObject)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['add_child_node'])},slot:"title"},[_vm._v("添加子节点")]),_c('a-button',{staticClass:"plus-icon",attrs:{"type":"link","icon":"plus"},on:{"click":_vm.addChild}})],1):_vm._e(),(!_vm.root && !_vm.isItem)?_c('a-tooltip',[_c('span',{attrs:{"slot":"title"},domProps:{"textContent":_vm._s(_vm.local['remove_node'])},slot:"title"},[_vm._v("删除节点")]),_c('a-button',{staticClass:"close-icon ant-btn-icon-only",attrs:{"type":"link"},on:{"click":_vm.removeNode}},[_c('i',{staticClass:"anticon anticon-plus",attrs:{"aria-label":"icon: plus"}},[_c('svg',{attrs:{"viewBox":"64 64 896 896","data-icon":"plus","width":"1em","height":"1em","fill":"currentColor","aria-hidden":"true","focusable":"false"}},[_c('path',{attrs:{"d":"M810.666667 273.493333L750.506667 213.333333 512 451.84 273.493333 213.333333 213.333333 273.493333 451.84 512 213.333333 750.506667 273.493333 810.666667 512 572.16 750.506667 810.666667 810.666667 750.506667 572.16 512z","p-id":"1142"}})])])])],1):_vm._e()],1)],1),(!_vm.hidden&&_vm.pickValue.properties && !_vm.isArray)?_vm._l((_vm.pickValue.properties),function(item,key,index){
|
||||
var _obj;
|
||||
return _c('json-schema-editor',{key:index,staticClass:"children",attrs:{"value":( _obj = {}, _obj[key] = item, _obj ),"parent":_vm.pickValue,"deep":_vm.deep+1,"root":false,"lang":_vm.lang,"custom":_vm.custom}})}):_vm._e(),(_vm.isArray)?[_c('json-schema-editor',{staticClass:"children",attrs:{"value":{items:_vm.pickValue.items},"deep":_vm.deep+1,"disabled":"","isItem":"","root":false,"lang":_vm.lang,"custom":_vm.custom}})]:_vm._e(),(_vm.modalVisible)?_c('a-modal',{attrs:{"title":_vm.local['adv_setting'],"maskClosable":false,"okText":_vm.local['ok'],"cancelText":_vm.local['cancel'],"width":"800px","dialogClass":"json-schema-editor-advanced-modal"},on:{"ok":_vm.handleOk},model:{value:(_vm.modalVisible),callback:function ($$v) {_vm.modalVisible=$$v},expression:"modalVisible"}},[_c('h3',{domProps:{"textContent":_vm._s(_vm.local['base_setting'])}},[_vm._v("基础设置")]),_c('a-form',{staticClass:"ant-advanced-search-form",model:{value:(_vm.advancedValue),callback:function ($$v) {_vm.advancedValue=$$v},expression:"advancedValue"}},[_c('a-row',{attrs:{"gutter":6}},_vm._l((_vm.advancedValue),function(item,key){return _c('a-col',{key:key,attrs:{"span":8}},[_c('a-form-item',[_c('span',[_vm._v(_vm._s(_vm.local[key]))]),(_vm.advancedAttr[key].type === 'integer' || _vm.advancedAttr[key].type === 'number')?_c('a-input-number',{staticStyle:{"width":"100%"},attrs:{"placeholder":key},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}}):(_vm.advancedAttr[key].type === 'boolean')?_c('span',{staticStyle:{"display":"inline-block","width":"100%"}},[_c('a-switch',{model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}})],1):(key === 'enum')?_c('a-textarea',{attrs:{"value":_vm.enumText,"rows":2,"placeholder":_vm.local['enum_msg']},on:{"blur":_vm.changeEnumValue}}):(_vm.advancedAttr[key].type === 'array')?_c('a-select',{staticStyle:{"width":"100%"},attrs:{"getPopupContainer":function (triggerNode) {
|
||||
return triggerNode.parentNode || _vm.document.body;
|
||||
},"placeholder":_vm.local[key]},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}},[_c('a-select-option',{attrs:{"value":""}},[_vm._v(_vm._s(_vm.local['nothing']))]),_vm._l((_vm.advancedAttr[key].enums),function(t){return _c('a-select-option',{key:t},[_vm._v(" "+_vm._s(t)+" ")])})],2):_c('a-input',{staticStyle:{"width":"100%"},attrs:{"placeholder":key},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}})],1)],1)}),1)],1),_c('h3',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],domProps:{"textContent":_vm._s(_vm.local['add_custom'])}},[_vm._v("添加自定义属性")]),_c('a-form',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],staticClass:"ant-advanced-search-form"},[_c('a-row',{attrs:{"gutter":6}},[_vm._l((_vm.customProps),function(item){return _c('a-col',{key:item.key,attrs:{"span":8}},[_c('a-form-item',{attrs:{"label":item.key}},[_c('a-input',{staticStyle:{"width":"calc(100% - 30px)"},model:{value:(item.value),callback:function ($$v) {_vm.$set(item, "value", $$v)},expression:"item.value"}}),_c('a-button',{staticStyle:{"width":"30px"},attrs:{"icon":"close","type":"link"},on:{"click":function($event){_vm.customProps.splice(_vm.customProps.indexOf(item),1)}}})],1)],1)}),_c('a-col',{directives:[{name:"show",rawName:"v-show",value:(_vm.addProp.key != undefined),expression:"addProp.key != undefined"}],attrs:{"span":8}},[_c('a-form-item',[_c('a-input',{staticStyle:{"width":"100px"},attrs:{"slot":"label"},slot:"label",model:{value:(_vm.addProp.key),callback:function ($$v) {_vm.$set(_vm.addProp, "key", $$v)},expression:"addProp.key"}}),_c('a-input',{staticStyle:{"width":"100%"},model:{value:(_vm.addProp.value),callback:function ($$v) {_vm.$set(_vm.addProp, "value", $$v)},expression:"addProp.value"}})],1)],1),_c('a-col',{attrs:{"span":8}},[_c('a-form-item',[(_vm.customing)?_c('a-button',{attrs:{"icon":"check","type":"link"},on:{"click":function($event){return _vm.confirmAddCustomNode(null)}}}):_c('a-tooltip',{attrs:{"title":_vm.local['add_custom']}},[_c('a-button',{attrs:{"icon":"plus","type":"link"},on:{"click":_vm.addCustomNode}})],1)],1)],1)],2)],1),_c('h3',{domProps:{"textContent":_vm._s(_vm.local['preview'])}},[_vm._v("预览")]),_c('pre',{staticStyle:{"width":"100%"}},[_vm._v(_vm._s(_vm.completeNodeValue))])],1):_vm._e()],2)}
|
||||
},"placeholder":_vm.local[key]},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}},[_c('a-select-option',{attrs:{"value":""}},[_vm._v(_vm._s(_vm.local['nothing']))]),_vm._l((_vm.advancedAttr[key].enums),function(t){return _c('a-select-option',{key:t},[_vm._v(" "+_vm._s(t)+" ")])})],2):_c('a-input',{staticStyle:{"width":"100%"},attrs:{"placeholder":key},model:{value:(_vm.advancedValue[key]),callback:function ($$v) {_vm.$set(_vm.advancedValue, key, $$v)},expression:"advancedValue[key]"}})],1)],1)}),1)],1),_c('h3',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],domProps:{"textContent":_vm._s(_vm.local['add_custom'])}},[_vm._v("添加自定义属性")]),_c('a-form',{directives:[{name:"show",rawName:"v-show",value:(_vm.custom),expression:"custom"}],staticClass:"ant-advanced-search-form"},[_c('a-row',{attrs:{"gutter":6}},[_vm._l((_vm.customProps),function(item){return _c('a-col',{key:item.key,attrs:{"span":8}},[_c('a-form-item',{attrs:{"label":item.key}},[_c('a-input',{staticStyle:{"width":"calc(100% - 30px)"},model:{value:(item.value),callback:function ($$v) {_vm.$set(item, "value", $$v)},expression:"item.value"}}),_c('a-button',{staticStyle:{"width":"30px"},attrs:{"icon":"close","type":"link"},on:{"click":function($event){return _vm.removeCustomNode(item.key)}}})],1)],1)}),_c('a-col',{directives:[{name:"show",rawName:"v-show",value:(_vm.addProp.key != undefined),expression:"addProp.key != undefined"}],attrs:{"span":8}},[_c('a-form-item',[_c('a-input',{staticStyle:{"width":"100px"},attrs:{"slot":"label"},slot:"label",model:{value:(_vm.addProp.key),callback:function ($$v) {_vm.$set(_vm.addProp, "key", $$v)},expression:"addProp.key"}}),_c('a-input',{staticStyle:{"width":"100%"},model:{value:(_vm.addProp.value),callback:function ($$v) {_vm.$set(_vm.addProp, "value", $$v)},expression:"addProp.value"}})],1)],1),_c('a-col',{attrs:{"span":8}},[_c('a-form-item',[(_vm.customing)?_c('a-button',{attrs:{"icon":"check","type":"link"},on:{"click":function($event){return _vm.confirmAddCustomNode(null)}}}):_c('a-tooltip',{attrs:{"title":_vm.local['add_custom']}},[_c('a-button',{attrs:{"icon":"plus","type":"link"},on:{"click":_vm.addCustomNode}})],1)],1)],1)],2)],1),_c('h3',{domProps:{"textContent":_vm._s(_vm.local['preview'])}},[_vm._v("预览")]),_c('pre',{staticStyle:{"width":"100%"}},[_vm._v(_vm._s(_vm.completeNodeValue))])],1):_vm._e()],2)}
|
||||
var staticRenderFns = []
|
||||
|
||||
|
||||
// CONCATENATED MODULE: ./packages/json-schema-editor/main.vue?vue&type=template&id=3b2b9f56&scoped=true&
|
||||
// CONCATENATED MODULE: ./packages/json-schema-editor/main.vue?vue&type=template&id=43dcb7a8&scoped=true&
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
|
||||
var es_array_concat = __webpack_require__("99af");
|
||||
@@ -41858,6 +41858,21 @@ var es_string_split = __webpack_require__("1276");
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
|
||||
var web_dom_collections_iterator = __webpack_require__("ddb0");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
|
||||
var es_symbol_description = __webpack_require__("e01a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
|
||||
var es_symbol_iterator = __webpack_require__("d28b");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
|
||||
var es_array_from = __webpack_require__("a630");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
|
||||
var es_array_slice = __webpack_require__("fb6a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
|
||||
var es_regexp_to_string = __webpack_require__("25f0");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
||||
function _arrayLikeToArray(arr, len) {
|
||||
if (len == null || len > arr.length) len = arr.length;
|
||||
@@ -41868,37 +41883,6 @@ function _arrayLikeToArray(arr, len) {
|
||||
|
||||
return arr2;
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
||||
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
|
||||
var es_symbol_description = __webpack_require__("e01a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
|
||||
var es_symbol_iterator = __webpack_require__("d28b");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
|
||||
var es_array_from = __webpack_require__("a630");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
|
||||
var es_array_slice = __webpack_require__("fb6a");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
|
||||
var es_regexp_to_string = __webpack_require__("25f0");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
||||
|
||||
|
||||
@@ -41915,18 +41899,6 @@ function _unsupportedIterableToArray(o, minLen) {
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js
|
||||
|
||||
|
||||
@@ -41991,6 +41963,34 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
||||
}
|
||||
};
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
||||
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
||||
function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
||||
|
||||
|
||||
|
||||
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/ant-design-vue/es/style/index.css
|
||||
var es_style = __webpack_require__("b550");
|
||||
|
||||
@@ -62769,6 +62769,7 @@ var langs = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
@@ -62981,6 +62982,9 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
advancedAttr: function advancedAttr() {
|
||||
return TYPE[this.pickValue.type].attr;
|
||||
},
|
||||
ownProps: function ownProps() {
|
||||
return ['type', 'title', 'properties', 'items', 'required'].concat(_toConsumableArray(Object.keys(this.advancedAttr)));
|
||||
},
|
||||
advancedNotEmptyValue: function advancedNotEmptyValue() {
|
||||
var jsonNode = Object.assign({}, this.advancedValue);
|
||||
|
||||
@@ -62993,6 +62997,8 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
completeNodeValue: function completeNodeValue() {
|
||||
var t = {};
|
||||
|
||||
var basicValue = _objectSpread2({}, this.pickValue);
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(this.customProps),
|
||||
_step;
|
||||
|
||||
@@ -63007,7 +63013,11 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return Object.assign({}, this.pickValue, this.advancedNotEmptyValue, t);
|
||||
this._pickDiffKey().forEach(function (key) {
|
||||
return delete basicValue[key];
|
||||
});
|
||||
|
||||
return Object.assign({}, basicValue, t, this.advancedNotEmptyValue);
|
||||
},
|
||||
enumText: function enumText() {
|
||||
var t = this.advancedValue['enum'];
|
||||
@@ -63031,17 +63041,6 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
parseCustomProps: function parseCustomProps() {
|
||||
var _this = this;
|
||||
|
||||
var ownProps = ['type', 'title', 'properties', 'items', 'required'].concat(_toConsumableArray(Object.keys(this.advancedAttr)));
|
||||
Object.keys(this.pickValue).forEach(function (key) {
|
||||
ownProps.indexOf(key) === -1 && _this.confirmAddCustomNode({
|
||||
key: key,
|
||||
value: _this.pickValue[key]
|
||||
});
|
||||
});
|
||||
},
|
||||
onInputName: function onInputName(e) {
|
||||
var oldKey = this.pickKey;
|
||||
var newKey = e.target.value;
|
||||
@@ -63061,12 +63060,12 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
}
|
||||
},
|
||||
onChangeType: function onChangeType() {
|
||||
var _this2 = this;
|
||||
var _this = this;
|
||||
|
||||
this.parseCustomProps(); // 删除自定义属性
|
||||
|
||||
this.customProps.forEach(function (item) {
|
||||
_this2.$delete(_this2.pickValue, item.key);
|
||||
_this.$delete(_this.pickValue, item.key);
|
||||
});
|
||||
this.customProps = [];
|
||||
this.$delete(this.pickValue, 'properties');
|
||||
@@ -63107,17 +63106,17 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
}
|
||||
},
|
||||
_deepCheck: function _deepCheck(checked, node) {
|
||||
var _this3 = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (node.type === 'object' && node.properties) {
|
||||
checked ? this.$set(node, 'required', Object.keys(node.properties)) : this.$delete(node, 'required');
|
||||
Object.keys(node.properties).forEach(function (key) {
|
||||
return _this3._deepCheck(checked, node.properties[key]);
|
||||
return _this2._deepCheck(checked, node.properties[key]);
|
||||
});
|
||||
} else if (node.type === 'array' && node.items.type === 'object') {
|
||||
checked ? this.$set(node.items, 'required', Object.keys(node.items.properties)) : this.$delete(node.items, 'required');
|
||||
Object.keys(node.items.properties).forEach(function (key) {
|
||||
return _this3._deepCheck(checked, node.items.properties[key]);
|
||||
return _this2._deepCheck(checked, node.items.properties[key]);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -63146,13 +63145,45 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
type: type
|
||||
});
|
||||
},
|
||||
parseCustomProps: function parseCustomProps() {
|
||||
var _this3 = this;
|
||||
|
||||
var ownProps = this.ownProps;
|
||||
Object.keys(this.pickValue).forEach(function (key) {
|
||||
if (ownProps.indexOf(key) === -1) {
|
||||
_this3.confirmAddCustomNode({
|
||||
key: key,
|
||||
value: _this3.pickValue[key]
|
||||
}); // this.$delete(this.pickValue,key)
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
addCustomNode: function addCustomNode() {
|
||||
this.$set(this.addProp, 'key', this._joinName());
|
||||
this.$set(this.addProp, 'value', '');
|
||||
this.customing = true;
|
||||
},
|
||||
removeCustomNode: function removeCustomNode(key) {
|
||||
var _this4 = this;
|
||||
|
||||
this.customProps.forEach(function (item, index) {
|
||||
if (item.key === key) {
|
||||
_this4.customProps.splice(index, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmAddCustomNode: function confirmAddCustomNode(prop) {
|
||||
var p = prop || this.addProp;
|
||||
var existKey = false;
|
||||
this.customProps.forEach(function (item) {
|
||||
if (item.key === prop.key) {
|
||||
existKey = true;
|
||||
}
|
||||
});
|
||||
if (existKey) return;
|
||||
this.customProps.push(p);
|
||||
this.addProp = {};
|
||||
this.customing = false;
|
||||
@@ -63177,12 +63208,16 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
this.advancedValue = _objectSpread2({}, this.advanced.value);
|
||||
|
||||
for (var k in this.advancedValue) {
|
||||
if (this.pickValue[k]) this.advancedValue[k] = this.pickValue[k];
|
||||
if (this.pickValue[k]) {
|
||||
this.advancedValue[k] = this.pickValue[k];
|
||||
}
|
||||
}
|
||||
|
||||
this.parseCustomProps();
|
||||
},
|
||||
handleOk: function handleOk() {
|
||||
var _this5 = this;
|
||||
|
||||
this.modalVisible = false;
|
||||
|
||||
for (var key in this.advancedValue) {
|
||||
@@ -63193,6 +63228,12 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
}
|
||||
}
|
||||
|
||||
var diffKey = this._pickDiffKey();
|
||||
|
||||
diffKey.forEach(function (key) {
|
||||
return _this5.$delete(_this5.pickValue, key);
|
||||
});
|
||||
|
||||
var _iterator2 = _createForOfIteratorHelper(this.customProps),
|
||||
_step2;
|
||||
|
||||
@@ -63206,13 +63247,21 @@ modal.install(external_commonjs_vue_commonjs2_vue_root_Vue_default.a);
|
||||
} finally {
|
||||
_iterator2.f();
|
||||
}
|
||||
},
|
||||
_pickDiffKey: function _pickDiffKey() {
|
||||
var _this6 = this;
|
||||
|
||||
var keys = Object.keys(this.pickValue);
|
||||
return keys.filter(function (item) {
|
||||
return _this6.ownProps.indexOf(item) === -1;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// CONCATENATED MODULE: ./packages/json-schema-editor/main.vue?vue&type=script&lang=js&
|
||||
/* harmony default export */ var json_schema_editor_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
|
||||
// EXTERNAL MODULE: ./packages/json-schema-editor/main.vue?vue&type=style&index=0&id=3b2b9f56&scoped=true&lang=css&
|
||||
var mainvue_type_style_index_0_id_3b2b9f56_scoped_true_lang_css_ = __webpack_require__("38ce");
|
||||
// EXTERNAL MODULE: ./packages/json-schema-editor/main.vue?vue&type=style&index=0&id=43dcb7a8&scoped=true&lang=css&
|
||||
var mainvue_type_style_index_0_id_43dcb7a8_scoped_true_lang_css_ = __webpack_require__("4e37");
|
||||
|
||||
// EXTERNAL MODULE: ./packages/json-schema-editor/main.vue?vue&type=style&index=1&lang=css&
|
||||
var mainvue_type_style_index_1_lang_css_ = __webpack_require__("6dc4");
|
||||
@@ -63329,11 +63378,11 @@ function normalizeComponent (
|
||||
|
||||
var main_component = normalizeComponent(
|
||||
json_schema_editor_mainvue_type_script_lang_js_,
|
||||
mainvue_type_template_id_3b2b9f56_scoped_true_render,
|
||||
mainvue_type_template_id_43dcb7a8_scoped_true_render,
|
||||
staticRenderFns,
|
||||
false,
|
||||
null,
|
||||
"3b2b9f56",
|
||||
"43dcb7a8",
|
||||
null
|
||||
|
||||
)
|
||||
|
||||
10
lib/json-schema-editor-vue.umd.min.js
vendored
10
lib/json-schema-editor-vue.umd.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "json-schema-editor-vue",
|
||||
"version": "2.0.4",
|
||||
"version": "2.1.0",
|
||||
"author": "zhangyq",
|
||||
"description": "A json-schema editor of high efficient and easy-to-use, base on Vue",
|
||||
"keywords": [
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<a-col :span="8" v-for="item in customProps" :key="item.key">
|
||||
<a-form-item :label="item.key">
|
||||
<a-input v-model="item.value" style="width:calc(100% - 30px)"/>
|
||||
<a-button icon="close" type="link" @click="customProps.splice(customProps.indexOf(item),1)" style="width:30px"></a-button>
|
||||
<a-button icon="close" type="link" @click="removeCustomNode(item.key)" style="width:30px"></a-button>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8" v-show="addProp.key != undefined">
|
||||
@@ -197,6 +197,9 @@ export default {
|
||||
advancedAttr(){
|
||||
return TYPE[this.pickValue.type].attr
|
||||
},
|
||||
ownProps () {
|
||||
return [ 'type', 'title', 'properties', 'items','required', ...Object.keys(this.advancedAttr)]
|
||||
},
|
||||
advancedNotEmptyValue(){
|
||||
const jsonNode = Object.assign({},this.advancedValue);
|
||||
for(let key in jsonNode){
|
||||
@@ -206,10 +209,12 @@ export default {
|
||||
},
|
||||
completeNodeValue(){
|
||||
const t = {}
|
||||
const basicValue = { ...this.pickValue }
|
||||
for(const item of this.customProps){
|
||||
t[item.key] = item.value
|
||||
}
|
||||
return Object.assign({},this.pickValue,this.advancedNotEmptyValue, t)
|
||||
this._pickDiffKey().forEach(key => delete basicValue[key])
|
||||
return Object.assign({}, basicValue, t,this.advancedNotEmptyValue)
|
||||
},
|
||||
enumText () {
|
||||
const t = this.advancedValue['enum']
|
||||
@@ -232,12 +237,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
parseCustomProps () {
|
||||
const ownProps = [ 'type', 'title', 'properties', 'items','required', ...Object.keys(this.advancedAttr)]
|
||||
Object.keys(this.pickValue).forEach(key => {
|
||||
ownProps.indexOf(key) === -1 && this.confirmAddCustomNode({ key: key, value: this.pickValue[key] })
|
||||
})
|
||||
},
|
||||
onInputName(e){
|
||||
const oldKey = this.pickKey
|
||||
const newKey = e.target.value
|
||||
@@ -327,13 +326,37 @@ export default {
|
||||
const props = node.properties
|
||||
this.$set(props,name,{type: type})
|
||||
},
|
||||
parseCustomProps () {
|
||||
const ownProps = this.ownProps
|
||||
Object.keys(this.pickValue).forEach(key => {
|
||||
if (ownProps.indexOf(key) === -1) {
|
||||
this.confirmAddCustomNode({ key: key, value: this.pickValue[key] })
|
||||
// this.$delete(this.pickValue,key)
|
||||
}
|
||||
})
|
||||
},
|
||||
addCustomNode(){
|
||||
this.$set(this.addProp,'key',this._joinName())
|
||||
this.$set(this.addProp,'value','')
|
||||
this.customing = true
|
||||
},
|
||||
removeCustomNode(key) {
|
||||
this.customProps.forEach((item,index) => {
|
||||
if (item.key === key) {
|
||||
this.customProps.splice(index,1)
|
||||
return
|
||||
}
|
||||
})
|
||||
},
|
||||
confirmAddCustomNode(prop) {
|
||||
const p = prop || this.addProp
|
||||
let existKey = false
|
||||
this.customProps.forEach(item => {
|
||||
if (item.key === prop.key) {
|
||||
existKey = true
|
||||
}
|
||||
})
|
||||
if (existKey) return
|
||||
this.customProps.push(p)
|
||||
this.addProp = {}
|
||||
this.customing = false
|
||||
@@ -354,7 +377,9 @@ export default {
|
||||
this.modalVisible = true
|
||||
this.advancedValue = { ...this.advanced.value }
|
||||
for(const k in this.advancedValue) {
|
||||
if(this.pickValue[k]) this.advancedValue[k] = this.pickValue[k]
|
||||
if(this.pickValue[k]) {
|
||||
this.advancedValue[k] = this.pickValue[k]
|
||||
}
|
||||
}
|
||||
this.parseCustomProps()
|
||||
},
|
||||
@@ -368,9 +393,15 @@ export default {
|
||||
this.$set(this.pickValue,key,this.advancedValue[key])
|
||||
}
|
||||
}
|
||||
const diffKey = this._pickDiffKey()
|
||||
diffKey.forEach(key => this.$delete(this.pickValue,key))
|
||||
for(const item of this.customProps){
|
||||
this.$set(this.pickValue,item.key,item.value)
|
||||
}
|
||||
},
|
||||
_pickDiffKey () {
|
||||
const keys = Object.keys(this.pickValue)
|
||||
return keys.filter(item => this.ownProps.indexOf(item) === -1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user