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

ibiz4j 发布系统代码

上级 626f114c
*volumes
*target *target
.settings .settings
*node_modules *node_modules
......
## v7.0.0-alpha.11 [2020-6-21]
### Bug修复
修复标题工具栏样式遮挡bug
修复表格行编辑字段格式对齐
修复日历部件初始化压缩成一行问题
修复下拉多选组件最后一项数据无法删除
### 功能新增及优化
#### 模板
新增支持表单、表格新建默认值(当前时间)
新增行编辑浮点数精度格式化
新增首页面包屑导航模式
新增编辑视图第一条记录、上一条记录、下一条记录、最后一条记录界面行为
优化面板和多数据部件数据流向
优化表单在模态打开模式中padding样式
优化嵌入视图中工具栏消息数量提示样式
优化动态导航视图树样式
#### 基础文件
新增行编辑浮点数精度格式化
## v7.0.0-alpha.10 [2020-6-18]
### Bug修复
分页导航视图页面刷新bug
表单项更新,实体行为调用不到bug
关系界面子界面保存不触发父界面保存
表单样式调整
### 功能新增及优化
#### 模板
表格操作列只显示图标时显示tooltip
门户部件高度为0时自适应
面板和多数据部件数据流向
列表,数据视图保存功能
门户部件标题界面行为tooltip
新增面包屑、应用切换器组件
#### 基础文件
formitem样式调整,label适配位置
表格行编辑切换,app-picker不显示
文件上传下载参数格式处理
## v7.0.0-alpha.9 [2020-6-11] ## v7.0.0-alpha.9 [2020-6-11]
### Bug修复 ### Bug修复
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"file-saver": "^2.0.2", "file-saver": "^2.0.2",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"ibiz-gantt-elastic": "^1.0.17", "ibiz-gantt-elastic": "^1.0.17",
"ibiz-vue-lib": "^0.1.10", "ibiz-vue-lib": "^0.1.13",
"interactjs": "^1.9.4", "interactjs": "^1.9.4",
"moment": "^2.24.0", "moment": "^2.24.0",
"path-to-regexp": "^6.1.0", "path-to-regexp": "^6.1.0",
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
"@vue/cli-service": "^4.1.0", "@vue/cli-service": "^4.1.0",
"@vue/test-utils": "1.0.0-beta.29", "@vue/test-utils": "1.0.0-beta.29",
"axios-mock-adapter": "^1.17.0", "axios-mock-adapter": "^1.17.0",
"compression-webpack-plugin": "^4.0.0",
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
......
...@@ -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 AppHeaderMenus from './components/app-header-menus/app-header-menus.vue' import AppHeaderMenus from './components/app-header-menus/app-header-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'
...@@ -71,14 +68,14 @@ import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file ...@@ -71,14 +68,14 @@ import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file
import ContextMenu from './components/context-menu/context-menu' import ContextMenu from './components/context-menu/context-menu'
import AppColumnFormat from './components/app-column-format/app-column-format.vue' import AppColumnFormat from './components/app-column-format/app-column-format.vue'
import AppQuickGroup from './components/app-quick-group/app-quick-group.vue' import AppQuickGroup from './components/app-quick-group/app-quick-group.vue'
import AppOrgSelect from './components/app-org-select/app-org-select.vue' import AppGroupPicker from './components/app-group-picker/app-group-picker.vue'
import AppDepartmentSelect from './components/app-department-select/app-department-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 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'
import AppOrgSelect from './components/app-org-select/app-org-select.vue'
import AppDepartmentSelect from './components/app-department-select/app-department-select.vue'
import AppGroupSelect from './components/app-group-select/app-group-select.vue'
// 全局挂载UI实体服务注册中心 // 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister; window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载功能服务注册中心 // 全局挂载功能服务注册中心
...@@ -115,7 +112,7 @@ export const AppComponents = { ...@@ -115,7 +112,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 +137,7 @@ export const AppComponents = { ...@@ -140,7 +137,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 +147,7 @@ export const AppComponents = { ...@@ -150,7 +147,7 @@ export const AppComponents = {
v.component('app-debug-actions', AppDebugActions); v.component('app-debug-actions', AppDebugActions);
v.component('app-header-menus', AppHeaderMenus); v.component('app-header-menus', AppHeaderMenus);
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);
...@@ -160,10 +157,11 @@ export const AppComponents = { ...@@ -160,10 +157,11 @@ export const AppComponents = {
v.component('app-quick-group',AppQuickGroup); v.component('app-quick-group',AppQuickGroup);
v.component('app-org-select',AppOrgSelect); v.component('app-org-select',AppOrgSelect);
v.component('app-department-select',AppDepartmentSelect); v.component('app-department-select',AppDepartmentSelect);
v.component('ibiz-group-select',IBizGroupSelect); v.component('app-group-select',AppGroupSelect);
v.component('ibiz-group-picker',IBizGroupPicker); v.component('app-group-picker',AppGroupPicker);
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="isShowSelected(item)">
<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>
</el-breadcrumb-item> </dropdown-menu>
</dropdown>
</span>
</span>
<a v-else @click.prevent="handleLink(item)">{{ item.title }}</a>
</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);
@Prop() public defPSAppView: any; //默认视图 /**
* 默认视图标识
*
* @memberof Breadcrumb
*/
@Prop() public indexViewTag!: string;
/**
* 导航模式
*
* @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,99 @@ export default class Breadcrumb extends Vue { ...@@ -58,24 +111,99 @@ export default class Breadcrumb extends Vue {
* @memberof Breadcrumb * @memberof Breadcrumb
*/ */
private getBreadcrumb() { private getBreadcrumb() {
this.breadcrumbs = this.$route.matched.filter((item) => { if(Object.is(this.navModel,"route")){
this.breadcrumbs = this.navDataService.getNavData();
this.$forceUpdate();
}else{
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) {
this.$router.push(item).catch(err => { if(Object.is(this.navModel,"route")){
console.warn(err); // 首页
}); 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 => {
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();
}
}
/**
* 是否显示下拉列表
*
* @memberof Breadcrumb
*/
public isShowSelected(item:any){
return item.isselected && !this.$util.isEmpty(item.srfkey);
}
} }
</script> </script>
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<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';
@Component({ @Component({
}) })
export default class AppDepartmentSelect extends Vue { export default class AppDepartmentSelect extends Vue {
......
...@@ -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,9 +8,12 @@ ...@@ -7,9 +8,12 @@
} }
} }
} }
>.ivu-card-extra { >.ivu-card-extra {
.item-extract-mode { .item-extract-mode {
display: flex; display: flex;
.item { .item {
margin-left: 12px; margin-left: 12px;
} }
...@@ -18,6 +22,7 @@ ...@@ -18,6 +22,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 +30,12 @@ ...@@ -25,9 +30,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'"
...@@ -87,17 +87,17 @@ ...@@ -87,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>
......
.app-form-item { .app-form-item {
// margin-bottom: 16px; height: 100%;
>.ivu-form-item-label { .editor {
text-decoration: none; height: 100%;
display: block; .ivu-form-item-content {
overflow: hidden; height: 100%;
white-space: nowrap; min-height: 36px;
} }
>.ivu-form-item-content { }
min-height: 36px; .app-form-item-label {
} padding: 6px 10px 6px 0px;
}
} }
.app-form-item-label-top {
>.ivu-form-item-label { .app-form-item.label-top, .app-form-item.label-bottom {
float: none; .app-form-item-label {
display: inline-block; display: block;
padding: 0 0 10px; }
}
} }
.app-form-item-label-left{ .app-form-item.label-left, .app-form-item.label-right {
.app-form-item-label{ .app-form-item-label, .editor {
float: left; height: 100%;
text-align: right;
padding-right: 12px;
} }
} }
.app-form-item-label-right{
.app-form-item-label{ .app-form-item.label-left {
float: right; .app-form-item-label {
text-align: left; float: left;
padding-left: 12px; text-align: right;
} }
} }
.app-form-item-label-top{
.app-form-item-label{ .app-form-item.label-right {
display: block; .app-form-item-label {
padding-bottom: 10px; float: right;
padding: 6px 0px 6px 10px;
} }
} }
.app-form-item-label-bottom{
.app-form-item-label{ .app-form-item.label-none {
display: block; .app-form-item-label {
padding-top: 10px; display: none !important;
} }
} }
\ No newline at end of file
<template> <template>
<div> <div :class="classes">
<div v-if="this.uiStyle === 'STYLE2'"> <template v-if="this.uiStyle === 'STYLE2'">
<app-form-item2 <app-form-item2
:caption="caption" :caption="caption"
:labelStyle="labelStyle" :labelStyle="labelStyle"
:error="error" :error="error"
...@@ -14,248 +14,261 @@ ...@@ -14,248 +14,261 @@
:itemRules="itemRules"> :itemRules="itemRules">
<slot></slot> <slot></slot>
</app-form-item2> </app-form-item2>
</div> </template>
<div v-if="this.uiStyle !== 'STYLE2'"> <template v-if="this.uiStyle !== 'STYLE2'">
<form-item <div
:prop="name" v-if="Object.is(this.labelPos,'BOTTOM') || Object.is(this.labelPos,'NONE') || !this.labelPos"
:error="error" class="editor"
:required="required" :style="slotstyle"
:rules="rules" >
:class="classes"> <form-item :prop="name" :error="error" :required="required" :rules="rules">
<div v-if="Object.is(this.labelPos,'BOTTOM') || Object.is(this.labelPos,'NONE') || !this.labelPos" class="slot-editor" :style="slotstyle">
<slot></slot> <slot></slot>
</div> </form-item>
<span v-if="!Object.is(this.labelPos,'NONE') && this.isShowCaption && this.labelWidth > 0" :style="labelstyle" :class="labelclasses"> </div>
{{this.isEmptyCaption ? '' : this.caption}} <span
</span> v-if="!Object.is(this.labelPos,'NONE') && this.isShowCaption && this.labelWidth > 0"
<div v-if="Object.is(this.labelPos,'TOP') || Object.is(this.labelPos,'LEFT') || Object.is(this.labelPos,'RIGHT')" class="slot-editor" :style="slotstyle"> :style="labelstyle"
:class="labelclasses"
>
<span v-if="required" style="color:red;">* </span>
{{this.isEmptyCaption ? '' : this.caption}}
</span>
<div
v-if="Object.is(this.labelPos,'TOP') || Object.is(this.labelPos,'LEFT') || Object.is(this.labelPos,'RIGHT')"
class="editor"
:style="slotstyle"
>
<form-item :prop="name" :error="error" :required="required" :rules="rules">
<slot></slot> <slot></slot>
</div> </form-item>
</form-item> </div>
</div> </template>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppFormItem extends Vue { export default class AppFormItem extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public caption!: string;
/** /**
* 名称 * 错误信息
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public caption!: string; @Prop() public error?: string;
/**
* 错误信息
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public error?: string;
/** /**
* label样式 * label样式
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public labelStyle?: string; @Prop() public labelStyle?: string;
/** /**
* 标签位置 * 标签位置
* *
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')} * @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public labelPos?: string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP'; @Prop() public labelPos?:
| string
| "BOTTOM"
| "LEFT"
| "NONE"
| "RIGHT"
| "TOP";
/** /**
* 标签宽度 * 标签宽度
* *
* @type {number} * @type {number}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop({}) public labelWidth!: number; @Prop({}) public labelWidth!: number;
/** /**
* 是否显示标题 * 是否显示标题
* *
* @type {boolean} * @type {boolean}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public isShowCaption?: boolean; @Prop() public isShowCaption?: boolean;
/** /**
* 标签是否空白 * 标签是否空白
* *
* @type {boolean} * @type {boolean}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public isEmptyCaption?: boolean; @Prop() public isEmptyCaption?: boolean;
/** /**
* 表单项名称 * 表单项名称
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 内置样式 * 内置样式
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public uiStyle?: string; @Prop() public uiStyle?: string;
/** /**
* 表单项值规则 * 表单项值规则
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public itemRules!: any; @Prop() public itemRules!: any;
/** /**
* 值规则数组 * 值规则数组
* *
* @type {any[]} * @type {any[]}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
public rules: any[] = []; public rules: any[] = [];
/** /**
* 是否必填 * 是否必填
* *
* @type {boolean} * @type {boolean}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
public required: boolean = false; public required: boolean = false;
/** /**
* 表单项值规则监控 * 表单项值规则监控
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Watch('itemRules',{deep:true}) @Watch("itemRules", { deep: true })
onItemRulesChange(newVal: any, oldVal: any) { onItemRulesChange(newVal: any, oldVal: any) {
if (newVal) { if (newVal) {
try { try {
this.rules = []; this.rules = [];
const _rules: any[] = newVal; const _rules: any[] = newVal;
this.rules = [..._rules]; this.rules = [..._rules];
this.rules.some((rule: any) => { this.rules.some((rule: any) => {
if (rule.hasOwnProperty('required')) { if (rule.hasOwnProperty("required")) {
this.required = rule.required; this.required = rule.required;
return true; return true;
} }
return false; return false;
}); });
} catch (error) { } catch (error) {}
}
}
} }
}
/** /**
* 计算样式 * 计算样式
* *
* @readonly * @readonly
* @type {string []} * @type {string []}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get classes(): string[] { get classes(): string[] {
let posClass = ''; let posClass = "";
switch (this.labelPos) { switch (this.labelPos) {
case 'TOP': case "TOP":
posClass = 'app-form-item-label-top'; posClass = "label-top";
break; break;
case 'LEFT': case "LEFT":
posClass = 'app-form-item-label-left'; posClass = "label-left";
break; break;
case 'BOTTOM': case "BOTTOM":
posClass = 'app-form-item-label-bottom'; posClass = "label-bottom";
break; break;
case 'RIGHT': case "RIGHT":
posClass = 'app-form-item-label-right'; posClass = "label-right";
break; break;
case 'NONE': case "NONE":
posClass = 'app-form-item-label-none'; posClass = "label-none";
break; break;
}
return [
'app-form-item',
posClass
];
} }
return [ "app-form-item", posClass ];
}
/** /**
* label样式 * label样式
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get labelclasses():string{ get labelclasses(): string {
return this.labelStyle?this.labelStyle+' app-form-item-label':'app-form-item-label'; return this.labelStyle
} ? this.labelStyle + " app-form-item-label"
: "app-form-item-label";
}
/** /**
* label行内样式 * label行内样式
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get labelstyle():any{ get labelstyle(): any {
return {width:this.labelWidth+'px'}; if (Object.is(this.labelPos, 'LEFT') || Object.is(this.labelPos, 'RIGHT')) {
return { width: this.labelWidth + "px" };
} }
}
/** /**
* slot行内样式 * slot行内样式
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get slotstyle():any{ get slotstyle(): any {
if(Object.is(this.labelPos,'LEFT')){ if (Object.is(this.labelPos, "LEFT")) {
return {marginLeft:this.labelWidth+'px'}; return { marginLeft: this.labelWidth + "px" };
}else if(Object.is(this.labelPos,'RIGHT')){ } else if (Object.is(this.labelPos, "RIGHT")) {
return {marginRight:this.labelWidth+'px'}; return { marginRight: this.labelWidth + "px" };
}
} }
}
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof AppFormItem * @memberof AppFormItem
*/ */
public mounted() { public mounted() {
if (this.itemRules) { if (this.itemRules) {
try { try {
const _rules: any[] = this.itemRules; const _rules: any[] = this.itemRules;
this.rules = [..._rules]; this.rules = [..._rules];
this.rules.some((rule: any) => { this.rules.some((rule: any) => {
if (rule.hasOwnProperty('required')) { if (rule.hasOwnProperty("required")) {
this.required = rule.required; this.required = rule.required;
return true; return true;
} }
return false; return false;
}); });
} catch (error) { } catch (error) {}
}
}
} }
}
} }
</script> </script>
<style lang='less'> <style lang='less'>
@import './app-form-item.less'; @import "./app-form-item.less";
</style> </style>
\ No newline at end of file
...@@ -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;
} }
} }
} }
......
<template>
<div class="ibiz-group-picker">
<div class="ibiz-group-container">
<div v-if="showTree" class="ibiz-group-tree">
<ibiz-select-tree :NodesData="treeItems" v-model="treeSelectVal" :treeOnly="true" :defaultChecked="true" @select="treeSelect"></ibiz-select-tree>
</div>
<div class="ibiz-group-content">
<ibiz-group-card :data="cardItems" text="label" value="id" groupName="group" :multiple="multiple" :defaultSelect="cardSelctVal" @select="groupSelect"></ibiz-group-card>
</div>
</div>
<div class="ibiz-group-footer">
<el-button size="small" type="primary" @click="onOK">确认</el-button>
<el-button size="small" @click="onCancel">取消</el-button>
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { Http } from '../../utils';
@Component({})
export default class AppGroupPicker extends Vue {
/**
* 视图上下文参数
*
* @type {*}
* @memberof AppGroupPicker
*/
@Prop() viewdata: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppGroupPicker
*/
@Prop() viewparam: any;
/**
* 多选
*
* @type {*}
* @memberof AppGroupPicker
*/
protected multiple: boolean = false;
/**
* 加载树url
*
* @type {*}
* @memberof AppGroupPicker
*/
protected treeurl:any;
/**
* 加载人员url
*
* @type {*}
* @memberof AppGroupPicker
*/
protected url:any;
/**
* 树数据集
*
* @type {*}
* @memberof AppGroupPicker
*/
protected treeItems: any[] = [];
/**
* 分组表数据集
*
* @type {*}
* @memberof AppGroupPicker
*/
protected cardItems: any[] = [];
/**
* 视图上下文参数对象
*
* @type {*}
* @memberof AppGroupPicker
*/
protected viewData: any;
/**
* 视图参数对象
*
* @type {*}
* @memberof AppGroupPicker
*/
protected viewParam: any;
/**
* 树选中值
*
* @type {*}
* @memberof AppGroupPicker
*/
protected treeSelectVal: string = '';
/**
* 分组表选中集合
*
* @type {*}
* @memberof AppGroupPicker
*/
protected cardSelctVal: any = [];
/**
* 数据选中集合
*
* @type {*}
* @memberof AppGroupPicker
*/
protected selects: any[] = [];
/**
* 是否显示树
*
* @type {*}
* @memberof AppGroupPicker
*/
get showTree() {
if(this.viewParam) {
return this.viewParam.showtree;
}
}
/**
* 生命周期
*
* @type {*}
* @memberof AppGroupPicker
*/
public created() {
if(!this.viewdata || !this.viewparam) {
return;
}
this.viewData = JSON.parse(this.viewdata);
this.viewParam = JSON.parse(this.viewparam);
this.multiple = this.viewParam.multiple;
this.treeurl = this.viewParam.treeurl;
this.url = this.viewParam.url;
if (this.viewParam.selects) {
this.viewParam.selects.forEach((select: any) => {
this.selects.push(select);
this.cardSelctVal.push(select.id)
})
}
this.load();
}
/**
* 加载数据
*
* @type {*}
* @memberof AppGroupPicker
*/
public load() {
if(this.showTree) {
this.loadTree();
} else {
this.loadGroupData(this.viewParam.filtervalue);
}
}
/**
* 加载树数据
*
* @type {*}
* @memberof AppGroupPicker
*/
public loadTree() {
let orgid = this.viewParam.filtervalue;
let tempTreeUrl:string = this.treeurl.replace('${orgid}',orgid);
let get = Http.getInstance().get(tempTreeUrl, true);
get.then((response: any) => {
if(response.status === 200) {
this.treeItems = response.data;
}
}).catch((error: any) => {
console.log(error)
})
}
/**
* 加载分组表数据
*
* @type {*}
* @memberof AppGroupPicker
*/
public loadGroupData(key: string) {
let tempUrl = this.url.replace('${selected-orgid}',key);
let get = Http.getInstance().get(tempUrl, true);
get.then((response: any) => {
if(response.status === 200) {
this.cardItems = response.data;
}
}).catch((error: any) => {
console.log(error)
})
}
/**
* 树选中
*
* @type {*}
* @memberof AppGroupPicker
*/
public treeSelect(event: any) {
if(!event || JSON.parse(event).length == 0) {
return;
}
const items: any = JSON.parse(event);
this.loadGroupData(items[0].id);
}
/**
* 分组表选中
*
* @type {*}
* @memberof AppGroupPicker
*/
public groupSelect(event: any) {
if (!event || !event.select) {
return;
}
if(!this.multiple) {
this.selects = [];
}
if(event.rselect) {
let index: number = this.selects.findIndex((item: any) => Object.is(event.rselect, item.id));
if(index >= 0) {
this.selects.splice(index, 1);
}
} else {
event.select.forEach((key: string) => {
let index: number = this.selects.findIndex((item: any) => Object.is(key, item.id));
if(index >= 0) {
return;
}
let item: any = this.cardItems.find((item: any) => Object.is(key, item.id));
if (item) {
this.selects.push(item);
}
});
}
}
/**
* 确认
*
* @type {*}
* @memberof AppGroupPicker
*/
public onOK() {
this.$emit('close', this.selects);
}
/**
* 取消
*
* @type {*}
* @memberof AppGroupPicker
*/
public onCancel() {
this.$emit('close');
}
}
</script>
<style lang="less">
.ibiz-group-picker{
width: 100%;
height: 100%;
.ibiz-group-container {
display: flex;
height: calc(100% - 65px);
.ibiz-group-tree {
min-width: 200px;
border-right: 1px solid #ddd;
padding: 0 34px 0 10px;
overflow: auto;
height: 100%;
}
.ibiz-group-content {
flex-grow: 1;
padding: 0 10px;
overflow: auto;
height: 100%;
}
}
.ibiz-group-footer {
padding: 16px;
text-align: right;
border-top: 1px solid #ddd;
}
}
</style>
\ No newline at end of file
<template>
<div class="ibiz-group-select">
<div class="ibiz-group-content">
<span v-if="!multiple">
{{ selectName }}
</span>
<template v-else v-for="(select, index) of selects">
<div :key="index" class="ibiz-group-item">
{{ select.label }}
<i v-if="!disabled" class="el-icon-close" @click="remove(select)"></i>
</div>
</template>
</div>
<div v-if="!disabled" class="ibiz-group-open">
<i v-if="!disabled && !multiple && selects.length > 0" class="el-icon-close" @click="remove(selects[0])"></i>
<i class="el-icon-search" @click="openView"></i>
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
@Component({})
export default class AppGroupSelect extends Vue {
/**
* 名称标识
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() name!: string;
/**
* 树加载地址
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() treeurl?:boolean;
/**
* 数据接口地址
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() url!: string;
/**
* 多选
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop({default: false}) multiple?: boolean;
/**
* 数据对象
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() data: any;
/**
* 过滤属性标识
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() filter?: string;
/**
* 是否启用
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() disabled?: boolean;
/**
* 值
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() value: any;
/**
* 上下文参数
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() context: any;
/**
* 关联属性
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() valueitem: any;
/**
* 填充属性
*
* @type {*}
* @memberof AppGroupSelect
*/
@Prop() fillmap: any;
/**
* 选中项集合
*
* @type {*}
* @memberof AppGroupSelect
*/
protected selects: any[] = [];
/**
* 值变化
*
* @type {*}
* @memberof AppGroupSelect
*/
@Watch('value')
onValueChange(newVal: any) {
this.selects = [];
if (newVal) {
let item: any = {};
item.label = newVal.split(',');
if(this.valueitem) {
item.id = this.data[this.valueitem] ? this.data[this.valueitem].split(',') : [];
}
if(this.fillmap) {
for(let key in this.fillmap) {
item[this.fillmap[key]] = this.data[key] ? this.data[key].split(',') : [];
}
}
item.label.forEach((val: string, index: number) => {
let _item: any = {};
for(let key in item) {
_item[key] = item[key][index] ? item[key][index] : null;
}
this.selects.push(_item)
})
}
}
/**
* 单选时选中名称
*
* @type {*}
* @memberof AppGroupSelect
*/
get selectName() {
if(this.selects.length > 0) {
return this.selects[0].label;
}
}
/**
* 打开选择视图
*
* @type {*}
* @memberof AppGroupSelect
*/
public openView() {
const view: any = {
viewname: 'app-group-picker',
title: '分组选择'
};
const context: any = JSON.parse(JSON.stringify(this.context));
let filtervalue:string = "";
if(this.filter){
if(this.data[this.filter]){
filtervalue = this.data[this.filter];
}else if(context[this.filter]){
filtervalue = context[this.filter];
}else{
filtervalue = context.srforgid;
}
}else{
filtervalue = context.srforgid;
}
const param: any = {};
Object.assign(param, {
showtree: this.treeurl?true:false,
url:this.url,
treeurl:this.treeurl,
filtervalue: filtervalue,
multiple: this.multiple,
selects: this.selects
});
let container: Subject<any> = this.$appmodal.openModal(view, context, param);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
this.openViewClose(result);
});
}
/**
* 选择视图关闭
*
* @type {*}
* @memberof AppGroupSelect
*/
public openViewClose(result: any) {
this.selects = [];
if (result.datas && result.datas.length > 0) {
this.selects = result.datas
}
this.setValue()
}
/**
* 数据删除
*
* @type {*}
* @memberof AppGroupSelect
*/
public remove(item: any) {
this.selects.splice(this.selects.indexOf(item), 1);
this.setValue()
}
/**
* 设置值
*
* @type {*}
* @memberof AppGroupSelect
*/
public setValue() {
let item: any = {};
item[this.name] = null;
if(this.valueitem) {
item[this.valueitem] = null;
}
if(this.fillmap) {
for(let key in this.fillmap) {
item[key] = null;
}
}
if(this.multiple) {
this.selects.forEach((select: any) => {
item[this.name] = item[this.name] ? `${item[this.name]},${select.label}` : select.label;
if(this.valueitem) {
item[this.valueitem] = item[this.valueitem] ? `${item[this.valueitem]},${select.id}` : select.id;
}
if(this.fillmap) {
for(let key in this.fillmap) {
item[key] = item[key] ? `${item[key]},${select[this.fillmap[key]]}` : select[this.fillmap[key]];
}
}
});
} else {
item = this.selects.length > 0 ? this.selects[0] : {};
item[this.name] = this.selects.length > 0 ? this.selects[0].label : null;
if(this.valueitem) {
item[this.valueitem] = this.selects.length > 0 ? this.selects[0].id : null;
}
if(this.fillmap) {
for(let key in this.fillmap) {
item[key] = this.selects.length > 0 ? this.selects[0][this.fillmap[key]] : null;
}
}
}
for(let key in item) {
this.$emit('formitemvaluechange', { name: key, value: item[key] });
}
}
}
</script>
<style lang="less">
.ibiz-group-select {
width: 100%;
display: flex;
border: 1px solid #DCDFE6;
min-height: 32px;
border-radius: 4px;
.ibiz-group-content {
flex-grow: 1;
padding: 0 16px;
.ibiz-group-item {
display: inline-block;
border: 1px solid #bbb;
line-height: 24px;
border-radius: 5px;
margin-right: 5px;
padding: 0 5px;
}
}
.ibiz-group-open {
display: flex;
text-align: center;
align-items: center;
padding: 0 5px;
}
}
.ibiz-group-select:hover {
border-color: #108cee;
}
</style>
\ No newline at end of file
...@@ -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,10 +324,10 @@ export default class AppPickerSelectView extends Vue { ...@@ -324,10 +324,10 @@ 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);
_viewparam.selectedData = this.selectItems;
this.viewparam = JSON.stringify(_viewparam);
} }
let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = this.selectItems;
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,11 +148,19 @@ export default class AppSpan extends Vue { ...@@ -148,11 +148,19 @@ 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"){
JSON.parse(this.value).forEach((item:any,index:number) => { if(this.$util.isEmpty(this.value)){
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext; this.text = '';
}); }else{
JSON.parse(this.value).forEach((item:any,index:number) => {
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext;
});
}
}else{ }else{
this.text = this.value; if(this.$util.isEmpty(this.value)){
this.text = '';
}else{
this.text = this.value;
}
} }
} }
......
...@@ -5,4 +5,7 @@ ...@@ -5,4 +5,7 @@
margin-right: 10px; margin-right: 10px;
padding: 0 5px; padding: 0 5px;
} }
}
.user-dropdownMenu{
margin-top: 9px;
} }
\ No newline at end of file
<template> <template>
<div class='app-header-user'> <div class='app-header-user'>
<dropdown @on-click="userSelect" :transfer="true"> <dropdown transfer-class-name="user-dropdownMenu" @on-click="userSelect" :transfer="true">
<div class='user'> <div class='user'>
<span>{{user.name ? user.name : $t('components.appUser.name')}}</span> <span>{{user.name ? user.name : $t('components.appUser.name')}}</span>
&nbsp;&nbsp;<avatar :src="user.avatar" /> &nbsp;&nbsp;<avatar :src="user.avatar" />
</div> </div>
<dropdown-menu class='menu' slot='list' style='font-size: 15px !important;'> <dropdown-menu class='menu' slot='list' style='font-size: 15px !important;'>
<dropdown-item name='logout' style='font-size: 15px !important;'> <dropdown-item name='logout' style='font-size: 15px !important;'>
<span><i aria-hidden='true' class='fa fa-cogs' style='margin-right: 8px;'></i></span> <span><i aria-hidden='true' class='ivu-icon ivu-icon-md-power' style='margin-right: 8px;'></i></span>
<span>{{$t('components.appUser.logout')}}</span> <span>{{$t('components.appUser.logout')}}</span>
</dropdown-item> </dropdown-item>
</dropdown-menu> </dropdown-menu>
......
.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" @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 @click="skipTo(item)" 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.stop="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 @click="skipTo(item)" 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.stop="outStar(item)">
<Icon type="ios-star" />
</span>
<span v-else class="star" @click.stop="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 {
public panelShow: boolean = true;
/**
* 抽屉菜单状态
*
* @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 skipTo(item: any){
if(item.addr){
let params: any = {};
params.model = this.selectlist;
const put: Promise<any> = this.entityService.updateChooseApp(null,params);
window.location.href = item.addr;
}else{
this.$message.info("未找到该应用");
}
}
/**
* 加入列表
*
* @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,13 +70,33 @@ export default class InputBox extends Vue { ...@@ -62,13 +70,33 @@ 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() {
return this.itemValue; if(Object.is(this.type, 'number') && this.itemValue && !isNaN(this.itemValue)){
return Number(Number(this.itemValue).toFixed(this.precision));
}else{
return this.itemValue;
}
} }
/** /**
......
...@@ -160,6 +160,10 @@ export default class Login extends Vue { ...@@ -160,6 +160,10 @@ export default class Login extends Vue {
* @memberof Login * @memberof Login
*/ */
public handleSubmit(): void { public handleSubmit(): void {
// 清除cookie
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1000);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
const form: any = this.$refs.loginForm; const form: any = this.$refs.loginForm;
let validatestate: boolean = true; let validatestate: boolean = true;
form.validate((valid: boolean) => { form.validate((valid: boolean) => {
......
...@@ -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", {
......
...@@ -103,7 +103,7 @@ export default class EditViewEngine extends ViewEngine { ...@@ -103,7 +103,7 @@ export default class EditViewEngine extends ViewEngine {
public onFormLoad(arg: any): void { public onFormLoad(arg: any): void {
this.view.model.dataInfo = Object.is(arg.srfuf, '1') ? (this.majorPSDEField?arg[this.majorPSDEField]:arg.srfmajortext) : this.view.$t('app.local.new'); this.view.model.dataInfo = Object.is(arg.srfuf, '1') ? (this.majorPSDEField?arg[this.majorPSDEField]:arg.srfmajortext) : this.view.$t('app.local.new');
this.setTabCaption(this.view.model.dataInfo); this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1'); const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata); this.calcToolbarItemState(newdata);
} }
...@@ -117,7 +117,7 @@ export default class EditViewEngine extends ViewEngine { ...@@ -117,7 +117,7 @@ export default class EditViewEngine extends ViewEngine {
public onFormSave(arg: any): void { public onFormSave(arg: any): void {
this.view.model.dataInfo = Object.is(arg.srfuf, '1') ? (this.majorPSDEField?arg[this.majorPSDEField]:arg.srfmajortext) : this.view.$t('app.local.new'); this.view.model.dataInfo = Object.is(arg.srfuf, '1') ? (this.majorPSDEField?arg[this.majorPSDEField]:arg.srfmajortext) : this.view.$t('app.local.new');
this.setTabCaption(this.view.model.dataInfo); this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1'); const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata); this.calcToolbarItemState(newdata);
this.view.$emit('save',arg); this.view.$emit('save',arg);
...@@ -245,14 +245,21 @@ export default class EditViewEngine extends ViewEngine { ...@@ -245,14 +245,21 @@ export default class EditViewEngine extends ViewEngine {
* *
* @memberof EditViewEngine * @memberof EditViewEngine
*/ */
public setTabCaption(info: string): void { public setTabCaption(info: string,isNew:boolean): 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(null,isNew);
} }
} }
......
...@@ -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});
} }
......
...@@ -6,50 +6,50 @@ import userCustom_en_US from '@locale/lanres/userCustom/userCustom_en_US'; ...@@ -6,50 +6,50 @@ import userCustom_en_US from '@locale/lanres/userCustom/userCustom_en_US';
export default { export default {
app: { app: {
commonWords:{ commonWords:{
error: 'Error', error: "Error",
success: 'Success', success: "Success",
ok: 'OK', ok: "OK",
cancel: 'Cancel', cancel: "Cancel",
}, },
local:{ local:{
new: 'New' new: "New"
}, },
gridpage: { gridpage: {
choicecolumns: 'Choice columns', choicecolumns: "Choice columns",
refresh: 'refresh', refresh: "refresh",
show: 'Show', show: "Show",
records: 'records', records: "records",
totle: 'totle', totle: "totle",
}, },
tabpage: { tabpage: {
sureclosetip: { sureclosetip: {
title: 'Close warning', title: "Close warning",
content: 'Form data Changed, are sure close?', content: "Form data Changed, are sure close?",
}, },
closeall: 'Close all', closeall: "Close all",
closeother: 'Close other', closeother: "Close other",
}, },
fileUpload: { fileUpload: {
caption: 'Upload', caption: "Upload",
}, },
searchButton: { searchButton: {
search: 'Search', search: "Search",
reset: 'Reset', reset: "Reset",
}, },
calendar:{ calendar:{
today: 'today', today: "today",
month: 'month', month: "month",
week: 'week', week: "week",
day: 'day', day: "day",
list: 'list', list: "list",
dateSelectModalTitle: 'select the time you wanted', dateSelectModalTitle: "select the time you wanted",
gotoDate: 'goto', gotoDate: "goto",
}, },
// 非实体视图 // 非实体视图
views: { views: {
sdindexview: { sdindexview: {
caption: 'ibizlab-disk', caption: "ibizlab-disk",
title: 'ibizlab-disk', title: "ibizlab-disk",
}, },
}, },
utilview:{ utilview:{
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
}, },
menus: { menus: {
sdindexview: { sdindexview: {
menuitem1: '文件', menuitem1: "文件",
}, },
}, },
}, },
......
...@@ -6,50 +6,50 @@ import userCustom_zh_CN from '@locale/lanres/userCustom/userCustom_zh_CN'; ...@@ -6,50 +6,50 @@ import userCustom_zh_CN from '@locale/lanres/userCustom/userCustom_zh_CN';
export default { export default {
app: { app: {
commonWords:{ commonWords:{
error: '失败', error: "失败",
success: '成功', success: "成功",
ok: '确认', ok: "确认",
cancel: '取消', cancel: "取消",
}, },
local:{ local:{
new: '新建' new: "新建"
}, },
gridpage: { gridpage: {
choicecolumns: '选择列', choicecolumns: "选择列",
refresh: '刷新', refresh: "刷新",
show: '显示', show: "显示",
records: '条', records: "条",
totle: '共', totle: "共",
}, },
tabpage: { tabpage: {
sureclosetip: { sureclosetip: {
title: '关闭提醒', title: "关闭提醒",
content: '表单数据已经修改,确定要关闭?', content: "表单数据已经修改,确定要关闭?",
}, },
closeall: '关闭所有', closeall: "关闭所有",
closeother: '关闭其他', closeother: "关闭其他",
}, },
fileUpload: { fileUpload: {
caption: '上传', caption: "上传",
}, },
searchButton: { searchButton: {
search: '搜索', search: "搜索",
reset: '重置', reset: "重置",
}, },
calendar:{ calendar:{
today: '今天', today: "今天",
month: '月', month: "月",
week: '周', week: "周",
day: '天', day: "天",
list: '列', list: "列",
dateSelectModalTitle: '选择要跳转的时间', dateSelectModalTitle: "选择要跳转的时间",
gotoDate: '跳转', gotoDate: "跳转",
}, },
// 非实体视图 // 非实体视图
views: { views: {
sdindexview: { sdindexview: {
caption: 'ibizlab-disk', caption: "ibizlab-disk",
title: 'ibizlab-disk', title: "ibizlab-disk",
}, },
}, },
utilview:{ utilview:{
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
}, },
menus: { menus: {
sdindexview: { sdindexview: {
menuitem1: '文件', menuitem1: "文件",
}, },
}, },
}, },
......
export default { export default {
SysOperator: { SysOperator: {
empty: '', "empty": "",
}, },
}; };
\ No newline at end of file
export default { export default {
SysOperator: { SysOperator: {
empty: '', "empty": "",
}, },
}; };
\ No newline at end of file
...@@ -3,11 +3,11 @@ export default { ...@@ -3,11 +3,11 @@ export default {
views: { views: {
gridview: { gridview: {
caption: "文件", caption: "文件",
title: '文件表格视图', title: "文件表格视图",
}, },
editview: { editview: {
caption: "文件", caption: "文件",
title: '文件编辑视图', title: "文件编辑视图",
}, },
}, },
main_form: { main_form: {
......
export default { export default {
views: { views: {
gridview: { gridview: {
caption: '文件', caption: "文件",
title: '文件表格视图', title: "文件表格视图",
}, },
editview: { editview: {
caption: '文件', caption: "文件",
title: '文件编辑视图', title: "文件编辑视图",
}, },
}, },
main_form: { main_form: {
details: { details: {
group1: '文件基本信息', group1: "文件基本信息",
formpage1: '基本信息', formpage1: "基本信息",
srfupdatedate: '更新时间', srfupdatedate: "更新时间",
srforikey: '', srforikey: "",
srfkey: '标识', srfkey: "标识",
srfmajortext: '名称', srfmajortext: "名称",
srftempmode: '', srftempmode: "",
srfuf: '', srfuf: "",
srfdeid: '', srfdeid: "",
srfsourcekey: '', srfsourcekey: "",
filename: '名称', filename: "名称",
filepath: '路径', filepath: "路径",
filesize: '文件大小', filesize: "文件大小",
fileext: '扩展名', fileext: "扩展名",
folder: '特定目录', folder: "特定目录",
digestcode: '签名', digestcode: "签名",
ownerid: '所属主体', ownerid: "所属主体",
ownertype: '所属类型', ownertype: "所属类型",
memo: '备注', memo: "备注",
createman: '创建人', createman: "创建人",
createdate: '创建日期', createdate: "创建日期",
updateman: '更新人', updateman: "更新人",
updatedate: '更新时间', updatedate: "更新时间",
fileid: '标识', fileid: "标识",
}, },
uiactions: { uiactions: {
}, },
}, },
main_grid: { main_grid: {
columns: { columns: {
fileid: '标识', fileid: "标识",
filename: '名称', filename: "名称",
filepath: '路径', filepath: "路径",
filesize: '文件大小', filesize: "文件大小",
fileext: '扩展名', fileext: "扩展名",
folder: '特定目录', folder: "特定目录",
ownertype: '所属类型', ownertype: "所属类型",
ownerid: '所属主体', ownerid: "所属主体",
createdate: '创建日期', createdate: "创建日期",
updatedate: '更新时间', updatedate: "更新时间",
}, },
uiactions: { uiactions: {
}, },
}, },
default_searchform: { default_searchform: {
details: { details: {
formpage1: '常规条件', formpage1: "常规条件",
n_filename_like: '名称(文本包含(%))', n_filename_like: "名称(文本包含(%))",
}, },
uiactions: { uiactions: {
}, },
}, },
gridviewtoolbar_toolbar: { gridviewtoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: '新建', caption: "新建",
tip: '新建', tip: "新建",
}, },
tbitem4: { tbitem4: {
caption: '编辑', caption: "编辑",
tip: '编辑', tip: "编辑",
}, },
tbitem6: { tbitem6: {
caption: '拷贝', caption: "拷贝",
tip: '拷贝', tip: "拷贝",
}, },
tbitem7: { tbitem7: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem8: { tbitem8: {
caption: '删除', caption: "删除",
tip: '删除', tip: "删除",
}, },
tbitem9: { tbitem9: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem13: { tbitem13: {
caption: '导出', caption: "导出",
tip: '导出', tip: "导出",
}, },
tbitem10: { tbitem10: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem16: { tbitem16: {
caption: '其它', caption: "其它",
tip: '其它', tip: "其它",
}, },
tbitem21: { tbitem21: {
caption: '导出数据模型', caption: "导出数据模型",
tip: '导出数据模型', tip: "导出数据模型",
}, },
tbitem23: { tbitem23: {
caption: '数据导入', caption: "数据导入",
tip: '数据导入', tip: "数据导入",
}, },
tbitem17: { tbitem17: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem19: { tbitem19: {
caption: '过滤', caption: "过滤",
tip: '过滤', tip: "过滤",
}, },
tbitem18: { tbitem18: {
caption: '帮助', caption: "帮助",
tip: '帮助', tip: "帮助",
}, },
}, },
editviewtoolbar_toolbar: { editviewtoolbar_toolbar: {
tbitem3: { tbitem3: {
caption: '保存', caption: "保存",
tip: '保存', tip: "保存",
}, },
tbitem4: { tbitem4: {
caption: '保存并新建', caption: "保存并新建",
tip: '保存并新建', tip: "保存并新建",
}, },
tbitem5: { tbitem5: {
caption: '保存并关闭', caption: "保存并关闭",
tip: '保存并关闭', tip: "保存并关闭",
}, },
tbitem6: { tbitem6: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem7: { tbitem7: {
caption: '删除并关闭', caption: "删除并关闭",
tip: '删除并关闭', tip: "删除并关闭",
}, },
tbitem8: { tbitem8: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem12: { tbitem12: {
caption: '新建', caption: "新建",
tip: '新建', tip: "新建",
}, },
tbitem13: { tbitem13: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem14: { tbitem14: {
caption: '拷贝', caption: "拷贝",
tip: '拷贝', tip: "拷贝",
}, },
tbitem16: { tbitem16: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem23: { tbitem23: {
caption: '第一个记录', caption: "第一个记录",
tip: '第一个记录', tip: "第一个记录",
}, },
tbitem24: { tbitem24: {
caption: '上一个记录', caption: "上一个记录",
tip: '上一个记录', tip: "上一个记录",
}, },
tbitem25: { tbitem25: {
caption: '下一个记录', caption: "下一个记录",
tip: '下一个记录', tip: "下一个记录",
}, },
tbitem26: { tbitem26: {
caption: '最后一个记录', caption: "最后一个记录",
tip: '最后一个记录', tip: "最后一个记录",
}, },
tbitem21: { tbitem21: {
caption: '-', caption: "-",
tip: '', tip: "",
}, },
tbitem22: { tbitem22: {
caption: '帮助', caption: "帮助",
tip: '帮助', tip: "帮助",
}, },
}, },
}; };
\ No newline at end of file
...@@ -25,7 +25,7 @@ mock.onGet('v7/sdindex-viewappmenu').reply((config: any) => { ...@@ -25,7 +25,7 @@ mock.onGet('v7/sdindex-viewappmenu').reply((config: any) => {
iconcls: '', iconcls: '',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_2', appfunctag: 'Auto1',
resourcetag: '', resourcetag: '',
}, },
], ],
......
...@@ -3,92 +3,89 @@ ...@@ -3,92 +3,89 @@
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sdfileeditview"></app-studioaction> <app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sdfileeditview"></app-studioaction>
<card class='view-card ' :disHover="true" :bordered="false"> <card class='view-card ' :disHover="true" :bordered="false">
<p slot='title'> <div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfTitle)}}</span> <span class='caption-info'>{{$t(model.srfTitle)}}</span>
</p> <div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<div slot="extra"> <i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<div class='toolbar-container'> <i class='fa fa-save'></i>
<tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.caption')}}</span>
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)"> </i-button>
<i class='fa fa-save'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.caption')}}</span> </tooltip>
</i-button> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.tip')}}</div> <i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
</tooltip> <i class='sx-tb-saveandnew'></i>
<tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.caption')}}</span>
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)"> </i-button>
<i class='sx-tb-saveandnew'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.caption')}}</span> </tooltip>
</i-button> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.tip')}}</div> <i-button v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)">
</tooltip> <i class='sx-tb-saveandclose'></i>
<tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.caption')}}</span>
<i-button v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)"> </i-button>
<i class='sx-tb-saveandclose'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.caption')}}</span> </tooltip>
</i-button> <span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.tip')}}</div> <i-button v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)">
</tooltip> <i class='fa fa-remove'></i>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.caption')}}</span>
<i-button v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)"> </i-button>
<i class='fa fa-remove'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.caption')}}</span> </tooltip>
</i-button> <span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.tip')}}</div> <i-button v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)">
</tooltip> <i class='fa fa-file-text-o'></i>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.caption')}}</span>
<i-button v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)"> </i-button>
<i class='fa fa-file-text-o'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.caption')}}</span> </tooltip>
</i-button> <span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.tip')}}</div> <i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)">
</tooltip> <i class='fa fa-copy'></i>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.caption')}}</span>
<i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)"> </i-button>
<i class='fa fa-copy'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.caption')}}</span> </tooltip>
</i-button> <span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.tip')}}</div> <i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' @click="toolbar_click({ tag: 'tbitem23' }, $event)">
</tooltip> <i class='fa fa-fast-backward'></i>
<span class='seperator'>|</span> <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>
<i class='fa fa-fast-backward'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem23.tip')}}</div>
</tooltip>
</i-button> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem23.tip')}}</div> <i-button v-show="toolBarModels.tbitem24.visabled" :disabled="toolBarModels.tbitem24.disabled" class='' @click="toolbar_click({ tag: 'tbitem24' }, $event)">
</tooltip> <i class='fa fa-step-backward'></i>
<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>
<i class='fa fa-step-backward'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem24.tip')}}</div>
</tooltip>
</i-button> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem24.tip')}}</div> <i-button v-show="toolBarModels.tbitem25.visabled" :disabled="toolBarModels.tbitem25.disabled" class='' @click="toolbar_click({ tag: 'tbitem25' }, $event)">
</tooltip> <i class='fa fa-step-forward'></i>
<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>
<i class='fa fa-step-forward'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem25.tip')}}</div>
</tooltip>
</i-button> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem25.tip')}}</div> <i-button v-show="toolBarModels.tbitem26.visabled" :disabled="toolBarModels.tbitem26.disabled" class='' @click="toolbar_click({ tag: 'tbitem26' }, $event)">
</tooltip> <i class='fa fa-fast-forward'></i>
<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>
<i class='fa fa-fast-forward'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem26.tip')}}</div>
</tooltip>
</i-button> <span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem26.tip')}}</div> <i-button v-show="toolBarModels.tbitem22.visabled" :disabled="toolBarModels.tbitem22.disabled" class='' @click="toolbar_click({ tag: 'tbitem22' }, $event)">
</tooltip> <i class='fa fa-question'></i>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600"> <span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.caption')}}</span>
<i-button v-show="toolBarModels.tbitem22.visabled" :disabled="toolBarModels.tbitem22.disabled" class='' @click="toolbar_click({ tag: 'tbitem22' }, $event)"> </i-button>
<i class='fa fa-question'></i> <div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.tip')}}</div>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.caption')}}</span> </tooltip>
</i-button> </div>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.tip')}}</div> </div>
</tooltip>
</div>
</div>
<div class="content-container"> <div class="content-container">
<div class='view-top-messages'> <div class='view-top-messages'>
</div> </div>
...@@ -122,9 +119,10 @@ ...@@ -122,9 +119,10 @@
</template> </template>
<script lang='tsx'> <script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils'; import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs'; import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import SDFileService from '@/service/sdfile/sdfile-service'; import SDFileService from '@/service/sdfile/sdfile-service';
import EditViewEngine from '@engine/view/edit-view-engine'; import EditViewEngine from '@engine/view/edit-view-engine';
...@@ -190,6 +188,15 @@ export default class SDFileEditViewBase extends Vue { ...@@ -190,6 +188,15 @@ export default class SDFileEditViewBase extends Vue {
*/ */
@Prop({ default: true }) public viewDefaultUsage!: boolean; @Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof SDFileEditViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/** /**
* 视图标识 * 视图标识
* *
...@@ -365,6 +372,23 @@ export default class SDFileEditViewBase extends Vue { ...@@ -365,6 +372,23 @@ export default class SDFileEditViewBase extends Vue {
}); });
} }
/**
* 应用导航服务
*
* @type {*}
* @memberof SDFileEditViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof SDFileEditViewBase
*/
public serviceStateEvent: Subscription | undefined;
/** /**
* 应用上下文 * 应用上下文
* *
...@@ -381,13 +405,21 @@ export default class SDFileEditViewBase extends Vue { ...@@ -381,13 +405,21 @@ export default class SDFileEditViewBase extends Vue {
*/ */
public viewparams:any = {}; public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof SDFileEditViewBase
*/
public viewCacheData:any;
/** /**
* 解析视图参数 * 解析视图参数
* *
* @public * @public
* @memberof SDFileEditViewBase * @memberof SDFileEditViewBase
*/ */
public parseViewParam(): void { public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){ for(let key in this.context){
delete this.context[key]; delete this.context[key];
} }
...@@ -417,12 +449,17 @@ export default class SDFileEditViewBase extends Vue { ...@@ -417,12 +449,17 @@ export default class SDFileEditViewBase extends Vue {
}); });
}); });
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams); this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(inputvalue){
Object.assign(this.context,{'sdfile':inputvalue});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){ if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context); Object.assign(this.context,this.$store.getters.getAppData().context);
} }
//初始化视图唯一标识 //初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()}); Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData(); this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
} }
/** /**
...@@ -500,6 +537,28 @@ export default class SDFileEditViewBase extends Vue { ...@@ -500,6 +537,28 @@ export default class SDFileEditViewBase extends Vue {
} }
} }
} }
/**
* 初始化导航数据(路由模式)
*
* @memberof SDFileEditViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false){
if(this.viewDefaultUsage && Object.is(this.navModel,"route")){
this.navDataService.addNavData({id:'sdfile-edit-view',tag:this.viewtag,srfkey:isNew ? null : this.context.sdfile,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof SDFileEditViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true){
if(this.viewDefaultUsage && !Object.is(this.navModel,"route")){
this.navDataService.addNavDataByOnly({id:'sdfile-edit-view',tag:this.viewtag,srfkey:this.context.sdfile,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/** /**
...@@ -517,10 +576,24 @@ export default class SDFileEditViewBase extends Vue { ...@@ -517,10 +576,24 @@ export default class SDFileEditViewBase extends Vue {
* @memberof SDFileEditViewBase * @memberof SDFileEditViewBase
*/ */
public afterCreated(){ public afterCreated(){
const secondtag = this.$util.createUUID(); let _this:any = this;
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag }); const secondtag = _this.$util.createUUID();
this.viewtag = secondtag; _this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
this.parseViewParam(); _this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'sdfile-edit-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
} }
...@@ -1302,7 +1375,17 @@ export default class SDFileEditViewBase extends Vue { ...@@ -1302,7 +1375,17 @@ export default class SDFileEditViewBase extends Vue {
* @memberof SDFileEditViewBase * @memberof SDFileEditViewBase
*/ */
public FirstRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public FirstRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '暂不支持此项操作' }); let _this:any = this;
let navDataService:any = new NavDataService(this.$store);
let allNavData:any = Object.is(this.navModel,"route")?navDataService.getPreNavDataById('sdfile-edit-view'):navDataService.getPreNavDataByTag(_this.viewtag);
if(allNavData && allNavData.data && allNavData.data.length >0){
if(_this.parseViewParam && _this.engine){
_this.parseViewParam(allNavData.data[0].srfkey);
_this.engine.load();
}
}else{
this.$Notice.warning({ title: '警告', desc: '请确认操作路径是否正确' });
}
} }
/** /**
* 上一个记录 * 上一个记录
...@@ -1316,7 +1399,31 @@ export default class SDFileEditViewBase extends Vue { ...@@ -1316,7 +1399,31 @@ export default class SDFileEditViewBase extends Vue {
* @memberof SDFileEditViewBase * @memberof SDFileEditViewBase
*/ */
public PrevRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public PrevRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '暂不支持此项操作' }); if(args.length === 0 || !args[0].srfkey){
return;
}
let _this:any = this;
let navDataService:any = new NavDataService(this.$store);
let allNavData:any = Object.is(this.navModel,"route")?navDataService.getPreNavDataById('sdfile-edit-view'):navDataService.getPreNavDataByTag(_this.viewtag);
if(allNavData && allNavData.data && allNavData.data.length >0){
let computedIndex:any;
for(let i=0;i<allNavData.data.length;i++){
if(allNavData.data[i].srfkey === args[0].srfkey){
computedIndex = i-1;
break;
}
}
if(computedIndex >= 0){
if(_this.parseViewParam && _this.engine){
_this.parseViewParam(allNavData.data[computedIndex].srfkey);
_this.engine.load();
}
}else{
this.$Notice.warning({ title: '警告', desc: '当前数据已经是第一条数据' });
}
}else{
this.$Notice.warning({ title: '警告', desc: '请确认操作路径是否正确' });
}
} }
/** /**
...@@ -1331,7 +1438,31 @@ export default class SDFileEditViewBase extends Vue { ...@@ -1331,7 +1438,31 @@ export default class SDFileEditViewBase extends Vue {
* @memberof SDFileEditViewBase * @memberof SDFileEditViewBase
*/ */
public NextRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public NextRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '暂不支持此项操作' }); if(args.length === 0 || !args[0].srfkey){
return;
}
let _this:any = this;
let navDataService:any = new NavDataService(this.$store);
let allNavData:any = Object.is(this.navModel,"route")?navDataService.getPreNavDataById('sdfile-edit-view'):navDataService.getPreNavDataByTag(_this.viewtag);
if(allNavData && allNavData.data && allNavData.data.length >0){
let computedIndex:any;
for(let i=0;i<allNavData.data.length;i++){
if(allNavData.data[i].srfkey === args[0].srfkey){
computedIndex = i+1;
break;
}
}
if(computedIndex < allNavData.data.length){
if(_this.parseViewParam && _this.engine){
_this.parseViewParam(allNavData.data[computedIndex].srfkey);
_this.engine.load();
}
}else{
this.$Notice.warning({ title: '警告', desc: '当前数据已经是最后一条数据' });
}
}else{
this.$Notice.warning({ title: '警告', desc: '请确认操作路径是否正确' });
}
} }
/** /**
...@@ -1346,7 +1477,17 @@ export default class SDFileEditViewBase extends Vue { ...@@ -1346,7 +1477,17 @@ export default class SDFileEditViewBase extends Vue {
* @memberof SDFileEditViewBase * @memberof SDFileEditViewBase
*/ */
public LastRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public LastRecord(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '暂不支持此项操作' }); let _this:any = this;
let navDataService:any = new NavDataService(this.$store);
let allNavData:any = Object.is(this.navModel,"route")?navDataService.getPreNavDataById('sdfile-edit-view'):navDataService.getPreNavDataByTag(_this.viewtag);
if(allNavData && allNavData.data && allNavData.data.length >0){
if(_this.parseViewParam && _this.engine){
_this.parseViewParam(allNavData.data[allNavData.data.length - 1].srfkey);
_this.engine.load();
}
}else{
this.$Notice.warning({ title: '警告', desc: '请确认操作路径是否正确' });
}
} }
/** /**
* 帮助 * 帮助
...@@ -1403,6 +1544,12 @@ export default class SDFileEditViewBase extends Vue { ...@@ -1403,6 +1544,12 @@ export default class SDFileEditViewBase extends Vue {
} }
}) })
} }
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
} }
} }
......
...@@ -9,6 +9,9 @@ import view_form from '@widgets/sdfile/main-form/main-form.vue'; ...@@ -9,6 +9,9 @@ import view_form from '@widgets/sdfile/main-form/main-form.vue';
}, },
beforeRouteEnter: (to: any, from: any, next: any) => { beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => { next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag }); vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
}); });
}, },
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div class='view-container degridview sdfile-grid-view'> <div class='view-container degridview sdfile-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sdfilegridview"></app-studioaction> <app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sdfilegridview"></app-studioaction>
<card class='view-card ' :dis-hover="true" :bordered="false"> <card class='view-card ' :dis-hover="true" :bordered="false">
<p slot='title'> <div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfTitle)}}</span> <span class='caption-info'>{{$t(model.srfTitle)}}</span>
</p> </div>
<div class='content-container'> <div class='content-container'>
<div class='view-top-messages'> <div class='view-top-messages'>
</div> </div>
...@@ -146,9 +146,10 @@ ...@@ -146,9 +146,10 @@
<script lang='tsx'> <script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils'; import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs'; import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import SDFileService from '@/service/sdfile/sdfile-service'; import SDFileService from '@/service/sdfile/sdfile-service';
import GridViewEngine from '@engine/view/grid-view-engine'; import GridViewEngine from '@engine/view/grid-view-engine';
...@@ -216,6 +217,15 @@ export default class SDFileGridViewBase extends Vue { ...@@ -216,6 +217,15 @@ export default class SDFileGridViewBase extends Vue {
*/ */
@Prop({ default: true }) public viewDefaultUsage!: boolean; @Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof SDFileGridViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/** /**
* 视图标识 * 视图标识
* *
...@@ -396,6 +406,23 @@ export default class SDFileGridViewBase extends Vue { ...@@ -396,6 +406,23 @@ export default class SDFileGridViewBase extends Vue {
}); });
} }
/**
* 应用导航服务
*
* @type {*}
* @memberof SDFileGridViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof SDFileGridViewBase
*/
public serviceStateEvent: Subscription | undefined;
/** /**
* 应用上下文 * 应用上下文
* *
...@@ -412,13 +439,21 @@ export default class SDFileGridViewBase extends Vue { ...@@ -412,13 +439,21 @@ export default class SDFileGridViewBase extends Vue {
*/ */
public viewparams:any = {}; public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof SDFileGridViewBase
*/
public viewCacheData:any;
/** /**
* 解析视图参数 * 解析视图参数
* *
* @public * @public
* @memberof SDFileGridViewBase * @memberof SDFileGridViewBase
*/ */
public parseViewParam(): void { public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){ for(let key in this.context){
delete this.context[key]; delete this.context[key];
} }
...@@ -448,12 +483,17 @@ export default class SDFileGridViewBase extends Vue { ...@@ -448,12 +483,17 @@ export default class SDFileGridViewBase extends Vue {
}); });
}); });
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams); this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(inputvalue){
Object.assign(this.context,{'sdfile':inputvalue});
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){ if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context); Object.assign(this.context,this.$store.getters.getAppData().context);
} }
//初始化视图唯一标识 //初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()}); Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData(); this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
} }
/** /**
...@@ -531,6 +571,28 @@ export default class SDFileGridViewBase extends Vue { ...@@ -531,6 +571,28 @@ export default class SDFileGridViewBase extends Vue {
} }
} }
} }
/**
* 初始化导航数据(路由模式)
*
* @memberof SDFileGridViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false){
if(this.viewDefaultUsage && Object.is(this.navModel,"route")){
this.navDataService.addNavData({id:'sdfile-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.sdfile,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof SDFileGridViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true){
if(this.viewDefaultUsage && !Object.is(this.navModel,"route")){
this.navDataService.addNavDataByOnly({id:'sdfile-grid-view',tag:this.viewtag,srfkey:this.context.sdfile,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/** /**
...@@ -548,10 +610,24 @@ export default class SDFileGridViewBase extends Vue { ...@@ -548,10 +610,24 @@ export default class SDFileGridViewBase extends Vue {
* @memberof SDFileGridViewBase * @memberof SDFileGridViewBase
*/ */
public afterCreated(){ public afterCreated(){
const secondtag = this.$util.createUUID(); let _this:any = this;
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag }); const secondtag = _this.$util.createUUID();
this.viewtag = secondtag; _this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
this.parseViewParam(); _this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'sdfile-grid-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
if(this.formDruipart){ if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{ this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'save')){ if(Object.is(res.action,'save')){
...@@ -1506,6 +1582,12 @@ export default class SDFileGridViewBase extends Vue { ...@@ -1506,6 +1582,12 @@ export default class SDFileGridViewBase extends Vue {
} }
}) })
} }
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
} }
} }
......
...@@ -11,6 +11,9 @@ import view_searchform from '@widgets/sdfile/default-searchform/default-searchfo ...@@ -11,6 +11,9 @@ import view_searchform from '@widgets/sdfile/default-searchform/default-searchfo
}, },
beforeRouteEnter: (to: any, from: any, next: any) => { beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => { next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag }); vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
}); });
}, },
......
...@@ -12,7 +12,6 @@ import i18n from '@/locale' ...@@ -12,7 +12,6 @@ import i18n from '@/locale'
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import 'view-design/dist/styles/iview.css'; import 'view-design/dist/styles/iview.css';
import 'ibiz-vue-lib/lib/ibiz-vue-lib.css'; import 'ibiz-vue-lib/lib/ibiz-vue-lib.css';
import '@/styles/default.less'; import '@/styles/default.less';
// 模拟数据 // 模拟数据
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<sider :width="collapseChange ? 64 : 200" hide-trigger v-model="collapseChange"> <sider :width="collapseChange ? 64 : 200" hide-trigger v-model="collapseChange">
<div class="sider-top"> <div class="sider-top">
<div class="page-logo"> <div class="page-logo">
<img v-show="collapseChange" src="../../../assets/img/logo.png" height="16" /> <span class="menuicon" @click="contextMenuDragVisiable=!contextMenuDragVisiable"><Icon type="md-menu" /></span>
<span v-show="!collapseChange" style="display: block;text-align: center;font-weight: 300;font-size: 20px;">{{$t(model.srfCaption)}}</span> <span v-show="!collapseChange" style="overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap;display: block;text-align: center;font-weight: 300;font-size: 20px;">{{$t(model.srfCaption)}}</span>
</div> </div>
</div> </div>
<view_appmenu <view_appmenu
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
:context="context" :context="context"
:showBusyIndicator="true" :showBusyIndicator="true"
v-model="collapseChange" v-model="collapseChange"
:mode="mode" :mode="mode"
:navModel="navModel"
viewtag="sdindex-view"
:selectTheme="selectTheme" :selectTheme="selectTheme"
:isDefaultPage="isDefaultPage" :isDefaultPage="isDefaultPage"
:defPSAppView="defPSAppView" :defPSAppView="defPSAppView"
...@@ -24,6 +26,7 @@ ...@@ -24,6 +26,7 @@
ref='appmenu' ref='appmenu'
@closeview="closeView($event)"> @closeview="closeView($event)">
</view_appmenu> </view_appmenu>
<context-menu-drag :contextMenuDragVisiable="contextMenuDragVisiable"></context-menu-drag>
</sider> </sider>
<layout> <layout>
<header class="index_header"> <header class="index_header">
...@@ -31,7 +34,7 @@ ...@@ -31,7 +34,7 @@
<div class="page-logo"> <div class="page-logo">
<i v-show="!collapseChange" class="ivu-icon el-icon-s-fold" @click="handleClick"></i> <i v-show="!collapseChange" class="ivu-icon el-icon-s-fold" @click="handleClick"></i>
<i v-show="collapseChange" class="ivu-icon el-icon-s-unfold" @click="handleClick"></i> <i v-show="collapseChange" class="ivu-icon el-icon-s-unfold" @click="handleClick"></i>
<app-breadcrumb :defPSAppView="defPSAppView"></app-breadcrumb> <app-breadcrumb :navModel="navModel" indexViewTag="sdindex-view"></app-breadcrumb>
</div> </div>
</div> </div>
<div class="header-right" style="display: flex;align-items: center;justify-content: space-between;"> <div class="header-right" style="display: flex;align-items: center;justify-content: space-between;">
...@@ -42,8 +45,8 @@ ...@@ -42,8 +45,8 @@
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme> <app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
</div> </div>
</header> </header>
<content class="index_content" :style="{'width':this.collapseChange ? 'calc(100vw - 64px)' : 'calc(100vw - 200px)' }"> <content :class="{'index_content':true,'index_tab_content':Object.is(navModel,'tab')?true:false,'index_route_content':Object.is(navModel,'route')?true:false}" :style="{'width':this.collapseChange ? 'calc(100vw - 64px)' : 'calc(100vw - 200px)' }" @click="contextMenuDragVisiable=false">
<tab-page-exp></tab-page-exp> <tab-page-exp v-if="Object.is(navModel,'tab')"></tab-page-exp>
<app-keep-alive :routerList="getRouterList"> <app-keep-alive :routerList="getRouterList">
<router-view :key="getRouterViewKey"></router-view> <router-view :key="getRouterViewKey"></router-view>
</app-keep-alive> </app-keep-alive>
...@@ -56,9 +59,10 @@ ...@@ -56,9 +59,10 @@
</template> </template>
<script lang='tsx'> <script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils'; import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs'; import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
...@@ -114,6 +118,7 @@ export default class SDIndexViewBase extends Vue { ...@@ -114,6 +118,7 @@ export default class SDIndexViewBase extends Vue {
*/ */
@Prop({ default: true }) public viewDefaultUsage!: boolean; @Prop({ default: true }) public viewDefaultUsage!: boolean;
/** /**
* 视图标识 * 视图标识
* *
...@@ -237,6 +242,23 @@ export default class SDIndexViewBase extends Vue { ...@@ -237,6 +242,23 @@ export default class SDIndexViewBase extends Vue {
public engineInit(): void { public engineInit(): void {
} }
/**
* 应用导航服务
*
* @type {*}
* @memberof SDIndexViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof SDIndexViewBase
*/
public serviceStateEvent: Subscription | undefined;
/** /**
* 应用上下文 * 应用上下文
* *
...@@ -253,13 +275,21 @@ export default class SDIndexViewBase extends Vue { ...@@ -253,13 +275,21 @@ export default class SDIndexViewBase extends Vue {
*/ */
public viewparams:any = {}; public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof SDIndexViewBase
*/
public viewCacheData:any;
/** /**
* 解析视图参数 * 解析视图参数
* *
* @public * @public
* @memberof SDIndexViewBase * @memberof SDIndexViewBase
*/ */
public parseViewParam(): void { public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){ for(let key in this.context){
delete this.context[key]; delete this.context[key];
} }
...@@ -293,6 +323,8 @@ export default class SDIndexViewBase extends Vue { ...@@ -293,6 +323,8 @@ export default class SDIndexViewBase extends Vue {
Object.assign(this.context,this.$store.getters.getAppData().context); Object.assign(this.context,this.$store.getters.getAppData().context);
} }
this.handleCustomViewData(); this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
} }
/** /**
...@@ -370,6 +402,28 @@ export default class SDIndexViewBase extends Vue { ...@@ -370,6 +402,28 @@ export default class SDIndexViewBase extends Vue {
} }
} }
} }
/**
* 初始化导航数据(路由模式)
*
* @memberof SDIndexViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false){
if(this.viewDefaultUsage && Object.is(this.navModel,"route")){
this.navDataService.addNavData({id:'sdindex-view',tag:this.viewtag,srfkey:isNew ? null : null,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof SDIndexViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true){
if(this.viewDefaultUsage && !Object.is(this.navModel,"route")){
this.navDataService.addNavDataByOnly({id:'sdindex-view',tag:this.viewtag,srfkey:null,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/** /**
...@@ -387,10 +441,24 @@ export default class SDIndexViewBase extends Vue { ...@@ -387,10 +441,24 @@ export default class SDIndexViewBase extends Vue {
* @memberof SDIndexViewBase * @memberof SDIndexViewBase
*/ */
public afterCreated(){ public afterCreated(){
const secondtag = this.$util.createUUID(); let _this:any = this;
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag }); const secondtag = _this.$util.createUUID();
this.viewtag = secondtag; _this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
this.parseViewParam(); _this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'sdindex-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
} }
...@@ -457,6 +525,33 @@ export default class SDIndexViewBase extends Vue { ...@@ -457,6 +525,33 @@ export default class SDIndexViewBase extends Vue {
*/ */
public mode: string ='vertical'; public mode: string ='vertical';
/**
* 导航模式(route:面包屑模式、tab:分页导航模式)
*
* @type {string}
* @memberof SDIndexViewBase
*/
@Provide()
public navModel:string = "tab";
/**
* 抽屉状态
*
* @type {boolean}
* @memberof SDIndexViewBase
*/
public contextMenuDragVisiable: boolean = false;
/**
* 初始化之前
*
* @memberof SDIndexViewBase
*/
public beforeCreate(){
let navDataService = NavDataService.getInstance(this.$store)
navDataService.removeAllNavData();
}
/** /**
* 当前主题 * 当前主题
* *
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
} }
.sdindex-view{
position: relative;
}
.index_view{ .index_view{
margin-bottom: 1px; margin-bottom: 1px;
width: 100%; width: 100%;
...@@ -19,6 +21,7 @@ ...@@ -19,6 +21,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
background-color: #fff;
.page-logo{ .page-logo{
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -73,7 +76,6 @@ ...@@ -73,7 +76,6 @@
} }
} }
.ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top{ .ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top{
padding: 4px;
margin-top: -2px; margin-top: -2px;
line-height: 58px; line-height: 58px;
text-align: center; text-align: center;
...@@ -81,11 +83,22 @@ ...@@ -81,11 +83,22 @@
cursor: pointer; cursor: pointer;
} }
.sider-top{ .sider-top{
padding: 0px;
margin-bottom: 1px; margin-bottom: 1px;
height:65px; height:65px;
box-shadow: 0 1px 2px 0 rgba(0,0,0,.15); box-shadow: 0 1px 2px 0 rgba(0,0,0,.15);
> .page-logo{ > .page-logo{
display: flex;
align-items: center;
height: 100%;
>.menuicon{
display: block;
text-align: center; text-align: center;
font-weight: 300;
font-size: 28px;
width:64px;
height:100%;
}
} }
} }
} }
......
...@@ -9,6 +9,9 @@ import view_appmenu from '@widgets/app/sdindex-view-appmenu/sdindex-view-appmenu ...@@ -9,6 +9,9 @@ import view_appmenu from '@widgets/app/sdindex-view-appmenu/sdindex-view-appmenu
}, },
beforeRouteEnter: (to: any, from: any, next: any) => { beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => { next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag }); vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
}); });
}, },
......
export interface NavDataElement {
/**
* 主键标识
*
* @memberof NavDataElement
*/
id: string;
/**
* 视图标题
*
* @memberof NavDataElement
*/
title: any;
/**
* 上下文
*
* @memberof NavDataElement
*/
context:any;
/**
* 视图参数
*
* @memberof NavDataElement
*/
viewparams:any;
/**
* 视图数据
*
* @memberof NavDataElement
*/
data:any;
/**
* 视图路径
*
* @memberof NavDataElement
*/
path:string;
/**
* 元素主键
*
* @memberof NavDataElement
*/
srfkey:string|null;
/**
* 视图标识
*
* @memberof NavDataElement
*/
tag:string|null;
}
export interface ServiceState {
/**
* 行为
*
* @memberof ServiceState
*/
action: string;
/**
* 名称
*
* @memberof ServiceState
*/
name: any;
/**
* 数据
*
* @memberof ServiceState
*/
data: any;
}
import { Subject } from 'rxjs';
/**
* 导航数据服务
*
* @export
* @class CodeListService
*/
export default class NavDataService {
/**
* 单例变量声明
*
* @private
* @static
* @type {NavDataService}
* @memberof NavDataService
*/
private static navDataService: NavDataService;
/**
* 缓存对象
*
* @private
* @type {(any)}
* @memberof NavDataService
*/
private static store: any;
/**
* 服务状态
*
* @memberof NavDataService
*/
public serviceState: Subject<ServiceState> = new Subject();
/**
* 导航数据栈
*
* @memberof NavDataService
*/
public navDataStack:Array<NavDataElement> = [];
/**
* 导航数据存储仓库
*
* @memberof NavDataService
*/
public sessionStore:any;
/**
* 初始化实例
*
* @memberof NavDataService
*/
constructor(opts:any = {}){
this.sessionStore = window.sessionStorage;
this.initNavData();
}
/**
* 获取 NavDataService 单例对象
*
* @static
* @returns {NavDataService}
* @memberof NavDataService
*/
public static getInstance(store: any): NavDataService {
if (!NavDataService.navDataService) {
NavDataService.navDataService = new NavDataService();
}
this.store = store;
return this.navDataService;
}
/**
* 初始化基础导航数据
*
* @memberof NavDataService
*/
public initNavData(){
if(this.sessionStore && this.sessionStore.getItem('srfnavdata')){
this.navDataStack = JSON.parse(this.sessionStore.getItem('srfnavdata'));
}
}
/**
* 添加基础导航数据到栈中
*
* @memberof NavDataService
*/
public addNavData(curNavData:NavDataElement){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,curNavData.id);
})
if(tempIndex === -1){
this.navDataStack.push(curNavData);
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return curNavData;
}else{
this.setNavDataById(curNavData.id,curNavData);
}
}else{
this.navDataStack.push(curNavData);
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return curNavData;
}
this.serviceState.next({action:'datarefresh',name:null,data:this.navDataStack});
}
/**
* 设置指定数据到基础导航数据栈中
*
* @memberof NavDataService
*/
public setNavDataById(id:string,curNavData:NavDataElement){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,id);
})
this.navDataStack[tempIndex] = curNavData;
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return curNavData;
}else{
return null;
}
}
/**
* 从导航数据栈中删除指定数据上层数据
*
* @memberof NavDataService
*/
public removeNavData(id:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,id);
})
let removeNavData = this.navDataStack.splice(tempIndex+1);
if(removeNavData && removeNavData.length >0){
removeNavData.forEach((navData:any) =>{
NavDataService.store.commit("deletePage", navData.path);
})
}
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return removeNavData;
}else{
return null;
}
}
/**
* 从导航数据栈中删除指定数据上层数据(不清除页面缓存)
*
* @memberof NavDataService
*/
public removeNavDataWithoutCache(id:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,id);
})
let removeNavData = this.navDataStack.splice(tempIndex+1);
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return removeNavData;
}else{
return null;
}
}
/**
* 从导航数据栈中获取指定数据
*
* @memberof NavDataService
*/
public getNavDataById(id:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,id);
})
return this.navDataStack[tempIndex];
}else{
return null;
}
}
/**
* 从导航数据栈中获取指定数据的前一条数据
*
* @memberof NavDataService
*/
public getPreNavDataById(id:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,id);
})
return this.navDataStack[tempIndex-1];
}else{
return null;
}
}
/**
* 清空导航数据栈数据
*
* @memberof NavDataService
*/
public clearNavData(id:string){
this.navDataStack = [];
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
}
/**
* 从导航数据栈中获取数据
*
* @memberof NavDataService
*/
public getNavData(){
if(this.navDataStack && this.navDataStack.length >0){
this.navDataStack.forEach((item:any,index) =>{
if(item && item.data && this.navDataStack[index+1]){
this.navDataStack[index+1] = Object.assign(this.navDataStack[index+1],{isselected:true});
}
})
return this.navDataStack;
}else{
return [];
}
}
/**
* 从导航数据栈中直接添加数据
*
* @memberof NavDataService
*/
public addNavDataByOnly(curNavData:NavDataElement,isOnlyAdd:boolean){
if(isOnlyAdd){
this.navDataStack.push(curNavData);
}else{
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.tag,curNavData.tag);
})
if(tempIndex === -1){
this.navDataStack.push(curNavData);
}else{
this.navDataStack[tempIndex] = curNavData;
}
}else{
this.navDataStack.push(curNavData);
}
}
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return curNavData;
}
/**
* 从导航数据栈中直接删除数据
*
* @memberof NavDataService
*/
public removeNavDataByTag(viewtag:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.tag,viewtag);
})
let removeNavData = this.navDataStack.splice(tempIndex,1);
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return removeNavData;
}else{
return null;
}
}
/**
* 从导航数据栈中获取指定元素前一个元素
*
* @memberof NavDataService
*/
public getPreNavDataByTag(viewtag:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.tag,viewtag);
})
return this.navDataStack[tempIndex - 1]?this.navDataStack[tempIndex - 1]:null;
}else{
return null;
}
}
/**
* 从导航数据栈中删除所有数据
*
* @memberof NavDataService
*/
public removeAllNavData(){
if(this.navDataStack.length >0){
this.navDataStack = [];
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
}
}
}
\ No newline at end of file
...@@ -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
...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's ...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
---- ----
FTL stack trace ("~" means nesting-related): FTL stack trace ("~" means nesting-related):
- Failed at: ${item.getKeyPSAppDEField().getCodeNa... [in template "TEMPLCODE_zh_CN" at line 435, column 26] - Failed at: ${item.getKeyPSAppDEField().getCodeNa... [in template "TEMPLCODE_zh_CN" at line 467, column 26]
---- ----
\ No newline at end of file
...@@ -62,10 +62,23 @@ ...@@ -62,10 +62,23 @@
border-top-color: #909399; border-top-color: #909399;
} }
// tab分页模式首页布局
.index_tab_content{
>.view-container {
height: calc(100% - 65px);
margin: 0px 12px;
}
}
// 面包屑模式首页布局
.index_route_content{
>.view-container {
height: calc(100% - 36px);
margin: 12px;
}
}
.view-container { .view-container {
height: calc(100% - 65px);
padding: 0 12px; padding: 0 12px;
margin: 0px 12px;
background: white; background: white;
box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04); box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
// flex-direction: column; // flex-direction: column;
...@@ -74,18 +87,29 @@ ...@@ -74,18 +87,29 @@
// display: flex; // display: flex;
// flex-direction: column; // flex-direction: column;
> .ivu-card-head{ > .ivu-card-head{
height: 50px; min-height: 42px;
border-color: rgb(221, 221, 221); border-color: rgb(221, 221, 221);
border-style: solid; border-style: solid;
border-width: 0px 0px 1px; border-width: 0px 0px 1px;
margin: 0px 0px 11px; margin: 0px 0px 11px;
padding: 6px 0px; padding: 6px 0px 2px;
> p{ > .header-container{
height: 50px; min-height: 42px;
display: flex;
flex-wrap: nowrap;
align-items: flex-start;
justify-content: space-between;
> .caption-info{ > .caption-info{
line-height: 50px; line-height: 42px;
font-size: 18px; font-size: 18px;
color: #1890ff; color: #1890ff;
flex-shrink: 0;
}
> .toolbar-container{
margin-left: auto;
display: flex;
flex-wrap: wrap;
align-items: center;
} }
} }
} }
...@@ -237,12 +261,6 @@ ...@@ -237,12 +261,6 @@
} }
} }
// 清除看板里视图的阴影
.dashboard .portlet .view-container{
-webkit-box-shadow: none ;
box-shadow: none;
}
/*** END:多数据视图属性布局 ***/ /*** END:多数据视图属性布局 ***/
// 看板视图,卡片模式 // 看板视图,卡片模式
......
...@@ -4,29 +4,6 @@ ...@@ -4,29 +4,6 @@
.app-theme-icon { .app-theme-icon {
color: #6ba1d1; color: #6ba1d1;
} }
/* .el-menu.el-menu--horizontal {
> .el-menu-item, > .el-submenu > .el-submenu__title {
background: #2d5f8b;
color: #6ba1d1;
i {
color: #6ba1d1;
}
}
> .el-menu-item.is-active, > .el-submenu.is-active > .el-submenu__title {
background-color: #4276a4;
color: #f1f1f1;
i {
color: #f1f1f1;
}
}
> .el-menu-item:hover, > .el-submenu:hover > .el-submenu__title {
background-color: #3c6c95;
color: #f1f1f1 !important;
i {
color: #f1f1f1;
}
}
} */
} }
> .ivu-layout { > .ivu-layout {
...@@ -34,7 +11,12 @@ ...@@ -34,7 +11,12 @@
background-color: #4276a4; background-color: #4276a4;
.sider-top { .sider-top {
color: hsla(0,0%,100%,.8); color: hsla(0,0%,100%,.8);
background: #2d5f8b; background-color: #4276a4;
>.page-logo{
>.menuicon:hover{
background-color: #2d5f8b;
}
}
} }
} }
} }
......
...@@ -3,30 +3,7 @@ ...@@ -3,30 +3,7 @@
> .ivu-layout-has-sider > .ivu-layout > header{ > .ivu-layout-has-sider > .ivu-layout > header{
.app-theme-icon { .app-theme-icon {
color: #606d80; color: #606d80;
}/* }
.el-menu.el-menu--horizontal {
> .el-menu-item, > .el-submenu > .el-submenu__title {
background: #20222A;
color: #606d80;
i {
color: #606d80;
}
}
> .el-menu-item.is-active, > .el-submenu.is-active > .el-submenu__title {
background-color: #20222A;
color: #f1f1f1;
i {
color: #f1f1f1;
}
}
> .el-menu-item:hover, > .el-submenu:hover > .el-submenu__title {
background-color: #3e4b5c;
color: #f1f1f1 !important;
i {
color: #f1f1f1;
}
}
} */
} }
> .ivu-layout { > .ivu-layout {
> .ivu-layout-sider { > .ivu-layout-sider {
...@@ -34,6 +11,11 @@ ...@@ -34,6 +11,11 @@
.sider-top { .sider-top {
color: hsla(0,0%,100%,.8); color: hsla(0,0%,100%,.8);
background-color: #20222A; background-color: #20222A;
>.page-logo{
>.menuicon:hover{
background-color:#060708;
}
}
} }
} }
} }
......
...@@ -4,38 +4,18 @@ ...@@ -4,38 +4,18 @@
.app-theme-icon { .app-theme-icon {
color: #aaaaaa; color: #aaaaaa;
} }
/* .el-menu.el-menu--horizontal {
> .el-menu-item, > .el-submenu > .el-submenu__title {
background: #e1e1e1;
color: #aaaaaa;
i {
color: #aaaaaa;
}
}
> .el-menu-item.is-active, > .el-submenu.is-active > .el-submenu__title {
background-color: #f6f6f6;
color: #666666;
i {
color: #666666;
}
}
> .el-menu-item:hover, > .el-submenu:hover > .el-submenu__title {
background-color: #e9e9e9;
color: #666666 !important;
i {
color: #666666;
}
}
} */
} }
> .ivu-layout { > .ivu-layout {
> .ivu-layout-sider { > .ivu-layout-sider {
background-color: #f6f6f6; background-color: #f6f6f6;
.sider-top { .sider-top {
background-color: #e8eaec; background-color: #f6f6f6;
.ivu-icon { >.page-logo{
color: #aaaaaa; >.menuicon:hover{
} background-color: #fff;
color:#000;
}
}
} }
} }
} }
......
...@@ -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,15 +99,17 @@ export class ViewTool { ...@@ -99,15 +99,17 @@ export class ViewTool {
let routePath: string = ''; let routePath: string = '';
let [arg] = args; let [arg] = args;
arg = arg ? arg : {}; arg = arg ? arg : {};
deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => { if(deResParameters && deResParameters.length >0){
let value:any = null; deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) { let value:any = null;
value = viewParam[parameterName]; if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) {
} else if (arg[parameterName] && !Object.is(arg[parameterName], '') && !Object.is(arg[parameterName], 'null')) { value = viewParam[parameterName];
value = arg[parameterName]; } else if (arg[parameterName] && !Object.is(arg[parameterName], '') && !Object.is(arg[parameterName], 'null')) {
} value = arg[parameterName];
routePath = `${routePath}/${pathName}/${value}`; }
}); routePath = `${routePath}/${pathName}/${value}`;
});
}
return routePath; return routePath;
} }
...@@ -124,21 +126,23 @@ export class ViewTool { ...@@ -124,21 +126,23 @@ 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.length === 1) { if(parameters && parameters.length >0){
const [{ pathName, parameterName }] = parameters; if (parameters.length === 1) {
routePath = `/${pathName}`; const [{ pathName, parameterName }] = parameters;
if (Object.keys(data).length > 0) { routePath = `/${pathName}`;
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`; if (Object.keys(data).length > 0) {
} routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
} else if (parameters.length === 2) { }
let [arg] = args; } else if (parameters.length === 2) {
arg = arg ? arg : {}; let [arg] = args;
const [{ pathName: _pathName, parameterName: _parameterName }, { pathName: _pathName2, parameterName: _parameterName2 }] = parameters; arg = arg ? arg : {};
const _value: any = arg[_parameterName] && !Object.is(arg[_parameterName], '') ? const [{ pathName: _pathName, parameterName: _parameterName }, { pathName: _pathName2, parameterName: _parameterName2 }] = parameters;
arg[_parameterName] : null; const _value: any = arg[_parameterName] && !Object.is(arg[_parameterName], '') ?
routePath = `/${_pathName}/${_value}/${_pathName2}`; arg[_parameterName] : null;
if (Object.keys(data).length > 0) { routePath = `/${_pathName}/${_value}/${_pathName2}`;
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`; if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
}
} }
} }
return routePath; return routePath;
......
...@@ -118,11 +118,12 @@ ...@@ -118,11 +118,12 @@
</template> </template>
<script lang='tsx'> <script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator'; import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue'; import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control'; import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils'; import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import SDIndexViewService from './sdindex-view-appmenu-service'; import SDIndexViewService from './sdindex-view-appmenu-service';
import SDIndexViewModel from './sdindex-view-appmenu-model'; import SDIndexViewModel from './sdindex-view-appmenu-model';
...@@ -140,7 +141,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -140,7 +141,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() public name?: string; @Prop() public name?: string;
...@@ -148,7 +149,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -148,7 +149,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 视图通讯对象 * 视图通讯对象
* *
* @type {Subject<ViewState>} * @type {Subject<ViewState>}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() public viewState!: Subject<ViewState>; @Prop() public viewState!: Subject<ViewState>;
...@@ -156,7 +157,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -156,7 +157,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 应用上下文 * 应用上下文
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() public context: any; @Prop() public context: any;
...@@ -164,7 +165,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -164,7 +165,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() public viewparams: any; @Prop() public viewparams: any;
...@@ -173,7 +174,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -173,7 +174,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @public * @public
* @type {(Subscription | undefined)} * @type {(Subscription | undefined)}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public viewStateEvent: Subscription | undefined; public viewStateEvent: Subscription | undefined;
...@@ -181,7 +182,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -181,7 +182,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 获取部件类型 * 获取部件类型
* *
* @returns {string} * @returns {string}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public getControlType(): string { public getControlType(): string {
return 'APPMENU' return 'APPMENU'
...@@ -193,7 +194,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -193,7 +194,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 建构部件服务对象 * 建构部件服务对象
* *
* @type {SDIndexViewService} * @type {SDIndexViewService}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public service: SDIndexViewService = new SDIndexViewService({ $store: this.$store }); public service: SDIndexViewService = new SDIndexViewService({ $store: this.$store });
...@@ -203,7 +204,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -203,7 +204,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 关闭视图 * 关闭视图
* *
* @param {any} args * @param {any} args
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public closeView(args: any): void { public closeView(args: any): void {
let _this: any = this; let _this: any = this;
...@@ -213,7 +214,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -213,7 +214,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/** /**
* 计数器刷新 * 计数器刷新
* *
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public counterRefresh(){ public counterRefresh(){
const _this:any =this; const _this:any =this;
...@@ -231,7 +232,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -231,7 +232,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 获取多项数据 * 获取多项数据
* *
* @returns {any[]} * @returns {any[]}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public getDatas(): any[] { public getDatas(): any[] {
return []; return [];
...@@ -241,18 +242,34 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -241,18 +242,34 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 获取单项树 * 获取单项树
* *
* @returns {*} * @returns {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public getData(): any { public getData(): any {
return null; return null;
} }
/**
* 导航模式(route:面包屑模式、tab:分页导航模式)
*
* @type {string}
* @memberof SDIndexViewBase
*/
@Prop({default:'tab'}) public navModel?:string;
/**
* 视图标识
*
* @type {string}
* @memberof SDIndexViewBase
*/
@Prop() public viewtag!:string;
/** /**
* 菜单模型 * 菜单模型
* *
* @public * @public
* @type {SDIndexViewModel} * @type {SDIndexViewModel}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public menuMode: SDIndexViewModel = new SDIndexViewModel(); public menuMode: SDIndexViewModel = new SDIndexViewModel();
...@@ -260,7 +277,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -260,7 +277,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 显示处理提示 * 显示处理提示
* *
* @type {boolean} * @type {boolean}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop({ default: true }) public showBusyIndicator?: boolean; @Prop({ default: true }) public showBusyIndicator?: boolean;
...@@ -269,7 +286,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -269,7 +286,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @public * @public
* @type {any[]} * @type {any[]}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Provide() @Provide()
public menus: any[] = []; public menus: any[] = [];
...@@ -278,7 +295,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -278,7 +295,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 菜单收缩改变 * 菜单收缩改变
* *
* @type {boolean} * @type {boolean}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Model() public collapsechange?: boolean; @Model() public collapsechange?: boolean;
...@@ -287,7 +304,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -287,7 +304,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Watch('collapsechange') @Watch('collapsechange')
onCollapsechangeChange(newVal: any, oldVal: any) { onCollapsechangeChange(newVal: any, oldVal: any) {
...@@ -300,7 +317,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -300,7 +317,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 当前模式,菜单在顶部还是在底部 * 当前模式,菜单在顶部还是在底部
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() mode: any; @Prop() mode: any;
...@@ -308,7 +325,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -308,7 +325,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 当前菜单是否在默认视图上 * 当前菜单是否在默认视图上
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop({ default: false }) isDefaultPage?: boolean; @Prop({ default: false }) isDefaultPage?: boolean;
...@@ -316,7 +333,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -316,7 +333,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 默认打开视图 * 默认打开视图
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() defPSAppView: any; @Prop() defPSAppView: any;
...@@ -324,7 +341,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -324,7 +341,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 默认激活的index * 默认激活的index
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Provide() defaultActive: any = null; @Provide() defaultActive: any = null;
...@@ -332,7 +349,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -332,7 +349,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 当前选中主题 * 当前选中主题
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Prop() selectTheme: any; @Prop() selectTheme: any;
...@@ -340,7 +357,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -340,7 +357,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 默认打开的index数组 * 默认打开的index数组
* *
* @type {any[]} * @type {any[]}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Provide() public defaultOpeneds: any[] = []; @Provide() public defaultOpeneds: any[] = [];
...@@ -348,7 +365,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -348,7 +365,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 是否展开 * 是否展开
* *
* @type {boolean} * @type {boolean}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Provide() public isCollapse: boolean = false; @Provide() public isCollapse: boolean = false;
...@@ -356,7 +373,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -356,7 +373,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 触发方式,默认click * 触发方式,默认click
* *
* @type {string} * @type {string}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
@Provide() trigger: string = 'click'; @Provide() trigger: string = 'click';
...@@ -364,13 +381,13 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -364,13 +381,13 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 计数器数据 * 计数器数据
* *
* @type {*} * @type {*}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public counterdata: any = {}; public counterdata: any = {};
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public created() { public created() {
this.afterCreated(); this.afterCreated();
...@@ -379,7 +396,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -379,7 +396,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/** /**
* 执行created后的逻辑 * 执行created后的逻辑
* *
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public afterCreated(){ public afterCreated(){
if (Object.is(this.mode, 'horizontal')) { if (Object.is(this.mode, 'horizontal')) {
...@@ -398,7 +415,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -398,7 +415,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public destroyed() { public destroyed() {
this.afterDestroy(); this.afterDestroy();
...@@ -407,7 +424,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -407,7 +424,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/** /**
* 执行destroyed后的逻辑 * 执行destroyed后的逻辑
* *
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public afterDestroy() { public afterDestroy() {
if (this.viewStateEvent) { if (this.viewStateEvent) {
...@@ -420,7 +437,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -420,7 +437,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 处理菜单默认选中项 * 处理菜单默认选中项
* *
* @public * @public
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public doMenuSelect(): void { public doMenuSelect(): void {
if (!this.isDefaultPage) { if (!this.isDefaultPage) {
...@@ -462,7 +479,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -462,7 +479,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {any[]} items * @param {any[]} items
* @param {string} appfunctag * @param {string} appfunctag
* @returns {boolean} * @returns {boolean}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public computeMenuSelect(items: any[], appfunctag: string): boolean { public computeMenuSelect(items: any[], appfunctag: string): boolean {
const appFuncs: any[] = this.menuMode.getAppFuncs(); const appFuncs: any[] = this.menuMode.getAppFuncs();
...@@ -498,7 +515,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -498,7 +515,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {any[]} items * @param {any[]} items
* @param {string} name * @param {string} name
* @returns * @returns
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public compute(items: any[], name: string) { public compute(items: any[], name: string) {
const item: any = {}; const item: any = {};
...@@ -525,7 +542,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -525,7 +542,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} item * @param {*} item
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public setHideSideBar(item: any): void { public setHideSideBar(item: any): void {
if (item.hidesidebar) { if (item.hidesidebar) {
...@@ -539,7 +556,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -539,7 +556,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {*} index * @param {*} index
* @param {any[]} indexs * @param {any[]} indexs
* @returns * @returns
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public select(index: any, indexs: any[]) { public select(index: any, indexs: any[]) {
let item = this.compute(this.menus, index); let item = this.compute(this.menus, index);
...@@ -554,13 +571,17 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -554,13 +571,17 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {*} item 菜单数据 * @param {*} item 菜单数据
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public click(item: any) { public click(item: any) {
if (item) { if (item) {
let navDataService = NavDataService.getInstance(this.$store);
if(Object.is(this.navModel,"route")){
navDataService.removeNavData(this.viewtag);
}
switch (item.appfunctag) { switch (item.appfunctag) {
case '_2': case 'Auto1':
this.click_2(item); this.clickAuto1(item);
return; return;
default: default:
console.warn('未指定应用功能'); console.warn('未指定应用功能');
...@@ -575,7 +596,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -575,7 +596,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof SDIndexView * @memberof SDIndexView
*/ */
public click_2(item: any = {}) { public clickAuto1(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
...@@ -584,14 +605,19 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -584,14 +605,19 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
{ pathName: 'gridview', parameterName: 'gridview' }, { pathName: 'gridview', parameterName: 'gridview' },
]; ];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam); const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
this.$router.push(path); if(Object.is(this.$route.fullPath,path)){
return;
}
this.$nextTick(function(){
this.$router.push(path);
})
} }
/** /**
* 数据加载 * 数据加载
* *
* @param {*} data * @param {*} data
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public load(data: any) { public load(data: any) {
this.handleMenusResource(this.menuMode.getAppMenuItems()); this.handleMenusResource(this.menuMode.getAppMenuItems());
...@@ -601,7 +627,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -601,7 +627,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 通过统一资源标识计算菜单 * 通过统一资源标识计算菜单
* *
* @param {*} data * @param {*} data
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public handleMenusResource(inputMenus:Array<any>){ public handleMenusResource(inputMenus:Array<any>){
if(Environment.enablePermissionValid){ if(Environment.enablePermissionValid){
...@@ -616,7 +642,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -616,7 +642,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 计算有效菜单项 * 计算有效菜单项
* *
* @param {*} data * @param {*} data
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public computedEffectiveMenus(inputMenus:Array<any>){ public computedEffectiveMenus(inputMenus:Array<any>){
inputMenus.forEach((_item:any) =>{ inputMenus.forEach((_item:any) =>{
...@@ -634,7 +660,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -634,7 +660,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @public * @public
* @param {any[]} items * @param {any[]} items
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
public dataProcess(items: any[]): void { public dataProcess(items: any[]): void {
items.forEach((_item: any) => { items.forEach((_item: any) => {
...@@ -652,7 +678,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface { ...@@ -652,7 +678,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof SDIndexView * @memberof SDIndexViewBase
*/ */
get popperClass(): string { get popperClass(): string {
return 'app-popper-menu ' + this.selectTheme; return 'app-popper-menu ' + this.selectTheme;
......
...@@ -29,7 +29,7 @@ export default class SDIndexViewModel { ...@@ -29,7 +29,7 @@ export default class SDIndexViewModel {
iconcls: '', iconcls: '',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_2', appfunctag: 'Auto1',
resourcetag: '', resourcetag: '',
authtag:'web-SDIndexView-menuitem1', authtag:'web-SDIndexView-menuitem1',
}, },
...@@ -44,7 +44,7 @@ export default class SDIndexViewModel { ...@@ -44,7 +44,7 @@ export default class SDIndexViewModel {
*/ */
public funcs: any[] = [ public funcs: any[] = [
{ {
appfunctag: '_2', appfunctag: 'Auto1',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'sdfilegridview', codename: 'sdfilegridview',
......
...@@ -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;
......
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
</i-form> </i-form>
</template> </template>
<script lang='tsx'> <script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator'; import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue'; import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs'; import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control'; import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils'; import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import SDFileService from '@/service/sdfile/sdfile-service'; import SDFileService from '@/service/sdfile/sdfile-service';
import DefaultService from './default-searchform-service'; import DefaultService from './default-searchform-service';
...@@ -45,7 +46,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -45,7 +46,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof Default * @memberof DefaultBase
*/ */
@Prop() public name?: string; @Prop() public name?: string;
...@@ -53,7 +54,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -53,7 +54,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 视图通讯对象 * 视图通讯对象
* *
* @type {Subject<ViewState>} * @type {Subject<ViewState>}
* @memberof Default * @memberof DefaultBase
*/ */
@Prop() public viewState!: Subject<ViewState>; @Prop() public viewState!: Subject<ViewState>;
...@@ -61,7 +62,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -61,7 +62,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 应用上下文 * 应用上下文
* *
* @type {*} * @type {*}
* @memberof Default * @memberof DefaultBase
*/ */
@Prop() public context: any; @Prop() public context: any;
...@@ -69,7 +70,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -69,7 +70,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof Default * @memberof DefaultBase
*/ */
@Prop() public viewparams: any; @Prop() public viewparams: any;
...@@ -78,7 +79,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -78,7 +79,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* *
* @public * @public
* @type {(Subscription | undefined)} * @type {(Subscription | undefined)}
* @memberof Default * @memberof DefaultBase
*/ */
public viewStateEvent: Subscription | undefined; public viewStateEvent: Subscription | undefined;
...@@ -86,7 +87,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -86,7 +87,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取部件类型 * 获取部件类型
* *
* @returns {string} * @returns {string}
* @memberof Default * @memberof DefaultBase
*/ */
public getControlType(): string { public getControlType(): string {
return 'SEARCHFORM' return 'SEARCHFORM'
...@@ -98,7 +99,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -98,7 +99,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 计数器服务对象集合 * 计数器服务对象集合
* *
* @type {Array<*>} * @type {Array<*>}
* @memberof Default * @memberof DefaultBase
*/ */
public counterServiceArray:Array<any> = []; public counterServiceArray:Array<any> = [];
...@@ -106,7 +107,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -106,7 +107,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 建构部件服务对象 * 建构部件服务对象
* *
* @type {DefaultService} * @type {DefaultService}
* @memberof Default * @memberof DefaultBase
*/ */
public service: DefaultService = new DefaultService({ $store: this.$store }); public service: DefaultService = new DefaultService({ $store: this.$store });
...@@ -114,7 +115,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -114,7 +115,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 实体服务对象 * 实体服务对象
* *
* @type {SDFileService} * @type {SDFileService}
* @memberof Default * @memberof DefaultBase
*/ */
public appEntityService: SDFileService = new SDFileService({ $store: this.$store }); public appEntityService: SDFileService = new SDFileService({ $store: this.$store });
...@@ -124,7 +125,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -124,7 +125,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 关闭视图 * 关闭视图
* *
* @param {any} args * @param {any} args
* @memberof Default * @memberof DefaultBase
*/ */
public closeView(args: any): void { public closeView(args: any): void {
let _this: any = this; let _this: any = this;
...@@ -134,7 +135,7 @@ export default class DefaultBase extends Vue implements ControlInterface { ...@@ -134,7 +135,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/** /**
* 计数器刷新 * 计数器刷新
* *
* @memberof Default * @memberof DefaultBase
*/ */
public counterRefresh(){ public counterRefresh(){
const _this:any =this; const _this:any =this;
......
!!!!模版产生代码错误:---- import { Http,Util,Errorlog } from '@/utils';
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? import ControlService from '@/widgets/control-service';
---- import SDFileService from '@/service/sdfile/sdfile-service';
import DefaultModel from './default-searchform-model';
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 349, column 14] /**
---- * Default 部件服务对象
\ No newline at end of file *
* @export
* @class DefaultService
*/
export default class DefaultService extends ControlService {
/**
* 文件服务对象
*
* @type {SDFileService}
* @memberof DefaultService
*/
public appEntityService: SDFileService = new SDFileService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof DefaultService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of DefaultService.
*
* @param {*} [opts={}]
* @memberof DefaultService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new DefaultModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof DefaultService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof DefaultService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data,true).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public get(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public frontLogic(action:string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof DefaultService
*/
public handleRequestData(action: string,context:any, data: any = {},isMerge:boolean = false){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
}
\ No newline at end of file
...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's ...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
---- ----
FTL stack trace ("~" means nesting-related): FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 1028, column 18] - Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 1038, column 18]
---- ----
\ No newline at end of file
...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's ...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
---- ----
FTL stack trace ("~" means nesting-related): FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 349, column 14] - Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 350, column 14]
---- ----
\ No newline at end of file
...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's ...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
---- ----
FTL stack trace ("~" means nesting-related): FTL stack trace ("~" means nesting-related):
- Failed at: ${ctrl.getPSAppDataEntity().getMajorP... [in template "TEMPLCODE_zh_CN" at line 884, column 39] - Failed at: ${ctrl.getPSAppDataEntity().getMajorP... [in template "TEMPLCODE_zh_CN" at line 886, column 39]
---- ----
\ No newline at end of file
...@@ -46,6 +46,13 @@ ...@@ -46,6 +46,13 @@
margin-bottom: unset !important; margin-bottom: unset !important;
} }
} }
.el-table__body .edit-cell{
padding:0;
.app-form-item{
margin-top: 20px;
margin-bottom: 20px;
}
}
} }
.grid-pagination { .grid-pagination {
height: 50px; height: 50px;
......
const path = require('path'); const path = require('path');
const os = require('os'); const os = require('os');
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
......
...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's ...@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
---- ----
FTL stack trace ("~" means nesting-related): FTL stack trace ("~" means nesting-related):
- Failed at: #assign sysApi = appDataEntity.getPSD... [in template "CODETEMPL_zh_CN" at line 31, column 9] - Failed at: #assign sysApi = appDataEntity.getPSD... [in template "CODETEMPL_zh_CN" at line 35, column 9]
---- ----
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<property name="LOG_PATH" value="logs" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %-40.40logger{39} : %msg%n" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}/ibzdisk-web.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="Console" />
<appender-ref ref="file" />
</root>
</configuration>
version: "3.2"
services:
ibzdisk-mongodb:
image: mongo:4.2.3
ports:
- 27017:27017
volumes:
- $PWD/../../../../volumes/mongodb/:/data/db/
networks:
- agent_network
networks:
agent_network:
attachable: true
version: "3.2"
services:
ibzdisk-nacos:
image: nacos/nacos-server:latest
container_name: nacos-standalone
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
ports:
- "8848:8848"
networks:
- agent_network
networks:
agent_network:
attachable: true
version: "3.2"
services:
ibzdisk-redis:
image: redis
ports:
- 6379:6379
environment:
- TZ=Asia/Shanghai
logging:
driver: "json-file"
command: redis-server
networks:
- agent_network
networks:
agent_network:
attachable: true
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<property name="LOG_PATH" value="logs" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %-40.40logger{39} : %msg%n" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}/ibzdisk.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="Console" />
<appender-ref ref="file" />
</root>
</configuration>
...@@ -92,10 +92,10 @@ ...@@ -92,10 +92,10 @@
<artifactId>liquibase-core</artifactId> <artifactId>liquibase-core</artifactId>
</dependency> </dependency>
<!--xxl-job定时服务 --> <!--baomidou-jobs定时服务 -->
<dependency> <dependency>
<groupId>com.xuxueli</groupId> <groupId>com.baomidou</groupId>
<artifactId>xxl-job-core</artifactId> <artifactId>jobs-spring-boot-starter</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -174,3 +174,4 @@ public class SDFileServiceImpl implements ISDFileService { ...@@ -174,3 +174,4 @@ public class SDFileServiceImpl implements ISDFileService {
package cn.ibizlab.core.util.config; package cn.ibizlab.core.util.config;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
/** @ConditionalOnExpression("!'${jobs.admin-address:NA}'.equals('NA')")
* xxl-job config
* 分布式任务调度平台XXL-JOB配置加载
* @author xuxueli 2017-04-28
*/
@Configuration @Configuration
public class XxlJobConfig { public class XxlJobConfig {
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
@Value("${xxl.job.admin.addresses:}")
private String adminAddresses;
@Value("${xxl.job.accessToken:}")
private String accessToken;
@Value("${xxl.job.executor.appname:ibzdisk}")
private String appName;
@Value("${xxl.job.executor.ip:127.0.0.1}")
private String ip;
@Value("${xxl.job.executor.port:9999}")
private int port;
@Value("${xxl.job.executor.logpath:/app/joblog}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays:-1}")
private int logRetentionDays;
@Bean(initMethod = "start", destroyMethod = "destroy")
public XxlJobSpringExecutor xxlJobExecutor() {
if(!StringUtils.isEmpty(adminAddresses)){
logger.info(">>>>>>>>>>> xxl-job config init.");
logger.info(">>>>>>>>>>> adminAddresses:"+adminAddresses);
logger.info(">>>>>>>>>>> appName:"+appName);
logger.info(">>>>>>>>>>> ip:"+ip);
logger.info(">>>>>>>>>>> port:"+port);
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppName(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
logger.info(">>>>>>>>>>> xxl-job config not init.");
return null;
}
/**
* 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
*
* 1、引入依赖:
* <dependency>
* <groupId>org.springframework.cloud</groupId>
* <artifactId>spring-cloud-commons</artifactId>
* <version>${version}"</version>
* </dependency>
*
* 2、配置文件,或者容器启动变量
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
*
* 3、获取IP
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
*/
} }
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
<!--httpClient --> <!--httpClient -->
<openfeign-httpclient.version>11.0</openfeign-httpclient.version> <openfeign-httpclient.version>11.0</openfeign-httpclient.version>
<!--xxl-job定时服务 --> <!--baomidou-jobs定时服务 -->
<xxl-job.version>2.1.0</xxl-job.version> <baomidou-jobs.version>1.0.3</baomidou-jobs.version>
<oracle.version>11.2.0.3</oracle.version> <oracle.version>11.2.0.3</oracle.version>
<postgresql.version>42.2.6</postgresql.version> <postgresql.version>42.2.6</postgresql.version>
...@@ -256,9 +256,9 @@ ...@@ -256,9 +256,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.xuxueli</groupId> <groupId>com.baomidou</groupId>
<artifactId>xxl-job-core</artifactId> <artifactId>jobs-spring-boot-starter</artifactId>
<version>${xxl-job.version}</version> <version>${baomidou-jobs.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -137,7 +137,7 @@ public class SDFileResource { ...@@ -137,7 +137,7 @@ public class SDFileResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"文件" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"文件" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sdfiles/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sdfiles/fetchdefault")
public ResponseEntity<List<SDFileDTO>> fetchDefault(SDFileSearchContext context) { public ResponseEntity<List<SDFileDTO>> fetchDefault(SDFileSearchContext context) {
...@@ -150,7 +150,7 @@ public class SDFileResource { ...@@ -150,7 +150,7 @@ public class SDFileResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-Default-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-searchDefault-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"文件" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"文件" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sdfiles/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sdfiles/searchdefault")
public ResponseEntity<Page<SDFileDTO>> searchDefault(@RequestBody SDFileSearchContext context) { public ResponseEntity<Page<SDFileDTO>> searchDefault(@RequestBody SDFileSearchContext context) {
......
server: server:
port: 8081 port: 8081
#Log配置
logging:
level:
cn.ibizlab: info
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<property name="LOG_PATH" value="logs" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %-40.40logger{39} : %msg%n" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="LOG_PATTERN2" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr([${LOG_LEVEL_PATTERN:-%5p}]) %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<!-- 控制台输出 -->
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_PATH}/ibzdisk-api.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="Console" />
<appender-ref ref="file" />
</root>
</configuration>
package cn.ibizlab.util.client; package cn.ibizlab.util.client;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.*;
@Component @Component
public class IBZWFFallback implements IBZWFFeignClient { public class IBZWFFallback implements IBZWFFeignClient {
...@@ -15,4 +15,9 @@ public class IBZWFFallback implements IBZWFFeignClient { ...@@ -15,4 +15,9 @@ public class IBZWFFallback implements IBZWFFeignClient {
public List<String> getbusinesskeysByUserId(String system, String userId, String entity, String processDefinitionKey, String taskDefinitionKey) { public List<String> getbusinesskeysByUserId(String system, String userId, String entity, String processDefinitionKey, String taskDefinitionKey) {
return null; return null;
} }
@Override
public Boolean deployBpmnFile(List<Map<String, Object>> bpmnfiles) {
return null;
}
} }
...@@ -2,7 +2,7 @@ package cn.ibizlab.util.client; ...@@ -2,7 +2,7 @@ package cn.ibizlab.util.client;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.*;
@FeignClient(value = "ibzwf-api",fallback = IBZWFFallback.class) @FeignClient(value = "ibzwf-api",fallback = IBZWFFallback.class)
public interface IBZWFFeignClient public interface IBZWFFeignClient
...@@ -15,4 +15,7 @@ public interface IBZWFFeignClient ...@@ -15,4 +15,7 @@ public interface IBZWFFeignClient
@RequestMapping(method = RequestMethod.POST, value = "/{system}-user-{userId}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks") @RequestMapping(method = RequestMethod.POST, value = "/{system}-user-{userId}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks")
List<String> getbusinesskeysByUserId(@PathVariable("system") String system,@PathVariable("userId") String userId, List<String> getbusinesskeysByUserId(@PathVariable("system") String system,@PathVariable("userId") String userId,
@PathVariable("entity") String entity,@PathVariable("processDefinitionKey") String processDefinitionKey,@PathVariable("taskDefinitionKey") String taskDefinitionKey); @PathVariable("entity") String entity,@PathVariable("processDefinitionKey") String processDefinitionKey,@PathVariable("taskDefinitionKey") String taskDefinitionKey);
@RequestMapping(method = RequestMethod.POST, value = "/deploybpmn")
Boolean deployBpmnFile(@RequestBody List<Map<String,Object>> bpmnfiles);
} }
...@@ -11,7 +11,9 @@ import org.springframework.boot.ApplicationRunner; ...@@ -11,7 +11,9 @@ import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;
import java.io.InputStream; import java.io.InputStream;
import java.util.*;
/** /**
* 权限:向uaa同步当前系统菜单、权限资源任务类 * 权限:向uaa同步当前系统菜单、权限资源任务类
...@@ -21,15 +23,14 @@ import java.io.InputStream; ...@@ -21,15 +23,14 @@ import java.io.InputStream;
@ConditionalOnProperty( name = "ibiz.enablePermissionValid", havingValue = "true") @ConditionalOnProperty( name = "ibiz.enablePermissionValid", havingValue = "true")
public class PermissionSyncJob implements ApplicationRunner { public class PermissionSyncJob implements ApplicationRunner {
@Autowired @Autowired
@Lazy @Lazy
private IBZUAAFeignClient client; private IBZUAAFeignClient client;
@Value("${ibiz.systemid:ibzdisk}") @Value("${ibiz.systemid:ibzdisk}")
private String systemId; private String systemId;
@Override @Override
public void run(ApplicationArguments args) { public void run(ApplicationArguments args) {
try { try {
...@@ -40,6 +41,7 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -40,6 +41,7 @@ public class PermissionSyncJob implements ApplicationRunner {
system.put("pssystemid",systemId); system.put("pssystemid",systemId);
system.put("pssystemname",systemId); system.put("pssystemname",systemId);
system.put("sysstructure",JSONObject.parseObject(permissionResult)); system.put("sysstructure",JSONObject.parseObject(permissionResult));
system.put("md5check",DigestUtils.md5DigestAsHex(permissionResult.getBytes()));
if(client.syncSysAuthority(system)){ if(client.syncSysAuthority(system)){
log.info("向[UAA]同步系统资源成功"); log.info("向[UAA]同步系统资源成功");
}else{ }else{
...@@ -49,5 +51,6 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -49,5 +51,6 @@ public class PermissionSyncJob implements ApplicationRunner {
catch (Exception ex) { catch (Exception ex) {
log.error(String.format("向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]",ex)); log.error(String.format("向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]",ex));
} }
} }
} }
\ No newline at end of file
...@@ -3,14 +3,14 @@ spring: ...@@ -3,14 +3,14 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 172.16.102.211:8848 server-addr: 127.0.0.1:8848
cache: cache:
redis: redis:
time-to-live: 3600 time-to-live: 3600
caffeine: caffeine:
spec: initialCapacity=5,maximumSize=500,expireAfterWrite=3600s spec: initialCapacity=5,maximumSize=500,expireAfterWrite=3600s
redis: redis:
host: 172.16.100.243 host: 127.0.0.1
port: 6379 port: 6379
password: password:
database: 0 database: 0
...@@ -22,7 +22,7 @@ spring: ...@@ -22,7 +22,7 @@ spring:
min-idle: 8 min-idle: 8
datasource: datasource:
username: root username: root
password: '123456' password: 'root'
url: jdbc:mysql://127.0.0.1:3306/ibzdisk?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true url: jdbc:mysql://127.0.0.1:3306/ibzdisk?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
filters: stat,wall,log4j2 filters: stat,wall,log4j2
...@@ -67,6 +67,13 @@ feign: ...@@ -67,6 +67,13 @@ feign:
enabled: true enabled: true
sentinel: sentinel:
enabled: true enabled: true
compression:
request:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
response:
enabled: true
#Log配置 #Log配置
logging: logging:
...@@ -85,16 +92,17 @@ ibiz: ...@@ -85,16 +92,17 @@ ibiz:
enablePermissionValid: true enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存 cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
#xxl-job定时服务 ### jobs
xxl: jobs:
job: #admin-address: http://127.0.0.1:40005
accessToken: app-name: ibzdisk
admin: app-port: 9999
addresses: #127.0.0.1 #app-ip: 127.0.0.1
executor:
appname: ibzdisk ### 启用Gzip压缩
ip: server:
port: 9999 compression:
logpath: /app/joblog enabled: true
logretentiondays: -1 mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册