提交 bf578b0f 编写于 作者: ibizdev's avatar ibizdev

ShineKOT 发布系统代码 [后台服务,演示应用]

上级 1082f917
......@@ -72,6 +72,11 @@ export default {
uiactions: {
},
},
extendeditoramount_list: {
nodata:"",
uiactions: {
},
},
editorlist_list: {
nodata:"",
uiactions: {
......
......@@ -71,6 +71,11 @@ export default {
uiactions: {
},
},
extendeditoramount_list: {
nodata:"",
uiactions: {
},
},
editorlist_list: {
nodata:"",
uiactions: {
......
......@@ -55,16 +55,16 @@
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 6, offset: 0 }">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem1
<view_db_sysportlet10
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem1"
ref='db_rawitem1'
name="db_sysportlet10"
ref='db_sysportlet10'
@closeview="closeView($event)">
</view_db_rawitem1>
</view_db_sysportlet10>
</span>
</card>
</i-col>
......
......@@ -3,8 +3,8 @@ import { Component } from 'vue-property-decorator';
import AppPortalView_dbBase from './app-portal-view-db-dashboard-base.vue';
import view_db_sysportlet5 from '@widgets/ibizappview/app-view-amount-portlet/app-view-amount-portlet.vue';
import view_db_sysportlet4 from '@widgets/ibizappeditor/editor-chart-portlet/editor-chart-portlet.vue';
import view_db_rawitem1 from '@widgets/app/db-rawitem1-portlet/db-rawitem1-portlet.vue';
import view_db_sysportlet3 from '@widgets/ibizappctrl/ctrl-chart-portlet/ctrl-chart-portlet.vue';
import view_db_sysportlet10 from '@widgets/ibizappeditor/app-extend-editor-portlet/app-extend-editor-portlet.vue';
import view_db_sysportlet2 from '@widgets/ibizappview/view-chart-portlet/view-chart-portlet.vue';
import view_db_sysportlet1 from '@widgets/ibizappview/app-view-list-portlet/app-view-list-portlet.vue';
import view_db_sysportlet9 from '@widgets/ibizappeditor/app-editor-list-view-portlet/app-editor-list-view-portlet.vue';
......@@ -17,8 +17,8 @@ import view_db_sysportlet6 from '@widgets/ibizappctrl/app-ctrl-amount-portlet/ap
components: {
view_db_sysportlet5,
view_db_sysportlet4,
view_db_rawitem1,
view_db_sysportlet3,
view_db_sysportlet10,
view_db_sysportlet2,
view_db_sysportlet1,
view_db_sysportlet9,
......
<template>
<div class='portlet app-extend-editor ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<div class="portlet-without-title">
<!-- 测试 -->
<view_db_sysportlet10_list
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="db_sysportlet10_list"
ref='db_sysportlet10_list'
@closeview="closeView($event)">
</view_db_sysportlet10_list>
</div>
</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 IBIZAPPEDITORService from '@/service/ibizappeditor/ibizappeditor-service';
import AppExtendEditorService from './app-extend-editor-portlet-service';
import IBIZAPPEDITORUIService from '@/uiservice/ibizappeditor/ibizappeditor-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZAPPEDITORAppExtendEditorBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof AppExtendEditorBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppExtendEditorBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof AppExtendEditorBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppExtendEditorBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppExtendEditorBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof AppExtendEditorBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AppExtendEditorBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {AppExtendEditorService}
* @memberof AppExtendEditorBase
*/
public service: AppExtendEditorService = new AppExtendEditorService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZAPPEDITORService}
* @memberof AppExtendEditorBase
*/
public appEntityService: IBIZAPPEDITORService = new IBIZAPPEDITORService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZAPPEDITORUIService}
* @memberof AppExtendEditorBase
*/
public appUIService:IBIZAPPEDITORUIService = new IBIZAPPEDITORUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof AppExtendEditorBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof AppExtendEditorBase
*/
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();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof AppExtendEditorBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof AppExtendEditorBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof AppExtendEditorBase
*/
public portletType: string = 'list';
/**
* 视图默认使用
*
* @type {string}
* @memberof AppExtendEditorBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof AppExtendEditorBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof AppExtendEditorBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof AppExtendEditorBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof AppExtendEditorBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof AppExtendEditorBase
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '100px';
}
}
/**
* 刷新
*
* @memberof AppExtendEditorBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'db_sysportlet10_list', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof AppExtendEditorBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AppExtendEditorBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof AppExtendEditorBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AppExtendEditorBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof AppExtendEditorBase
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './app-extend-editor-portlet.less';
</style>
/**
* AppExtendEditor 部件模型
*
* @export
* @class AppExtendEditorModel
*/
export default class AppExtendEditorModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof AppExtendEditorModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'updatedate',
},
{
name: 'createdate',
},
{
name: 'ibizappeditorname',
},
{
name: 'updateman',
},
{
name: 'ibizappeditor',
prop: 'ibizappeditorid',
},
{
name: 'ibizappeditortype',
},
{
name: 'rditordescription',
},
{
name: 'documentaddress',
},
{
name: 'amount',
},
{
name: 'isextendeditor',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* AppExtendEditor 部件服务对象
*
* @export
* @class AppExtendEditorService
*/
export default class AppExtendEditorService extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZAPPEDITORAppExtendEditorBase from './app-extend-editor-portlet-base.vue';
import view_db_sysportlet10_list from '@widgets/ibizappeditor/extend-editor-amount-list/extend-editor-amount-list.vue';
@Component({
components: {
view_db_sysportlet10_list,
}
})
export default class IBIZAPPEDITORAppExtendEditor extends IBIZAPPEDITORAppExtendEditorBase {
}
</script>
<template>
<div :class="['app-list',this.items.length > 0 ? '' : 'app-list-empty' ]">
<div style="display: flex;justify-content: space-between;align-items: center;height: 100%;">
<div style="height: 80px;width: 80px;display: flex;align-items: center;justify-content: center;">
<i class="el-icon-s-operation" style="font-size: 50px;color: #34bfa3"/>
</div>
<div style="height: 80px;width: 165px;display: flex;flex-direction: column;justify-content: center;text-align: center;">
<div style="margin-bottom: 8px;color: rgba(0,0,0,.45);font-size: 18px;font-weight: 700;">
<span> 支持扩展编辑器总数 </span>
</div>
<div style="color: #666;font-size: 24px;font-weight: 700;">
<span> {{ calculation() }} </span>
</div>
</div>
</div>
</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 IBIZAPPEDITORService from '@/service/ibizappeditor/ibizappeditor-service';
import ExtendEditorAmountService from './extend-editor-amount-list-service';
import IBIZAPPEDITORUIService from '@/uiservice/ibizappeditor/ibizappeditor-ui-service';
import CodeListService from "@/codelist/codelist-service";
@Component({
components: {
}
})
export default class ExtendEditorAmountBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof ExtendEditorAmountBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof ExtendEditorAmountBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof ExtendEditorAmountBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ExtendEditorAmountBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof ExtendEditorAmountBase
*/
public getControlType(): string {
return 'LIST'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof ExtendEditorAmountBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {ExtendEditorAmountService}
* @memberof ExtendEditorAmountBase
*/
public service: ExtendEditorAmountService = new ExtendEditorAmountService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZAPPEDITORService}
* @memberof ExtendEditorAmountBase
*/
public appEntityService: IBIZAPPEDITORService = new IBIZAPPEDITORService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof ExtendEditorAmountBase
*/
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 ExtendEditorAmountBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof ExtendEditorAmountBase
*/
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 calculation(){
let total = 0;
if(this.items.length > 0 ){
this.items.forEach((item: any) => {
if(Object.is(item.extendeditor,'是')){
total ++;
}
})
}
return total;
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ExtendEditorAmountBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ExtendEditorAmountBase
*/
public getDatas(): any[] {
return this.selections;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ExtendEditorAmountBase
*/
public getData(): any {
return null;
}
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof ExtendEditorAmountBase
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ExtendEditorAmountBase
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--create
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
@Prop() public createAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
@Prop() public removeAction!: string;
/**
* 部件行为--update
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
@Prop() public fetchAction!: string;
/**
* this引用
*
* @type {number}
* @memberof ExtendEditorAmountBase
*/
public thisRef: any = this;
/**
* 当前页
*
* @type {number}
* @memberof ExtendEditorAmountBase
*/
public curPage: number = 1;
/**
* 数据
*
* @type {any[]}
* @memberof ExtendEditorAmountBase
*/
public items: any[] = [];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof ExtendEditorAmountBase
*/
public isEnablePagingBar: boolean = true;
/**
* 分页条数
*
* @type {number}
* @memberof ExtendEditorAmountBase
*/
public limit: number = 1000;
/**
* 总条数
*
* @type {number}
* @memberof ExtendEditorAmountBase
*/
public totalRecord: number = 0;
/**
* 加载的数据是否附加在items之后
*
* @type {boolean}
* @memberof ExtendEditorAmountBase
*/
public isAddBehind:boolean = false;
/**
* 是否有滚动条
*
* @type {boolean}
* @memberof ExtendEditorAmountBase
*/
public isScrollBar: boolean = false;
/**
* 排序方向
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
public sortDir:string = '';
/**
* 排序字段
*
* @type {string}
* @memberof ExtendEditorAmountBase
*/
public sortField: string = '';
/**
* 选中数组
* @type {Array<any>}
* @memberof ExtendEditorAmountBase
*/
public selections: Array<any> = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ExtendEditorAmountBase
*/
public appStateEvent: Subscription | undefined;
/**
* Vue声明周期,组件挂载完毕
*
* @memberof ExtendEditorAmountBase
*/
public mounted () {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ExtendEditorAmountBase
*/
public afterMounted () {
const loadMoreCallBack:any = this.throttle(this.loadMore,3000);
this.$el.addEventListener('scroll', ()=> {
if(this.$el.scrollHeight > this.$el.clientHeight) {
this.isScrollBar = true;
} else {
this.isScrollBar = false;
}
if( this.$el.scrollTop + this.$el.clientHeight >= this.$el.scrollHeight) {
loadMoreCallBack();
}
})
}
/**
* Vue声明周期,组件创建完毕
*
* @memberof ExtendEditorAmountBase
*/
public created() {
this.afterCreated()
}
/**
* 执行created后的逻辑
*
* @memberof ExtendEditorAmountBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(this.name, tag)) {
return;
}
if (Object.is(action,'load')) {
this.curPage = 1;
this.items = [];
this.load(data);
}
if (Object.is(action,'refresh')) {
this.refresh(data);
}
});
}
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"IBIZAPPEDITOR")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
}
/**
* vue 生命周期
*
* @memberof ExtendEditorAmountBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ExtendEditorAmountBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
}
/**
* 加载更多
*
* @memberof ExtendEditorAmountBase
*/
public loadMore(){
if(this.totalRecord>this.items.length){
this.curPage = ++this.curPage;
this.isAddBehind = true;
this.load({});
}
}
/**
* 刷新
*
* @param {*} [args={}]
* @memberof Main
*/
public refresh(args?: any) {
this.isAddBehind = true;
this.load(args);
}
/**
* 列表数据加载
*
* @public
* @param {*} [arg={}]
* @memberof ExtendEditorAmountBase
*/
public load(opt: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'AppPortalView' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
const page: any = {};
if (this.isEnablePagingBar) {
Object.assign(page, { page: this.curPage-1, size: this.limit });
}
// 设置排序
if (!Object.is(this.sortDir, '') && !Object.is(this.sortField, '')) {
const sort: string = this.sortField+","+this.sortDir;
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:{};
if(this.viewparams){
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
}
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction, this.context?JSON.parse(JSON.stringify(this.context)):{}, arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || 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;
if(!this.isAddBehind){
this.items = [];
}
if (data && data.length > 0) {
let datas = JSON.parse(JSON.stringify(data));
datas.map((item: any) => {
Object.assign(item, { isselected: false });
});
this.totalRecord = response.total;
this.items.push(...datas);
this.items = this.arrayNonRepeatfy(this.items);
}
this.isAddBehind = false;
this.$emit('load', this.items);
//在导航视图中,如已有选中数据,则右侧展开已选中数据的视图,如无选中数据则默认选中第一条
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.handleClick(this.items[index]);
}
})
}else{
this.handleClick(this.items[0]);
}
}
}, (response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
/**
* 列表数据去重
*
* @param {Array<any>} [arr]
* @returns {void}
* @memberof ExtendEditorAmountBase
*/
public arrayNonRepeatfy(arr:Array<any>) {
let map = new Map();
let array = new Array();
for (let i = 0; i < arr.length; i++) {
map .set(arr[i].srfkey, arr[i]);
}
map.forEach((value:any, key:string, map:any) => {
array.push(value);
});
return array ;
}
/**
* 节流
*
* @param {Array<any>} [arr]
* @returns {void}
* @memberof ExtendEditorAmountBase
*/
public throttle(fn:any, wait:number){
let time = 0;
return () =>{
let now = Date.now()
let args = arguments;
if(now - time > wait){
fn.apply(this, args)
time = now;
}
}
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof ExtendEditorAmountBase
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'AppPortalView' + (this.$t('app.list.notConfig.removeAction') as string) });
return;
}
if (datas.length === 0) {
return;
}
let dataInfo = '';
datas.forEach((record: any, index: number) => {
let srfmajortext = record.srfmajortext;
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (datas.length < 5) {
dataInfo = dataInfo + ' 共' + datas.length + '条数据';
} else {
dataInfo = dataInfo + '...' + ' 共' + datas.length + '条数据';
}
const removeData = () => {
let keys: any[] = [];
datas.forEach((data: any) => {
keys.push(data.srfkey);
});
let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ;
const context:any = JSON.parse(JSON.stringify(this.context));
const post: Promise<any> = this.service.delete(_removeAction,Object.assign(context,{ ibizappeditor: keys.join(';') }),Object.assign({ ibizappeditor: keys.join(';') },{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.commonWords.delDataFail') as string) + ',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
}
//删除items中已删除的项
datas.forEach((data: any) => {
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
return true;
}
});
});
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, '').replace(/[ ]/g, '');
this.$Modal.confirm({
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.list.confirmDel') as string) + ' ' + dataInfo + ',' + (this.$t('app.list.notRecoverable') as string) ,
onOk: () => {
removeData();
},
onCancel: () => { }
});
return removeData;
}
/**
* 保存
*
* @param {*} $event
* @returns {Promise<any>}
* @memberof ExtendEditorAmountBase
*/
public async save(args: any[], params?: any, $event?: any, xData?: any){
let _this = this;
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: 'AppPortalView' + (this.$t('app.list.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.warning') as string), desc: 'AppPortalView' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.ibizappeditor){
Object.assign(this.context,{ibizappeditor:item.ibizappeditor});
}
let response = await this.service.add(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){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname+ (this.$t('app.commonWords.saveFailed') as string) + '!' });
console.error(errorMessage[index]);
});
}
return successItems;
}
/**
* 面板数据变化处理事件
* @param {any} item 当前列数据
* @param {any} $event 面板事件数据
*
* @memberof ExtendEditorAmountBase
*/
public onPanelDataChange(item:any,$event:any) {
Object.assign(item, $event, {rowDataState:'update'});
}
/**
* 选择数据
* @memberof ExtendEditorAmountBase
*
*/
public handleClick(args: any) {
// this.clearSelection();
args.isselected = !args.isselected;
this.selectchange();
}
/**
* 双击数据
* @memberof ExtendEditorAmountBase
*
*/
public handleDblClick(args: any) {
this.$emit('rowdblclick', args);
}
/**
* 触发事件
* @memberof ExtendEditorAmountBase
*
*/
public selectchange() {
this.selections = [];
this.items.map((item: any) => {
if (item.isselected) {
this.selections.push(item);
}
});
this.$emit('selectionchange', this.selections);
}
/**
* 清除当前所有选中状态
*
* @memberof ExtendEditorAmountBase
*/
public clearSelection(){
this.items.map((item: any) => {
Object.assign(item, { isselected: false });
});
}
/**
* 操作栏模型数据
*
* @type {*}
* @memberof ExtendEditorAmountBase
*/
public actionModel:any ={
};
/**
* 操作列界面行为
*
* @param {*} data
* @param {*} tag
* @param {*} $event
* @memberof ExtendEditorAmountBase
*/
public uiAction(data: any, tag: any, $event: any) {
$event.stopPropagation();
}
}
</script>
<style lang='less'>
@import './extend-editor-amount-list.less';
</style>
\ No newline at end of file
/**
* ExtendEditorAmount 部件模型
*
* @export
* @class ExtendEditorAmountModel
*/
export default class ExtendEditorAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ExtendEditorAmountDb_sysportlet10_listMode
*/
public getDataItems(): any[] {
return [
{
name: 'extendeditor',
prop: 'isextendeditor',
dataType: 'TEXT',
},
{
name: 'srfkey',
prop: 'ibizappeditorid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'ibizappeditorname',
dataType: 'TEXT',
},
{
name: 'ibizappeditor',
prop: 'ibizappeditorid',
dataType: 'FONTKEY',
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'sort',
prop:'sort'
},
{
name:'page',
prop:'page'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZAPPEDITORService from '@/service/ibizappeditor/ibizappeditor-service';
import ExtendEditorAmountModel from './extend-editor-amount-list-model';
/**
* ExtendEditorAmount 部件服务对象
*
* @export
* @class ExtendEditorAmountService
*/
export default class ExtendEditorAmountService extends ControlService {
/**
* 编辑器服务对象
*
* @type {IBIZAPPEDITORService}
* @memberof ExtendEditorAmountService
*/
public appEntityService: IBIZAPPEDITORService = new IBIZAPPEDITORService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof ExtendEditorAmountService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of ExtendEditorAmountService.
*
* @param {*} [opts={}]
* @memberof ExtendEditorAmountService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new ExtendEditorAmountModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ExtendEditorAmountService
*/
@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(async (response) => {
await this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ExtendEditorAmountService
*/
@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) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ExtendEditorAmountService
*/
@Errorlog
public add(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.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 ExtendEditorAmountService
*/
@Errorlog
public update(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.Update(Context,Data,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
\ No newline at end of file
// this is less
.app-list {
height:100%;
flex-grow: 1;
overflow-y: auto;
.el-collapse-item__header.is-active{
color: #409eff;
background-color: #ecf5ff;
}
.el-collapse{
.el-collapse-item{
.el-collapse-item__wrap{
.el-collapse-item__content{
padding: 10px 0 10px 0;
}
}
}
}
.app-list-item {
line-height: 34px;
padding: 12px 6px;
min-height: 24px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #f0f0f0;
.app-list-item-content {
width: 70%;
display: flex;
align-items: center;
.item-icon {
width: 40px;
height: 40px;
margin-right: 14px;
img {
width: 40px;
height: 40px;
border-radius: 50%;
}
}
.item-content-text {
display: flex;
flex-direction: column;
.item-text {
font-size: 18px;
font-weight: bold;
}
.item-subtext {
color: #8c8c8c;
}
}
}
.app-list-item-date {
position: relative;
color: #8c8c8c;
}
}
.app-list-item.isSelect {
background: #ecf5ff;
border-radius: 2px;
border-color: rgb(197, 197, 197);
}
.app-list-item:hover {
background: #ecf5ff;
}
.loadmore {
text-align: center;
padding: 10px;
text-decoration: underline;
color: #82bff7;
cursor: default;
}
}
.app-list-empty {
height:100%;
color: #909399;
display: flex;
justify-content: center;
align-items: center;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import ExtendEditorAmountBase from './extend-editor-amount-list-base.vue';
@Component({
components: {
}
})
export default class ExtendEditorAmount extends ExtendEditorAmountBase {
}
</script>
\ No newline at end of file
......@@ -37,11 +37,6 @@
git clone -b master $para2 demosys/
export NODE_OPTIONS=--max-old-space-size=4096
cd demosys/
mvn clean package -Pweb
cd demo-app/demo-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/demo-app-web.yaml iBizDemo --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /demo-app-web.jar
EXPOSE 51001
EXPOSE 8080
ADD demo-app-web.jar /demo-app-web.jar
......@@ -3,24 +3,9 @@ services:
demo-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/demo-app-web:latest
ports:
- "51001:51001"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=51001
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_df847bdfd
- SPRING_DATASOURCE_PASSWORD=3d6@460A
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_df847bdfd?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_df847bdfd
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册