提交 3fefc6ad 编写于 作者: tony001's avatar tony001

Merge branch 'dev'

......@@ -78,6 +78,7 @@ import AppOrgSelect from './components/app-org-select/app-org-select.vue'
import AppDepartmentSelect from './components/app-department-select/app-department-select.vue'
import AppGroupSelect from './components/app-group-select/app-group-select.vue'
import UpdatePwd from './components/app-update-password/app-update-password.vue'
import AppMenuItem from './components/app-menu-item/app-menu-item.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载实体权限服务注册中心
......@@ -168,5 +169,6 @@ export const AppComponents = {
v.component('app-transfer',AppTransfer);
v.component('context-menu-drag',ContextMenuDrag);
v.component('app-update-password',UpdatePwd);
v.component('app-menu-item', AppMenuItem);
},
};
\ No newline at end of file
<template>
<div class="app-actionbar">
<div class="app-actionbar-item" v-for="(item,index) in items" :key="index">
<Badge v-if="item.counterService&&item.counterService.counterData" :count="item.counterService.counterData[item.counterId]" type="primary">
<i-button @click="handleClick(item.viewlogicname)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
<Badge v-if="item.counterService&&item.counterService.counterData" v-show="item.visabled" :count="item.counterService.counterData[item.counterId]" type="primary">
<i-button :style="{'pointer-events':item.disabled?'none':'auto'}" @click="handleClick(item.viewlogicname)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
</Badge>
<i-button v-else @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
<i-button v-show="item.visabled" :style="{'pointer-events':item.disabled?'none':'auto'}" v-else @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
</div>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Model, Emit } from "vue-property-decorator";
import { Subject } from "rxjs";
import { Vue, Component, Prop, Model, Emit,Inject, Watch } from "vue-property-decorator";
import { Subject,Subscription } from "rxjs";
@Component({})
export default class AppActionBar extends Vue {
......@@ -24,6 +24,49 @@ export default class AppActionBar extends Vue {
*/
@Prop() public items!:any;
/**
* 注入的UI服务
*
* @type {*}
* @memberof AppActionBar
*/
@Prop() public uiService!: any;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppActionBar
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ActionlinetestBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 组件初始化
*
* @memberof AppActionBar
*/
public created(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, "app-actionbar")) {
return;
}
if(Object.is(action,'loadmodel')){
this.calcActionItemAuthState(data,this.items,this.uiService);
}
});
}
}
/**
* 触发界面行为
*
......@@ -33,6 +76,52 @@ export default class AppActionBar extends Vue {
this.$emit('itemClick',$event);
}
/**
* 计算界面行为项权限状态
*
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof AppActionBar
*/
public calcActionItemAuthState(data:any,ActionModel:any,UIService:any){
for (const key in ActionModel) {
if (!ActionModel.hasOwnProperty(key)) {
return;
}
const _item = ActionModel[key];
if(_item && _item['dataaccaction'] && UIService && data && Object.keys(data).length >0){
let dataActionResult:any = UIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_item.visabled = false;
}else{
_item.visabled = true;
}
}
if(dataActionResult === 1){
_item.visabled = true;
_item.disabled = false;
}
}
}
}
/**
* 组件销毁
*
* @memberof AppActionBar
*/
public destory(){
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
......
......@@ -161,6 +161,7 @@ export default class Breadcrumb extends Vue {
if(item && item.meta && item.meta.viewType && Object.is(item.meta.viewType,"APPINDEX")){
let path: string | null = window.sessionStorage.getItem(Environment.AppName);
if (path) {
this.$store.commit("removeAllPage");
this.$router.push({ path: path });
} else {
this.$router.push("/");
......
......@@ -165,7 +165,7 @@ export default class AppFormGroup extends Vue {
if(_item && _item['dataaccaction'] && UIService && data && Object.keys(data).length >0){
let dataActionResult:any = UIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(!dataActionResult){
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
......@@ -175,7 +175,8 @@ export default class AppFormGroup extends Vue {
}else{
_item.visabled = true;
}
}else{
}
if(dataActionResult === 1){
_item.visabled = true;
_item.disabled = false;
}
......
<template>
<div class="app-menu-item">
<template v-for="item in menus">
<template v-if="item.items && Array.isArray(item.items) && item.items.length > 0">
<el-submenu v-show="!item.hidden" :index="item.name" :popper-class="popperClass" :key="item.id">
<template slot='title'>
<template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' />
</template>
<template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template>
<span class='text' :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
</template>
<app-menu-item :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popperclass="popperClass"></app-menu-item>
</el-submenu>
</template>
<template v-else>
<template v-if="item.type =='MENUITEM'">
<el-menu-item v-show="!item.hidden" :index="item.name" :key="item.id">
<template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' />
</template>
<template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template>
<template slot="title">
<span class="text" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
<template v-if="item.type =='SEPERATOR'">
<divider :key="item.id" />
</template>
</template>
</template>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
@Component({})
export default class AppMenuItem extends Vue {
/**
* 菜单数据
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop( {default: []} ) public menus!: any;
/**
* 部件名称
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public ctrlName!: string;
/**
* 计数器数据
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public counterdata!: any;
/**
* 提示框主题样式
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public popperClass!: any;
/**
* 是否是一级菜单
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public isFirst!: boolean;
}
</script>
\ No newline at end of file
......@@ -242,7 +242,7 @@ export default class AppPicker extends Vue {
* @param {*} oldVal
* @memberof AppPicker
*/
@Watch('value')
@Watch('value',{immediate:true})
public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
......
......@@ -6,7 +6,7 @@
<script lang="ts">
import { Vue, Component, Prop, Watch, Model } from 'vue-property-decorator';
import moment from "moment";
@Component({})
export default class AppSpan extends Vue {
......@@ -18,6 +18,38 @@ export default class AppSpan extends Vue {
*/
@Prop() public value?: any;
/**
* 数据类型
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public dataType?: string;
/**
* 单位名称
*
* @type {string}
* @memberof AppSpan
*/
@Prop({default:''}) public unitName?: string;
/**
* 精度
*
* @type {number}
* @memberof AppSpan
*/
@Prop({default:'2'}) public precision?:number;
/**
* 日期值格式化
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public valueFormat?: string;
/**
* 当前表单项名称
*
......@@ -158,12 +190,52 @@ export default class AppSpan extends Vue {
}else{
if(this.$util.isEmpty(this.value)){
this.text = '';
}else if(this.dataType){
this.dataFormat();
}else{
this.text = this.value;
}
}
}
/**
* 数据格式化
*
* @memberof AppSpan
*/
public dataFormat(){
if(this.valueFormat){
this.dateFormat() ;
return;
}
if(Object.is(this.dataType,"CURRENCY")){
let number:any = Number(this.value);
this.text = Number(number.toFixed(this.precision)).toLocaleString('en-US')+ ' '+ this.unitName;
}else if(Object.is(this.dataType,"FLOAT") || Object.is(this.dataType,"DECIMAL")){
let number:any = Number(this.value);
this.text = number.toFixed(this.precision);
}else {
this.text = this.value;
}
}
/**
* 日期格式化
*
* @memberof AppSpan
*/
public dateFormat(){
if(this.valueFormat){
if(this.valueFormat.indexOf('%1$t') !== -1){
this.text= moment(this.data).format("YYYY-MM-DD HH:mm:ss");
}else if(this.valueFormat.indexOf('%1$s') == -1){
this.text= moment(this.data).format(this.valueFormat);
}else{
this.text= this.value;
}
}
}
}
</script>
......
......@@ -7,8 +7,7 @@
:precision="precision"
v-model="CurrentVal"
:disabled="disabled ? true : false"
:formatter="formatter"
:parser="parser"
:active-change="false"
></InputNumber>
<i-input v-else
:placeholder="placeholder"
......@@ -188,29 +187,7 @@ export default class InputBox extends Vue {
}
}
/**
* 指定输入框展示值的格式
*/
public formatter(value:any){
if(this.precision===0) return this.CurrentVal;
if(value.indexOf('.')!==-1){
let arr:Array<any> = value.split('.');
if(arr[1]==='00'){
return arr[0];
}
if(parseInt(arr[1])%10===0){
return arr[0]+'.'+parseInt(arr[1])/10;
}
}
return value;
}
/**
* 指定从 formatter 里转换回数字的方式
*/
public parser(value:any){
return value;
}
}
</script>
......
......@@ -193,7 +193,7 @@ export default class ViewEngine {
if(_item && _item['dataaccaction'] && _this.view.appUIService && data && Object.keys(data).length >0){
let dataActionResult:any = _this.view.appUIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(!dataActionResult){
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_this.view.toolBarModels[key].disabled = true;
......@@ -203,8 +203,10 @@ export default class ViewEngine {
}else{
_this.view.toolBarModels[key].visabled = true;
}
}else{
}
if(dataActionResult === 1){
_this.view.toolBarModels[key].visabled = true;
_this.view.toolBarModels[key].disabled = false;
}
}
}
......
......@@ -294,7 +294,8 @@ export default class EntityService {
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME) as any);
if(result){
let tempResult:any = result.filter((item:any) =>{
return !( Object.is(item[this.APPDEKEY],data[this.APPDEKEY]) && Object.is(item[this.APPDETEXT],data[this.APPDETEXT]));
// return !( Object.is(item[this.APPDEKEY],data[this.APPDEKEY]) && Object.is(item[this.APPDETEXT],data[this.APPDETEXT]));
return !Object.is(item[this.APPDEKEY],data[this.APPDEKEY]);
})
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempResult));
return {"status":200,"data":data};
......@@ -596,6 +597,19 @@ export default class EntityService {
return Http.getInstance().post(`/${this.APPDENAME}/batch`,data,isloading);
}
/**
* saveBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async saveBatch(context: any = {},data: any, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/${this.APPDENAME}/savebatch`,data,isloading);
}
/**
* updateBatch接口方法
*
......
.el-popover {
overflow-y: auto;
//z-index: 99 !important;
background: #ffffff;
border: 1px solid #dee0e4;
padding: 0px;
z-index: 2000;
color: var(--app-color-font-content);
line-height: 1.4;
text-align: justify;
font-size: 14px;
overflow-y: hidden;
overflow-x: hidden;
.el-card__header {
padding: 5px 10px;
border-bottom: 1px solid #dee0e4;
color: var(--app-color-font-content);
}
.el-card{
min-width: 150px;
border: none;
background-color: #ffffff;
color: var(--app-color-font-content);
}
.el-card__body {
padding: 0px;
overflow-x:hidden;
overflow-y: auto;
.viewcontainer2{
.content-container{
margin: 0;
}
}
}
}
.clearfix{
position: relative;
.cancel{
position: absolute;
right: 5px;
top: 5px;
}
.app-popover-wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
.app-popover.app-popper {
border-radius: 5px;
overflow: auto;
border: 1px solid #bfbfbf;
padding: 5px;
background: #e8e8e8;
}
}
\ No newline at end of file
import Vue, { CreateElement } from 'vue';
import PopperJs from 'popper.js';
import { Subject, Observable } from 'rxjs';
import { createPopper, Instance } from '@popperjs/core/lib/popper-lite.js';
import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow.js';
import flip from '@popperjs/core/lib/modifiers/flip.js';
import { Placement } from '@popperjs/core/lib/enums';
import { on } from '../dom/dom';
import './app-popover.less';
import { ViewTool } from '../view-tool/view-tool';
import store from '../../store';
import i18n from '@/locale';
import { Subject } from 'rxjs';
import './app-popover.less';
/**
* 悬浮窗控制器实例
......@@ -24,6 +24,7 @@ export class AppPopover {
* @memberof AppPopover
*/
private static readonly $popover = new AppPopover();
/**
* vue实例
*
......@@ -32,14 +33,16 @@ export class AppPopover {
* @memberof AppPopover
*/
private vueExample!: Vue;
/**
* PopperJs实例
*
* @private
* @type {PopperJs}
* @type {Instance}
* @memberof AppPopover
*/
private popperExample?: PopperJs;
private popperExample?: Instance;
/**
* 是否显示悬浮窗
*
......@@ -48,6 +51,7 @@ export class AppPopover {
* @memberof AppPopover
*/
private showPopper: boolean = false;
/**
* 是否在点击空白区域时自动关闭
*
......@@ -56,33 +60,15 @@ export class AppPopover {
* @memberof AppPopover
*/
private isAutoClose: boolean = true;
/**
* 当前激活popver标识
*
* @private
* @type {string}
* @memberof AppPopover
*/
private activePopoverTag?: string;
/**
* 返回数据
*/
private tempResult = { ret: '' };
/**
* 数据传递对象
*/
private subject: any;
/**
* 气泡卡片层级
* 当前显示层级
*
* @private
* @type {(number | null)}
* @type {number}
* @memberof AppPopover
*/
private zIndex: number | null = null;
private zIndex: number = 0;
/**
* Creates an instance of AppPopover.
......@@ -92,12 +78,6 @@ export class AppPopover {
if (AppPopover.$popover) {
return AppPopover.$popover;
}
on(document, 'click', () => {
if (!this.showPopper || !this.isAutoClose) {
return;
}
this.destroy();
});
}
/**
......@@ -108,207 +88,112 @@ export class AppPopover {
* @memberof AppPopover
*/
private initVueExample(): void {
const self = this;
const container = document.createElement('div');
container.className = 'app-popover-wrapper';
on(container, 'click', () => {
if (!this.showPopper || !this.isAutoClose) {
return;
}
this.popperDestroy();
});
const div = document.createElement('div');
document.body.appendChild(div);
container.appendChild(div);
document.body.appendChild(container);
this.vueExample = new Vue({
el: div,
store: store,
i18n: i18n,
data: {
title: null,
content: null,
isShow: false
data: { content: null, width: 300, height: 300 },
methods: {
click(e: MouseEvent) {
e.stopPropagation();
}
},
render(h: CreateElement) {
const content: any = this.content;
const style: string = `display: ${this.isShow ? 'block' : 'none'};`;
return <div style={style} class="el-popover el-popper panel-design-popover">
<el-card ref="datacard">
{
this.title ? <div slot="header" class="clearfix">
<span>{this.title}</span>
<span class="cancel" ref="cancel"><i class="fa fa-times" aria-hidden="true" style="cursor: pointer;"></i></span>
</div> : null
}
<div style="height:100%;">
{content ? content(h) : null}
</div>
</el-card>
<div x-arrow class="popper__arrow"></div>
</div>;
}
});
on(this.vueExample.$el, 'click', (event: any) => {
if (Object.is(event.target.outerHTML, '<i aria-hidden="true" class="fa fa-times" style="cursor: pointer;"></i>')) {
this.destroy();
} else {
event.stopPropagation();
container.style.zIndex = (self.zIndex - 1).toString();
return <div v-show="self.showPopper" style={{ width: this.width + 'px', height: this.height + 'px', 'z-index': self.zIndex }} class="app-popover app-popper" on-click={this.click}>{(self.showPopper && content) ? content(h) : null}</div>;
}
});
}
/**
/**
* 打开悬浮窗
*
* @param {MouseEvent} event 事件
* @param {*} view 视图
* @param {*} [context={}] 应用上下文参数
* @param {any[]} deResParameters 关系实体参数对象
* @param {any[]} parameters 当前应用视图参数对象
* @param {any[]} args 多项数据
* @param {*} data 行为参数
* @param {string} [title] 标题
* @param {PopperJs.Placement} [position='left'] 悬浮窗位置
* @param {boolean} [isAutoClose=true] 是否自动关闭
* @param {number} [width] 宽度
* @param {number} [height] 高度
* @returns {Subject<any>}
* @param {Placement} position 显示位置
* @param {boolean} isAutoClose 是否可自动关闭
* @returns {Observable<any>}
* @memberof AppPopover
*/
public openPop(event: MouseEvent, view: any, context: any = {}, data: any, title?: string, position: PopperJs.Placement = 'left', isAutoClose: boolean = true, width?: number, height?: number): Subject<any> {
let viewdata: any = {};
Object.assign(viewdata, JSON.parse(JSON.stringify(context)));
this.subject = new Subject<any>();
public openPop(event: any, view: any, context: any = {}, data: any, position?: Placement, isAutoClose?: boolean): Observable<any> {
const subject = new Subject<any>();
if(!event){
console.error("事件触发源无值,强制返回");
return subject.asObservable();
}
if(!view.width) view.width = 300;
if(!view.height) view.height = 300;
this.openPopover(event, (h: CreateElement) => {
return h(view.viewname, {
class: {
viewcontainer2: true,
},
props: {
viewdata: JSON.stringify(viewdata),
viewdata: JSON.stringify(context),
viewDefaultUsage: false,
viewparam:JSON.stringify(data)
viewUsage: 4,
viewparam: JSON.stringify(data)
},
on: {
viewdataschange: ($event: any) => this.dataChange($event),
close: ($event: any) => this.viewclose($event)
},
close: (result: any) => {
subject.next({ ret: 'OK', datas: result });
subject.complete();
subject.unsubscribe();
}
}
})
}, view.title, undefined, false, view.width, view.height);
return this.subject;
}
/**
* 数据变化回调
* @param $event
*/
public dataChange(result: any) {
this.tempResult = { ret: '' };
if (result && Array.isArray(result) && result.length > 0) {
Object.assign(this.tempResult, { ret: 'OK' }, { datas: JSON.parse(JSON.stringify(result)) });
}
this.close();
this.destroy();
}
/**
* 视图关闭
* @param result
*/
public viewclose(result: any) {
if (result && Array.isArray(result) && result.length > 0) {
Object.assign(this.tempResult, { datas: JSON.parse(JSON.stringify(result)) });
}
this.destroy();
}
/**
* 关闭回调(吐值)
*/
public close() {
if (this.tempResult && Object.is(this.tempResult.ret, 'OK')) {
this.subject.next(this.tempResult);
}
}, position, isAutoClose, view.width, view.height);
return subject.asObservable();
}
/**
* 打开悬浮窗
*
* @param {MouseEvent} event
* @param {*} event
* @param {(h: CreateElement) => any} [content]
* @param {string} [title]
* @param {PopperJs.Placement} [position='left']
* @param {Placement} [position='left']
* @param {boolean} [isAutoClose=true]
* @param {number} [width]
* @param {number} [height]
* @returns {void}
* @param {number} [width=300]
* @param {number} [height=300]
* @memberof AppPopover
*/
public openPopover(event: any, content?: (h: CreateElement) => any, title?: string, position: PopperJs.Placement = 'left', isAutoClose: boolean = true, width?: number, height?: number): void {
public openPopover(event: any, content?: (h: CreateElement) => any, position: Placement = 'left-end', isAutoClose: boolean = true, width: number = 300, height: number = 300): void {
// 阻止事件冒泡
event.stopPropagation();
const element: Element = event.toElement || event.srcElement;
if (element.hasAttribute('app-popover-tag')) {
const tag: any = element.getAttribute('app-popover-tag');
if (Object.is(this.activePopoverTag, tag)) {
this.destroy();
return;
}
this.activePopoverTag = tag;
} else {
const tag: string = 'app-popover-tag-' + new Date().getTime();
element.setAttribute('app-popover-tag', tag);
this.activePopoverTag = tag;
}
// if (!this.vueExample) {
// this.initVueExample();
// }
if (this.vueExample) {
this.destroy();
if (!this.vueExample) {
this.initVueExample();
}
this.initVueExample();
const _element: any = this.vueExample.$el;
this.popperDestroy();
const zIndex = this.vueExample.$store.getters.getZIndex();
if (zIndex) {
this.zIndex = zIndex + 100;
this.vueExample.$store.commit('updateZIndex', this.zIndex);
}
_element.style.zIndex = this.zIndex;
const datacard: any = this.vueExample.$refs.datacard;
datacard.$el.style.width = width !== 0 ? width + 'px' : '240px';
datacard.$el.getElementsByClassName('el-card__body')[0].style.height = height !== 0 ? height + 'px' : '562px';
// if (width !== '0px' && width) {
// this.vueExample.$refs.datacard.$el.style.width = width;
// } else {
// this.vueExample.$refs.datacard.$el.style.width = '240px';
// }
// if (height !== '0px' && height) {
// this.vueExample.$refs.datacard.$el.getElementsByClassName('el-card__body')[0].style.height = height;
// } else {
// this.vueExample.$refs.datacard.$el.getElementsByClassName('el-card__body')[0].style.height = '562px';
// }
// this.destroy();
// 是否可自动关闭
this.isAutoClose = isAutoClose;
// 更新vue实例内容
this.vueExample.$data.title = title;
this.vueExample.$data.content = content;
this.vueExample.$data.isShow = true;
this.vueExample.$forceUpdate();
// 绘制popover
const config: PopperJs.PopperOptions = {
this.showPopper = true;
Object.assign(this.vueExample.$data, { content, width, height, zIndex: this.zIndex });
const el: any = this.vueExample.$el;
this.popperExample = createPopper(element, el, {
placement: position,
onCreate: () => {
this.showPopper = true;
},
onUpdate: (arg) => {
const popper: any = arg.instance.popper;
popper.style.display = 'none';
},
modifiers: {
flip: {
boundariesElement: 'viewport'
},
preventOverflow: {
boundariesElement: document.getElementsByClassName('app-index')[0]
}
}
};
this.popperExample = new PopperJs(element, this.vueExample.$el, config);
this.popperExample.update();
strategy: 'absolute',
modifiers: [preventOverflow, flip]
});
this.vueExample.$forceUpdate();
}
/**
......@@ -316,22 +201,15 @@ export class AppPopover {
*
* @memberof AppPopover
*/
public destroy(): void {
public popperDestroy(): void {
if (this.popperExample) {
this.popperExample.destroy();
if (this.zIndex) {
if (this.zIndex !== 0) {
const zIndex: any = this.zIndex;
this.vueExample.$store.commit('updateZIndex', zIndex - 100);
this.zIndex = null;
this.zIndex = 0;
}
this.vueExample.$destroy();
document.body.removeChild(this.vueExample.$el);
this.popperExample = undefined;
this.showPopper = false;
this.activePopoverTag = '';
this.vueExample.$data.isShow = false;
this.vueExample.$forceUpdate();
}
}
......
import { Notice } from 'view-design';
export function Errorlog(target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<any>){
let origin=descriptor.value;
let $Notice: any = Notice;
descriptor.value=function(...args:any[]){
return new Promise((resolve: any, reject: any) => {
// 原方法调用方法
......@@ -12,7 +9,7 @@ export function Errorlog(target: Object, propertyKey: string, descriptor: TypedP
}).catch((error:any)=>{
// 开发模式下页面报错
if (process.env.NODE_ENV === 'development') {
$Notice.error({ title: '错误', desc: target.constructor.name+'类'+propertyKey+'方法产生异常' });
console.error(target.constructor.name+'类'+propertyKey+'方法产生异常');
}
// 控制台报错
console.error(error);
......
......@@ -260,7 +260,7 @@ export class ViewTool {
if(_item && _item['dataaccaction'] && UIService && data && Object.keys(data).length >0){
let dataActionResult:any = UIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(!dataActionResult){
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
......@@ -270,7 +270,8 @@ export class ViewTool {
}else{
_item.visabled = true;
}
}else{
}
if(dataActionResult === 1){
_item.visabled = true;
_item.disabled = false;
}
......
......@@ -1210,6 +1210,11 @@
dependencies:
mkdirp "^1.0.4"
"@popperjs/core@^2.4.3":
version "2.4.4"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.4.4.tgz#11d5db19bd178936ec89cd84519c4de439574398"
integrity sha512-1oO6+dN5kdIA3sKPZhRGJTfGVP4SWV6KqlMOwry4J3HfyD68sl/3KmG7DeYUzvN+RbhXDnv/D8vNNB8168tAMg==
"@soda/friendly-errors-webpack-plugin@^1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz#706f64bcb4a8b9642b48ae3ace444c70334d615d"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册