1 line
25 KiB
JavaScript
1 line
25 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["hr-kpi-KPIViewController"],{5160:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"KPIViewController\": () => (/* binding */ KPIViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass KPIViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#kpi_view_container',\n\n\n\n\t\t\ttype_array: null,\n\t\t\tstatus_array: null,\n\n\t\t\tkpi_group_array: null,\n\t\t\tkpi_group_api: null,\n\n\t\t\tsub_document_view_controller: null,\n\n\t\t\tdocument_object_type_id: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'KPIEditView.html';\n\t\tthis.permission_id = 'kpi';\n\t\tthis.viewId = 'KPI';\n\t\tthis.script_name = 'KPIView';\n\t\tthis.table_name_key = 'kpi';\n\t\tthis.context_menu_name = $.i18n._( 'KPI' );\n\t\tthis.navigation_label = $.i18n._( 'KPI' );\n\t\tthis.api = TTAPI.APIKPI;\n\t\tthis.kpi_group_api = TTAPI.APIKPIGroup;\n\n\t\tthis.document_object_type_id = 210;\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'type' );\n\t\tthis.initDropDownOption( 'status' );\n\n\t\tthis.kpi_group_api.getKPIGroup( '', false, false, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = Global.clone( res.getResult() );\n\t\t\t\tvar all = {};\n\t\t\t\tall.name = '-- ' + $.i18n._( 'All' ) + ' --';\n\t\t\t\tall.level = 1;\n\t\t\t\tall.id = TTUUID.not_exist_id;\n\n\t\t\t\tif ( res.hasOwnProperty( '0' ) && res[0].hasOwnProperty( 'children' ) ) {\n\t\t\t\t\tres[0].children.unshift( all );\n\t\t\t\t} else {\n\t\t\t\t\tres = [\n\t\t\t\t\t\t{ children: [all], id: 0, level: 0, name: 'Root' }\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\tres = Global.buildTreeRecord( res );\n\t\t\t\t$this.kpi_group_array = res;\n\t\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['group_id'] ) {\n\t\t\t\t\t$this.basic_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t}\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_key_performance_indicator': { 'label': $.i18n._( 'Key Performance Indicator' ) },\n\t\t\t'tab_attachment': true,\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIKPI,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_kpi',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_key_performance_indicator = this.edit_view_tab.find( '#tab_key_performance_indicator' );\n\n\t\tvar tab_key_performance_indicator_column1 = tab_key_performance_indicator.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_key_performance_indicator_column1 );\n\n\t\t//Type\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'type_id' } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_key_performance_indicator_column1, '' );\n\n\t\t//Status\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_key_performance_indicator_column1 );\n\n\t\t//Name\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TT
|