Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fhcommon

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fhcommon - npm Package Compare versions

Comparing version 1.0.14 to 1.0.15

2

dist/fhcommon.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FHCommon=e():t.FHCommon=e()}(this,(()=>(()=>{"use strict";var t={784:(t,e,n)=>{n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.noError?n("img",t._b({attrs:{src:t.currentSrc},on:{load:function(e){return t.$emit("load")},error:t.handleError}},"img",t.$attrs,!1)):n("i",{staticClass:"iconfont icon-zhanyehaibao c-08a full-content"})};r._withStripped=!0;const o={name:"DefaultImage",props:{src:{type:String,default:"",required:!0},backupSrc:{type:String,default:"",required:!1}},data:function(){return{currentSrc:"",noError:!0}},created:function(){this.currentSrc=this.src},methods:{handleError:function(){this.currentSrc!==this.backupSrc?(this.currentSrc=this.backupSrc,this.$emit("error")):this.noError=!1}}};var i=n(72),a=n.n(i),c=n(825),s=n.n(c),u=n(659),l=n.n(u),f=n(56),p=n.n(f),d=n(540),h=n.n(d),y=n(113),v=n.n(y),m=n(591),g={};g.styleTagTransform=v(),g.setAttributes=p(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=h();a()(m.A,g);m.A&&m.A.locals&&m.A.locals;function b(t,e,n,r,o,i,a,c){var s,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(s=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=s):o&&(s=c?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),s)if(u.functional){u._injectStyles=s;var l=u.render;u.render=function(t,e){return s.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,s):[s]}return{exports:t,options:u}}var w=b(o,r,[],!1,null,"b45d3530",null);w.options.__file="packages/fhImage/index.vue";const S=w.exports;S.install=function(t){t.component(S.name,S)};const x=S;var E=function(){var t=this,e=t.$createElement;return(t._self._c||e)("FHImage",t._b({attrs:{src:t.src,"backup-src":t.backupSrc}},"FHImage",t.$attrs,!1))};function _(t){if("boolean"==typeof t)return!1;if("number"==typeof t)return!1;if(t instanceof Array){if(0===t.length)return!0}else{if(!(t instanceof Object))return"null"===t||null===t||"undefined"===t||void 0===t||""===t;if("{}"===JSON.stringify(t))return!0}return!1}E._withStripped=!0;var O="Fun-".concat(process.env.VUE_APP_NAME,"-").concat(process.env.VUE_APP_ENV_CONFIG,"-"),j="Fun-".concat(process.env.VUE_APP_ENV_CONFIG,"-"),P=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.name,n=t.debug,r=t.key,o=t.commonKey;e=r||("userGlobalGist"===e?j+e:o?j+o:O+e);var i,a={};if(_(a=window.sessionStorage.getItem(e))&&(a=window.localStorage.getItem(e)),!_(a)){try{a=JSON.parse(a)}catch(t){return a}return n||r?a:("string"===a.dataType?i=a.content:"number"===a.dataType?i=Number(a.content):"boolean"===a.dataType?i=a.content||!1:"object"===a.dataType&&(i=a.content),i)}};var T="https://frcdapcdn.fhrons.com";var k=b({name:"FHPresetImage",components:{FHImage:x},props:{id:{type:String,default:"",required:!0}},data:function(){return{src:"",backupSrc:""}},created:function(){var t=P({name:"platformCode"})||"00",e=P({name:"language"})||"zh_CN";this.src="".concat(T,"/saasmanage/front/").concat(t,"/").concat(e,"/").concat(this.id,".png"),this.backupSrc="".concat(T,"/saasmanage/front/00/").concat(e,"/").concat(this.id,".png")}},E,[],!1,null,"44f619ee",null);k.options.__file="packages/fhPresetImage/index.vue";const C=k.exports;C.install=function(t){t.component(C.name,C)};const N=C;function A(){A=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new C(r||[]);return o(a,"_invoke",{value:j(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(N([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=m.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==V(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function j(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=P(c,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?y:d,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(V(e)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},_(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(E),u(E,s,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function I(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function L(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){I(i,r,o,a,c,"next",t)}function c(t){I(i,r,o,a,c,"throw",t)}a(void 0)}))}}function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function U(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F(Object(n),!0).forEach((function(e){z(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function z(t,e,n){var r;return r=function(t,e){if("object"!=V(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=V(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==V(r)?r:r+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}var M,G;t=n.hmd(t),M=void 0,G=function(){function t(t){return e.apply(this,arguments)}function e(){return e=L(A().mark((function t(e){var n,r,o,i=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:.7,e=e.raw?e.raw:e,t.prev=2,r="",t.next=6,lrz(e,{quality:n});case 6:return o=t.sent,r=new File([o.file],e.name,{type:"image/jpeg",lastModified:Date.now()}),t.abrupt("return",r);case 11:return t.prev=11,t.t0=t.catch(2),t.abrupt("return","");case 14:case"end":return t.stop()}}),t,null,[[2,11]])}))),e.apply(this,arguments)}function n(){return(n=L(A().mark((function e(n,r,o){var i;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",new Error("size 不能为空"));case 2:return e.next=4,t(n,o);case 4:return(i=e.sent).size>r&&t(i,o),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function r(t,e){if(!function(t){for(var e=!1,n=document.getElementsByTagName("script"),r=new Set,o=0;o<n.length;o++){var i=n[o].getAttribute("src");i&&i===t&&(r.has(i)?e=!0:r.add(i))}return 0===r.size&&(e=!1),e}(t)){var n=document.createElement("script"),r=document.getElementsByTagName("head")[0];n.type="text/javascript",n.charset="UTF-8",n.src=t,window.onerror=function(){console.log("loadJavaScript加载".concat(t,"失败"))},n.addEventListener?n.addEventListener("load",(function(){e()}),!1):n.attachEvent&&n.attachEvent("onreadystatechange",(function(){"loaded"!==window.event.srcElement.readyState&&"complate"!==n.readState||e()})),n.addEventListener("error",(function(t){var n;null==(n=t)||"string"==typeof n&&(""===n||"undefined"===n||"null"===n)||Array.isArray(n)&&0===n.length||"[object Object]"===Object.prototype.toString.call(n)&&0===Object.keys(n).length||e("err")})),t&&r.appendChild(n)}}window.axios||r("https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js",(function(){console.log("axios 加载成功")})),window.AWS||r("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js",(function(){console.log("aws-sdk 加载成功")})),window.COS||r("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js",(function(){console.log("腾讯cos 加载成功")})),window.lrz||r("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js",(function(){console.log("lrz加载成功")}));var o={upload:function(t,e){var n,r=t.file,o=t.target,i=t.project,a=void 0===i?"0":i,c=t.keyFunc,s=t.needWholeRes,u=location.origin.includes("https://smnguat.fhrons.net")||location.origin.includes("https://openuat.fhrons.net")||location.origin.includes("https://smng.avantech.io")||location.origin.includes("https://open.avantech.io")||process.env.VUE_APP_ENV_CONFIG&&process.env.VUE_APP_ENV_CONFIG.includes("hk")||process.env.VUE_APP_ENV_CONFIG&&"poc"===process.env.VUE_APP_ENV_CONFIG?"amazon":"tencent";if(o=o||u,r){r.raw&&(r=r.raw),r.file&&(r=r.file),o="tencent"===o?"0":"1";var l=r.name,f=process.env.VUE_APP_NAME||"common";("function"!=typeof c||"function"==typeof c&&!c())&&(c=function(){return"/"+f+"/"+(new Date).valueOf()+"_"+l});var p=c();return p=(n=p).startsWith("/")?n.substring(1):n,axios.get("/funapi/config/oss/sign/".concat(o,"/").concat(a)).then((function(t){var n=t.data||t,o=n.tmpSecretId,i=n.tmpSecretKey,a=n.token,c=n.sessionToken,u=n.startTime,l=n.expiredTime,f=n.requestId,d=n.type,h=n.bucketName,y=n.region,v=n.cdnUrl;if("1"===d){AWS.config.update({accessKeyId:o,secretAccessKey:i,region:y,sessionToken:a});var m=new AWS.S3,g={Bucket:h,Key:p,ContentType:d,Body:r,"Access-Control-Allow-Credentials":"*"},b=m.upload(g);return b.on("httpUploadProgress",(function(t){var n=t.loaded,r=t.total,o=Math.round(100*parseInt(n/r));"function"==typeof e&&e(o)})),b.promise().then((function(t){var e=t.key,n=t.Key;return console.log(t),s?U(U({},t),{},{fileUrl:"".concat(v,"/").concat(e||n)}):"".concat(v,"/").concat(e||n)})).catch((function(t){console.log(t)})).finally((function(t){}))}return new COS({getAuthorization:function(t,e){e({TmpSecretId:o,TmpSecretKey:i,XCosSecurityToken:c,StartTime:u,ExpiredTime:l,requestId:f,SecurityToken:a})}}).sliceUploadFile({Bucket:h,Region:y,Key:p,StorageClass:"STANDARD",Body:r,onProgress:function(t){console.log(t),t.loaded,t.total;var n=t.percent,r=(t.speed,Math.round(parseInt(100*n)));"function"==typeof e&&e(r)}}).then((function(e){console.log(e);var n=e.key,r=e.Key,o=r.startsWith("/")?"":"/";return s?U(U({},t),{},{fileUrl:"".concat(v).concat(o).concat(n||r)}):"".concat(v).concat(o).concat(n||r)})).catch((function(t){console.log(t)}))}))}console.error("上传的文件不能为空")},compressFile:t,loopCompressFile:function(t,e,r){return n.apply(this,arguments)},install:function(t){window.FHCommon=o,t.component("FHImage",x),t.component("FHPresetImage",N)}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(o),o},"object"===("undefined"==typeof exports?"undefined":V(exports))?t.exports=G():"function"==typeof define&&n.amdO?define(G):(M=M||self).FHCommon=G()},591:(t,e,n)=>{n.d(e,{A:()=>c});var r=n(601),o=n.n(r),i=n(314),a=n.n(i)()(o());a.push([t.id,".icon-zhanyehaibao[data-v-b45d3530] {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.icon-zhanyehaibao[data-v-b45d3530]::before {\n font-size: 30px;\n color: #dcdfe6;\n}\n",""]);const c=a},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(r)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(a[s]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);r&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),e.push(l))}},e}},601:t=>{t.exports=function(t){return t[1]}},72:t=>{var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var i={},a=[],c=0;c<t.length;c++){var s=t[c],u=r.base?s[0]+r.base:s[0],l=i[u]||0,f="".concat(u," ").concat(l);i[u]=l+1;var p=n(f),d={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var h=o(d,r);r.byIndex=c,e.splice(c,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function o(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var i=r(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<i.length;a++){var c=n(i[a]);e[c].references--}for(var s=r(t,o),u=0;u<i.length;u++){var l=n(i[u]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}i=s}}},659:t=>{var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}return n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0,n(784)})()));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FHCommon=e():t.FHCommon=e()}(this,(()=>(()=>{"use strict";var t={591:(t,e,n)=>{n.d(e,{A:()=>c});var r=n(601),o=n.n(r),i=n(314),a=n.n(i)()(o());a.push([t.id,".icon-zhanyehaibao[data-v-b45d3530] {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.icon-zhanyehaibao[data-v-b45d3530]::before {\n font-size: 30px;\n color: #dcdfe6;\n}\n",""]);const c=a},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(r)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(a[s]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);r&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),e.push(l))}},e}},601:t=>{t.exports=function(t){return t[1]}},72:t=>{var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var i={},a=[],c=0;c<t.length;c++){var s=t[c],u=r.base?s[0]+r.base:s[0],l=i[u]||0,f="".concat(u," ").concat(l);i[u]=l+1;var p=n(f),d={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var h=o(d,r);r.byIndex=c,e.splice(c,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function o(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var i=r(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<i.length;a++){var c=n(i[a]);e[c].references--}for(var s=r(t,o),u=0;u<i.length;u++){var l=n(i[u]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}i=s}}},659:t=>{var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nc=void 0;var r={};return(()=>{function t(){t=function(){return r};var n,r={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(n){f=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new A(r||[]);return a(i,"_invoke",{value:k(t,n,c)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var E={};f(E,s,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(I([])));x&&x!==o&&i.call(x,s)&&(E=x);var j=_.prototype=b.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,n){function r(o,a,c,s){var u=d(t[o],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&i.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,c,s)}),(function(t){r("throw",t,c,s)})):n.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,s)}))}s(u.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new n((function(n,o){r(t,e,n,o)}))}return o=o?o.then(i,i):i()}})}function k(t,e,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:n,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=d(t,e,r);if("normal"===u.type){if(o=r.done?m:v,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function T(t,e){var r=e.method,o=t.iterator[r];if(o===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,T(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(i.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return a.next=a}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=_,a(j,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,f(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},r.awrap=function(t){return{__await:t}},O(P.prototype),f(P.prototype,u,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new P(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(j),f(j,l,"Generator"),f(j,s,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},r.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(N),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return c.type="throw",c.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}},r}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function c(t){o(a,r,i,c,s,"next",t)}function s(t){o(a,r,i,c,s,"throw",t)}c(void 0)}))}}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,n,r){var o;return o=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(n,"string"),(n="symbol"==e(o)?o:o+"")in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function u(t){return l.apply(this,arguments)}function l(){return l=i(t().mark((function e(n){var r,o,i,a=arguments;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:.7,n=n.raw?n.raw:n,t.prev=2,o="",t.next=6,lrz(n,{quality:r});case 6:return i=t.sent,o=new File([i.file],n.name,{type:"image/jpeg",lastModified:Date.now()}),t.abrupt("return",o);case 11:return t.prev=11,t.t0=t.catch(2),t.abrupt("return","");case 14:case"end":return t.stop()}}),e,null,[[2,11]])}))),l.apply(this,arguments)}function f(){return(f=i(t().mark((function e(n,r,o){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return",new Error("size 不能为空"));case 2:return t.next=4,u(n,o);case 4:return(i=t.sent).size>r&&u(i,o),t.abrupt("return",i);case 7:case"end":return t.stop()}}),e)})))).apply(this,arguments)}function p(t,e){if(!function(t){for(var e=!1,n=document.getElementsByTagName("script"),r=new Set,o=0;o<n.length;o++){var i=n[o].getAttribute("src");i&&i===t&&(r.has(i)?e=!0:r.add(i))}return 0===r.size&&(e=!1),e}(t)){var n=document.createElement("script"),r=document.getElementsByTagName("head")[0];n.type="text/javascript",n.charset="UTF-8",n.src=t,window.onerror=function(){console.log("loadJavaScript加载".concat(t,"失败"))},n.addEventListener?n.addEventListener("load",(function(){e()}),!1):n.attachEvent&&n.attachEvent("onreadystatechange",(function(){"loaded"!==window.event.srcElement.readyState&&"complate"!==n.readState||e()})),n.addEventListener("error",(function(t){(function(t){if(null==t||"string"==typeof t&&(""===t||"undefined"===t||"null"===t)||Array.isArray(t)&&0===t.length||"[object Object]"===Object.prototype.toString.call(t)&&0===Object.keys(t).length)return!0;return!1})(t)||e("err")})),t&&r.appendChild(n)}}n.d(r,{default:()=>q}),window.axios||p("https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js",(function(){console.log("axios 加载成功")})),window.AWS||p("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js",(function(){console.log("aws-sdk 加载成功")})),window.COS||p("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js",(function(){console.log("腾讯cos 加载成功")})),window.lrz||p("https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js",(function(){console.log("lrz加载成功")}));var d=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.noError?n("img",t._b({attrs:{src:t.currentSrc},on:{load:function(e){return t.$emit("load")},error:t.handleError}},"img",t.$attrs,!1)):n("i",{staticClass:"iconfont icon-zhanyehaibao c-08a full-content"})};d._withStripped=!0;const h={name:"DefaultImage",props:{src:{type:String,default:"",required:!0},backupSrc:{type:String,default:"",required:!1}},data:function(){return{currentSrc:"",noError:!0}},created:function(){this.currentSrc=this.src},methods:{handleError:function(){this.currentSrc!==this.backupSrc?(this.currentSrc=this.backupSrc,this.$emit("error")):this.noError=!1}}};var v=n(72),y=n.n(v),m=n(825),g=n.n(m),b=n(659),w=n.n(b),_=n(56),E=n.n(_),S=n(540),x=n.n(S),j=n(113),O=n.n(j),P=n(591),k={};k.styleTagTransform=O(),k.setAttributes=E(),k.insert=w().bind(null,"head"),k.domAPI=g(),k.insertStyleElement=x();y()(P.A,k);P.A&&P.A.locals&&P.A.locals;function T(t,e,n,r,o,i,a,c){var s,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(s=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=s):o&&(s=c?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),s)if(u.functional){u._injectStyles=s;var l=u.render;u.render=function(t,e){return s.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,s):[s]}return{exports:t,options:u}}var C=T(h,d,[],!1,null,"b45d3530",null);C.options.__file="packages/fhImage/index.vue";const N=C.exports;N.install=function(t){t.component(N.name,N)};const A=N;var I=function(){var t=this,e=t.$createElement;return(t._self._c||e)("FHImage",t._b({attrs:{src:t.src,"backup-src":t.backupSrc}},"FHImage",t.$attrs,!1))};function L(t){if("boolean"==typeof t)return!1;if("number"==typeof t)return!1;if(t instanceof Array){if(0===t.length)return!0}else{if(!(t instanceof Object))return"null"===t||null===t||"undefined"===t||void 0===t||""===t;if("{}"===JSON.stringify(t))return!0}return!1}I._withStripped=!0;var F="Fun-".concat(process.env.VUE_APP_NAME,"-").concat(process.env.VUE_APP_ENV_CONFIG,"-"),U="Fun-".concat(process.env.VUE_APP_ENV_CONFIG,"-"),z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.name,n=t.debug,r=t.key,o=t.commonKey;e=r||("userGlobalGist"===e?U+e:o?U+o:F+e);var i,a={};if(L(a=window.sessionStorage.getItem(e))&&(a=window.localStorage.getItem(e)),!L(a)){try{a=JSON.parse(a)}catch(t){return a}return n||r?a:("string"===a.dataType?i=a.content:"number"===a.dataType?i=Number(a.content):"boolean"===a.dataType?i=a.content||!1:"object"===a.dataType&&(i=a.content),i)}};var V="https://frcdapcdn.fhrons.com";var G=T({name:"FHPresetImage",components:{FHImage:A},props:{id:{type:String,default:"",required:!0}},data:function(){return{src:"",backupSrc:""}},created:function(){var t=z({name:"platformCode"})||"00",e=z({name:"language"})||"zh_CN";this.src="".concat(V,"/saasmanage/front/").concat(t,"/").concat(e,"/").concat(this.id,".png"),this.backupSrc="".concat(V,"/saasmanage/front/00/").concat(e,"/").concat(this.id,".png")}},I,[],!1,null,"44f619ee",null);G.options.__file="packages/fhPresetImage/index.vue";const M=G.exports;M.install=function(t){t.component(M.name,M)};const H=M;var $={upload:function(t,e){var n=t.file,r=t.target,o=t.project,i=void 0===o?"0":o,a=t.keyFunc,s=t.needWholeRes,u=location.origin.includes("https://smnguat.fhrons.net")||location.origin.includes("https://openuat.fhrons.net")||location.origin.includes("https://smng.avantech.io")||location.origin.includes("https://open.avantech.io")||process.env.VUE_APP_ENV_CONFIG&&process.env.VUE_APP_ENV_CONFIG.includes("hk")||process.env.VUE_APP_ENV_CONFIG&&"poc"===process.env.VUE_APP_ENV_CONFIG?"amazon":"tencent";if(r=r||u,n){n.raw&&(n=n.raw),n.file&&(n=n.file),r="tencent"===r?"0":"1";var l=n.name,f=process.env.VUE_APP_NAME||"common";("function"!=typeof a||"function"==typeof a&&!a())&&(a=function(){return"/"+f+"/"+(new Date).valueOf()+"_"+l});var p=a();return p=function(t){if(t.startsWith("/"))return t.substring(1);return t}(p),axios.get("/funapi/config/oss/sign/".concat(r,"/").concat(i)).then((function(t){var r=t.data||t,o=r.tmpSecretId,i=r.tmpSecretKey,a=r.token,u=r.sessionToken,l=r.startTime,f=r.expiredTime,d=r.requestId,h=r.type,v=r.bucketName,y=r.region,m=r.cdnUrl;if("1"===h){AWS.config.update({accessKeyId:o,secretAccessKey:i,region:y,sessionToken:a});var g=new AWS.S3,b={Bucket:v,Key:p,ContentType:h,Body:n,"Access-Control-Allow-Credentials":"*"},w=g.upload(b);return w.on("httpUploadProgress",(function(t){var n=t.loaded,r=t.total,o=Math.round(100*parseInt(n/r));"function"==typeof e&&e(o)})),w.promise().then((function(t){var e=t.key,n=t.Key;return console.log(t),s?c(c({},t),{},{fileUrl:"".concat(m,"/").concat(e||n)}):"".concat(m,"/").concat(e||n)})).catch((function(t){console.log(t)})).finally((function(t){}))}return new COS({getAuthorization:function(t,e){e({TmpSecretId:o,TmpSecretKey:i,XCosSecurityToken:u,StartTime:l,ExpiredTime:f,requestId:d,SecurityToken:a})}}).sliceUploadFile({Bucket:v,Region:y,Key:p,StorageClass:"STANDARD",Body:n,onProgress:function(t){console.log(t);t.loaded,t.total;var n=t.percent,r=(t.speed,Math.round(parseInt(100*n)));"function"==typeof e&&e(r)}}).then((function(e){console.log(e);var n=e.key,r=e.Key,o=r.startsWith("/")?"":"/";return s?c(c({},t),{},{fileUrl:"".concat(m).concat(o).concat(n||r)}):"".concat(m).concat(o).concat(n||r)})).catch((function(t){console.log(t)}))}))}console.error("上传的文件不能为空")},compressFile:u,loopCompressFile:function(t,e,n){return f.apply(this,arguments)},install:function(t){window.FHCommon=$,t.component("FHImage",A),t.component("FHPresetImage",H)}};"undefined"!=typeof window&&window.Vue&&(window.Vue.use($),window.FHUpload=$);const q=$})(),r=r.default})()));

@@ -1,1 +0,21 @@

export * as FHUpload from './dist/upload.min.js'
import {upload,compressFile,loopCompressFile} from './upload'
import FHImage from "./packages/fhImage";
import FHPresetImage from "./packages/fhPresetImage";
const FHCommon = {
upload: upload,
compressFile: compressFile,
loopCompressFile: loopCompressFile,
install (Vue) {
window.FHCommon = FHCommon
Vue.component('FHImage',FHImage)
Vue.component('FHPresetImage',FHPresetImage)
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(FHCommon)
window.FHUpload = FHCommon
}
// expose FHCommon as default export
export default FHCommon;
{
"name": "fhcommon",
"version": "1.0.14",
"version": "1.0.15",
"description": "泛华前端的上传方法",
"main": "dist/upload.min.js",
"module": "dist/upload.min.js",
"main": "dist/fhcommon.min.js",
"module": "dist/fhcommon.min.js",
"dependencies": {},

@@ -8,0 +8,0 @@ "devDependencies": {

@@ -1,294 +0,271 @@

import FHImage from "./packages/fhImage";
import FHPresetImage from "./packages/fhPresetImage";
// cdn引入axios
if (!window.axios) {
loadJavaScript('https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js', () => {
console.log('axios 加载成功');
});
}
if (!window.AWS) {
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js', () => {
console.log('aws-sdk 加载成功');
});
}
if (!window.COS) {
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js', () => {
console.log('腾讯cos 加载成功');
});
}
if (!window.lrz) {
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js', () => {
console.log('lrz加载成功');
});
}
(function (global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? (module.exports = factory()) :
typeof define === "function" && define.amd ? define(factory) :
((global = global || self), (global.FHCommon = factory()));
})(this, function () {
// cdn引入axios
if (!window.axios) {
loadJavaScript('https://scrm-pro-1251973116.file.myqcloud.com/funzg/form/axios.js', () => {
console.log('axios 加载成功');
});
/**
* 第一个参数的可选属性
* @param {Blob} file 要上传的文件
* @param {String} target 要上传的目标云,类型:0大陆环境/1港险环境
* @param {String} project 所属项目:0全局,1课程,2开放平台,4:scrm 5:营销 6:frcdap
* @param {Function} keyFunc 生成key的方法
* @param {Boolean} needWholeRes 是否需要返回完整的响应体
*
* 第二个参数
* @param {Function} onProgress 接收上传进度的回调
* @returns Link 上传完成后的图片链接
*
* 例:
* const param = {
* file, target = 'tencent', project = '0', keyFunc
* }
* upload(param,(percent)=>{
* console.log(percent) // 输出上传进度的百分比
* })
*/
export function upload ({ file, target, project = '0', keyFunc, needWholeRes }, onProgress) {
const defaultTarget = (location.origin.includes('https://smnguat.fhrons.net') || location.origin.includes('https://openuat.fhrons.net') || location.origin.includes('https://smng.avantech.io') || location.origin.includes('https://open.avantech.io') || process.env.VUE_APP_ENV_CONFIG && process.env.VUE_APP_ENV_CONFIG.includes('hk') || process.env.VUE_APP_ENV_CONFIG && process.env.VUE_APP_ENV_CONFIG === 'poc') ? 'amazon' : 'tencent';
target = target || defaultTarget
if (!file) {
console.error('上传的文件不能为空');
return;
}
if (!window.AWS) {
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js', () => {
console.log('aws-sdk 加载成功');
});
}
if (!window.COS) {
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js', () => {
console.log('腾讯cos 加载成功');
});
}
if (!window.lrz) {
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/lrz.all.bundle.min.js', () => {
console.log('lrz加载成功');
});
}
/**
* 第一个参数的可选属性
* @param {Blob} file 要上传的文件
* @param {String} target 要上传的目标云,类型:0大陆环境/1港险环境
* @param {String} project 所属项目:0全局,1课程,2开放平台,4:scrm 5:营销 6:frcdap
* @param {Function} keyFunc 生成key的方法
* @param {Boolean} needWholeRes 是否需要返回完整的响应体
*
* 第二个参数
* @param {Function} onProgress 接收上传进度的回调
* @returns Link 上传完成后的图片链接
*
* 例:
* const param = {
* file, target = 'tencent', project = '0', keyFunc
* }
* upload(param,(percent)=>{
* console.log(percent) // 输出上传进度的百分比
* })
*/
function upload ({ file, target, project = '0', keyFunc, needWholeRes }, onProgress) {
const defaultTarget = (location.origin.includes('https://smnguat.fhrons.net') || location.origin.includes('https://openuat.fhrons.net') || location.origin.includes('https://smng.avantech.io') || location.origin.includes('https://open.avantech.io') || process.env.VUE_APP_ENV_CONFIG && process.env.VUE_APP_ENV_CONFIG.includes('hk') || process.env.VUE_APP_ENV_CONFIG && process.env.VUE_APP_ENV_CONFIG === 'poc') ? 'amazon' : 'tencent';
target = target || defaultTarget
if (!file) {
console.error('上传的文件不能为空');
return;
}
if (file.raw) file = file.raw; // 有的file对象里面的raw才是实际的文件内容
if (file.file) file = file.file // vant文件选择器选到的文件里还有一层file
target = target === 'tencent' ? '0' : '1'; // 根据传进来的target转换
const filename = file.name;
const appName = process.env.VUE_APP_NAME || 'common';
if (typeof keyFunc !== 'function' || (typeof keyFunc === 'function' && !keyFunc())) keyFunc = () => '/' + appName + '/' + new Date().valueOf() + '_' + filename;
let newKey = keyFunc();
newKey = removeLeadingSlash(newKey);
return axios.get(`/funapi/config/oss/sign/${target}/${project}`).then(res => {
const { tmpSecretId, tmpSecretKey, token, sessionToken, startTime, expiredTime, requestId, type, bucketName, region, cdnUrl } = res.data || res;
/**
* @tmpSecretId 临时访问密钥的标识符。
* @tmpSecretKey 临时访问密钥的密钥。
* @type 0腾讯/1亚马逊 字符串格式
* @startTime 腾讯使用的字段,开始时间
* @expiredTime 腾讯使用的字段,过期时间
* @bucketName 存储桶名称
* @cdnUrl cdn链接的前缀
* @region 存储区域
*/
if (type === '1') { // 亚马逊
AWS.config.update({
accessKeyId: tmpSecretId,
secretAccessKey: tmpSecretKey,
region: region,
sessionToken: token
});
const s3 = new AWS.S3();
const params = {
Bucket: bucketName,
Key: newKey,
ContentType: type,
Body: file,
'Access-Control-Allow-Credentials': '*'
};
const upload = s3.upload(params);
upload.on('httpUploadProgress', (progress) => {
const { loaded, total } = progress;
/* 非必须 */
const percent = Math.round(parseInt(loaded / total) * 100);
if (typeof onProgress === 'function') onProgress(percent);
});
const uploadPromise = upload.promise();
return uploadPromise.then(res => {
const { key, Key } = res;
console.log(res);
// const tempUrl = (key.startsWith('/') ? '' : '/');
if (needWholeRes) {
return {
...res,
fileUrl: `${cdnUrl}/${key || Key}`
};
} return `${cdnUrl}/${key || Key}`;
}).catch(err => {
console.log(err);
}).finally(_ => {
});
} // 腾讯 如果没有type 则默认使用腾讯上传
const cos = new COS({
getAuthorization: function (options, callback) {
callback({
TmpSecretId: tmpSecretId,
TmpSecretKey: tmpSecretKey,
XCosSecurityToken: sessionToken,
StartTime: startTime,
ExpiredTime: expiredTime,
requestId: requestId,
SecurityToken: token
});
}
if (file.raw) file = file.raw; // 有的file对象里面的raw才是实际的文件内容
if (file.file) file = file.file // vant文件选择器选到的文件里还有一层file
target = target === 'tencent' ? '0' : '1'; // 根据传进来的target转换
const filename = file.name;
const appName = process.env.VUE_APP_NAME || 'common';
if (typeof keyFunc !== 'function' || (typeof keyFunc === 'function' && !keyFunc())) keyFunc = () => '/' + appName + '/' + new Date().valueOf() + '_' + filename;
let newKey = keyFunc();
newKey = removeLeadingSlash(newKey);
return axios.get(`/funapi/config/oss/sign/${target}/${project}`).then(res => {
const { tmpSecretId, tmpSecretKey, token, sessionToken, startTime, expiredTime, requestId, type, bucketName, region, cdnUrl } = res.data || res;
/**
* @tmpSecretId 临时访问密钥的标识符。
* @tmpSecretKey 临时访问密钥的密钥。
* @type 0腾讯/1亚马逊 字符串格式
* @startTime 腾讯使用的字段,开始时间
* @expiredTime 腾讯使用的字段,过期时间
* @bucketName 存储桶名称
* @cdnUrl cdn链接的前缀
* @region 存储区域
*/
if (type === '1') { // 亚马逊
AWS.config.update({
accessKeyId: tmpSecretId,
secretAccessKey: tmpSecretKey,
region: region,
sessionToken: token
});
return cos.sliceUploadFile(
{
Bucket: bucketName /* 必须 */,
Region: region /* 存储桶所在地域,必须字段 */,
Key: newKey /* 必须 */,
StorageClass: 'STANDARD',
Body: file, // 上传文件对象
onProgress: progressData => {
console.log(progressData);
const { loaded, total, percent, speed } = progressData;
const per = Math.round(parseInt(percent * 100));
if (typeof onProgress === 'function') onProgress(per);
}
}
).then(data => {
console.log(data);
const { key, Key } = data;
const tempUrl = (Key.startsWith('/') ? '' : '/');
const s3 = new AWS.S3();
const params = {
Bucket: bucketName,
Key: newKey,
ContentType: type,
Body: file,
'Access-Control-Allow-Credentials': '*'
};
const upload = s3.upload(params);
upload.on('httpUploadProgress', (progress) => {
const { loaded, total } = progress;
/* 非必须 */
const percent = Math.round(parseInt(loaded / total) * 100);
if (typeof onProgress === 'function') onProgress(percent);
});
const uploadPromise = upload.promise();
return uploadPromise.then(res => {
const { key, Key } = res;
console.log(res);
// const tempUrl = (key.startsWith('/') ? '' : '/');
if (needWholeRes) {
return {
...res,
fileUrl: `${cdnUrl}${tempUrl}${key || Key}`
fileUrl: `${cdnUrl}/${key || Key}`
};
} return `${cdnUrl}${tempUrl}${key || Key}`;
} return `${cdnUrl}/${key || Key}`;
}).catch(err => {
console.log(err);
}).finally(_ => {
});
} // 腾讯 如果没有type 则默认使用腾讯上传
const cos = new COS({
getAuthorization: function (options, callback) {
callback({
TmpSecretId: tmpSecretId,
TmpSecretKey: tmpSecretKey,
XCosSecurityToken: sessionToken,
StartTime: startTime,
ExpiredTime: expiredTime,
requestId: requestId,
SecurityToken: token
});
}
});
};
return cos.sliceUploadFile(
{
Bucket: bucketName /* 必须 */,
Region: region /* 存储桶所在地域,必须字段 */,
Key: newKey /* 必须 */,
StorageClass: 'STANDARD',
Body: file, // 上传文件对象
onProgress: progressData => {
console.log(progressData);
const { loaded, total, percent, speed } = progressData;
const per = Math.round(parseInt(percent * 100));
if (typeof onProgress === 'function') onProgress(per);
}
}
).then(data => {
console.log(data);
const { key, Key } = data;
const tempUrl = (Key.startsWith('/') ? '' : '/');
if (needWholeRes) {
return {
...res,
fileUrl: `${cdnUrl}${tempUrl}${key || Key}`
};
} return `${cdnUrl}${tempUrl}${key || Key}`;
}).catch(err => {
console.log(err);
});
});
};
/**
* @param {Blob} file 上传的图片文件
* @param {Number} quality 压缩质量
* @returns 返回压缩后的图片文件
*/
// 压缩文件
async function compressFile (file, quality = 0.7) {
file = file.raw ? file.raw : file;
// const imageCompressor = new Compressor();
try {
let reFile = '';
const rst = await lrz(file, {
quality: quality // 图片压缩质量,取值0-1,默认为0.7
});
// const rst = new Compressor(file);
reFile = new File([rst.file], file.name, { type: 'image/jpeg', lastModified: Date.now() });
return reFile;
} catch (error) {
return '';
}
};
/**
* @param {Blob} file 上传的图片文件
* @param {Number} size 指定压缩后的图片大小
* @param {Number} quality 压缩质量
* @returns 返回压缩后的图片文件
*/
// 循环压缩
async function loopCompressFile (file, size, quality) {
if (!size) {
return new Error('size 不能为空')
}
// let reFile = file;
const reFile = await compressFile(file, quality);
if (reFile.size > size) {
compressFile(reFile, quality);
}
/**
* @param {Blob} file 上传的图片文件
* @param {Number} quality 压缩质量
* @returns 返回压缩后的图片文件
*/
// 压缩文件
export async function compressFile (file, quality = 0.7) {
file = file.raw ? file.raw : file;
// const imageCompressor = new Compressor();
try {
let reFile = '';
const rst = await lrz(file, {
quality: quality // 图片压缩质量,取值0-1,默认为0.7
});
// const rst = new Compressor(file);
reFile = new File([rst.file], file.name, { type: 'image/jpeg', lastModified: Date.now() });
return reFile;
};
} catch (error) {
return '';
}
};
// 判断html文档中是否有重复引用的标签
/**
* @param {String} src 要检查的引用地址
*/
function chectDuplicateScript (src) {
let result = false;
// 获取文档中所有的script标签
const scriptTags = document.getElementsByTagName('script');
// 创建一个存储已经出现过的URL集合
const scriptURLs = new Set();
// 遍历所有的tag 标签
for (let i = 0; i < scriptTags.length; i++) {
const currentSrc = scriptTags[i].getAttribute('src');
if (currentSrc && currentSrc === src) {
if (scriptURLs.has(currentSrc)) {
// console.log('重复引用,引用地址为', currentSrc);
result = true;
} else {
scriptURLs.add(currentSrc);
}
/**
* @param {Blob} file 上传的图片文件
* @param {Number} size 指定压缩后的图片大小
* @param {Number} quality 压缩质量
* @returns 返回压缩后的图片文件
*/
// 循环压缩
export async function loopCompressFile (file, size, quality) {
if (!size) {
return new Error('size 不能为空')
}
// let reFile = file;
const reFile = await compressFile(file, quality);
if (reFile.size > size) {
compressFile(reFile, quality);
}
return reFile;
};
// 判断html文档中是否有重复引用的标签
/**
* @param {String} src 要检查的引用地址
*/
function chectDuplicateScript (src) {
let result = false;
// 获取文档中所有的script标签
const scriptTags = document.getElementsByTagName('script');
// 创建一个存储已经出现过的URL集合
const scriptURLs = new Set();
// 遍历所有的tag 标签
for (let i = 0; i < scriptTags.length; i++) {
const currentSrc = scriptTags[i].getAttribute('src');
if (currentSrc && currentSrc === src) {
if (scriptURLs.has(currentSrc)) {
// console.log('重复引用,引用地址为', currentSrc);
result = true;
} else {
scriptURLs.add(currentSrc);
}
}
if (scriptURLs.size === 0) {
result = false;
// console.log('没有重复引用', src);
}
return result;
}
// 动态引入JS文件
function loadJavaScript (src, callback) {
if (chectDuplicateScript(src)) return;
const script = document.createElement('script');
const head = document.getElementsByTagName('head')[0];
script.type = 'text/javascript';
script.charset = 'UTF-8';
script.src = src;
window.onerror = () => {
console.log(`loadJavaScript加载${src}失败`);
};
if (script.addEventListener) {
script.addEventListener('load', function () {
if (scriptURLs.size === 0) {
result = false;
// console.log('没有重复引用', src);
}
return result;
}
// 动态引入JS文件
function loadJavaScript (src, callback) {
if (chectDuplicateScript(src)) return;
const script = document.createElement('script');
const head = document.getElementsByTagName('head')[0];
script.type = 'text/javascript';
script.charset = 'UTF-8';
script.src = src;
window.onerror = () => {
console.log(`loadJavaScript加载${src}失败`);
};
if (script.addEventListener) {
script.addEventListener('load', function () {
callback();
}, false);
} else if (script.attachEvent) {
script.attachEvent('onreadystatechange', function () {
const target = window.event.srcElement;
if (target.readyState === 'loaded' || script.readState === 'complate') {
callback();
}, false);
} else if (script.attachEvent) {
script.attachEvent('onreadystatechange', function () {
const target = window.event.srcElement;
if (target.readyState === 'loaded' || script.readState === 'complate') {
callback();
}
});
}
script.addEventListener('error', (e) => {
if (!isEmpty(e)) {
callback('err');
}
});
if (src) {
// 如果src不存在,不加入到项目里面去,否则会报加载资源失败
head.appendChild(script);
}
}
/**
* 为空
* @param val
* @returns {boolean}
*/
function isEmpty (val) {
if (val === null || val === undefined || (typeof val === 'string' && (val === '' || val === 'undefined' || val === 'null')) || (Array.isArray(val) && val.length === 0) || (Object.prototype.toString.call(val) === '[object Object]' && Object.keys(val).length === 0)) {
return true;
script.addEventListener('error', (e) => {
if (!isEmpty(e)) {
callback('err');
}
return false;
});
if (src) {
// 如果src不存在,不加入到项目里面去,否则会报加载资源失败
head.appendChild(script);
}
}
/**
* 为空
* @param val
* @returns {boolean}
*/
function isEmpty (val) {
if (val === null || val === undefined || (typeof val === 'string' && (val === '' || val === 'undefined' || val === 'null')) || (Array.isArray(val) && val.length === 0) || (Object.prototype.toString.call(val) === '[object Object]' && Object.keys(val).length === 0)) {
return true;
}
return false;
}
function removeLeadingSlash (str) {
if (str.startsWith('/')) {
return str.substring(1); // 返回去掉斜杠后的值
}
return str; // 如果字符串不以斜杠开头,则返回原始字符串
function removeLeadingSlash (str) {
if (str.startsWith('/')) {
return str.substring(1); // 返回去掉斜杠后的值
}
const FHCommon = {
upload: upload,
compressFile: compressFile,
loopCompressFile: loopCompressFile,
install (Vue) {
window.FHCommon = FHCommon
Vue.component('FHImage',FHImage)
Vue.component('FHPresetImage',FHPresetImage)
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(FHCommon)
}
return FHCommon
});
return str; // 如果字符串不以斜杠开头,则返回原始字符串
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc