提交 063aa777 编写于 作者: tony001's avatar tony001

Merge remote-tracking branch 'local/master' into dev

上级 d8ec1ded
...@@ -28,7 +28,6 @@ import AppCheckboxList from './components/app-checkbox-list/app-checkbox-list.vu ...@@ -28,7 +28,6 @@ import AppCheckboxList from './components/app-checkbox-list/app-checkbox-list.vu
import AppRadioGroup from './components/app-radio-group/app-radio-group.vue' import AppRadioGroup from './components/app-radio-group/app-radio-group.vue'
import AppEmbedPicker from './components/app-embed-picker/app-embed-picker.vue' import AppEmbedPicker from './components/app-embed-picker/app-embed-picker.vue'
import AppTreePicker from './components/app-tree-picker/app-tree-picker.vue' import AppTreePicker from './components/app-tree-picker/app-tree-picker.vue'
import AppRichTextEditor from './components/app-rich-text-editor/app-rich-text-editor.vue'
import AppFileUpload from './components/app-file-upload/app-file-upload.vue' import AppFileUpload from './components/app-file-upload/app-file-upload.vue'
import AppImageUpload from './components/app-image-upload/app-image-upload.vue' import AppImageUpload from './components/app-image-upload/app-image-upload.vue'
import PropertyLayout from './components/property-layout/property-layout.vue' import PropertyLayout from './components/property-layout/property-layout.vue'
...@@ -53,7 +52,6 @@ import AppRate from './components/app-rate/app-rate.vue' ...@@ -53,7 +52,6 @@ import AppRate from './components/app-rate/app-rate.vue'
import AppSwitch from './components/app-switch/app-switch.vue' import AppSwitch from './components/app-switch/app-switch.vue'
import AppSlider from './components/app-slider/app-slider.vue' import AppSlider from './components/app-slider/app-slider.vue'
import AppStepper from './components/app-stepper/app-stepper.vue' import AppStepper from './components/app-stepper/app-stepper.vue'
import AppPortalDesign from './components/app-portal-design/app-portal-design.vue'
import DatePickerRange from './components/date-picker-range/date-picker-range.vue' import DatePickerRange from './components/date-picker-range/date-picker-range.vue'
import AppRangeDate from './components/app-range-date/app-range-date.vue' import AppRangeDate from './components/app-range-date/app-range-date.vue'
import AppActionBar from './components/app-actionbar/app-actionbar.vue' import AppActionBar from './components/app-actionbar/app-actionbar.vue'
...@@ -63,7 +61,6 @@ import AppStudioAction from './components/app-studioaction/app-studioaction.vue' ...@@ -63,7 +61,6 @@ import AppStudioAction from './components/app-studioaction/app-studioaction.vue'
import AppDebugActions from './components/app-debug-actions/app-debug-actions.vue' import AppDebugActions from './components/app-debug-actions/app-debug-actions.vue'
import AppTopMenus from './components/app-top-menus/app-top-menus.vue' import AppTopMenus from './components/app-top-menus/app-top-menus.vue'
import AppColumnLink from './components/app-column-link/app-column-link.vue' import AppColumnLink from './components/app-column-link/app-column-link.vue'
import AppDataUploadView from './components/app-data-upload/app-data-upload.vue'
import DropDownListDynamic from './components/dropdown-list-dynamic/dropdown-list-dynamic.vue' import DropDownListDynamic from './components/dropdown-list-dynamic/dropdown-list-dynamic.vue'
import AppImagePreview from './components/app-image-preview/app-image-preview.vue' import AppImagePreview from './components/app-image-preview/app-image-preview.vue'
import AppFormatData from './components/app-format-data/app-format-data.vue' import AppFormatData from './components/app-format-data/app-format-data.vue'
...@@ -76,8 +73,9 @@ import AppDepartmentSelect from './components/app-department-select/app-departme ...@@ -76,8 +73,9 @@ import AppDepartmentSelect from './components/app-department-select/app-departme
import IBizGroupSelect from './components/ibiz-group-select/ibiz-group-select.vue' import IBizGroupSelect from './components/ibiz-group-select/ibiz-group-select.vue'
import IBizGroupPicker from './components/ibiz-group-picker/ibiz-group-picker.vue' import IBizGroupPicker from './components/ibiz-group-picker/ibiz-group-picker.vue'
import AppWFApproval from './components/app-wf-approval/app-wf-approval.vue' import AppWFApproval from './components/app-wf-approval/app-wf-approval.vue'
import Breadcrumb from './components/app-breadcrumb/app-breadcrumb.vue'; import Breadcrumb from './components/app-breadcrumb/app-breadcrumb.vue'
import AppTransfer from './components/app-transfer/app-transfer.vue' import AppTransfer from './components/app-transfer/app-transfer.vue'
import ContextMenuDrag from './components/context-menu-drag/context-menu-drag.vue'
// 全局挂载UI实体服务注册中心 // 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister; window['uiServiceRegister'] = uiServiceRegister;
...@@ -115,7 +113,7 @@ export const AppComponents = { ...@@ -115,7 +113,7 @@ export const AppComponents = {
v.component('app-radio-group',AppRadioGroup); v.component('app-radio-group',AppRadioGroup);
v.component('app-embed-picker', AppEmbedPicker); v.component('app-embed-picker', AppEmbedPicker);
v.component('app-tree-picker', AppTreePicker); v.component('app-tree-picker', AppTreePicker);
v.component('app-rich-text-editor',AppRichTextEditor); v.component('app-rich-text-editor', () => import('./components/app-rich-text-editor/app-rich-text-editor.vue'));
v.component('app-file-upload',AppFileUpload); v.component('app-file-upload',AppFileUpload);
v.component('app-image-upload',AppImageUpload); v.component('app-image-upload',AppImageUpload);
v.component('property-layout',PropertyLayout); v.component('property-layout',PropertyLayout);
...@@ -140,7 +138,7 @@ export const AppComponents = { ...@@ -140,7 +138,7 @@ export const AppComponents = {
v.component('app-switch', AppSwitch); v.component('app-switch', AppSwitch);
v.component('app-slider', AppSlider); v.component('app-slider', AppSlider);
v.component('app-stepper', AppStepper); v.component('app-stepper', AppStepper);
v.component('app-portal-design',AppPortalDesign); v.component('app-portal-design', () => import('./components/app-portal-design/app-portal-design.vue'));
v.component('date-picker-range',DatePickerRange); v.component('date-picker-range',DatePickerRange);
v.component('app-range-date', AppRangeDate); v.component('app-range-date', AppRangeDate);
v.component('app-actionbar', AppActionBar); v.component('app-actionbar', AppActionBar);
...@@ -150,7 +148,7 @@ export const AppComponents = { ...@@ -150,7 +148,7 @@ export const AppComponents = {
v.component('app-debug-actions', AppDebugActions); v.component('app-debug-actions', AppDebugActions);
v.component('app-top-menus', AppTopMenus); v.component('app-top-menus', AppTopMenus);
v.component('app-column-link', AppColumnLink); v.component('app-column-link', AppColumnLink);
v.component('app-data-upload', AppDataUploadView); v.component('app-data-upload', () => import('./components/app-data-upload/app-data-upload.vue'));
v.component('dropdown-list-dynamic', DropDownListDynamic); v.component('dropdown-list-dynamic', DropDownListDynamic);
v.component('app-image-preview', AppImagePreview); v.component('app-image-preview', AppImagePreview);
v.component('app-format-data', AppFormatData); v.component('app-format-data', AppFormatData);
...@@ -165,5 +163,6 @@ export const AppComponents = { ...@@ -165,5 +163,6 @@ export const AppComponents = {
v.component('app-wf-approval',AppWFApproval); v.component('app-wf-approval',AppWFApproval);
v.component('app-breadcrumb',Breadcrumb); v.component('app-breadcrumb',Breadcrumb);
v.component('app-transfer',AppTransfer); v.component('app-transfer',AppTransfer);
v.component('context-menu-drag',ContextMenuDrag);
}, },
}; };
\ No newline at end of file
...@@ -13,5 +13,12 @@ ...@@ -13,5 +13,12 @@
.no-redirect { .no-redirect {
color: #97a8be; color: #97a8be;
cursor: text; cursor: text;
.curselected{
color: #2196F3;
font-weight: bold;
}
.app-breadcrumb-selected{
cursor: pointer;
}
} }
} }
\ No newline at end of file
<template> <template>
<el-breadcrumb <el-breadcrumb class="app-breadcrumb" separator="/">
class="app-breadcrumb"
separator="/"
>
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item <template v-if="Object.is(this.navModel,'route')">
v-for="(item, index) in breadcrumbs" <el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.id">
:key="item.path" <span v-if="index === breadcrumbs.length-1" class="no-redirect">{{ item.title }}
> <span v-if="item.isselected === true">
<span <dropdown trigger='click' @on-click="selectNavData($event,item)">
v-if="index === breadcrumbs.length-1" <span class="app-breadcrumb-selected">
class="no-redirect" <i class="el-icon-caret-bottom"></i>
>{{ $t(item.meta.caption) }}</span> </span>
<a <dropdown-menu slot='list'>
v-else <dropdown-item v-for="(dataitem) in getPreNavData(item)" :name="dataitem.srfkey" :key="dataitem.srfkey">
@click.prevent="handleLink(item)" <span :class="{'curselected':isCurSelected(item,dataitem)}">{{dataitem.srfmajortext}}</span>
>{{ $t(item.meta.caption) }}</a> </dropdown-item>
</dropdown-menu>
</dropdown>
</span>
</span>
<a v-else @click.prevent="handleLink(item)">{{ item.title }}</a>
</el-breadcrumb-item> </el-breadcrumb-item>
</template>
<template v-if="!Object.is(this.navModel,'route')">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
<span v-if="index === breadcrumbs.length-1" class="no-redirect" >{{ $t(item.meta.caption)}}</span>
<a v-else @click.prevent="handleLink(item)" >{{ $t(item.meta.caption) }}</a>
</el-breadcrumb-item>
</template>
</transition-group> </transition-group>
</el-breadcrumb> </el-breadcrumb>
</template> </template>
...@@ -24,14 +33,41 @@ ...@@ -24,14 +33,41 @@
<script lang="ts"> <script lang="ts">
import { Component, Vue, Watch, Prop } from 'vue-property-decorator' import { Component, Vue, Watch, Prop } from 'vue-property-decorator'
import { RouteRecord, Route } from 'vue-router' import { RouteRecord, Route } from 'vue-router'
import { Environment } from "@/environments/environment";
import NavDataService from '@/service/app/navdata-service';
import {Subscription } from 'rxjs';
@Component({ @Component({
}) })
export default class Breadcrumb extends Vue { export default class Breadcrumb extends Vue {
private breadcrumbs: RouteRecord[] = []; //面包屑列表 /**
* 面包屑列表
*
* @memberof Breadcrumb
*/
private breadcrumbs: Array<any> = [];
/**
* 导航服务
*
* @memberof Breadcrumb
*/
private navDataService = NavDataService.getInstance(this.$store);
/**
* 默认视图标识
*
* @memberof Breadcrumb
*/
@Prop() public indexViewTag!: string;
@Prop() public defPSAppView: any; //默认视图 /**
* 导航模式
*
* @memberof Breadcrumb
*/
@Prop({default:'tab'}) public navModel?:string;
/** /**
* 监听路由 * 监听路由
...@@ -43,13 +79,30 @@ export default class Breadcrumb extends Vue { ...@@ -43,13 +79,30 @@ export default class Breadcrumb extends Vue {
this.getBreadcrumb() this.getBreadcrumb()
} }
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Dev
*/
public serviceStateEvent: Subscription | undefined;
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof Breadcrumb * @memberof Breadcrumb
*/ */
created() { created() {
this.getBreadcrumb() this.getBreadcrumb();
if(Object.is(this.navModel,"route")){
this.serviceStateEvent = this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if (Object.is(action, 'datarefresh')) {
this.getBreadcrumb();
}
});
}
} }
/** /**
...@@ -58,24 +111,90 @@ export default class Breadcrumb extends Vue { ...@@ -58,24 +111,90 @@ export default class Breadcrumb extends Vue {
* @memberof Breadcrumb * @memberof Breadcrumb
*/ */
private getBreadcrumb() { private getBreadcrumb() {
if(Object.is(this.navModel,"route")){
this.breadcrumbs = this.navDataService.getNavData();
this.$forceUpdate();
}else{
this.breadcrumbs = this.$route.matched.filter((item) => { this.breadcrumbs = this.$route.matched.filter((item) => {
return item.meta && item.meta.caption return item.meta && item.meta.caption
}) })
if(this.defPSAppView){
/**如果配置了默认视图,给面包屑第一级赋值默认视图为首页 */
} }
} }
/** /**
* 单机面包屑 * 获取面包屑指定元素前一条数据
*
* @memberof Breadcrumb
*/
private getPreNavData(item:any){
let preNavData:any = this.navDataService.getPreNavDataById(item.id);
return preNavData.data;
}
/**
* 判断是否为当前选中项
*
* @memberof Breadcrumb
*/
private isCurSelected(item:any,singleItem:any){
return item.srfkey === singleItem.srfkey;
}
/**
* 面包屑点击行为
* *
* @memberof Breadcrumb * @memberof Breadcrumb
*/ */
private handleLink(item: any) { private handleLink(item: any) {
if(Object.is(this.navModel,"route")){
// 首页
if(Object.is(item.id,this.indexViewTag)){
this.$router.push((window.sessionStorage.getItem(Environment.AppName))as string);
}else{
// 非首页
this.$router.push(item.path).catch(err => {
console.warn(err);
});
}
this.navDataService.removeNavData(item.id);
}else{
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.$router.push({ path: path });
} else {
this.$router.push("/");
}
}else{
this.$router.push(item).catch(err => { this.$router.push(item).catch(err => {
console.warn(err); console.warn(err);
}); });
} }
}
}
/**
* 切换导航行为
*
* @memberof Breadcrumb
*/
private selectNavData($event:any,item:any){
let preNavData:any = this.getPreNavData(item);
let curSrfkey:any = $event;
this.navDataService.serviceState.next({action:'viewrefresh',name:item.id, data:curSrfkey});
}
/**
* 组件销毁
*
* @memberof Breadcrumb
*/
public destroyed() {
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
}
} }
</script> </script>
......
...@@ -100,6 +100,22 @@ export default class AppFileUpload extends Vue { ...@@ -100,6 +100,22 @@ export default class AppFileUpload extends Vue {
*/ */
@Prop() public data!: string; @Prop() public data!: string;
/**
* 视图参数
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@Prop() public viewparams!: any;
/**
* 视图上下文
*
* @type {*}
* @memberof AppAutocomplete
*/
@Prop() public context!: any;
/** /**
* 初始化值 * 初始化值
* *
...@@ -146,7 +162,7 @@ export default class AppFileUpload extends Vue { ...@@ -146,7 +162,7 @@ export default class AppFileUpload extends Vue {
* @type {string} * @type {string}
* @memberof AppFileUpload * @memberof AppFileUpload
*/ */
@Prop() public uploadparams?: string; @Prop() public uploadparams?: any;
/** /**
* 下载参数 * 下载参数
...@@ -154,15 +170,7 @@ export default class AppFileUpload extends Vue { ...@@ -154,15 +170,7 @@ export default class AppFileUpload extends Vue {
* @type {string} * @type {string}
* @memberof AppFileUpload * @memberof AppFileUpload
*/ */
@Prop() public exportparams?: string; @Prop() public exportparams?: any;
/**
* 自定义参数
*
* @type {*}
* @memberof AppFileUpload
*/
@Prop() public customparams?: any;
/** /**
* 上传文件路径 * 上传文件路径
...@@ -186,20 +194,20 @@ export default class AppFileUpload extends Vue { ...@@ -186,20 +194,20 @@ export default class AppFileUpload extends Vue {
public files = []; public files = [];
/** /**
* 上传keys * 上传params
* *
* @type {Array<any>} * @type {Array<any>}
* @memberof AppFileUpload * @memberof AppFileUpload
*/ */
public upload_keys: Array<any> = []; public upload_params: Array<any> = [];
/** /**
* 导出keys * 导出params
* *
* @type {Array<any>} * @type {Array<any>}
* @memberof AppFileUpload * @memberof AppFileUpload
*/ */
public export_keys: Array<any> = []; public export_params: Array<any> = [];
/** /**
* 自定义数组 * 自定义数组
...@@ -239,31 +247,37 @@ export default class AppFileUpload extends Vue { ...@@ -239,31 +247,37 @@ export default class AppFileUpload extends Vue {
* @memberof AppFileUpload * @memberof AppFileUpload
*/ */
private dataProcess(): void { private dataProcess(): void {
let upload_arr: Array<string> = [];
let export_arr: Array<string> = [];
const _data: any = JSON.parse(this.data);
this.upload_keys.forEach((key: string) => {
upload_arr.push(`${key}=${_data[key]}`);
});
this.export_keys.forEach((key: string) => {
export_arr.push(`${key}=${_data[key]}`);
});
let _url = `${Environment.BaseUrl}${Environment.UploadFile}`; let _url = `${Environment.BaseUrl}${Environment.UploadFile}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) { if (this.upload_params.length > 0 ) {
_url = `${_url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`; _url +='?';
this.upload_params.forEach((item:any,i:any)=>{
_url += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.upload_params.length-1){
_url += '&';
}
})
} }
this.uploadUrl = _url; this.uploadUrl = _url;
this.files.forEach((file: any) => { this.files.forEach((file: any) => {
let url = `${this.downloadUrl}/${file.id}`; let url = `${this.downloadUrl}/${file.id}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) { if (this.export_params.length > 0) {
url = `${url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`; url +='?';
this.export_params.forEach((item:any,i:any)=>{
url += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.export_params.length-1){
url += '&';
}
})
} }
file.url = url; file.url = url;
}); });
} }
/** /**
* vue 生命周期 * vue 生命周期
* *
...@@ -290,28 +304,37 @@ export default class AppFileUpload extends Vue { ...@@ -290,28 +304,37 @@ export default class AppFileUpload extends Vue {
public mounted() { public mounted() {
this.appData = this.$store.getters.getAppData(); this.appData = this.$store.getters.getAppData();
let uploadparams: string = ''; let uploadparams: any = {};
let exportparams: string = ''; let exportparams: any = {};
let upload_keys: Array<string> = []; let upload_params: Array<string> = [];
let export_keys: Array<string> = []; let export_params: Array<string> = [];
let custom_arr: Array<string> = []; let custom_arr: Array<string> = [];
let param:any = this.viewparams;
let context:any = this.context;
let _data:any = JSON.parse(this.data);
if (this.uploadparams && !Object.is(this.uploadparams, '')) { if (this.uploadparams && !Object.is(this.uploadparams, '')) {
uploadparams = this.uploadparams; uploadparams = this.uploadparams;
upload_keys = uploadparams.split(';'); upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
} }
if (this.exportparams && !Object.is(this.exportparams, '')) { if (this.exportparams && !Object.is(this.exportparams, '')) {
exportparams = this.exportparams; exportparams = this.exportparams;
export_keys = exportparams.split(';'); export_params = this.$util.computedNavData(_data,param,context,exportparams);
} }
if (this.customparams && !Object.is(this.customparams, '')) {
Object.keys(this.customparams).forEach((name: string) => { for (const item in upload_params) {
custom_arr.push(`${name}=${this.customparams[name]}`); this.upload_params.push({
}); [item]:upload_params[item]
})
}
for (const item in export_params) {
this.export_params.push({
[item]:export_params[item]
})
} }
this.upload_keys = upload_keys;
this.export_keys = export_keys;
this.custom_arr = custom_arr;
this.setFiles(this.value); this.setFiles(this.value);
this.dataProcess(); this.dataProcess();
......
.app-form-group { .app-form-group {
>.ivu-card-head { >.ivu-card-head {
>p { >p {
>i { >i {
...@@ -7,7 +8,9 @@ ...@@ -7,7 +8,9 @@
} }
} }
} }
>.ivu-card-extra { >.ivu-card-extra {
.item-extract-mode { .item-extract-mode {
display: flex; display: flex;
.item { .item {
...@@ -18,6 +21,7 @@ ...@@ -18,6 +21,7 @@
} }
.app-form-group.app-group-collapse-contant { .app-form-group.app-group-collapse-contant {
.ivu-card-body { .ivu-card-body {
display: none; display: none;
} }
...@@ -25,9 +29,12 @@ ...@@ -25,9 +29,12 @@
.app-group-flex { .app-group-flex {
height: 100%; height: 100%;
overflow: auto; overflow-y: auto;
> .ivu-card-body { overflow-x: hidden;
>.ivu-card-body {
height: calc(100% - 51px); height: calc(100% - 51px);
overflow: auto; overflow-y: auto;
overflow-x: hidden;
} }
} }
\ No newline at end of file
<template> <template>
<div class="app-form-group"> <div :class="classes">
<div v-if="uiStyle=='STYLE2'"> <template v-if="uiStyle=='STYLE2'">
<app-form-group2 <app-form-group2
:caption="caption" :caption="caption"
:uiStyle="uiStyle" :uiStyle="uiStyle"
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
:titleBarCloseMode="titleBarCloseMode"> :titleBarCloseMode="titleBarCloseMode">
<slot></slot> <slot></slot>
</app-form-group2> </app-form-group2>
</div> </template>
<div v-else> <template v-else>
<card v-if="isShowCaption === true" :bordered="false" :dis-hover="true" :class="classes"> <card v-if="isShowCaption === true" :bordered="false" :dis-hover="true" :class="classes">
<p class='' slot='title'> <p class='' slot='title'>
<icon v-if="titleBarCloseMode !== 0" :type="collapseContant ? 'ios-arrow-dropright-circle' : 'ios-arrow-dropdown-circle'" <icon v-if="titleBarCloseMode !== 0" :type="collapseContant ? 'ios-arrow-dropright-circle' : 'ios-arrow-dropdown-circle'"
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<dropdown-menu slot='list' v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)"> <dropdown-menu slot='list' v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<dropdown-item v-for="(detail,index) in (uiActionGroup.details)" :key="index" :name="detail.name"> <dropdown-item v-for="(detail,index) in (uiActionGroup.details)" :key="index" :name="detail.name">
<span class='item' @click="doUIAction($event, detail)"> <span class='item' @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')"> <template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i> <i :class="detail.icon" ></i>
</template> </template>
...@@ -36,14 +37,17 @@ ...@@ -36,14 +37,17 @@
<img :src="detail.img" /> <img :src="detail.img" />
</div> </div>
</template> </template>
</template>
&nbsp; &nbsp;
<span> <span>
<template v-if="detail.isShowCaption">
<template v-if="uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, '')"> <template v-if="uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, '')">
{{$t(`${uiActionGroup.langbase}.uiactions.${detail.uiactiontag}`)}} {{$t(`${uiActionGroup.langbase}.uiactions.${detail.uiactiontag}`)}}
</template> </template>
<template v-if="!(uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, ''))"> <template v-if="!(uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, ''))">
{{detail.caption}} {{detail.caption}}
</template> </template>
</template>
</span> </span>
</span> </span>
</dropdown-item> </dropdown-item>
...@@ -55,6 +59,7 @@ ...@@ -55,6 +59,7 @@
<template v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)"> <template v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<div v-for="(detail,index) in uiActionGroup.details" :key="index"> <div v-for="(detail,index) in uiActionGroup.details" :key="index">
<span class='item' @click="doUIAction($event, detail)"> <span class='item' @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')"> <template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i> <i :class="detail.icon" ></i>
</template> </template>
...@@ -63,14 +68,17 @@ ...@@ -63,14 +68,17 @@
<img :src="detail.img" /> <img :src="detail.img" />
</div> </div>
</template> </template>
</template>
&nbsp; &nbsp;
<span> <span>
<template v-if="detail.isShowCaption">
<template v-if="uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, '')"> <template v-if="uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, '')">
{{$t(`${uiActionGroup.langbase}.uiactions.${detail.uiactiontag}`)}} {{$t(`${uiActionGroup.langbase}.uiactions.${detail.uiactiontag}`)}}
</template> </template>
<template v-if="!(uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, ''))"> <template v-if="!(uiActionGroup.langbase && !Object.is(uiActionGroup.langbase, '') && detail.uiactiontag && !Object.is(detail.uiactiontag, ''))">
{{detail.caption}} {{detail.caption}}
</template> </template>
</template>
</span> </span>
</span> </span>
</div> </div>
...@@ -79,17 +87,17 @@ ...@@ -79,17 +87,17 @@
</template> </template>
</a > </a >
</template> </template>
<div v-if="Object.is(layoutType, 'FLEX')"> <template v-if="Object.is(layoutType, 'FLEX')">
<slot></slot> <slot></slot>
</div> </template>
<div v-if="!Object.is(layoutType, 'FLEX')"> <template v-if="!Object.is(layoutType, 'FLEX')">
<row :gutter="10"><slot></slot></row> <row :gutter="10"><slot></slot></row>
</div> </template>
</card> </card>
<row v-if="isShowCaption === false" :class="classes"> <template v-if="isShowCaption === false">
<slot></slot> <slot></slot>
</row> </template>
</div> </template>
</div> </div>
</template> </template>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
overflow: auto; overflow: auto;
> .ivu-tabs-tabpane { > .ivu-tabs-tabpane {
height: 100%; height: 100%;
overflow: auto; overflow: initial;
} }
} }
} }
......
...@@ -98,6 +98,22 @@ export default class AppImageUpload extends Vue { ...@@ -98,6 +98,22 @@ export default class AppImageUpload extends Vue {
*/ */
@Prop() public data!: string; @Prop() public data!: string;
/**
* 视图参数
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@Prop() public viewparams!: any;
/**
* 视图上下文
*
* @type {*}
* @memberof AppAutocomplete
*/
@Prop() public context!: any;
/** /**
* 初始化值 * 初始化值
* *
...@@ -185,20 +201,20 @@ export default class AppImageUpload extends Vue { ...@@ -185,20 +201,20 @@ export default class AppImageUpload extends Vue {
@Provide() public files = []; @Provide() public files = [];
/** /**
* 上传keys * 上传params
* *
* @type {Array<any>} * @type {Array<any>}
* @memberof AppImageUpload * @memberof AppImageUpload
*/ */
public upload_keys: Array<any> = []; public upload_params: Array<any> = [];
/** /**
* 导出keys * 导出params
* *
* @type {Array<any>} * @type {Array<any>}
* @memberof AppImageUpload * @memberof AppImageUpload
*/ */
public export_keys: Array<any> = []; public export_params: Array<any> = [];
/** /**
* 自定义数组 * 自定义数组
...@@ -238,26 +254,31 @@ export default class AppImageUpload extends Vue { ...@@ -238,26 +254,31 @@ export default class AppImageUpload extends Vue {
* @memberof AppImageUpload * @memberof AppImageUpload
*/ */
private dataProcess(): void { private dataProcess(): void {
let upload_arr: Array<string> = [];
let export_arr: Array<string> = [];
const _data: any = JSON.parse(this.data);
this.upload_keys.forEach((key: string) => {
upload_arr.push(`${key}=${_data[key]}`);
});
this.export_keys.forEach((key: string) => {
export_arr.push(`${key}=${_data[key]}`);
});
let _url = `${Environment.BaseUrl}${Environment.UploadFile}`; let _url = `${Environment.BaseUrl}${Environment.UploadFile}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) { if (this.upload_params.length > 0 ) {
_url = `${_url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`; _url +='?';
this.upload_params.forEach((item:any,i:any)=>{
_url += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.upload_params.length-1){
_url += '&';
} }
})
}
this.uploadUrl = _url; this.uploadUrl = _url;
this.files.forEach((file: any) => { this.files.forEach((file: any) => {
let url = `${this.downloadUrl}/${file.id}`; let url = `${this.downloadUrl}/${file.id}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) { if (this.export_params.length > 0) {
url = `${url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`; url +='?';
this.export_params.forEach((item:any,i:any)=>{
url += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.export_params.length-1){
url += '&';
}
})
} }
file.url = url; file.url = url;
}); });
...@@ -288,28 +309,35 @@ export default class AppImageUpload extends Vue { ...@@ -288,28 +309,35 @@ export default class AppImageUpload extends Vue {
public mounted() { public mounted() {
this.appData = this.$store.getters.getAppData(); this.appData = this.$store.getters.getAppData();
let uploadparams: string = ''; let uploadparams: any = {};
let exportparams: string = ''; let exportparams: any = {};
let upload_keys: Array<string> = []; let upload_params: Array<string> = [];
let export_keys: Array<string> = []; let export_params: Array<string> = [];
let custom_arr: Array<string> = []; let custom_arr: Array<string> = [];
let param:any = this.viewparams;
let context:any = this.context;
let _data:any = JSON.parse(this.data);
if (this.uploadparams && !Object.is(this.uploadparams, '')) { if (this.uploadparams && !Object.is(this.uploadparams, '')) {
uploadparams = this.uploadparams; uploadparams = this.uploadparams;
upload_keys = uploadparams.split(';'); upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
} }
if (this.exportparams && !Object.is(this.exportparams, '')) { if (this.exportparams && !Object.is(this.exportparams, '')) {
exportparams = this.exportparams; exportparams = this.exportparams;
export_keys = exportparams.split(';'); export_params = this.$util.computedNavData(_data,param,context,exportparams);
} }
if (this.customparams && !Object.is(this.customparams, '')) {
Object.keys(this.customparams).forEach((name: string) => { for (const item in upload_params) {
custom_arr.push(`${name}=${this.customparams[name]}`); this.upload_params.push({
}); [item]:upload_params[item]
})
}
for (const item in export_params) {
this.export_params.push({
[item]:export_params[item]
})
} }
this.upload_keys = upload_keys;
this.export_keys = export_keys;
this.custom_arr = custom_arr;
this.setFiles(this.value); this.setFiles(this.value);
this.dataProcess(); this.dataProcess();
......
...@@ -324,11 +324,11 @@ export default class AppPickerSelectView extends Vue { ...@@ -324,11 +324,11 @@ export default class AppPickerSelectView extends Vue {
this.items.push({ srfmajortext : item.srfmajortext, srfkey: item.srfkey }); this.items.push({ srfmajortext : item.srfmajortext, srfkey: item.srfkey });
} }
}); });
}
let _viewparam = JSON.parse(this.viewparam); let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = this.selectItems; _viewparam.selectedData = this.selectItems;
this.viewparam = JSON.stringify(_viewparam); this.viewparam = JSON.stringify(_viewparam);
} }
}
this.$forceUpdate(); this.$forceUpdate();
} }
......
...@@ -242,7 +242,7 @@ export default class AppPicker extends Vue { ...@@ -242,7 +242,7 @@ export default class AppPicker extends Vue {
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPicker * @memberof AppPicker
*/ */
@Watch('value') @Watch('value',{immediate: true})
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal; this.curvalue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) { if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
......
...@@ -148,13 +148,21 @@ export default class AppSpan extends Vue { ...@@ -148,13 +148,21 @@ export default class AppSpan extends Vue {
if(this.tag){ if(this.tag){
return; //代码表走codelist组件 return; //代码表走codelist组件
}else if(this.editorType === "ADDRESSPICKUP"){ }else if(this.editorType === "ADDRESSPICKUP"){
if(this.$util.isEmpty(this.value)){
this.text = '';
}else{
JSON.parse(this.value).forEach((item:any,index:number) => { JSON.parse(this.value).forEach((item:any,index:number) => {
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext; this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext;
}); });
}
}else{
if(this.$util.isEmpty(this.value)){
this.text = '';
}else{ }else{
this.text = this.value; this.text = this.value;
} }
} }
}
} }
</script> </script>
......
.ivu-select-dropdown { .transfer-select{
.ivu-select-dropdown {
padding: 0px; padding: 0px;
.hidden { .hidden {
display: none; display: none;
} }
.el-transfer{
min-width: 100% !important;
display: flex;
justify-content: space-between;
.el-transfer-panel{
min-width: 25%;
} }
.el-transfer__buttons{
align-self: center;
}
}
}
}
<template> <template>
<Select <Select
class="transfer-select"
@on-open-change="transferRefresh" @on-open-change="transferRefresh"
@on-change="dataChange" @on-change="dataChange"
v-model="dataRight" v-model="dataRight"
:style="{width:width===undefined?'586px':width}" :style="{width:width}"
multiple :disabled="disabled"
> :placeholder="placeholder"
<Option class="hidden" :value="item" v-for="(item,i) in dataRight" :key="i">{{findLabel(item)}}</Option> multiple>
<el-transfer v-model="dataRight" :data="dataLeft" @change="dataChange" :titles="['未选择', '已选择']"></el-transfer> <Option class="hidden" :value="item" v-for="(item,i) in dataRight" :key="i">
{{findLabel(item)}}
</Option>
<el-transfer
v-model="dataRight"
:data="dataLeft"
@change="dataChange"
:titles="['未选择', '已选择']"/>
</Select> </Select>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Watch, Prop, Model } from "vue-property-decorator"; import { Vue, Component, Watch, Prop, Model } from "vue-property-decorator";
import CodeListService from "@service/app/codelist-service"; import CodeListService from "@service/app/codelist-service";
...@@ -18,48 +27,28 @@ import { ElSelect } from "element-ui/types/select"; ...@@ -18,48 +27,28 @@ import { ElSelect } from "element-ui/types/select";
@Component({}) @Component({})
export default class AppTransfer extends Vue { export default class AppTransfer extends Vue {
/** /**
* 左侧框数据 * 传入表单数据
*/
public dataLeft: any[] = [];
/**
* 右侧框数据
*/
public dataRight: any[] = [];
/**
* 穿梭框宽度
*/
@Prop() public width: any;
/**
* 代码表服务对象
* *
* @type {CodeListService} * @type {*}
* @memberof AppTransfer * @memberof AppTransfer
*/ */
@Prop() public data:any;
public codeListService: CodeListService = new CodeListService({
$store: this.$store
});
/** /**
* 查询参数 * 穿梭框宽度
* @type {*} *
* @type {string}
* @memberof AppTransfer * @memberof AppTransfer
*/ */
public queryParam: any; @Prop() public width?: string;
/** /**
* 表单传入字符串值分隔符 * 表单传入字符串值分隔符
*/ *
@Prop() public valueSeparator!: string; * @type {string}
/**
* 当前选中值
* @type {any}
* @memberof AppTransfer * @memberof AppTransfer
*/ */
@Model("change") public itemValue!: any; @Prop() public valueSeparator?: string;
/** /**
* 代码表标识 * 代码表标识
...@@ -93,33 +82,6 @@ export default class AppTransfer extends Vue { ...@@ -93,33 +82,6 @@ export default class AppTransfer extends Vue {
*/ */
@Prop() public localParam!: any; @Prop() public localParam!: any;
/**
* 组件change事件,右侧框数据变化时
* @memberof AppTransfer
*/
dataChange(e: any) {
let _valueSeparator: any;
_valueSeparator = this.initValueSeparator(_valueSeparator);
let newVal: any;
newVal = e.join(`${_valueSeparator}`);
if (newVal) {
this.$emit("change", newVal);
} else {
this.$emit("change", null);
}
}
/**
* 初始化valueSeparator
*/
public initValueSeparator(_valueSeparator: any) {
if (this.valueSeparator === undefined) {
return ",";
} else {
return this.valueSeparator;
}
}
/** /**
* 视图上下文 * 视图上下文
* *
...@@ -138,6 +100,7 @@ export default class AppTransfer extends Vue { ...@@ -138,6 +100,7 @@ export default class AppTransfer extends Vue {
/** /**
* 是否禁用 * 是否禁用
*
* @type {any} * @type {any}
* @memberof AppTransfer * @memberof AppTransfer
* *
...@@ -145,22 +108,47 @@ export default class AppTransfer extends Vue { ...@@ -145,22 +108,47 @@ export default class AppTransfer extends Vue {
@Prop() public disabled?: any; @Prop() public disabled?: any;
/** /**
* 是否支持过滤 * 穿梭框提示内容
* @type {boolean} *
* @type {string}
* @memberof AppTransfer * @memberof AppTransfer
*/ */
@Prop() public filterable?: boolean; @Prop() public placeholder?: string;
/** /**
* 下拉选提示内容 * 当前选中值
* @type {string} *
* @type {any}
* @memberof AppTransfer * @memberof AppTransfer
*/ */
@Prop() public placeholder?: string; @Model("change") public itemValue!: any;
/** /**
* vue 生命周期 * 左侧框数据
*
* @memberof AppTransfer
*/
public dataLeft: any[] = [];
/**
* 右侧框数据
*
* @memberof AppTransfer
*/
public dataRight: any[] = [];
/**
* 代码表服务对象
* *
* @type {CodeListService}
* @memberof AppTransfer
*/
public codeListService: CodeListService = new CodeListService({
$store: this.$store
});
/**
* vue 生命周期
* @memberof AppTransfer * @memberof AppTransfer
*/ */
public created() { public created() {
...@@ -169,14 +157,15 @@ export default class AppTransfer extends Vue { ...@@ -169,14 +157,15 @@ export default class AppTransfer extends Vue {
/** /**
* 数据处理 * 数据处理
*
* @memberof AppTransfer
*/ */
public dataHandle() { public dataHandle() {
if (this.tag && Object.is(this.codelistType, "STATIC")) { if (this.tag && Object.is(this.codelistType, "STATIC")) {
const codelist = this.$store.getters.getCodeList(this.tag); const codelist = this.$store.getters.getCodeList(this.tag);
if (codelist) { if (codelist) {
this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))]; this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))];
this.initLeft(); this.initData()
this.initRight();
} else { } else {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----代码表不存在`);
} }
...@@ -191,8 +180,7 @@ export default class AppTransfer extends Vue { ...@@ -191,8 +180,7 @@ export default class AppTransfer extends Vue {
.getItems(this.tag, _context, _param) .getItems(this.tag, _context, _param)
.then((res: any) => { .then((res: any) => {
this.dataLeft = res; this.dataLeft = res;
this.initLeft(); this.initData()
this.initRight();
}) })
.catch((error: any) => { .catch((error: any) => {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----代码表不存在`);
...@@ -207,37 +195,28 @@ export default class AppTransfer extends Vue { ...@@ -207,37 +195,28 @@ export default class AppTransfer extends Vue {
* @returns * @returns
* @memberof AppTransfer * @memberof AppTransfer
*/ */
public handlePublicParams(arg: any) { public handlePublicParams(arg: any) {
// 合并表单参数 // 合并表单参数
arg.param = this.viewparams arg.param = this.viewparams? JSON.parse(JSON.stringify(this.viewparams)): {};
? JSON.parse(JSON.stringify(this.viewparams))
: {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理 // 附加参数处理
if (this.localContext && Object.keys(this.localContext).length > 0) { if (this.localContext && Object.keys(this.localContext).length > 0) {
let _context = this.$util.computedNavData( let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
this.itemValue,
arg.context,
arg.param,
this.localContext
);
Object.assign(arg.context, _context); Object.assign(arg.context, _context);
} }
if (this.localParam && Object.keys(this.localParam).length > 0) { if (this.localParam && Object.keys(this.localParam).length > 0) {
let _param = this.$util.computedNavData( let _param = this.$util.computedNavData(this.data,arg.context,arg.param,this.localParam);
this.itemValue,
arg.context,
arg.param,
this.localParam
);
Object.assign(arg.param, _param); Object.assign(arg.param, _param);
} }
} }
/** /**
* 初始化左侧框数据 * 初始化获取到的选项数据
*
* @memberof AppTransfer
*/ */
public initLeft() { public initData(){
// 初始化左侧框数据
let left: any[] = []; let left: any[] = [];
Object.assign(left, this.dataLeft); Object.assign(left, this.dataLeft);
this.dataLeft = []; this.dataLeft = [];
...@@ -249,13 +228,10 @@ export default class AppTransfer extends Vue { ...@@ -249,13 +228,10 @@ export default class AppTransfer extends Vue {
disabled: elem.disabled disabled: elem.disabled
}); });
}); });
}
/** // 初始化右侧框数据
* 初始化右侧框数据
*/
public initRight() {
let _valueSeparator: any; let _valueSeparator: any;
_valueSeparator = this.initValueSeparator(_valueSeparator); _valueSeparator = this.initValueSeparator();
let _data: any = this.itemValue; let _data: any = this.itemValue;
if (_data) { if (_data) {
let _dataRight: any = []; let _dataRight: any = [];
...@@ -270,10 +246,35 @@ export default class AppTransfer extends Vue { ...@@ -270,10 +246,35 @@ export default class AppTransfer extends Vue {
this.dataRight = _dataRight; this.dataRight = _dataRight;
} }
} }
/**
* 组件change事件,右侧框数据变化时
* @memberof AppTransfer
*/
public dataChange(e: any) {
let _valueSeparator: string;
_valueSeparator = this.initValueSeparator();
let newVal: string = e.join(`${_valueSeparator}`);
if (newVal) {
this.$emit("change", newVal);
} else {
this.$emit("change", null);
}
}
/**
* 初始化valueSeparator
* @memberof AppTransfer
*/
public initValueSeparator() {
return this.valueSeparator ? this.valueSeparator : ",";
}
/** /**
* 穿梭框打开时刷新数据 * 穿梭框打开时刷新数据
* @memberof AppTransfer
*/ */
public transferRefresh(e: any) { public transferRefresh(e: boolean) {
if (e && this.codelistType === "DYNAMIC") { if (e && this.codelistType === "DYNAMIC") {
this.dataLeft = []; this.dataLeft = [];
this.dataHandle(); this.dataHandle();
...@@ -282,6 +283,7 @@ export default class AppTransfer extends Vue { ...@@ -282,6 +283,7 @@ export default class AppTransfer extends Vue {
/** /**
* 找到dataLeft中key与dataRight中item相等的元素,返回label * 找到dataLeft中key与dataRight中item相等的元素,返回label
* @memberof AppTransfer
*/ */
public findLabel(item: any) { public findLabel(item: any) {
for (const elem of this.dataLeft) { for (const elem of this.dataLeft) {
......
.menu-drawer {
.ivu-drawer-left {
left: 201px !important;
}
.ivu-drawer {
top: 64px !important;
}
.ivu-drawer-body {
padding: 32px !important;
.menuItems {
display: flex;
flex-wrap: wrap;
> .item {
margin: 0px 10px;
width: calc(33.333% - 20px);
padding: 0px 15px;
font-size: 13px;
transition: all 0.3s;
display: flex;
justify-content: space-between;
height: 32px;
align-items: center;
.star {
display: flex;
height: 100%;
width: 30px;
font-size: 15px;
align-items: center;
justify-content: center;
.ivu-icon-ios-star-outline{
display: none;
}
}
}
> .item:hover {
background-color: #eaeaea;
cursor: pointer;
.ivu-icon-ios-star-outline{
display: inline;
}
}
}
}
}
.sider-drawer {
.ivu-drawer {
background-color: #ffffff !important;
}
.ivu-drawer-body {
padding: 0px !important;
}
.ivu-drawer {
top: 64px !important;
}
.context-menu-drag {
display: flex;
.flip-list-move {
transition: transform 0.3s;
}
.menu-list {
width: 100%;
height: 100%;
.menu-header {
cursor: pointer;
border-bottom: 1px solid rgb(222, 222, 222);
height: 48px;
line-height: 48px;
display: flex;
align-items: center;
.menuicon {
display: inline-block;
width: 50px;
font-size: 16px;
text-align: center;
font-size: 22px;
}
.content {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1 1 0%;
overflow: hidden;
font-size: 13px;
}
.forward {
margin: 0px 8px 0px 4px;
color: rgb(222, 222, 222);
font-size: 15px;
}
}
.list-group-item {
transition: background 1s;
-webkit-transition: background 1s;
.menuicon {
text-align: center;
}
.el-row {
height: 100%;
display: flex;
align-items: center;
padding: 0px 5px;
}
height: 40px;
cursor: pointer;
position: relative;
display: block;
margin-bottom: -1px;
transition: background-color 0.5s;
transition-timing-function: ease-in-out;
.handle {
cursor: move;
}
.bar {
display: flex;
.ivu-icon-ios-close {
cursor: pointer;
font-size: 25px;
}
}
}
.list-group-item:hover {
background-color: #f5f5f5;
.ivu-icon-ios-star-outline{
display: inline;
}
}
}
}
}
\ No newline at end of file
<template>
<Drawer class-name="sider-drawer" placement="left" :closable="false" :mask="false" width="200" v-model="leftDrawerVisiable">
<div class="context-menu-drag">
<div class="menu-list">
<div class="menu-header" @mouseover="showMenuDrawer" @click="rightDrawerVisiable=!rightDrawerVisiable">
<div class="menuicon">
<Icon type="md-apps" />
</div>
<div class="content">
<span>服务</span>
</div>
<div class="forward">
<Icon type="ios-arrow-forward" />
</div>
</div>
<div style="padding:8px 0px;" class="col-6">
<draggable class="list-group" tag="ul" v-model="selectlist" v-bind="dragOptionsVal" @start="drag=true" @end="drag=false" :animation="250" handle=".handle" ghost-class="ghost">
<transition-group type="transition" :name="!drag ? 'flip-list' : null">
<li class="list-group-item" v-for="(item,index) in selectlist" :key="item.id">
<el-row>
<el-col class="menuicon" :span="4">
<span>
<Icon v-if="item.icon" :type="item.icon" />
<Icon v-else type="md-menu" />
</span>
</el-col>
<el-col :span="14">
<span>{{ item.label }}</span>
</el-col>
<el-col :span="6">
<div class="bar">
<div>
<Icon type="ios-close" @click="removeAt(index)" />
</div>
<div>
<Icon type="ios-move handle" />
</div>
</div>
</el-col>
</el-row>
</li>
</transition-group>
</draggable>
</div>
</div>
<Drawer class-name="menu-drawer" width="60" :closable="true" :mask="false" placement="left" v-model="rightDrawerVisiable">
<div class="menuItems">
<div class="item" v-for="(item) in list" :key="item.id">
<span class="title">{{item.label}}</span>
<span v-if="isStar(item.id)" class="star" @click="outStar(item)">
<Icon type="ios-star" />
</span>
<span v-else class="star" @click="onStar(item)">
<Icon type="ios-star-outline" />
</span>
</div>
</div>
</Drawer>
</div>
</Drawer>
</template>
<script lang="ts">
import draggable from "vuedraggable";
import EntityService from '@/service/entity-service';
import { Vue,Component,Provide,Watch,Prop,Model } from "vue-property-decorator";
// tslint:disable-next-line:max-classes-per-file
@Component({
components: {
draggable
}
})
export default class ContextMenuDrag extends Vue {
/**
* 抽屉菜单状态
*
* @returns
* @memberof ContextMenuDrag
*/
@Prop() public contextMenuDragVisiable?: boolean;
/**
* 拖拽列表配置对象
*
* @returns
* @memberof ContextMenuDrag
*/
@Model("change") public dragOptions: any;
/**
* 右侧飘窗状态
*
* @returns
* @memberof ContextMenuDrag
*/
public rightDrawerVisiable: boolean = false;
/**
* 左侧飘窗状态
*
* @returns
* @memberof ContextMenuDrag
*/
public leftDrawerVisiable: boolean = false;
/**
* 全部应用数据
*
* @returns
* @memberof ContextMenuDrag
*/
public list: Array<any> = [];
/**
* 已选择的应用数据
*
* @returns
* @memberof ContextMenuDrag
*/
public selectlist: Array<any> = [];
/**
* 拖拽列表
*
* @returns
* @memberof ContextMenuDrag
*/
public drag: boolean = false;
/**
* 拖拽列表配置项
*
* @returns
* @memberof ContextMenuDrag
*/
get dragOptionsVal() {
return {
animation: 200,
group: "description",
disabled: false,
ghostClass: "ghost"
};
}
/**
* 实体服务对象
*
* @protected
* @type {EntityService}
* @memberof ContextMenuDrag
*/
protected entityService: EntityService = new EntityService();
/**
* 监听抽屉菜单状态
*
* @returns
* @memberof ContextMenuDrag
*/
@Watch("contextMenuDragVisiable")
public onVisiableChange(newVal: any, oldVal: any) {
if (newVal) {
this.leftDrawerVisiable = newVal;
} else {
let that: any = this;
let params: any = {};
params.model = this.selectlist;
const put: Promise<any> = this.entityService.updateChooseApp(null,params);
this.rightDrawerVisiable = false;
setTimeout(() => {
that.leftDrawerVisiable = false;
}, 300);
}
}
/**
* 鼠标移入服务时显示右侧飘窗
*
* @returns
* @memberof ContextMenuDrag
*/
public showMenuDrawer() {
let that: any = this;
if(this.contextMenuDragVisiable){
setTimeout(() => {
that.rightDrawerVisiable = true;
}, 300);
}
}
/**
* 判断是否已选择该应用
*
* @returns
* @memberof ContextMenuDrag
*/
public isStar(id: any) {
let istar: boolean = false;
this.selectlist.forEach((item: any) => {
if (Object.is(item.id, id)) {
istar = true;
}
});
return istar;
}
/**
* 加入列表
*
* @returns
* @memberof ContextMenuDrag
*/
public onStar(item: any) {
item.visabled = 1;
this.selectlist.push(item);
}
/**
* 从列表中删除
*
* @returns
* @memberof ContextMenuDrag
*/
public outStar(item: any) {
item.visabled = 0;
let index: number = 0;
let that: any = this;
this.selectlist.forEach((select: any, index: number) => {
if (Object.is(item.id, select.id)) {
that.selectlist.splice(index,1);
}
});
}
/**
* 删除已选择应用
*
* @returns
* @memberof ContextMenuDrag
*/
removeAt(index: any) {
this.selectlist.splice(index, 1);
}
/**
* 拖拽列表排序
*/
sort() {
this.selectlist = this.selectlist.sort((a, b) => a.order - b.order);
}
/**
* 过滤已选择的应用
*
* @returns
* @memberof ContextMenuDrag
*/
listFilter() {
let that: any = this;
that.selectlist = [];
this.list.forEach((item: any) => {
if (item.visabled === 1) {
that.selectlist.push(item);
}
});
}
/**
* vue 生命周期
*
* @returns
* @memberof ContextMenuDrag
*/
mounted() {
let that: any = this;
const get: Promise<any> = this.entityService.getAllApp(null,{});
get
.then((response: any) => {
if (response) {
that.list = response.data.model;
that.listFilter();
}
});
}
}
</script>
<style lang='less'>
@import './context-menu-drag.less';
</style>
...@@ -5,4 +5,7 @@ ...@@ -5,4 +5,7 @@
top: 0; top: 0;
right: 20px; right: 20px;
} }
.ivu-input-number-input{
text-align: right;
}
} }
\ No newline at end of file
<template> <template>
<div class="input-unit"> <div class="input-unit">
<i-input <InputNumber v-if="type === 'number'"
:placeholder="placeholder"
:size="size"
:precision="precision"
v-model="CurrentVal"
:disabled="disabled ? true : false"
></InputNumber>
<i-input v-else
:placeholder="placeholder" :placeholder="placeholder"
:size="size" :size="size"
:type="type" :type="type"
v-model="CurrentVal" v-model="CurrentVal"
:disabled="disabled ? true : false" :disabled="disabled ? true : false"
:autosize="autoSize"
@on-enter="enter" @on-enter="enter"
></i-input> ></i-input>
<div class="unit-text">{{unit}}</div> <div class="unit-text">{{unit}}</div>
...@@ -62,14 +70,34 @@ export default class InputBox extends Vue { ...@@ -62,14 +70,34 @@ export default class InputBox extends Vue {
*/ */
@Prop() public type?: string; @Prop() public type?: string;
/**
* 精度
*
* @type {number}
* @memberof InputBox
*/
@Prop({default: 0}) public precision?: number;
/**
* 多行文本行数
*
* @type {string}
* @memberof InputBox
*/
@Prop() public autoSize?: any;
/** /**
* 当前值 * 当前值
* *
* @memberof InputBox * @memberof InputBox
*/ */
get CurrentVal() { get CurrentVal() {
if(Object.is(this.type, 'number') && this.itemValue && !isNaN(this.itemValue)){
return Number(Number(this.itemValue).toFixed(this.precision));
}else{
return this.itemValue; return this.itemValue;
} }
}
/** /**
* 值变化 * 值变化
......
...@@ -227,7 +227,7 @@ export default class TabPageExp extends Vue { ...@@ -227,7 +227,7 @@ export default class TabPageExp extends Vue {
* @memberof TabPageExp * @memberof TabPageExp
*/ */
public setCurPageCaption(caption: string, title: any, info: string) { public setCurPageCaption(caption: string, title: any, info: string) {
if (this.$route.meta && !Object.is(this.$route.meta.caption, caption)) { if (this.$route.meta && !Object.is(this.$t(this.$route.meta.caption), caption)) {
return; return;
} }
this.$store.commit("setCurPageCaption", { this.$store.commit("setCurPageCaption", {
......
...@@ -247,12 +247,19 @@ export default class EditViewEngine extends ViewEngine { ...@@ -247,12 +247,19 @@ export default class EditViewEngine extends ViewEngine {
*/ */
public setTabCaption(info: string): void { public setTabCaption(info: string): void {
let viewdata: any = this.view.model; let viewdata: any = this.view.model;
if (viewdata && info && !Object.is(info, '') && this.view.$tabPageExp && (viewdata.srfTitle.indexOf(" - ") === -1)) { let index:number = viewdata.srfTitle.indexOf("-");
this.view.$tabPageExp.setCurPageCaption(viewdata.srfTitle, viewdata.srfTitle, info); if (viewdata && info && !Object.is(info, '')) {
if(index !== -1){
viewdata.srfTitle = viewdata.srfTitle.substr(0,index);
}
if(this.view.$tabPageExp){
this.view.$tabPageExp.setCurPageCaption(this.view.$t(viewdata.srfTitle), this.view.$t(viewdata.srfTitle), info);
}
if(this.view.$route){ if(this.view.$route){
this.view.$route.meta.info = info; this.view.$route.meta.info = info;
} }
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)} - ${viewdata.dataInfo}`; this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)}-${viewdata.dataInfo}`;
// this.view.initNavDataWithRoute();
} }
} }
......
...@@ -367,6 +367,15 @@ export default class MDViewEngine extends ViewEngine { ...@@ -367,6 +367,15 @@ export default class MDViewEngine extends ViewEngine {
* @memberof MDViewEngine * @memberof MDViewEngine
*/ */
public MDCtrlLoad(args: any[]) { public MDCtrlLoad(args: any[]) {
let cacheArray:Array<any> = [];
if(args.length >0){
args.forEach((item:any) =>{
cacheArray.push({srfkey:item.srfkey,srfmajortext:item.srfmajortext});
})
}
// this.view.viewCacheData = cacheArray;
// this.view.initNavDataWithRoute(cacheArray);
// this.view.initNavDataWithTab(cacheArray,false);
if (this.view) { if (this.view) {
this.view.$emit('viewload', args); this.view.$emit('viewload', args);
} }
...@@ -391,11 +400,11 @@ export default class MDViewEngine extends ViewEngine { ...@@ -391,11 +400,11 @@ export default class MDViewEngine extends ViewEngine {
} }
// 快速分组和快速搜索栏 // 快速分组和快速搜索栏
let otherQueryParam:any = {}; let otherQueryParam:any = {};
if(this.view && this.view.qucikGroupData){ if(this.view && this.view.quickGroupData){
Object.assign(otherQueryParam,this.view.qucikGroupData); Object.assign(otherQueryParam,this.view.quickGroupData);
} }
if(this.view && this.view.qucikFormData){ if(this.view && this.view.quickFormData){
Object.assign(otherQueryParam,this.view.qucikFormData); Object.assign(otherQueryParam,this.view.quickFormData);
} }
Object.assign(arg,{viewparams:otherQueryParam}); Object.assign(arg,{viewparams:otherQueryParam});
} }
......
此差异已折叠。
...@@ -909,4 +909,26 @@ export default class EntityService { ...@@ -909,4 +909,26 @@ export default class EntityService {
return Http.getInstance().post(`/${this.APPDENAME}/${data[this.APPDEKEY]}/testuserexistworklist`,requestData,isloading); return Http.getInstance().post(`/${this.APPDENAME}/${data[this.APPDEKEY]}/testuserexistworklist`,requestData,isloading);
} }
/**
* 获取所有应用数据
*
* @param context
* @param data
* @param isloading
*/
public async getAllApp(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`uaa/access-center/app-switcher/default`,data,isloading);
}
/**
* 更新已选择的应用
*
* @param context
* @param data
* @param isloading
*/
public async updateChooseApp(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().put(`uaa/access-center/app-switcher/default`,data,isloading);
}
} }
\ No newline at end of file
...@@ -132,13 +132,16 @@ export class Interceptors { ...@@ -132,13 +132,16 @@ export class Interceptors {
* @memberof Interceptors * @memberof Interceptors
*/ */
private doNoLogin(data: any = {}): void { private doNoLogin(data: any = {}): void {
// 清除user和token // 清除user、token和cookie
if(localStorage.getItem('user')){ if(localStorage.getItem('user')){
localStorage.removeItem('user'); localStorage.removeItem('user');
} }
if(localStorage.getItem('token')){ if(localStorage.getItem('token')){
localStorage.removeItem('token'); localStorage.removeItem('token');
} }
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
if (data.loginurl && !Object.is(data.loginurl, '') && data.originurl && !Object.is(data.originurl, '')) { if (data.loginurl && !Object.is(data.loginurl, '') && data.originurl && !Object.is(data.originurl, '')) {
let _url = encodeURIComponent(encodeURIComponent(window.location.href)); let _url = encodeURIComponent(encodeURIComponent(window.location.href));
let loginurl: string = data.loginurl; let loginurl: string = data.loginurl;
......
...@@ -99,6 +99,7 @@ export class ViewTool { ...@@ -99,6 +99,7 @@ export class ViewTool {
let routePath: string = ''; let routePath: string = '';
let [arg] = args; let [arg] = args;
arg = arg ? arg : {}; arg = arg ? arg : {};
if(deResParameters && deResParameters.length >0){
deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => { deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
let value:any = null; let value:any = null;
if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) { if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) {
...@@ -108,6 +109,7 @@ export class ViewTool { ...@@ -108,6 +109,7 @@ export class ViewTool {
} }
routePath = `${routePath}/${pathName}/${value}`; routePath = `${routePath}/${pathName}/${value}`;
}); });
}
return routePath; return routePath;
} }
...@@ -124,6 +126,7 @@ export class ViewTool { ...@@ -124,6 +126,7 @@ export class ViewTool {
public static getActiveRoutePath(parameters: any[], args: any[], data: any): string { public static getActiveRoutePath(parameters: any[], args: any[], data: any): string {
let routePath: string = ''; let routePath: string = '';
// 不存在应用实体 // 不存在应用实体
if(parameters && parameters.length >0){
if (parameters.length === 1) { if (parameters.length === 1) {
const [{ pathName, parameterName }] = parameters; const [{ pathName, parameterName }] = parameters;
routePath = `/${pathName}`; routePath = `/${pathName}`;
...@@ -141,6 +144,7 @@ export class ViewTool { ...@@ -141,6 +144,7 @@ export class ViewTool {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`; routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
} }
} }
}
return routePath; return routePath;
} }
......
...@@ -99,6 +99,9 @@ export default class ControlService { ...@@ -99,6 +99,9 @@ export default class ControlService {
} }
let dataItems: any[] = model.getDataItems(); let dataItems: any[] = model.getDataItems();
let requestData:any = {}; let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{ dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){ if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){ if(item && item.prop && item.name ){
...@@ -110,9 +113,6 @@ export default class ControlService { ...@@ -110,9 +113,6 @@ export default class ControlService {
} }
} }
}); });
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){ if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid; tempContext.srfsessionkey = tempContext.srfsessionid;
......
...@@ -5181,10 +5181,10 @@ human-signals@^1.1.1: ...@@ -5181,10 +5181,10 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
ibiz-gantt-elastic@^1.0.16: ibiz-gantt-elastic@^1.0.17:
version "1.0.16" version "1.0.17"
resolved "https://registry.npm.taobao.org/ibiz-gantt-elastic/download/ibiz-gantt-elastic-1.0.16.tgz#e2de7e8d4bdb3c292cfbc97c4f970c8ecfe6c43b" resolved "https://registry.yarnpkg.com/ibiz-gantt-elastic/-/ibiz-gantt-elastic-1.0.17.tgz#447cce5db2e0127d2336c20370fc251992520c6f"
integrity sha1-4t5+jUvbPCks+8l8T5cMjs/mxDs= integrity sha512-AJOYXZGM020wafn60RJLM2yKmtT2BjCpBKkZ0PONcxdqW/kCyXOqEo3c3/PBtFEkJx/8KGTayB013BOdGI1+uQ==
dependencies: dependencies:
dayjs "^1.8.16" dayjs "^1.8.16"
resize-observer-polyfill "^1.5.1" resize-observer-polyfill "^1.5.1"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册