webpackJsonp([2],{ /***/ 6350: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_WhiteList_vue__ = __webpack_require__(6448); /* empty harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c5a0bdd_hasScoped_false_transformToRequire_video_src_poster_source_src_img_src_image_xlink_href_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_WhiteList_vue__ = __webpack_require__(6555); var disposed = false var normalizeComponent = __webpack_require__(2) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = null /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_WhiteList_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c5a0bdd_hasScoped_false_transformToRequire_video_src_poster_source_src_img_src_image_xlink_href_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_WhiteList_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) Component.options.__file = "src/components/internal/whiteList/WhiteList.vue" /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-3c5a0bdd", Component.options) } else { hotAPI.reload("data-v-3c5a0bdd", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 6448: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_DialogAddEdit_vue__ = __webpack_require__(6449); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_WhiteListTable_vue__ = __webpack_require__(6549); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vuex__ = __webpack_require__(4); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: 'WhiteList', components: { DialogAddEdit: __WEBPACK_IMPORTED_MODULE_1__components_DialogAddEdit_vue__["a" /* default */], WhiteListTable: __WEBPACK_IMPORTED_MODULE_2__components_WhiteListTable_vue__["a" /* default */] }, computed: __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_3_vuex__["c" /* mapGetters */])(['whitelist'])), data: function data() { return { search: '', rowsConfig: [15, 30, 100, 250], actualPage: 1, limit: 15, queryStr: '' }; }, created: function created() { // this.$store.dispatch('loadWhiteList', {page: this.actualPage, take: this.limit}) // Load when created }, methods: { changePage: function changePage(goTo) { var page = goTo.split('=')[1]; this.$store.dispatch('loadWhiteList', { page: page, take: this.limit }); }, filterWhiteList: function filterWhiteList() { if (!this.search) { this.$store.dispatch('loadWhiteList', { page: 1, take: this.limit }); return; } this.$store.dispatch('loadWhiteList', { query: this.search }); } }, watch: { limit: function limit() { this.$store.dispatch('loadWhiteList', { page: 1, take: this.limit }); } } }); /***/ }), /***/ 6449: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_DialogAddEdit_vue__ = __webpack_require__(6450); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5dde3438_hasScoped_true_transformToRequire_video_src_poster_source_src_img_src_image_xlink_href_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_DialogAddEdit_vue__ = __webpack_require__(6548); var disposed = false function injectStyle (ssrContext) { if (disposed) return __webpack_require__(6546) } var normalizeComponent = __webpack_require__(2) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-5dde3438" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_DialogAddEdit_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5dde3438_hasScoped_true_transformToRequire_video_src_poster_source_src_img_src_image_xlink_href_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_DialogAddEdit_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) Component.options.__file = "src/components/internal/whiteList/components/DialogAddEdit.vue" /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-5dde3438", Component.options) } else { hotAPI.reload("data-v-5dde3438", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /***/ 6450: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_the_mask__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_the_mask___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_the_mask__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuex__ = __webpack_require__(4); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: 'DialogAddEdit', props: { title: { type: String, default: 'Titulo' }, toEdit: { type: Object }, editMode: { type: Boolean, default: false } }, directives: { mask: __WEBPACK_IMPORTED_MODULE_1_vue_the_mask__["mask"] }, computed: __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_2_vuex__["c" /* mapGetters */])(['loadingActionWhitelist'])), data: function data() { return { valid: true, dialog: false, formNotSent: true, noCode: false, emailRules: [function (v) { return !!v || 'E-mail é obrigatório'; }, function (v) { return (/.+@.+\..+/.test(v) || 'E-mail inválido' ); }], codeRules: [function (v) { return !!v || 'Código é obrigatório'; }, function (v) { return v.length === 3 || 'Código precisa ter 3 números'; }], obsRules: [function (v) { return !!v || 'Observação é obrigatório'; }], fields: { email: '', code: '', obs: '' } }; }, methods: { handleNoCode: function handleNoCode() { this.noCode = !this.noCode; this.valid = true; if (this.noCode) this.fields.code = ''; if (this.editMode && !this.noCode) this.fields.code = this.toEdit.item.codigo_conferencia; }, close: function close() { this.dialog = false; this.fields = { email: '', code: '', obs: '' }; this.noCode = false; }, handleSave: function handleSave() { if (this.$refs.form.validate()) { // Create Mode if (!this.editMode) { var obj = { email: this.fields.email }; if (!this.noCode) obj.codigo_conferencia = Number(this.fields.code);else obj.observacoes = this.fields.obs; this.$store.dispatch('newWhiteList', obj); } else { // Edit Mode var objToEdit = { email: this.fields.email, codigo: this.toEdit.item.codigo }; if (!this.noCode) { objToEdit.codigo_conferencia = Number(this.fields.code); objToEdit.observacoes = null; } else { objToEdit.observacoes = this.fields.obs; objToEdit.codigo_conferencia = null; } this.$store.dispatch('editWhiteList', objToEdit); } } } }, watch: { 'toEdit.count': function toEditCount() { this.dialog = true; this.fields.email = this.toEdit.item.email; if (this.toEdit.item.codigo_conferencia && !this.toEdit.item.observacoes) { this.noCode = false; this.fields.code = this.toEdit.item.codigo_conferencia; } else { this.fields.code = ''; this.noCode = true; this.fields.obs = this.toEdit.item.observacoes; } }, loadingActionWhitelist: function loadingActionWhitelist(last, old) { if (old && !last) { this.close(); } } } }); /***/ }), /***/ 6451: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__DialogAddEdit_vue__ = __webpack_require__(6449); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__DialogDelete_vue__ = __webpack_require__(6550); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vuex__ = __webpack_require__(4); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: 'WhiteListTable', components: { DialogEdit: __WEBPACK_IMPORTED_MODULE_2__DialogAddEdit_vue__["a" /* default */], DialogDelete: __WEBPACK_IMPORTED_MODULE_3__DialogDelete_vue__["a" /* default */] }, props: { whitelist_total: { type: Number, default: 15 } }, computed: __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_4_vuex__["c" /* mapGetters */])(['whitelist', 'loadingWhitelist']), { whitelistData: function whitelistData() { if (this.whitelist.data) { var array = [].concat(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default()(this.whitelist.data)); array.forEach(function (item) { item.email = item.valor; }); return array; } return []; } }), data: function data() { return { headers: [{ text: 'Email', value: 'email', align: 'left' }, { text: 'Observações', value: 'observacoes', align: 'left' }, // { text: '', value: 'edit', align: 'center', width: '1%' }, { text: '', value: 'delete', align: 'center', width: '1%' }], toEdit: { item: null, count: 0 }, toDelete: { item: null, count: 0 } }; }, methods: { handleEdit: function handleEdit(item) { this.toEdit.count++; this.toEdit.item = item; }, handleDelete: function handleDelete(item) { this.toDelete.count++; this.toDelete.item = item; } } }); /***/ }), /***/ 6452: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(4); // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: 'DialogDelete', props: { title: { type: String, default: 'Titulo' }, toDelete: { type: Object } }, computed: __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, Object(__WEBPACK_IMPORTED_MODULE_1_vuex__["c" /* mapGetters */])(['loadingActionWhitelist'])), data: function data() { return { dialog: false, loadingDelete: false }; }, methods: { handleDelete: function handleDelete() { this.$store.dispatch('removeWhiteList', { codigo: this.toDelete.item.codigo }); }, close: function close() { this.dialog = false; } }, watch: { 'toDelete.count': function toDeleteCount() { this.dialog = true; }, loadingActionWhitelist: function loadingActionWhitelist(last, old) { if (old && !last) this.dialog = false; } } }); /***/ }), /***/ 6546: /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a