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

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

上级 7599b428
......@@ -65,6 +65,11 @@ export default {
uiactions: {
},
},
ctrlamount_list: {
nodata:"",
uiactions: {
},
},
ctrllist_list: {
nodata:"",
uiactions: {
......
......@@ -64,6 +64,11 @@ export default {
uiactions: {
},
},
ctrlamount_list: {
nodata:"",
uiactions: {
},
},
ctrllist_list: {
nodata:"",
uiactions: {
......
......@@ -70,6 +70,11 @@ export default {
uiactions: {
},
},
editoramount_list: {
nodata:"",
uiactions: {
},
},
editorlist_list: {
nodata:"",
uiactions: {
......
......@@ -69,6 +69,11 @@ export default {
uiactions: {
},
},
editoramount_list: {
nodata:"",
uiactions: {
},
},
editorlist_list: {
nodata:"",
uiactions: {
......
......@@ -62,6 +62,11 @@ export default {
uiactions: {
},
},
viewamount_list: {
nodata:"",
uiactions: {
},
},
viewlist_list: {
nodata:"",
uiactions: {
......
......@@ -61,6 +61,11 @@ export default {
uiactions: {
},
},
viewamount_list: {
nodata:"",
uiactions: {
},
},
viewlist_list: {
nodata:"",
uiactions: {
......
......@@ -9,9 +9,6 @@
<div class='content-container'>
<div style="margin-bottom:6px;">
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange"></app-quick-group>
</div>
<i-input v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' placeholder="图书名称" style='max-width: 400px;margin-top:6px;' />
<div class='pull-right'>
</div>
......@@ -548,7 +545,7 @@ export default class IBIZBOOKUsr2CalendarViewBase extends Vue {
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
_this.loadQuickGroupModel();
}
......@@ -735,100 +732,6 @@ export default class IBIZBOOKUsr2CalendarViewBase extends Vue {
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 快速分组数据对象
*
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public quickGroupData:any;
/**
* 快速分组是否有抛值
*
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public isEmitQuickGroupValue:boolean = false;
/**
* 快速分组模型
*
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public quickGroupModel:Array<any> = [];
/**
* 加载快速分组模型
*
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public loadQuickGroupModel(){
let quickGroupCodeList:any = {tag:'Bookgroup',codelistType:'STATIC'};
if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(quickGroupCodeList.tag);
if (codelist) {
this.quickGroupModel = [...this.handleDynamicData(JSON.parse(JSON.stringify(codelist.items)))];
} else {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
}
}else if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"DYNAMIC")){
this.codeListService.getItems(quickGroupCodeList.tag,{},{}).then((res:any) => {
this.quickGroupModel = res;
}).catch((error:any) => {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
});
}
}
/**
* 处理快速分组模型动态数据部分(%xxx%)
*
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public handleDynamicData(inputArray:Array<any>){
if(inputArray.length >0){
inputArray.forEach((item:any) =>{
if(item.data && Object.keys(item.data).length >0){
Object.keys(item.data).forEach((name:any) =>{
let value: any = item.data[name];
if (value && typeof(value)=='string' && value.startsWith('%') && value.endsWith('%')) {
const key = (value.substring(1, value.length - 1)).toLowerCase();
if (this.context[key]) {
value = this.context[key];
} else if(this.viewparams[key]){
value = this.viewparams[key];
}
}
item.data[name] = value;
})
}
})
}
return inputArray;
}
/**
* 快速分组值变化
*
* @memberof IBIZBOOKUsr2CalendarViewBase
*/
public quickGroupValueChange($event:any){
if($event){
this.quickGroupData = $event.data;
if(this.isEmitQuickGroupValue){
this.onSearch($event);
}
}
this.isEmitQuickGroupValue = true;
}
}
</script>
......
......@@ -9,9 +9,6 @@
<div class='content-container'>
<div style="margin-bottom:6px;">
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange"></app-quick-group>
</div>
<i-input v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' placeholder="图书名称" style='max-width: 400px;margin-top:6px;' />
<div class='pull-right'>
</div>
......@@ -548,7 +545,7 @@ export default class IBIZBOOKUsr3CalendarViewBase extends Vue {
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
_this.loadQuickGroupModel();
}
......@@ -735,100 +732,6 @@ export default class IBIZBOOKUsr3CalendarViewBase extends Vue {
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 快速分组数据对象
*
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public quickGroupData:any;
/**
* 快速分组是否有抛值
*
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public isEmitQuickGroupValue:boolean = false;
/**
* 快速分组模型
*
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public quickGroupModel:Array<any> = [];
/**
* 加载快速分组模型
*
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public loadQuickGroupModel(){
let quickGroupCodeList:any = {tag:'Bookgroup',codelistType:'STATIC'};
if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(quickGroupCodeList.tag);
if (codelist) {
this.quickGroupModel = [...this.handleDynamicData(JSON.parse(JSON.stringify(codelist.items)))];
} else {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
}
}else if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"DYNAMIC")){
this.codeListService.getItems(quickGroupCodeList.tag,{},{}).then((res:any) => {
this.quickGroupModel = res;
}).catch((error:any) => {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
});
}
}
/**
* 处理快速分组模型动态数据部分(%xxx%)
*
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public handleDynamicData(inputArray:Array<any>){
if(inputArray.length >0){
inputArray.forEach((item:any) =>{
if(item.data && Object.keys(item.data).length >0){
Object.keys(item.data).forEach((name:any) =>{
let value: any = item.data[name];
if (value && typeof(value)=='string' && value.startsWith('%') && value.endsWith('%')) {
const key = (value.substring(1, value.length - 1)).toLowerCase();
if (this.context[key]) {
value = this.context[key];
} else if(this.viewparams[key]){
value = this.viewparams[key];
}
}
item.data[name] = value;
})
}
})
}
return inputArray;
}
/**
* 快速分组值变化
*
* @memberof IBIZBOOKUsr3CalendarViewBase
*/
public quickGroupValueChange($event:any){
if($event){
this.quickGroupData = $event.data;
if(this.isEmitQuickGroupValue){
this.onSearch($event);
}
}
this.isEmitQuickGroupValue = true;
}
}
</script>
......
......@@ -9,9 +9,6 @@
<div class='content-container'>
<div style="margin-bottom:6px;">
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange"></app-quick-group>
</div>
<i-input v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' placeholder="图书名称" style='max-width: 400px;margin-top:6px;' />
<div class='pull-right'>
</div>
......@@ -548,7 +545,7 @@ export default class IBIZBOOKUsr4CalendarViewBase extends Vue {
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
_this.loadQuickGroupModel();
}
......@@ -735,100 +732,6 @@ export default class IBIZBOOKUsr4CalendarViewBase extends Vue {
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 快速分组数据对象
*
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public quickGroupData:any;
/**
* 快速分组是否有抛值
*
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public isEmitQuickGroupValue:boolean = false;
/**
* 快速分组模型
*
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public quickGroupModel:Array<any> = [];
/**
* 加载快速分组模型
*
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public loadQuickGroupModel(){
let quickGroupCodeList:any = {tag:'Bookgroup',codelistType:'STATIC'};
if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(quickGroupCodeList.tag);
if (codelist) {
this.quickGroupModel = [...this.handleDynamicData(JSON.parse(JSON.stringify(codelist.items)))];
} else {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
}
}else if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"DYNAMIC")){
this.codeListService.getItems(quickGroupCodeList.tag,{},{}).then((res:any) => {
this.quickGroupModel = res;
}).catch((error:any) => {
console.log(`----${quickGroupCodeList.tag}----代码表不存在`);
});
}
}
/**
* 处理快速分组模型动态数据部分(%xxx%)
*
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public handleDynamicData(inputArray:Array<any>){
if(inputArray.length >0){
inputArray.forEach((item:any) =>{
if(item.data && Object.keys(item.data).length >0){
Object.keys(item.data).forEach((name:any) =>{
let value: any = item.data[name];
if (value && typeof(value)=='string' && value.startsWith('%') && value.endsWith('%')) {
const key = (value.substring(1, value.length - 1)).toLowerCase();
if (this.context[key]) {
value = this.context[key];
} else if(this.viewparams[key]){
value = this.viewparams[key];
}
}
item.data[name] = value;
})
}
})
}
return inputArray;
}
/**
* 快速分组值变化
*
* @memberof IBIZBOOKUsr4CalendarViewBase
*/
public quickGroupValueChange($event:any){
if($event){
this.quickGroupData = $event.data;
if(this.isEmitQuickGroupValue){
this.onSearch($event);
}
}
this.isEmitQuickGroupValue = true;
}
}
</script>
......
......@@ -7,64 +7,64 @@
<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_sysportlet5
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem1"
ref='db_rawitem1'
name="db_sysportlet5"
ref='db_sysportlet5'
@closeview="closeView($event)">
</view_db_rawitem1>
</view_db_sysportlet5>
</span>
</card>
</i-col>
<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_rawitem2
<view_db_sysportlet6
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem2"
ref='db_rawitem2'
name="db_sysportlet6"
ref='db_sysportlet6'
@closeview="closeView($event)">
</view_db_rawitem2>
</view_db_sysportlet6>
</span>
</card>
</i-col>
<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_rawitem3
<view_db_sysportlet7
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem3"
ref='db_rawitem3'
name="db_sysportlet7"
ref='db_sysportlet7'
@closeview="closeView($event)">
</view_db_rawitem3>
</view_db_sysportlet7>
</span>
</card>
</i-col>
<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_rawitem4
<view_db_rawitem1
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem4"
ref='db_rawitem4'
name="db_rawitem1"
ref='db_rawitem1'
@closeview="closeView($event)">
</view_db_rawitem4>
</view_db_rawitem1>
</span>
</card>
</i-col>
......
<script lang='tsx'>
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_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_rawitem4 from '@widgets/app/db-rawitem4-portlet/db-rawitem4-portlet.vue';
import view_db_rawitem2 from '@widgets/app/db-rawitem2-portlet/db-rawitem2-portlet.vue';
import view_db_rawitem3 from '@widgets/app/db-rawitem3-portlet/db-rawitem3-portlet.vue';
import view_db_sysportlet7 from '@widgets/ibizappeditor/app-editor-amount-portlet/app-editor-amount-portlet.vue';
import view_db_sysportlet6 from '@widgets/ibizappctrl/app-ctrl-amount-portlet/app-ctrl-amount-portlet.vue';
@Component({
components: {
view_db_sysportlet5,
view_db_sysportlet4,
view_db_rawitem1,
view_db_sysportlet3,
view_db_sysportlet2,
view_db_sysportlet1,
view_db_rawitem4,
view_db_rawitem2,
view_db_rawitem3,
view_db_sysportlet7,
view_db_sysportlet6,
}
})
......
<template>
<div class='portlet app-ctrl-amount ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<div class="portlet-without-title">
<!-- 测试 -->
<view_db_sysportlet6_list
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="db_sysportlet6_list"
ref='db_sysportlet6_list'
@closeview="closeView($event)">
</view_db_sysportlet6_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 IBIZAPPCTRLService from '@/service/ibizappctrl/ibizappctrl-service';
import AppCtrlAmountService from './app-ctrl-amount-portlet-service';
import IBIZAPPCTRLUIService from '@/uiservice/ibizappctrl/ibizappctrl-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZAPPCTRLAppCtrlAmountBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof AppCtrlAmountBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppCtrlAmountBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof AppCtrlAmountBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppCtrlAmountBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppCtrlAmountBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof AppCtrlAmountBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AppCtrlAmountBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {AppCtrlAmountService}
* @memberof AppCtrlAmountBase
*/
public service: AppCtrlAmountService = new AppCtrlAmountService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZAPPCTRLService}
* @memberof AppCtrlAmountBase
*/
public appEntityService: IBIZAPPCTRLService = new IBIZAPPCTRLService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZAPPCTRLUIService}
* @memberof AppCtrlAmountBase
*/
public appUIService:IBIZAPPCTRLUIService = new IBIZAPPCTRLUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof AppCtrlAmountBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof AppCtrlAmountBase
*/
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 AppCtrlAmountBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof AppCtrlAmountBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof AppCtrlAmountBase
*/
public portletType: string = 'list';
/**
* 视图默认使用
*
* @type {string}
* @memberof AppCtrlAmountBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof AppCtrlAmountBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof AppCtrlAmountBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof AppCtrlAmountBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof AppCtrlAmountBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof AppCtrlAmountBase
*/
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 AppCtrlAmountBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'db_sysportlet6_list', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof AppCtrlAmountBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AppCtrlAmountBase
*/
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 AppCtrlAmountBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AppCtrlAmountBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof AppCtrlAmountBase
*/
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-ctrl-amount-portlet.less';
</style>
/**
* AppCtrlAmount 部件模型
*
* @export
* @class AppCtrlAmountModel
*/
export default class AppCtrlAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof AppCtrlAmountModel
*/
public getDataItems(): any[] {
return [
{
name: 'ibizappctrlname',
},
{
name: 'ibizappctrl',
prop: 'ibizappctrlid',
},
{
name: 'updatedate',
},
{
name: 'createdate',
},
{
name: 'createman',
},
{
name: 'updateman',
},
{
name: 'ibizappctrltype',
},
{
name: 'ctrldescription',
},
{
name: 'documentaddress',
},
{
name: 'amount',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* AppCtrlAmount 部件服务对象
*
* @export
* @class AppCtrlAmountService
*/
export default class AppCtrlAmountService 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 IBIZAPPCTRLAppCtrlAmountBase from './app-ctrl-amount-portlet-base.vue';
import view_db_sysportlet6_list from '@widgets/ibizappctrl/ctrl-amount-list/ctrl-amount-list.vue';
@Component({
components: {
view_db_sysportlet6_list,
}
})
export default class IBIZAPPCTRLAppCtrlAmount extends IBIZAPPCTRLAppCtrlAmountBase {
}
</script>
/**
* CtrlAmount 部件模型
*
* @export
* @class CtrlAmountModel
*/
export default class CtrlAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof CtrlAmountDb_sysportlet6_listMode
*/
public getDataItems(): any[] {
return [
{
name: 'srfamount',
prop: 'amount',
dataType: 'INT',
},
{
name: 'srfkey',
prop: 'ibizappctrlid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'ibizappctrlname',
dataType: 'TEXT',
},
{
name: 'ibizappctrl',
prop: 'ibizappctrlid',
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 IBIZAPPCTRLService from '@/service/ibizappctrl/ibizappctrl-service';
import CtrlAmountModel from './ctrl-amount-list-model';
/**
* CtrlAmount 部件服务对象
*
* @export
* @class CtrlAmountService
*/
export default class CtrlAmountService extends ControlService {
/**
* 应用部件服务对象
*
* @type {IBIZAPPCTRLService}
* @memberof CtrlAmountService
*/
public appEntityService: IBIZAPPCTRLService = new IBIZAPPCTRLService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof CtrlAmountService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of CtrlAmountService.
*
* @param {*} [opts={}]
* @memberof CtrlAmountService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new CtrlAmountModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof CtrlAmountService
*/
@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 CtrlAmountService
*/
@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 CtrlAmountService
*/
@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 CtrlAmountService
*/
@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 CtrlAmountBase from './ctrl-amount-list-base.vue';
@Component({
components: {
}
})
export default class CtrlAmount extends CtrlAmountBase {
}
</script>
\ No newline at end of file
<template>
<div class='portlet app-editor-amount ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<div class="portlet-without-title">
<!-- 测试 -->
<view_db_sysportlet7_list
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="db_sysportlet7_list"
ref='db_sysportlet7_list'
@closeview="closeView($event)">
</view_db_sysportlet7_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 AppEditorAmountService from './app-editor-amount-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 IBIZAPPEDITORAppEditorAmountBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof AppEditorAmountBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppEditorAmountBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof AppEditorAmountBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppEditorAmountBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppEditorAmountBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof AppEditorAmountBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AppEditorAmountBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {AppEditorAmountService}
* @memberof AppEditorAmountBase
*/
public service: AppEditorAmountService = new AppEditorAmountService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZAPPEDITORService}
* @memberof AppEditorAmountBase
*/
public appEntityService: IBIZAPPEDITORService = new IBIZAPPEDITORService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZAPPEDITORUIService}
* @memberof AppEditorAmountBase
*/
public appUIService:IBIZAPPEDITORUIService = new IBIZAPPEDITORUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof AppEditorAmountBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof AppEditorAmountBase
*/
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 AppEditorAmountBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof AppEditorAmountBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof AppEditorAmountBase
*/
public portletType: string = 'list';
/**
* 视图默认使用
*
* @type {string}
* @memberof AppEditorAmountBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof AppEditorAmountBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof AppEditorAmountBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof AppEditorAmountBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof AppEditorAmountBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof AppEditorAmountBase
*/
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 AppEditorAmountBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'db_sysportlet7_list', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof AppEditorAmountBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AppEditorAmountBase
*/
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 AppEditorAmountBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AppEditorAmountBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof AppEditorAmountBase
*/
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-editor-amount-portlet.less';
</style>
/**
* AppEditorAmount 部件模型
*
* @export
* @class AppEditorAmountModel
*/
export default class AppEditorAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof AppEditorAmountModel
*/
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: 'inbuilteditoramount',
},
{
name: 'expandeditoramount',
},
{
name: 'totalamount',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* AppEditorAmount 部件服务对象
*
* @export
* @class AppEditorAmountService
*/
export default class AppEditorAmountService 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 IBIZAPPEDITORAppEditorAmountBase from './app-editor-amount-portlet-base.vue';
import view_db_sysportlet7_list from '@widgets/ibizappeditor/editor-amount-list/editor-amount-list.vue';
@Component({
components: {
view_db_sysportlet7_list,
}
})
export default class IBIZAPPEDITORAppEditorAmount extends IBIZAPPEDITORAppEditorAmountBase {
}
</script>
/**
* EditorAmount 部件模型
*
* @export
* @class EditorAmountModel
*/
export default class EditorAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof EditorAmountDb_sysportlet7_listMode
*/
public getDataItems(): any[] {
return [
{
name: 'srfamount',
prop: 'totalamount',
dataType: 'INT',
},
{
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 EditorAmountModel from './editor-amount-list-model';
/**
* EditorAmount 部件服务对象
*
* @export
* @class EditorAmountService
*/
export default class EditorAmountService extends ControlService {
/**
* 编辑器服务对象
*
* @type {IBIZAPPEDITORService}
* @memberof EditorAmountService
*/
public appEntityService: IBIZAPPEDITORService = new IBIZAPPEDITORService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof EditorAmountService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of EditorAmountService.
*
* @param {*} [opts={}]
* @memberof EditorAmountService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new EditorAmountModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EditorAmountService
*/
@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 EditorAmountService
*/
@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 EditorAmountService
*/
@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 EditorAmountService
*/
@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 EditorAmountBase from './editor-amount-list-base.vue';
@Component({
components: {
}
})
export default class EditorAmount extends EditorAmountBase {
}
</script>
\ No newline at end of file
<template>
<div class='portlet app-view-amount ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<div class="portlet-without-title">
<!-- 测试 -->
<view_db_sysportlet5_list
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="db_sysportlet5_list"
ref='db_sysportlet5_list'
@closeview="closeView($event)">
</view_db_sysportlet5_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 IBIZAPPVIEWService from '@/service/ibizappview/ibizappview-service';
import AppViewAmountService from './app-view-amount-portlet-service';
import IBIZAPPVIEWUIService from '@/uiservice/ibizappview/ibizappview-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZAPPVIEWAppViewAmountBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof AppViewAmountBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppViewAmountBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof AppViewAmountBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppViewAmountBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppViewAmountBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof AppViewAmountBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AppViewAmountBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {AppViewAmountService}
* @memberof AppViewAmountBase
*/
public service: AppViewAmountService = new AppViewAmountService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZAPPVIEWService}
* @memberof AppViewAmountBase
*/
public appEntityService: IBIZAPPVIEWService = new IBIZAPPVIEWService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZAPPVIEWUIService}
* @memberof AppViewAmountBase
*/
public appUIService:IBIZAPPVIEWUIService = new IBIZAPPVIEWUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof AppViewAmountBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof AppViewAmountBase
*/
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 AppViewAmountBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof AppViewAmountBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof AppViewAmountBase
*/
public portletType: string = 'list';
/**
* 视图默认使用
*
* @type {string}
* @memberof AppViewAmountBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof AppViewAmountBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof AppViewAmountBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof AppViewAmountBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof AppViewAmountBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof AppViewAmountBase
*/
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 AppViewAmountBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'db_sysportlet5_list', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof AppViewAmountBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AppViewAmountBase
*/
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 AppViewAmountBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AppViewAmountBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof AppViewAmountBase
*/
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-view-amount-portlet.less';
</style>
/**
* AppViewAmount 部件模型
*
* @export
* @class AppViewAmountModel
*/
export default class AppViewAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof AppViewAmountModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'createdate',
},
{
name: 'ibizappviewname',
},
{
name: 'ibizappview',
prop: 'ibizappviewid',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'ibizappviewtype',
},
{
name: 'documentaddress',
},
{
name: 'instanceaddress',
},
{
name: 'viewdescription',
},
{
name: 'amount',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* AppViewAmount 部件服务对象
*
* @export
* @class AppViewAmountService
*/
export default class AppViewAmountService 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 IBIZAPPVIEWAppViewAmountBase from './app-view-amount-portlet-base.vue';
import view_db_sysportlet5_list from '@widgets/ibizappview/view-amount-list/view-amount-list.vue';
@Component({
components: {
view_db_sysportlet5_list,
}
})
export default class IBIZAPPVIEWAppViewAmount extends IBIZAPPVIEWAppViewAmountBase {
}
</script>
/**
* ViewAmount 部件模型
*
* @export
* @class ViewAmountModel
*/
export default class ViewAmountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ViewAmountDb_sysportlet5_listMode
*/
public getDataItems(): any[] {
return [
{
name: 'srfamount',
prop: 'amount',
dataType: 'INT',
},
{
name: 'srfkey',
prop: 'ibizappviewid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'ibizappviewname',
dataType: 'TEXT',
},
{
name: 'ibizappview',
prop: 'ibizappviewid',
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 IBIZAPPVIEWService from '@/service/ibizappview/ibizappview-service';
import ViewAmountModel from './view-amount-list-model';
/**
* ViewAmount 部件服务对象
*
* @export
* @class ViewAmountService
*/
export default class ViewAmountService extends ControlService {
/**
* 应用视图服务对象
*
* @type {IBIZAPPVIEWService}
* @memberof ViewAmountService
*/
public appEntityService: IBIZAPPVIEWService = new IBIZAPPVIEWService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof ViewAmountService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of ViewAmountService.
*
* @param {*} [opts={}]
* @memberof ViewAmountService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new ViewAmountModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ViewAmountService
*/
@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 ViewAmountService
*/
@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 ViewAmountService
*/
@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 ViewAmountService
*/
@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 ViewAmountBase from './view-amount-list-base.vue';
@Component({
components: {
}
})
export default class ViewAmount extends ViewAmountBase {
}
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册