fa-selectpages.js 6.4 KB

1234567891011
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/fa-selectpages/fa-selectpages"],{"1b9a":function(e,t,i){},"3b26":function(e,t,i){"use strict";i.d(t,"b",(function(){return u})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return n}));var n={uInput:function(){return Promise.all([i.e("common/vendor"),i.e("uview-ui/components/u-input/u-input")]).then(i.bind(null,"b3e3"))},uTag:function(){return i.e("uview-ui/components/u-tag/u-tag").then(i.bind(null,"a8f0"))},uPopup:function(){return i.e("uview-ui/components/u-popup/u-popup").then(i.bind(null,"0cac"))},uSearch:function(){return i.e("uview-ui/components/u-search/u-search").then(i.bind(null,"2c7d"))},uCellItem:function(){return i.e("uview-ui/components/u-cell-item/u-cell-item").then(i.bind(null,"e84c"))},uRadioGroup:function(){return Promise.all([i.e("common/vendor"),i.e("uview-ui/components/u-radio-group/u-radio-group")]).then(i.bind(null,"516b"))},uRadio:function(){return i.e("uview-ui/components/u-radio/u-radio").then(i.bind(null,"ed39"))},uLoadmore:function(){return i.e("uview-ui/components/u-loadmore/u-loadmore").then(i.bind(null,"340d"))},uGap:function(){return i.e("uview-ui/components/u-gap/u-gap").then(i.bind(null,"71a3"))}},u=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.show=!0},e.e1=function(t){e.show=!0})},o=[]},"3e5f":function(e,t,i){"use strict";i.r(t);var n=i("3b26"),u=i("f722");for(var o in u)"default"!==o&&function(e){i.d(t,e,(function(){return u[e]}))}(o);i("9437");var a,s=i("f0c5"),r=Object(s["a"])(u["default"],n["b"],n["c"],!1,null,"7de86b28",null,!1,n["a"],a);t["default"]=r.exports},9331:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=u(i("eb3f"));function u(e){return e&&e.__esModule?e:{default:e}}function o(e){return l(e)||r(e)||s(e)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){if(e){if("string"===typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function l(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var h={name:"fa-selects",mixins:[n.default],props:{value:{type:[String,Number],default:""},faId:{type:[Number,String],default:""},showField:{type:String,default:""},keyField:{type:String,default:""},title:{type:String,default:""},checkeType:{type:String,default:"selectpage"},showValue:{type:[String,Number],default:""}},watch:{show:function(t,i){var n=this;t?(this.$nextTick((function(){setTimeout((function(){e.createSelectorQuery().in(n).select(".fa-scroll").boundingClientRect((function(e){e&&(n.scrollHg=e.height)})).exec()}),100)})),this.list.length||(this.page=1,this.getSelectPages())):this.sendChange()},showValue:{immediate:!0,handler:function(e){e&&!this.isFirst&&(this.isFirst=!0,this.getInitSelect())}},q_word:function(e,t){this.list=[],this.page=1,this.getSelectPages()}},data:function(){return{show:!1,list:[],radio_value:"",scrollHg:0,q_word:"",pageNum:0,page:1,totalPage:0,status:"loadmore",isFirst:!1,page_lable:"",pagesLable:[],ids_ing:[],ids:[]}},methods:{close:function(){this.show=!1},getInitSelect:function(){var e=this;if(this.showValue){var t={id:this.faId,pageNumber:this.page,q_word:this.q_word,keyValue:this.showValue};this.$api.selectpage(t).then((function(t){if("selectpage"==e.checkeType)e.page_lable=t.list[0][e.showField],e.radio_value=t.list[0][e.keyField]+"";else{e.pagesLable=t.list;var i=[];t.list.forEach((function(t){i.push(t[e.keyField])})),e.ids=i}}))}},getSelectPages:function(){var e=this;if(this.faId){var t={id:this.faId,pageNumber:this.page,q_word:this.q_word};this.$api.selectpage(t).then((function(t){e.status=0==t.total||e.page>=e.totalPage?"nomore":"loadmore";var i=[];"selectpages"==e.checkeType?t.list.forEach((function(t){t.checked=-1!=e.ids.indexOf(t[e.keyField]),i.push(t),e.pagesLable.forEach((function(i){t[e.keyField]==i[e.keyField]&&e.ids_ing.push(i)}))})):i=t.list,e.pageNum||(e.pageNum=i.length),e.totalPage=Math.ceil(t.total/e.pageNum),e.list=[].concat(o(e.list),o(i))}))}},selectCell:function(e){var t=this;"selectpages"==this.checkeType?this.$set(this.list[e],"checked",!this.list[e].checked):(this.radio_value=this.list[e][this.keyField],this.page_lable=this.list[e][this.showField],this.$emit("input",this.radio_value),this.close(),setTimeout((function(){t.dispatch("u-form-item","on-form-blur",t.radio_value)}),50))},goLower:function(e){this.page!=this.totalPage&&(this.status="loading",this.page++,this.getSelectPages())},confirm:function(){var e=this;if("selectpages"==this.checkeType){var t=this.pagesLable.filter((function(t){return!e.$u.test.empty(e.ids_ing)&&!e.ids_ing.find((function(i){return t[e.keyField]==i[e.keyField]}))})),i=[],n=[];this.list.forEach((function(t){t.checked&&(i.push(t[e.keyField]),n.push(t))})),t.forEach((function(t){i.push(t[e.keyField]),n.push(t)})),this.pagesLable=n,this.ids=i,this.$emit("input",i.join(",")),setTimeout((function(){e.dispatch("u-form-item","on-form-blur",i.join(","))}),50)}this.close()},allSelect:function(){this.list.map((function(e){e.checked=!0}))},clearAll:function(){this.list.map((function(e){e.checked=!1})),this.pagesLable=[]},sendChange:function(){var e=this;setTimeout((function(){"select"==e.checkeType?e.dispatch("u-form-item","on-form-change",e.radio_value):e.dispatch("u-form-item","on-form-change",e.checkbox_value)}),50)}}};t.default=h}).call(this,i("f266")["default"])},9437:function(e,t,i){"use strict";var n=i("1b9a"),u=i.n(n);u.a},f722:function(e,t,i){"use strict";i.r(t);var n=i("9331"),u=i.n(n);for(var o in n)"default"!==o&&function(e){i.d(t,e,(function(){return n[e]}))}(o);t["default"]=u.a}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/fa-selectpages/fa-selectpages-create-component',
  4. {
  5. 'components/fa-selectpages/fa-selectpages-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('f266')['createComponent'](__webpack_require__("3e5f"))
  7. })
  8. },
  9. [['components/fa-selectpages/fa-selectpages-create-component']]
  10. ]);