(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-system-safety-list"],{"0215":function(e,t,n){"use strict";n.r(t);var i=n("b9b2"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},"0cad":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}));var i={uniStatBreadcrumb:n("2531").default,unicloudDb:n("3220").default,uniTable:n("aa68").default,uniTr:n("615c").default,uniTh:n("9fdf").default,uniTd:n("398e").default,uniDateformat:n("e37cb").default,uniPagination:n("31f1").default},a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",[n("v-uni-view",{staticClass:"uni-header"},[n("uni-stat-breadcrumb",{staticClass:"uni-stat-breadcrumb-on-phone"}),n("v-uni-view",{staticClass:"uni-group"},[n("v-uni-input",{staticClass:"uni-search",attrs:{type:"text",placeholder:e.$t("common.placeholder.query")},on:{confirm:function(t){arguments[0]=t=e.$handleEvent(t),e.search.apply(void 0,arguments)}},model:{value:e.query,callback:function(t){e.query=t},expression:"query"}}),n("v-uni-button",{staticClass:"uni-button hide-on-phone",attrs:{type:"default",size:"mini"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.search.apply(void 0,arguments)}}},[e._v(e._s(e.$t("common.button.search")))])],1)],1),n("v-uni-view",{staticClass:"uni-container"},[n("unicloud-db",{ref:"udb",attrs:{collection:e.collectionList,options:e.options,where:e.where,"page-data":"replace",orderby:e.orderby,getcount:!0,"page-size":e.options.pageSize,"page-current":e.options.pageCurrent},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.data,a=t.pagination,o=t.loading,r=t.error;return[n("uni-table",{attrs:{loading:o,emptyText:r.message||"没有更多数据",border:!0,stripe:!0}},[n("uni-tr",[n("uni-th",{attrs:{align:"center"}},[e._v("序号")]),n("uni-th",{attrs:{align:"center"}},[e._v("用户名")]),n("uni-th",{attrs:{align:"center"}},[e._v("昵称")]),n("uni-th",{attrs:{align:"center"}},[e._v("内容")]),n("uni-th",{attrs:{align:"center"}},[e._v("IP")]),n("uni-th",{attrs:{align:"center"}},[e._v("时间")])],1),e._l(i,(function(t,i){return n("uni-tr",{key:i},[n("uni-td",{attrs:{align:"center"}},[e._v(e._s((a.current-1)*a.size+(i+1)))]),n("uni-td",{attrs:{align:"center"}},[e._v(e._s(t.user_id[0]&&t.user_id[0].username||"-"))]),n("uni-td",{attrs:{align:"center"}},[e._v(e._s(t.user_id[0]&&t.user_id[0].nickname||"-"))]),n("uni-td",{attrs:{align:"center"}},[e._v(e._s(t.type))]),n("uni-td",{attrs:{align:"center"}},[e._v(e._s(t.ip))]),n("uni-td",{attrs:{align:"center"}},[n("uni-dateformat",{attrs:{date:t.create_date,threshold:[0,0]}})],1)],1)}))],2),n("v-uni-view",{staticClass:"uni-pagination-box"},[n("uni-pagination",{attrs:{"show-icon":!0,"page-size":a.size,total:a.count},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.onPageChanged.apply(void 0,arguments)}},model:{value:a.current,callback:function(t){e.$set(a,"current",t)},expression:"pagination.current"}})],1)]}}])})],1)],1)},o=[]},"31f1":function(e,t,n){"use strict";n.r(t);var i=n("4601"),a=n("f6da");for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n("4752");var r=n("828b"),u=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"6e4c382b",null,!1,i["a"],void 0);t["default"]=u.exports},3220:function(e,t,n){"use strict";n.r(t);var i=n("c14b"),a=n("49df");for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var r=n("828b"),u=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);t["default"]=u.exports},"3e44":function(e){e.exports=JSON.parse('{"uni-pagination.prevText":"précédente","uni-pagination.nextText":"suivante","uni-pagination.piecePerPage":"Articles/Pages"}')},"426c":function(e){e.exports=JSON.parse('{"uni-pagination.prevText":"prev","uni-pagination.nextText":"next","uni-pagination.piecePerPage":"piece/page"}')},4601:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}));var i={uniIcons:n("e3a5").default},a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{staticClass:"uni-pagination"},[!0===e.showPageSize||"true"===e.showPageSize?n("v-uni-picker",{staticClass:"select-picker",attrs:{mode:"selector",value:e.pageSizeIndex,range:e.pageSizeRange},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerChange.apply(void 0,arguments)},cancel:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerClick.apply(void 0,arguments)}},nativeOn:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.pickerClick.apply(void 0,arguments)}}},[n("v-uni-button",{attrs:{type:"default",size:"mini",plain:!0}},[n("v-uni-text",[e._v(e._s(e.pageSizeRange[e.pageSizeIndex])+" "+e._s(e.piecePerPage))]),n("uni-icons",{staticClass:"select-picker-icon",attrs:{type:"arrowdown",size:"12",color:"#999"}})],1)],1):e._e(),n("v-uni-view",{staticClass:"uni-pagination__total is-phone-hide"},[e._v("共 "+e._s(e.total)+" 条")]),n("v-uni-view",{staticClass:"uni-pagination__btn",class:1===e.currentIndex?"uni-pagination--disabled":"uni-pagination--enabled",attrs:{"hover-class":1===e.currentIndex?"":"uni-pagination--hover","hover-start-time":20,"hover-stay-time":70},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.clickLeft.apply(void 0,arguments)}}},[!0===e.showIcon||"true"===e.showIcon?[n("uni-icons",{attrs:{color:"#666",size:"16",type:"left"}})]:[n("v-uni-text",{staticClass:"uni-pagination__child-btn"},[e._v(e._s(e.prevPageText))])]],2),n("v-uni-view",{staticClass:"uni-pagination__num uni-pagination__num-flex-none"},[n("v-uni-view",{staticClass:"uni-pagination__num-current"},[n("v-uni-text",{staticClass:"uni-pagination__num-current-text is-pc-hide current-index-text"},[e._v(e._s(e.currentIndex))]),n("v-uni-text",{staticClass:"uni-pagination__num-current-text is-pc-hide"},[e._v("/"+e._s(e.maxPage||0))]),e._l(e.paper,(function(t,i){return n("v-uni-view",{key:i,staticClass:"uni-pagination__num-tag tag--active is-phone-hide",class:{"page--active":t===e.currentIndex},on:{click:function(n){if(!n.type.indexOf("key")&&e._k(n.keyCode,"top",void 0,n.key,void 0))return null;arguments[0]=n=e.$handleEvent(n),e.selectPage(t,i)}}},[n("v-uni-text",[e._v(e._s(t))])],1)}))],2)],1),n("v-uni-view",{staticClass:"uni-pagination__btn",class:e.currentIndex>=e.maxPage?"uni-pagination--disabled":"uni-pagination--enabled",attrs:{"hover-class":e.currentIndex===e.maxPage?"":"uni-pagination--hover","hover-start-time":20,"hover-stay-time":70},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.clickRight.apply(void 0,arguments)}}},[!0===e.showIcon||"true"===e.showIcon?[n("uni-icons",{attrs:{color:"#666",size:"16",type:"right"}})]:[n("v-uni-text",{staticClass:"uni-pagination__child-btn"},[e._v(e._s(e.nextPageText))])]],2)],1)},o=[]},"469d":function(e,t,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("64aa"),n("aa9c"),n("bf0f"),n("e966");var a=n("d3b4"),o=i(n("950e")),r=(0,a.initVueI18n)(o.default),u=r.t,c={name:"UniPagination",emits:["update:modelValue","input","change","pageSizeChange"],props:{value:{type:[Number,String],default:1},modelValue:{type:[Number,String],default:1},prevText:{type:String},nextText:{type:String},piecePerPageText:{type:String},current:{type:[Number,String],default:1},total:{type:[Number,String],default:0},pageSize:{type:[Number,String],default:10},showIcon:{type:[Boolean,String],default:!1},showPageSize:{type:[Boolean,String],default:!1},pagerCount:{type:Number,default:7},pageSizeRange:{type:Array,default:function(){return[20,50,100,500]}}},data:function(){return{pageSizeIndex:0,currentIndex:1,paperData:[],pickerShow:!1}},computed:{piecePerPage:function(){return this.piecePerPageText||u("uni-pagination.piecePerPage")},prevPageText:function(){return this.prevText||u("uni-pagination.prevText")},nextPageText:function(){return this.nextText||u("uni-pagination.nextText")},maxPage:function(){var e=1,t=Number(this.total),n=Number(this.pageSize);return t&&n&&(e=Math.ceil(t/n)),e},paper:function(){for(var e=this.currentIndex,t=this.pagerCount,n=this.total,i=this.pageSize,a=[],o=[],r=Math.ceil(n/i),u=0;u=e?n1&&o.push(n):e+2<=c?n>e-(t+1)/2&&ne-(t+1)/2||r-tt?((t+1)/2>=e?o[o.length-1]="...":e+2<=c?(o[1]="...",o[o.length-1]="..."):o[1]="...",o.push(a[a.length-1])):(t+1)/2>=e||e+2<=c||(o.shift(),o.push(a[a.length-1])),o}},watch:{current:{immediate:!0,handler:function(e,t){this.currentIndex=e<1?1:e}},value:{immediate:!0,handler:function(e){1===Number(this.current)&&(this.currentIndex=e<1?1:e)}},pageSizeIndex:function(e){this.$emit("pageSizeChange",this.pageSizeRange[e])}},methods:{pickerChange:function(e){this.pageSizeIndex=e.detail.value,this.pickerClick()},pickerClick:function(){var e=document.querySelector("body");if(e){this.pickerShow=!this.pickerShow,this.pickerShow?e.classList.add("uni-pagination-picker-show"):setTimeout((function(){return e.classList.remove("uni-pagination-picker-show")}),300)}},selectPage:function(e,t){if(parseInt(e))this.currentIndex=e,this.change("current");else{var n=Math.ceil(this.total/this.pageSize);if(t<=1)return void(this.currentIndex-5>1?this.currentIndex-=5:this.currentIndex=1);if(t>=6)return void(this.currentIndex+5>n?this.currentIndex=n:this.currentIndex+=5)}},clickLeft:function(){1!==Number(this.currentIndex)&&(this.currentIndex-=1,this.change("prev"))},clickRight:function(){Number(this.currentIndex)>=this.maxPage||(this.currentIndex+=1,this.change("next"))},change:function(e){this.$emit("input",this.currentIndex),this.$emit("update:modelValue",this.currentIndex),this.$emit("change",{type:e,current:this.currentIndex})}}};t.default=c},4752:function(e,t,n){"use strict";var i=n("6a28"),a=n.n(i);a.a},"48b1":function(e,t,n){"use strict";n.r(t);var i=n("a8ce"),a=n("9469"),o=n("affd"),r=n("6aea"),u=n("e7f2");t["default"]={en:i,es:a,fr:o,"zh-Hans":r,"zh-Hant":u}},"49df":function(e,t,n){"use strict";n.r(t);var i=n("db82"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},5840:function(e){e.exports=JSON.parse('{"uni-pagination.prevText":"上一页","uni-pagination.nextText":"下一页","uni-pagination.piecePerPage":"条/页"}')},"6a28":function(e,t,n){var i=n("6eae");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=n("967d").default;a("ebaa8be2",i,!0,{sourceMap:!1,shadowMode:!1})},"6aea":function(e){e.exports=JSON.parse('{"uniCloud.component.add.success":"新增成功","uniCloud.component.update.success":"修改成功","uniCloud.component.update.showModal.title":"提示","uniCloud.component.update.showModal.content":"是否更新该数据","uniCloud.component.remove.showModal.title":"提示","uniCloud.component.remove.showModal.content":"是否删除该数据"}')},"6c92":function(e,t,n){"use strict";n("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("64aa"),n("e966");var i=n("deb7"),a={name:"uniDateformat",props:{date:{type:[Object,String,Number],default:function(){return"-"}},locale:{type:String,default:"zh"},threshold:{type:Array,default:function(){return[0,0]}},format:{type:String,default:"yyyy/MM/dd hh:mm:ss"},refreshRate:{type:[Number,String],default:0}},data:function(){return{refreshMark:0}},computed:{dateShow:function(){return this.refreshMark,(0,i.friendlyDate)(this.date,{locale:this.locale,threshold:this.threshold,format:this.format})}},watch:{refreshRate:{handler:function(){this.setAutoRefresh()},immediate:!0}},methods:{refresh:function(){this.refreshMark++},setAutoRefresh:function(){var e=this;clearInterval(this.refreshInterval),this.refreshRate&&(this.refreshInterval=setInterval((function(){e.refresh()}),parseInt(this.refreshRate)))}}};t.default=a},"6eae":function(e,t,n){var i=n("c86c");t=i(!1),t.push([e.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 水平间距 */\r\n/* 水平间距 */\r\n/* 行为相关颜色 */\r\n/* 兼容 uni-ui 相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.uni-pagination[data-v-6e4c382b]{display:flex;position:relative;overflow:hidden;flex-direction:row;justify-content:center;align-items:center}.uni-pagination__total[data-v-6e4c382b]{font-size:14px;color:#999;margin-right:15px}.uni-pagination__btn[data-v-6e4c382b]{display:flex;cursor:pointer;padding:0 8px;line-height:30px;font-size:12px;position:relative;background-color:#f0f0f0;flex-direction:row;justify-content:center;align-items:center;text-align:center;border-radius:5px}.uni-pagination__child-btn[data-v-6e4c382b]{display:flex;font-size:12px;position:relative;flex-direction:row;justify-content:center;align-items:center;text-align:center;color:#666}.uni-pagination__num[data-v-6e4c382b]{display:flex;flex:1;flex-direction:row;justify-content:center;align-items:center;height:30px;line-height:30px;font-size:12px;color:#666;margin:0 5px}.uni-pagination__num-tag[data-v-6e4c382b]{cursor:pointer;min-width:30px;margin:0 5px;height:30px;text-align:center;line-height:30px;color:#999;border-radius:4px}.uni-pagination__num-current[data-v-6e4c382b]{display:flex;flex-direction:row}.uni-pagination__num-current-text[data-v-6e4c382b]{font-size:15px}.current-index-text[data-v-6e4c382b]{color:#2979ff}.uni-pagination--enabled[data-v-6e4c382b]{color:#333;opacity:1}.uni-pagination--disabled[data-v-6e4c382b]{opacity:.5;cursor:default}.uni-pagination--hover[data-v-6e4c382b]{color:rgba(0,0,0,.6);background-color:#eee}.tag--active[data-v-6e4c382b]:hover{color:#2979ff}.page--active[data-v-6e4c382b]{color:#fff;background-color:#2979ff}.page--active[data-v-6e4c382b]:hover{color:#fff}.is-pc-hide[data-v-6e4c382b]{display:block}.is-phone-hide[data-v-6e4c382b]{display:none}@media screen and (min-width:450px){.is-pc-hide[data-v-6e4c382b]{display:none}.is-phone-hide[data-v-6e4c382b]{display:block}.uni-pagination__num-flex-none[data-v-6e4c382b]{flex:none}}',""]),e.exports=t},"7fe2":function(e){e.exports=JSON.parse('{"uni-pagination.prevText":"anterior","uni-pagination.nextText":"prxima","uni-pagination.piecePerPage":"Art��culo/P��gina"}')},"84a7":function(e,t,n){"use strict";n.r(t);var i=n("0cad"),a=n("0215");for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var r=n("828b"),u=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"033d2fc2",null,!1,i["a"],void 0);t["default"]=u.exports},"8ebd":function(e){e.exports=JSON.parse('{"uni-pagination.prevText":"上一頁","uni-pagination.nextText":"下一頁","uni-pagination.piecePerPage":"條/頁"}')},9469:function(e){e.exports=JSON.parse('{"uniCloud.component.add.success":"新增成功","uniCloud.component.update.success":"修改成功","uniCloud.component.update.showModal.title":"提示","uniCloud.component.update.showModal.content":"是否更新该数据","uniCloud.component.remove.showModal.title":"提示","uniCloud.component.remove.showModal.content":"是否删除该数据"}')},"950e":function(e,t,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n("426c")),o=i(n("7fe2")),r=i(n("3e44")),u=i(n("5840")),c=i(n("8ebd")),s={en:a.default,es:o.default,fr:r.default,"zh-Hans":u.default,"zh-Hant":c.default};t.default=s},a8ce:function(e){e.exports=JSON.parse('{"uniCloud.component.add.success":"Success","uniCloud.component.update.success":"Success","uniCloud.component.update.showModal.title":"Tips","uniCloud.component.update.showModal.content":"是否更新该数据","uniCloud.component.remove.showModal.title":"Tips","uniCloud.component.remove.showModal.content":"是否删除该数据"}')},ab22:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){}));var i=function(){var e=this.$createElement,t=this._self._c||e;return t("v-uni-text",[this._v(this._s(this.dateShow))])},a=[]},affd:function(e){e.exports=JSON.parse('{"uniCloud.component.add.success":"新增成功","uniCloud.component.update.success":"修改成功","uniCloud.component.update.showModal.title":"提示","uniCloud.component.update.showModal.content":"是否更新该数据","uniCloud.component.remove.showModal.title":"提示","uniCloud.component.remove.showModal.content":"是否删除该数据"}')},b9b2:function(e,t,n){"use strict";(function(e){n("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("0c26"),n("23f4"),n("7d2f"),n("5c47"),n("9c4e"),n("ab80"),n("fd3c");var i=e.database(),a=["user_id.username","user_id.nickname","type","ip"],o={data:function(){return{collectionList:[i.collection("uni-id-log").field("type, ip, create_date, user_id").getTemp(),i.collection("uni-id-users").field("_id, username,nickname").getTemp()],query:"",where:"",orderby:"create_date desc",options:{pageSize:20,pageCurrent:1}}},methods:{getWhere:function(){var e,t=this.query.trim();if(!t)return"";try{e=new RegExp(t,"i")}catch(n){return void uni.showToast({title:"请勿输入等不满足正则格式的符号",icon:"none"})}return a.map((function(t){return e+".test("+t+")"})).join(" || ")},search:function(){var e=this.getWhere(),t=e===this.where;this.where=e,t&&this.loadData()},loadData:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$refs.udb.loadData({clear:e})},onPageChanged:function(e){this.$refs.udb.loadData({current:e.current})},navigateTo:function(e){var t=this;uni.navigateTo({url:e,events:{refreshData:function(){t.loadData()}}})},selectedItems:function(){var e=this.$refs.udb.dataList;return this.selectedIndexs.map((function(t){return e[t]._id}))},delTable:function(){this.$refs.udb.remove(this.selectedItems())},selectionChange:function(e){this.selectedIndexs=e.detail.index},confirmDelete:function(e){this.$refs.udb.remove(e)}}};t.default=o}).call(this,n("861b")["default"])},c14b:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){}));var i=function(){var e=this.$createElement,t=this._self._c||e;return t("v-uni-view",[this._t("default",null,{options:this.options,data:this.dataList,pagination:this.paginationInternal,loading:this.loading,hasMore:this.hasMore,error:this.errorMessage})],2)},a=[]},db82:function(e,t,n){"use strict";(function(e){n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n("b7c7")),o=i(n("fcf3"));n("64aa"),n("5ef2"),n("bf0f"),n("aa9c"),n("dd2b"),n("5c47"),n("d4b5"),n("dc8a"),n("7a76"),n("c9b5"),n("f7a5");var r=n("d3b4"),u=i(n("48b1")),c=(0,r.initVueI18n)(u.default),s=c.t,d={load:"load",error:"error"},l={add:"add",replace:"replace"},p={auto:"auto",onready:"onready",manual:"manual"},h=["pageCurrent","pageSize","spaceInfo","collection","action","field","getcount","orderby","where","groupby","groupField","distinct"],f={name:"UniClouddb",props:{options:{type:[Object,Array],default:function(){return{}}},spaceInfo:{type:Object,default:function(){return{}}},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},getone:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String,Object],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},pageIndistinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:function(){return{loading:!1,hasMore:!1,dataList:this.getone?void 0:[],paginationInternal:{},errorMessage:""}},computed:{collectionArgs:function(){return Array.isArray(this.collection)?this.collection:[this.collection]},isLookup:function(){return Array.isArray(this.collection)&&this.collection.length>1||"string"===typeof this.collection&&this.collection.indexOf(",")>-1}},created:function(){var e=this;this._isEnded=!1,this.paginationInternal={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((function(){var t=[];return h.forEach((function(n){t.push(e[n])})),t}),(function(t,n){if(e.paginationInternal.size=e.pageSize,t[0]!==n[0]&&(e.paginationInternal.current=e.pageCurrent),e.loadtime!==p.manual){for(var i=!1,a=2;a1&&void 0!==arguments[1]?arguments[1]:{},i=n.action,a=n.showToast,o=void 0===a||a,r=n.toastTitle,u=n.success,c=n.fail,d=n.complete,l=n.needConfirm,p=void 0===l||l,h=n.needLoading,f=void 0===h||h,g=n.loadingTitle,v=void 0===g?"":g;f&&uni.showLoading({title:v});var m=e.database(this.spaceInfo);i&&(m=m.action(i)),m.collection(this.getMainCollection()).add(t).then((function(e){u&&u(e),o&&uni.showToast({title:r||s("uniCloud.component.add.success")})})).catch((function(e){c&&c(e),p&&uni.showModal({content:e.message,showCancel:!1})})).finally((function(){f&&uni.hideLoading(),d&&d()}))},remove:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.action,a=n.success,o=n.fail,r=n.complete,u=n.confirmTitle,c=n.confirmContent,d=n.needConfirm,l=void 0===d||d,p=n.needLoading,h=void 0===p||p,f=n.loadingTitle,g=void 0===f?"":f;e&&e.length&&(l?uni.showModal({title:u||s("uniCloud.component.remove.showModal.title"),content:c||s("uniCloud.component.remove.showModal.content"),showCancel:!0,success:function(n){n.confirm&&t._execRemove(e,i,a,o,r,l,h,g)}}):this._execRemove(e,i,a,o,r,l,h,g))},update:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i.action,o=(i.showToast,i.toastTitle,i.success),r=i.fail,u=i.complete,c=i.confirmTitle,d=i.confirmContent,l=i.needConfirm,p=void 0===l||l,h=i.needLoading,f=void 0===h||h,g=i.loadingTitle,v=void 0===g?"":g;p?uni.showModal({title:c||s("uniCloud.component.update.showModal.title"),content:d||s("uniCloud.component.update.showModal.content"),showCancel:!0,success:function(i){i.confirm&&n._doUpdate(e,t,a,o,r,u,p,f,v)}}):this._doUpdate(e,t,a,o,r,u,p,f,v)},_doUpdate:function(t,n,i,a,o,r,u,c,d){c&&uni.showLoading({title:d});var l=e.database(this.spaceInfo);i&&(l=l.action(i)),l.collection(this.getMainCollection()).doc(t).update(n).then((function(e){a&&a(e),showToast&&uni.showToast({title:toastTitle||s("uniCloud.component.update.success")})})).catch((function(e){o&&o(e),u&&uni.showModal({content:e.message,showCancel:!1})})).finally((function(){c&&uni.hideLoading(),r&&r()}))},getMainCollection:function(){if("string"===typeof this.collection)return this.collection.split(",")[0];var e=JSON.parse(JSON.stringify(this.collection[0]));return e.$db[0].$param[0]},getTemp:function(){var t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=e.database(this.spaceInfo);this.action&&(i=i.action(this.action)),i=(t=i).collection.apply(t,(0,a.default)(this.collectionArgs)),this.foreignKey&&(i=i.foreignKey(this.foreignKey)),this.where&&Object.keys(this.where).length&&(i=i.where(this.where)),this.field&&(i=i.field(this.field)),this.groupby&&(i=i.groupBy(this.groupby)),this.groupField&&(i=i.groupField(this.groupField)),!0===this.distinct&&(i=i.distinct()),this.orderby&&(i=i.orderBy(this.orderby));var o=this.paginationInternal,r=o.current,u=o.size,c={};this.getcount&&(c.getCount=this.getcount);var s={limitLevel:this.limitlevel,startWith:this.startwith};return this.gettree&&(c.getTree=s),this.gettreepath&&(c.getTreePath=s),i=i.skip(u*(r-1)).limit(u),n?(i=i.getTemp(c),i.udb=this):i=i.get(c),i},setResult:function(e){0===e.code?this._execLoadDataSuccess(e):this._execLoadDataFail(new Error(e.message))},_execLoadData:function(e,t){var n=this;this.loading||(this.loading=!0,this.errorMessage="",this._getExec().then((function(i){n.loading=!1,n._execLoadDataSuccess(i.result,e,t)})).catch((function(t){n.loading=!1,n._execLoadDataFail(t,e)})))},_execLoadDataSuccess:function(e,t,n){var i=e.data,o=e.count;this._isEnded=void 0!==o?this.paginationInternal.current*this.paginationInternal.size>=o:i.length=0;i--){var a=t.indexOf(n[i]._id);a>=0&&(n.splice(i,1),t.splice(a,1))}},_dispatchEvent:function(e,t){this._changeDataFunction?this._changeDataFunction(t,this._isEnded,this.paginationInternal):this.$emit(e,t,this._isEnded,this.paginationInternal)}}};t.default=f}).call(this,n("861b")["default"])},e37cb:function(e,t,n){"use strict";n.r(t);var i=n("ab22"),a=n("fcca");for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var r=n("828b"),u=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"690ab064",null,!1,i["a"],void 0);t["default"]=u.exports},e7f2:function(e){e.exports=JSON.parse('{"uniCloud.component.add.success":"新增成功","uniCloud.component.update.success":"修改成功","uniCloud.component.update.showModal.title":"提示","uniCloud.component.update.showModal.content":"是否更新该数据","uniCloud.component.remove.showModal.title":"提示","uniCloud.component.remove.showModal.content":"是否刪除數據"}')},f6da:function(e,t,n){"use strict";n.r(t);var i=n("469d"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},fcca:function(e,t,n){"use strict";n.r(t);var i=n("6c92"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a}}]);