PageSourceSearch

https://my.bod.ch/assets/js/MetadataProductGroup.31c987b6bd45192fbc46.chunk.js

js bod.ch collected 2026-10-02 15:01:40 UTC 19,380 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkDashboard=self.webpackChunkDashboard||[]).push([[5927],{66757:(t,e,i)=>{i.r(e),i.d(e,{default:()=>r});var n=i(46015),a=i(4267),o=i(76610);const c={name:"MetadataProductGroup",components:{AlertContainer:function(){return i.e(7561).then(i.bind(i,89451))},ModalContainer:function(){return i.e(1239).then(i.bind(i,20652))},LoadingWrapper:function(){return i.e(1028).then(i.bind(i,25094))},ProductGroupBreadcrumb:function(){return i.e(6040).then(i.bind(i,42503))},ProductGroupRecursiveSelection:function(){return i.e(8800).then(i.bind(i,46577))},ProductGroupSpecificationRecursiveSelection:function(){return i.e(3433).then(i.bind(i,1869))}},props:{data:{type:Object,required:!0},lockedService:{type:Boolean,default:!1},isProject:{type:Boolean,default:!1}},data:function(){return{view:"",maxProductGroups:3,maxSpecifications:3,productGroupsDefault:[{key:"B",name:this.$t("utilities.metadata.productGroup.mainSelection.item1"),type:"productGroup",level:0,finalSelected:!1},{key:"K",name:this.$t("utilities.metadata.productGroup.mainSelection.item2"),type:"productGroup",level:0,finalSelected:!1},{key:"S",name:this.$t("utilities.metadata.productGroup.mainSelection.item3"),type:"productGroup",level:0,finalSelected:!1},{key:"F",name:this.$t("utilities.metadata.productGroup.mainSelection.item4"),type:"productGroup",level:0,finalSelected:!1},{key:"R",name:this.$t("utilities.metadata.productGroup.mainSelection.item5"),type:"productGroup",level:0,finalSelected:!1}],productGroups:[[]],selectedProductGroups:[],specification:[],selectedSpecification:[],specificationIndex:0,finalSelection:[],finalSelectionSaved:!1,finalSelectionResponse:[],alert:{state:"",text:""},isSendLoading:!1,edit:!1}},computed:{productGroupOverviewData:function(){var t,e,i,n;return this.finalSelectionSaved?this.finalSelectionResponse:null!==(t=this.data)&&void 0!==t&&t.themaPreviousVersion?null===(n=this.data)||void 0===n?void 0:n.themaPreviousVersion:(null===(e=this.data)||void 0===e||null===(i=e.current)||void 0===i?void 0:i.productGroup)||{}},editable:function(){var t,e,i,n,a;return this.isProject?!((null===(n=this.data)||void 0===n||null===(a=n.themaPreviousVersion)||void 0===a?void 0:a.length)>0):null===(t=this.data)||void 0===t||null===(e=t.allowEdit)||void 0===e||null===(i=e.productGroup)||void 0===i?void 0:i.status},editMessage:function(){var t,e,i;return(null===(t=this.data)||void 0===t||null===(e=t.allowEdit)||void 0===e||null===(i=e.productGroup)||void 0===i?void 0:i.message)||null},isCancelBtnDisabled:function(){return!this.isProject||0!==this.finalSelection.length},validationErrors:function(){return this.finalSelection.map((function(t){return t.error})).includes(!0)},hasMaxProductGroups:function(){return!(this.finalSelection.length<this.maxProductGroups)}},mounted:function(){if(this.isProject){var t,e,i;if((null===(t=this.data)||void 0===t||null===(e=t.themaPreviousVersion)||void 0===e?void 0:e.length)>0)return;if(0===(null===(i=this.data)||void 0===i?void 0:i.themaItems.length))return void this.showEditView();this.setPrefillData()}this.editMessage&&(this.alert={state:"info",text:this.editMessage})},watch:{view:function(){this.setDefaultProductGroups()},"data.themaFromLastVersion":function(t){1!=t?this.showEditView():this.hideEditView()},finalSelection:{handler:function(){if(this.isProject){var t={};this.finalSelection.forEach((function(e,i){t[i]={thcoId:parseInt(e.lastItem.productGroupThcoId),mainsubject:e.mainsubject,pos:i+1,identifierItems:{}},e.lastItem.specificationThidIds.forEach((function(e,n){t[i].identifierItems[n]={thidId:parseInt(e)}}))})),this.$emit("input",t)}},deep:!0}},methods:{showEditView:function(){this.view="productGroup",this.edit=!0},hideEditView:function(){this.view="",this.resetProductGroupAndSpecificationData(!0),this.edit=!1},setDefaultProductGroups:function(){var t=this.productGroupsDefault.filter((function(t){return("R"!=t.key||!["dk","se","fi"].includes(n.$r))&&("S"!=t.key||!["fr"].includes(n.$r))}));this.productGroups=[t]},setPrefillData:function(){var t;this.edit=!0,this.setDefaultProductGroups(),this.finalSelection=null===(t=this.data)||void 0===t?void 0:t.themaLegacy},loadProductGroup:function(t){var e=this,i={cmd:"thema",mandantId:n.vv};0==t.level?i.bereich=t.key:i.code=t.code,o.hi.get("/v1/{mandantId}/thema",i).then((function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.data;if(200==i.status){n=(0,a.f9)(n).map((function(e){return e.type="productGroup",e.name=e.textMybod,e.level=t.level+1,e.parentId=0==t.level?0:t.thcoId,e.finalSelected=!1,delete e.textMybod,e}));var o=e.productGroups.length-1;t.level!=o&&e.productGroups.splice(t.level-o),e.productGroups.splice(t.level+1,1,n),e.selectedProductGroups[t.level]=t;o=e.selectedProductGroups.length-1;t.level!=o&&e.selectedProductGroups.splice(t.level-o)}})).catch((function(t){console.error(t)}))},saveFinalProductGroup:function(t){t.finalSelected=!0,this.selectedProductGroups[t.level]=t,this.selectedProductGroups.splice(t.level+1),this.finalSelection.push({error:!1,errorMsg:"",mainsubject:this.mainProductGroupSelected(),productGroups:this.selectedProductGroups,specification:[],lastItem:{productGroupThcoId:this.selectedProductGroups[this.selectedProductGroups.length-1].thcoId,specificationThidIds:[]}}),this.specificationIndex=this.finalSelection.length-1,this.updateParams(!1),this.loadSpecification(t)},mainProductGroupSelected:function(){return!this.finalSelection.map((function(t){return t.mainsubject})).includes(!0)},changeMainProductGroupSelection:function(t){this.finalSelection.map((function(t){return t.mainsubject=!1})),this.finalSelection[t].mainsubject=!0},loadSpecification:function(t){var e=this;this.view="specification";var i={mandantId:n.vv};"productGroup"==t.type?i.thco_id=t.thcoId:(i.thid_id=t.thidId,i.code=t.code,i.strSelectedQualifier=this.getSpecificationIds()),o.hi.get("/v1/{mandantId}/thema",i).then((function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.data;
1if(200==i.status){var o="specification"!=t.type?0:t.level+1,c="specification"!=t.type?0:t.thidId;n=(0,a.f9)(n).map((function(t){return t.type="specification",t.name=t.textMybod,t.level=o,t.parentId=c,t.finalSelected=!1,delete t.textMybod,t}));var r=e.specification.length;if(o!=r&&e.specification.splice(o-r),e.specification.splice(o,1,n),"specification"!=t.type)return;e.selectedSpecification[t.level]=t;r=e.selectedSpecification.length-1;t.level!=r&&e.selectedSpecification.splice(t.level-r)}})).catch((function(t){console.error(t)}))},loadAdditionalSpecification:function(t){var e=this.finalSelection[t].productGroups;this.specification=[],this.selectedSpecification=[],this.specificationIndex=t,this.loadSpecification(e[e.length-1])},cancelAdditionalSpecification:function(){this.view="",this.resetProductGroupAndSpecificationData(),this.checkProductGroupSpecificationErrors()},saveFinalSpecification:function(t){t.finalSelected=!0,this.selectedSpecification[t.level]=t,this.selectedSpecification.splice(t.level+1);var e=this.selectedSpecification[this.selectedSpecification.length-1].thidId;this.finalSelection[this.specificationIndex].specification.push(this.selectedSpecification),this.finalSelection[this.specificationIndex].lastItem.specificationThidIds.push(e),this.view="",this.resetProductGroupAndSpecificationData(),this.checkProductGroupSpecificationErrors()},getSpecificationIds:function(){return this.finalSelection.map((function(t){return t.lastItem.specificationThidIds})).filter((function(t){return t.length>0})).join(",")},checkProductGroupSpecificationErrors:function(){var t=this;this.finalSelection.forEach((function(e,i){var c={cmd:"check",mandantId:n.vv,thema:e.lastItem.productGroupThcoId,strSelectedThema:t.finalSelection.map((function(t){return t.lastItem.productGroupThcoId})).join(","),strSelectedMainSubjects:t.finalSelection.map((function(t){return t.mainsubject?"Y":"N"})).join(","),strSelectedQualifier:t.getSpecificationIds()};o.hi.get("/v1/{mandantId}/thema",c).then((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.data;if(200==e.status)if(n.error){var o=(0,a.fZ)(null==n?void 0:n.error_code);t.finalSelection[i].error=!0,t.finalSelection[i].errorMsg=t.$t("utilities.metadata.productGroup.errorCodes.".concat(o))}else t.finalSelection[i].error=!1,t.finalSelection[i].errorMsg=""})).catch((function(t){console.error(t)}))}))},deleteProductGroupAndSpecification:function(t){this.finalSelection.splice(t,1),this.mainProductGroupSelected()&&this.finalSelection.length>0&&(this.finalSelection[0].mainsubject=!0),this.checkProductGroupSpecificationErrors(),0==this.finalSelection.length&&(this.view="productGroup",this.updateParams(!0))},deleteSpecification:function(t,e,i){this.finalSelection[t].specification.splice(e,1);var n=this.finalSelection[t].lastItem.specificationThidIds.filter((function(t){return t!==i}));this.finalSelection[t].lastItem.specificationThidIds=n,this.checkProductGroupSpecificationErrors()},saveFinalProductGroupAndSpecification:function(){var t=this;this.isSendLoading=!0;var e={id:this.data.id},i={version:this.data.version,thema:{themaItems:{}}};this.finalSelection.forEach((function(t,e){i.thema.themaItems[e]={thcoId:parseInt(t.lastItem.productGroupThcoId),mainsubject:t.mainsubject,pos:e+1,identifierItems:{}},t.lastItem.specificationThidIds.forEach((function(t,n){i.thema.themaItems[e].identifierItems[n]={thidId:parseInt(t)}}))})),o.hi.post("/v1/me/books/{id}/metadata",i,e).then((function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.data;t.alert={state:"success",text:i.message},t.reloadProductGroup()})).catch((function(t){arguments.length>1&&void 0!==arguments[1]||t.response;console.error(t)})).finally((function(){t.isSendLoading=!1}))},reloadProductGroup:function(){var t=this,e={id:this.data.id};o.hi.get("/v1/me/books/{id}/metadata",e).then((function(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.data.data||null;n&&(t.finalSelectionSaved=!0,t.finalSelectionResponse=null==n||null===(i=n.current)||void 0===i?void 0:i.productGroup,t.updateParams(!0),t.hideEditView())})).catch((function(t){console.error(t)}))},resetProductGroupSelection:function(){this.finalSelection.length>0?(this.productGroups=[this.productGroups[0]],this.selectedProductGroups=[],this.view=""):this.hideEditView()},resetProductGroupAndSpecificationData:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.productGroups=[this.productGroups[0]],this.selectedProductGroups=[],this.specification=[],this.selectedSpecification=[],this.specificationIndex=0,t&&(this.finalSelection=[],this.updateParams(!0))},updateParams:function(t){this.$emit("input",t)}}};const r=(0,i(51900).Z)(c,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"metadata-product-group"},[t.edit?[i("product-group-breadcrumb",{attrs:{view:"edit",data:{finalSelection:t.finalSelection,maxSpecifications:t.maxSpecifications}},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n                "+t._s(t.$t("utilities.metadata.productGroup.editviewSelectedProductGroupSpecificationTitle"))+"\n            ")]},proxy:!0},{key:"mainProductGroup",fn:function(e){var n=e.mainProductGroup,a=e.index;return[n?t._e():i("span",{staticClass:"d-block"},[i("a",{staticClass:"text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.changeMainProductGroupSelection(a)}}},[t._v("\n                        "+t._s(t.$t("utilities.metadata.productGroup.btnMainProductGroup"))+"\n                    ")])])]}},{key:"deleteSpecification",fn:function(e){var n=e.index,a=e.sIndex,o=e.thidId;return[i("small",{staticClass:"d-block mt-2"},[i("a",{staticClass:"text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.deleteSpecification(n,a,o)}}},[i("i",{staticClass:"fa-regular fa-trash-can me-2"}),t._v(t._s(t.$t("utilities.metadata.btnDelete"))+"\n                    ")])])]}},{key:"alert",fn:function(t){var e=t.errorMsg;return[i("alert-container",{staticClass:"mt-3",attrs:{data:{state:"error",text:e},layoutType:2}})]}},{key:"specificationSelection",fn:function(e){var n=e.index,a=e.hasMaxSpecifications;return["specification"==t.view&&t.specificationIndex==n?[i("p",{staticClass:"fw-bolder mt-5"},[t._v("\n                        "+t._s(t.$t("utilities.metadata.productGroup.specificationSelectionTitle"))+"\n                    ")]),t._v(" "),i("loading-wrapper",{attrs:{loading:!t.specification[0]}},[i("div",{staticClass:"rounded bg-white py-3 px-4"},[i("product-group-specification-recursive-selection",{attrs:{specification:t.specification,selectedSpecification:t.selectedSpecification,finalSelection:t.finalSelection,depth:0,parentId:0},on:{loadSpecification:t.loadSpecification,saveFinalSpecification:t.saveFinalSpecification}}),t._v(" "),i("button",{staticClass:"btn btn-sm btn-outline-dark rounded-pill px-4 mt-4",on:{click:function(e){return e.preventDefault(),t.cancelAdditionalSpecification(e)}}},[t._v("\n                                "+t._s(t.$t("utilities.metadata.productGroup.btnCancelAdditionalSpecification"))+"\n                            ")])],1)])]:[i("div",{staticClass:"d-flex flex-column flex-md-row justify-content-between align-items-center mt-5"},[a?[i("p",{staticClass:"m-0"},[i("i",{staticClass:"fa-regular fa-info-circle"}),t._v(" "+t._s(t.$t("utilities.metadata.productGroup.maxSpecifications"))+"\n                            ")])]:[i("button",{staticClass:"btn btn-sm btn-outline-dark rounded-pill px-4",on:{click:function(e){return e.preventDefault(),t.loadAdditionalSpecification(n)}}},[t._v("\n                                "+t._s(t.$t("utilities.metadata.productGroup.btnAddSpecification"))+"\n                            ")])],t._v(" "),i("a",{staticClass:"text-dark mt-4 mt-md-0",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.deleteProductGroupAndSpecification(n)}}},[i("i",{staticClass:"fa-regular fa-trash-can me-2"}),t._v(t._s(t.$t("utilities.metadata.productGroup.btnDeleteProductGroup"))+"\n                        ")])],2)]]}}],null,!1,3277798271)}),t._v(" "),"productGroup"==t.view?[i("p",{staticClass:"fw-bolder mt-5"},[t._v("\n                "+t._s(t.$t("utilities.metadata.productGroup.editviewProductGroupTitle"))+"\n            ")]),t._v(" "),i("div",{staticClass:"card bg-bodgrey-light border-bodgrey-light mb-3"},[i("div",{staticClass:"card-body"},[i("product-group-recursive-selection",{attrs:{productGroups:t.productGroups,selectedProductGroups:t.selectedProductGroups,finalSelection:t.finalSelection,depth:0,parentId:0},on:{loadProductGroup:t.loadProductGroup,saveFinalProductGroup:t.saveFinalProductGroup}}
1),t._v(" "),t.isCancelBtnDisabled?i("button",{staticClass:"btn btn-sm btn-outline-dark rounded-pill px-4 mt-4",on:{click:function(e){return e.preventDefault(),t.resetProductGroupSelection(e)}}},[t._v("\n                        "+t._s(t.$t("utilities.metadata.btnCancel"))+"\n                    ")]):t._e()],1)])]:t._e(),t._v(" "),""==t.view?i("div",{staticClass:"row"},[i("div",{staticClass:"col-24 col-md-12 col-xl-8"},[t.hasMaxProductGroups?[i("p",{staticClass:"m-0"},[i("i",{staticClass:"fa-regular fa-info-circle"}),t._v(" "+t._s(t.$t("utilities.metadata.productGroup.maxProductGroups"))+"\n                    ")])]:[i("button",{staticClass:"btn btn-dark rounded-pill px-4 w-100",on:{click:function(e){e.preventDefault(),t.view="productGroup"}}},[t._v("\n                        "+t._s(t.$t("utilities.metadata.productGroup.btnAddProductGroup"))+"\n                    ")])]],2),t._v(" "),t.isProject?t._e():i("div",{staticClass:"col-24 col-md-12 col-xl-16 mt-4 mt-md-0"},[i("div",{staticClass:"d-flex justify-content-between justify-content-md-end align-items-center"},[i("button",{staticClass:"btn btn-outline-dark rounded-pill px-4 me-4",attrs:{"data-bs-toggle":"modal","data-bs-target":"#modalContainerCancel",disabled:t.isSendLoading}},[t._v("\n                        "+t._s(t.$t("utilities.metadata.btnCancel"))+"\n                    ")]),t._v(" "),i("button",{staticClass:"btn btn-bodorange rounded-pill px-4",attrs:{"data-bs-toggle":"modal","data-bs-target":"#modalContainerSave",disabled:t.isSendLoading||t.validationErrors}}
1,[t.isSendLoading?[i("i",{staticClass:"fa-duotone fa-spinner-third fa-spin"}),t._v("\n                            "+t._s(t.$t("general.loading"))+"\n                        ")]:[t._v(t._s(t.$t("utilities.metadata.btnSave")))]],2)])])]):t._e()]:[i("product-group-breadcrumb",{attrs:{view:"overview",data:t.productGroupOverviewData},scopedSlots:t._u([{key:"title",fn:function(){return[t.data.themaFromLastVersion?[t._v("\n                    "+t._s(t.$t("utilities.metadata.productGroup.overviewPreviousVersionTitle"))+"\n                ")]:[t._v("\n                    "+t._s(t.$t("utilities.metadata.productGroup.overviewTitle"))+"\n                ")]]},proxy:!0}])}),t._v(" "),t.lockedService?[i("alert-container",{attrs:{data:{state:"info",text:this.$t("publishedbooksmetadata.services.lockedServiceNote")},layoutType:2}})]:[t.alert.state?i("alert-container",{attrs:{data:t.alert,layoutType:2}}):t._e(),t._v(" "),t.editable&&!t.finalSelectionSaved?[i("button",{staticClass:"btn btn-dark rounded-pill px-4",on:{click:function(e){return e.preventDefault(),t.showEditView(e)}}},[t._v("\n                    "+t._s(t.$t("utilities.metadata.btnEdit"))+"\n                ")])]:t._e()]],t._v(" "),i("modal-container",{attrs:{name:"modalContainerSave"},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n            "+t._s(t.$t("utilities.metadata.productGroup.modal.productGroupSaveTitle"))+"\n        ")]},proxy:!0},{key:"footer",fn:function(){return[i("button",{staticClass:"btn btn-bodorange rounded-pill px-4",attrs:{type:"button","data-bs-dismiss":"modal"},on:{click:function(e){return e.preventDefault(),t.saveFinalProductGroupAndSpecification(e)}}},[t._v("\n                "+t._s(t.$t("utilities.metadata.btnSave"))+"\n            ")]),t._v(" "),i("button",{staticClass:"btn btn-outline-dark rounded-pill px-4 mt-4 mt-md-0 ms-0 ms-md-4",attrs:{type:"button","data-bs-dismiss":"modal"}},[t._v("\n                "+t._s(t.$t("general.modal.cancel"))+"\n            ")])]},proxy:!0}])},[t._v(" "),i("p",{staticClass:"lead"},[t._v("\n            "+t._s(t.$t("utilities.metadata.productGroup.modal.productGroupSaveText"))+"\n        ")])]),t._v(" "),i("modal-container",{attrs:{name:"modalContainerCancel"},scopedSlots:t._u([{key:"title",fn:function(){return[t._v("\n            "+t._s(t.$t("utilities.metadata.productGroup.modal.productGroupCancelTitle"))+"\n        ")]},proxy:!0},{key:"footer",fn:function(){return[i("button",{staticClass:"btn btn-bodorange rounded-pill px-4",attrs:{type:"button","data-bs-dismiss":"modal"},on:{click:function(e){return e.preventDefault(),t.hideEditView(e)}}},[t._v("\n                "+t._s(t.$t("utilities.metadata.productGroup.modal.btnCancel"))+"\n            ")]),t._v(" "),i("button",{staticClass:"btn btn-outline-dark rounded-pill px-4 mt-4 mt-md-0 ms-0 ms-md-4",attrs:{type:"button","data-bs-dismiss":"modal"}},[t._v("\n                "+t._s(t.$t("utilities.metadata.productGroup.modal.btnNoCancel"))+"\n            ")])]},proxy:!0}])},[t._v(" "),i("p",{staticClass:"lead"},[t._v("\n            "+t._s(t.$t("utilities.metadata.productGroup.modal.productGroupCancelText"))+"\n        ")])])],2)}),[],!1,null,null,null).exports}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.