{"version":3,"sources":["webpack:///./src/pages/manage/mailscenarios/id.vue","webpack:///./src/data/Object/MailScenarioObjectDataSource.ts","webpack:///./src/pages/manage/mailscenarios/id.vue?d031","webpack:///./src/pages/manage/mailscenarios/id.vue?4311","webpack:///./src/pages/manage/mailscenarios/id.vue?d468","webpack:///./src/pages/manage/mailscenarios/id.vue?c70e"],"names":["attrs","_vm","scopedSlots","key","fn","staticClass","tag","dataSource","property","_c","on","add","proxy","ref","render","MailScenarioObjectDataSource","ObjectDataSource","constructor","id","model","super","className","config","this","baseUrl","axios","post","mailUrl","error","visibleProperties","Home","Vue","$route","params","subsciberDataSource","ListDataSource","pageIndex","pageSize","filter","JSON","stringify","Filter","caption","description","email","scenarioId","fields","editor","label","type","name","validations","required","placeholder","emailAddres","_this$dataSource$mode","_this$dataSource$mode2","text","to","exact","disabled","_this$dataSource$meta","_this$dataSource$meta2","properties","metadata","cb","p","some","n","dataEditor","update","items","length","dataList","refreshData","$message","_error$response","response","data","__decorate","Ref","Component","components","DataEditorDialog","component","staticRenderFns"],"mappings":"uMAAgHA,EAAM,W,IAAC,O,EAAoB,QAAa,GAAgB,QAAcC,Y,OAAgB,eAACC,OAAqBC,MAAI,EAAM,QAACC,cAAG,EAAU,W,YAAY,e,YAAiB,EAAO,K,IAAE,O,GAAE,W,MAAgCC,UAAY,CAAa,MAAO,CAA4C,KAAU,K,CAAwBA,SAAY,YAAiB,YAAW,c,EAACA,wBAAY,YAAkB,OAAM,EAAG,KAAK,CAA+CA,MAAY,KAAoB,YAAM,mBAAmCC,GAAI,MAAYN,YAAM,oB,CAAC,SAAa,GAACC,EAAIM,KAAU,0B,YAASC,qBAAQ,8BAAG,IAAI,YAAK,MAAM,CAAsB,cAAW,aAACR,MAAM,MAAsB,QAAsC,wBAACE,e,MAAyB,CAAiBE,MAAG,a,cAAsB,EAAM,qB,YAAS,OAAK,IAAC,iBAACD,GAAG,WAAa,MAAC,GAAAC,SAAgB,OAAE,G,CAAkD,cAAE,GAAC,e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M,gBAIV,cAAW,IAAAK,EACT,OAA4B,QAA5BA,EAAOhC,KAAKhB,WAAWY,aAAK,IAAAoC,OAAA,EAArBA,EAAuBb,QAGhC,kBAAe,IAAAc,EACb,MAAO,CACL,CACEC,KAAM,UACNC,GAAI,KAEN,CACED,KAAM,cACNC,GAAI,wBACJC,OAAO,GAET,CACEF,KAA2B,QAAvBD,EAAEjC,KAAKhB,WAAWY,aAAK,IAAAqC,OAAA,EAArBA,EAAuBd,QAC7BkB,UAAU,IAKhB,wBAAqB,IAAAC,EAAAC,EACnB,MAAMC,EAAiD,QAAvCF,EAA2B,QAA3BC,EAAGvC,KAAKhB,WAAWyD,gBAAQ,IAAAF,OAAA,EAAxBA,EAA0BC,kBAAU,IAAAF,IAAI,GACrDI,EAAMC,GAAMrC,EAAkBsC,KAAMC,GAAMF,EAAEhB,OAASkB,GAC3D,OAAOL,EAAWzB,OAAO2B,GAG3B,YACE,MAAM9C,QAAcI,KAAK8C,WAAWC,OAAO/C,KAAKJ,OAChD,GAAKA,EAEL,UACQI,KAAKW,oBAAoBvB,IAAIQ,GACU,GAAzCI,KAAKW,oBAAoBqC,MAAMC,cAC3BjD,KAAKkD,SAASC,cAEtBnD,KAAKoD,SAAS,qBACd,MAAO/C,GAAO,IAAAgD,EACdrD,KAAKoD,SAAuB,OAAb/C,QAAa,IAAbA,GAAuB,QAAVgD,EAAbhD,EAAeiD,gBAAQ,IAAAD,OAAA,EAAvBA,EAAyBE,KAAM,YA/F/BC,eAAA,CAAlBC,eAAI,e,iCACYD,eAAA,CAAhBC,eAAI,a,+BAFclD,EAAIiD,eAAA,CAHxBE,eAAU,CACTC,WAAY,CAAEC,4BAEKrD,WCzB2Y,I,wBCQ5ZsD,EAAY,eACd,EACA,EACAC,GACA,EACA,KACA,KACA,MAIa,aAAAD,E,6CCnBf","file":"js/chunk-935b77ee.4fc8a624.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('data-item',{attrs:{\"title\":_vm.caption,\"data-source\":_vm.dataSource,\"breadcrumbs\":_vm.breadcrumbs},scopedSlots:_vm._u([{key:\"body\",fn:function(){return [_c('v-card',{attrs:{\"tile\":\"\"}},[_c('v-card-text',[_c('table',{staticClass:\"order-form\"},_vm._l((_vm.visibleProperties),function(property){return _c('tr',{key:property.name,staticClass:\"order-form__row\"},[_c('td',{staticClass:\"order-form__name\"},[_c('b',[_vm._v(_vm._s(property.caption)+\":\")])]),_c('td',{staticClass:\"order-form__value\"},[_c(`inline-editor-${property.editor}`,{tag:\"component\",attrs:{\"data-source\":_vm.dataSource,\"field\":property}})],1)])}),0)])],1),_c('data-list',{ref:\"dataList\",attrs:{\"title\":\"Подписчики\",\"data-source\":_vm.subsciberDataSource},scopedSlots:_vm._u([{key:\"filter-section\",fn:function(){return [_c('div')]},proxy:true},{key:\"caption\",fn:function({ item }){return [_c('div',[_vm._v(_vm._s(item.caption))])]}},{key:\"add\",fn:function(){return [_c('v-btn',{attrs:{\"color\":\"primary\"},on:{\"click\":_vm.add}},[_c('v-icon',{attrs:{\"left\":\"\"}},[_vm._v(\" mdi-plus \")]),_vm._v(\" Добавить Подписчика \")],1)]},proxy:true}])}),_c('data-editor-dialog',{ref:\"dataEditor\",attrs:{\"fields\":_vm.fields,\"title\":\"Добавить нового подписчика\"}}),_c('data-editor-dialog',{ref:\"dataEdito1r1\",attrs:{\"fields\":_vm.testMailFields,\"title\":\"Отправить тестовое письмо\"}})]},proxy:true}])})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import axios from \"axios\";\nimport { ObjectDataSource } from \"./ObjecDatatSource\";\n\nexport class MailScenarioObjectDataSource extends ObjectDataSource {\n constructor(id: number, model: any = {}) {\n super({\n id,\n model,\n className: \"mailscenario\",\n config: {},\n });\n }\n\n public get mailUrl() {\n return `${this.baseUrl}/sendEmail`;\n }\n\n public async sendRegistrationLetter() {\n try {\n await axios.post(`${this.mailUrl}/successRegistration`);\n } catch (error) {\n throw error;\n }\n }\n}\n","\nimport { Vue, Component, Ref } from \"vue-property-decorator\";\nimport { ListDataSource } from \"@/data/List/ListDataSource\";\nimport DataEditorDialog from \"@/components/helpers/data/editor-dialog.vue\";\nimport { emailAddres, required } from \"@/cms-services/consts\";\nimport DataList from \"@/components/common/data/list.vue\";\nimport { Filter } from \"@/cms-services/filter\";\nimport { MailScenarioObjectDataSource } from \"@/data/Object/MailScenarioObjectDataSource\";\nconst visibleProperties = [\n \"name\",\n \"template\",\n \"userTemplate\",\n \"userCaption\",\n \"caption\",\n \"id\",\n \"createDate\",\n \"lastUpdate\",\n \"priority\",\n \"instanceStateId\",\n \"scenarioType\",\n \"objectClassName\",\n];\n@Component({\n components: { DataEditorDialog },\n})\nexport default class Home extends Vue {\n @Ref(\"dataEditor\") dataEditor!: DataEditorDialog;\n @Ref(\"dataList\") dataList!: DataList;\n\n dataSource: MailScenarioObjectDataSource = new MailScenarioObjectDataSource(\n +this.$route.params.id,\n );\n\n subsciberDataSource: ListDataSource = new ListDataSource({\n className: \"mailsubscriber\",\n config: {\n pageIndex: 1,\n pageSize: 100,\n filter: JSON.stringify([\n new Filter(\"scenarioId\", +this.$route.params.id),\n ]),\n },\n });\n $message: any;\n\n model: any = {\n caption: \"\",\n description: \"\",\n email: \"\",\n scenarioId: +this.$route.params.id,\n };\n\n fields: any = [\n {\n editor: \"string\",\n attrs: {\n label: \"Заголовок\",\n type: \"text\",\n },\n name: \"caption\",\n validations: [required()],\n },\n {\n editor: \"string\",\n attrs: {\n label: \"Почта\",\n placeholder: \"Например info@mail.ru\",\n type: \"email\",\n },\n name: \"email\",\n validations: [required(), emailAddres()],\n },\n {\n editor: \"string\",\n attrs: {\n label: \"Описание\",\n type: \"text\",\n },\n name: \"description\",\n },\n ];\n\n get caption() {\n return this.dataSource.model?.caption;\n }\n\n get breadcrumbs() {\n return [\n {\n text: \"Главная\",\n to: \"/\",\n },\n {\n text: \"Уведомления\",\n to: \"/manage/mailscenario/\",\n exact: true,\n },\n {\n text: this.dataSource.model?.caption,\n disabled: true,\n },\n ];\n }\n\n get visibleProperties(): any {\n const properties = this.dataSource.metadata?.properties ?? [];\n const cb = (p) => visibleProperties.some((n) => p.name === n);\n return properties.filter(cb);\n }\n\n async add() {\n const model = await this.dataEditor.update(this.model);\n if (!model) return;\n\n try {\n await this.subsciberDataSource.add(model);\n if (this.subsciberDataSource.items.length == 1) {\n await this.dataList.refreshData();\n }\n this.$message(\"Успешно добавлено\");\n } catch (error) {\n this.$message((error as any)?.response?.data, \"error\");\n }\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./id.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./id.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./id.vue?vue&type=template&id=75541138\"\nimport script from \"./id.vue?vue&type=script&lang=ts\"\nexport * from \"./id.vue?vue&type=script&lang=ts\"\nimport style0 from \"./id.vue?vue&type=style&index=0&id=75541138&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./id.vue?vue&type=style&index=0&id=75541138&prod&lang=scss\""],"sourceRoot":""}