general-basic-form 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(D,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],$):(D=typeof globalThis<"u"?globalThis:D||self,$(D.Index={},D.Vue))})(this,function(D,$){"use strict";const ot="";function k(r,e,t,a,n,o,s,c){var i=typeof r=="function"?r.options:r;e&&(i.render=e,i.staticRenderFns=t,i._compiled=!0),a&&(i.functional=!0),o&&(i._scopeId="data-v-"+o);var l;if(s?(l=function(u){u=u||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!u&&typeof __VUE_SSR_CONTEXT__<"u"&&(u=__VUE_SSR_CONTEXT__),n&&n.call(this,u),u&&u._registeredComponents&&u._registeredComponents.add(s)},i._ssrRegister=l):n&&(l=c?function(){n.call(this,(i.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(i.functional){i._injectStyles=l;var d=i.render;i.render=function(f,h){return l.call(h),d(f,h)}}else{var p=i.beforeCreate;i.beforeCreate=p?[].concat(p,l):[l]}return{exports:r,options:i}}const ae={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};var ne=function(){var e=this,t=e._self._c;return t("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},se=[],oe=k(ae,ne,se,!1,null,null,null,null);const ie=oe.exports,ce=(r={})=>{for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const t=r[e];Object.prototype.toString.call(t)==="[object Object]"&&(r[e]=JSON.stringify(t))}return r},le=(r={})=>{for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const t=r[e];try{/[{]+/g.test(t)&&/[}]+/g.test(t)&&(r[e]=JSON.parse(t))}catch{}}return r},W={paramsToQuery:ce,queryToData:le},S=K;(function(r,e){const t=K,a=r();for(;;)try{if(parseInt(t(224))/1*(-parseInt(t(262))/2)+parseInt(t(271))/3*(-parseInt(t(273))/4)+-parseInt(t(281))/5*(-parseInt(t(257))/6)+-parseInt(t(250))/7*(-parseInt(t(253))/8)+-parseInt(t(261))/9+-parseInt(t(247))/10+-parseInt(t(276))/11*(-parseInt(t(256))/12)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(j,932279);const g={};let I=null;const M=async(r,e)=>{const t=K;!window.indexedDB&&window[t(252)](t(236));const{DBName:a="",DBVersion:n=1}=r;let o,s=!1;try{const c=window[t(265)].open(a,n);await new Promise((i,l)=>{const d=t;c[d(231)]=async function(p){const u=d,f=p[u(286)][u(228)],{stores:h=[]}=r;await Promise[u(269)](h[u(242)](async y=>{const m=u,{DBStoreName:b="",properties:w={}}=y;try{const B={};B[m(237)]=r[m(238)];const O=p[m(234)].result[m(289)](b,B);if(Object[m(241)](w)[m(282)]===0){console[m(226)](b+m(275));return}for(const T in w)if(w[m(223)][m(268)](w,T)){const z=w[T],N={...z[m(258)]};O[m(258)](T,T,N)}}catch(B){console.warn(B)}})),o=f,s=!0},c[d(288)]=async function(p){const u=d;if(o=this[u(228)],s){const{stores:f=[]}=r;await Promise[u(269)](f[u(242)](async h=>{const y=u,{DBStoreName:m=""}=h,b=o[y(246)]([m],y(251)),w=b[y(274)](m),B={};B[r[y(238)]]=e,w[y(285)](B);try{await new Promise((O,T)=>{const z=y;b.onabort=function(N){const V=K;console[V(230)](V(254),N),T()},b[z(272)]=function(N){O()},b[z(260)]=function(N){const V=z;console[V(230)](V(239),N),T()}})}catch(O){console[y(226)](y(270),O)}}))}i()},c[d(260)]=function(p){l(p)}})}catch(c){console.error(c,t(266))}return o};function j(){const r=["1464mvMiei","237864JBnTLr","createIndex","info","onerror","10438893QpczMy","2762094YVzJZu","update","Database connection closed, reconnecting...","indexedDB","打开数据库报错,可能是数据库版本不对,或者储存容量不足等原因","传入结构化克隆算法不支持的数据类型可能导致报错","call","all","目前所有数据都在用户ID的主键下面,所以没有主键的话做重新载入页面处理","4860399kEbqOd","oncomplete","4VdzWwr","objectStore","没有设置默认值","235378QpXYjE","deleteDB","close","事务失败","数据库删除失败","140VRAbTP","length","store不存在,请更新schema和DBVersion并重启前端服务","getDB","add","target","DBName","onsuccess","createObjectStore","hasOwnProperty","1UrIRyX","updateStore","warn","openCursor","result","put","error","onupgradeneeded","deleteStore","主键查询结果:","currentTarget","mapDB","您的浏览器不支持IndexedDB的稳定版本。离线数据功能将不可用。Your browser doesn't support a stable version of IndexedDB. offline data feature will not be available.","keyPath","primaryKey","主键插入失败","数据更新成功","keys","map","delete","get","数据更新失败没有request","transaction","4043600olVeJQ","数据更新失败","addEventListener","163681jsedKz","readwrite","alert","608zfClSO","主键插入中止","continue"];return j=function(){return r},j()}function K(r,e){const t=j();return K=function(a,n){return a=a-223,t[a]},K(r,e)}let R=!1;g[S(284)]=async r=>{const e=S,{mapDB:t,primaryKey:a}=r;return t?a?(R&&await new Promise(async(n,o)=>{const s=()=>{R?setTimeout(()=>{s()},200):n()};s()}),!I&&(R=!0,I=await M(t,a),I==null||I[e(249)](e(278),async()=>{const n=e;console[n(259)](n(264)),I=await M(t,a)}),R=!1),I):(console[e(226)]("获取Database缺乏用户信息,请先传入对primaryKey的赋值"),!1):(console[e(226)]("必须传入数据库配置信息"),!1)},g.getDataByKey=async(r,e)=>{const t=S,{mapDB:a,tableName:n,primaryKey:o}=r,s={};s[t(235)]=a,s[t(238)]=o;const c=await g[t(284)](s);if(!c)return;const i=c.transaction([n]),l=i[t(274)](n),d=l[t(244)](o);return new Promise((p,u)=>{const f=t;d[f(288)]=function(h){const y=f;e(n+y(233)+d[y(228)]),p(d[y(228)])},d[f(260)]=function(h){const y=f;console[y(230)](n+y(279)+h),u()}})},g[S(225)]=async(r,e)=>{var t;const a=S,{mapDB:n,tableName:o,updateData:s}=r;!s[n==null?void 0:n[a(238)]]&&console[a(226)]("请传入主键"+n[a(238)]);const c={};c[a(235)]=n,c[a(238)]=s[n==null?void 0:n[a(238)]];const i=await g.getDB(c);if(!i)return;let l=null;try{l=i[a(246)]([o],"readwrite").objectStore(o)}catch(f){console[a(230)](a(283),f)}let d=null,p=null;const u=await new Promise((f,h)=>{const y=a,m=l[y(227)](s[n==null?void 0:n.primaryKey]);m[y(288)]=b=>{f(b)},m.onerror=b=>{h(b)}});p=(t=u==null?void 0:u[a(286)])==null?void 0:t[a(228)];try{p&&(p==null?void 0:p[a(238)])===s[n==null?void 0:n.primaryKey]?d=p[a(263)](s):d=l[a(229)](s)}catch(f){console[a(230)](a(267),f,s)}new Promise((f,h)=>{const y=a;!d&&(console[y(230)](o+y(245)),h()),d[y(288)]=function(m){e(o+y(240)),f()},d[y(260)]=function(m){const b=y;console[b(230)](o+b(248),m),h()}}),p&&p[a(255)]()},g[S(232)]=async(r,e)=>{const t=S,{mapDB:a,tableName:n,primaryKey:o}=r,s={};s[t(235)]=a,s[t(238)]=o;const c=await g[t(284)](s);if(!c)return;const i=c[t(246)]([n],t(251))[t(274)](n)[t(243)](o);return new Promise((l,d)=>{const p=t;i[p(288)]=function(u){e(n+"数据删除成功"),l()},i.onerror=function(u){console[p(230)](n+"数据删除失败"+u),d()}})},g[S(277)]=async(r,e)=>{const t=S,{mapDB:a}=r,n=window[t(265)].deleteDatabase(a[t(287)]);return new Promise((o,s)=>{const c=t;n[c(288)]=i=>{e(a[c(287)]+"数据库已删除"),o()},n[c(260)]=i=>{const l=c;console[l(230)](a[l(287)]+l(280)+i),s()}})};const G=P;function E(){const r=["error","18qzGcVH","4682604GbULBa","6016003SPdUIY","20065atPLOQ","updateStore","65UvpzlD","6700512ZDDSvv","handleData","为空,请先调用handleData","mapDB","13110xITriW","primaryKey","deleteStore","getDataByKey","clearData","7689BMhWoa","404ipIPIB","22929dseKps","426mZTQfR","8660kGxzIL","tableName","9mGIzFA","updateData"];return E=function(){return r},E()}(function(r,e){const t=P,a=r();for(;;)try{if(parseInt(t(400))/1*(-parseInt(t(405))/2)+parseInt(t(398))/3*(-parseInt(t(397))/4)+parseInt(t(408))/5*(parseInt(t(399))/6)+-parseInt(t(407))/7+parseInt(t(387))/8*(-parseInt(t(402))/9)+-parseInt(t(391))/10*(-parseInt(t(396))/11)+parseInt(t(406))/12*(parseInt(t(410))/13)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(E,605521);async function ue(r,e){const t=P,{tableName:a,propertiesKey:n,parameter:o,primaryKey:s,mapDB:c}=r;let i=null,l={[c[t(392)]]:s};const d={};d[t(390)]=c,d[t(401)]=a,d[t(392)]=s;const p=await g[t(394)](d);p&&(l={...p,[c[t(392)]]:s}),l[n]=o;const u={};return u[t(390)]=c,u[t(401)]=a,u.updateData=l,await g[t(409)](u),o&&(i=o),e(i),i}async function pe(r,e){const t=P,{tableName:a,propertiesKey:n,primaryKey:o,mapDB:s}=r;let c=null;const i={};i[t(390)]=s,i[t(401)]=a,i.primaryKey=o;const l=await g[t(394)](i);return l&&(c=l[n]),e(c),c}async function de(r,e){const t=P,{tableName:a,propertiesKey:n,parameter:o,primaryKey:s,mapDB:c}=r;let i={};const l={};l[t(390)]=c,l[t(401)]=a,l[t(392)]=s;const d=await g.getDataByKey(l);try{if(d){i={...d[n],...o};const p={[c[t(392)]]:s},u=p;u[n]=i;const f={};f[t(390)]=c,f[t(401)]=a,f[t(403)]=u,await g[t(409)](f)}else console.warn(a+t(389))}catch(p){console.error(p)}return e(i),i}function P(r,e){const t=E();return P=function(a,n){return a=a-387,t[a]},P(r,e)}async function fe(r,e){const t=P,{tableName:a,primaryKey:n,mapDB:o}=r;let s=null;try{const c={};c[t(390)]=o,c.tableName=a,c.primaryKey=n,await g[t(393)](c)}catch(c){console[t(404)](c)}return e(s),s}const C={};C[G(388)]=ue,C.getData=pe,C[G(403)]=de,C[G(395)]=fe;var v=Q;(function(r,e){for(var t=Q,a=r();;)try{var n=-parseInt(t(195))/1*(-parseInt(t(179))/2)+-parseInt(t(196))/3*(-parseInt(t(194))/4)+-parseInt(t(197))/5+parseInt(t(183))/6*(-parseInt(t(191))/7)+-parseInt(t(190))/8+-parseInt(t(202))/9*(-parseInt(t(199))/10)+-parseInt(t(203))/11*(-parseInt(t(201))/12);if(n===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(L,291935);var U={};function L(){var r=["mapDB-indexeddb-form-schema","778390VHiMPL","stores","3383508RfiKTD","63UERWuz","22gvbCFO","509514cRHqzj","DBVersion","formParams","properties","49908OxCuGa","createIndex","DBName","primaryKey","userId","default","unique","562896ZFvrwm","392gQpHIY","DBStoreName","queryParams","8eQWvIE","1FtIDQF","5259FOfsNi","2694745YrsVgs"];return L=function(){return r},L()}U[v(189)]=!1;var H={};function Q(r,e){var t=L();return Q=function(a,n){a=a-179;var o=t[a];return o},Q(r,e)}H[v(184)]=U,H[v(188)]={};var Y={};Y[v(193)]=H;var J={};J[v(192)]=v(181),J[v(182)]=Y;var F={};F[v(186)]=v(187),F[v(185)]=v(198),F[v(180)]=1,F[v(200)]=[J];const ye={formSchema:F},me=C,{handleData:he,getData:be}=me,{formSchema:Z}=ye,ge=async(r,e)=>{var t;return e.parametersType==="url"&&(r={...W.queryToData((t=e.$route)==null?void 0:t.query),...r}),e.parametersType==="indexDB"&&(r={...await be({tableName:"formParams",propertiesKey:e.$route.path||"defQueryParams",primaryKey:e.DBPrimaryKey||"default",mapDB:Z}),...r}),r},_e=async(r,e)=>{e.parametersType==="url"&&await e.$router.push({query:W.paramsToQuery({...r})}),e.parametersType==="indexDB"&&await he({tableName:"formParams",propertiesKey:e.$route.path||"defQueryParams",parameter:{...r},primaryKey:e.DBPrimaryKey||"default",mapDB:Z})},ve={makeParamsByType:ge,saveParamsByType:_e},X=W,q=ve,_={};let x=null;const ee=async(r,e)=>{window.indexedDB||window.alert("您的浏览器不支持IndexedDB的稳定版本。离线数据功能将不可用。Your browser doesn't support a stable version of IndexedDB. offline data feature will not be available.");const{DBName:t="",DBVersion:a=1}=r;let n,o=!1;try{const s=window.indexedDB.open(t,a);await new Promise((c,i)=>{s.onupgradeneeded=async function(l){const d=l.target.result,{stores:p=[]}=r;await Promise.all(p.map(async u=>{const{DBStoreName:f="",properties:h={}}=u;try{const y=l.currentTarget.result.createObjectStore(f,{keyPath:r.primaryKey});if(Object.keys(h).length===0){console.warn(`${f}没有设置默认值`);return}for(const m in h)if(h.hasOwnProperty.call(h,m)){const b=h[m];y.createIndex(m,m,{...b.createIndex})}}catch(y){console.warn(y)}})),n=d,o=!0},s.onsuccess=async function(l){if(n=this.result,o){const{stores:d=[]}=r;await Promise.all(d.map(async p=>{const{DBStoreName:u=""}=p,f=n.transaction([u],"readwrite"),h=f.objectStore(u),y={};y[r.primaryKey]=e,h.add(y);try{await new Promise((m,b)=>{f.onabort=function(w){console.error("主键插入中止",w),b()},f.oncomplete=function(w){m()},f.onerror=function(w){console.error("主键插入失败",w),b()}})}catch(m){console.warn("目前所有数据都在用户ID的主键下面,所以没有主键的话做重新载入页面处理",m)}}))}c()},s.onerror=function(l){i(l)}})}catch(s){console.error(s,"打开数据库报错,可能是数据库版本不对,或者储存容量不足等原因")}return n};let A=!1;_.getDB=async(r,e)=>{const{mapDB:t,primaryKey:a}=r;return t?a?(A&&await new Promise(async(n,o)=>{const s=()=>{A?setTimeout(()=>{s()},200):n()};s()}),x||(A=!0,x=await ee(t,a),x==null||x.addEventListener("close",async()=>{console.info("Database connection closed, reconnecting..."),x=await ee(t,a)}),A=!1),e&&e(x),x):(console.warn("获取Database缺乏用户信息,请先传入对primaryKey的赋值"),!1):(console.warn("必须传入数据库配置信息"),!1)},_.getDataByKey=async(r,e)=>{const{mapDB:t,tableName:a,primaryKey:n}=r,o=await _.getDB({mapDB:t,primaryKey:n});if(!o)return;const i=o.transaction([a]).objectStore(a).get(n);return new Promise((l,d)=>{i.onsuccess=function(p){e&&e(`${a}主键查询结果:${i.result}`),l(i.result)},i.onerror=function(p){console.error(`${a}事务失败`+p),d()}})},_.updateStore=async(r,e)=>{var d;const{mapDB:t,tableName:a,updateData:n}=r;n[t==null?void 0:t.primaryKey]||console.warn(`请传入主键${t.primaryKey}`);const o=await _.getDB({mapDB:t,primaryKey:n[t==null?void 0:t.primaryKey]});if(!o)return;let s=null;try{s=o.transaction([a],"readwrite").objectStore(a)}catch(p){console.error("store不存在,请更新schema和DBVersion并重启前端服务",p)}let c=null,i=null;const l=await new Promise((p,u)=>{const f=s.openCursor(n[t==null?void 0:t.primaryKey]);f.onsuccess=h=>{p(h)},f.onerror=h=>{u(h)}});i=(d=l==null?void 0:l.target)==null?void 0:d.result;try{i&&(i==null?void 0:i.primaryKey)===n[t==null?void 0:t.primaryKey]?c=i.update(n):c=s.put(n)}catch(p){console.error("传入结构化克隆算法不支持的数据类型可能导致报错",p,n)}new Promise((p,u)=>{c||(console.error(`${a}数据更新失败没有request`),u()),c.onsuccess=function(f){e&&e(`${a}数据更新成功`),p()},c.onerror=function(f){console.error(`${a}数据更新失败`,f),u()}}),i&&i.continue()},_.deleteStore=async(r,e)=>{const{mapDB:t,tableName:a,primaryKey:n}=r,o=await _.getDB({mapDB:t,primaryKey:n});if(!o)return;const s=o.transaction([a],"readwrite").objectStore(a).delete(n);return new Promise((c,i)=>{s.onsuccess=function(l){e&&e(`${a}数据删除成功`),c()},s.onerror=function(l){console.error(`${a}数据删除失败`+l),i()}})},_.deleteDB=async(r,e)=>{const{mapDB:t}=r,a=window.indexedDB.deleteDatabase(t.DBName);return new Promise((n,o)=>{a.onsuccess=s=>{e&&e(`${t.DBName}数据库已删除`),n()},a.onerror=s=>{console.error(`${t.DBName}数据库删除失败`+s),o()}})};async function we(r,e){const{tableName:t,propertiesKey:a,parameter:n,primaryKey:o,mapDB:s}=r;let c=null,i={[s.primaryKey]:o};const l=await _.getDataByKey({mapDB:s,tableName:t,primaryKey:o});return l&&(i={...l,[s.primaryKey]:o}),i[a]=n,await _.updateStore({mapDB:s,tableName:t,updateData:i}),n&&(c=n),e&&e(c),c}async function De(r,e){const{tableName:t,propertiesKey:a,primaryKey:n,mapDB:o}=r;let s=null;const c=await _.getDataByKey({mapDB:o,tableName:t,primaryKey:n});return c&&(s=c[a]),e&&e(s),s}async function Se(r,e){const{tableName:t,propertiesKey:a,parameter:n,primaryKey:o,mapDB:s}=r;let c={};const i=await _.getDataByKey({mapDB:s,tableName:t,primaryKey:o});try{if(i){c={...i[a],...n};const d={[s.primaryKey]:o};d[a]=c,await _.updateStore({mapDB:s,tableName:t,updateData:d})}else console.warn(`${t}为空,请先调用handleData`)}catch(l){console.error(l)}return e&&e(c),c}async function Pe(r,e){const{tableName:t,primaryKey:a,mapDB:n}=r;let o=null;try{await _.deleteStore({mapDB:n,tableName:t,primaryKey:a})}catch(s){console.error(s)}return e&&e(o),o}const xe={handleData:we,getData:De,updateData:Se,clearData:Pe},te={formSchema:{primaryKey:"userId",DBName:"mapDB-indexeddb-form-schema",DBVersion:1,stores:[{DBStoreName:"formParams",properties:{queryParams:{createIndex:{unique:!1},default:{}}}}]}},re=xe,ct="",{getData:Be}=re,{formSchema:Te}=te,ke={name:"GeneralBasicForm",components:{InputArchive:r=>{const{templateEle:e}=r;return e()},VerificationButton:ie},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:()=>[]},size:{type:String,default:""},labelWidth:{type:String,default:"90px"},parametersType:{type:String,default:"url"},DBPrimaryKey:{type:[String,Number],required:!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1},currentPageKey:{type:String,default:"page"},pageSizeKey:{type:String,default:"limit"},defCurrentPage:{type:Number,default:1},defPageSize:{type:Number,default:10},queryWhenReady:{type:Boolean,default:()=>!1}},data(){return{queryParams:this.initQueryParams(),formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},attrs:{inline:!0,"label-position":"left"}}},watch:{formData:{handler(r,e){JSON.stringify(r)!==JSON.stringify(this.queryParams)&&(this.queryParams={...this.queryParams,...r})},immediate:!0,deep:!0},queryParams:{handler(r){this.$emit("update:formData",{...r})},deep:!0},$attrs:{handler(r){this.attrs={...this.attrs,...r}},immediate:!0,deep:!0},loading(r){this.formLoading!==r&&(this.formLoading=r)},formLoading(r){this.loading!==r&&this.$emit("update:loading",r)}},methods:{async handleQuery(r={}){r.defaultPageFirst??(r.defaultPageFirst=!0);const e={[this.currentPageKey]:this.defCurrentPage};let t={...e,...this.queryParams};console.log(t,"searchParams1"),t=await q.makeParamsByType(t,this),console.log(t,"searchParams2"),r.defaultPageFirst&&(t={...t,...e}),await q.saveParamsByType(t,this),this.getList({...t})},async resetQuery(){this.$refs.queryFormRef.resetFields();const r={[this.currentPageKey]:this.defCurrentPage};await q.saveParamsByType(r,this),this.queryParams={...r},this.afterReset(),this.handleQuery()},initQueryParams(){var e;let r={[this.pageSizeKey]:this.defPageSize};return this.parametersType==="url"&&(r={...r,...X.queryToData((e=this.$route)==null?void 0:e.query)}),this.parametersType==="indexDB"&&Be({tableName:"formParams",propertiesKey:this.$route.path||"defQueryParams",primaryKey:this.DBPrimaryKey||"default",mapDB:Te},t=>{this.queryParams={...r,...t}}),this.queryWhenReady&&this.$nextTick(()=>{this.handleQuery({defaultPageFirst:!1})}),r},currentInputComponent(){return"input-archive"},getItemRules(r){const{type:e,rules:t=[]}=r,a=[...t];return this.noInputBlank&&e==="input"&&a.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),a},getInputSetting(r){const{inputSetting:e,setting:t}=r;return{...this.inputSetting,...e,...t}},defaultFunction(){},getInputEvents(r){return{blur:r.blur||this.defaultFunction,focus:r.focus||this.defaultFunction,change:r.change||this.defaultFunction,input:r.input||this.defaultFunction,clear:r.clear||this.defaultFunction}},getSelectSetting(r){const{selectSetting:e,setting:t}=r;return{...this.selectSetting,...e,...t}},getSelectEvents(r){return{change:r.change||this.defaultFunction,"visible-change":r["visible-change"]||this.defaultFunction,"remove-tag":r["remove-tag"]||this.defaultFunction,"expand-change":r["expand-change"]||this.defaultFunction,clear:r.clear||this.defaultFunction,blur:r.blur||this.defaultFunction,focus:r.focus||this.defaultFunction}},getDatePackerSetting(r){const{datePackerSetting:e,setting:t}=r;return{...this.datePackerSetting,...e,...t}},getDatePackerEvents(r){return{change:r.change||this.defaultFunction,blur:r.blur||this.defaultFunction,focus:r.focus||this.defaultFunction}},getCheckboxGroupSetting(r){const{checkboxGroupSetting:e,setting:t}=r;return{...e,...t}},getCheckboxGroupEvents(r){return{change:r.change||this.defaultFunction}}}};var Ie=function(){var e=this,t=e._self._c;return t("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,"label-width":e.labelWidth}},"el-form",e.attrs,!1),[e._l(e.formItem,function(a){return t("el-form-item",e._b({key:a.prop,attrs:{rules:e.getItemRules(a)}},"el-form-item",a,!1),[a.type==="input"?t("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(a.template,function(n,o){return{key:o,fn:function(){return[n?t(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(a),!1),e.getInputEvents(a))):a.type==="input-mobile-verification"?t("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(a.template,function(n,o){return{key:o,fn:function(){return[n?t(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(a),!1),e.getInputEvents(a)),[t("template",{slot:"append"},[t("verification-button",{attrs:{verificationSetting:a.verificationSetting,getSmscode:a.getSmscode}})],1)],2):a.type==="select"?t("el-select",e._g(e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(a),!1),e.getSelectEvents(a)),e._l(a.option||[],function(n){return t("el-option",{key:n.key||n.value,attrs:{label:n.label,value:n.value}})}),1):a.type==="cascader"?t("el-cascader",e._g(e._b({attrs:{filterable:"",size:e.size,options:a.options||[]},model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(a),!1),e.getSelectEvents(a))):a.type==="date-picker"?t("el-date-picker",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(a),!1),e.getDatePackerEvents(a))):e._e(),a.type==="input-number"?t("el-input-number",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(a),!1),e.getInputEvents(a))):a.type==="checkbox"?t("el-checkbox-group",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[a.prop],callback:function(n){e.$set(e.queryParams,a.prop,n)},expression:"queryParams[item.prop]"}},"el-checkbox-group",e.getCheckboxGroupSetting(a),!1),e.getCheckboxGroupEvents(a)),e._l(a.option||[],function(n){return t("el-checkbox",e._b({key:n.key||n.value||n.label},"el-checkbox",n,!1))}),1):e._e(),/^form-item-slot$/i.test(a.type)?e._t(a.name):e._e()],2)}),e._t("default"),e.formOnly?e._e():t("el-form-item",[t("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),t("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},Ke=[],Ne=k(ke,Ie,Ke,!1,null,"1bb4e2ca",null,null);const $e=Ne.exports,lt="",Ce={components:{},props:{query:{type:Object,default:()=>({prefCode:sessionStorage.getItem("prefCode")})},routePath:{type:String,default:()=>"/search/searchDetail"},inputstyle:{type:Object,default:()=>({width:"1280px"})},openHref:{type:Boolean,default:()=>!1},size:{type:String,default:()=>"medium"}},data(){var r,e;return{keyWord:((e=(r=this.$route)==null?void 0:r.query)==null?void 0:e.keyWord)||"",attrs:{}}},watch:{$attrs:{handler(r){this.attrs={...this.attrs,...r}},immediate:!0,deep:!0}},methods:{search(){const r={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(r);window.open(e.href,"_blank")}else this.$router.push(r)}}};var Fe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"search-box"},[t("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(a){e.keyWord=a},expression:"keyWord"}},"el-input",e.attrs,!1),[t("svg",{staticClass:"el-input__icon",attrs:{slot:"prefix",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},slot:"prefix"},[t("path",{attrs:{d:"M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z",fill:"#959A9F"}})])])],1)},qe=[],Oe=k(Ce,Fe,qe,!1,null,"ef706e31",null,null);const ze=Oe.exports,Ve={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(r,e){const{props:t}=e,{column:a,formData:n}=t;return a.render(n)}}},data(){return{attrs:{border:!0,class:"v-descriptions"}}},props:{formItem:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}}},watch:{$attrs:{handler(r){this.attrs={...this.attrs,...r}},immediate:!0,deep:!0}}};var je=function(){var e=this,t=e._self._c;return t("el-descriptions",e._b({},"el-descriptions",e.attrs,!1),e._l(e.formItem,function(a,n){return t("el-descriptions-item",e._b({key:a.prop,attrs:{label:a.label}},"el-descriptions-item",a.descriptionsItemProps,!1),[a.render?t("DescriptionsColumn",{attrs:{column:a,formData:e.formData}}):t("span",[e._v(e._s(e.formData[a.prop]))])],1)}),1)},Re=[],Ee=k(Ve,je,Re,!1,null,null,null,null);const Le=Ee.exports,pt="",Qe={props:{nodeKey:{type:String,default:"id"},filterable:{type:Boolean,default:!1},dataSource:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]}},watch:{sourceFilterText(r){this.$refs.sourceTree.filter(r)},selectedFilterText(r){this.$refs.selectTree.filter(r)},checkedKeys(r){this.$refs.sourceTree.setCheckedKeys(r),$.nextTick(()=>{this.getSelectedData(),this.$refs.selectTree.setCheckedKeys(r)})}},data(){return{defaultTreeAttributes:{"default-expand-all":!0,"show-checkbox":!0},selectedList:[],sourceFilterText:"",selectedFilterText:""}},methods:{sourceFilterNode(r,e){return r?e.label.indexOf(r)!==-1:!0},getSelectedData(){let r=!0,e;const t=this.$refs.sourceTree.getCheckedNodes(r,e);this.selectedList=t},removeSelectedData(){let r,e;const t=this.$refs.selectTree.getCheckedNodes(r,e),a={};t.forEach(n=>{a[n[this.nodeKey]]=n}),this.selectedList=this.selectedList.filter(n=>!a[n[this.nodeKey]])}}};var Ae=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tree-box"},[t("div",{staticClass:"left-box"},[e.filterable?t("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.sourceFilterText,callback:function(a){e.sourceFilterText=a},expression:"sourceFilterText"}}):e._e(),t("el-tree",e._b({ref:"sourceTree",attrs:{data:e.dataSource,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1),t("div",{staticClass:"mid-box"},[t("el-button",{attrs:{icon:"el-icon-arrow-right",circle:""},on:{click:e.getSelectedData}}),t("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeSelectedData}})],1),t("div",{staticClass:"right-box"},[e.filterable?t("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.selectedFilterText,callback:function(a){e.selectedFilterText=a},expression:"selectedFilterText"}}):e._e(),t("el-tree",e._b({ref:"selectTree",attrs:{data:e.selectedList,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1)])},We=[],Ge=k(Qe,Ae,We,!1,null,"49dbad2a",null,null);const He=Ge.exports,dt="",{getData:Je}=re,{formSchema:Me}=te,Ue={name:"VTabs",data(){return{activeName:this.activeNameInit()}},props:{tabPanes:{type:Array,default:()=>[]},parametersType:{type:String,default:"url"},DBPrimaryKey:{type:[String,Number],required:!1},activeNameKey:{type:String,default:"activeName"},defActiveName:{type:String},getList:{type:Function,default:()=>{}}},watch:{defActiveName:{handler(r,e){JSON.stringify(r)!==JSON.stringify(this.activeName)&&(this.activeName=r)},immediate:!0},activeName:{handler(r){this.$emit(`update:${this.activeNameKey}`,r)}}},methods:{async handleClick(r,e){const t=await q.makeParamsByType({[this.activeNameKey]:this.activeName},this);await q.saveParamsByType(t,this),this.getList({...t})},activeNameInit(){var t,a,n;let r="";(t=this.tabPanes[0])!=null&&t.name&&(r=(a=this.tabPanes[0])==null?void 0:a.name);const e=X.queryToData(Number((n=this.$route)==null?void 0:n.query[this.activeNameKey]));return this.parametersType==="url"&&e&&(r=e),this.parametersType==="indexDB"&&Je({tableName:"formParams",propertiesKey:this.$route.path||"defQueryParams",primaryKey:this.DBPrimaryKey||"default",mapDB:Me},o=>{this.activeName=o==null?void 0:o[this.activeNameKey]}),this.defActiveName&&(r=this.defActiveName),`${r}`}}};var Ye=function(){var e=this,t=e._self._c;return t("el-tabs",e._b({on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(a){e.activeName=a},expression:"activeName"}},"el-tabs",e.$attrs,!1),[e._l(e.tabPanes,function(a){return t("el-tab-pane",e._b({key:a.name},"el-tab-pane",a,!1),[e._v(" "+e._s(a.render&&a.render(a))+" ")])}),e._t("default")],2)},Ze=[],Xe=k(Ue,Ye,Ze,!1,null,"27244d13",null,null);const et=Xe.exports,tt=$e,rt=ze,at=Le,nt=He,st=et;D.VDescriptions=at,D.VGeneralBasicForm=tt,D.VSearchBox=rt,D.VTabs=st,D.VTreeTransfer=nt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
1
+ (function(I,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],j):(I=typeof globalThis<"u"?globalThis:I||self,j(I.Index={},I.Vue))})(this,function(I,j){"use strict";const vt="";function z(a,e,t,r,n,o,i,s){var c=typeof a=="function"?a.options:a;e&&(c.render=e,c.staticRenderFns=t,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o);var f;if(i?(f=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),n&&n.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(i)},c._ssrRegister=f):n&&(f=s?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),f)if(c.functional){c._injectStyles=f;var p=c.render;c.render=function(y,b){return f.call(b),p(y,b)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,f):[f]}return{exports:a,options:c}}const _e={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};var ge=function(){var e=this,t=e._self._c;return t("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},ve=[],De=z(_e,ge,ve,!1,null,null,null,null);const we=De.exports,Se=(a={})=>{for(const e in a)if(Object.prototype.hasOwnProperty.call(a,e)){const t=a[e];Object.prototype.toString.call(t)==="[object Object]"&&(a[e]=JSON.stringify(t))}return a},Be=(a={})=>{for(const e in a)if(Object.prototype.hasOwnProperty.call(a,e)){const t=a[e];try{/[{]+/g.test(t)&&/[}]+/g.test(t)&&(a[e]=JSON.parse(t))}catch{}}return a},ae={paramsToQuery:Se,queryToData:Be},N=q;(function(a,e){const t=q,r=a();for(;;)try{if(parseInt(t(561))/1+-parseInt(t(558))/2+parseInt(t(521))/3*(parseInt(t(527))/4)+-parseInt(t(506))/5*(parseInt(t(510))/6)+-parseInt(t(550))/7*(parseInt(t(503))/8)+parseInt(t(540))/9+-parseInt(t(546))/10*(-parseInt(t(562))/11)===e)break;r.push(r.shift())}catch{r.push(r.shift())}})(Q,819524);const w={};let C=null;const ce=async(a,e)=>{const t=q;!window[t(543)]&&window[t(498)]("您的浏览器不支持IndexedDB的稳定版本。离线数据功能将不可用。Your browser doesn't support a stable version of IndexedDB. offline data feature will not be available.");const{DBName:r="",DBVersion:n=1}=a;let o,i=!1;try{const s=window[t(543)][t(519)](r,n);await new Promise((c,f)=>{const p=t;s[p(551)]=async function(u){const l=p,y=u.target.result,{stores:b=[]}=a;await Promise.all(b[l(509)](async d=>{const m=l,{DBStoreName:h="",properties:_={}}=d;try{const g={};g[m(536)]=a[m(557)];const P=u[m(541)][m(520)][m(554)](h,g);if(Object[m(548)](_)[m(500)]===0){console[m(559)](h+"没有设置默认值");return}for(const v in _)if(_[m(556)][m(515)](_,v)){const D=_[v],B={...D.createIndex};P[m(504)](v,v,B)}}catch(g){console[m(559)](g)}})),o=y,i=!0},s[p(535)]=async function(u){const l=p;if(o=this[l(520)],i){const{stores:y=[]}=a;await Promise[l(528)](y[l(509)](async b=>{const d=l,{DBStoreName:m=""}=b,h=o[d(552)]([m],d(547)),_=h[d(496)](m),g={};g[a[d(557)]]=e,_[d(502)](g);try{await new Promise((P,v)=>{const D=d;h[D(525)]=function(B){const T=D;console[T(513)](T(512),B),v()},h[D(544)]=function(B){P()},h[D(529)]=function(B){const T=D;console[T(513)](T(534),B),v()}})}catch(P){console.warn(d(511),P)}}))}c()},s.onerror=function(u){f(u)}})}catch(s){console[t(513)](s,t(526))}return o};function Q(){const a=["transaction","DBName","createObjectStore","close","hasOwnProperty","primaryKey","208156ZfrAJr","warn","delete","1575928bFmnZg","154LBDnQZ","objectStore","数据更新失败","alert","store不存在,请更新schema和DBVersion并重启前端服务","length","openCursor","add","15752fkogxb","createIndex","deleteDB","299045NkkBTh","请传入主键","mapDB","map","102uEoUGM","目前所有数据都在用户ID的主键下面,所以没有主键的话做重新载入页面处理","主键插入中止","error","数据库删除失败","call","continue","update","deleteStore","open","result","66891DVCnfv","get","getDataByKey","数据删除失败","onabort","打开数据库报错,可能是数据库版本不对,或者储存容量不足等原因","52JGzdMb","all","onerror","put","数据更新失败没有request","Database connection closed, reconnecting...","target","主键插入失败","onsuccess","keyPath","数据更新成功","主键查询结果:","传入结构化克隆算法不支持的数据类型可能导致报错","4779333CtWPbr","currentTarget","获取Database缺乏用户信息,请先传入对primaryKey的赋值","indexedDB","oncomplete","事务失败","634540WpNScH","readwrite","keys","getDB","4781SEkDBZ","onupgradeneeded"];return Q=function(){return a},Q()}function q(a,e){const t=Q();return q=function(r,n){return r=r-496,t[r]},q(a,e)}let J=!1;w[N(549)]=async(a,e)=>{const t=N,{mapDB:r,primaryKey:n}=a;return r?n?(J&&await new Promise(async(o,i)=>{const s=()=>{J?setTimeout(()=>{s()},200):o()};s()}),!C&&(J=!0,C=await ce(r,n),C==null||C.addEventListener(t(555),async()=>{console.info(t(532)),C=await ce(r,n)}),J=!1),e&&e(C),C):(console[t(559)](t(542)),!1):(console[t(559)]("必须传入数据库配置信息"),!1)},w[N(523)]=async(a,e)=>{const t=N,{mapDB:r,tableName:n,primaryKey:o}=a,i={};i[t(508)]=r,i[t(557)]=o;const s=await w.getDB(i);if(!s)return;const c=s.transaction([n]),f=c[t(496)](n),p=f[t(522)](o);return new Promise((u,l)=>{const y=t;p.onsuccess=function(b){const d=q;e&&e(n+d(538)+p[d(520)]),u(p[d(520)])},p[y(529)]=function(b){console.error(n+y(545)+b),l()}})},w.updateStore=async(a,e)=>{var t;const r=N,{mapDB:n,tableName:o,updateData:i}=a;!i[n==null?void 0:n[r(557)]]&&console[r(559)](r(507)+n[r(557)]);const s={};s.mapDB=n,s[r(557)]=i[n==null?void 0:n[r(557)]];const c=await w[r(549)](s);if(!c)return;let f=null;try{f=c[r(552)]([o],r(547)).objectStore(o)}catch(y){console[r(513)](r(499),y)}let p=null,u=null;const l=await new Promise((y,b)=>{const d=r,m=f[d(501)](i[n==null?void 0:n[d(557)]]);m[d(535)]=h=>{y(h)},m.onerror=h=>{b(h)}});u=(t=l==null?void 0:l[r(533)])==null?void 0:t[r(520)];try{u&&(u==null?void 0:u.primaryKey)===i[n==null?void 0:n.primaryKey]?p=u[r(517)](i):p=f[r(530)](i)}catch(y){console[r(513)](r(539),y,i)}new Promise((y,b)=>{const d=r;!p&&(console[d(513)](o+d(531)),b()),p[d(535)]=function(m){e&&e(o+d(537)),y()},p[d(529)]=function(m){const h=d;console[h(513)](o+h(497),m),b()}}),u&&u[r(516)]()},w[N(518)]=async(a,e)=>{const t=N,{mapDB:r,tableName:n,primaryKey:o}=a,i={};i[t(508)]=r,i[t(557)]=o;const s=await w.getDB(i);if(!s)return;const c=s[t(552)]([n],t(547))[t(496)](n)[t(560)](o);return new Promise((f,p)=>{const u=t;c[u(535)]=function(l){e&&e(n+"数据删除成功"),f()},c.onerror=function(l){const y=u;console[y(513)](n+y(524)+l),p()}})},w[N(505)]=async(a,e)=>{const{mapDB:t}=a,r=window.indexedDB.deleteDatabase(t.DBName);return new Promise((n,o)=>{const i=q;r[i(535)]=s=>{e&&e(t[i(553)]+"数据库已删除"),n()},r[i(529)]=s=>{const c=i;console[c(513)](t[c(553)]+c(514)+s),o()}})};function K(a,e){const t=W();return K=function(r,n){return r=r-125,t[r]},K(a,e)}function W(){const a=["updateData","error","getDataByKey","531aQoQZo","primaryKey","handleData","2kSsgxs","777jFjQPc","1271805RJVSFy","546pnZEJw","3522904vvFeGW","4wGSwDA","tableName","780ChApSf","deleteStore","655364nEjUrb","3705144rIEFqv","updateStore","getData","clearData","mapDB","3003845nIJAzp"];return W=function(){return a},W()}const Z=K;(function(a,e){const t=K,r=a();for(;;)try{if(-parseInt(t(140))/1*(-parseInt(t(127))/2)+parseInt(t(142))/3*(parseInt(t(145))/4)+-parseInt(t(133))/5+-parseInt(t(143))/6*(parseInt(t(141))/7)+-parseInt(t(128))/8+parseInt(t(137))/9*(parseInt(t(125))/10)+parseInt(t(144))/11===e)break;r.push(r.shift())}catch{r.push(r.shift())}})(W,330152);async function ke(a,e){const t=K,{tableName:r,propertiesKey:n,parameter:o,primaryKey:i,mapDB:s}=a;let c=null,f={[s[t(138)]]:i};const p={};p[t(132)]=s,p.tableName=r,p[t(138)]=i;const u=await w[t(136)](p);u&&(f={...u,[s.primaryKey]:i}),f[n]=o;const l={};return l[t(132)]=s,l.tableName=r,l[t(134)]=f,await w[t(129)](l),o&&(c=o),e&&e(c),c}async function xe(a,e){const t=K,{tableName:r,propertiesKey:n,primaryKey:o,mapDB:i}=a;let s=null;const c={};c[t(132)]=i,c[t(146)]=r,c.primaryKey=o;const f=await w[t(136)](c);return f&&(s=f[n]),e&&e(s),s}async function Ie(a,e){const t=K,{tableName:r,propertiesKey:n,parameter:o,primaryKey:i,mapDB:s}=a;let c={};const f={};f.mapDB=s,f[t(146)]=r,f[t(138)]=i;const p=await w[t(136)](f);try{if(p){c={...p[n],...o};const u={[s[t(138)]]:i},l=u;l[n]=c;const y={};y[t(132)]=s,y[t(146)]=r,y[t(134)]=l,await w.updateStore(y)}else console.warn(r+"为空,请先调用handleData")}catch(u){console[t(135)](u)}return e&&e(c),c}async function Pe(a,e){const t=K,{tableName:r,primaryKey:n,mapDB:o}=a;let i=null;try{const s={};s.mapDB=o,s[t(146)]=r,s[t(138)]=n,await w[t(126)](s)}catch(s){console.error(s)}return e&&e(i),i}const A={};A[Z(139)]=ke,A[Z(130)]=xe,A[Z(134)]=Ie,A[Z(131)]=Pe;var k=U;(function(a,e){for(var t=U,r=a();;)try{var n=-parseInt(t(385))/1+parseInt(t(387))/2+-parseInt(t(389))/3+-parseInt(t(398))/4*(parseInt(t(394))/5)+-parseInt(t(402))/6+-parseInt(t(399))/7+-parseInt(t(386))/8*(-parseInt(t(400))/9);if(n===e)break;r.push(r.shift())}catch{r.push(r.shift())}})(M,363872);var le={};le[k(397)]=!1;var ne={};ne[k(384)]=le,ne[k(392)]={};var ue={};function M(){var a=["default","mapDB-indexeddb-form-schema","663915ecCGKl","primaryKey","stores","unique","12QKZOdu","2103521TxMjSC","1212714qgZAmF","formParams","3534618LLAImJ","DBName","properties","createIndex","464644FTRsMp","128qSoFyx","33606razpoB","DBVersion","168804drPGaG","queryParams","DBStoreName"];return M=function(){return a},M()}ue[k(390)]=ne;function U(a,e){var t=M();return U=function(r,n){r=r-382;var o=t[r];return o},U(a,e)}var se={};se[k(391)]=k(401),se[k(383)]=ue;var L={};L[k(395)]="userId",L[k(382)]=k(393),L[k(388)]=1,L[k(396)]=[se];const Te={formSchema:L},Ne=A,{handleData:Ke,getData:$e}=Ne,{formSchema:pe}=Te,Fe=async(a,e)=>{var t;return e.parametersType==="url"&&(a={...ae.queryToData((t=e.$route)==null?void 0:t.query),...a}),e.parametersType==="indexDB"&&(a={...await $e({tableName:"formParams",propertiesKey:e.$route.path||"defQueryParams",primaryKey:e.DBPrimaryKey||"default",mapDB:pe}),...a}),a},Ce=async(a,e)=>{e.parametersType==="url"&&await e.$router.push({query:ae.paramsToQuery({...a})}),e.parametersType==="indexDB"&&await Ke({tableName:"formParams",propertiesKey:e.$route.path||"defQueryParams",parameter:{...a},primaryKey:e.DBPrimaryKey||"default",mapDB:pe})},qe={makeParamsByType:Fe,saveParamsByType:Ce},fe=ae,V=qe,$=E;(function(a,e){const t=E,r=a();for(;;)try{if(parseInt(t(561))/1+-parseInt(t(558))/2+parseInt(t(521))/3*(parseInt(t(527))/4)+-parseInt(t(506))/5*(parseInt(t(510))/6)+-parseInt(t(550))/7*(parseInt(t(503))/8)+parseInt(t(540))/9+-parseInt(t(546))/10*(-parseInt(t(562))/11)===e)break;r.push(r.shift())}catch{r.push(r.shift())}})(H,819524);const S={};let O=null;const de=async(a,e)=>{const t=E;!window[t(543)]&&window[t(498)]("您的浏览器不支持IndexedDB的稳定版本。离线数据功能将不可用。Your browser doesn't support a stable version of IndexedDB. offline data feature will not be available.");const{DBName:r="",DBVersion:n=1}=a;let o,i=!1;try{const s=window[t(543)][t(519)](r,n);await new Promise((c,f)=>{const p=t;s[p(551)]=async function(u){const l=p,y=u.target.result,{stores:b=[]}=a;await Promise.all(b[l(509)](async d=>{const m=l,{DBStoreName:h="",properties:_={}}=d;try{const g={};g[m(536)]=a[m(557)];const P=u[m(541)][m(520)][m(554)](h,g);if(Object[m(548)](_)[m(500)]===0){console[m(559)](h+"没有设置默认值");return}for(const v in _)if(_[m(556)][m(515)](_,v)){const D=_[v],B={...D.createIndex};P[m(504)](v,v,B)}}catch(g){console[m(559)](g)}})),o=y,i=!0},s[p(535)]=async function(u){const l=p;if(o=this[l(520)],i){const{stores:y=[]}=a;await Promise[l(528)](y[l(509)](async b=>{const d=l,{DBStoreName:m=""}=b,h=o[d(552)]([m],d(547)),_=h[d(496)](m),g={};g[a[d(557)]]=e,_[d(502)](g);try{await new Promise((P,v)=>{const D=d;h[D(525)]=function(B){const T=D;console[T(513)](T(512),B),v()},h[D(544)]=function(B){P()},h[D(529)]=function(B){const T=D;console[T(513)](T(534),B),v()}})}catch(P){console.warn(d(511),P)}}))}c()},s.onerror=function(u){f(u)}})}catch(s){console[t(513)](s,t(526))}return o};function H(){const a=["transaction","DBName","createObjectStore","close","hasOwnProperty","primaryKey","208156ZfrAJr","warn","delete","1575928bFmnZg","154LBDnQZ","objectStore","数据更新失败","alert","store不存在,请更新schema和DBVersion并重启前端服务","length","openCursor","add","15752fkogxb","createIndex","deleteDB","299045NkkBTh","请传入主键","mapDB","map","102uEoUGM","目前所有数据都在用户ID的主键下面,所以没有主键的话做重新载入页面处理","主键插入中止","error","数据库删除失败","call","continue","update","deleteStore","open","result","66891DVCnfv","get","getDataByKey","数据删除失败","onabort","打开数据库报错,可能是数据库版本不对,或者储存容量不足等原因","52JGzdMb","all","onerror","put","数据更新失败没有request","Database connection closed, reconnecting...","target","主键插入失败","onsuccess","keyPath","数据更新成功","主键查询结果:","传入结构化克隆算法不支持的数据类型可能导致报错","4779333CtWPbr","currentTarget","获取Database缺乏用户信息,请先传入对primaryKey的赋值","indexedDB","oncomplete","事务失败","634540WpNScH","readwrite","keys","getDB","4781SEkDBZ","onupgradeneeded"];return H=function(){return a},H()}function E(a,e){const t=H();return E=function(r,n){return r=r-496,t[r]},E(a,e)}let X=!1;S[$(549)]=async(a,e)=>{const t=$,{mapDB:r,primaryKey:n}=a;return r?n?(X&&await new Promise(async(o,i)=>{const s=()=>{X?setTimeout(()=>{s()},200):o()};s()}),!O&&(X=!0,O=await de(r,n),O==null||O.addEventListener(t(555),async()=>{console.info(t(532)),O=await de(r,n)}),X=!1),e&&e(O),O):(console[t(559)](t(542)),!1):(console[t(559)]("必须传入数据库配置信息"),!1)},S[$(523)]=async(a,e)=>{const t=$,{mapDB:r,tableName:n,primaryKey:o}=a,i={};i[t(508)]=r,i[t(557)]=o;const s=await S.getDB(i);if(!s)return;const c=s.transaction([n]),f=c[t(496)](n),p=f[t(522)](o);return new Promise((u,l)=>{const y=t;p.onsuccess=function(b){const d=E;e&&e(n+d(538)+p[d(520)]),u(p[d(520)])},p[y(529)]=function(b){console.error(n+y(545)+b),l()}})},S.updateStore=async(a,e)=>{var t;const r=$,{mapDB:n,tableName:o,updateData:i}=a;!i[n==null?void 0:n[r(557)]]&&console[r(559)](r(507)+n[r(557)]);const s={};s.mapDB=n,s[r(557)]=i[n==null?void 0:n[r(557)]];const c=await S[r(549)](s);if(!c)return;let f=null;try{f=c[r(552)]([o],r(547)).objectStore(o)}catch(y){console[r(513)](r(499),y)}let p=null,u=null;const l=await new Promise((y,b)=>{const d=r,m=f[d(501)](i[n==null?void 0:n[d(557)]]);m[d(535)]=h=>{y(h)},m.onerror=h=>{b(h)}});u=(t=l==null?void 0:l[r(533)])==null?void 0:t[r(520)];try{u&&(u==null?void 0:u.primaryKey)===i[n==null?void 0:n.primaryKey]?p=u[r(517)](i):p=f[r(530)](i)}catch(y){console[r(513)](r(539),y,i)}new Promise((y,b)=>{const d=r;!p&&(console[d(513)](o+d(531)),b()),p[d(535)]=function(m){e&&e(o+d(537)),y()},p[d(529)]=function(m){const h=d;console[h(513)](o+h(497),m),b()}}),u&&u[r(516)]()},S[$(518)]=async(a,e)=>{const t=$,{mapDB:r,tableName:n,primaryKey:o}=a,i={};i[t(508)]=r,i[t(557)]=o;const s=await S.getDB(i);if(!s)return;const c=s[t(552)]([n],t(547))[t(496)](n)[t(560)](o);return new Promise((f,p)=>{const u=t;c[u(535)]=function(l){e&&e(n+"数据删除成功"),f()},c.onerror=function(l){const y=u;console[y(513)](n+y(524)+l),p()}})},S[$(505)]=async(a,e)=>{const{mapDB:t}=a,r=window.indexedDB.deleteDatabase(t.DBName);return new Promise((n,o)=>{const i=E;r[i(535)]=s=>{e&&e(t[i(553)]+"数据库已删除"),n()},r[i(529)]=s=>{const c=i;console[c(513)](t[c(553)]+c(514)+s),o()}})};function F(a,e){const t=Y();return F=function(r,n){return r=r-125,t[r]},F(a,e)}function Y(){const a=["updateData","error","getDataByKey","531aQoQZo","primaryKey","handleData","2kSsgxs","777jFjQPc","1271805RJVSFy","546pnZEJw","3522904vvFeGW","4wGSwDA","tableName","780ChApSf","deleteStore","655364nEjUrb","3705144rIEFqv","updateStore","getData","clearData","mapDB","3003845nIJAzp"];return Y=function(){return a},Y()}const ee=F;(function(a,e){const t=F,r=a();for(;;)try{if(-parseInt(t(140))/1*(-parseInt(t(127))/2)+parseInt(t(142))/3*(parseInt(t(145))/4)+-parseInt(t(133))/5+-parseInt(t(143))/6*(parseInt(t(141))/7)+-parseInt(t(128))/8+parseInt(t(137))/9*(parseInt(t(125))/10)+parseInt(t(144))/11===e)break;r.push(r.shift())}catch{r.push(r.shift())}})(Y,330152);async function Oe(a,e){const t=F,{tableName:r,propertiesKey:n,parameter:o,primaryKey:i,mapDB:s}=a;let c=null,f={[s[t(138)]]:i};const p={};p[t(132)]=s,p.tableName=r,p[t(138)]=i;const u=await S[t(136)](p);u&&(f={...u,[s.primaryKey]:i}),f[n]=o;const l={};return l[t(132)]=s,l.tableName=r,l[t(134)]=f,await S[t(129)](l),o&&(c=o),e&&e(c),c}async function Ee(a,e){const t=F,{tableName:r,propertiesKey:n,primaryKey:o,mapDB:i}=a;let s=null;const c={};c[t(132)]=i,c[t(146)]=r,c.primaryKey=o;const f=await S[t(136)](c);return f&&(s=f[n]),e&&e(s),s}async function ze(a,e){const t=F,{tableName:r,propertiesKey:n,parameter:o,primaryKey:i,mapDB:s}=a;let c={};const f={};f.mapDB=s,f[t(146)]=r,f[t(138)]=i;const p=await S[t(136)](f);try{if(p){c={...p[n],...o};const u={[s[t(138)]]:i},l=u;l[n]=c;const y={};y[t(132)]=s,y[t(146)]=r,y[t(134)]=l,await S.updateStore(y)}else console.warn(r+"为空,请先调用handleData")}catch(u){console[t(135)](u)}return e&&e(c),c}async function je(a,e){const t=F,{tableName:r,primaryKey:n,mapDB:o}=a;let i=null;try{const s={};s.mapDB=o,s[t(146)]=r,s[t(138)]=n,await S[t(126)](s)}catch(s){console.error(s)}return e&&e(i),i}const R={};R[ee(139)]=Oe,R[ee(130)]=Ee,R[ee(134)]=ze,R[ee(131)]=je;var x=re;(function(a,e){for(var t=re,r=a();;)try{var n=-parseInt(t(385))/1+parseInt(t(387))/2+-parseInt(t(389))/3+-parseInt(t(398))/4*(parseInt(t(394))/5)+-parseInt(t(402))/6+-parseInt(t(399))/7+-parseInt(t(386))/8*(-parseInt(t(400))/9);if(n===e)break;r.push(r.shift())}catch{r.push(r.shift())}})(te,363872);var ye={};ye[x(397)]=!1;var oe={};oe[x(384)]=ye,oe[x(392)]={};var me={};function te(){var a=["default","mapDB-indexeddb-form-schema","663915ecCGKl","primaryKey","stores","unique","12QKZOdu","2103521TxMjSC","1212714qgZAmF","formParams","3534618LLAImJ","DBName","properties","createIndex","464644FTRsMp","128qSoFyx","33606razpoB","DBVersion","168804drPGaG","queryParams","DBStoreName"];return te=function(){return a},te()}me[x(390)]=oe;function re(a,e){var t=te();return re=function(r,n){r=r-382;var o=t[r];return o},re(a,e)}var ie={};ie[x(391)]=x(401),ie[x(383)]=me;var G={};G[x(395)]="userId",G[x(382)]=x(393),G[x(388)]=1,G[x(396)]=[ie];const he={formSchema:G},be=R,Dt="",{getData:Ae}=be,{formSchema:Le}=he,Ve={name:"GeneralBasicForm",components:{InputArchive:a=>{const{templateEle:e}=a;return e()},VerificationButton:we},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:()=>[]},size:{type:String,default:""},labelWidth:{type:String,default:"90px"},parametersType:{type:String,default:"url"},DBPrimaryKey:{type:[String,Number],required:!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1},currentPageKey:{type:String,default:"page"},pageSizeKey:{type:String,default:"limit"},defCurrentPage:{type:Number,default:1},defPageSize:{type:Number,default:10},queryWhenReady:{type:Boolean,default:()=>!1}},data(){return{queryParams:this.initQueryParams(),formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},attrs:{inline:!0,"label-position":"left"}}},watch:{formData:{handler(a,e){JSON.stringify(a)!==JSON.stringify(this.queryParams)&&(this.queryParams={...this.queryParams,...a})},immediate:!0,deep:!0},queryParams:{handler(a){this.$emit("update:formData",{...a})},deep:!0},$attrs:{handler(a){this.attrs={...this.attrs,...a}},immediate:!0,deep:!0},loading(a){this.formLoading!==a&&(this.formLoading=a)},formLoading(a){this.loading!==a&&this.$emit("update:loading",a)}},methods:{async handleQuery(a={}){a.defaultPageFirst??(a.defaultPageFirst=!0);const e={[this.currentPageKey]:this.defCurrentPage};let t={...e,...this.queryParams};t=await V.makeParamsByType(t,this),a.defaultPageFirst&&(t={...t,...e}),await V.saveParamsByType(t,this),this.getList({...t})},async resetQuery(){this.$refs.queryFormRef.resetFields();const a={[this.currentPageKey]:this.defCurrentPage};await V.saveParamsByType(a,this),this.queryParams={...a},this.afterReset(),this.handleQuery()},initQueryParams(){var e;let a={[this.pageSizeKey]:this.defPageSize};return this.parametersType==="url"&&(a={...a,...fe.queryToData((e=this.$route)==null?void 0:e.query)}),this.parametersType==="indexDB"&&Ae({tableName:"formParams",propertiesKey:this.$route.path||"defQueryParams",primaryKey:this.DBPrimaryKey||"default",mapDB:Le},t=>{this.queryParams={...a,...t}}),this.queryWhenReady&&this.$nextTick(()=>{this.handleQuery({defaultPageFirst:!1})}),a},currentInputComponent(){return"input-archive"},getItemRules(a){const{type:e,rules:t=[]}=a,r=[...t];return this.noInputBlank&&e==="input"&&r.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),r},getInputSetting(a){const{inputSetting:e,setting:t}=a;return{...this.inputSetting,...e,...t}},defaultFunction(){},getInputEvents(a){return{blur:a.blur||this.defaultFunction,focus:a.focus||this.defaultFunction,change:a.change||this.defaultFunction,input:a.input||this.defaultFunction,clear:a.clear||this.defaultFunction}},getSelectSetting(a){const{selectSetting:e,setting:t}=a;return{...this.selectSetting,...e,...t}},getSelectEvents(a){return{change:a.change||this.defaultFunction,"visible-change":a["visible-change"]||this.defaultFunction,"remove-tag":a["remove-tag"]||this.defaultFunction,"expand-change":a["expand-change"]||this.defaultFunction,clear:a.clear||this.defaultFunction,blur:a.blur||this.defaultFunction,focus:a.focus||this.defaultFunction}},getDatePackerSetting(a){const{datePackerSetting:e,setting:t}=a;return{...this.datePackerSetting,...e,...t}},getDatePackerEvents(a){return{change:a.change||this.defaultFunction,blur:a.blur||this.defaultFunction,focus:a.focus||this.defaultFunction}},getCheckboxGroupSetting(a){const{checkboxGroupSetting:e,setting:t}=a;return{...e,...t}},getCheckboxGroupEvents(a){return{change:a.change||this.defaultFunction}}}};var Re=function(){var e=this,t=e._self._c;return t("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,"label-width":e.labelWidth}},"el-form",e.attrs,!1),[e._l(e.formItem,function(r){return t("el-form-item",e._b({key:r.prop,attrs:{rules:e.getItemRules(r)}},"el-form-item",r,!1),[r.type==="input"?t("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(n,o){return{key:o,fn:function(){return[n?t(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="input-mobile-verification"?t("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(n,o){return{key:o,fn:function(){return[n?t(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r)),[t("template",{slot:"append"},[t("verification-button",{attrs:{verificationSetting:r.verificationSetting,getSmscode:r.getSmscode}})],1)],2):r.type==="select"?t("el-select",e._g(e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(r),!1),e.getSelectEvents(r)),e._l(r.option||[],function(n){return t("el-option",{key:n.key||n.value,attrs:{label:n.label,value:n.value}})}),1):r.type==="cascader"?t("el-cascader",e._g(e._b({attrs:{filterable:"",size:e.size,options:r.options||[]},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(r),!1),e.getSelectEvents(r))):r.type==="date-picker"?t("el-date-picker",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(r),!1),e.getDatePackerEvents(r))):e._e(),r.type==="input-number"?t("el-input-number",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="checkbox"?t("el-checkbox-group",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-checkbox-group",e.getCheckboxGroupSetting(r),!1),e.getCheckboxGroupEvents(r)),e._l(r.option||[],function(n){return t("el-checkbox",e._b({key:n.key||n.value||n.label},"el-checkbox",n,!1))}),1):e._e(),/^form-item-slot$/i.test(r.type)?e._t(r.name):e._e()],2)}),e._t("default"),e.formOnly?e._e():t("el-form-item",[t("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),t("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},Ge=[],Qe=z(Ve,Re,Ge,!1,null,"e0143289",null,null);const Je=Qe.exports,wt="",We={components:{},props:{query:{type:Object,default:()=>({prefCode:sessionStorage.getItem("prefCode")})},routePath:{type:String,default:()=>"/search/searchDetail"},inputstyle:{type:Object,default:()=>({width:"1280px"})},openHref:{type:Boolean,default:()=>!1},size:{type:String,default:()=>"medium"}},data(){var a,e;return{keyWord:((e=(a=this.$route)==null?void 0:a.query)==null?void 0:e.keyWord)||"",attrs:{}}},watch:{$attrs:{handler(a){this.attrs={...this.attrs,...a}},immediate:!0,deep:!0}},methods:{search(){const a={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(a);window.open(e.href,"_blank")}else this.$router.push(a)}}};var Ze=function(){var e=this,t=e._self._c;return t("div",{staticClass:"search-box"},[t("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(r){e.keyWord=r},expression:"keyWord"}},"el-input",e.attrs,!1),[t("svg",{staticClass:"el-input__icon",attrs:{slot:"prefix",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},slot:"prefix"},[t("path",{attrs:{d:"M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z",fill:"#959A9F"}})])])],1)},Me=[],Ue=z(We,Ze,Me,!1,null,"ef706e31",null,null);const He=Ue.exports,Xe={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(a,e){const{props:t}=e,{column:r,formData:n}=t;return r.render(n)}}},data(){return{attrs:{border:!0,class:"v-descriptions"}}},props:{formItem:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}}},watch:{$attrs:{handler(a){this.attrs={...this.attrs,...a}},immediate:!0,deep:!0}}};var Ye=function(){var e=this,t=e._self._c;return t("el-descriptions",e._b({},"el-descriptions",e.attrs,!1),e._l(e.formItem,function(r,n){return t("el-descriptions-item",e._b({key:r.prop,attrs:{label:r.label}},"el-descriptions-item",r.descriptionsItemProps,!1),[r.render?t("DescriptionsColumn",{attrs:{column:r,formData:e.formData}}):t("span",[e._v(e._s(e.formData[r.prop]))])],1)}),1)},et=[],tt=z(Xe,Ye,et,!1,null,null,null,null);const rt=tt.exports,Bt="",at={props:{nodeKey:{type:String,default:"id"},filterable:{type:Boolean,default:!1},dataSource:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]}},watch:{sourceFilterText(a){this.$refs.sourceTree.filter(a)},selectedFilterText(a){this.$refs.selectTree.filter(a)},checkedKeys(a){this.$refs.sourceTree.setCheckedKeys(a),j.nextTick(()=>{this.getSelectedData(),this.$refs.selectTree.setCheckedKeys(a)})}},data(){return{defaultTreeAttributes:{"default-expand-all":!0,"show-checkbox":!0},selectedList:[],sourceFilterText:"",selectedFilterText:""}},methods:{sourceFilterNode(a,e){return a?e.label.indexOf(a)!==-1:!0},getSelectedData(){let a=!0,e;const t=this.$refs.sourceTree.getCheckedNodes(a,e);this.selectedList=t},removeSelectedData(){let a,e;const t=this.$refs.selectTree.getCheckedNodes(a,e),r={};t.forEach(n=>{r[n[this.nodeKey]]=n}),this.selectedList=this.selectedList.filter(n=>!r[n[this.nodeKey]])}}};var nt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tree-box"},[t("div",{staticClass:"left-box"},[e.filterable?t("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.sourceFilterText,callback:function(r){e.sourceFilterText=r},expression:"sourceFilterText"}}):e._e(),t("el-tree",e._b({ref:"sourceTree",attrs:{data:e.dataSource,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1),t("div",{staticClass:"mid-box"},[t("el-button",{attrs:{icon:"el-icon-arrow-right",circle:""},on:{click:e.getSelectedData}}),t("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeSelectedData}})],1),t("div",{staticClass:"right-box"},[e.filterable?t("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.selectedFilterText,callback:function(r){e.selectedFilterText=r},expression:"selectedFilterText"}}):e._e(),t("el-tree",e._b({ref:"selectTree",attrs:{data:e.selectedList,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1)])},st=[],ot=z(at,nt,st,!1,null,"49dbad2a",null,null);const it=ot.exports,kt="",{getData:ct}=be,{formSchema:lt}=he,ut={name:"VTabs",data(){return{activeName:this.activeNameInit()}},props:{tabPanes:{type:Array,default:()=>[]},parametersType:{type:String,default:"url"},DBPrimaryKey:{type:[String,Number],required:!1},activeNameKey:{type:String,default:"activeName"},defActiveName:{type:String},getList:{type:Function,default:()=>{}}},watch:{defActiveName:{handler(a,e){JSON.stringify(a)!==JSON.stringify(this.activeName)&&(this.activeName=a)},immediate:!0},activeName:{handler(a){this.$emit(`update:${this.activeNameKey}`,a)}}},methods:{async handleClick(a,e){const t=await V.makeParamsByType({[this.activeNameKey]:this.activeName},this);await V.saveParamsByType(t,this),this.getList({...t})},activeNameInit(){var t,r,n;let a="";(t=this.tabPanes[0])!=null&&t.name&&(a=(r=this.tabPanes[0])==null?void 0:r.name);const e=fe.queryToData(Number((n=this.$route)==null?void 0:n.query[this.activeNameKey]));return this.parametersType==="url"&&e&&(a=e),this.parametersType==="indexDB"&&ct({tableName:"formParams",propertiesKey:this.$route.path||"defQueryParams",primaryKey:this.DBPrimaryKey||"default",mapDB:lt},o=>{this.activeName=o==null?void 0:o[this.activeNameKey]}),this.defActiveName&&(a=this.defActiveName),`${a}`}}};var pt=function(){var e=this,t=e._self._c;return t("el-tabs",e._b({on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(r){e.activeName=r},expression:"activeName"}},"el-tabs",e.$attrs,!1),[e._l(e.tabPanes,function(r){return t("el-tab-pane",e._b({key:r.name},"el-tab-pane",r,!1),[e._v(" "+e._s(r.render&&r.render(r))+" ")])}),e._t("default")],2)},ft=[],dt=z(ut,pt,ft,!1,null,"ebedcae9",null,null);const yt=dt.exports,mt=Je,ht=He,bt=rt,_t=it,gt=yt;I.VDescriptions=bt,I.VGeneralBasicForm=mt,I.VSearchBox=ht,I.VTabs=gt,I.VTreeTransfer=_t,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "general-basic-form",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "",
5
- "main": "./src/index.ts",
5
+ "main": "./dist/index.umd.cjs",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "cross-env CURRENT_ENV=prod run-p type-check && run-p build-only",
@@ -52,9 +52,21 @@
52
52
  "peerDependencies": {
53
53
  "vue": "^2.7.0-0"
54
54
  },
55
- "typings": "./publish/index.d.ts",
55
+ "typings": "./dist/index.d.ts",
56
56
  "dependencies": {
57
57
  "general-basic-indexdb": "^1.0.3",
58
58
  "network-spanner": "^1.2.11"
59
- }
59
+ },
60
+ "module": "./dist/index.js",
61
+ "exports": {
62
+ ".": {
63
+ "import": "./dist/index.js",
64
+ "require": "./dist/index.umd.cjs",
65
+ "types": "./dist/index.d.ts"
66
+ },
67
+ "./style": "./dist/style.css"
68
+ },
69
+ "files": [
70
+ "/dist"
71
+ ]
60
72
  }
package/public/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /*
2
- * @Author: 陈德立*******419287484@qq.com
3
- * @Date: 2023-11-07 17:55:59
4
- * @LastEditTime: 2023-11-08 10:24:14
5
- * @LastEditors: 陈德立*******419287484@qq.com
6
- * @Github: https://github.com/Alan1034
7
- * @Description:
8
- * @FilePath: \GeneralBasicForm\public\index.d.ts
9
- *
10
- */
11
- /// <reference types="vite/client" />
12
- declare module "*.vue" {
13
- import { DefineComponent } from "vue"
14
- const component: DefineComponent<{}, {}, any>
15
- export default component
16
- }
17
- declare module "general-basic-form";
@@ -1,24 +0,0 @@
1
- import path from "path";
2
- import fs from 'fs'
3
- import chalk from 'chalk'
4
- import { fileURLToPath } from 'url'
5
- const __filenameNew = fileURLToPath(import.meta.url)
6
- const __dirnameNew = path.dirname(__filenameNew)
7
- export const updateMain = (mainDir:string) => {
8
- try {
9
- const packageTxt = fs.readFileSync(path.join(__dirnameNew, '../package.json'), 'utf8');
10
- const packageJson = JSON.parse(packageTxt);
11
-
12
- delete packageJson.files
13
- delete packageJson.module
14
- delete packageJson.exports
15
- packageJson.typings = "./publish/index.d.ts"
16
- packageJson.main = mainDir
17
- const versionData = JSON.stringify(packageJson, null, 2);
18
- fs.writeFileSync(path.join(__dirnameNew, '../package.json'), versionData, 'utf8');
19
- console.log(chalk.green.bold('修改入口配置成功!当前入口路径为为:' + mainDir));
20
- } catch (error) {
21
- console.log(chalk.red.bold('修改入口配置出错:', error.toString()));
22
- }
23
-
24
- }
package/script/link.ts DELETED
@@ -1,14 +0,0 @@
1
- /*
2
- * @Author: 陈德立*******419287484@qq.com
3
- * @Date: 2023-11-10 09:39:59
4
- * @LastEditTime: 2023-11-15 18:38:43
5
- * @LastEditors: 陈德立*******419287484@qq.com
6
- * @Github: https://github.com/Alan1034
7
- * @Description: link处理流程
8
- * @FilePath: \VueNpmFrame\script\link.ts
9
- *
10
- */
11
- import { updateMain } from "./initialization";
12
-
13
-
14
- updateMain("./src/index.ts")
@@ -1,14 +0,0 @@
1
- /*
2
- * @Author: 陈德立*******419287484@qq.com
3
- * @Date: 2023-11-10 09:39:59
4
- * @LastEditTime: 2024-03-01 11:27:02
5
- * @LastEditors: 陈德立*******419287484@qq.com
6
- * @Github: https://github.com/Alan1034
7
- * @Description: link处理流程
8
- * @FilePath: \VueNpmFrame\script\linkNode.ts
9
- *
10
- */
11
- import { updateMain } from "./initialization";
12
-
13
-
14
- updateMain("./dist/src/index.js")
@@ -1,48 +0,0 @@
1
- /*
2
- * @Author: 陈德立*******419287484@qq.com
3
- * @Date: 2023-11-10 09:39:59
4
- * @LastEditTime: 2023-11-25 23:52:27
5
- * @LastEditors: 陈德立*******419287484@qq.com
6
- * @Github: https://github.com/Alan1034
7
- * @Description: unlink处理流程
8
- * @FilePath: \vite-plugin-update-version\script\unlinkModule.ts
9
- *
10
- */
11
- import path from "path";
12
- import fs from 'fs'
13
- import chalk from 'chalk'
14
- import { fileURLToPath } from 'url'
15
- const __filenameNew = fileURLToPath(import.meta.url)
16
- const __dirnameNew = path.dirname(__filenameNew)
17
- const updateMain = () => {
18
- try {
19
- const packageTxt = fs.readFileSync(path.join(__dirnameNew, '../package.json'), 'utf8');
20
- const packageJson = JSON.parse(packageTxt);
21
- const umdDir = "./dist/index.umd.cjs"
22
- const esDir = "./dist/index.js"
23
- const types = "./dist/index.d.ts"
24
- packageJson.type = "module"
25
- packageJson.main = umdDir
26
- packageJson.module = esDir
27
- packageJson.exports = {
28
- ".": {
29
- "import": esDir,
30
- "require": umdDir,
31
- "types": types
32
- },
33
- "./style": "./dist/style.css"
34
- }
35
- packageJson.typings = types
36
- packageJson.files = [
37
- "/dist"
38
- ]
39
- const versionData = JSON.stringify(packageJson, null, 2);
40
- fs.writeFileSync(path.join(__dirnameNew, '../package.json'), versionData, 'utf8');
41
- console.log(chalk.green.bold('修改入口配置成功!当前入口路径为为:' + umdDir));
42
- } catch (error) {
43
- console.log(chalk.red.bold('修改入口配置出错:', error.toString()));
44
- }
45
-
46
- }
47
-
48
- updateMain()
@@ -1,38 +0,0 @@
1
- /*
2
- * @Author: 陈德立*******419287484@qq.com
3
- * @Date: 2023-11-10 09:39:59
4
- * @LastEditTime: 2024-03-01 11:33:05
5
- * @LastEditors: 陈德立*******419287484@qq.com
6
- * @Github: https://github.com/Alan1034
7
- * @Description: unlink处理流程
8
- * @FilePath: \VueNpmFrame\script\unlinkNode.ts
9
- *
10
- */
11
- import path from "path";
12
- import fs from 'fs'
13
- import chalk from 'chalk'
14
- import { fileURLToPath } from 'url'
15
- const __filenameNew = fileURLToPath(import.meta.url)
16
- const __dirnameNew = path.dirname(__filenameNew)
17
- const updateMain = () => {
18
- try {
19
- const packageTxt = fs.readFileSync(path.join(__dirnameNew, '../package.json'), 'utf8');
20
- const packageJson = JSON.parse(packageTxt);
21
- const cjsDir = "./dist/src/index.js"
22
- const types = "./dist/src/index.d.ts"
23
- delete packageJson.type
24
- packageJson.main = cjsDir
25
- packageJson.typings = types
26
- packageJson.files = [
27
- "/dist"
28
- ]
29
- const versionData = JSON.stringify(packageJson, null, 2);
30
- fs.writeFileSync(path.join(__dirnameNew, '../package.json'), versionData, 'utf8');
31
- console.log(chalk.green.bold('修改入口配置成功!当前入口路径为为:' + cjsDir));
32
- } catch (error) {
33
- console.log(chalk.red.bold('修改入口配置出错:', error.toString()));
34
- }
35
-
36
- }
37
-
38
- updateMain()
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "include": [
3
- "public/index.d.tsex.d.ts",
4
- "src/**/*",
5
- "src/**/*.vue",
6
- "public/*",
7
- ],
8
- "exclude": [],
9
- "compilerOptions": {
10
- "declaration": true,
11
- "allowJs": true,
12
- "composite": true
13
- }
14
- }
package/vite.config.js DELETED
@@ -1,121 +0,0 @@
1
- import legacy from '@vitejs/plugin-legacy'
2
- import { fileURLToPath } from 'url'
3
- import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'
4
- import vue from '@vitejs/plugin-vue2'
5
- import vueJsx from '@vitejs/plugin-vue2-jsx'
6
- import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
7
- import path from 'path';
8
- const __filenameNew = fileURLToPath(import.meta.url)
9
- const __dirnameNew = path.dirname(__filenameNew)
10
- const resolve = (dir) => path.resolve(__dirnameNew, dir);
11
- // https://vitejs.dev/config/
12
- export default defineConfig(({ command, mode }) => {
13
- // 根据当前工作目录中的 `mode` 加载 .env 文件
14
- // 设置第三个参数为 '' 来加载所有环境变量,而不管是否有 `VITE_` 前缀。
15
- const env = loadEnv(mode, process.cwd(), '')
16
- // console.log(command)
17
- // console.log(env)
18
- // console.log(env.CURRENT_ENV)
19
- // console.log(env.APP_ENV)
20
- // console.log(env.VUE_APP_BASE_API)
21
- return {
22
- // vite环境变量配置
23
- define: {
24
- "CURRENT_ENV": JSON.stringify(env.CURRENT_ENV),
25
- },
26
- server: {
27
- open: true,
28
- },
29
- resolve: {
30
- alias: {
31
- '@': resolve('src'),//路径化名
32
- },
33
-
34
- extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
35
- },
36
-
37
- plugins: [
38
- /**
39
- * @description: vite自带的文件分割配置
40
- * @return {*}
41
- */
42
- {
43
- ...splitVendorChunkPlugin(),
44
- apply: 'build',
45
- },
46
- /**
47
- * @description: 图片压缩插件
48
- * @return {*}
49
- */
50
- {
51
- ...ViteImageOptimizer({
52
- /* pass your config */
53
- }),
54
- // enforce: 'pre',
55
- apply: 'build',
56
- },
57
- /**
58
- * @description: 兼容旧版本浏览器
59
- * @return {*}
60
- */
61
- {
62
- ...legacy({
63
- targets: ['defaults'],
64
- }),
65
- apply: 'build',
66
- },
67
- vue(),
68
- vueJsx(),
69
- ],
70
- css: {
71
- preprocessorOptions: {
72
- less: {
73
- // 支持内联 JavaScript
74
- javascriptEnabled: true,
75
- },
76
- },
77
- },
78
- /**
79
- * @description: 打包时才调用
80
- * @return {*}
81
- */
82
- build: {
83
- lib: {
84
- // Could also be a dictionary or array of multiple entry points
85
- // 添加打包入口文件夹
86
- entry: resolve(`${__dirnameNew}/src`, 'index.ts'),
87
- // formats: ['es', 'cjs', 'umd', 'iife'],
88
- name: 'Index',
89
- // the proper extensions will be added
90
- // fileName: (format) => `index.${format}.js`,
91
- fileName: "index",
92
- },
93
- rollupOptions: {
94
- // 确保外部化处理那些你不想打包进库的依赖
95
- external: ['vue'],
96
- output: {
97
- // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
98
- globals: {
99
- vue: 'Vue',
100
- },
101
- },
102
- },
103
- // minify: 'terser',
104
- //打包环境移除console.log,debugger
105
- // terserOptions: {
106
- // compress: {
107
- // drop_console: true,
108
- // drop_debugger: true,
109
- // },
110
- // },
111
- //打包文件按照类型分文件夹显示(貌似会导致性能下降)
112
- // rollupOptions: {
113
- // output: {
114
- // chunkFileNames: 'js/[name]-chunk-[hash:7].js',
115
- // entryFileNames: 'js/[name]-app-[hash:7].js',
116
- // assetFileNames: '[ext]/[name]-chunk-[hash:7].[ext]',
117
- // },
118
- // },
119
- },
120
- }
121
- })