Commit d0825158 by zhangmeng

plugin init

parents
{
"presets": [
["env", { "modules": false }],
"stage-3"
]
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Tue Sep 04 2018 17:42:16 GMT+0800 (GMT+08:00)
\ No newline at end of file
#
<<<<<<< HEAD
> A Vue.js confirm-people select Plugin
## Install
```shell
npm install @gic-test/vue-gic-confirm-people -S
```
## how to use
```
// main.js
import vueGicConfirmPeople from '@gic-test/vue-gic-confirm-people'
Vue.use(vueGicConfirmPeople)
// 使用页面
<vue-gic-confirm-people @get-data="getData" :list="list"></vue-gic-confirm-people>
data() {
return {
// 可传参数
list:[], //对象数组
idType:'', //获取的属性,如果需要拿memberId 传'memberId',默认为'openid',
onlyWxMember:1, // 获取数据类型 仅为微信会员传1 不限制传0
}
}
methods: {
//获取指定会员 字符串数组
getData(val) {
console.log(val)
},
},
```
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vue-gic-confirm-people",[],t):"object"==typeof exports?exports["vue-gic-confirm-people"]=t():e["vue-gic-confirm-people"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=3)}([function(e,t,r){"use strict";function n(e,t){for(var r=[],n={},o=0;o<e.length;o++)n[e[o][t]]||(r.push(e[o]),n[e[o][t]]=1);return r}var o=r(11),i=r.n(o),a=[];t.a={name:"vue-gic-confirm-people",props:{idType:{type:String,default:"openId"},list:{type:Array,default:function(){return[]}},onlyWxMember:{type:Number,default:1}},data:function(){return{loading:!1,keyWord:"",keyWordRight:"",leftList:[],rightList:[],leftSelected:[],rightSelected:[],avatar:r(14)}},watch:{rightList:function(e){var t=this;this.$emit("get-data",e.map(function(e){return e[t.idType]}).join(","))},list:function(e){a=this.rightList=e.slice()}},methods:{handleSelectionChange:function(e){this.leftSelected=e},handleSelectionChangeRight:function(e){this.rightSelected=e},toRight:function(){var e=this;this.leftSelected.map(function(t){e.rightList.indexOf(t)<0&&e.rightList.push(t)}),console.log(this.rightList.map(function(e){return e.memberId})),a=this.rightList=n(this.rightList,"memberId")},loadList:function(){var e=this;this.loading=!0,this.leftSelected=[];var t={searchParams:this.keyWord,onlyWxMember:this.onlyWxMember,requestProject:"gic-web"};this.axios.post("/api-marketing/member-search-engine",i.a.stringify(t),{}).then(function(t){0===t.data.errorCode&&t.data.result&&(e.leftList=t.data.result),e.loading=!1})},removeAll:function(){var e=this.rightList.slice();this.rightSelected.map(function(t){var r=e.indexOf(t);r>-1&&e.splice(r,1)}),a=this.rightList=e},remove:function(e){this.rightList.splice(e,1),a.splice(e,1)},filterRight:function(){var e=this;if(this.keyWordRight){var t=Object.assign([],this.rightList),r=t.filter(function(t){var r=!1;return t.cardNo&&(r=t.cardNo.indexOf(e.keyWordRight)>-1),t.memberName&&(r=t.memberName.indexOf(e.keyWordRight)>-1),r});this.rightList=r}else this.rightList=Object.assign([],a)}}}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e){for(var t;e.length;){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t},a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},l=function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(Array.isArray(t))t.push(r);else{if("object"!=typeof t)return[t,r];(o.plainObjects||o.allowPrototypes||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!=typeof t)return[t].concat(r);var i=t;return Array.isArray(t)&&!Array.isArray(r)&&(i=a(t,o)),Array.isArray(t)&&Array.isArray(r)?(r.forEach(function(r,i){n.call(t,i)?t[i]&&"object"==typeof t[i]?t[i]=e(t[i],r,o):t.push(r):t[i]=r}),t):Object.keys(r).reduce(function(t,i){var a=r[i];return n.call(t,i)?t[i]=e(t[i],a,o):t[i]=a,t},i)},c=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},s=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},u=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",n=0;n<t.length;++n){var i=t.charCodeAt(n);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r+=t.charAt(n):i<128?r+=o[i]:i<2048?r+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?r+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(n+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return r},f=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],a=o.obj[o.prop],l=Object.keys(a),c=0;c<l.length;++c){var s=l[c],u=a[s];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:a,prop:s}),r.push(u))}return i(t)},p=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},d=function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};e.exports={arrayToObject:a,assign:c,compact:f,decode:s,encode:u,isBuffer:d,isRegExp:p,merge:l}},function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o={install:function(e,t){e.component(n.a.name,n.a)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(o),t.default=o},function(e,t,r){"use strict";function n(e){r(5)}var o=r(0),i=r(15),a=r(10),l=n,c=a(o.a,i.a,!1,l,"data-v-49b51b74",null);t.a=c.exports},function(e,t,r){var n=r(6);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r(8)("15b62a58",n,!0,{})},function(e,t,r){t=e.exports=r(7)(!1),t.push([e.i,".confirm-people[data-v-49b51b74]{width:1000px}.confirm-people_l[data-v-49b51b74],.confirm-people_r[data-v-49b51b74]{display:inline-block;width:400px;border:1px solid #dcdfe6;vertical-align:middle}.confirm-people_l header[data-v-49b51b74],.confirm-people_r header[data-v-49b51b74]{height:66px;line-height:66px;padding:0 15px}.confirm-people_c[data-v-49b51b74]{display:inline-block;vertical-align:middle;margin:0 10px}.confirm-people_c button[data-v-49b51b74]{display:block;margin:10px auto}.confirm-people[data-v-49b51b74] .avatar{display:inline-block;vertical-align:middle}",""])},function(e,t){function r(e,t){var r=e[1]||"",o=e[3];if(!o)return r;if(t&&"function"==typeof btoa){var i=n(o);return[r].concat(o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"})).concat([i]).join("\n")}return[r].join("\n")}function n(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=r(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(n[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="("+a[2]+") and ("+r+")"),t.push(a))}},t}},function(e,t,r){function n(e){for(var t=0;t<e.length;t++){var r=e[t],n=u[r.id];if(n){n.refs++;for(var o=0;o<n.parts.length;o++)n.parts[o](r.parts[o]);for(;o<r.parts.length;o++)n.parts.push(i(r.parts[o]));n.parts.length>r.parts.length&&(n.parts.length=r.parts.length)}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(i(r.parts[o]));u[r.id]={id:r.id,refs:1,parts:a}}}}function o(){var e=document.createElement("style");return e.type="text/css",f.appendChild(e),e}function i(e){var t,r,n=document.querySelector("style["+m+'~="'+e.id+'"]');if(n){if(h)return v;n.parentNode.removeChild(n)}if(g){var i=d++;n=p||(p=o()),t=a.bind(null,n,i,!1),r=a.bind(null,n,i,!0)}else n=o(),t=l.bind(null,n),r=function(){n.parentNode.removeChild(n)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else r()}}function a(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=b(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function l(e,t){var r=t.css,n=t.media,o=t.sourceMap;if(n&&e.setAttribute("media",n),y.ssrId&&e.setAttribute(m,t.id),o&&(r+="\n/*# sourceURL="+o.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var s=r(9),u={},f=c&&(document.head||document.getElementsByTagName("head")[0]),p=null,d=0,h=!1,v=function(){},y=null,m="data-vue-ssr-id",g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,r,o){h=r,y=o||{};var i=s(e,t);return n(i),function(t){for(var r=[],o=0;o<i.length;o++){var a=i[o],l=u[a.id];l.refs--,r.push(l)}t?(i=s(e,t),n(i)):i=[];for(var o=0;o<r.length;o++){var l=r[o];if(0===l.refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete u[l.id]}}}};var b=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t){for(var r=[],n={},o=0;o<t.length;o++){var i=t[o],a=i[0],l=i[1],c=i[2],s=i[3],u={id:e+":"+o,css:l,media:c,sourceMap:s};n[a]?n[a].parts.push(u):r.push(n[a]={id:a,parts:[u]})}return r}},function(e,t){e.exports=function(e,t,r,n,o,i){var a,l=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(a=e,l=e.default);var s="function"==typeof l?l.options:l;t&&(s.render=t.render,s.staticRenderFns=t.staticRenderFns,s._compiled=!0),r&&(s.functional=!0),o&&(s._scopeId=o);var u;if(i?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},s._ssrRegister=u):n&&(u=n),u){var f=s.functional,p=f?s.render:s.beforeCreate;f?(s._injectStyles=u,s.render=function(e,t){return u.call(t),p(e,t)}):s.beforeCreate=p?[].concat(p,u):[u]}return{esModule:a,exports:l,options:s}}},function(e,t,r){"use strict";var n=r(12),o=r(13),i=r(2);e.exports={formats:i,parse:o,stringify:n}},function(e,t,r){"use strict";var n=r(1),o=r(2),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,l={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,r,o,i,a,c,s,u,f,p,d,h){var v=t;if("function"==typeof s)v=s(r,v);else if(v instanceof Date)v=p(v);else if(null===v){if(i)return c&&!h?c(r,l.encoder):r;v=""}if("string"==typeof v||"number"==typeof v||"boolean"==typeof v||n.isBuffer(v)){if(c){return[d(h?r:c(r,l.encoder))+"="+d(c(v,l.encoder))]}return[d(r)+"="+d(String(v))]}var y=[];if(void 0===v)return y;var m;if(Array.isArray(s))m=s;else{var g=Object.keys(v);m=u?g.sort(u):g}for(var b=0;b<m.length;++b){var x=m[b];a&&null===v[x]||(y=Array.isArray(v)?y.concat(e(v[x],o(r,x),o,i,a,c,s,u,f,p,d,h)):y.concat(e(v[x],r+(f?"."+x:"["+x+"]"),o,i,a,c,s,u,f,p,d,h)))}return y};e.exports=function(e,t){var r=e,a=t?n.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var s=void 0===a.delimiter?l.delimiter:a.delimiter,u="boolean"==typeof a.strictNullHandling?a.strictNullHandling:l.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:l.skipNulls,p="boolean"==typeof a.encode?a.encode:l.encode,d="function"==typeof a.encoder?a.encoder:l.encoder,h="function"==typeof a.sort?a.sort:null,v=void 0!==a.allowDots&&a.allowDots,y="function"==typeof a.serializeDate?a.serializeDate:l.serializeDate,m="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:l.encodeValuesOnly;if(void 0===a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var g,b,x=o.formatters[a.format];"function"==typeof a.filter?(b=a.filter,r=b("",r)):Array.isArray(a.filter)&&(b=a.filter,g=b);var w=[];if("object"!=typeof r||null===r)return"";var j;j=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var _=i[j];g||(g=Object.keys(r)),h&&g.sort(h);for(var O=0;O<g.length;++O){var S=g[O];f&&null===r[S]||(w=w.concat(c(r[S],S,_,u,f,p?d:null,b,h,v,y,x,m)))}var C=w.join(s),k=!0===a.addQueryPrefix?"?":"";return C.length>0?k+C:""}},function(e,t,r){"use strict";var n=r(1),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,l=n.split(t.delimiter,a),c=0;c<l.length;++c){var s,u,f=l[c],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(s=t.decoder(f,i.decoder),u=t.strictNullHandling?null:""):(s=t.decoder(f.slice(0,d),i.decoder),u=t.decoder(f.slice(d+1),i.decoder)),o.call(r,s)?r[s]=[].concat(r[s]).concat(u):r[s]=u}return r},l=function(e,t,r){for(var n=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=[],i=i.concat(n);else{i=r.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(l,10);!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(i=[],i[c]=n):i[l]=n}n=i}return n},c=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=i.exec(n),s=c?n.slice(0,c.index):n,u=[];if(s){if(!r.plainObjects&&o.call(Object.prototype,s)&&!r.allowPrototypes)return;u.push(s)}for(var f=0;null!==(c=a.exec(n))&&f<r.depth;){if(f+=1,!r.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+n.slice(c.index)+"]"),l(u,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:i.delimiter,r.depth="number"==typeof r.depth?r.depth:i.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:i.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:i.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:i.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:i.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:i.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:i.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return r.plainObjects?Object.create(null):{};for(var o="string"==typeof e?a(e,r):e,l=r.plainObjects?Object.create(null):{},s=Object.keys(o),u=0;u<s.length;++u){var f=s[u],p=c(f,o[f],r);l=n.merge(l,p,r)}return n.compact(l)}},function(e,t,r){e.exports=r.p+"head_default.jpg?72bbbc548e60e829a2e6f1dfb05fc5fb"},function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("section",{staticClass:"confirm-people"},[r("div",{staticClass:"confirm-people_l"},[r("header",[r("el-input",{staticStyle:{width:"370px"},attrs:{size:"medium",placeholder:"请输入昵称卡号","prefix-icon":"el-icon-search",clearable:""},on:{change:e.loadList},model:{value:e.keyWord,callback:function(t){e.keyWord=t},expression:"keyWord"}})],1),e._v(" "),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{tooltipEffect:"light",data:e.leftList,"tooltip-effect":"dark",height:"400px"},on:{"selection-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),r("el-table-column",{attrs:{label:"会员信息","min-width":"120","show-overflow-tooltip":!0},scopedSlots:e._u([{key:"default",fn:function(t){return[r("img",{staticStyle:{"vertical-align":"middle"},attrs:{src:t.row.photoUrl||e.avatar,width:"40px",height:"40px",alt:"",srcset:""}}),e._v(" "),r("span",{staticClass:"avatar"},[r("p",[e._v(e._s(t.row.name))]),e._v(" "),r("p",{staticStyle:{color:"#909399"}},[e._v(e._s(t.row.cardNo))])])]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"gradeName",label:"会员等级",width:"100"}})],1)],1),e._v(" "),r("div",{staticClass:"confirm-people_c"},[r("el-button",{attrs:{type:"primary",icon:"el-icon-arrow-right",circle:""},on:{click:e.toRight}}),e._v(" "),r("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeAll}})],1),e._v(" "),r("div",{staticClass:"confirm-people_r"},[r("header",[r("el-input",{staticStyle:{width:"370px"},attrs:{size:"medium",placeholder:"请输入昵称卡号",clearable:"","prefix-icon":"el-icon-search"},on:{change:e.filterRight},model:{value:e.keyWordRight,callback:function(t){e.keyWordRight=t},expression:"keyWordRight"}})],1),e._v(" "),r("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{tooltipEffect:"light",data:e.rightList,"tooltip-effect":"dark",height:"400px"},on:{"selection-change":e.handleSelectionChangeRight}},[r("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),r("el-table-column",{attrs:{label:"会员信息","min-width":"120","show-overflow-tooltip":!0},scopedSlots:e._u([{key:"default",fn:function(t){return[r("img",{staticStyle:{"vertical-align":"middle"},attrs:{src:t.row.photoUrl||e.avatar,width:"40px",height:"40px",alt:"",srcset:""}}),e._v(" "),r("span",{staticClass:"avatar"},[r("p",[e._v(e._s(t.row.name))]),e._v(" "),r("p",{staticStyle:{color:"#909399"}},[e._v(e._s(t.row.cardNo))])])]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"gradeName",label:"会员等级",width:"100"}}),e._v(" "),r("el-table-column",{attrs:{prop:"gradeName",label:"操作",width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"text"},on:{click:function(r){e.remove(t.$index)}}},[e._v("移除")])]}}])})],1)],1)])},o=[],i={render:n,staticRenderFns:o};t.a=i}])});
//# sourceMappingURL=vue-gic-confirm-people.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>vue-gic-card</title>
</head>
<body>
<div id="app"></div>
<!-- <script src="/dist/build.js"></script> -->
<script src="/dist/vue-gic-card.js"></script>
</body>
</html>
{
"name": "@gic-test/vue-gic-confirm-people",
"description": "vue-gic-confirm-people Plugin",
"version": "1.0.2",
"license": "MIT",
"private": false,
"main": "dist/vue-gic-confirm-people.js",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"axios": "^0.18.0",
"qs": "^6.5.2",
"vue": "^2.5.16"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-3": "^6.24.1",
"cross-env": "^5.0.5",
"css-loader": "^0.28.7",
"file-loader": "^1.1.4",
"less-loader": "^4.1.0",
"node-sass": "^4.5.3",
"sass-loader": "^6.0.6",
"vue-loader": "^13.0.5",
"vue-template-compiler": "^2.5.17",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.1"
},
"_from": "@gic-test/vue-gic-confirm-people@1.0.2",
"_resolved": "http://www.gicdev.com:7001/@gic-test/vue-gic-confirm-people/download/@gic-test/vue-gic-confirm-people-1.0.2.tgz"
}
\ No newline at end of file
<template>
<div id="app">
<div @click="showCard">点击弹窗</div>
<vue-gic-card :projectName="projectName" :showCardDialog="showCardDialog" :cardLimit="cardLimit" :cardType="cardType" @selectCard="selectCard"></vue-gic-card>
</div>
</template>
<script>
import vueGicCard from './lib/vue-gic-card'
export default {
name: 'app',
data () {
return {
projectName: '', //当前项目名
showCardDialog: false,
cardLimit: 1, //卡券限制类型 1-限制领取1张的卡券 2- 限制领取 1~100的卡券 3-限制领取>=100 的卡券
cardType: null, //卡券类型集合(0:抵金券,1:折扣券,2:兑换券)null-为全部类型 逗号分隔
}
},
components: {
vueGicCard
},
methods: {
// 显示卡券弹窗
showCard() {
var that = this
that.showCardDialog = true;
},
// 子组件触发方法
selectCard(val) {
// 模拟检查数据
console.log(val)
var that = this
that.showCardDialog = false;
}
}
}
</script>
<style lang="scss">
* {
margin: 0;
padding: 0;
}
</style>
import axios from 'axios';
import qs from 'qs';
axios.defaults.timeout = 10000;
let base = "http://192.168.1.164:8282/gic/";
const timeout = 10000;
let token = ''//sessionStorage.getItem('user');
/*
*
* 统一 get 请求方法
* @url: 请求的 url
* @params: 请求带的参数
* @header: 带 token
*
*/
export const getRequest = (url, params) => {
return axios({
method: 'get',
url: `${base}${url}`,
data: {},
params: params,
headers: {'content-type': 'application/x-www-form-urlencoded'},// "token": token
});
}
import vueGicConfirmPeople from './vue-gic-confirm-people.vue' // 导入组件
const gicConfirmPeople = {
install(Vue, options) {
Vue.component(vueGicConfirmPeople.name, vueGicConfirmPeople) // vueGicConfirmPeople.name 组件的name属性
// 类似通过 this.$xxx 方式调用插件的 其实只是挂载到原型上而已
// Vue.prototype.$xxx // 最终可以在任何地方通过 this.$xxx 调用
// 虽然没有明确规定用$开头 但是大家都默认遵守这个规定
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(gicConfirmPeople);
}
export default gicConfirmPeople
<template>
<section class="confirm-people">
<div class="confirm-people_l">
<header>
<el-input size="small"" style="width:370px;" placeholder="请输入昵称卡号" prefix-icon="el-icon-search" v-model="keyWord" clearable @change="loadList"></el-input>
</header>
<el-table v-loading="loading" tooltipEffect="light" ref="multipleTable" :data="leftList" tooltip-effect="dark" style="width: 100%" height="400px" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="会员信息" min-width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
<img style="vertical-align: middle;" :src="scope.row.photoUrl || avatar" width="40px" height="40px" alt="" srcset="">
<span class="avatar">
<p>{{ scope.row.name }}</p>
<p style="color:#909399;">{{ scope.row.cardNo }}</p>
</span>
</template>
</el-table-column>
<el-table-column prop="gradeName" label="会员等级" width="100"></el-table-column>
</el-table>
</div>
<div class="confirm-people_c">
<el-button type="primary" icon="el-icon-arrow-right" circle @click="toRight"></el-button>
<el-button icon="el-icon-arrow-left" circle @click="removeAll"></el-button>
</div>
<div class="confirm-people_r">
<header>
<el-input size="small" style="width:370px;" placeholder="请输入昵称卡号" clearable prefix-icon="el-icon-search" v-model="keyWordRight" @change="filterRight"></el-input>
</header>
<el-table tooltipEffect="light" ref="multipleTable" :data="rightList" tooltip-effect="dark" style="width: 100%" height="400px" @selection-change="handleSelectionChangeRight">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="会员信息" min-width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
<img style="vertical-align: middle;" :src="scope.row.photoUrl || avatar" width="40px" height="40px" alt="" srcset="">
<span class="avatar">
<p>{{ scope.row.name }}</p>
<p style="color:#909399;">{{ scope.row.cardNo }}</p>
</span>
</template>
</el-table-column>
<el-table-column prop="gradeName" label="会员等级" width="100"></el-table-column>
<el-table-column prop="gradeName" label="操作" width="50">
<template slot-scope="scope">
<el-button type="text" @click="remove(scope.$index)">移除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</section>
</template>
<script>
import qs from 'qs'
/**
* 清除重复
*/
function uniqueByType(arr, type) {
var res = [];
var json = {};
for (var i = 0; i < arr.length; i++) {
if (!json[arr[i][type]]) {
res.push(arr[i]);
json[arr[i][type]] = 1;
}
}
return res;
}
let allList = [];
export default {
name:'vue-gic-confirm-people',
props:{
idType:{
type:String,
default:'openId'
},
list:{
type:Array,
default() {
return []
}
},
onlyWxMember:{
type:Number,
default:1
},
},
data() {
return {
loading:false,
keyWord:'',
keyWordRight:'',
leftList:[],
rightList:[],
leftSelected:[],
rightSelected:[],
avatar:require('./head_default.jpg')
}
},
watch: {
rightList(val) {
// console.log(val)
this.$emit('get-data',val.map(v => v[this.idType]).join(','));
},
list(val) {
allList = this.rightList = val.slice();
}
},
methods:{
handleSelectionChange(val) {
// console.log(val)
this.leftSelected = val;
},
handleSelectionChangeRight(val){
this.rightSelected = val;
},
toRight(){
// console.log(this.leftSelected)
this.leftSelected.map( v => {
const index = this.rightList.indexOf(v);
if (index < 0) {
this.rightList.push(v);
}
})
console.log(this.rightList.map(v => v.memberId));
allList = this.rightList = uniqueByType(this.rightList,'memberId')
},
loadList() {
this.loading = true;
this.leftSelected = []
let params = {
searchParams:this.keyWord,
onlyWxMember:this.onlyWxMember,
requestProject:'gic-web'
}
this.axios.post('/api-marketing/member-search-engine',qs.stringify(params),
{})
.then(res => {
if (res.data.errorCode === 0 && res.data.result) {
this.leftList = res.data.result;
}
this.loading = false;
})
},
removeAll() {
let currentList = this.rightList.slice();
this.rightSelected.map(v => {
const index = currentList.indexOf(v);
if (index > -1) {
currentList.splice(index,1)
}
})
allList = this.rightList = currentList;
},
remove(index) {
this.rightList.splice(index,1);
allList.splice(index,1);
},
//TODO
filterRight() {
if (!this.keyWordRight) {
this.rightList = Object.assign([],allList);
} else {
const list = Object.assign([],this.rightList);
const filterList = list.filter(v => {
let flag = false;
if(v.cardNo) flag = v.cardNo.indexOf(this.keyWordRight) > -1;
if(v.memberName) flag = v.memberName.indexOf(this.keyWordRight) > -1;
return flag;
});
this.rightList = filterList;
}
}
}
}
</script>
<style lang="scss" scoped>
.confirm-people{
width: 1000px;
&_l,&_r{
display: inline-block;
width: 400px;
border: 1px solid #DCDFE6;
vertical-align: middle;
header{
height: 66px;
line-height: 66px;
padding: 0 15px;
}
}
&_c {
display: inline-block;
vertical-align: middle;
margin: 0 10px;
button{
display: block;
margin: 10px auto;
}
}
/deep/ .avatar{
display: inline-block;vertical-align: middle;
}
// /deep/ .el-table__body-wrapper::-webkit-scrollbar-button {
// background-color:#000;
// }
}
</style>
import Vue from 'vue'
import App from './App.vue'
new Vue({
el: '#app',
render: h => h(App)
})
var path = require('path')
var webpack = require('webpack')
module.exports = {
// entry: './src/main.js',
entry: './src/lib/index.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
// filename: 'build.js',
filename: 'vue-gic-confirm-people.js',
library: 'vue-gic-confirm-people',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
],
},
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
],
},
{
test: /\.sass$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader?indentedSyntax'
],
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
// Since sass-loader (weirdly) has SCSS as its default parse mode, we map
// the "scss" and "sass" values for the lang attribute to the right configs here.
// other preprocessors should work out of the box, no loader config like this necessary.
'scss': [
'vue-style-loader',
'css-loader',
'sass-loader'
],
'sass': [
'vue-style-loader',
'css-loader',
'sass-loader?indentedSyntax'
]
}
// other vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true
},
performance: {
hints: false
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment