From 72fb0b774db217e9fc0eebb27d06163744b1bacf Mon Sep 17 00:00:00 2001 From: ibizdev <ibizdev@ibizsys.net> Date: Thu, 19 Nov 2020 18:52:11 +0800 Subject: [PATCH] =?UTF-8?q?=20Mosher=20=E5=8F=91=E5=B8=83=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BB=A3=E7=A0=81=20[=E5=90=8E=E5=8F=B0=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E6=BC=94=E7=A4=BA=E5=BA=94=E7=94=A8]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_Web/src/locale/lang/en-US.ts | 1 + app_Web/src/locale/lang/zh-CN.ts | 1 + .../entities/ibizbook/ibizbook_en_US.ts | 10 +- .../entities/ibizbook/ibizbook_zh_CN.ts | 10 +- .../main-menu-appmenu/main-menu-appmenu.ts | 18 + ...izbooknew-default-value-grid-view-base.vue | 1 + .../ibizbookupdate-default-grid-view-base.vue | 984 +++++++ .../ibizbookupdate-default-grid-view.less | 19 + .../ibizbookupdate-default-grid-view.vue | 24 + .../src/pages/sample/index/page-register.ts | 3 +- app_Web/src/pages/sample/index/router.ts | 47 +- .../src/store/modules/view-action/state.ts | 11 + .../main-menu-appmenu-base.vue | 26 + .../main-menu-appmenu-model.ts | 19 + .../new-default-grid-base.vue | 9 + .../update-default-grid-base.vue | 2268 +++++++++++++++++ .../update-default-grid-model.ts | 131 + .../update-default-grid-service.ts | 494 ++++ .../update-default-grid.less | 176 ++ .../update-default-grid.vue | 14 + .../resources/permission/systemResource.json | 2 +- 21 files changed, 4246 insertions(+), 22 deletions(-) create mode 100644 app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view-base.vue create mode 100644 app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.less create mode 100644 app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue create mode 100644 app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-base.vue create mode 100644 app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-model.ts create mode 100644 app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-service.ts create mode 100644 app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.less create mode 100644 app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.vue diff --git a/app_Web/src/locale/lang/en-US.ts b/app_Web/src/locale/lang/en-US.ts index 6a2b596da..60e97d8d8 100644 --- a/app_Web/src/locale/lang/en-US.ts +++ b/app_Web/src/locale/lang/en-US.ts @@ -189,6 +189,7 @@ export default { menuitem73: "琛ㄦ牸鍐呯疆鍔熻兘", menuitem74: "琛岀紪杈�", menuitem75: "鏂板缓榛樿鍊�", + menuitem76: "鏇存柊榛樿鍊�", menuitem14: "鏍戣鍥�", menuitem60: "闈欐€佽妭鐐�", menuitem61: "鍔ㄦ€佽妭鐐癸紙浠g爜琛級", diff --git a/app_Web/src/locale/lang/zh-CN.ts b/app_Web/src/locale/lang/zh-CN.ts index 1285d58ef..fec317c31 100644 --- a/app_Web/src/locale/lang/zh-CN.ts +++ b/app_Web/src/locale/lang/zh-CN.ts @@ -189,6 +189,7 @@ export default { menuitem73: "琛ㄦ牸鍐呯疆鍔熻兘", menuitem74: "琛岀紪杈�", menuitem75: "鏂板缓榛樿鍊�", + menuitem76: "鏇存柊榛樿鍊�", menuitem14: "鏍戣鍥�", menuitem60: "闈欐€佽妭鐐�", menuitem61: "鍔ㄦ€佽妭鐐癸紙浠g爜琛級", diff --git a/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_en_US.ts b/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_en_US.ts index a48e0a5a8..17a3368ac 100644 --- a/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_en_US.ts +++ b/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_en_US.ts @@ -83,26 +83,26 @@ export default { uiactions: { }, }, - internalfunc_grid: { + updatedefault_grid: { columns: { ibizbookname: "鍥句功鍚嶇О", author: "鍥句功浣滆€�", type: "鍥句功绫诲瀷", press: "鍥句功鍑虹増绀�", price: "鍥句功浠锋牸", + updatedate: "鏇存柊鏃堕棿", }, nodata:"", uiactions: { }, }, - updatedefault_grid: { + internalfunc_grid: { columns: { ibizbookname: "鍥句功鍚嶇О", author: "鍥句功浣滆€�", type: "鍥句功绫诲瀷", press: "鍥句功鍑虹増绀�", price: "鍥句功浠锋牸", - updatedate: "鏇存柊鏃堕棿", }, nodata:"", uiactions: { @@ -249,6 +249,8 @@ export default { tip: "鏁版嵁瀵煎叆", }, }, + updatedefaultgridviewtoolbar_toolbar: { + }, internalfuncgridviewtoolbar_toolbar: { tbitem3: { caption: "New", @@ -299,6 +301,4 @@ export default { tip: "鏁版嵁瀵煎叆", }, }, - updatedefaultgridviewtoolbar_toolbar: { - }, }; \ No newline at end of file diff --git a/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_zh_CN.ts b/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_zh_CN.ts index ab1d6c5fa..a51e4e552 100644 --- a/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_zh_CN.ts +++ b/app_Web/src/locale/lanres/entities/ibizbook/ibizbook_zh_CN.ts @@ -82,26 +82,26 @@ export default { uiactions: { }, }, - internalfunc_grid: { + updatedefault_grid: { columns: { ibizbookname: "鍥句功鍚嶇О", author: "鍥句功浣滆€�", type: "鍥句功绫诲瀷", press: "鍥句功鍑虹増绀�", price: "鍥句功浠锋牸", + updatedate: "鏇存柊鏃堕棿", }, nodata:"", uiactions: { }, }, - updatedefault_grid: { + internalfunc_grid: { columns: { ibizbookname: "鍥句功鍚嶇О", author: "鍥句功浣滆€�", type: "鍥句功绫诲瀷", press: "鍥句功鍑虹増绀�", price: "鍥句功浠锋牸", - updatedate: "鏇存柊鏃堕棿", }, nodata:"", uiactions: { @@ -248,6 +248,8 @@ export default { tip: "鏁版嵁瀵煎叆", }, }, + updatedefaultgridviewtoolbar_toolbar: { + }, internalfuncgridviewtoolbar_toolbar: { tbitem3: { caption: "鏂板缓", @@ -298,6 +300,4 @@ export default { tip: "鏁版嵁瀵煎叆", }, }, - updatedefaultgridviewtoolbar_toolbar: { - }, }; \ No newline at end of file diff --git a/app_Web/src/mock/app/main-menu-appmenu/main-menu-appmenu.ts b/app_Web/src/mock/app/main-menu-appmenu/main-menu-appmenu.ts index 1218275e7..7600823d2 100644 --- a/app_Web/src/mock/app/main-menu-appmenu/main-menu-appmenu.ts +++ b/app_Web/src/mock/app/main-menu-appmenu/main-menu-appmenu.ts @@ -481,6 +481,24 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => { textcls: '', appfunctag: 'AppFunc4', resourcetag: '', +}, + { + id: 'E25B1356-D910-4E5E-A3AC-505517F1DD30', + name: 'menuitem76', + text: '鏇存柊榛樿鍊�', + type: 'MENUITEM', + counterid: '', + tooltip: '鏇存柊榛樿鍊�', + expanded: false, + separator: false, + hidden: false, + hidesidebar: false, + opendefault: false, + iconcls: '', + icon: '', + textcls: '', + appfunctag: 'AppFunc5', + resourcetag: '', }, ], }, diff --git a/app_Web/src/pages/sample/ibizbooknew-default-value-grid-view/ibizbooknew-default-value-grid-view-base.vue b/app_Web/src/pages/sample/ibizbooknew-default-value-grid-view/ibizbooknew-default-value-grid-view-base.vue index 36db7b570..087473958 100644 --- a/app_Web/src/pages/sample/ibizbooknew-default-value-grid-view/ibizbooknew-default-value-grid-view-base.vue +++ b/app_Web/src/pages/sample/ibizbooknew-default-value-grid-view/ibizbooknew-default-value-grid-view-base.vue @@ -240,6 +240,7 @@ export default class IBIZBOOKNewDefaultValueGridViewBase extends Vue { * @memberof IBIZBOOKNewDefaultValueGridViewBase */ public customViewNavContexts:any ={ + "BOOKTYPE":{"isRawValue":true,"value":"鏂板缓榛樿鍊硷細涓婁笅鏂�"} }; /** diff --git a/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view-base.vue b/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view-base.vue new file mode 100644 index 000000000..975317272 --- /dev/null +++ b/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view-base.vue @@ -0,0 +1,984 @@ +<template> +<div class='view-container degridview ibizbookupdate-default-grid-view'> + <app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizbookupdatedefaultgridview"></app-studioaction> + <card class='view-card ' :dis-hover="true" :bordered="false"> + <div slot='title' class="header-container"> + <span class='caption-info'>{{$t(model.srfCaption)}}</span> + </div> + <div class='view-top-messages'> + </div> + <div class='content-container'> + <div style='margin-bottom: 6px;'> + <i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;' placeholder="鍥句功鍚嶇О" /> + <div class='pull-right'> + <div class='toolbar-container'> + </div> + </div> + </div> + <view_searchform + :viewState="viewState" + :viewparams="viewparams" + :context="context" + :showBusyIndicator="true" + v-show="isExpandSearchForm" + loaddraftAction="FilterGetDraft" + loadAction="FilterGet" + + name="searchform" + ref='searchform' + @save="searchform_save($event)" + @search="searchform_search($event)" + @load="searchform_load($event)" + @closeview="closeView($event)"> + </view_searchform> + <div class='view-body-messages'> + </div> + <view_grid + :viewState="viewState" + :viewparams="viewparams" + :context="context" + :isSingleSelect="isSingleSelect" + :showBusyIndicator="true" + :isOpenEdit="false" + :gridRowActiveMode="gridRowActiveMode" + :isformDruipart="isformDruipart" + @save="onSave" + updateAction="" + removeAction="Remove" + loaddraftAction="" + loadAction="" + createAction="" + fetchAction="FetchDefault" + :newdata="newdata" + :opendata="opendata" + name="grid" + ref='grid' + @selectionchange="grid_selectionchange($event)" + @beforeload="grid_beforeload($event)" + @rowdblclick="grid_rowdblclick($event)" + @remove="grid_remove($event)" + @load="grid_load($event)" + @closeview="closeView($event)"> + </view_grid> + </div> + <div class='view-bottom-messages'> + </div> + </card> +</div> +</template> + + +<script lang='tsx'> +import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator'; +import { UIActionTool,Util } from '@/utils'; +import NavDataService from '@/service/app/navdata-service'; +import { Subject,Subscription } from 'rxjs'; +import IBIZBOOKService from '@/service/ibizbook/ibizbook-service'; +import IBIZBOOKAuthService from '@/authservice/ibizbook/ibizbook-auth-service'; + +import GridViewEngine from '@engine/view/grid-view-engine'; + + +import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service'; +import CodeListService from "@/codelist/codelist-service"; + + +@Component({ + components: { + }, +}) +export default class IBIZBOOKUpdateDefaultGridViewBase extends Vue { + + /** + * 瀹炰綋鏈嶅姟瀵硅薄 + * + * @type {IBIZBOOKService} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public appEntityService: IBIZBOOKService = new IBIZBOOKService; + + /** + * 瀹炰綋UI鏈嶅姟瀵硅薄 + * + * @type IBIZBOOKUIService + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public appUIService: IBIZBOOKUIService = new IBIZBOOKUIService(this.$store); + + /** + * 鏁版嵁鍙樺寲 + * + * @param {*} val + * @returns {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Emit() + public viewDatasChange(val: any):any { + return val; + } + + /** + * 浼犲叆瑙嗗浘涓婁笅鏂� + * + * @type {string} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Prop() public viewdata!: string; + + /** + * 浼犲叆瑙嗗浘鍙傛暟 + * + * @type {string} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Prop() public viewparam!: string; + + /** + * 瑙嗗浘榛樿浣跨敤 + * + * @type {boolean} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Prop({ default: true }) public viewDefaultUsage!: boolean; + + /** + * 瑙嗗浘榛樿浣跨敤 + * + * @type {string} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Inject({from:'navModel',default: 'tab'}) + public navModel!:string; + + /** + * 瑙嗗浘鏍囪瘑 + * + * @type {string} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public viewtag: string = 'e53fed4d0b4dd614057f426b02115b41'; + + /** + * 鑷畾涔夎鍥惧鑸笂涓嬫枃闆嗗悎 + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public customViewNavContexts:any ={ + "BOOKTYPE":{"isRawValue":true,"value":"涓婁笅鏂囷細绫诲瀷"} + }; + + /** + * 鑷畾涔夎鍥惧鑸弬鏁伴泦鍚� + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public customViewParams:any ={ + }; + + /** + * 瑙嗗浘妯″瀷鏁版嵁 + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public model: any = { + srfCaption: 'entities.ibizbook.views.updatedefaultgridview.caption', + srfTitle: 'entities.ibizbook.views.updatedefaultgridview.title', + srfSubTitle: 'entities.ibizbook.views.updatedefaultgridview.subtitle', + dataInfo: '' + } + + /** + * 瑙嗗浘鍙傛暟鍙樺寲 + * + * @param {*} newVal + * @param {*} oldVal + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Watch('viewparam',{immediate: true, deep: true}) + onParamData(newVal: any, oldVal: any) { + if(newVal){ + this.viewparams = {}; + if(typeof newVal == 'string') { + Object.assign(this.viewparams, JSON.parse(this.viewparam)); + }else{ + this.viewparams = Util.deepCopy(this.viewparam); + } + + } + } + + /** + * 澶勭悊搴旂敤涓婁笅鏂囧彉鍖� + * + * @param {*} newVal + * @param {*} oldVal + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Watch('viewdata') + onViewData(newVal: any, oldVal: any) { + const _this: any = this; + + if (!Object.is(newVal, oldVal) && _this.engine) { + this.$nextTick(()=>{ + _this.parseViewParam(); + _this.engine.load(); + }); + } else if(!Object.is(newVal, oldVal) && _this.refresh && _this.refresh instanceof Function) { + _this.refresh(); + } + } + + /** + * 瀹瑰櫒妯″瀷 + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public containerModel: any = { + view_toolbar: { name: 'toolbar', type: 'TOOLBAR' }, + view_grid: { name: 'grid', type: 'GRID' }, + view_searchform: { name: 'searchform', type: 'SEARCHFORM' }, + }; + + /** + * 瑙嗗浘鍒锋柊 + * + * @param {*} args + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public refresh(args?: any): void { + const refs: any = this.$refs; + if (refs && refs.grid) { + refs.grid.refresh(); + } + } + /** + * 璁℃暟鍣ㄥ埛鏂� + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public counterRefresh(){ + const _this:any =this; + if(_this.counterServiceArray && _this.counterServiceArray.length >0){ + _this.counterServiceArray.forEach((item:any) =>{ + if(item.refreshData && item.refreshData instanceof Function){ + item.refreshData(); + } + }) + } + } + + /** + * 瑙嗗浘鐘舵€佽闃呭璞� + * + * @public + * @type {Subject<{action: string, data: any}>} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public viewState: Subject<ViewState> = new Subject(); + /** + * 宸ュ叿鏍忔ā鍨� + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridView + */ + public toolBarModels: any = { + }; + + + + + + /** + * 瑙嗗浘寮曟搸 + * + * @public + * @type {Engine} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public engine: GridViewEngine = new GridViewEngine(); + + /** + * 寮曟搸鍒濆鍖� + * + * @public + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public engineInit(): void { + this.engine.init({ + view: this, + opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => { + this.opendata(args,fullargs, params, $event, xData); + }, + newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => { + this.newdata(args,fullargs, params, $event, xData); + }, + grid: this.$refs.grid, + searchform: this.$refs.searchform, + keyPSDEField: 'ibizbook', + majorPSDEField: 'ibizbookname', + isLoadDefault: true, + }); + } + + /** + * 搴旂敤瀵艰埅鏈嶅姟 + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public navDataService = NavDataService.getInstance(this.$store); + + /** + * 瀵艰埅鏈嶅姟浜嬩欢 + * + * @public + * @type {(Subscription | undefined)} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public serviceStateEvent: Subscription | undefined; + + /** + * 闂ㄦ埛閮ㄤ欢鐘舵€佸璞� + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Prop() public portletState?: any; + + /** + * 闂ㄦ埛閮ㄤ欢鐘舵€佷簨浠� + * + * @public + * @type {(Subscription | undefined)} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public portletStateEvent: Subscription | undefined; + + /** + * 搴旂敤涓婁笅鏂� + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public context:any = {}; + + /** + * 瑙嗗浘鍙傛暟 + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public viewparams:any = {}; + + /** + * 瑙嗗浘缂撳瓨鏁版嵁 + * + * @type {*} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public viewCacheData:any; + + + /** + * 璁℃暟鍣ㄦ湇鍔″璞¢泦鍚� + * + * @type {Array<*>} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public counterServiceArray:Array<any> = []; + + /** + * 瑙f瀽瑙嗗浘鍙傛暟 + * + * @public + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public parseViewParam(inputvalue:any = null): void { + for(let key in this.context){ + delete this.context[key]; + } + if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){ + Object.assign(this.context,this.$store.getters.getAppData().context); + } + if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) { + if(typeof this.viewdata == 'string') { + Object.assign(this.context, JSON.parse(this.viewdata)); + } + if(this.context && this.context.srfparentdename){ + Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename}); + } + if(this.context && this.context.srfparentkey){ + Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey}); + } + this.handleCustomViewData(); + return; + } + const path = (this.$route.matched[this.$route.matched.length - 1]).path; + const keys: Array<any> = []; + const curReg = this.$pathToRegExp.pathToRegexp(path, keys); + const matchArray = curReg.exec(this.$route.path); + let tempValue: Object = {}; + keys.forEach((item: any, index: number) => { + Object.defineProperty(tempValue, item.name, { + enumerable: true, + value: matchArray[index + 1] + }); + }); + this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams); + if(inputvalue){ + Object.assign(this.context,{'ibizbook':inputvalue}); + } + //鍒濆鍖栬鍥惧敮涓€鏍囪瘑 + Object.assign(this.context,{srfsessionid:this.$util.createUUID()}); + this.handleCustomViewData(); + //鍒濆鍖栧鑸暟鎹� + this.initNavDataWithRoute(); + } + + /** + * 澶勭悊鑷畾涔夎鍥炬暟鎹� + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public handleCustomViewData(){ + if(Object.keys(this.customViewNavContexts).length > 0){ + Object.keys(this.customViewNavContexts).forEach((item:any) =>{ + let tempContext:any = {}; + let curNavContext:any = this.customViewNavContexts[item]; + this.handleCustomDataLogic(curNavContext,tempContext,item); + Object.assign(this.context,tempContext); + }) + } + if(Object.keys(this.customViewParams).length > 0){ + Object.keys(this.customViewParams).forEach((item:any) =>{ + let tempParam:any = {}; + let curNavParam:any = this.customViewParams[item]; + this.handleCustomDataLogic(curNavParam,tempParam,item); + Object.assign(this.viewparams,tempParam); + }) + } + } + + /** + * 澶勭悊鑷畾涔夎鍥炬暟鎹€昏緫 + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public handleCustomDataLogic(curNavData:any,tempData:any,item:string){ + // 鐩存帴鍊肩洿鎺ヨ祴鍊� + if(curNavData.isRawValue){ + if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){ + Object.defineProperty(tempData, item.toLowerCase(), { + value: null, + writable : true, + enumerable : true, + configurable : true + }); + }else{ + Object.defineProperty(tempData, item.toLowerCase(), { + value: curNavData.value, + writable : true, + enumerable : true, + configurable : true + }); + } + }else{ + // 鍏堜粠瀵艰埅涓婁笅鏂囧彇鏁帮紝娌℃湁鍐嶄粠瀵艰埅鍙傛暟锛圲RL锛夊彇鏁帮紝濡傛灉瀵艰埅涓婁笅鏂囧拰瀵艰埅鍙傛暟閮芥病鏈夊垯涓簄ull + if(this.context[(curNavData.value).toLowerCase()] != null){ + Object.defineProperty(tempData, item.toLowerCase(), { + value: this.context[(curNavData.value).toLowerCase()], + writable : true, + enumerable : true, + configurable : true + }); + }else{ + if(this.viewparams[(curNavData.value).toLowerCase()] != null){ + Object.defineProperty(tempData, item.toLowerCase(), { + value: this.viewparams[(curNavData.value).toLowerCase()], + writable : true, + enumerable : true, + configurable : true + }); + }else{ + Object.defineProperty(tempData, item.toLowerCase(), { + value: null, + writable : true, + enumerable : true, + configurable : true + }); + } + } + } + } + + /** + * 鍒濆鍖栧鑸暟鎹�(璺敱妯″紡) + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){ + if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){ + this.navDataService.addNavData({id:'ibizbookupdate-default-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizbook,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath}); + } + } + + /** + * 鍒濆鍖栧鑸暟鎹�(鍒嗛〉妯″紡) + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){ + if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){ + this.navDataService.addNavDataByOnly({id:'ibizbookupdate-default-grid-view',tag:this.viewtag,srfkey:this.context.ibizbook,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd); + } + } + + + /** + * Vue澹版槑鍛ㄦ湡 + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public created() { + this.afterCreated(); + } + + /** + * 鎵цcreated鍚庣殑閫昏緫 + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public afterCreated(){ + let _this:any = this; + const secondtag = _this.$util.createUUID(); + _this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag }); + _this.viewtag = secondtag; + _this.parseViewParam(); + _this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => { + if(!Object.is(name,'ibizbookupdate-default-grid-view')){ + return; + } + if (Object.is(action, 'viewrefresh')) { + _this.$nextTick(()=>{ + _this.parseViewParam(data); + if(_this.engine){ + _this.engine.load(); + } + }); + } + }); + if(_this.portletState){ + _this.portletStateEvent = _this.portletState.subscribe((res:any) =>{ + if(!Object.is(res.name,'IBIZBOOKUpdateDefaultGridView')){ + return; + } + if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){ + _this.refresh(); + } + }) + } + if(this.formDruipart){ + this.formDruipart.subscribe((res:any) =>{ + if(Object.is(res.action,'save')){ + this.viewState.next({ tag:'grid', action: 'save', data: this.viewparams }); + } + if(Object.is(res.action,'load')){ + const _this: any = this; + _this.engine.load(res.data,true); + } + }); + } + + } + + /** + * 閿€姣佷箣鍓� + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public beforeDestroy() { + this.$store.commit('viewaction/removeView', this.viewtag); + } + + /** + * Vue澹版槑鍛ㄦ湡(缁勪欢鍒濆鍖栧畬姣�) + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public mounted() { + this.afterMounted(); + } + + /** + * 鎵цmounted鍚庣殑閫昏緫 + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public afterMounted(){ + const _this: any = this; + _this.engineInit(); + if (_this.loadModel && _this.loadModel instanceof Function) { + _this.loadModel(); + } + + + } + + + /** + * grid 閮ㄤ欢 selectionchange 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public grid_selectionchange($event: any, $event2?: any) { + this.engine.onCtrlEvent('grid', 'selectionchange', $event); + } + + + /** + * grid 閮ㄤ欢 beforeload 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public grid_beforeload($event: any, $event2?: any) { + this.engine.onCtrlEvent('grid', 'beforeload', $event); + } + + + /** + * grid 閮ㄤ欢 rowdblclick 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public grid_rowdblclick($event: any, $event2?: any) { + this.engine.onCtrlEvent('grid', 'rowdblclick', $event); + } + + + /** + * grid 閮ㄤ欢 remove 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public grid_remove($event: any, $event2?: any) { + this.engine.onCtrlEvent('grid', 'remove', $event); + } + + + /** + * grid 閮ㄤ欢 load 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public grid_load($event: any, $event2?: any) { + this.engine.onCtrlEvent('grid', 'load', $event); + } + + + /** + * searchform 閮ㄤ欢 save 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public searchform_save($event: any, $event2?: any) { + this.engine.onCtrlEvent('searchform', 'save', $event); + } + + + /** + * searchform 閮ㄤ欢 search 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public searchform_search($event: any, $event2?: any) { + this.engine.onCtrlEvent('searchform', 'search', $event); + } + + + /** + * searchform 閮ㄤ欢 load 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public searchform_load($event: any, $event2?: any) { + this.engine.onCtrlEvent('searchform', 'load', $event); + } + + + + /** + * 鎵撳紑鏂板缓鏁版嵁瑙嗗浘 + * + * @param {any[]} args + * @param {*} [params] + * @param {*} [fullargs] + * @param {*} [$event] + * @param {*} [xData] + * @memberof IBIZBOOKUpdateDefaultGridView + */ + public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) { + let localContext:any = null; + let localViewParam:any =null; + const data: any = {}; + if(args[0].srfsourcekey){ + data.srfsourcekey = args[0].srfsourcekey; + } + let tempContext = JSON.parse(JSON.stringify(this.context)); + delete tempContext.ibizbook; + if(args.length >0){ + Object.assign(tempContext,args[0]); + } + const deResParameters: any[] = []; + const parameters: any[] = [ + { pathName: 'ibizbooks', parameterName: 'ibizbook' }, + { pathName: 'editview', parameterName: 'editview' }, + ]; + const _this: any = this; + const openIndexViewTab = (data: any) => { + const _data: any = { w: (new Date().getTime()) }; + Object.assign(_data, data); + const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, _data); + this.$router.push(routePath); + } + openIndexViewTab(data); + } + + + /** + * 鎵撳紑缂栬緫鏁版嵁瑙嗗浘 + * + * @param {any[]} args + * @param {*} [params] + * @param {*} [fullargs] + * @param {*} [$event] + * @param {*} [xData] + * @memberof IBIZBOOKUpdateDefaultGridView + */ + public opendata(args: any[],fullargs?:any,params?: any, $event?: any, xData?: any) { + if(!this.viewDefaultUsage){ + if(Object.is(this.navModel,"route")){ + this.initNavDataWithRoute(this.viewCacheData, false, true); + }else{ + this.initNavDataWithTab(this.viewCacheData, false, true); + } + } + let localContext:any = null; + let localViewParam:any =null; + const data: any = {}; + let tempContext = JSON.parse(JSON.stringify(this.context)); + if(args.length >0){ + Object.assign(tempContext,args[0]); + } + const deResParameters: any[] = []; + const parameters: any[] = [ + { pathName: 'ibizbooks', parameterName: 'ibizbook' }, + { pathName: 'editview', parameterName: 'editview' }, + ]; + const _this: any = this; + if(fullargs && fullargs.copymode){ + Object.assign(data,{copymode:true}); + } + const openIndexViewTab = (data: any) => { + const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data); + this.$router.push(routePath); + } + openIndexViewTab(data); + } + + + + /** + * 鍏抽棴瑙嗗浘 + * + * @param {any[]} args + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public closeView(args: any[]): void { + let _view: any = this; + if (_view.viewdata) { + _view.$emit('viewdataschange', [args]); + _view.$emit('close', [args]); + } else if (_view.$tabPageExp) { + _view.$tabPageExp.onClose(_view.$route.fullPath); + } + } + + /** + * 閿€姣佽鍥惧洖璋� + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public destroyed(){ + this.afterDestroyed(); + } + + /** + * 鎵цdestroyed鍚庣殑閫昏緫 + * + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public afterDestroyed(){ + if(this.viewDefaultUsage){ + let localStoreLength = Object.keys(localStorage); + if(localStoreLength.length > 0){ + localStoreLength.forEach((item:string) =>{ + if(item.startsWith(this.context.srfsessionid)){ + localStorage.removeItem(item); + } + }) + } + if(Object.is(this.navModel,"tab")){ + this.navDataService.removeNavDataByTag(this.viewtag); + } + if (this.serviceStateEvent) { + this.serviceStateEvent.unsubscribe(); + } + } + // 閿€姣佽鏁板櫒瀹氭椂鍣� + if(this.counterServiceArray && this.counterServiceArray.length >0){ + this.counterServiceArray.forEach((item:any) =>{ + if(item.destroyCounter && item.destroyCounter instanceof Function){ + item.destroyCounter(); + } + }) + } + if(this.portletStateEvent){ + this.portletStateEvent.unsubscribe(); + } + } + + /** + * 鏄惁鍗曢€� + * + * @type {boolean} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public isSingleSelect: boolean = false; + + + /** + * 鏄惁宓屽叆鍏崇郴鐣岄潰 + * + * @type {boolean} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Prop({default:false}) public isformDruipart?: boolean; + + /** + * 鐣岄潰鍏崇郴閫氳瀵硅薄 + * + * @type {Subject<ViewState>} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Prop() public formDruipart?: Subject<ViewState>; + + /** + * 鎼滅储鍊� + * + * @type {string} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public query: string = ''; + + /** + * 鏄惁灞曞紑鎼滅储琛ㄥ崟 + * + * @type {boolean} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public isExpandSearchForm: boolean = false; + + /** + * 琛ㄦ牸琛屾暟鎹粯璁ゆ縺娲绘ā寮� + * 0 涓嶆縺娲� + * 1 鍗曞嚮婵€娲� + * 2 鍙屽嚮婵€娲� + * + * @type {(number | 0 | 1 | 2)} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public gridRowActiveMode: number | 0 | 1 | 2 = 2; + + /** + * 蹇€熸悳绱� + * + * @param {*} $event + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + public onSearch($event: any): void { + const grid: any = this.$refs.grid; + if (grid) { + grid.load(this.context, true); + } + } + + /** + * grid 閮ㄤ欢 save 浜嬩欢 + * + * @param {*} [args={}] + * @param {*} $event + * @memberof ENTITYTEST1Usr2GridViewBase + */ + public onSave($event: any) { + this.$emit('drdatasaved', $event); + } + + /** + * 鍒锋柊鏁版嵁 + * + * @readonly + * @type {(number | null)} + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + get refreshdata(): number | null { + return this.$store.getters['viewaction/getRefreshData'](this.viewtag); + } + + /** + * 鐩戞帶鏁版嵁鍙樺寲 + * + * @param {*} newVal + * @param {*} oldVal + * @returns + * @memberof IBIZBOOKUpdateDefaultGridViewBase + */ + @Watch('refreshdata') + onRefreshData(newVal: any, oldVal: any) { + if (newVal === null || newVal === undefined) { + return; + } + if (newVal === 0) { + return; + } + const grid: any = this.$refs.grid; + if (grid) { + grid.load({}); + } + } + +} +</script> + +<style lang='less'> +@import './ibizbookupdate-default-grid-view.less'; +</style> \ No newline at end of file diff --git a/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.less b/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.less new file mode 100644 index 000000000..493df99bb --- /dev/null +++ b/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.less @@ -0,0 +1,19 @@ +.ibizbookupdate-default-grid-view{ + position: relative; +} + .toolbar-container { + button { + margin: 6px 0px 4px 4px; + .caption { + margin-left: 4px; + } + } + .seperator { + color: #dcdee2; + margin: 0 0px 0 4px; + } + } + + // this is less + + diff --git a/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue b/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue new file mode 100644 index 000000000..1ac055153 --- /dev/null +++ b/app_Web/src/pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue @@ -0,0 +1,24 @@ +<script lang='tsx'> +import { Component } from 'vue-property-decorator'; +import IBIZBOOKUpdateDefaultGridViewBase from './ibizbookupdate-default-grid-view-base.vue'; + +import view_grid from '@widgets/ibizbook/update-default-grid/update-default-grid.vue'; +import view_searchform from '@widgets/ibizbook/default-searchform/default-searchform.vue'; +@Component({ + components: { + view_grid, + view_searchform, + }, + beforeRouteEnter: (to: any, from: any, next: any) => { + next((vm: any) => { + if(!Object.is(vm.navModel,"route")){ + vm.initNavDataWithTab(vm.viewCacheData); + } + vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag }); + }); + }, +}) +export default class IBIZBOOKUpdateDefaultGridView extends IBIZBOOKUpdateDefaultGridViewBase { + +} +</script> \ No newline at end of file diff --git a/app_Web/src/pages/sample/index/page-register.ts b/app_Web/src/pages/sample/index/page-register.ts index 6d1e2476c..f07b0d4ee 100644 --- a/app_Web/src/pages/sample/index/page-register.ts +++ b/app_Web/src/pages/sample/index/page-register.ts @@ -9,8 +9,8 @@ export const PageComponents = { Vue.component('ibizuniproduct-pickup-view', () => import('@pages/sample/ibizuniproduct-pickup-view/ibizuniproduct-pickup-view.vue')); Vue.component('ibizsample0001-sf4-edit-view', () => import('@pages/sample/ibizsample0001-sf4-edit-view/ibizsample0001-sf4-edit-view.vue')); Vue.component('ibizsoftware-suit-sgrid-view', () => import('@pages/sample/ibizsoftware-suit-sgrid-view/ibizsoftware-suit-sgrid-view.vue')); - Vue.component('ibizsample0003-stree-exp-view2', () => import('@pages/sample/ibizsample0003-stree-exp-view2/ibizsample0003-stree-exp-view2.vue')); Vue.component('ibizorder-bar-chart-view', () => import('@pages/sample/ibizorder-bar-chart-view/ibizorder-bar-chart-view.vue')); + Vue.component('ibizsample0003-stree-exp-view2', () => import('@pages/sample/ibizsample0003-stree-exp-view2/ibizsample0003-stree-exp-view2.vue')); Vue.component('ibizsample0001-sf2-edit-view', () => import('@pages/sample/ibizsample0001-sf2-edit-view/ibizsample0001-sf2-edit-view.vue')); Vue.component('ibizorder-detail-sf2-edit-view', () => import('@pages/sample/ibizorder-detail-sf2-edit-view/ibizorder-detail-sf2-edit-view.vue')); Vue.component('ibizbooknew-default-value-grid-view', () => import('@pages/sample/ibizbooknew-default-value-grid-view/ibizbooknew-default-value-grid-view.vue')); @@ -109,6 +109,7 @@ export const PageComponents = { Vue.component('ibizbookedit-view', () => import('@pages/sample/ibizbookedit-view/ibizbookedit-view.vue')); Vue.component('ibizsample0001-sf5-edit-view', () => import('@pages/sample/ibizsample0001-sf5-edit-view/ibizsample0001-sf5-edit-view.vue')); Vue.component('ibizorder-radar-chart-view', () => import('@pages/sample/ibizorder-radar-chart-view/ibizorder-radar-chart-view.vue')); + Vue.component('ibizbookupdate-default-grid-view', () => import('@pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue')); Vue.component('ibizsample0003-stab-exp-view', () => import('@pages/sample/ibizsample0003-stab-exp-view/ibizsample0003-stab-exp-view.vue')); Vue.component('ibizsample0017-pickup-grid-view', () => import('@pages/sample/ibizsample0017-pickup-grid-view/ibizsample0017-pickup-grid-view.vue')); Vue.component('ibizsample0013-pickup-grid-view', () => import('@pages/sample/ibizsample0013-pickup-grid-view/ibizsample0013-pickup-grid-view.vue')); diff --git a/app_Web/src/pages/sample/index/router.ts b/app_Web/src/pages/sample/index/router.ts index 3029e8b57..7014c29ea 100644 --- a/app_Web/src/pages/sample/index/router.ts +++ b/app_Web/src/pages/sample/index/router.ts @@ -192,32 +192,32 @@ const router = new Router({ component: () => import('@pages/sample/ibizsoftware-suit-sgrid-view/ibizsoftware-suit-sgrid-view.vue'), }, { - path: 'ibizsample0003s/:ibizsample0003?/streeexpview2/:streeexpview2?', + path: 'ibizorders/:ibizorder?/barchartview/:barchartview?', meta: { - caption: 'entities.ibizsample0003.views.streeexpview2.caption', + caption: 'entities.ibizorder.views.barchartview.caption', info:'', parameters: [ { pathName: 'index', parameterName: 'index' }, - { pathName: 'ibizsample0003s', parameterName: 'ibizsample0003' }, - { pathName: 'streeexpview2', parameterName: 'streeexpview2' }, + { pathName: 'ibizorders', parameterName: 'ibizorder' }, + { pathName: 'barchartview', parameterName: 'barchartview' }, ], requireAuth: true, }, - component: () => import('@pages/sample/ibizsample0003-stree-exp-view2/ibizsample0003-stree-exp-view2.vue'), + component: () => import('@pages/sample/ibizorder-bar-chart-view/ibizorder-bar-chart-view.vue'), }, { - path: 'ibizorders/:ibizorder?/barchartview/:barchartview?', + path: 'ibizsample0003s/:ibizsample0003?/streeexpview2/:streeexpview2?', meta: { - caption: 'entities.ibizorder.views.barchartview.caption', + caption: 'entities.ibizsample0003.views.streeexpview2.caption', info:'', parameters: [ { pathName: 'index', parameterName: 'index' }, - { pathName: 'ibizorders', parameterName: 'ibizorder' }, - { pathName: 'barchartview', parameterName: 'barchartview' }, + { pathName: 'ibizsample0003s', parameterName: 'ibizsample0003' }, + { pathName: 'streeexpview2', parameterName: 'streeexpview2' }, ], requireAuth: true, }, - component: () => import('@pages/sample/ibizorder-bar-chart-view/ibizorder-bar-chart-view.vue'), + component: () => import('@pages/sample/ibizsample0003-stree-exp-view2/ibizsample0003-stree-exp-view2.vue'), }, { path: 'ibizsample0002s/:ibizsample0002?/ibizsample0001s/:ibizsample0001?/sf2editview/:sf2editview?', @@ -1621,6 +1621,20 @@ const router = new Router({ }, component: () => import('@pages/sample/ibizorder-radar-chart-view/ibizorder-radar-chart-view.vue'), }, + { + path: 'ibizbooks/:ibizbook?/updatedefaultgridview/:updatedefaultgridview?', + meta: { + caption: 'entities.ibizbook.views.updatedefaultgridview.caption', + info:'', + parameters: [ + { pathName: 'index', parameterName: 'index' }, + { pathName: 'ibizbooks', parameterName: 'ibizbook' }, + { pathName: 'updatedefaultgridview', parameterName: 'updatedefaultgridview' }, + ], + requireAuth: true, + }, + component: () => import('@pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue'), + }, { path: 'ibizsample0003s/:ibizsample0003?/stabexpview/:stabexpview?', meta: { @@ -3116,6 +3130,19 @@ const router = new Router({ }, component: () => import('@pages/sample/ibizhardware-edit-view/ibizhardware-edit-view.vue'), }, + { + path: '/ibizbooks/:ibizbook?/updatedefaultgridview/:updatedefaultgridview?', + meta: { + caption: 'entities.ibizbook.views.updatedefaultgridview.caption', + info:'', + parameters: [ + { pathName: 'ibizbooks', parameterName: 'ibizbook' }, + { pathName: 'updatedefaultgridview', parameterName: 'updatedefaultgridview' }, + ], + requireAuth: true, + }, + component: () => import('@pages/sample/ibizbookupdate-default-grid-view/ibizbookupdate-default-grid-view.vue'), + }, { path: '/ibizorders/:ibizorder?/sf4editview/:sf4editview?', meta: { diff --git a/app_Web/src/store/modules/view-action/state.ts b/app_Web/src/store/modules/view-action/state.ts index 3159a7b53..5070d19bf 100644 --- a/app_Web/src/store/modules/view-action/state.ts +++ b/app_Web/src/store/modules/view-action/state.ts @@ -208,6 +208,7 @@ export const viewstate: any = { 'b1256beac1e95915b675893c61559b59', '09663b7a4e3dce70524d1b64e02b5e2d', '491c2bc6eab0ad313d4b6f06f6a396f5', + 'e53fed4d0b4dd614057f426b02115b41', '836bdb4063978b55fedd6a180d60c323', 'e54ae8e27a53b3425ac78a229a163bd5', '369a14f21cbff0d0fe23831aecfca7ba', @@ -1109,6 +1110,16 @@ export const viewstate: any = { refviews: [ ], }, + { + viewtag: 'e53fed4d0b4dd614057f426b02115b41', + viewmodule: 'Sample', + viewname: 'IBIZBOOKUpdateDefaultGridView', + viewaction: '', + viewdatachange: false, + refviews: [ + 'b3429ecc4d89a02bc5f5279f1bd7f620', + ], + }, { viewtag: 'e54ae8e27a53b3425ac78a229a163bd5', viewmodule: 'Sample', diff --git a/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-base.vue b/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-base.vue index 79f39b80c..86f2b87bb 100644 --- a/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-base.vue +++ b/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-base.vue @@ -602,6 +602,9 @@ export default class MainMenuBase extends Vue implements ControlInterface { case 'Auto243': this.clickAuto243(item); return; + case 'AppFunc5': + this.clickAppFunc5(item); + return; case 'Auto393': this.clickAuto393(item); return; @@ -1348,6 +1351,29 @@ export default class MainMenuBase extends Vue implements ControlInterface { }) } + /** + * 鍥句功琛ㄦ牸瑙嗗浘-鏇存柊榛樿鍊� + * + * @param {*} [item={}] + * @memberof MainMenu + */ + public clickAppFunc5(item: any = {}) { + const viewparam: any = {}; + Object.assign(viewparam, {}); + const deResParameters: any[] = []; + const parameters: any[] = [ + { pathName: 'ibizbooks', parameterName: 'ibizbook' }, + { pathName: 'updatedefaultgridview', parameterName: 'updatedefaultgridview' }, + ]; + const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam); + if(Object.is(this.$route.fullPath,path)){ + return; + } + this.$nextTick(function(){ + this.$router.push(path); + }) + } + /** * 鍩虹琛ㄥ崟椤� * diff --git a/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-model.ts b/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-model.ts index 642c48a56..eaa569eb3 100644 --- a/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-model.ts +++ b/app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-model.ts @@ -511,6 +511,25 @@ export default class MainMenuModel { appfunctag: 'AppFunc4', resourcetag: '', authtag:'Web-MainMenu-menuitem75', +}, + { + id: 'E25B1356-D910-4E5E-A3AC-505517F1DD30', + name: 'menuitem76', + text: '鏇存柊榛樿鍊�', + type: 'MENUITEM', + counterid: '', + tooltip: '鏇存柊榛樿鍊�', + expanded: false, + separator: false, + hidden: false, + hidesidebar: false, + opendefault: false, + iconcls: '', + icon: '', + textcls: '', + appfunctag: 'AppFunc5', + resourcetag: '', + authtag:'Web-MainMenu-menuitem76', }, ], }, diff --git a/app_Web/src/widgets/ibizbook/new-default-grid/new-default-grid-base.vue b/app_Web/src/widgets/ibizbook/new-default-grid/new-default-grid-base.vue index 1d116a3eb..5fb74b8ed 100644 --- a/app_Web/src/widgets/ibizbook/new-default-grid/new-default-grid-base.vue +++ b/app_Web/src/widgets/ibizbook/new-default-grid/new-default-grid-base.vue @@ -2163,12 +2163,21 @@ export default class NewDefaultBase extends Vue implements ControlInterface { if (row.hasOwnProperty('author')) { row['author'] = this.context['srfusername']; } + if (row.hasOwnProperty('press')) { + row['press'] = this.context['IBIZBOOKNAME']; + } if (row.hasOwnProperty('ibizbookname')) { row['ibizbookname'] = '鏂板缓榛樿鍊硷細鍥句功'; } + if (row.hasOwnProperty('price')) { + row['price'] = '133.3'; + } if (row.hasOwnProperty('updatedate')) { row['updatedate'] = this.$util.dateFormat(new Date()); } + if (row.hasOwnProperty('type')) { + row['type'] = this.context['booktype']; + } } /** diff --git a/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-base.vue b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-base.vue new file mode 100644 index 000000000..423461428 --- /dev/null +++ b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-base.vue @@ -0,0 +1,2268 @@ +<template> +<div class='grid' style="height:100%"> + <i-form style="height:100%;display:flex;flex-direction: column;justify-content: space-between"> + <el-table v-if="isDisplay === true" + :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }" + @sort-change="onSortChange($event)" + :border="isDragendCol" + :highlight-current-row ="isSingleSelect" + :row-class-name="getRowClassName" + :cell-class-name="getCellClassName" + max-height="items.length > 0 ? 'calc(100%-50px)' : '100%'" + @row-click="rowClick($event)" + @select-all="selectAll($event)" + @select="select" + @row-class-name="onRowClassName($event)" + @row-dblclick="rowDBLClick($event)" + ref='multipleTable' :data="items" :show-header="!isHideHeader"> + <template slot="empty"> + {{$t('entities.ibizbook.updatedefault_grid.nodata')}} + </template> + <template v-if="!isSingleSelect"> + <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column> + </template> + <template v-if="getColumnState('ibizbookname')"> + <el-table-column show-overflow-tooltip :prop="'ibizbookname'" :label="$t('entities.ibizbook.updatedefault_grid.columns.ibizbookname')" :width="180" :align="'left'" :sortable="'custom'"> + <template v-slot:header="{column}"> + <span class="column-header "> + {{$t('entities.ibizbook.updatedefault_grid.columns.ibizbookname')}} + </span> + </template> + <template v-slot="{row,column,$index}"> + <template > + <app-span name='ibizbookname' editorType="TEXTBOX" :value="row.ibizbookname" dataType="TEXT" precision="0" ></app-span> + </template> + </template> + </el-table-column> + </template> + <template v-if="getColumnState('author')"> + <el-table-column show-overflow-tooltip :prop="'author'" :label="$t('entities.ibizbook.updatedefault_grid.columns.author')" :width="180" :align="'left'" :sortable="'custom'"> + <template v-slot:header="{column}"> + <span class="column-header "> + {{$t('entities.ibizbook.updatedefault_grid.columns.author')}} + </span> + </template> + <template v-slot="{row,column,$index}"> + <template > + <app-span name='author' editorType="TEXTBOX" :value="row.author" dataType="TEXT" precision="0" ></app-span> + </template> + </template> + </el-table-column> + </template> + <template v-if="getColumnState('type')"> + <el-table-column show-overflow-tooltip :prop="'type'" :label="$t('entities.ibizbook.updatedefault_grid.columns.type')" :width="180" :align="'center'" :sortable="'custom'"> + <template v-slot:header="{column}"> + <span class="column-header "> + {{$t('entities.ibizbook.updatedefault_grid.columns.type')}} + </span> + </template> + <template v-slot="{row,column,$index}"> + <template > + <app-span name='type' editorType="TEXTBOX" :value="row.type" dataType="TEXT" precision="0" ></app-span> + </template> + </template> + </el-table-column> + </template> + <template v-if="getColumnState('press')"> + <el-table-column show-overflow-tooltip :prop="'press'" :label="$t('entities.ibizbook.updatedefault_grid.columns.press')" :width="180" :align="'left'" :sortable="'custom'"> + <template v-slot:header="{column}"> + <span class="column-header "> + {{$t('entities.ibizbook.updatedefault_grid.columns.press')}} + </span> + </template> + <template v-slot="{row,column,$index}"> + <template > + <app-span name='press' editorType="TEXTBOX" :value="row.press" dataType="TEXT" precision="0" ></app-span> + </template> + </template> + </el-table-column> + </template> + <template v-if="getColumnState('price')"> + <el-table-column show-overflow-tooltip :prop="'price'" :label="$t('entities.ibizbook.updatedefault_grid.columns.price')" :width="150" :align="'left'" :sortable="'custom'"> + <template v-slot:header="{column}"> + <span class="column-header "> + {{$t('entities.ibizbook.updatedefault_grid.columns.price')}} + </span> + </template> + <template v-slot="{row,column,$index}"> + <template > + <app-span name='price' editorType="NUMBER" :value="row.price" dataType="CURRENCY" precision="0" ></app-span> + </template> + </template> + </el-table-column> + </template> + <template v-if="getColumnState('updatedate')"> + <el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.ibizbook.updatedefault_grid.columns.updatedate')" :width="180" :align="'left'" :sortable="'custom'"> + <template v-slot:header="{column}"> + <span class="column-header "> + {{$t('entities.ibizbook.updatedefault_grid.columns.updatedate')}} + </span> + </template> + <template v-slot="{row,column,$index}"> + <template > + <app-span name='updatedate' editorType="DATEPICKER" :value="row.updatedate" dataType="DATETIME" precision="0" ></app-span> + </template> + </template> + </el-table-column> + </template> + <template v-if="adaptiveState"> + <el-table-column></el-table-column> + </template> + </el-table> + + <row class='grid-pagination' v-show="items.length > 0"> + <page class='pull-right' @on-change="pageOnChange($event)" + @on-page-size-change="onPageSizeChange($event)" + :transfer="true" :total="totalrow" + show-sizer :current="curPage" :page-size="limit" + :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total> + <span> + <span class="page-column"> + <poptip transfer placement="top-start"> + <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button> + <div slot="content"> + <template v-for="col in allColumns"> + <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div> + </template> + </div> + </poptip> + </span> + <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span> + <span> + {{$t('app.gridpage.show')}} + <span> + <template v-if="items.length === 1"> + 1 + </template> + <template v-else> + <span>{{(curPage - 1) * limit + 1}} - {{totalrow > curPage * limit ? curPage * limit : totalrow}}</span> + </template> + </span> + {{$t('app.gridpage.records')}}锛寋{$t('app.gridpage.totle')}} {{totalrow}} {{$t('app.gridpage.records')}} + </span> + </span> + </page> + </row> + </i-form> +</div> +</template> +<script lang='tsx'> +import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator'; +import { CreateElement } from 'vue'; +import { Subject, Subscription } from 'rxjs'; +import { ControlInterface } from '@/interface/control'; +import { UIActionTool,Util,ViewTool } from '@/utils'; +import NavDataService from '@/service/app/navdata-service'; +import AppCenterService from "@service/app/app-center-service"; +import IBIZBOOKService from '@/service/ibizbook/ibizbook-service'; +import UpdateDefaultService from './update-default-grid-service'; +import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service'; +import CodeListService from "@/codelist/codelist-service"; +import { FormItemModel } from '@/model/form-detail'; +import { Environment } from '@/environments/environment'; + + +@Component({ + components: { + + } +}) +export default class UpdateDefaultBase extends Vue implements ControlInterface { + + /** + * 鍚嶇О + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public name?: string; + + /** + * 瑙嗗浘閫氳瀵硅薄 + * + * @type {Subject<ViewState>} + * @memberof UpdateDefaultBase + */ + @Prop() public viewState!: Subject<ViewState>; + + /** + * 搴旂敤涓婁笅鏂� + * + * @type {*} + * @memberof UpdateDefaultBase + */ + @Prop() public context: any; + + /** + * 瑙嗗浘鍙傛暟 + * + * @type {*} + * @memberof UpdateDefaultBase + */ + @Prop() public viewparams: any; + + /** + * 瑙嗗浘鐘舵€佷簨浠� + * + * @public + * @type {(Subscription | undefined)} + * @memberof UpdateDefaultBase + */ + public viewStateEvent: Subscription | undefined; + + /** + * 鑾峰彇閮ㄤ欢绫诲瀷 + * + * @returns {string} + * @memberof UpdateDefaultBase + */ + public getControlType(): string { + return 'GRID' + } + + + + /** + * 璁℃暟鍣ㄦ湇鍔″璞¢泦鍚� + * + * @type {Array<*>} + * @memberof UpdateDefaultBase + */ + public counterServiceArray:Array<any> = []; + + /** + * 寤烘瀯閮ㄤ欢鏈嶅姟瀵硅薄 + * + * @type {UpdateDefaultService} + * @memberof UpdateDefaultBase + */ + public service: UpdateDefaultService = new UpdateDefaultService({ $store: this.$store }); + + /** + * 瀹炰綋鏈嶅姟瀵硅薄 + * + * @type {IBIZBOOKService} + * @memberof UpdateDefaultBase + */ + public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store }); + + + + /** + * 杞寲鏁版嵁 + * + * @param {any} args + * @memberof UpdateDefaultBase + */ + public transformData(args: any) { + let _this: any = this; + if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){ + return _this.service.handleRequestData('transform',_this.context,args)['data']; + } + } + + /** + * 鍏抽棴瑙嗗浘 + * + * @param {any} args + * @memberof UpdateDefaultBase + */ + public closeView(args: any): void { + let _this: any = this; + _this.$emit('closeview', [args]); + } + + /** + * 璁℃暟鍣ㄥ埛鏂� + * + * @memberof UpdateDefaultBase + */ + public counterRefresh(){ + const _this:any =this; + if(_this.counterServiceArray && _this.counterServiceArray.length >0){ + _this.counterServiceArray.forEach((item:any) =>{ + if(item.refreshData && item.refreshData instanceof Function){ + item.refreshData(); + } + }) + } + } + + + /** + * 浠g爜琛ㄦ湇鍔″璞� + * + * @type {CodeListService} + * @memberof UpdateDefaultBase + */ + public codeListService:CodeListService = new CodeListService({ $store: this.$store }); + + /** + * 涓讳俊鎭〃鏍煎垪 + * + * @type {string} + * @memberof UpdateDefaultBase + */ + public majorInfoColName:string = "ibizbookname"; + + /** + * 鐣岄潰UI鏈嶅姟瀵硅薄 + * + * @type {IBIZBOOKUIService} + * @memberof UpdateDefaultBase + */ + public appUIService:IBIZBOOKUIService = new IBIZBOOKUIService(this.$store); + + /** + * 鐣岄潰琛屼负妯″瀷 + * + * @type {*} + * @memberof UpdateDefaultBase + */ + public ActionModel:any ={ + }; + + /** + * 搴旂敤鐘舵€佷簨浠� + * + * @public + * @type {(Subscription | undefined)} + * @memberof UpdateDefaultBase + */ + public appStateEvent: Subscription | undefined; + + /** + * 鑾峰彇澶氶」鏁版嵁 + * + * @returns {any[]} + * @memberof UpdateDefaultBase + */ + public getDatas(): any[] { + return this.selections; + } + + /** + * 鑾峰彇鍗曢」鏍� + * + * @returns {*} + * @memberof UpdateDefaultBase + */ + public getData(): any { + return this.selections[0]; + } + + /** + * 鎵撳紑鏂板缓鏁版嵁瑙嗗浘 + * + * @type {any} + * @memberof UpdateDefaultBase + */ + @Prop() public newdata: any; + /** + * 鎵撳紑缂栬緫鏁版嵁瑙嗗浘 + * + * @type {any} + * @memberof UpdateDefaultBase + */ + @Prop() public opendata: any; + + /** + * 鏄惁宓屽叆鍏崇郴鐣岄潰 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + @Prop({default:false}) public isformDruipart?: boolean; + + /** + * 鏄剧ず澶勭悊鎻愮ず + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + @Prop({ default: true }) public showBusyIndicator?: boolean; + + /** + * 閮ㄤ欢琛屼负--update + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public updateAction!: string; + + /** + * 閮ㄤ欢琛屼负--fetch + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public fetchAction!: string; + + /** + * 閮ㄤ欢琛屼负--remove + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public removeAction!: string; + + /** + * 閮ㄤ欢琛屼负--load + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public loadAction!: string; + + /** + * 閮ㄤ欢琛屼负--loaddraft + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public loaddraftAction!: string; + + /** + * 閮ㄤ欢琛屼负--create + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public createAction!: string; + + /** + * 褰撳墠椤� + * + * @type {number} + * @memberof UpdateDefaultBase + */ + public curPage: number = 1; + + /** + * 鏁版嵁 + * + * @type {any[]} + * @memberof UpdateDefaultBase + */ + public items: any[] = []; + + /** + * 鏄惁鏀寔鍒嗛〉 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public isEnablePagingBar: boolean = true; + + /** + * 鏄惁绂佺敤鎺掑簭 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public isNoSort: boolean = false; + + /** + * 鎺掑簭鏂瑰悜 + * + * @type {string} + * @memberof UpdateDefaultBase + */ + public minorSortDir: string = ''; + + /** + * 鎺掑簭瀛楁 + * + * @type {string} + * @memberof UpdateDefaultBase + */ + public minorSortPSDEF: string = ''; + + /** + * 鍒嗛〉鏉℃暟 + * + * @type {number} + * @memberof UpdateDefaultBase + */ + public limit: number = 20; + + /** + * 鏄惁鏄剧ず鏍囬 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public isHideHeader: boolean = false; + + /** + * 鏄惁榛樿閫変腑绗竴鏉℃暟鎹� + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + @Prop({ default: false }) public isSelectFirstDefault!: boolean; + + /** + * 鏄惁鍗曢€� + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + @Prop() public isSingleSelect?: boolean; + + /** + * 閫変腑鏁版嵁瀛楃涓� + * + * @type {string} + * @memberof UpdateDefaultBase + */ + @Prop() public selectedData?: string; + + /** + * 閫変腑鍊煎彉鍖� + * + * @param {*} newVal + * @param {*} oldVal + * @memberof UpdateDefaultBase + */ + @Watch('selectedData') + public onValueChange(newVal: any, oldVal: any) { + this.selections = []; + if(this.selectedData){ + const refs: any = this.$refs; + if (refs.multipleTable) { + refs.multipleTable.clearSelection(); + JSON.parse(this.selectedData).forEach((selection:any)=>{ + let selectedItem = this.items.find((item:any)=>{ + return Object.is(item.srfkey, selection.srfkey); + }); + if(selectedItem){ + this.rowClick(selectedItem); + } + }); + } + } + } + + /** + * 琛ㄦ牸琛屾暟鎹粯璁ゆ縺娲绘ā寮� + * 0 涓嶆縺娲� + * 1 鍗曞嚮婵€娲� + * 2 鍙屽嚮婵€娲� + * + * @type {(number | 0 | 1 | 2)} + * @memberof UpdateDefaultBase + */ + @Prop({default: 2}) public gridRowActiveMode!: number; + + /** + * 鏄惁寮€鍚缂栬緫 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + @Prop({default: false}) public isOpenEdit!: boolean; + + /** + * 瀹為檯鏄惁寮€鍚缂栬緫 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public actualIsOpenEdit: boolean = this.isOpenEdit; + + /** + * 鎬绘潯鏁� + * + * @type {number} + * @memberof UpdateDefaultBase + */ + public totalrow: number = 0; + + /** + * 琛ㄦ牸鏇存柊榛樿鍊奸」 + * + * @memberof UpdateDefaultBase + */ + public defaultUpdateItems:Array<any> =[,,'ibizbookname','price',,'type',]; + + /** + * 閫変腑琛屾暟鎹� + * + * @type {any[]} + * @memberof UpdateDefaultBase + */ + public selections: any[] = []; + + /** + * 鎷︽埅琛岄€変腑 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public stopRowClick: boolean = false; + + /** + * 褰撳墠缂栬緫琛屾暟鎹� + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public curEditRowData:any; + + + + + /** + * 琛ㄦ牸鏄惁鏄剧ず + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public isDisplay:boolean = true; + + /** + * 琛ㄦ牸琛岀紪杈戦」鏍¢獙閿欒鎻愮ず淇℃伅 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public errorMessages: Array<any> = []; + + /** + * 閮ㄤ欢鍒锋柊 + * + * @param {any} args + * @memberof UpdateDefaultBase + */ + public refresh(args?: any): void { + this.load(); + } + + /** + * 閫夐」妗嗗垪瀹� + * + * @type {number} + * @memberof AppIndex + */ + public checkboxColWidth: number = 50; + + /** + * 鏄惁鍏佽鎷栧姩鍒楀 + * + * @type {boolean} + * @memberof AppEmbedPicker + */ + public isDragendCol: boolean = true; + + /** + * 鎵€鏈夊垪鎴愬憳 + * + * @type {any[]} + * @memberof UpdateDefaultBase + */ + public allColumns: any[] = [ + { + name: 'ibizbookname', + label: '鍥句功鍚嶇О', + langtag: 'entities.ibizbook.updatedefault_grid.columns.ibizbookname', + show: true, + unit: 'PX', + isEnableRowEdit: false, + enableCond: 3 , + }, + { + name: 'author', + label: '鍥句功浣滆€�', + langtag: 'entities.ibizbook.updatedefault_grid.columns.author', + show: true, + unit: 'PX', + isEnableRowEdit: false, + enableCond: 3 , + }, + { + name: 'type', + label: '鍥句功绫诲瀷', + langtag: 'entities.ibizbook.updatedefault_grid.columns.type', + show: true, + unit: 'PX', + isEnableRowEdit: false, + enableCond: 3 , + }, + { + name: 'press', + label: '鍥句功鍑虹増绀�', + langtag: 'entities.ibizbook.updatedefault_grid.columns.press', + show: true, + unit: 'PX', + isEnableRowEdit: false, + enableCond: 3 , + }, + { + name: 'price', + label: '鍥句功浠锋牸', + langtag: 'entities.ibizbook.updatedefault_grid.columns.price', + show: true, + unit: 'PX', + isEnableRowEdit: false, + enableCond: 3 , + }, + { + name: 'updatedate', + label: '鏇存柊鏃堕棿', + langtag: 'entities.ibizbook.updatedefault_grid.columns.updatedate', + show: true, + unit: 'PX', + isEnableRowEdit: false, + enableCond: 3 , + }, + ] + + /** + * 琛ㄦ牸妯″瀷闆嗗悎 + * + * @type {*} + * @memberof UpdateDefaultBase + */ + public gridItemsModel: any[] = []; + + /** + * 鏄惁鍚敤鍒嗙粍 + * + * @type {boolean} + * @memberof UpdateDefaultBase + */ + public isEnableGroup:boolean = false; + + /** + * 鍒嗙粍灞炴€� + * + * @type {string} + * @memberof UpdateDefaultBase + */ + public groupAppField:string =""; + + /** + * 鍒嗙粍妯″紡 + * + * @type {string} + * @memberof UpdateDefaultBase + */ + public groupMode:string ="NONE"; + + /** + * 鑾峰彇鐣岄潰琛屼负鏉冮檺鐘舵€� + * + * @memberof UpdateDefaultBase + */ + public getActionState(data:any){ + let tempActionModel:any = JSON.parse(JSON.stringify(this.ActionModel)); + let targetData:any = this.transformData(data); + ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService); + return tempActionModel; + } + + /** + * 鑾峰彇琛ㄦ牸琛屾ā鍨� + * + * @type {*} + * @memberof UpdateDefaultBase + */ + public getGridRowModel(){ + return { + author: new FormItemModel(), + press: new FormItemModel(), + ibizbookname: new FormItemModel(), + price: new FormItemModel(), + updatedate: new FormItemModel(), + type: new FormItemModel(), + srfkey: new FormItemModel(), + } + } + + /** + * 灞炴€у€艰鍒� + * + * @type {*} + * @memberof UpdateDefaultBase + */ + public deRules:any = { + }; + + /** + * 鍊艰鍒欓泦鍚� + * + * @type {*} + * @memberof UpdateDefaultBase + */ + public rules: any = { + author: [ + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功浣滆€� 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功浣滆€� 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + press: [ + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功鍑虹増绀� 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功鍑虹増绀� 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + ibizbookname: [ + { required: true, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功鍚嶇О 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: true, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功鍚嶇О 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + price: [ + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功浠锋牸 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功浠锋牸 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + updatedate: [ + { required: true, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鏇存柊鏃堕棿 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: true, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鏇存柊鏃堕棿 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + type: [ + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功绫诲瀷 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功绫诲瀷 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + srfkey: [ + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功鏍囪瘑 鍊间笉鑳戒负绌�', trigger: 'change' }, + { required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '鍥句功鏍囪瘑 鍊间笉鑳戒负绌�', trigger: 'blur' }, + ], + } + + /** + * 琛ㄦ牸琛岀紪杈戦」鏍¢獙 + * + * @param {string} property 灞炴€у悕 + * @param {*} data 琛屾暟鎹� + * @param {number} rowIndex 琛岀储寮� + * @returns Promise<any> + * + * @memberof UpdateDefaultBase + */ + public validate(property:string, data:any, rowIndex:number):Promise<any>{ + return new Promise((resolve, reject) => { + this.$util.validateItem(property,data,this.rules).then(()=>{ + this.gridItemsModel[rowIndex][property].setError(null); + resolve(true); + }).catch(({ errors, fields }) => { + this.gridItemsModel[rowIndex][property].setError(errors[0].message); + resolve(false); + }); + }); + } + + /** + * 鏍¢獙鎵€鏈変慨鏀硅繃鐨勭紪杈戦」 + * + * @returns Promise<any> + * @memberof UpdateDefaultBase + */ + public async validateAll(){ + this.errorMessages = []; + let validateState = true; + let index = -1; + for (let item of this.items) { + let tempMessage: string = ''; + index++; + if (item.rowDataState === "create" || item.rowDataState === "update") { + for (let property of Object.keys(this.rules)) { + if (!await this.validate(property, item, index)) { + validateState = false; + tempMessage = tempMessage + '<p>' + this.gridItemsModel[index][property].error + '<p>'; + } + } + } + this.errorMessages.push(tempMessage); + } + return validateState; + } + + /** + * 琛ㄦ牸鏁版嵁鍔犺浇 + * + * @param {*} [arg={}] + * @memberof UpdateDefaultBase + */ + public load(opt: any = {}, pageReset: boolean = false): void { + if(!this.fetchAction){ + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUpdateDefaultGridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) }); + return; + } + if(pageReset){ + this.curPage = 1; + } + const arg: any = {...opt}; + const page: any = {}; + if (this.isEnablePagingBar) { + Object.assign(page, { page: this.curPage-1, size: this.limit }); + } + // 璁剧疆鎺掑簭 + if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) { + const sort: string = this.minorSortPSDEF+","+this.minorSortDir; + Object.assign(page, { sort: sort }); + } + Object.assign(arg, page); + const parentdata: any = {}; + this.$emit('beforeload', parentdata); + Object.assign(arg, parentdata); + let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{}; + Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams))); + Object.assign(arg,{viewparams:tempViewParams}); + const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator); + post.then((response: any) => { + if (!response.status || response.status !== 200) { + if (response.errorMessage) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage }); + } + return; + } + const data: any = response.data; + this.totalrow = response.total; + this.items = JSON.parse(JSON.stringify(data)); + // 娓呯┖selections,gridItemsModel + //this.selections = []; + this.gridItemsModel = []; + this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())}); + this.items.forEach((item:any)=>{ + Object.assign(item,this.getActionState(item)); + }); + this.$emit('load', this.items); + // 璁剧疆榛樿閫変腑 + let _this = this; + setTimeout(() => { + //鍦ㄥ鑸鍥句腑锛屽宸叉湁閫変腑鏁版嵁锛屽垯鍙充晶灞曞紑宸查€変腑鏁版嵁鐨勮鍥撅紝濡傛棤閫変腑鏁版嵁鍒欓粯璁ら€変腑绗竴鏉� + if(_this.isSelectFirstDefault){ + if(_this.selections && _this.selections.length > 0){ + _this.selections.forEach((select: any)=>{ + const index = _this.items.findIndex((item:any) => Object.is(item.srfkey,select.srfkey)); + if(index != -1){ + _this.rowClick(_this.items[index]); + } + }) + }else{ + _this.rowClick(this.items[0]); + } + } + if(_this.selectedData){ + const refs: any = _this.$refs; + if (refs.multipleTable) { + refs.multipleTable.clearSelection(); + JSON.parse(_this.selectedData).forEach((selection:any)=>{ + let selectedItem = _this.items.find((item:any)=>{ + return Object.is(item.srfkey, selection.srfkey); + }); + if(selectedItem){ + _this.rowClick(selectedItem); + } + }); + } + } + }, 300); + }).catch((response: any) => { + if (response && response.status === 401) { + return; + } + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage }); + }); + } + + /** + * 鍒犻櫎 + * + * @param {any[]} datas + * @returns {Promise<any>} + * @memberof UpdateDefaultBase + */ + public async remove(datas: any[]): Promise<any> { + if(!this.removeAction){ + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUpdateDefaultGridView'+(this.$t('app.gridpage.notConfig.removeAction') as string) }); + return; + } + let _datas:any[] = []; + datas.forEach((record: any, index: number) => { + if (Object.is(record.srfuf,"0")) { + this.items.some((val: any, num: number) =>{ + if(JSON.stringify(val) == JSON.stringify(record)){ + this.items.splice(num,1); + this.gridItemsModel.splice(num,1); + return true; + } + }); + }else{ + _datas.push(datas[index]); + } + }); + if (_datas.length === 0) { + return; + } + let dataInfo = ''; + _datas.forEach((record: any, index: number) => { + let srfmajortext = record.ibizbookname; + if (index < 5) { + if (!Object.is(dataInfo, '')) { + dataInfo += '銆�'; + } + dataInfo += srfmajortext; + } else { + return false; + } + }); + + if (_datas.length < 5) { + dataInfo = dataInfo + ' ' + (this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string) + (this.$t('app.gridpage.data') as string); + } else { + dataInfo = ' ... ' + (this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string) + (this.$t('app.gridpage.data') as string); + } + + const removeData = () => { + let keys: any[] = []; + _datas.forEach((data: any) => { + keys.push(data.srfkey); + }); + let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ; + let _keys = keys.length > 1 ? keys : keys[0] ; + const context:any = JSON.parse(JSON.stringify(this.context)); + const post: Promise<any> = this.service.delete(_removeAction,Object.assign(context,{ ibizbook: _keys }),Object.assign({ ibizbook: _keys },{viewparams:this.viewparams}), this.showBusyIndicator); + return new Promise((resolve: any, reject: any) => { + post.then((response: any) => { + if (!response || response.status !== 200) { + this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.delDataFail') as string)+',' + response.info }); + return; + } else { + this.$Notice.success({ title: '', desc: (this.$t('app.gridpage.delSuccess') as string) }); + } + //鍒犻櫎items涓凡鍒犻櫎鐨勯」 + console.log(this.items); + _datas.forEach((data: any) => { + this.items.some((item:any,index:number)=>{ + if(Object.is(item.srfkey,data.srfkey)){ + this.items.splice(index,1); + this.gridItemsModel.splice(index,1); + return true; + } + }); + }); + this.totalrow -= _datas.length; + this.$emit('remove', null); + this.selections = []; + resolve(response); + }).catch((response: any) => { + if (response && response.status === 401) { + return; + } + if (!response || !response.status || !response.data) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) }); + reject(response); + return; + } + reject(response); + }); + }); + } + + dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, ''); + this.$Modal.confirm({ + title: (this.$t('app.commonWords.warning') as string), + content: (this.$t('app.gridpage.confirmDel') as string)+' ' + dataInfo + '锛�'+(this.$t('app.gridpage.notRecoverable') as string), + onOk: () => { + removeData(); + }, + onCancel: () => { } + }); + return removeData; + } + + + /** + * 鎵归噺娣诲姞 + * + * @param {*} [arg={}] + * @memberof UpdateDefaultBase + */ + public addBatch(arg: any = {}): void { + if(!this.fetchAction){ + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUpdateDefaultGridView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) }); + return; + } + if(!arg){ + arg = {}; + } + console.error((this.$t('app.gridpage.notBatch') as string)); + } + + /** + * 鏁版嵁瀵煎叆 + * + * @param {*} data + * @memberof UpdateDefaultBase + */ + public importExcel(data:any ={}):void{ + //瀵煎叆excel + const importDataModel:any ={ + } + if(Object.keys(importDataModel).length == 0){ + this.$Notice.warning({ 'title': (this.$t("app.utilview.warning") as string), 'desc': (this.$t("app.utilview.info") as string) }); + return; + } + const view:any ={ + viewname: 'app-data-upload', + title: this.$t("app.utilview.importview"), + width: 900, + height: 700 + } + let container: Subject<any> = this.$appmodal.openModal(view, JSON.parse(JSON.stringify(this.context)), importDataModel); + container.subscribe((result: any) => { + if(Object.is(result.ret,'OK')){ + this.refresh(result.datas); + } + }); + } + + + /** + * 鏁版嵁瀵煎嚭 + * + * @param {*} data + * @memberof UpdateDefaultBase + */ + public exportExcel(data: any = {}): void { + // 瀵煎嚭Excel + const doExport = async (_data:any) => { + const tHeader: Array<any> = []; + const filterVal: Array<any> = []; + this.allColumns.forEach((item: any) => { + item.show && item.label ? tHeader.push(this.$t(item.langtag)) : ""; + item.show && item.name ? filterVal.push(item.name) : ""; + }); + const data = await this.formatExcelData(filterVal, _data); + this.$export.exportExcel().then((excel:any)=>{ + excel.export_json_to_excel({ + header: tHeader, //琛ㄥご 蹇呭~ + data, //鍏蜂綋鏁版嵁 蹇呭~ + filename: "鍥句功"+(this.$t('app.gridpage.grid') as string), //闈炲繀濉� + autoWidth: true, //闈炲繀濉� + bookType: "xlsx" //闈炲繀濉� + }); + }); + }; + const page: any = {}; + // 璁剧疆page锛宻ize + if (Object.is(data.type, 'maxRowCount')) { + Object.assign(page, { page: 0, size: data.maxRowCount }); + } else if (Object.is(data.type, 'activatedPage')) { + try { + doExport(JSON.parse(JSON.stringify(this.items))); + } catch (error) { + console.error(error); + } + return; + } + // 璁剧疆鎺掑簭 + if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) { + const sort: string = this.minorSortPSDEF+","+this.minorSortDir; + Object.assign(page, { sort: sort }); + } + const arg: any = {}; + Object.assign(arg, page); + // 鑾峰彇query,鎼滅储琛ㄥ崟锛寁iewparams绛夌埗鏁版嵁 + const parentdata: any = {}; + this.$emit('beforeload', parentdata); + Object.assign(arg, parentdata); + const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator); + post.then((response: any) => { + if (!response || response.status !== 200) { + this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string)+',' + response.info }); + return; + } + try { + doExport(JSON.parse(JSON.stringify(response.data))); + } catch (error) { + console.error(error); + } + }).catch((response: any) => { + if (response && response.status === 401) { + return; + } + this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string) }); + }); + } + + + /** + * 瀵煎嚭鏁版嵁鏍煎紡鍖� + * + * @param {*} filterVal + * @param {*} jsonData + * @returns {[]} + * @memberof UpdateDefaultBase + */ + public async formatExcelData(filterVal:any, jsonData:any) { + let codelistColumns:Array<any> = [ + ]; + let _this = this; + for (const codelist of codelistColumns) { + // 鍔ㄦ€佷唬鐮佽〃澶勭悊 + if (Object.is(codelist.codelistType, "DYNAMIC")) { + let items = await _this.codeListService.getItems(codelist.srfkey); + jsonData.forEach((row:any)=>{ + row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist); + }); + // 闈欐€佸鐞� + } else if(Object.is(codelist.codelistType, "STATIC")){ + let items = await _this.$store.getters.getCodeListItems(codelist.srfkey); + jsonData.forEach((row:any)=>{ + row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist); + }); + } + } + return jsonData.map((v:any) => filterVal.map((j:any) => v[j])) + } + + + /** + * 瑙f瀽浠g爜琛ㄥ拰vlaue锛岃缃甶tems + * + * @public + * @param {any[]} items 浠g爜琛ㄦ暟鎹� + * @param {*} value + * @returns {*} + * @memberof UpdateDefaultBase + */ + public getCodelistValue(items: any[], value: any, codelist: any,){ + if(!value && value !== 0 && value !== false){ + return this.$t('codelist.'+codelist.srfkey+'.empty'); + } + if (items) { + let result:any = []; + if(Object.is(codelist.renderMode,"number")){ + items.map((_item: any, index: number)=>{ + const nValue = parseInt((value as any), 10); + const codevalue = _item.value; + if((parseInt(codevalue, 10) & nValue) > 0){ + result.push(_item); + } + }); + } else if(Object.is(codelist.renderMode,"string")){ + const arrayValue: Array<any> = (value as any).split(codelist.valueSeparator); + arrayValue.map((value: any, index: number) => { + result.push([]); + let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)]; + values.map((val:any ,num: number)=>{ + const item = this.getItem(items, val, codelist); + if(item){ + result[index].push(item); + } + }); + }); + } else { + let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)]; + values.map((value:any ,index: number)=>{ + const item = this.getItem(items, value, codelist); + if(item){ + result.push(item); + } + }); + } + // 璁剧疆items + if(result.length != 0){ + return result.join(codelist.valueSeparator); + }else{ + return value; + } + } + } + + /** + * 鑾峰彇浠g爜椤� + * + * @public + * @param {any[]} items + * @param {*} value + * @returns {*} + * @memberof UpdateDefaultBase + */ + public getItem(items: any[], value: any, codelist: any): any { + const arr: Array<any> = items.filter(item => {return item.value == value}); + if (arr.length !== 1) { + return undefined; + } + if(Object.is(codelist.codelistType,'STATIC')){ + return this.$t('codelist.'+codelist.srfkey+'.'+arr[0].value); + }else{ + return arr[0].text; + } + } + + /** + * 鐢熷懡鍛ㄦ湡 + * + * @memberof UpdateDefaultBase + */ + public created(): void { + this.afterCreated(); + } + + /** + * 鎵цcreated鍚庣殑閫昏緫 + * + * @memberof UpdateDefaultBase + */ + public afterCreated(){ + this.setColState(); + if (this.viewState) { + this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => { + if (!Object.is(tag, this.name)) { + return; + } + if (Object.is('load', action)) { + this.load(data,true); + } + if (Object.is('remove', action)) { + this.remove(data); + } + if (Object.is('save', action)) { + this.save(data); + } + }); + } + if(AppCenterService && AppCenterService.getMessageCenter()){ + this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{ + if(!Object.is(name,"IBIZBOOK")){ + return; + } + if(Object.is(action,'appRefresh')){ + this.refresh([data]); + } + }) + } + } + + /** + * vue 鐢熷懡鍛ㄦ湡 + * + * @memberof UpdateDefaultBase + */ + public destroyed() { + this.afterDestroy(); + } + + /** + * 鎵цdestroyed鍚庣殑閫昏緫 + * + * @memberof UpdateDefaultBase + */ + public afterDestroy() { + if (this.viewStateEvent) { + this.viewStateEvent.unsubscribe(); + } + if(this.appStateEvent){ + this.appStateEvent.unsubscribe(); + } + } + + /** + * 鑾峰彇閫変腑琛岃儭鏁版嵁 + * + * @returns {any[]} + * @memberof UpdateDefaultBase + */ + public getSelection(): any[] { + return this.selections; + } + + /** + * 琛屽弻鍑讳簨浠� + * + * @param {*} $event + * @returns {void} + * @memberof UpdateDefaultBase + */ + public rowDBLClick($event: any): void { + // 鍒嗙粍琛岃烦杩� + if($event && $event.children && $event.children.length >0){ + return; + } + if (!$event || this.actualIsOpenEdit || Object.is(this.gridRowActiveMode,0)) { + return; + } + this.selections = []; + this.selections.push(JSON.parse(JSON.stringify($event))); + + const refs: any = this.$refs; + if (refs.multipleTable) { + refs.multipleTable.clearSelection(); + refs.multipleTable.toggleRowSelection($event); + } + + this.$emit('rowdblclick', this.selections); + this.$emit('selectionchange', this.selections); + } + + /** + * 鍚堝苟鍒嗙粍琛� + * + * @memberof UpdateDefaultBase + */ + public arraySpanMethod({row, column, rowIndex, columnIndex} : any) { + let allColumns:Array<any> = ['ibizbookname','author','type','press','price','updatedate']; + if(row && row.children && row.children.length>0) { + if(columnIndex == (this.isSingleSelect ? 0:1)) { + return [1, allColumns.length+1]; + } else if(columnIndex > (this.isSingleSelect ? 0:1)) { + return [0,0]; + } + } + } + + /** + * 缁樺埗鍒嗙粍 + * + * @memberof UpdateDefaultBase + */ + public drawGroup(){ + if(!this.isEnableGroup) return; + // 鍒嗙粍 + let allGroup: Array<any> = []; + this.items.forEach((item: any)=>{ + if(item.hasOwnProperty(this.groupAppField)){ + allGroup.push(item[this.groupAppField]); + } + }); + let groupTree:Array<any> = []; + allGroup = [...new Set(allGroup)]; + if(allGroup.length == 0){ + console.warn("鍒嗙粍鏁版嵁鏃犳晥"); + } + // 缁勮鏁版嵁 + allGroup.forEach((group: any, groupIndex: number)=>{ + let children:Array<any> = []; + this.items.forEach((item: any,itemIndex: number)=>{ + if(Object.is(group,item[this.groupAppField])){ + item.groupById = Number((groupIndex+1) * 10 + (itemIndex+1) * 1); + item.group = ''; + children.push(item); + } + }); + group = group ? group : this.$t('app.gridpage.other'); + const tree: any ={ + groupById: Number((groupIndex+1)*10), + group: group, + ibizbookname:'', + author:'', + type:'', + press:'', + price:'', + updatedate:'', + children: children, + } + groupTree.push(tree); + }); + this.items = groupTree; + if(this.actualIsOpenEdit) { + for(let i = 0; i < this.items.length; i++) { + this.gridItemsModel.push(this.getGridRowModel()); + } + } + } + + /** + * 鍗曚釜澶嶉€夋閫変腑 + * + * @param {*} selection 鎵€鏈夐€変腑琛屾暟鎹� + * @param {*} row 褰撳墠閫変腑琛屾暟鎹� + * @memberof UpdateDefaultBase + */ + public select(selection: any, row: any): void { + if(this.groupAppField) { + let isContain:boolean = selection.some((item:any) =>{ + return item == row; + }) + // 鏄惁閫変腑褰撳墠琛岋紝閫変腑涓簍rue锛屽惁鍒欎负false + if(isContain) { + // 褰撳墠琛屼负鍒嗙粍琛� + if(row.children && row.children.length > 0) { + this.toggleSelection(row.children, true); + row.children.forEach((children: any) => { + this.selections.push(children); + }); + } else { + this.selections.push(row); + } + } else { + if(row.children && row.children.length > 0) { + this.toggleSelection(row.children, false); + this.selections = this.computeCheckedData(this.selections, row.children); + } else { + this.selections = this.computeCheckedData(this.selections, row); + } + } + this.selections = [...new Set(this.selections)] + } else { + if(!selection) { + return; + } + this.selections = [...JSON.parse(JSON.stringify(selection))]; + } + this.$emit('selectionchange', this.selections); + } + + /** + * 璁$畻褰撳墠閫変腑鏁版嵁 + * + * @param {*} selectionArray 鎵€鏈夐€変腑琛屾暟鎹� + * @param {*} cancelData 琚彇娑堥€変腑琛屾暟鎹紝鍒嗙粍琛屼负鏁扮粍锛岄潪鍒嗙粍琛屼负瀵硅薄 + * @memberof UpdateDefaultBase + */ + public computeCheckedData(selectionArray: any[], cancelData: Array<any> | any) { + let targetArray: Array<any> = []; + // 鍒嗙粍琛� + if(Array.isArray(cancelData)) { + if(selectionArray && selectionArray.length > 0) { + selectionArray.forEach((selection:any) =>{ + let tempFlag:boolean = true; + cancelData.forEach((child:any) =>{ + if(selection.groupById===child.groupById){ + tempFlag = false; + } + }) + if(tempFlag) targetArray.push(selection); + }) + } + } else { + // 闈炲垎缁勮 + if(selectionArray && selectionArray.length > 0) { + selectionArray.forEach((selection:any) =>{ + let tempFlag:boolean = true; + if(selection.groupById===cancelData.groupById){ + tempFlag = false; + } + if(tempFlag) targetArray.push(selection); + }) + } + } + return targetArray; + } + + /** + * 璁剧疆闈炲垎缁勮checkbox閫変腑鐘舵€� + * + * @param {*} rows 閫変腑鏁版嵁鏁扮粍 + * @param {boolean} flag 鏄惁閫変腑 + * @memberof UpdateDefaultBase + */ + public toggleSelection(rows?: any, flag?: boolean) { + if(rows) { + rows.forEach((row:any) => { + (this.$refs.multipleTable as any).toggleRowSelection(row, flag); + }); + } else { + (this.$refs.multipleTable as any).clearSelection(); + } + } + + /** + * 澶嶉€夋鏁版嵁鍏ㄩ儴閫変腑 + * + * @param {*} $event + * @memberof UpdateDefaultBase + */ + public selectAll(selection: any): void { + this.selections = []; + if(this.groupAppField) { + let flag: boolean = true; + if(selection && selection.length === this.items.length) { + selection.forEach((element: any) => { + if(element.children && element.children.length > 0) { + this.toggleSelection(element.children, flag); + element.children.forEach((children: any) => { + this.selections.push(children); + }); + } else { + flag = false; + } + }); + } else { + flag = false; + } + if(!flag) { + this.toggleSelection(); + } + } else { + if(!selection) { + return; + } + this.selections = [...JSON.parse(JSON.stringify(selection))]; + } + this.$emit('selectionchange', this.selections); + } + + + /** + * 琛屽崟鍑婚€変腑 + * + * @param {*} $event + * @returns {void} + * @memberof UpdateDefaultBase + */ + public rowClick($event: any, ifAlways: boolean = false): void { + // 鍒嗙粍琛岃烦杩� + if($event && $event.children && $event.children.length >0){ + return; + } + if (!ifAlways && (!$event || this.actualIsOpenEdit)) { + return; + } + if(this.stopRowClick) { + this.stopRowClick = false; + return; + } + if(this.isSingleSelect){ + this.selections = []; + } + // 宸查€変腑鍒欏垹闄わ紝娌¢€変腑鍒欐坊鍔� + let selectIndex = this.selections.findIndex((item:any)=>{ + return Object.is(item.ibizbook,$event.ibizbook); + }); + if (Object.is(selectIndex,-1)){ + this.selections.push(JSON.parse(JSON.stringify($event))); + } else { + this.selections.splice(selectIndex,1); + } + + const refs: any = this.$refs; + if (refs.multipleTable) { + if(this.isSingleSelect){ + refs.multipleTable.clearSelection(); + refs.multipleTable.setCurrentRow($event); + }else{ + refs.multipleTable.toggleRowSelection($event); + } + } + + this.$emit('selectionchange', this.selections); + } + + + /** + * 椤甸潰鍙樺寲 + * + * @param {*} $event + * @returns {void} + * @memberof UpdateDefaultBase + */ + public pageOnChange($event: any): void { + if (!$event) { + return; + } + if ($event === this.curPage) { + return; + } + this.curPage = $event; + this.load({}); + } + + /** + * 鍒嗛〉鏉℃暟鍙樺寲 + * + * @param {*} $event + * @returns {void} + * @memberof UpdateDefaultBase + */ + public onPageSizeChange($event: any): void { + if (!$event) { + return; + } + if ($event === this.limit) { + return; + } + this.limit = $event; + if (this.curPage === 1) { + this.load({}); + } + } + + /** + * 鍒嗛〉鍒锋柊 + * + * @memberof UpdateDefaultBase + */ + public pageRefresh(): void { + this.load({}); + } + + /** + * 鎺掑簭鍙樺寲 + * + * @param {{ column: any, prop: any, order: any }} { column, prop, order } + * @memberof UpdateDefaultBase + */ + public onSortChange({ column, prop, order }: { column: any, prop: any, order: any }): void { + const dir = Object.is(order, 'ascending') ? 'asc' : Object.is(order, 'descending') ? 'desc' : ''; + if (Object.is(dir, this.minorSortDir) && Object.is(this.minorSortPSDEF, prop)) { + return; + } + this.minorSortDir = dir; + this.minorSortPSDEF = prop ? prop : ''; + this.load({}); + } + + /** + * 琛ㄦ牸琛岄€変腑鏍峰紡 + * + * @param {{ row: any, rowIndex: any }} { row, rowIndex } + * @returns {string} + * @memberof UpdateDefaultBase + */ + public onRowClassName({ row, rowIndex }: { row: any, rowIndex: any }): string { + const index = this.selections.findIndex((select: any) => Object.is(select.srfkey, row.srfkey)); + return index !== -1 ? 'grid-row-select' : ''; + } + + + + /** + * 鐣岄潰琛屼负 + * + * @param {*} row + * @param {*} tag + * @param {*} $event + * @memberof UpdateDefaultBase + */ + public uiAction(row: any, tag: any, $event: any) { + // this.rowClick(row, true); + $event.stopPropagation(); + } + + /** + * 璁剧疆鍒楃姸鎬� + * + * @memberof UpdateDefaultBase + */ + public setColState() { + const _data: any = localStorage.getItem('ibizbook_updatedefault_grid'); + if (_data) { + let columns = JSON.parse(_data); + columns.forEach((col: any) => { + let column = this.allColumns.find((item) => Object.is(col.name, item.name)); + if (column) { + Object.assign(column, col); + } + }); + } + } + + /** + * 鍒楀彉鍖� + * + * @memberof UpdateDefaultBase + */ + public onColChange() { + localStorage.setItem('ibizbook_updatedefault_grid', JSON.stringify(this.allColumns)); + } + + /** + * 鑾峰彇鍒楃姸鎬� + * + * @param {string} name + * @returns {boolean} + * @memberof UpdateDefaultBase + */ + public getColumnState(name: string): boolean { + let column = this.allColumns.find((col: any) => + Object.is(name, col.name) + ); + return column.show ? true : false; + } + + /** + * 琛ㄦ牸鍒楁槸鍚﹁嚜閫傚簲甯冨眬 + * + * @readonly + * @type {boolean} + * @memberof UpdateDefaultBase + */ + get adaptiveState(): boolean { + return !this.allColumns.find((column: any) => column.show && Object.is(column.unit, 'STAR')); + } + + /** + * 淇濆瓨 + * + * @param {*} $event + * @returns {Promise<any>} + * @memberof UpdateDefaultBase + */ + public async save(args: any[], params?: any, $event?: any, xData?: any){ + let _this = this; + // 鎷疯礉妯″紡 + if(_this.viewparams && _this.viewparams.copymode && Object.is(_this.viewparams.copymode,'true') && _this.items && _this.items.length >0){ + for (const item of _this.items) { + item.rowDataState = 'create'; + } + } + if(_this.items && _this.items.length >0){ + for (const item of _this.items) { + if(Object.is(item.rowDataState, 'update')){ + _this.updateDefault(item); + } + } + } + if (!await this.validateAll()) { + if(this.errorMessages && this.errorMessages.length > 0) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: this.errorMessages[0] }); + } else { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) }); + } + return []; + } + let successItems:any = []; + let errorItems:any = []; + let errorMessage:any = []; + for (const item of _this.items) { + try { + if(Object.is(item.rowDataState, 'create')){ + if(!this.createAction){ + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUpdateDefaultGridView'+(this.$t('app.gridpage.notConfig.createAction') as string) }); + }else{ + Object.assign(item,{viewparams:this.viewparams}); + let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator); + successItems.push(JSON.parse(JSON.stringify(response.data))); + } + }else if(Object.is(item.rowDataState, 'update')){ + if(!this.updateAction){ + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUpdateDefaultGridView'+(this.$t('app.gridpage.notConfig.updateAction') as string) }); + }else{ + Object.assign(item,{viewparams:this.viewparams}); + if(item.ibizbook){ + Object.assign(this.context,{ibizbook:item.ibizbook}); + } + let response = await this.service.update(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator); + successItems.push(JSON.parse(JSON.stringify(response.data))); + } + } + } catch (error) { + errorItems.push(JSON.parse(JSON.stringify(item))); + errorMessage.push(error); + } + } + this.$emit('save', successItems); + this.refresh([]); + if(errorItems.length === 0 && successItems.length >0 && !this.isformDruipart){ + this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) }); + }else{ + errorItems.forEach((item: any, index: number) => { + if(errorMessage[index] && errorMessage[index].data) { + if(Object.is(errorMessage[index].data.errorKey, 'DupCheck')) { + let errorProp: string = errorMessage[index].data.message.match(/\[[a-zA-Z]*\]/)[0]; + let name: string = errorProp ? this.service.getNameByProp(errorProp.substr(1, errorProp.length-2)) : ''; + if(name) { + let desc: any = this.allColumns.find((column: any) =>{ + return Object.is(column.name, name); + }); + this.$Notice.error({ + title: (this.$t('app.commonWords.createFailed') as string), + desc: (desc ? desc.label : '') + " : " + item[name] + (this.$t('app.commonWords.isExist') as string) + '!', + }); + } else { + this.$Notice.error({ + title: (this.$t('app.commonWords.createFailed') as string), + desc: errorMessage[index].data.message?errorMessage[index].data.message:(this.$t('app.commonWords.sysException') as string), + }); + } + } else if(Object.is(errorMessage[index].data.errorKey, 'DuplicateKeyException')){ + this.$Notice.error({ + title: (this.$t('app.commonWords.saveFailed') as string), + desc: errorMessage[index].data.message?errorMessage[index].data.message:(this.$t('app.commonWords.sysException') as string), + }); + }else { + this.$Notice.error({ + title: (this.$t('app.commonWords.saveFailed') as string), + desc: errorMessage[index].data.message?errorMessage[index].data.message:(this.$t('app.commonWords.sysException') as string), + }); + } + } else { + this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: (item[this.majorInfoColName]?item[this.majorInfoColName]:"") + (this.$t('app.commonWords.saveFailed') as string) + '!' }); + } + }); + } + return successItems; + } + + /** + * 鏂板缓琛� + * + * @param {*} $event + * @returns {void} + * @memberof UpdateDefaultBase + */ + public newRow(args: any[], params?: any, $event?: any, xData?: any): void { + if(!this.loaddraftAction){ + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUpdateDefaultGridView'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) }); + return; + } + let _this = this; + Object.assign(args[0],{viewparams:this.viewparams}); + let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator); + post.then((response: any) => { + if (!response.status || response.status !== 200) { + if (response.errorMessage) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage }); + } + return; + } + const data = response.data; + this.createDefault(data); + data.rowDataState = "create"; + let tempItems: any[] = []; + tempItems.push(data); + _this.items = tempItems.concat(_this.items); + _this.gridItemsModel.push(_this.getGridRowModel()); + }).catch((response: any) => { + if (response && response.status === 401) { + return; + } + if (!response || !response.status || !response.data) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) }); + return; + } + }); + } + + /** + * 琛ㄦ牸缂栬緫椤瑰€煎彉鏇� + * + * @param row 琛屾暟鎹� + * @param {{ name: string, value: any }} $event + * @returns {void} + * @memberof UpdateDefaultBase + */ + public onGridItemValueChange(row: any,$event: { name: string, value: any },rowIndex: number): void { + if (!$event) { + return; + } + if (!$event.name || Object.is($event.name, '') || !row.hasOwnProperty($event.name)) { + return; + } + row[$event.name] = $event.value; + this.gridEditItemChange(row, $event.name, $event.value, rowIndex); + } + + /** + * 琛ㄦ牸缂栬緫椤瑰€煎彉鍖� + * + * @public + * @param row 琛屾暟鎹� + * @param property 鍒楃紪杈戦」鍚� + * @param row 鍒楃紪杈戦」鍊� + * @returns {void} + * @memberof UpdateDefaultBase + */ + public gridEditItemChange(row: any, property: string, value: any, rowIndex: number){ + row.rowDataState = row.rowDataState ? row.rowDataState : "update" ; + if(Object.is(row.rowDataState,"update")){ + if(!value && this.defaultUpdateItems.includes(property)){ + row.hasUpdated = true; + } + } + this.curEditRowData = row; + this.validate(property,row,rowIndex); + } + + /** + * 琛ㄦ牸缂栬緫椤规洿鏂� + * + * @param {string} mode 鐣岄潰琛屼负鍚嶇О + * @param {*} [data={}] 璇锋眰鏁版嵁 + * @param {string[]} updateDetails 鏇存柊椤� + * @param {boolean} [showloading] 鏄惁鏄剧ず鍔犺浇鐘舵€� + * @returns {void} + * @memberof UpdateDefaultBase + */ + public updateGridEditItem(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void { + if (!mode || (mode && Object.is(mode, ''))) { + return; + } + let tempContext: any = this.$util.deepCopy(this.context); + const arg: any = JSON.parse(JSON.stringify(data)); + Object.assign(arg,{viewparams:this.viewparams}); + const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(tempContext)),arg, showloading); + post.then((response: any) => { + if (!response || response.status !== 200) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.formitemFailed') as string) }); + return; + } + const _data: any = response.data; + if(!_data){ + return; + } + updateDetails.forEach((name: string) => { + if (!_data.hasOwnProperty(name)) { + return; + } + data[name] = _data[name]; + }); + }).catch((response: any) => { + if (response && response.status === 401) { + return; + } + if (!response || !response.status || !response.data) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) }); + return; + } + }); + } + + /** + * 鑾峰彇瀵瑰簲琛宑lass + * + * @param {*} $args row 琛屾暟鎹紝rowIndex 琛岀储寮� + * @returns {void} + * @memberof UpdateDefaultBase + */ + public getRowClassName(args:{row: any,rowIndex: number}){ + let isSelected = this.selections.some((item:any)=>{ + return Object.is(item.ibizbook,args.row.ibizbook); + }); + return isSelected ? "grid-selected-row" : ""; + } + + /** + * 鑾峰彇瀵瑰簲鍗曞厓鏍糲lass + * + * @param {*} $args row 琛屾暟鎹紝column 鍒楁暟鎹紝rowIndex 琛岀储寮曪紝columnIndex 鍒楃储寮� + * @returns {void} + * @memberof UpdateDefaultBase + */ + public getCellClassName(args:{row: any, column: any, rowIndex: number, columnIndex:number}){ + let className: string = ''; + if(args.column.property){ + let col = this.allColumns.find((item:any)=>{ + return Object.is(args.column.property,item.name); + }) + if(col !== undefined){ + if(col.isEnableRowEdit && this.actualIsOpenEdit ){ + className += 'edit-cell '; + } + } else { + className += 'info-cell'; + } + } + if(this.groupAppField && args.columnIndex === 0 && !this.isSingleSelect) { + if(args.row.children && args.row.children.length > 0) { + className += this.computeGroupRow(args.row.children, args.row); + } + } + return className; + } + + /** + * 璁$畻鍒嗙粍琛宑heckbox閫変腑鏍峰紡 + * + * @param {*} rows 褰撳墠鍒嗙粍琛屼笅鐨勬墍鏈夋暟鎹� + * @returns {*} currentRow 褰撳墠鍒嗙粍琛� + * @memberof UpdateDefaultBase + */ + public computeGroupRow(rows: any[], currentRow: any) { + let count: number = 0; + this.selections.forEach((select: any) => { + rows.forEach((row: any) => { + if(row.groupById === select.groupById) { + count++; + } + }) + }) + if(count === rows.length) { + (this.$refs.multipleTable as any).toggleRowSelection(currentRow, true); + return 'cell-select-all '; + } else if(count !== 0 && count < rows.length) { + return 'cell-indeterminate ' + } else if(count === 0) { + (this.$refs.multipleTable as any).toggleRowSelection(currentRow, false); + return ''; + } + } + + /** + * 鏂板缓榛樿鍊� + * @param {*} row 琛屾暟鎹� + * @memberof UpdateDefaultBase + */ + public createDefault(row: any){ + } + + /** + * 鏇存柊榛樿鍊� + * @param {*} row 琛屾暟鎹� + * @memberof UpdateDefaultBase + */ + public updateDefault(row: any){ + if (row.hasOwnProperty('author') && !row.author && row.hasUpdated) { + row['author'] = this.context['srfusername']; + } + if (row.hasOwnProperty('ibizbookname') && !row.ibizbookname && row.hasUpdated) { + row['ibizbookname'] = '鏇存柊榛樿鍊硷細鍥句功'; + } + if (row.hasOwnProperty('price') && !row.price && row.hasUpdated) { + row['price'] = '133.3'; + } + if (row.hasOwnProperty('updatedate') && !row.updatedate && row.hasUpdated) { + row['updatedate'] = this.$util.dateFormat(new Date()); + } + if (row.hasOwnProperty('type') && !row.type && row.hasUpdated) { + row['type'] = this.context['booktype']; + } + } + + /** + * 璁$畻鏁版嵁瀵硅薄绫诲瀷鐨勯粯璁ゅ€� + * @param {string} action 琛屼负 + * @param {string} param 榛樿鍊煎弬鏁� + * @param {*} data 褰撳墠琛屾暟鎹� + * @memberof UpdateDefaultBase + */ + public computeDefaultValueWithParam(action:string,param:string,data:any){ + if(Object.is(action,"UPDATE")){ + const nativeData:any = this.service.getCopynativeData(); + if(nativeData && (nativeData instanceof Array) && nativeData.length >0){ + let targetData:any = nativeData.find((item:any) =>{ + return item.ibizbookid === data.srfkey; + }) + if(targetData){ + return targetData[param]?targetData[param]:null; + }else{ + return null; + } + }else{ + return null; + } + }else{ + return this.service.getRemoteCopyData()[param]?this.service.getRemoteCopyData()[param]:null; + } + } + + /** + * 鏍¢獙灞炴€у€艰鍒� + * + * @public + * @param {{ name: string }} { name } + * @memberof UpdateDefaultBase + */ + public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND",value:any) :{isPast:boolean}{ + let falg:any = {}; + if(!rule || !rule[name]){ + return falg; + } + let opValue = op == 'AND'? true :false; + let startOp = (val:boolean)=>{ + if(falg.isPast){ + if(opValue){ + falg.isPast = falg.isPast && val; + }else{ + falg.isPast = falg.isPast || val; + } + }else{ + falg.isPast = val; + } + } + rule[name].forEach((item:any) => { + if((value === null || value === undefined || value === "") && (item.type != 'GROUP')){ + startOp(true); + return falg; + } + // 甯歌瑙勫垯 + if(item.type == 'SIMPLE'){ + startOp(!this.$verify.checkFieldSimpleRule(value,item.condOP,item.paramValue,item.ruleInfo,item.paramType,this.curEditRowData,item.isKeyCond)); + } + // 鏁板€艰寖鍥� + if(item.type == 'VALUERANGE2'){ + startOp( !this.$verify.checkFieldValueRangeRule(value,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond)); + } + // 姝e垯寮� + if (item.type == "REGEX") { + startOp(!this.$verify.checkFieldRegExRule(value,item.regExCode,item.ruleInfo,item.isKeyCond)); + } + // 闀垮害 + if (item.type == "STRINGLENGTH") { + startOp(!this.$verify.checkFieldStringLengthRule(value,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond)); + } + // 绯荤粺鍊艰鍒� + if(item.type == "SYSVALUERULE") { + startOp(!this.$verify.checkFieldSysValueRule(value,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond)); + } + // 鍒嗙粍 + if(item.type == 'GROUP'){ + falg = this.verifyDeRules('group',item,item.condOP?item.condOP:"AND",value) + if(item.isNotMode){ + falg.isPast = !falg.isPast; + } + } + + }); + if(!falg.hasOwnProperty("isPast")){ + falg.isPast = true; + } + if(!value){ + falg.isPast = true; + } + return falg; + } + + /** + * 宸ヤ綔娴佹彁浜� + * + * @param {*} [data={}] + * @param {*} [localdata={}] + * @returns {Promise<any>} + * @memberof UpdateDefaultBase + */ + public async submitbatch(data: any,localdata:any): Promise<any> { + return new Promise((resolve: any, reject: any) => { + const _this: any = this; + const arg: any = data; + const result: Promise<any> = this.service.submitbatch(_this.WFSubmitAction, JSON.parse(JSON.stringify(this.context)),arg,localdata,this.showBusyIndicator); + result.then((response: any) => { + if (!response || response.status !== 200) { + if(response.data){ + this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.submiterror') as string) + ', ' + response.data.message }); + } + return; + } + this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.submitsuccess') as string) }); + resolve(response); + }).catch((response: any) => { + if (response && response.status && response.data) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message }); + reject(response); + return; + } + if (!response || !response.status || !response.data) { + this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) }); + reject(response); + return; + } + reject(response); + }); + }) + } + + /** + * 鑾峰彇琛ㄦ牸鍒楃鐢ㄧ姸鎬� + * + * @memberof UpdateDefaultBase + */ + public getColumnDisabled(data:any,name:string){ + if(this.allColumns || Array.isArray(this.allColumns)){ + const curColumn:any = this.allColumns.find((item:any) =>{ + return item.name === name; + }) + if(curColumn.hasOwnProperty('enableCond')){ + return data.srfuf == 1 ? (curColumn.enableCond & 2) !== 2 : (curColumn.enableCond & 1) !== 1 + }else{ + return false; + } + } + } + +} +</script> + +<style lang='less'> +@import './update-default-grid.less'; +</style> \ No newline at end of file diff --git a/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-model.ts b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-model.ts new file mode 100644 index 000000000..e2e2d6f0c --- /dev/null +++ b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-model.ts @@ -0,0 +1,131 @@ +/** + * UpdateDefault 閮ㄤ欢妯″瀷 + * + * @export + * @class UpdateDefaultModel + */ +export default class UpdateDefaultModel { + + /** + * 鏄惁鏄疄浣撴暟鎹鍑� + * + * @returns {any[]} + * @memberof UpdateDefaultGridMode + */ + public isDEExport: boolean = false; + + /** + * 鑾峰彇鏁版嵁椤归泦鍚� + * + * @returns {any[]} + * @memberof UpdateDefaultGridMode + */ + public getDataItems(): any[] { + if(this.isDEExport){ + return [ + ] + }else{ + return [ + { + name: 'author', + prop: 'author', + dataType: 'TEXT', + isEditable:true + }, + { + name: 'press', + prop: 'press', + dataType: 'TEXT', + isEditable:true + }, + { + name: 'ibizbookname', + prop: 'ibizbookname', + dataType: 'TEXT', + isEditable:true + }, + { + name: 'price', + prop: 'price', + dataType: 'CURRENCY', + isEditable:true + }, + { + name: 'ibizbookid', + prop: 'ibizbookid', + dataType: 'GUID', + }, + { + name: 'updatedate', + prop: 'updatedate', + dataType: 'DATETIME', + isEditable:true + }, + { + name: 'type', + prop: 'type', + dataType: 'TEXT', + isEditable:true + }, + { + name: 'srfmajortext', + prop: 'ibizbookname', + dataType: 'TEXT', + }, + { + name: 'srfdataaccaction', + prop: 'ibizbookid', + dataType: 'GUID', + }, + { + name: 'srfkey', + prop: 'ibizbookid', + dataType: 'GUID', + isEditable:true + }, + { + name: 'ibizbook', + prop: 'ibizbookid', + }, + + { + name:'size', + prop:'size', + dataType: 'QUERYPARAM' + }, + { + name:'query', + prop:'query', + dataType: 'QUERYPARAM' + }, + { + name:'filter', + prop:'filter', + dataType: 'QUERYPARAM' + }, + { + name:'page', + prop:'page', + dataType: 'QUERYPARAM' + }, + { + name:'sort', + prop:'sort', + dataType: 'QUERYPARAM' + }, + { + name:'srfparentdata', + prop:'srfparentdata', + dataType: 'QUERYPARAM' + }, + // 鍓嶇鏂板淇敼鏍囪瘑锛屾柊澧炰负"0",淇敼涓�"1"鎴栨湭璁惧€� + { + name: 'srffrontuf', + prop: 'srffrontuf', + dataType: 'TEXT', + }, + ] + } + } + +} \ No newline at end of file diff --git a/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-service.ts b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-service.ts new file mode 100644 index 000000000..579c5b2f5 --- /dev/null +++ b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid-service.ts @@ -0,0 +1,494 @@ +import { Http,Util,Errorlog } from '@/utils'; +import ControlService from '@/widgets/control-service'; +import IBIZBOOKService from '@/service/ibizbook/ibizbook-service'; +import UpdateDefaultModel from './update-default-grid-model'; + + +/** + * UpdateDefault 閮ㄤ欢鏈嶅姟瀵硅薄 + * + * @export + * @class UpdateDefaultService + */ +export default class UpdateDefaultService extends ControlService { + + /** + * 鍥句功鏈嶅姟瀵硅薄 + * + * @type {IBIZBOOKService} + * @memberof UpdateDefaultService + */ + public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.getStore() }); + + /** + * 璁剧疆浠庢暟鎹ā寮� + * + * @type {boolean} + * @memberof UpdateDefaultService + */ + public setTempMode(){ + this.isTempMode = false; + } + + /** + * Creates an instance of UpdateDefaultService. + * + * @param {*} [opts={}] + * @memberof UpdateDefaultService + */ + constructor(opts: any = {}) { + super(opts); + this.model = new UpdateDefaultModel(); + } + + /** + * 澶囦唤鍘熺敓鏁版嵁 + * + * @type {*} + * @memberof UpdateDefaultService + */ + private copynativeData:any; + + /** + * 杩滅鏁版嵁 + * + * @type {*} + * @memberof UpdateDefaultService + */ + private remoteCopyData:any = {}; + + + /** + * 澶勭悊鏁版嵁 + * + * @public + * @param {Promise<any>} promise + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + public doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> { + return new Promise((resolve, reject) => { + promise.then((response: any) => { + if (response && response.status === 200) { + const data = response.data; + data.forEach((item:any,index:number) =>{ + item[deName] = item[deKeyField]; + data[index] = item; + }); + resolve(data); + } else { + reject([]) + } + }).catch((response: any) => { + reject([]) + }); + }); + } + + /** + * 鑾峰彇璺ㄥ疄浣撴暟鎹泦鍚� + * + * @param {string} serviceName 鏈嶅姟鍚嶇О + * @param {string} interfaceName 鎺ュ彛鍚嶇О + * @param {*} data + * @param {boolean} [isloading] + * @returns {Promise<any[]>} + * @memberof UpdateDefaultService + */ + @Errorlog + public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> { + data.page = data.page ? data.page : 0; + data.size = data.size ? data.size : 1000; + + return Promise.reject([]) + } + + /** + * 娣诲姞鏁版嵁 + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true); + return new Promise((resolve: any, reject: any) => { + const _appEntityService: any = this.appEntityService; + let result: Promise<any>; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data, isloading); + }else{ + result =_appEntityService.Create(Context,Data, isloading); + } + result.then((response) => { + this.handleResponse(action, response); + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + /** + * 鍒犻櫎鏁版嵁 + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); + return new Promise((resolve: any, reject: any) => { + const _appEntityService: any = this.appEntityService; + let result: Promise<any>; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data, isloading); + }else{ + result =_appEntityService.Remove(Context,Data, isloading); + } + result.then((response) => { + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + /** + * 淇敼鏁版嵁 + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true); + return new Promise((resolve: any, reject: any) => { + const _appEntityService: any = this.appEntityService; + let result: Promise<any>; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data,isloading); + }else{ + result =_appEntityService.Update(Context,Data,isloading); + } + result.then((response) => { + this.handleResponse(action, response); + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + /** + * 鑾峰彇鏁版嵁 + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public get(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); + return new Promise((resolve: any, reject: any) => { + let result: Promise<any>; + const _appEntityService: any = this.appEntityService; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data, isloading); + } else { + result = this.appEntityService.Get(Context,Data, isloading); + } + result.then((response) => { + //澶勭悊杩斿洖鏁版嵁锛岃ˉ鍏呭垽鏂爣璇� + if(response.data){ + Object.assign(response.data,{srfuf:'0'}); + } + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + /** + * 鏌ヨ鏁版嵁 + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public search(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); + return new Promise((resolve: any, reject: any) => { + const _appEntityService: any = this.appEntityService; + let result: Promise<any>; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data, isloading); + }else{ + result =_appEntityService.FetchDefault(Context,Data, isloading); + } + result.then((response) => { + this.setCopynativeData(response.data); + this.handleResponse(action, response); + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + + /** + * 鍔犺浇鑽夌ǹ + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public loadDraft(action: string, context: any = {}, data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); + return new Promise((resolve: any, reject: any) => { + let result: Promise<any>; + const _appEntityService: any = this.appEntityService; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data, isloading); + } else { + result = this.appEntityService.GetDraft(Context,Data, isloading); + } + result.then((response) => { + //澶勭悊杩斿洖鏁版嵁锛岃ˉ鍏呭垽鏂爣璇� + if(response.data){ + Object.assign(response.data,{srfuf:'0'}); + //浠跨湡涓婚敭鏁版嵁 + response.data.ibizbookid = Util.createUUID(); + } + this.setRemoteCopyData(response); + this.handleResponse(action, response, true); + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + + /** + * 鍓嶅彴閫昏緫 + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> { + const {data:Data,context:Context} = this.handleRequestData(action,context,data,true); + return new Promise((resolve: any, reject: any)=>{ + let result: Promise<any>; + const _appEntityService: any = this.appEntityService; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](Context,Data, isloading); + } else { + return Promise.reject({ status: 500, data: { title: '澶辫触', message: '绯荤粺寮傚父' } }); + } + result.then((response) => { + this.handleResponse(action, response); + resolve(response); + }).catch(response => { + reject(response); + }); + }) + } + + /** + * 澶勭悊璇锋眰鏁版嵁(淇敼鎴栧鍔犳暟鎹�) + * + * @param action 琛屼负 + * @param data 鏁版嵁 + * @memberof UpdateDefaultService + */ + public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){ + let model: any = this.getMode(); + if (!model && model.getDataItems instanceof Function) { + return data; + } + let dataItems: any[] = model.getDataItems(); + let requestData:any = {}; + if(isMerge && (data && data.viewparams)){ + Object.assign(requestData,data.viewparams); + } + dataItems.forEach((item:any) =>{ + if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){ + if(item && item.prop && item.name ){ + requestData[item.prop] = context[item.name]; + } + }else{ + if(item && item.isEditable && item.prop && item.name && data.hasOwnProperty(item.name)){ + requestData[item.prop] = data[item.name]; + } + } + }); + let tempContext:any = JSON.parse(JSON.stringify(context)); + if(tempContext && tempContext.srfsessionid){ + tempContext.srfsessionkey = tempContext.srfsessionid; + delete tempContext.srfsessionid; + } + return {context:tempContext,data:requestData}; + } + + /** + * 澶勭悊宸ヤ綔娴佹暟鎹� + * + * @param data 浼犲叆鏁版嵁 + * @memberof UpdateDefaultService + */ + public handleWFData(data:any, isMerge:boolean = false){ + let model: any = this.getMode(); + if (!model && model.getDataItems instanceof Function) { + return data; + } + let dataItems: any[] = model.getDataItems(); + let requestData:any = {}; + dataItems.forEach((item:any) =>{ + if(item && item.prop){ + if(item.dataType){ + if(!Object.is(item.dataType,'QUERYPARAM')){ + requestData[item.prop] = data[item.name]; + } + }else{ + requestData[item.prop] = data[item.name]; + } + } + }); + if(isMerge && (data.viewparams && Object.keys(data.viewparams).length > 0)){ + Object.assign(requestData,data.viewparams); + } + // 鍒犻櫎鍓嶇srffrontuf鏍囪瘑 + if(requestData.hasOwnProperty('srffrontuf')){ + delete requestData.srffrontuf; + } + //琛ュ厖宸ヤ綔娴佹墍闇€涓婚敭 + requestData.srfkey = data.ibizbook; + //琛ュ厖鍏ㄩ噺鏁版嵁 + requestData = this.fillNativeData(requestData); + return requestData; + } + + /** + * 琛ュ厖鍏ㄩ噺鏁版嵁 + * + * @param {*} [data] + * @memberof UpdateDefaultService + */ + public fillNativeData(data:any){ + if(this.copynativeData && this.copynativeData.length >0){ + let targetData:any = this.copynativeData.find((item:any) =>{ + return item.ibizbookid === data.srfkey; + }) + data = Object.assign(targetData,data); + return data; + } + } + + /** + * 鎻愪氦宸ヤ綔娴� + * + * @param {string} action + * @param {*} [context={}] + * @param {*} [data={}] + * @param {boolean} [isloading] + * @param {*} [localdata] + * @returns {Promise<any>} + * @memberof UpdateDefaultService + */ + @Errorlog + public submitbatch(action: string,context: any = {}, data: any,localdata:any,isloading?: boolean): Promise<any> { + let tempData:any = []; + if(data && data.length > 0){ + data.forEach((item:any) => { + let data:any = this.handleWFData(item,true); + tempData.push(data); + }); + } + context = this.handleRequestData(action,context,data,true).context; + return new Promise((resolve: any, reject: any) => { + let result: Promise<any>; + const _appEntityService: any = this.appEntityService; + if (_appEntityService[action] && _appEntityService[action] instanceof Function) { + result = _appEntityService[action](context,tempData, localdata,isloading); + } else { + result = this.appEntityService.wfSubmitBatch(context,tempData,localdata,isloading); + } + result.then((response) => { + this.handleResponse(action, response); + resolve(response); + }).catch(response => { + reject(response); + }); + }); + } + + /** + * 璁剧疆杩滅鏁版嵁 + * + * @param result 杩滅璇锋眰缁撴灉 + * @memberof UpdateDefaultService + */ + public setRemoteCopyData(result:any){ + if (result && result.status === 200) { + this.remoteCopyData = Util.deepCopy(result.data); + } + } + + /** + * 鑾峰彇杩滅鏁版嵁 + * + * @memberof UpdateDefaultService + */ + public getRemoteCopyData(){ + return this.remoteCopyData; + } + + /** + * 璁剧疆澶囦唤鍘熺敓鏁版嵁 + * + * @param data 杩滅璇锋眰缁撴灉 + * @memberof UpdateDefaultService + */ + public setCopynativeData(data:any){ + this.copynativeData = Util.deepCopy(data); + } + + /** + * 鑾峰彇澶囦唤鍘熺敓鏁版嵁 + * + * @memberof UpdateDefaultService + */ + public getCopynativeData(){ + return this.copynativeData; + } +} \ No newline at end of file diff --git a/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.less b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.less new file mode 100644 index 000000000..d863f7620 --- /dev/null +++ b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.less @@ -0,0 +1,176 @@ +.grid { + flex-grow: 1; + height: 100%; + overflow: auto; + .el-table__body-wrapper::-webkit-scrollbar { + /*婊氬姩鏉℃暣浣撴牱寮�*/ + width : 10px !important; /*楂樺鍒嗗埆瀵瑰簲妯珫婊氬姩鏉$殑灏哄*/ + height: 10px !important; + } + .el-table__body-wrapper::-webkit-scrollbar-thumb { + /*婊氬姩鏉¢鑹�*/ + border-radius : 10px !important; + background-color: #cecece !important; + } + .el-table__body-wrapper::-webkit-scrollbar-track { + /*婊氬姩鏉¢噷闈㈣建閬�*/ + box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2) !important; + background : #ededed !important; + border-radius: 10px !important; + } + /*琛ㄦ牸鏂囧瓧杩囬暱鐪佺暐*/ + .el-table th>.cell, .el-table td>.cell{ + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + word-break: break-all; + } + .el-table-column--selection .cell { + padding-left: 0px; + padding-right: 0px; + } + .app-column-link, .app-format-data{ + display: inline; + } + .el-table { + height: 100%; + display:flex; + flex-direction: column; + justify-content: flex-start; + .el-table__row{ + .grid-uiaction-divider { + padding:0 10px 0 10px; + border-left: 1px #b3b3b3 solid; + } + .grid-first-uiaction { + padding:0 10px 0 10px; + } + } + .quick-toolbar{ + display: inline-block; + button{ + background: #ebf3fb; + color: #2575ca; + border: 0; + } + } + .el-tooltip{ + .ivu-form-item{ + margin-bottom: unset !important; + } + } + .el-table__body .edit-cell{ + padding:0; + .app-form-item{ + margin-top: 20px; + margin-bottom: 20px; + } + } + .el-table__header-wrapper{ + min-height: 45px; + max-height: 100px; + height: auto; + } + .el-table__footer-wrapper{ + min-height: 45px; + max-height: 100px; + height: auto; + } + } + .grid-pagination { + height: 50px; + padding: 6px 0px; + .page-button { + button { + padding: 0; + font-size: 16px; + min-width: 32px; + height: 32px; + margin-right: 4px; + } + } + .page-column { + position: absolute; + left: 0; + } + .batch-toolbar{ + position: absolute; + left: 105px; + >.toolbar-container{ + button { + font-size: 16px; + min-width: 32px; + height: 32px; + margin-right: 4px; + margin-top: 0; + margin-bottom: 0; + } + } + } + } +} +.ivu-modal-content{ + .footer{ + .ivu-row{ + text-align: right; + } + } +} +.cell-indeterminate { + >div>label { + >span { + .el-checkbox__inner { + background-color: #409eff; + border-color: #409eff; + } + .el-checkbox__inner:before { + content: ""; + position: absolute; + display: block; + background-color: #fff; + height: 2px; + transform: scale(.5); + left: 0; + right: 0; + top: 5px; + } + } + >span.is-checked { + .el-checkbox__inner { + background-color: #409eff; + border-color: #409eff; + } + .el-checkbox__inner:after { + border: 0px; + } + } + } +} + +.cell-select-all { + >div>label { + >span { + .el-checkbox__inner { + background-color: #409eff; + border-color: #409eff; + } + .el-checkbox__inner:after { + box-sizing: content-box; + content: ""; + border: 1px solid #fff; + border-left: 0; + border-top: 0; + height: 7px; + left: 4px; + position: absolute; + top: 1px; + transform: rotate(45deg) scaleY(1); + width: 3px; + transition: transform .15s ease-in .05s; + transform-origin: center; + } + } + } +} + +// this is less diff --git a/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.vue b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.vue new file mode 100644 index 000000000..a4be1e46f --- /dev/null +++ b/app_Web/src/widgets/ibizbook/update-default-grid/update-default-grid.vue @@ -0,0 +1,14 @@ +<script lang='tsx'> +import { Component } from 'vue-property-decorator'; +import UpdateDefaultBase from './update-default-grid-base.vue'; + + +@Component({ + components: { + + } +}) +export default class UpdateDefault extends UpdateDefaultBase { + +} +</script> \ No newline at end of file diff --git a/demo-core/src/main/resources/permission/systemResource.json b/demo-core/src/main/resources/permission/systemResource.json index 58aef8e48..e6ba5448d 100644 --- a/demo-core/src/main/resources/permission/systemResource.json +++ b/demo-core/src/main/resources/permission/systemResource.json @@ -302,7 +302,7 @@ { "appid":"Web", "appname":"婕旂ず搴旂敤", - "appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"宸ヤ綔鍙�" },{ "id":"menuitem3" , "name":"鎺т欢" , "items":[{ "id":"menuitem6" , "name":"榛樿鏁版嵁绫诲瀷" },{ "id":"menuitem7" , "name":"榛樿缂栬緫鍣ㄧ被鍨�" },{ "id":"menuitem15" , "name":"鍩虹琛ㄥ崟椤�" },{ "id":"menuitem72" , "name":"缂栬緫鍣ㄦ墿灞�" }]},{ "id":"menuitem4" , "name":"閮ㄤ欢" , "items":[{ "id":"menuitem12" , "name":"缂栬緫琛ㄥ崟" , "items":[{ "id":"menuitem47" , "name":"榛樿鍊�" },{ "id":"menuitem48" , "name":"杈撳叆鎻愮ず" },{ "id":"menuitem49" , "name":"杈呭姪杈撳叆" },{ "id":"menuitem50" , "name":"鑷姩濉厖" },{ "id":"menuitem51" , "name":"瓒呴摼鎺�" },{ "id":"menuitem52" , "name":"鍊奸噸缃�" },{ "id":"menuitem55" , "name":"鍔ㄦ€佹樉绀�" },{ "id":"menuitem53" , "name":"鍔ㄦ€佸惎鐢�" },{ "id":"menuitem54" , "name":"鍔ㄦ€佺┖杈撳叆" },{ "id":"menuitem56" , "name":"琛ㄥ崟椤规洿鏂�" }]},{ "id":"menuitem16" , "name":"鎼滅储琛ㄥ崟" },{ "id":"menuitem13" , "name":"琛ㄦ牸" , "items":[{ "id":"menuitem57" , "name":"绂佺敤鎺掑簭" },{ "id":"menuitem59" , "name":"琛屾搷浣�" },{ "id":"menuitem58" , "name":"琛岀紪杈�" },{ "id":"menuitem73" , "name":"琛ㄦ牸鍐呯疆鍔熻兘" },{ "id":"menuitem74" , "name":"琛岀紪杈�" },{ "id":"menuitem75" , "name":"鏂板缓榛樿鍊�" }]},{ "id":"menuitem14" , "name":"鏍戣鍥�" , "items":[{ "id":"menuitem60" , "name":"闈欐€佽妭鐐�" },{ "id":"menuitem61" , "name":"鍔ㄦ€佽妭鐐癸紙浠g爜琛級" },{ "id":"menuitem62" , "name":"鍔ㄦ€佽妭鐐癸紙瀹炰綋锛�" },{ "id":"menuitem63" , "name":"鍙抽敭鎿嶄綔" },{ "id":"menuitem64" , "name":"鍔ㄦ€佸弬鏁拌繃婊�" }]},{ "id":"menuitem37" , "name":"鍥捐〃" , "items":[{ "id":"menuitem38" , "name":"鏌辩姸鍥�" },{ "id":"menuitem39" , "name":"鎶樼嚎鍥�" },{ "id":"menuitem40" , "name":"楗煎浘" },{ "id":"menuitem41" , "name":"鍖哄煙鍥�" },{ "id":"menuitem42" , "name":"闆疯揪鍥�" },{ "id":"menuitem43" , "name":"浠〃鐩�" },{ "id":"menuitem44" , "name":"K绾垮浘" }]},{ "id":"menuitem17" , "name":"鍚戝" },{ "id":"menuitem18" , "name":"鐣岄潰琛屼负" , "items":[{ "id":"menuitem65" , "name":"鍓嶇鐣岄潰琛屼负" },{ "id":"menuitem66" , "name":"鍚庡彴鐣岄潰琛屼负" }]}]},{ "id":"menuitem5" , "name":"瑙嗗浘" , "items":[{ "id":"menuitem9" , "name":"鍒楄〃瑙嗗浘" , "items":[{ "id":"menuitem19" , "name":"甯歌琛ㄦ牸瑙嗗浘" },{ "id":"menuitem21" , "name":"宸﹀彸琛ㄦ牸瑙嗗浘" },{ "id":"menuitem20" , "name":"宓屽叆琛ㄦ牸瑙嗗浘" }]},{ "id":"menuitem8" , "name":"缂栬緫瑙嗗浘" , "items":[{ "id":"menuitem22" , "name":"甯歌缂栬緫瑙嗗浘" },{ "id":"menuitem23" , "name":"宸﹀彸缂栬緫瑙嗗浘" },{ "id":"menuitem24" , "name":"鍒嗛〉缂栬緫瑙嗗浘" },{ "id":"menuitem25" , "name":"宓屽叆缂栬緫瑙嗗浘" }]},{ "id":"menuitem26" , "name":"閫夋嫨瑙嗗浘" , "items":[{ "id":"menuitem27" , "name":"鍗曢€夎鍥�" },{ "id":"menuitem28" , "name":"澶氶€夎鍥�" },{ "id":"menuitem29" , "name":"鏍戝舰閫夋嫨瑙嗗浘" },{ "id":"menuitem30" , "name":"宸﹀彸鍗曢€夎鍥�" },{ "id":"menuitem31" , "name":"宸﹀彸澶氶€夎鍥�" }]},{ "id":"menuitem10" , "name":"瀵艰埅瑙嗗浘" , "items":[{ "id":"menuitem32" , "name":"甯歌瀵艰埅瑙嗗浘" },{ "id":"menuitem33" , "name":"鍒嗛〉瀵艰埅瑙嗗浘" },{ "id":"menuitem34" , "name":"宓屽叆瀵艰埅瑙嗗浘" }]},{ "id":"menuitem11" , "name":"鍏朵粬瑙嗗浘" , "items":[{ "id":"menuitem35" , "name":"鍥捐〃瑙嗗浘" },{ "id":"menuitem36" , "name":"鎶ヨ〃瑙嗗浘" }]}]},{ "id":"menuitem69" , "name":"宸ヤ綔娴�" },{ "id":"menuitem2" , "name":"鏇村" , "items":[{ "id":"menuitem46" , "name":"鏁版嵁瀵煎嚭瀵煎叆" },{ "id":"menuitem45" , "name":"鏁版嵁鎵撳嵃" },{ "id":"menuitem67" , "name":"绱㈠紩瀹炰綋" },{ "id":"menuitem68" , "name":"缁ф壙瀹炰綋" },{ "id":"menuitem70" , "name":"涓荤姸鎬�" },{ "id":"menuitem71" , "name":"澶氳〃鍗�" }]}] }] + "appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"宸ヤ綔鍙�" },{ "id":"menuitem3" , "name":"鎺т欢" , "items":[{ "id":"menuitem6" , "name":"榛樿鏁版嵁绫诲瀷" },{ "id":"menuitem7" , "name":"榛樿缂栬緫鍣ㄧ被鍨�" },{ "id":"menuitem15" , "name":"鍩虹琛ㄥ崟椤�" },{ "id":"menuitem72" , "name":"缂栬緫鍣ㄦ墿灞�" }]},{ "id":"menuitem4" , "name":"閮ㄤ欢" , "items":[{ "id":"menuitem12" , "name":"缂栬緫琛ㄥ崟" , "items":[{ "id":"menuitem47" , "name":"榛樿鍊�" },{ "id":"menuitem48" , "name":"杈撳叆鎻愮ず" },{ "id":"menuitem49" , "name":"杈呭姪杈撳叆" },{ "id":"menuitem50" , "name":"鑷姩濉厖" },{ "id":"menuitem51" , "name":"瓒呴摼鎺�" },{ "id":"menuitem52" , "name":"鍊奸噸缃�" },{ "id":"menuitem55" , "name":"鍔ㄦ€佹樉绀�" },{ "id":"menuitem53" , "name":"鍔ㄦ€佸惎鐢�" },{ "id":"menuitem54" , "name":"鍔ㄦ€佺┖杈撳叆" },{ "id":"menuitem56" , "name":"琛ㄥ崟椤规洿鏂�" }]},{ "id":"menuitem16" , "name":"鎼滅储琛ㄥ崟" },{ "id":"menuitem13" , "name":"琛ㄦ牸" , "items":[{ "id":"menuitem57" , "name":"绂佺敤鎺掑簭" },{ "id":"menuitem59" , "name":"琛屾搷浣�" },{ "id":"menuitem58" , "name":"琛岀紪杈�" },{ "id":"menuitem73" , "name":"琛ㄦ牸鍐呯疆鍔熻兘" },{ "id":"menuitem74" , "name":"琛岀紪杈�" },{ "id":"menuitem75" , "name":"鏂板缓榛樿鍊�" },{ "id":"menuitem76" , "name":"鏇存柊榛樿鍊�" }]},{ "id":"menuitem14" , "name":"鏍戣鍥�" , "items":[{ "id":"menuitem60" , "name":"闈欐€佽妭鐐�" },{ "id":"menuitem61" , "name":"鍔ㄦ€佽妭鐐癸紙浠g爜琛級" },{ "id":"menuitem62" , "name":"鍔ㄦ€佽妭鐐癸紙瀹炰綋锛�" },{ "id":"menuitem63" , "name":"鍙抽敭鎿嶄綔" },{ "id":"menuitem64" , "name":"鍔ㄦ€佸弬鏁拌繃婊�" }]},{ "id":"menuitem37" , "name":"鍥捐〃" , "items":[{ "id":"menuitem38" , "name":"鏌辩姸鍥�" },{ "id":"menuitem39" , "name":"鎶樼嚎鍥�" },{ "id":"menuitem40" , "name":"楗煎浘" },{ "id":"menuitem41" , "name":"鍖哄煙鍥�" },{ "id":"menuitem42" , "name":"闆疯揪鍥�" },{ "id":"menuitem43" , "name":"浠〃鐩�" },{ "id":"menuitem44" , "name":"K绾垮浘" }]},{ "id":"menuitem17" , "name":"鍚戝" },{ "id":"menuitem18" , "name":"鐣岄潰琛屼负" , "items":[{ "id":"menuitem65" , "name":"鍓嶇鐣岄潰琛屼负" },{ "id":"menuitem66" , "name":"鍚庡彴鐣岄潰琛屼负" }]}]},{ "id":"menuitem5" , "name":"瑙嗗浘" , "items":[{ "id":"menuitem9" , "name":"鍒楄〃瑙嗗浘" , "items":[{ "id":"menuitem19" , "name":"甯歌琛ㄦ牸瑙嗗浘" },{ "id":"menuitem21" , "name":"宸﹀彸琛ㄦ牸瑙嗗浘" },{ "id":"menuitem20" , "name":"宓屽叆琛ㄦ牸瑙嗗浘" }]},{ "id":"menuitem8" , "name":"缂栬緫瑙嗗浘" , "items":[{ "id":"menuitem22" , "name":"甯歌缂栬緫瑙嗗浘" },{ "id":"menuitem23" , "name":"宸﹀彸缂栬緫瑙嗗浘" },{ "id":"menuitem24" , "name":"鍒嗛〉缂栬緫瑙嗗浘" },{ "id":"menuitem25" , "name":"宓屽叆缂栬緫瑙嗗浘" }]},{ "id":"menuitem26" , "name":"閫夋嫨瑙嗗浘" , "items":[{ "id":"menuitem27" , "name":"鍗曢€夎鍥�" },{ "id":"menuitem28" , "name":"澶氶€夎鍥�" },{ "id":"menuitem29" , "name":"鏍戝舰閫夋嫨瑙嗗浘" },{ "id":"menuitem30" , "name":"宸﹀彸鍗曢€夎鍥�" },{ "id":"menuitem31" , "name":"宸﹀彸澶氶€夎鍥�" }]},{ "id":"menuitem10" , "name":"瀵艰埅瑙嗗浘" , "items":[{ "id":"menuitem32" , "name":"甯歌瀵艰埅瑙嗗浘" },{ "id":"menuitem33" , "name":"鍒嗛〉瀵艰埅瑙嗗浘" },{ "id":"menuitem34" , "name":"宓屽叆瀵艰埅瑙嗗浘" }]},{ "id":"menuitem11" , "name":"鍏朵粬瑙嗗浘" , "items":[{ "id":"menuitem35" , "name":"鍥捐〃瑙嗗浘" },{ "id":"menuitem36" , "name":"鎶ヨ〃瑙嗗浘" }]}]},{ "id":"menuitem69" , "name":"宸ヤ綔娴�" },{ "id":"menuitem2" , "name":"鏇村" , "items":[{ "id":"menuitem46" , "name":"鏁版嵁瀵煎嚭瀵煎叆" },{ "id":"menuitem45" , "name":"鏁版嵁鎵撳嵃" },{ "id":"menuitem67" , "name":"绱㈠紩瀹炰綋" },{ "id":"menuitem68" , "name":"缁ф壙瀹炰綋" },{ "id":"menuitem70" , "name":"涓荤姸鎬�" },{ "id":"menuitem71" , "name":"澶氳〃鍗�" }]}] }] } ] } -- 2.21.0