@her-activity-components/rules-widget
Advanced tools
| var _her_activity_components_rules_widget_0_1_0=function(e){"use strict";var t,n=function(e,t,n,i,r,o,a,s){var d,l=("function"==typeof n?n.options:n)||{};if(l.__file="consumer.vue",l.render||(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),l._scopeId=i,t&&(d=function(e){t.call(this,a(e))}),void 0!==d)if(l.functional){var c=l.render;l.render=function(e,t){return d.call(t),c(e,t)}}else{var m=l.beforeCreate;l.beforeCreate=m?[].concat(m,d):[d]}return l}({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"rules-widget"},[e.title?n("h5",{staticClass:"title",style:{color:e.titleColor}},[e._v(e._s(e.title))]):e._e(),e._v(" "),n("div",{staticClass:"content",domProps:{innerHTML:e._s(e.content)}}),e._v(" "),e.copyright?n("p",{staticClass:"copyright",style:{color:e.copyrightColor}},[e._v(e._s(e.copyright))]):e._e()])},staticRenderFns:[]},function(e){e&&e("data-v-1f46e475_0",{source:"\n.rules-widget[data-v-1f46e475]{font-size:100px;padding:0.2em 0.16em\n}\n.title[data-v-1f46e475]{font-size:0.2em;font-weight:700;line-height:1;margin-bottom:1em;text-align:center\n}\n.content[data-v-1f46e475]{font-size:0.14em\n}\n.copyright[data-v-1f46e475]{font-size:0.12em;line-height:1;margin-bottom:0.8333em;margin-top:2.5em;text-align:center\n}\n.rem-16 .rules-widget[data-v-1f46e475]{font-size:6.25rem\n}",map:void 0,media:void 0})},{props:{title:String,titleColor:String,content:String,copyright:String,copyrightColor:String}},"data-v-1f46e475",!1,0,function e(){var l=document.head||document.getElementsByTagName("head")[0],c=e.styles||(e.styles={}),m="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,t){if(!document.querySelector('style[data-vue-ssr-id~="'+e+'"]')){var n=m?t.media||"default":e,i=c[n]||(c[n]={ids:[],parts:[],element:void 0});if(!i.ids.includes(e)){var r=t.source,o=i.ids.length;if(i.ids.push(e),t.map&&(r+="\n/*# sourceURL="+t.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),m&&(i.element=i.element||document.querySelector("style[data-group="+n+"]")),!i.element){var a=i.element=document.createElement("style");a.type="text/css",t.media&&a.setAttribute("media",t.media),m&&(a.setAttribute("data-group",n),a.setAttribute("data-next-index","0")),l.appendChild(a)}if(m&&(o=parseInt(i.element.getAttribute("data-next-index")),i.element.setAttribute("data-next-index",o+1)),i.element.styleSheet)i.parts.push(r),i.element.styleSheet.cssText=i.parts.filter(Boolean).join("\n");else{var s=document.createTextNode(r),d=i.element.childNodes;d[o]&&i.element.removeChild(d[o]),d.length?i.element.insertBefore(s,d[o]):i.element.appendChild(s)}}}}});return"undefined"!=typeof window?t=window.Vue:"undefined"!=typeof global&&(t=global.Vue),t&&t.component("@her-activity-components/rules-widget@0.1.0",n),e.$=n,e}({}); |
| var _her_activity_components_rules_widget_0_1_0=function(e){"use strict";var i,o,r,l,a,t={height:300,language:"zh_CN",plugins:["code","colorpicker","fullscreen","link","lists","image","preview","textcolor"],toolbar:"undo redo | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media"};var n,s=function(e,t,n,o,i,r,l,a){var s,d=("function"==typeof n?n.options:n)||{};if(d.__file="provider.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),d._scopeId=o,t&&(s=function(e){t.call(this,l(e))}),void 0!==s)if(d.functional){var c=d.render;d.render=function(e,t){return s.call(t),c(e,t)}}else{var u=d.beforeCreate;d.beforeCreate=u?[].concat(u,s):[s]}return d}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-form",{ref:"form",attrs:{model:t.model,rules:t.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"\u6807\u9898"}},[n("el-input",{model:{value:t.model.title,callback:function(e){t.$set(t.model,"title",e)},expression:"model.title"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"\u6807\u9898\u989c\u8272"}},[n("el-color-picker",{attrs:{"show-alpha":""},model:{value:t.model.titleColor,callback:function(e){t.$set(t.model,"titleColor",e)},expression:"model.titleColor"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"\u6d3b\u52a8\u8bf4\u660e",prop:"content"}},[n("div",{staticClass:"rules-widget-editor"},[t.editorLoaded?n("editor",t._b({model:{value:t.model.content,callback:function(e){t.$set(t.model,"content",e)},expression:"model.content"}},"editor",t.editorOptions,!1)):t._e()],1)]),t._v(" "),n("el-form-item",{attrs:{label:"\u7248\u6743\u6587\u6848",prop:"copyright"}},[n("el-input",{model:{value:t.model.copyright,callback:function(e){t.$set(t.model,"copyright",e)},expression:"model.copyright"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"\u7248\u6743\u6587\u6848\u989c\u8272"}},[n("el-color-picker",{attrs:{"show-alpha":""},model:{value:t.model.copyrightColor,callback:function(e){t.$set(t.model,"copyrightColor",e)},expression:"model.copyrightColor"}})],1),t._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[t._v("\u4fdd\u5b58")]),t._v(" "),n("el-button",{on:{click:t.onCancel}},[t._v("\u53d6\u6d88")])],1)],1)},staticRenderFns:[]},function(e){e&&e("data-v-212ee25b_0",{source:"\n.rules-widget-editor{height:400px;padding-right:4px\n}\n.mce-branding{display:none!important\n}",map:void 0,media:void 0})},{mixins:[(i={title:{type:String,default:"\u6d3b\u52a8\u89c4\u5219"},titleColor:{type:String},content:{type:String,rule:[{required:!0,message:"\u8bf7\u8f93\u5165\u6d3b\u52a8\u8bf4\u660e"}]},copyright:{type:String,default:"\u672c\u6d3b\u52a8\u6cd5\u5f8b\u8303\u56f4\u5185\u6700\u7ec8\u89e3\u91ca\u6743\u5f52\u9605\u6587\u96c6\u56e2\u6240\u6709"},copyrightColor:{type:String}},o=Object.keys(i),r={},l={},a={},o.forEach(function(t){var e=i[t],n=e.rule,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&-1===t.indexOf(o)&&(n[o]=e[o]);return n}(e,["rule"]);r[t]=o,l[t]=n,a[t]=function(e){this.model[t]=e}}),{props:r,data:function(){var t=this,n={};return o.forEach(function(e){n[e]=t[e]}),{model:n,rules:l}},watch:a,methods:{onSubmit:function(){var t=this;this.$refs.form.validate(function(e){if(!e)return!1;t.$emit("save",{props:t.model})})},onCancel:function(){this.$refs.form.resetFields()}}})],data:function(){var i=this;return{editorLoaded:!1,editorOptions:{init:Object.assign({},t,{images_upload_handler:function(e,t,n){var o=new FormData;o.append("lbf-file-upload",e.blob(),e.filename()),i.$ajax.post("/her/ajax/general/file/files",o).then(function(e){return t(e.data.url)},n)}})}}},mounted:function(){var t=this;new Promise(function(e){var t="https://cdn.jsdelivr.net/npm/",n=window.$script;n([t+"tinymce@4.9.1/tinymce.min.js",t+"@tinymce/tinymce-vue@1.1.0/lib/browser/tinymce-vue.min.js"],function(){n(t+"tinymce-i18n@18.11.18/langs/zh_CN.js",function(){e(window.Editor)})})}).then(function(e){Vue.component("editor")||Vue.component("editor",e),t.editorLoaded=!0})}},void 0,!1,0,function e(){var d=document.head||document.getElementsByTagName("head")[0],c=e.styles||(e.styles={}),u="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(e,t){if(!document.querySelector('style[data-vue-ssr-id~="'+e+'"]')){var n=u?t.media||"default":e,o=c[n]||(c[n]={ids:[],parts:[],element:void 0});if(!o.ids.includes(e)){var i=t.source,r=o.ids.length;if(o.ids.push(e),t.map&&(i+="\n/*# sourceURL="+t.map.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),u&&(o.element=o.element||document.querySelector("style[data-group="+n+"]")),!o.element){var l=o.element=document.createElement("style");l.type="text/css",t.media&&l.setAttribute("media",t.media),u&&(l.setAttribute("data-group",n),l.setAttribute("data-next-index","0")),d.appendChild(l)}if(u&&(r=parseInt(o.element.getAttribute("data-next-index")),o.element.setAttribute("data-next-index",r+1)),o.element.styleSheet)o.parts.push(i),o.element.styleSheet.cssText=o.parts.filter(Boolean).join("\n");else{var a=document.createTextNode(i),s=o.element.childNodes;s[r]&&o.element.removeChild(s[r]),s.length?o.element.insertBefore(a,s[r]):o.element.appendChild(a)}}}}});return"undefined"!=typeof window?n=window.Vue:"undefined"!=typeof global&&(n=global.Vue),n&&n.component("@her-activity-components/rules-widget@0.1.0",s),e.$=s,e}({}); |
+4
-7
@@ -1,2 +0,2 @@ | ||
| var _her_activity_components_rules_widget_0_0_2 = (function (exports) { | ||
| var _her_activity_components_rules_widget_0_1_0 = (function (exports) { | ||
| 'use strict'; | ||
@@ -23,5 +23,2 @@ | ||
| }, | ||
| filter: { | ||
| color: function color() {}, | ||
| }, | ||
| }; | ||
@@ -64,7 +61,7 @@ | ||
| if (!inject) { return } | ||
| inject("data-v-548e4772_0", { source: "\n.rules-widget[data-v-548e4772] {\n font-size: 100px;\n padding: 0.2em 0.16em;\n}\n.title[data-v-548e4772] {\n font-size: 0.2em;\n font-weight: bold;\n line-height: 1;\n margin-bottom: 1em;\n text-align: center;\n}\n.content[data-v-548e4772] {\n font-size: 0.14em;\n}\n.copyright[data-v-548e4772] {\n font-size: 0.12em;\n line-height: 1;\n margin-bottom: 0.8333em;;\n margin-top: 2.5em;\n text-align: center;\n}\n.rem-16 .rules-widget[data-v-548e4772] {\n font-size: 6.25rem;\n}\n", map: {"version":3,"sources":["/Users/zhangchengrong/Projects/readx/her-activity/components/rules-widget/src/consumer.vue"],"names":[],"mappings":";AA0BA;EACA,iBAAA;EACA,sBAAA;CACA;AAEA;EACA,iBAAA;EACA,kBAAA;EACA,eAAA;EACA,mBAAA;EACA,mBAAA;CACA;AAEA;EACA,kBAAA;CACA;AAEA;EACA,kBAAA;EACA,eAAA;EACA,wBAAA;EACA,kBAAA;EACA,mBAAA;CACA;AAEA;EACA,mBAAA;CACA","file":"consumer.vue","sourcesContent":["<template>\n <div\n class=\"rules-widget\"\n >\n <h5 v-if=\"title\" class=\"title\" :style=\"{ color: titleColor }\">{{title}}</h5>\n <div class=\"content\" v-html=\"content\" />\n <p v-if=\"copyright\" class=\"copyright\" :style=\"{ color: copyrightColor }\">{{copyright}}</p>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n title: String,\n titleColor: String,\n content: String,\n copyright: String,\n copyrightColor: String,\n },\n filter: {\n color() {},\n },\n};\n</script>\n\n<style scoped>\n.rules-widget {\n font-size: 100px;\n padding: em(20, 100) em(16, 100);\n}\n\n.title {\n font-size: em(20, 100);\n font-weight: bold;\n line-height: 1;\n margin-bottom: em(20, 20);\n text-align: center;\n}\n\n.content {\n font-size: em(14, 100);\n}\n\n.copyright {\n font-size: em(12, 100);\n line-height: 1;\n margin-bottom: em(10, 12);;\n margin-top: em(30, 12);\n text-align: center;\n}\n\n.rem-16 .rules-widget {\n font-size: rem(200);\n}\n</style>\n"]}, media: undefined }); | ||
| inject("data-v-fa24c95c_0", { source: "\n.rules-widget[data-v-fa24c95c] {\n font-size: 100px;\n padding: 0.2em 0.16em;\n}\n.title[data-v-fa24c95c] {\n font-size: 0.2em;\n font-weight: bold;\n line-height: 1;\n margin-bottom: 1em;\n text-align: center;\n}\n.content[data-v-fa24c95c] {\n font-size: 0.14em;\n}\n.copyright[data-v-fa24c95c] {\n font-size: 0.12em;\n line-height: 1;\n margin-bottom: 0.8333em;;\n margin-top: 2.5em;\n text-align: center;\n}\n.rem-16 .rules-widget[data-v-fa24c95c] {\n font-size: 6.25rem;\n}\n", map: {"version":3,"sources":["/Users/zhangchengrong/Projects/readx/her-activity/components/rules-widget/src/consumer.vue"],"names":[],"mappings":";AAuBA;EACA,iBAAA;EACA,sBAAA;CACA;AAEA;EACA,iBAAA;EACA,kBAAA;EACA,eAAA;EACA,mBAAA;EACA,mBAAA;CACA;AAEA;EACA,kBAAA;CACA;AAEA;EACA,kBAAA;EACA,eAAA;EACA,wBAAA;EACA,kBAAA;EACA,mBAAA;CACA;AAEA;EACA,mBAAA;CACA","file":"consumer.vue","sourcesContent":["<template>\n <div\n class=\"rules-widget\"\n >\n <h5 v-if=\"title\" class=\"title\" :style=\"{ color: titleColor }\">{{title}}</h5>\n <div class=\"content\" v-html=\"content\" />\n <p v-if=\"copyright\" class=\"copyright\" :style=\"{ color: copyrightColor }\">{{copyright}}</p>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n title: String,\n titleColor: String,\n content: String,\n copyright: String,\n copyrightColor: String,\n },\n};\n</script>\n\n<style scoped>\n.rules-widget {\n font-size: 100px;\n padding: em(20, 100) em(16, 100);\n}\n\n.title {\n font-size: em(20, 100);\n font-weight: bold;\n line-height: 1;\n margin-bottom: em(20, 20);\n text-align: center;\n}\n\n.content {\n font-size: em(14, 100);\n}\n\n.copyright {\n font-size: em(12, 100);\n line-height: 1;\n margin-bottom: em(10, 12);;\n margin-top: em(30, 12);\n text-align: center;\n}\n\n.rem-16 .rules-widget {\n font-size: rem(200);\n}\n</style>\n"]}, media: undefined }); | ||
| }; | ||
| /* scoped */ | ||
| var __vue_scope_id__ = "data-v-548e4772"; | ||
| var __vue_scope_id__ = "data-v-fa24c95c"; | ||
| /* module identifier */ | ||
@@ -201,3 +198,3 @@ var __vue_module_identifier__ = undefined; | ||
| if ($Vue) { | ||
| $Vue.component("@her-activity-components/rules-widget@0.0.2", component); | ||
| $Vue.component("@her-activity-components/rules-widget@0.1.0", component); | ||
| } | ||
@@ -204,0 +201,0 @@ |
+85
-72
@@ -1,30 +0,60 @@ | ||
| var _her_activity_components_rules_widget_0_0_2 = (function (exports) { | ||
| var _her_activity_components_rules_widget_0_1_0 = (function (exports) { | ||
| 'use strict'; | ||
| function objectWithoutProperties (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; } | ||
| function createProvider (options) { | ||
| var keys = Object.keys(options); | ||
| var props = {}; | ||
| var rules = {}; | ||
| var watch = {}; | ||
| keys.forEach(function (key) { | ||
| var ref = options[key]; | ||
| var rule = ref.rule; | ||
| var rest = objectWithoutProperties( ref, ["rule"] ); | ||
| var prop = rest; | ||
| props[key] = prop; | ||
| rules[key] = rule; | ||
| watch[key] = function (value) { | ||
| this.model[key] = value; | ||
| }; | ||
| }); | ||
| return { | ||
| props: props, | ||
| data: function data() { | ||
| var this$1 = this; | ||
| var model = {}; | ||
| keys.forEach(function (key) { | ||
| model[key] = this$1[key]; | ||
| }); | ||
| return { | ||
| model: model, | ||
| rules: rules, | ||
| } | ||
| }, | ||
| watch: watch, | ||
| methods: { | ||
| onSubmit: function onSubmit() { | ||
| var this$1 = this; | ||
| this.$refs.form.validate(function (valid) { | ||
| if (!valid) { | ||
| return false | ||
| } | ||
| this$1.$emit('save', { props: this$1.model }); | ||
| }); | ||
| }, | ||
| onCancel: function onCancel() { | ||
| this.$refs.form.resetFields(); | ||
| }, | ||
| } | ||
| } | ||
| } | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
| // | ||
@@ -35,19 +65,30 @@ var editInitOptions = { | ||
| plugins: ['code', 'colorpicker', 'fullscreen', 'link', 'lists', 'image', 'preview', 'textcolor'], | ||
| toolbar: 'undo redo | fontsizeselect | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media', | ||
| toolbar: 'undo redo | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media', | ||
| // toolbar: 'undo redo | fontsizeselect | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media', // fontsizeselect 感觉没啥用,又长,屏幕小一点会导致换行 | ||
| }; | ||
| var script = { | ||
| props: { | ||
| title: { | ||
| type: String, | ||
| default: '活动规则', | ||
| }, | ||
| titleColor: String, | ||
| content: String, | ||
| copyright: { | ||
| type: String, | ||
| default: '本活动法律范围内最终解释权归阅文集团所有', | ||
| }, | ||
| copyrightColor: String, | ||
| }, | ||
| mixins: [ | ||
| createProvider({ | ||
| title: { | ||
| // 标题可能是图片,那就直接由 editor 编辑出来,所以没有必填 rule | ||
| type: String, | ||
| default: '活动规则', | ||
| }, | ||
| titleColor: { | ||
| type: String, | ||
| }, | ||
| content: { | ||
| type: String, | ||
| rule: [ | ||
| { required: true, message: '请输入活动说明' } ], | ||
| }, | ||
| copyright: { | ||
| type: String, | ||
| default: '本活动法律范围内最终解释权归阅文集团所有', | ||
| }, | ||
| copyrightColor: { | ||
| type: String, | ||
| }, | ||
| }) ], | ||
| data: function data() { | ||
@@ -68,13 +109,2 @@ var this$1 = this; | ||
| }, | ||
| model: { | ||
| title: this.title, // 标题可能是图片,那就直接由 editor 编辑出来,所以没有必填 rule | ||
| titleColor: this.titleColor, | ||
| content: this.content, | ||
| copyright: this.copyright, | ||
| copyrightColor: this.copyrightColor, | ||
| }, | ||
| rules: { | ||
| content: [ | ||
| { required: true, message: '请输入活动说明' } ], | ||
| }, | ||
| } | ||
@@ -92,18 +122,2 @@ }, | ||
| }, | ||
| methods: { | ||
| onSubmit: function onSubmit() { | ||
| var this$1 = this; | ||
| this.$refs.form.validate(function (valid) { | ||
| if (!valid) { | ||
| return false | ||
| } | ||
| this$1.$emit('save', { props: this$1.model }); | ||
| }); | ||
| }, | ||
| onCancel: function onCancel() { | ||
| this.$refs.form.resetFields(); | ||
| }, | ||
| } | ||
| }; | ||
@@ -178,3 +192,3 @@ | ||
| "div", | ||
| { staticClass: "editor" }, | ||
| { staticClass: "rules-widget-editor" }, | ||
| [ | ||
@@ -263,8 +277,7 @@ _vm.editorLoaded | ||
| if (!inject) { return } | ||
| inject("data-v-3e3bfd19_0", { source: "\n.mce-branding {\n display: none !important;\n}\n", map: {"version":3,"sources":["/Users/zhangchengrong/Projects/readx/her-activity/components/rules-widget/src/provider.vue"],"names":[],"mappings":";AAuHA;EACA,yBAAA;CACA","file":"provider.vue","sourcesContent":["<template>\n <el-form ref=\"form\" :model=\"model\" :rules=\"rules\" label-width=\"120px\">\n <el-form-item label=\"标题\">\n <el-input v-model=\"model.title\" />\n </el-form-item>\n <el-form-item label=\"标题颜色\">\n <el-color-picker v-model=\"model.titleColor\" show-alpha />\n </el-form-item>\n <el-form-item label=\"活动说明\" prop=\"content\">\n <div class=\"editor\">\n <editor v-if=\"editorLoaded\" v-bind=\"editorOptions\" v-model=\"model.content\" />\n </div>\n </el-form-item>\n <el-form-item label=\"版权文案\" prop=\"copyright\">\n <el-input v-model=\"model.copyright\" />\n </el-form-item>\n <el-form-item label=\"版权文案颜色\">\n <el-color-picker v-model=\"model.copyrightColor\" show-alpha />\n </el-form-item>\n <el-form-item>\n <el-button type=\"primary\" @click=\"onSubmit\">保存</el-button>\n <el-button @click=\"onCancel\">取消</el-button>\n </el-form-item>\n </el-form>\n</template>\n\n<script>\nconst editInitOptions = {\n height: 300,\n language: 'zh_CN',\n plugins: ['code', 'colorpicker', 'fullscreen', 'link', 'lists', 'image', 'preview', 'textcolor'],\n toolbar: 'undo redo | fontsizeselect | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media',\n}\n\nexport default {\n props: {\n title: {\n type: String,\n default: '活动规则',\n },\n titleColor: String,\n content: String,\n copyright: {\n type: String,\n default: '本活动法律范围内最终解释权归阅文集团所有',\n },\n copyrightColor: String,\n },\n data() {\n return {\n editorLoaded: false,\n editorOptions: {\n init: {\n ...editInitOptions,\n images_upload_handler: (blobInfo, success, failure) => {\n const form = new FormData()\n form.append('lbf-file-upload', blobInfo.blob(), blobInfo.filename())\n\n this.$ajax.post('/her/ajax/general/file/files', form)\n .then(res => success(res.data.url), failure)\n },\n },\n },\n model: {\n title: this.title, // 标题可能是图片,那就直接由 editor 编辑出来,所以没有必填 rule\n titleColor: this.titleColor,\n content: this.content,\n copyright: this.copyright,\n copyrightColor: this.copyrightColor,\n },\n rules: {\n content: [\n { required: true, message: '请输入活动说明' },\n ],\n },\n }\n },\n mounted() {\n loadEditor().then((Editor) => {\n if (!Vue.component('editor')) {\n Vue.component('editor', Editor)\n }\n this.editorLoaded = true\n })\n },\n methods: {\n onSubmit() {\n this.$refs.form.validate((valid) => {\n if (!valid) {\n return false\n }\n\n this.$emit('save', { props: this.model })\n });\n },\n onCancel() {\n this.$refs.form.resetFields()\n },\n }\n}\n\nfunction loadEditor() {\n return new Promise((resolve) => {\n const BASE_URL = 'https://cdn.jsdelivr.net/npm/'\n const loadScripts = window.$script\n loadScripts([\n `${BASE_URL}tinymce@4.9.1/tinymce.min.js`,\n `${BASE_URL}@tinymce/tinymce-vue@1.1.0/lib/browser/tinymce-vue.min.js`,\n ], () => {\n loadScripts(`${BASE_URL}tinymce-i18n@18.11.18/langs/zh_CN.js`, () => {\n resolve(window.Editor)\n })\n })\n })\n}\n</script>\n\n\n<style>\n.mce-branding {\n display: none !important;\n}\n</style>\n\n<style scoped>\n.editor {\n height: 400px;\n}\n</style>"]}, media: undefined }) | ||
| ,inject("data-v-3e3bfd19_1", { source: "\n.editor[data-v-3e3bfd19] {\n height: 400px;\n}\n", map: {"version":3,"sources":["/Users/zhangchengrong/Projects/readx/her-activity/components/rules-widget/src/provider.vue"],"names":[],"mappings":";AA6HA;EACA,cAAA;CACA","file":"provider.vue","sourcesContent":["<template>\n <el-form ref=\"form\" :model=\"model\" :rules=\"rules\" label-width=\"120px\">\n <el-form-item label=\"标题\">\n <el-input v-model=\"model.title\" />\n </el-form-item>\n <el-form-item label=\"标题颜色\">\n <el-color-picker v-model=\"model.titleColor\" show-alpha />\n </el-form-item>\n <el-form-item label=\"活动说明\" prop=\"content\">\n <div class=\"editor\">\n <editor v-if=\"editorLoaded\" v-bind=\"editorOptions\" v-model=\"model.content\" />\n </div>\n </el-form-item>\n <el-form-item label=\"版权文案\" prop=\"copyright\">\n <el-input v-model=\"model.copyright\" />\n </el-form-item>\n <el-form-item label=\"版权文案颜色\">\n <el-color-picker v-model=\"model.copyrightColor\" show-alpha />\n </el-form-item>\n <el-form-item>\n <el-button type=\"primary\" @click=\"onSubmit\">保存</el-button>\n <el-button @click=\"onCancel\">取消</el-button>\n </el-form-item>\n </el-form>\n</template>\n\n<script>\nconst editInitOptions = {\n height: 300,\n language: 'zh_CN',\n plugins: ['code', 'colorpicker', 'fullscreen', 'link', 'lists', 'image', 'preview', 'textcolor'],\n toolbar: 'undo redo | fontsizeselect | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media',\n}\n\nexport default {\n props: {\n title: {\n type: String,\n default: '活动规则',\n },\n titleColor: String,\n content: String,\n copyright: {\n type: String,\n default: '本活动法律范围内最终解释权归阅文集团所有',\n },\n copyrightColor: String,\n },\n data() {\n return {\n editorLoaded: false,\n editorOptions: {\n init: {\n ...editInitOptions,\n images_upload_handler: (blobInfo, success, failure) => {\n const form = new FormData()\n form.append('lbf-file-upload', blobInfo.blob(), blobInfo.filename())\n\n this.$ajax.post('/her/ajax/general/file/files', form)\n .then(res => success(res.data.url), failure)\n },\n },\n },\n model: {\n title: this.title, // 标题可能是图片,那就直接由 editor 编辑出来,所以没有必填 rule\n titleColor: this.titleColor,\n content: this.content,\n copyright: this.copyright,\n copyrightColor: this.copyrightColor,\n },\n rules: {\n content: [\n { required: true, message: '请输入活动说明' },\n ],\n },\n }\n },\n mounted() {\n loadEditor().then((Editor) => {\n if (!Vue.component('editor')) {\n Vue.component('editor', Editor)\n }\n this.editorLoaded = true\n })\n },\n methods: {\n onSubmit() {\n this.$refs.form.validate((valid) => {\n if (!valid) {\n return false\n }\n\n this.$emit('save', { props: this.model })\n });\n },\n onCancel() {\n this.$refs.form.resetFields()\n },\n }\n}\n\nfunction loadEditor() {\n return new Promise((resolve) => {\n const BASE_URL = 'https://cdn.jsdelivr.net/npm/'\n const loadScripts = window.$script\n loadScripts([\n `${BASE_URL}tinymce@4.9.1/tinymce.min.js`,\n `${BASE_URL}@tinymce/tinymce-vue@1.1.0/lib/browser/tinymce-vue.min.js`,\n ], () => {\n loadScripts(`${BASE_URL}tinymce-i18n@18.11.18/langs/zh_CN.js`, () => {\n resolve(window.Editor)\n })\n })\n })\n}\n</script>\n\n\n<style>\n.mce-branding {\n display: none !important;\n}\n</style>\n\n<style scoped>\n.editor {\n height: 400px;\n}\n</style>"]}, media: undefined }); | ||
| inject("data-v-51bb7978_0", { source: "\n.rules-widget-editor {\n height: 400px;\n padding-right: 4px; /* 让阴影显示出来 */\n}\n.mce-branding {\n display: none !important;\n}\n", map: {"version":3,"sources":["/Users/zhangchengrong/Projects/readx/her-activity/components/rules-widget/src/provider.vue"],"names":[],"mappings":";AA4GA;EACA,cAAA;EACA,mBAAA,CAAA,aAAA;CACA;AACA;EACA,yBAAA;CACA","file":"provider.vue","sourcesContent":["<template>\n <el-form ref=\"form\" :model=\"model\" :rules=\"rules\" label-width=\"120px\">\n <el-form-item label=\"标题\">\n <el-input v-model=\"model.title\" />\n </el-form-item>\n <el-form-item label=\"标题颜色\">\n <el-color-picker v-model=\"model.titleColor\" show-alpha />\n </el-form-item>\n <el-form-item label=\"活动说明\" prop=\"content\">\n <div class=\"rules-widget-editor\">\n <editor v-if=\"editorLoaded\" v-bind=\"editorOptions\" v-model=\"model.content\" />\n </div>\n </el-form-item>\n <el-form-item label=\"版权文案\" prop=\"copyright\">\n <el-input v-model=\"model.copyright\" />\n </el-form-item>\n <el-form-item label=\"版权文案颜色\">\n <el-color-picker v-model=\"model.copyrightColor\" show-alpha />\n </el-form-item>\n <el-form-item>\n <el-button type=\"primary\" @click=\"onSubmit\">保存</el-button>\n <el-button @click=\"onCancel\">取消</el-button>\n </el-form-item>\n </el-form>\n</template>\n\n<script>\nimport createProvider from '../../shared/createProvider'\n\nconst editInitOptions = {\n height: 300,\n language: 'zh_CN',\n plugins: ['code', 'colorpicker', 'fullscreen', 'link', 'lists', 'image', 'preview', 'textcolor'],\n toolbar: 'undo redo | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media',\n // toolbar: 'undo redo | fontsizeselect | bold italic | forecolor | alignleft aligncenter alignright | bullist numlist | link image media', // fontsizeselect 感觉没啥用,又长,屏幕小一点会导致换行\n}\n\nexport default {\n mixins: [\n createProvider({\n title: {\n // 标题可能是图片,那就直接由 editor 编辑出来,所以没有必填 rule\n type: String,\n default: '活动规则',\n },\n titleColor: {\n type: String,\n },\n content: {\n type: String,\n rule: [\n { required: true, message: '请输入活动说明' },\n ],\n },\n copyright: {\n type: String,\n default: '本活动法律范围内最终解释权归阅文集团所有',\n },\n copyrightColor: {\n type: String,\n },\n }),\n ],\n data() {\n return {\n editorLoaded: false,\n editorOptions: {\n init: {\n ...editInitOptions,\n images_upload_handler: (blobInfo, success, failure) => {\n const form = new FormData()\n form.append('lbf-file-upload', blobInfo.blob(), blobInfo.filename())\n\n this.$ajax.post('/her/ajax/general/file/files', form)\n .then(res => success(res.data.url), failure)\n },\n },\n },\n }\n },\n mounted() {\n loadEditor().then((Editor) => {\n if (!Vue.component('editor')) {\n Vue.component('editor', Editor)\n }\n this.editorLoaded = true\n })\n },\n}\n\nfunction loadEditor() {\n return new Promise((resolve) => {\n const BASE_URL = 'https://cdn.jsdelivr.net/npm/'\n const loadScripts = window.$script\n loadScripts([\n `${BASE_URL}tinymce@4.9.1/tinymce.min.js`,\n `${BASE_URL}@tinymce/tinymce-vue@1.1.0/lib/browser/tinymce-vue.min.js`,\n ], () => {\n loadScripts(`${BASE_URL}tinymce-i18n@18.11.18/langs/zh_CN.js`, () => {\n resolve(window.Editor)\n })\n })\n })\n}\n</script>\n\n\n<style>\n.rules-widget-editor {\n height: 400px;\n padding-right: 4px; /* 让阴影显示出来 */\n}\n.mce-branding {\n display: none !important;\n}\n</style>\n"]}, media: undefined }); | ||
| }; | ||
| /* scoped */ | ||
| var __vue_scope_id__ = "data-v-3e3bfd19"; | ||
| var __vue_scope_id__ = undefined; | ||
| /* module identifier */ | ||
@@ -401,3 +414,3 @@ var __vue_module_identifier__ = undefined; | ||
| if ($Vue) { | ||
| $Vue.component("@her-activity-components/rules-widget@0.0.2", component); | ||
| $Vue.component("@her-activity-components/rules-widget@0.1.0", component); | ||
| } | ||
@@ -404,0 +417,0 @@ |
+2
-2
| { | ||
| "name": "@her-activity-components/rules-widget", | ||
| "version": "0.0.2", | ||
| "version": "0.1.0", | ||
| "publishConfig": { | ||
@@ -10,3 +10,3 @@ "access": "public" | ||
| ], | ||
| "gitHead": "844106e1e97139d9c64aca9d3b6f3dda82d5103e" | ||
| "gitHead": "0293cbfe650e0d8cc5c436a316f5fdf1a1ab445c" | ||
| } |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
32770
20.18%5
66.67%3
-25%563
-1.23%4
100%