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

ibiz4j 发布系统代码 [ibz-disk,存储]

上级 2af7f798
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
"typescript": "~3.5.3", "typescript": "^4.0.3",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
} }
} }
...@@ -104,6 +104,9 @@ import AppMapPosition from './components/app-map-position/app-map-position.vue'; ...@@ -104,6 +104,9 @@ import AppMapPosition from './components/app-map-position/app-map-position.vue';
import AppSortBar from './components/app-sort-bar/app-sort-bar.vue'; import AppSortBar from './components/app-sort-bar/app-sort-bar.vue';
import AppAfterTime from './components/app-after-time/app-after-time.vue'; import AppAfterTime from './components/app-after-time/app-after-time.vue';
import AppInputIp from './components/app-input-ip/app-input-ip.vue'; import AppInputIp from './components/app-input-ip/app-input-ip.vue';
import Loadding from './directive/loadding/loadding';
import AppColorSpan from './components/app-color-span/app-color-span.vue';
import AppColorPicker from './components/app-color-picker/app-color-picker.vue';
// 全局挂载UI实体服务注册中心 // 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister; window['uiServiceRegister'] = uiServiceRegister;
...@@ -223,5 +226,8 @@ export const AppComponents = { ...@@ -223,5 +226,8 @@ export const AppComponents = {
v.component('app-sort-bar', AppSortBar); v.component('app-sort-bar', AppSortBar);
v.component('app-after-time', AppAfterTime); v.component('app-after-time', AppAfterTime);
v.component('app-input-ip', AppInputIp); v.component('app-input-ip', AppInputIp);
v.directive('loading',Loadding);
v.component('app-color-span', AppColorSpan);
v.component('app-color-picker', AppColorPicker);
}, },
}; };
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop, Emit, Watch, Model } from 'vue-property-decorator'; import { Vue, Component, Prop, Emit, Watch, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';
import moment from 'moment';
@Component({}) @Component({})
export default class AppAfterTime extends Vue { export default class AppAfterTime extends Vue {
...@@ -105,8 +106,9 @@ export default class AppAfterTime extends Vue { ...@@ -105,8 +106,9 @@ export default class AppAfterTime extends Vue {
*/ */
public transTime(){ public transTime(){
if(this.value){ if(this.value){
let oldTime = new Date(this.value).getTime(); let dateString:any = 'YYYY年MM月DD日' || 'YYYY年MM月DD日 HH时mm分ss秒' || 'YYYY-MM-DD HH:mm:ss' || 'YYYY-MM-DD' || 'YYYY/MM/DD HH:mm:ss' || 'YYYY/MM/DD';
let nowTime = new Date().getTime(); let oldTime = moment(this.value,dateString).valueOf();
let nowTime = moment().valueOf();
let diffTime = nowTime - oldTime; let diffTime = nowTime - oldTime;
if(diffTime < 3600000){ if(diffTime < 3600000){
this.curvalue = Math.ceil(diffTime/60000)+''; this.curvalue = Math.ceil(diffTime/60000)+'';
...@@ -119,7 +121,7 @@ export default class AppAfterTime extends Vue { ...@@ -119,7 +121,7 @@ export default class AppAfterTime extends Vue {
this.diffTime = 'days'; this.diffTime = 'days';
}else if(diffTime < 31104000000){ }else if(diffTime < 31104000000){
this.curvalue = Math.floor(diffTime/2592000000)+''; this.curvalue = Math.floor(diffTime/2592000000)+'';
this.diffTime = 'mounth'; this.diffTime = 'mouth';
}else{ }else{
this.curvalue = Math.floor(diffTime/31104000000)+''; this.curvalue = Math.floor(diffTime/31104000000)+'';
this.diffTime = 'years'; this.diffTime = 'years';
......
...@@ -114,7 +114,6 @@ export default class AppAlertGroup extends Vue { ...@@ -114,7 +114,6 @@ export default class AppAlertGroup extends Vue {
<style lang="less"> <style lang="less">
.view-body-messages { .view-body-messages {
margin-top: -10px;
margin-bottom: 6px; margin-bottom: 6px;
} }
</style> </style>
\ No newline at end of file
.app-color-picker {
.el-color-picker__trigger {
border: none;
left: 6px;
.el-color-picker__color {
border: 0.5px solid #dcdee2;
cursor: pointer;
top: 20px;
width: 77%;
height: 5px;
left: 3px;
.el-icon-close {
display: none;
}
}
}
.ivu-icon {
font-size: 22px;
position: absolute;
top: 2px;
right: -1px;
cursor: pointer;
}
}
\ No newline at end of file
<template>
<div class="app-color-picker">
<el-input
v-model="curVal"
size="small"
ref="colorPicker"
:disabled="disabled"
:placeholder="placeholder"
>
<template slot="suffix">
<el-color-picker ref="picker" v-model="colorValue" @change="colorChange" size="small">
</el-color-picker>
<Icon type="md-color-palette" @click="iconClick" />
</template>
</el-input>
</div>
</template>
<script lang="ts">
import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator';
import CodeListService from '@codelist/codelist-service';
import { Subject, Subscription } from 'rxjs';
@Component({})
export default class AppColorPicker extends Vue {
/**
* 双向绑定表单项数据
*
* @type {*}
* @memberof AppColorPicker
*/
@Model('change') public value: any;
/**
* 表单数据
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop() public data: any;
/**
* 表单通讯对象
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop() public formState?: Subject<any>;
/**
* 禁用状态
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop({default: false}) public disabled?: boolean;
/**
* 占位提示
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop() public placeholder?: string;
/**
* 上下文
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop() public viewparam: any;
/**
* 颜色对应字段值
*
* @type {*}
* @memberof AppColorPicker
*/
@Prop() public color: any;
/**
* 双向绑定颜色
*
* @type {*}
* @memberof AppColorPicker
*/
public colorValue: any = null;
/**
* 获取输入框值
*
* @type {*}
* @memberof AppColorPicker
*/
get curVal() {
return this.value;
}
/**
* 设置值
*
* @type {*}
* @memberof AppColorPicker
*/
set curVal(val: any) {
this.$emit('change', val);
}
/**
* Vue生命周期
*
* @memberof AppColorPicker
*/
public created() {
this.handleData();
}
/**
* 数据处理
*
* @memberof AppColorPicker
*/
@Watch('value')
public handleData() {
if(!this.value && !this.color) {
return;
}
this.colorValue = this.data[this.color];
this.curVal = this.value;
this.handleInputColor(this.colorValue);
}
/**
* 数据处理
*
* @memberof AppColorPicker
*/
public colorChange(color: any) {
this.handleInputColor(color);
this.$emit('colorChange', { name: this.color, value: color });
}
/**
* 设置输入框字体颜色
*
* @memberof AppColorPicker
*/
public handleInputColor(color: any) {
let picker: any = this.$refs.colorPicker;
if(picker) {
let child: any = picker.$el.children[0];
child.style.color = color;
}
}
/**
* 模拟点击事件
*
* @memberof AppColorPicker
*/
public iconClick() {
let picker: any = this.$refs.picker;
let e: any = document.createEvent('MouseEvent');
e.initEvent('click', true, true);
if(picker) {
picker.$el.children[0].dispatchEvent(e);
}
}
}
</script>
<style lang="less">
@import './app-color-picker.less';
</style>
<template>
<div class="app-color-span">
<span v-if="color" :style="{ color:textColor }">{{ text ? text : '---' }}</span>
<template v-else>
<template v-if="dataValue && dataValue.length > 0">
<span v-for="(textItem,index) of dataValue" :key="index" class="text-color" :style="{ backgroundColor:textItem.color }">
{{ textItem.srfmajortext ? textItem.srfmajortext : '---'}}
</span>
</template>
<span v-else>---</span>
</template>
</div>
</template>
<script lang="ts">
import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator';
import CodeListService from '@codelist/codelist-service';
import { Subject, Subscription } from 'rxjs';
@Component({
})
export default class AppColorSpan extends Vue {
/**
* 当前值
*
* @type {*}
* @memberof AppColorSpan
*/
@Prop() public value: any;
/**
* 当前表单项名称
*
* @type {*}
* @memberof AppColorSpan
*/
@Prop() public name?: any;
/**
* 代码表类型
*
* @type {string}
* @memberof AppColorSpan
*/
@Prop() public codelistType?: string;
/**
* 传入表单数据
*
* @type {*}
* @memberof AppColorSpan
*/
@Prop() public data?: any;
/**
* 局部上下文导航参数
*
* @type {any}
* @memberof AppColorSpan
*/
@Prop() public localContext!: any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppColorSpan
*/
@Prop() public localParam!: any;
/**
* 视图上下文
*
* @type {*}
* @memberof AppColorSpan
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppColorSpan
*/
@Prop() public viewparams!: any;
/**
* 颜色标识
*
* @type {*}
* @memberof AppColorSpan
*/
@Prop() color:any;
/**
* 颜色
*
* @type {*}
* @memberof AppColorSpan
*/
public textColor:any;
/**
* 显示值
* @type {*}
* @memberof AppColorSpan
*/
public text: any = '';
/**
* 数据数组
*
* @type {*}
* @memberof AppColorSpan
*/
public dataValue:Array<any> = [];
/**
* 监听value
*
* @memberof AppColorSpan
*/
@Watch('value')
public valueChange(newVal:any,oldVal:any){
if(newVal !== oldVal){
this.load();
}
}
/**
* 加载数据
*
* @memberof AppColorSpan
*/
public load(){
if(this.color){
this.text = this.value;
this.textColor = this.data[this.color];
}else{
this.dataValue = JSON.parse(this.value);
}
}
/**
* vue 生命周期
*
* @memberof AppColorSpan
*/
public created() {
this.load();
}
}
</script>
<style lang="less">
.text-color{
padding: 2px;
margin: 6px;
border-radius: 4px;
}
</style>
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
class="editor" class="editor"
:style="slotstyle" :style="slotstyle"
> >
<form-item :prop="name" :error="error" :required="required" :rules="rules"> <form-item :prop="name" :error="error" :rules="rules">
<slot></slot> <slot></slot>
</form-item> </form-item>
</div> </div>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
class="editor" class="editor"
:style="slotstyle" :style="slotstyle"
> >
<form-item :prop="name" :error="error" :required="required" :rules="rules"> <form-item :prop="name" :error="error" :rules="rules">
<slot></slot> <slot></slot>
</form-item> </form-item>
</div> </div>
......
input{ .app-inpu-ip{
border-radius: 4px; display: flex;
border:1px solid #888; flex-wrap: nowrap;
padding: 2px 10px; .el-input{
width: 20%; margin-right: 3px;
} margin-left: 3px;
}
}
\ No newline at end of file
<template> <template>
<div class="app-inpu-ip"> <div class="app-inpu-ip">
<input <el-input
type="text" type="text"
size="small"
v-model="firstIp" v-model="firstIp"
maxlength="3" />. maxlength="3" />.
<input <el-input
type="text" type="text"
size="small"
v-model="secIp" v-model="secIp"
maxlength="3" />. maxlength="3" />.
<input <el-input
type="text" type="text"
size="small"
maxlength="3" maxlength="3"
v-model="thirdIp" />. v-model="thirdIp" />.
<input <el-input
type="text" type="text"
size="small"
maxlength="3" maxlength="3"
v-model="forIp" /> v-model="forIp" />
</div> </div>
......
...@@ -115,7 +115,7 @@ export default class AppMapPosition extends Vue { ...@@ -115,7 +115,7 @@ export default class AppMapPosition extends Vue {
* @type {*} * @type {*}
* @memberof AppMapPosition * @memberof AppMapPosition
*/ */
@Prop() public formState!: Subject<any>;; @Prop() public formState!: Subject<any>;
/** /**
* 搜索框显示值 * 搜索框显示值
...@@ -234,7 +234,7 @@ export default class AppMapPosition extends Vue { ...@@ -234,7 +234,7 @@ export default class AppMapPosition extends Vue {
* @memberof AppMapPosition * @memberof AppMapPosition
*/ */
public initMap() { public initMap() {
if(!this.mode || !this.value) { if(!this.mode) {
return; return;
} }
if(Object.is(this.mode, 'address')) { if(Object.is(this.mode, 'address')) {
...@@ -252,7 +252,7 @@ export default class AppMapPosition extends Vue { ...@@ -252,7 +252,7 @@ export default class AppMapPosition extends Vue {
* @memberof AppMapPosition * @memberof AppMapPosition
*/ */
public initByAddress() { public initByAddress() {
if(this.longitude && this.latitude && this.data) { if(this.longitude && this.latitude && this.data && this.value) {
const position = [this.data[this.longitude], this.data[this.latitude]]; const position = [this.data[this.longitude], this.data[this.latitude]];
Object.assign(this.marker, { Object.assign(this.marker, {
position: position, position: position,
...@@ -278,7 +278,7 @@ export default class AppMapPosition extends Vue { ...@@ -278,7 +278,7 @@ export default class AppMapPosition extends Vue {
* @memberof AppMapPosition * @memberof AppMapPosition
*/ */
public initByLng() { public initByLng() {
if(this.latitude && this.data) { if(this.latitude && this.data && this.value) {
this.handleMarker(this.value, this.data[this.latitude], this); this.handleMarker(this.value, this.data[this.latitude], this);
} else { } else {
Object.assign(this.marker, { Object.assign(this.marker, {
...@@ -296,7 +296,7 @@ export default class AppMapPosition extends Vue { ...@@ -296,7 +296,7 @@ export default class AppMapPosition extends Vue {
* @memberof AppMapPosition * @memberof AppMapPosition
*/ */
public initByLat() { public initByLat() {
if(this.longitude && this.data) { if(this.longitude && this.data && this.value) {
this.handleMarker(this.data[this.longitude], this.value, this); this.handleMarker(this.data[this.longitude], this.value, this);
} else { } else {
Object.assign(this.marker, { Object.assign(this.marker, {
...@@ -333,6 +333,9 @@ export default class AppMapPosition extends Vue { ...@@ -333,6 +333,9 @@ export default class AppMapPosition extends Vue {
public handleMapShow() { public handleMapShow() {
this.resultShow = false; this.resultShow = false;
this.dialogShow = true; this.dialogShow = true;
if(!this.markerResult || JSON.stringify(this.markerResult) == "{}") {
return;
}
this.searchAddress = this.markerResult.address; this.searchAddress = this.markerResult.address;
Object.assign(this.marker, this.markerResult); Object.assign(this.marker, this.markerResult);
this.center = this.markerResult.position; this.center = this.markerResult.position;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
padding: 0 6px; padding: 0 6px;
.editor{ .editor{
flex-grow: 1; flex-grow: 1;
line-height: 34px;
.editorstyle{ .editorstyle{
.ivu-input.ivu-input-default{ .ivu-input.ivu-input-default{
border-color: red; border-color: red;
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
} }
.app-panel-field-label { .app-panel-field-label {
height: 34px !important; height: 34px !important;
line-height: 25px; line-height: 22px;
flex-shrink: 0; flex-shrink: 0;
padding: 6px 10px 6px 0px; padding: 6px 10px 6px 0px;
} }
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<div class='app-picker'> <div class='app-picker'>
<el-autocomplete class='text-value' :value-key="deMajorField" :disabled="disabled" v-model="curvalue" size='small' <el-autocomplete class='text-value' :value-key="deMajorField" :disabled="disabled" v-model="curvalue" size='small'
:trigger-on-focus="true" :fetch-suggestions="(query, callback) => { this.onSearch(query, callback, true) }" @select="onACSelect" :trigger-on-focus="true" :fetch-suggestions="(query, callback) => { this.onSearch(query, callback, true) }" @select="onACSelect"
@input="onInput" @blur="onBlur" style='width:100%;'> @input="onInput" @blur="onBlur" style='width:100%;'
:placeholder="placeholder">
<template v-slot:default="{item}"> <template v-slot:default="{item}">
<!-- <template v-if="item.isNew"> <!-- <template v-if="item.isNew">
<div v-if="linkview" @click="newAndEdit">{{$t('components.appPicker.newAndEdit')}}</div> <div v-if="linkview" @click="newAndEdit">{{$t('components.appPicker.newAndEdit')}}</div>
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
</div> </div>
<div v-else-if="Object.is(editortype, 'pickup-no-ac')" class='app-picker'> <div v-else-if="Object.is(editortype, 'pickup-no-ac')" class='app-picker'>
<div class='app-picker'> <div class='app-picker'>
<el-input class='text-value' :value="curvalue" readonly size='small' :disabled="disabled"> <el-input class='text-value' :placeholder="placeholder" :value="curvalue" readonly size='small' :disabled="disabled">
<template slot='suffix'> <template slot='suffix'>
<i v-if="curvalue && !disabled" class='el-icon-circle-close' @click="onClear"></i> <i v-if="curvalue && !disabled" class='el-icon-circle-close' @click="onClear"></i>
<i class='el-icon-search' @click="openView"></i> <i class='el-icon-search' @click="openView"></i>
...@@ -38,7 +39,8 @@ ...@@ -38,7 +39,8 @@
<div v-else-if="Object.is(editortype, 'dropdown')" class='app-picker'> <div v-else-if="Object.is(editortype, 'dropdown')" class='app-picker'>
<el-select ref="appPicker" remote :remote-method="(query) => this.onSearch(query, null, true)" :value="refvalue" size='small' filterable <el-select ref="appPicker" remote :remote-method="(query) => this.onSearch(query, null, true)" :value="refvalue" size='small' filterable
@change="onSelect" :disabled="disabled" style='width:100%;' clearable popper-class="app-picker-dropdown" @change="onSelect" :disabled="disabled" style='width:100%;' clearable popper-class="app-picker-dropdown"
@clear="onClear" @visible-change="onSelectOpen"> @clear="onClear" @visible-change="onSelectOpen"
:placeholder="placeholder">
<template v-if="items"> <template v-if="items">
<template v-for="_item in items"> <template v-for="_item in items">
<el-option v-if="!_item.tag" :key="_item[deKeyField]" :value="_item[deKeyField]" :label="_item[deMajorField]" :disabled="_item.disabled"></el-option> <el-option v-if="!_item.tag" :key="_item[deKeyField]" :value="_item[deKeyField]" :label="_item[deMajorField]" :disabled="_item.disabled"></el-option>
...@@ -222,6 +224,14 @@ export default class AppPicker extends Vue { ...@@ -222,6 +224,14 @@ export default class AppPicker extends Vue {
*/ */
@Model('change') public value?: any; @Model('change') public value?: any;
/**
* 占位提示
*
* @type {*}
* @memberof AppPicker
*/
@Prop() public placeholder?: string;
/** /**
* 当前值 * 当前值
* *
...@@ -258,7 +268,7 @@ export default class AppPicker extends Vue { ...@@ -258,7 +268,7 @@ export default class AppPicker extends Vue {
* @type {string} * @type {string}
* @memberof AppPicker * @memberof AppPicker
*/ */
public selectValue = this.value; public selectValue = null;
/** /**
* 下拉列表节点元素 * 下拉列表节点元素
...@@ -291,6 +301,7 @@ export default class AppPicker extends Vue { ...@@ -291,6 +301,7 @@ export default class AppPicker extends Vue {
@Watch('value',{immediate:true}) @Watch('value',{immediate:true})
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal; this.curvalue = newVal;
this.selectValue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) { if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
const value = this.data[this.valueitem]; const value = this.data[this.valueitem];
const index = this.items.findIndex((item: any) => Object.is(item.value, value)); const index = this.items.findIndex((item: any) => Object.is(item.value, value));
...@@ -421,7 +432,6 @@ export default class AppPicker extends Vue { ...@@ -421,7 +432,6 @@ export default class AppPicker extends Vue {
* @param item * @param item
*/ */
public onACSelect(item: any): void { public onACSelect(item: any): void {
this.selectValue = item[this.deMajorField];
if (this.valueitem) { if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: item[this.deKeyField] }); this.$emit('formitemvaluechange', { name: this.valueitem, value: item[this.deKeyField] });
} }
......
...@@ -144,7 +144,7 @@ export default class AppQuickGroup extends Vue { ...@@ -144,7 +144,7 @@ export default class AppQuickGroup extends Vue {
* @memberof AppQuickGroup * @memberof AppQuickGroup
*/ */
public handleClick($event:any,isswitch:boolean = true){ public handleClick($event:any,isswitch:boolean = true){
if(this.selectedUiItem && (this.selectedUiItem.id === $event.id)){ if((this.selectedUiItem && (this.selectedUiItem.id === $event.id)) || $event.children) {
return; return;
} }
this.$emit('valuechange',$event); this.$emit('valuechange',$event);
......
...@@ -63,6 +63,22 @@ ...@@ -63,6 +63,22 @@
} }
} }
} }
.slide-in(@x-begin,@x-end,@c-begin,@c-end,@name){
@keyframes @name{
from {
transform: translateX(@x-begin);
background-color: @c-begin;
}
to {
transform: translateX(@x-end);
background-color: @c-end;
}
}
}
.slide-in(1670px,0px,#fff,#EEF2F5,fadein);
.animation(@animation-name,@animation-duration,@animation-timing-function,@animation-delay,@play-state){
animation: @arguments;
};
.open-bar { .open-bar {
background-color: #EEF2F5; .animation(fadein,0.7s,linear,0s,forwards);
} };
\ No newline at end of file \ No newline at end of file
<template> <template>
<div :class="['app-sort-bar', isSort ? 'open-bar' : '']"> <div :class="['app-sort-bar', isSort ? 'open-bar' : '',]">
<row v-if="sortModel && sortModel.length>0" class="page-sort-bar" :gutter="10" type="flex" justify="start" style="margin:0px;"> <row v-if="sortModel && sortModel.length>0" class="page-sort-bar" :gutter="10" type="flex" justify="start" style="margin:0px;">
<template v-for="(item, index) in sortModel"> <template v-for="(item, index) in sortModel">
<i-col v-show="isSort" :key="index" :class="getSortClass(item)"> <i-col v-show="isSort" :key="index" :class="getSortClass(item)">
<div @click="sortItemClick(item)"> <div >
<div @click="sortItemClick(item)">
<span class="sort-field-text" >{{$t('entities.'+ entityName +'.fields.' + item)}}</span> <span class="sort-field-text" >{{$t('entities.'+ entityName +'.fields.' + item)}}</span>
<span class="caret-wrapper"> <span class="caret-wrapper">
<Icon type="md-arrow-dropup" /> <Icon type="md-arrow-dropup" />
<Icon type="md-arrow-dropdown" /> <Icon type="md-arrow-dropdown" />
</span> </span>
</div> </div>
</div>
</i-col> </i-col>
</template> </template>
<div class="issort" @click="handleSort"> <div class="issort" @click="handleSort">
...@@ -48,7 +51,6 @@ export default class AppSortBar extends Vue { ...@@ -48,7 +51,6 @@ export default class AppSortBar extends Vue {
} }
public sortItemClick(name: string) { public sortItemClick(name: string) {
console.log(name);
this.$emit('clickSort', name); this.$emit('clickSort', name);
} }
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<script lang="ts"> <script lang="ts">
import {Vue, Component, Watch} from 'vue-property-decorator'; import {Vue, Component, Watch} from 'vue-property-decorator';
import {Environment} from '@/environments/environment'; import {Environment} from '@/environments/environment';
//import Divider from "ibiz-vue-lib/lib/ibiz-vue-lib.common"; import { Util } from '@/utils';
@Component({ @Component({
components: {} components: {}
...@@ -141,7 +141,7 @@ export default class Login extends Vue { ...@@ -141,7 +141,7 @@ export default class Login extends Vue {
} }
public mounted() { public mounted() {
this.getCookie("loginname"); Util.getCookie("loginname");
} }
/** /**
...@@ -181,13 +181,13 @@ export default class Login extends Vue { ...@@ -181,13 +181,13 @@ export default class Login extends Vue {
const data = response.data; const data = response.data;
if (data && data.token) { if (data && data.token) {
localStorage.setItem('token', data.token); localStorage.setItem('token', data.token);
this.setCookie('ibzuaa-token',data.token,0); Util.setCookie('ibzuaa-token',data.token,0);
} }
if(data && data.user){ if(data && data.user){
localStorage.setItem('user', JSON.stringify(data.user)); localStorage.setItem('user', JSON.stringify(data.user));
} }
// 设置cookie,保存账号密码7天 // 设置cookie,保存账号密码7天
this.setCookie("loginname",loginname, 7); Util.setCookie("loginname",loginname, 7);
// 跳转首页 // 跳转首页
const url: any = this.$route.query.redirect ? this.$route.query.redirect : '*'; const url: any = this.$route.query.redirect ? this.$route.query.redirect : '*';
this.$router.push({path: url}); this.$router.push({path: url});
...@@ -223,40 +223,6 @@ export default class Login extends Vue { ...@@ -223,40 +223,6 @@ export default class Login extends Vue {
_this.form={loginname: 'ibzadmin', password: '123456'} _this.form={loginname: 'ibzadmin', password: '123456'}
} }
/**
* 设置cookie
*
* @memberof Login
*/
public setCookie(name: any, value: any, day: any) {
if (day !== 0) { //当设置的时间等于0时,不设置expires属性,cookie在浏览器关闭后删除
let curDate = new Date();
let curTamp = curDate.getTime();
let curWeeHours = new Date(curDate.toLocaleDateString()).getTime() - 1;
let passedTamp = curTamp - curWeeHours;
let leftTamp = 24 * 60 * 60 * 1000 - passedTamp;
let leftTime = new Date();
leftTime.setTime(leftTamp + curTamp);
document.cookie = name + "=" + escape(value) + ";expires=" + leftTime.toUTCString();
} else {
document.cookie = name + "=" + escape(value);
}
}
/**
* 获取cookie
*
* @memberof Login
*/
public getCookie(name: any): any {
let arr;
let reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
/** /**
* qq授权登录 * qq授权登录
* @param thirdpart * @param thirdpart
......
import { Http } from '@/utils';
import { Subscription } from 'rxjs';
/**
* 按钮loadding状态服务
*
* @export
* @class LoaddingService
*/
export class LoaddingService {
/**
* 单例变量声明
*
* @private
* @static
* @type {LoaddingService}
* @memberof LoaddingService
*/
private static loaddingService: LoaddingService;
/**
* loadding状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof LoaddingService
*/
public loaddingStateEvent: Subscription | undefined;
/**
* 获取 LoaddingService 单例对象
*
* @static
* @returns {LoaddingService}
* @memberof LoaddingService
*/
public static getInstance(): LoaddingService {
if (!LoaddingService.loaddingService) {
LoaddingService.loaddingService = new LoaddingService();
}
return this.loaddingService;
}
/**
* 初始化指令所绑定的元素状态
*
* @param {any} el 指令所绑定的元素
* @param {any} binding 指令附加参数
* @memberof LoaddingService
*/
public initElement(el:any, binding:any){
if(binding && binding.arg){
// 工具栏按钮
if(Object.is(binding.arg,'i-button')){
if(el.getElementsByTagName('i') && el.getElementsByTagName('i').length >0){
let iconElement:any = el.getElementsByTagName('i')[0];
iconElement.setAttribute('ownclassname',iconElement.className);
}
}
}
}
/**
* 设置loadding状态
*
* @param {any} el 指令所绑定的元素
* @param {any} binding 指令附加参数
* @memberof LoaddingService
*/
public setLoadState(el:any, binding:any){
this.loaddingStateEvent = Http.getInstance().getNotifyObject().subscribe((result:any) =>{
if(result && result.action && Object.is(result.action,'setloadstate')){
if(result && result.state){
this.addLoadState(el,binding);
}else{
this.removeLoadState(el,binding);
}
}
})
}
/**
* 添加loadding状态
*
* @param {any} el 指令所绑定的元素
* @param {any} binding 指令附加参数
* @memberof LoaddingService
*/
public addLoadState(el:any, binding:any){
if(binding && binding.arg){
el.style.pointerEvents = 'none';
// 工具栏按钮
if(Object.is(binding.arg,'i-button')){
if(el.getElementsByTagName('i') && el.getElementsByTagName('i').length >0){
let iconElement:any = el.getElementsByTagName('i')[0];
iconElement.className = "el-icon-loading";
}
}
}
}
/**
* 移除loadding状态
*
* @param {any} el 指令所绑定的元素
* @param {any} binding 指令附加参数
* @memberof LoaddingService
*/
public removeLoadState(el:any, binding:any){
if(binding && binding.arg){
el.style.pointerEvents = '';
// 工具栏按钮
if(Object.is(binding.arg,'i-button')){
if(el.getElementsByTagName('i') && el.getElementsByTagName('i').length >0){
let iconElement:any = el.getElementsByTagName('i')[0];
iconElement.className = iconElement.getAttribute('ownclassname');
}
}
}
}
/**
* 清除资源(取消订阅)
*
* @param {any} el 指令所绑定的元素
* @param {any} binding 指令附加参数
* @memberof LoaddingService
*/
public clearResource(el:any, binding:any){
if(this.loaddingStateEvent){
this.loaddingStateEvent.unsubscribe();
}
}
}
export default {
bind(el:any, binding:any) {
LoaddingService.getInstance().initElement(el, binding);
},
inserted(el:any, binding:any) {
LoaddingService.getInstance().setLoadState(el, binding);
},
unbind(el:any, binding:any) {
LoaddingService.getInstance().clearResource(el,binding);
}
}
\ No newline at end of file
...@@ -89,10 +89,9 @@ export default class EditView3Engine extends EditViewEngine { ...@@ -89,10 +89,9 @@ export default class EditView3Engine extends EditViewEngine {
*/ */
public onFormLoad(arg: any = {}): void { public onFormLoad(arg: any = {}): void {
super.onFormLoad(arg); super.onFormLoad(arg);
this.view.formData = arg;
if (this.getDrTab()) { if (this.getDrTab()) {
const tag = this.getDrTab().name; const tag = this.getDrTab().name;
this.setViewState2({ tag: tag, action: 'state', viewdata: this.view.viewparams }); this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
} }
} }
...@@ -104,10 +103,9 @@ export default class EditView3Engine extends EditViewEngine { ...@@ -104,10 +103,9 @@ export default class EditView3Engine extends EditViewEngine {
*/ */
public onFormSave(arg: any = {}): void { public onFormSave(arg: any = {}): void {
super.onFormSave(arg); super.onFormSave(arg);
this.view.formData = arg;
if (this.getDrTab()) { if (this.getDrTab()) {
const tag = this.getDrTab().name; const tag = this.getDrTab().name;
this.setViewState2({ tag: tag, action: 'state', viewdata: this.view.viewparams }); this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
} }
} }
......
...@@ -91,7 +91,7 @@ export default class EditView4Engine extends EditViewEngine { ...@@ -91,7 +91,7 @@ export default class EditView4Engine extends EditViewEngine {
super.onFormLoad(arg); super.onFormLoad(arg);
if (this.getDrTab()) { if (this.getDrTab()) {
const tag = this.getDrTab().name; const tag = this.getDrTab().name;
this.setViewState2({ tag: tag, action: 'state', viewdata: this.view.viewparams }); this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
} }
} }
...@@ -105,7 +105,7 @@ export default class EditView4Engine extends EditViewEngine { ...@@ -105,7 +105,7 @@ export default class EditView4Engine extends EditViewEngine {
super.onFormSave(arg); super.onFormSave(arg);
if (this.getDrTab()) { if (this.getDrTab()) {
const tag = this.getDrTab().name; const tag = this.getDrTab().name;
this.setViewState2({ tag: tag, action: 'state', viewdata: this.view.viewparams }); this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
} }
} }
......
...@@ -41,6 +41,9 @@ export default class TabExpViewEngine extends ViewEngine { ...@@ -41,6 +41,9 @@ export default class TabExpViewEngine extends ViewEngine {
if (!Object.is(_item.type, 'TABEXPPANEL')) { if (!Object.is(_item.type, 'TABEXPPANEL')) {
return; return;
} }
if(this.view.context && this.view.context[(this.keyPSDEField as string)]){
return;
}
this.setViewState2({ tag: _item.name, action: 'load', viewdata: this.view.context }); this.setViewState2({ tag: _item.name, action: 'load', viewdata: this.view.context });
}); });
} }
......
...@@ -7,21 +7,21 @@ ...@@ -7,21 +7,21 @@
<span class='caption-info'>{{$t(model.srfCaption)}}</span> <span class='caption-info'>{{$t(model.srfCaption)}}</span>
<div class='toolbar-container'> <div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)"> <i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-save'></i> <i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)"> <i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='sx-tb-saveandnew'></i> <i class='sx-tb-saveandnew'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)"> <i-button v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem5' }, $event)">
<i class='sx-tb-saveandclose'></i> <i class='sx-tb-saveandclose'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.caption')}}</span>
</i-button> </i-button>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</tooltip> </tooltip>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)"> <i-button v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem7' }, $event)">
<i class='fa fa-remove'></i> <i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.caption')}}</span>
</i-button> </i-button>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</tooltip> </tooltip>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)"> <i-button v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem12' }, $event)">
<i class='fa fa-file-text-o'></i> <i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.caption')}}</span>
</i-button> </i-button>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</tooltip> </tooltip>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)"> <i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem14' }, $event)">
<i class='fa fa-copy'></i> <i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.caption')}}</span>
</i-button> </i-button>
...@@ -53,28 +53,28 @@ ...@@ -53,28 +53,28 @@
</tooltip> </tooltip>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' @click="toolbar_click({ tag: 'tbitem23' }, $event)"> <i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem23' }, $event)">
<i class='fa fa-fast-backward'></i> <i class='fa fa-fast-backward'></i>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem23.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem23.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem24.visabled" :disabled="toolBarModels.tbitem24.disabled" class='' @click="toolbar_click({ tag: 'tbitem24' }, $event)"> <i-button v-show="toolBarModels.tbitem24.visabled" :disabled="toolBarModels.tbitem24.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem24' }, $event)">
<i class='fa fa-step-backward'></i> <i class='fa fa-step-backward'></i>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem24.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem24.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem25.visabled" :disabled="toolBarModels.tbitem25.disabled" class='' @click="toolbar_click({ tag: 'tbitem25' }, $event)"> <i-button v-show="toolBarModels.tbitem25.visabled" :disabled="toolBarModels.tbitem25.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem25' }, $event)">
<i class='fa fa-step-forward'></i> <i class='fa fa-step-forward'></i>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem25.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem25.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem26.visabled" :disabled="toolBarModels.tbitem26.disabled" class='' @click="toolbar_click({ tag: 'tbitem26' }, $event)"> <i-button v-show="toolBarModels.tbitem26.visabled" :disabled="toolBarModels.tbitem26.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem26' }, $event)">
<i class='fa fa-fast-forward'></i> <i class='fa fa-fast-forward'></i>
</i-button> </i-button>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
</tooltip> </tooltip>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem22.visabled" :disabled="toolBarModels.tbitem22.disabled" class='' @click="toolbar_click({ tag: 'tbitem22' }, $event)"> <i-button v-show="toolBarModels.tbitem22.visabled" :disabled="toolBarModels.tbitem22.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem22' }, $event)">
<i class='fa fa-question'></i> <i class='fa fa-question'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.caption')}}</span>
</i-button> </i-button>
......
...@@ -13,21 +13,21 @@ ...@@ -13,21 +13,21 @@
<div class='pull-right'> <div class='pull-right'>
<div class='toolbar-container'> <div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)"> <i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-file-text-o'></i> <i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem3.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem3.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)"> <i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='fa fa-edit'></i> <i class='fa fa-edit'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem4.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem4.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem6.visabled" :disabled="toolBarModels.tbitem6.disabled" class='' @click="toolbar_click({ tag: 'tbitem6' }, $event)"> <i-button v-show="toolBarModels.tbitem6.visabled" :disabled="toolBarModels.tbitem6.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem6' }, $event)">
<i class='fa fa-copy'></i> <i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem6.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem6.caption')}}</span>
</i-button> </i-button>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</tooltip> </tooltip>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' @click="toolbar_click({ tag: 'tbitem8' }, $event)"> <i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem8' }, $event)">
<i class='fa fa-remove'></i> <i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem8.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem8.caption')}}</span>
</i-button> </i-button>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<dropdown-menu slot='list'> <dropdown-menu slot='list'>
<dropdown-item> <dropdown-item>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem21.visabled" :disabled="toolBarModels.tbitem21.disabled" class='' @click="toolbar_click({ tag: 'tbitem21' }, $event)"> <i-button v-show="toolBarModels.tbitem21.visabled" :disabled="toolBarModels.tbitem21.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem21' }, $event)">
<i class='fa fa-download'></i> <i class='fa fa-download'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem21.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem21.caption')}}</span>
</i-button> </i-button>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</dropdown-item> </dropdown-item>
<dropdown-item> <dropdown-item>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' @click="toolbar_click({ tag: 'tbitem23' }, $event)"> <i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem23' }, $event)">
<i class='fa fa-upload'></i> <i class='fa fa-upload'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem23.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem23.caption')}}</span>
</i-button> </i-button>
...@@ -83,14 +83,14 @@ ...@@ -83,14 +83,14 @@
</dropdown> </dropdown>
<span class='seperator'>|</span> <span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem19.visabled" :disabled="toolBarModels.tbitem19.disabled" class='' @click="toolbar_click({ tag: 'tbitem19' }, $event)"> <i-button v-show="toolBarModels.tbitem19.visabled" :disabled="toolBarModels.tbitem19.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem19' }, $event)">
<i class='fa fa-filter'></i> <i class='fa fa-filter'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem19.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem19.caption')}}</span>
</i-button> </i-button>
<div slot='content'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem19.tip')}}</div> <div slot='content'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem19.tip')}}</div>
</tooltip> </tooltip>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem18.visabled" :disabled="toolBarModels.tbitem18.disabled" class='' @click="toolbar_click({ tag: 'tbitem18' }, $event)"> <i-button v-show="toolBarModels.tbitem18.visabled" :disabled="toolBarModels.tbitem18.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem18' }, $event)">
<i class='fa fa-question'></i> <i class='fa fa-question'></i>
<span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem18.caption')}}</span> <span class='caption'>{{$t('entities.sdfile.gridviewtoolbar_toolbar.tbitem18.caption')}}</span>
</i-button> </i-button>
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
} }
} }
.view-container.degridview, .view-container.degridview9, .view-container.dewfgridview, .view-container.delistview, .view-container.delistview9, .view-container.dedataview, .view-container.dedataview9,.view-container.dechartview,.view-container.dechartview9{ .view-container.degridview, .view-container.degridview9, .view-container.dewfgridview, .view-container.delistview, .view-container.delistview9, .view-container.dedataview, .view-container.dedataview9,.view-container.dechartview,.view-container.dechartview9,.view-container.decalendarview,.view-container.decalendarview9{
>.view-card.view-no-caption{ >.view-card.view-no-caption{
>.ivu-card-body{ >.ivu-card-body{
height: 100%; height: 100%;
......
...@@ -2,6 +2,8 @@ import axios from 'axios'; ...@@ -2,6 +2,8 @@ import axios from 'axios';
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
import { ElLoadingComponent } from 'element-ui/types/loading'; import { ElLoadingComponent } from 'element-ui/types/loading';
import qs from 'qs'; import qs from 'qs';
import { Subject } from 'rxjs';
/** /**
* Http net 对象 * Http net 对象
* 调用 getInstance() 获取实例 * 调用 getInstance() 获取实例
...@@ -10,20 +12,6 @@ import qs from 'qs'; ...@@ -10,20 +12,6 @@ import qs from 'qs';
*/ */
export class Http { export class Http {
/**
* 获取 Http 单例对象
*
* @static
* @returns {Http}
* @memberof Http
*/
public static getInstance(): Http {
if (!Http.Http) {
Http.Http = new Http();
}
return this.Http;
}
/** /**
* 单例变量声明 * 单例变量声明
* *
...@@ -42,6 +30,28 @@ export class Http { ...@@ -42,6 +30,28 @@ export class Http {
*/ */
private loadingCount: number = 0; private loadingCount: number = 0;
/**
* 数据传递对象
*
* @type {Subject}
* @memberof Http
*/
private subject:Subject<any> = new Subject<any>();
/**
* 获取 Http 单例对象
*
* @static
* @returns {Http}
* @memberof Http
*/
public static getInstance(): Http {
if (!Http.Http) {
Http.Http = new Http();
}
return this.Http;
}
/** /**
* load状态管理器 * load状态管理器
* *
...@@ -227,6 +237,7 @@ export class Http { ...@@ -227,6 +237,7 @@ export class Http {
body: true, body: true,
fullscreen: true, fullscreen: true,
}); });
this.notifyLoadState(true);
} }
this.loadingCount++; this.loadingCount++;
} }
...@@ -244,6 +255,7 @@ export class Http { ...@@ -244,6 +255,7 @@ export class Http {
setTimeout(() => { setTimeout(() => {
if (this.loadingCount === 0) { if (this.loadingCount === 0) {
this.elLoadingComponent.close(); this.elLoadingComponent.close();
this.notifyLoadState(false);
} }
}, 500); }, 500);
} }
...@@ -265,4 +277,24 @@ export class Http { ...@@ -265,4 +277,24 @@ export class Http {
return data; return data;
} }
/**
* 获取通知对象
*
* @public
* @memberof Http
*/
public getNotifyObject(){
return this.subject;
}
/**
* 通知loadding状态
*
* @private
* @memberof Http
*/
private notifyLoadState(loadingState:boolean){
this.subject.next({action:'setloadstate',state:loadingState});
}
} }
\ No newline at end of file
...@@ -3,6 +3,9 @@ import axios from 'axios'; ...@@ -3,6 +3,9 @@ import axios from 'axios';
import Router from 'vue-router'; import Router from 'vue-router';
import i18n from '@/locale'; import i18n from '@/locale';
import { Environment } from '@/environments/environment'; import { Environment } from '@/environments/environment';
import { Http } from '../http/http';
import { Util } from '../util/util';
/** /**
* 拦截器 * 拦截器
* *
...@@ -104,6 +107,9 @@ export class Interceptors { ...@@ -104,6 +107,9 @@ export class Interceptors {
}); });
axios.interceptors.response.use((response: any) => { axios.interceptors.response.use((response: any) => {
if(response.headers && response.headers['refreshtoken'] && localStorage.getItem('token')){
this.refreshToken(response);
}
return response; return response;
}, (error: any) => { }, (error: any) => {
error = error ? error : { response: {} }; error = error ? error : { response: {} };
...@@ -174,4 +180,30 @@ export class Interceptors { ...@@ -174,4 +180,30 @@ export class Interceptors {
} }
} }
/**
* 刷新token
*
* @private
* @param {*} [data={}]
* @memberof Interceptors
*/
private refreshToken(data:any = {}):void{
if(data && data.config && (data.config.url == "/uaa/refreshToken")){
return;
}
Http.getInstance().post('/uaa/refreshToken',localStorage.getItem('token'),false).then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
if (data ) {
localStorage.setItem('token', data);
Util.setCookie('ibzuaa-token',data,0);
}
}else{
console.log("刷新token出错");
}
}).catch((error: any) => {
console.log("刷新token出错");
});
}
} }
\ No newline at end of file
...@@ -153,7 +153,7 @@ export declare interface Util { ...@@ -153,7 +153,7 @@ export declare interface Util {
* @returns {string} * @returns {string}
* @memberof Util * @memberof Util
*/ */
dateFormat(date: any,fmt?: string):string dateFormat(date: any,fmt?: string):string;
/** /**
* 表单项校验 * 表单项校验
...@@ -164,7 +164,21 @@ export declare interface Util { ...@@ -164,7 +164,21 @@ export declare interface Util {
* @returns {Promise} * @returns {Promise}
* @memberof Util * @memberof Util
*/ */
validateItem(property: string, data:any, rules:any): Promise<any> validateItem(property: string, data:any, rules:any): Promise<any>;
/**
* 设置cookie
*
* @memberof Util
*/
setCookie(name: any, value: any, day: any):void;
/**
* 获取cookie
*
* @memberof Util
*/
getCookie(name: any): any;
} }
declare module "vue/types/vue" { declare module "vue/types/vue" {
......
...@@ -258,7 +258,8 @@ export class Util { ...@@ -258,7 +258,8 @@ export class Util {
*/ */
public static srfFilePath2(name: string): string { public static srfFilePath2(name: string): string {
if (!name || (name && Object.is(name, ''))) { if (!name || (name && Object.is(name, ''))) {
throw new Error('名称异常'); console.error("名称异常")
return '';
} }
name = name.replace(/[_]/g, '-'); name = name.replace(/[_]/g, '-');
let state: number = 0; let state: number = 0;
...@@ -427,4 +428,39 @@ export class Util { ...@@ -427,4 +428,39 @@ export class Util {
// 校验返回Promise // 校验返回Promise
return schema.validate({ [property]: value }) return schema.validate({ [property]: value })
} }
/**
* 设置cookie
*
* @memberof Util
*/
public static setCookie(name: any, value: any, day: any) {
if (day !== 0) { //当设置的时间等于0时,不设置expires属性,cookie在浏览器关闭后删除
let curDate = new Date();
let curTamp = curDate.getTime();
let curWeeHours = new Date(curDate.toLocaleDateString()).getTime() - 1;
let passedTamp = curTamp - curWeeHours;
let leftTamp = 24 * 60 * 60 * 1000 - passedTamp;
let leftTime = new Date();
leftTime.setTime(leftTamp + curTamp);
document.cookie = name + "=" + escape(value) + ";expires=" + leftTime.toUTCString();
} else {
document.cookie = name + "=" + escape(value);
}
}
/**
* 获取cookie
*
* @memberof Util
*/
public static getCookie(name: any): any {
let arr;
let reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
} }
\ No newline at end of file
...@@ -154,7 +154,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -154,7 +154,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof SDIndexViewBase * @memberof SDIndexViewBase
*/ */
@Prop() public context: any; @Prop() public context!: any;
/** /**
* 视图参数 * 视图参数
...@@ -162,7 +162,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -162,7 +162,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof SDIndexViewBase * @memberof SDIndexViewBase
*/ */
@Prop() public viewparams: any; @Prop() public viewparams!: any;
/** /**
* 视图状态事件 * 视图状态事件
......
...@@ -74,7 +74,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -74,7 +74,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof DefaultBase * @memberof DefaultBase
*/ */
@Prop() public context: any; @Prop() public context!: any;
/** /**
* 视图参数 * 视图参数
...@@ -82,7 +82,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -82,7 +82,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof DefaultBase * @memberof DefaultBase
*/ */
@Prop() public viewparams: any; @Prop() public viewparams!: any;
/** /**
* 视图状态事件 * 视图状态事件
......
...@@ -228,7 +228,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -228,7 +228,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public context: any; @Prop() public context!: any;
/** /**
* 视图参数 * 视图参数
...@@ -236,7 +236,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -236,7 +236,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public viewparams: any; @Prop() public viewparams!: any;
/** /**
* 视图状态事件 * 视图状态事件
......
...@@ -227,7 +227,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -227,7 +227,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public context: any; @Prop() public context!: any;
/** /**
* 视图参数 * 视图参数
...@@ -235,7 +235,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -235,7 +235,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {*} * @type {*}
* @memberof MainBase * @memberof MainBase
*/ */
@Prop() public viewparams: any; @Prop() public viewparams!: any;
/** /**
* 视图状态事件 * 视图状态事件
...@@ -2137,9 +2137,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2137,9 +2137,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data; const data = response.data;
this.createDefault(data); this.createDefault(data);
data.rowDataState = "create"; data.rowDataState = "create";
let tempItems: any[] = []; this.items.splice(0,0,data);
tempItems.push(data);
_this.items = tempItems.concat(_this.items);
_this.gridItemsModel.push(_this.getGridRowModel()); _this.gridItemsModel.push(_this.getGridRowModel());
}).catch((response: any) => { }).catch((response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
...@@ -2189,6 +2187,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2189,6 +2187,7 @@ export default class MainBase extends Vue implements ControlInterface {
} }
} }
this.curEditRowData = row; this.curEditRowData = row;
this.resetGridData(row, property, rowIndex);
this.validate(property,row,rowIndex); this.validate(property,row,rowIndex);
} }
...@@ -2490,6 +2489,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -2490,6 +2489,19 @@ export default class MainBase extends Vue implements ControlInterface {
} }
} }
/**
* 重置表格项值
*
* @param {*} row 当前行
* @param {string} property 属性名
* @param {number} rowIndex 行下标
* @memberof MainBase
*/
public resetGridData(row: any, property: string, rowIndex: number) {
if(this.actualIsOpenEdit) {
}
}
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册