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

ibiz4j 发布系统代码

上级 626f114c
*volumes
*target
.settings
*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]
### Bug修复
......
......@@ -27,7 +27,7 @@
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
"ibiz-gantt-elastic": "^1.0.17",
"ibiz-vue-lib": "^0.1.10",
"ibiz-vue-lib": "^0.1.13",
"interactjs": "^1.9.4",
"moment": "^2.24.0",
"path-to-regexp": "^6.1.0",
......@@ -58,6 +58,7 @@
"@vue/cli-service": "^4.1.0",
"@vue/test-utils": "1.0.0-beta.29",
"axios-mock-adapter": "^1.17.0",
"compression-webpack-plugin": "^4.0.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"mockjs": "^1.1.0",
......
......@@ -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 AppEmbedPicker from './components/app-embed-picker/app-embed-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 AppImageUpload from './components/app-image-upload/app-image-upload.vue'
import PropertyLayout from './components/property-layout/property-layout.vue'
......@@ -53,7 +52,6 @@ import AppRate from './components/app-rate/app-rate.vue'
import AppSwitch from './components/app-switch/app-switch.vue'
import AppSlider from './components/app-slider/app-slider.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 AppRangeDate from './components/app-range-date/app-range-date.vue'
import AppActionBar from './components/app-actionbar/app-actionbar.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 AppHeaderMenus from './components/app-header-menus/app-header-menus.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 AppImagePreview from './components/app-image-preview/app-image-preview.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
import ContextMenu from './components/context-menu/context-menu'
import AppColumnFormat from './components/app-column-format/app-column-format.vue'
import AppQuickGroup from './components/app-quick-group/app-quick-group.vue'
import AppOrgSelect from './components/app-org-select/app-org-select.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 AppGroupPicker from './components/app-group-picker/app-group-picker.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 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实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载功能服务注册中心
......@@ -115,7 +112,7 @@ export const AppComponents = {
v.component('app-radio-group',AppRadioGroup);
v.component('app-embed-picker', AppEmbedPicker);
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-image-upload',AppImageUpload);
v.component('property-layout',PropertyLayout);
......@@ -140,7 +137,7 @@ export const AppComponents = {
v.component('app-switch', AppSwitch);
v.component('app-slider', AppSlider);
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('app-range-date', AppRangeDate);
v.component('app-actionbar', AppActionBar);
......@@ -150,7 +147,7 @@ export const AppComponents = {
v.component('app-debug-actions', AppDebugActions);
v.component('app-header-menus', AppHeaderMenus);
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('app-image-preview', AppImagePreview);
v.component('app-format-data', AppFormatData);
......@@ -160,10 +157,11 @@ export const AppComponents = {
v.component('app-quick-group',AppQuickGroup);
v.component('app-org-select',AppOrgSelect);
v.component('app-department-select',AppDepartmentSelect);
v.component('ibiz-group-select',IBizGroupSelect);
v.component('ibiz-group-picker',IBizGroupPicker);
v.component('app-group-select',AppGroupSelect);
v.component('app-group-picker',AppGroupPicker);
v.component('app-wf-approval',AppWFApproval);
v.component('app-breadcrumb',Breadcrumb);
v.component('app-transfer',AppTransfer);
v.component('context-menu-drag',ContextMenuDrag);
},
};
\ No newline at end of file
......@@ -13,5 +13,12 @@
.no-redirect {
color: #97a8be;
cursor: text;
.curselected{
color: #2196F3;
font-weight: bold;
}
.app-breadcrumb-selected{
cursor: pointer;
}
}
}
\ No newline at end of file
<template>
<el-breadcrumb
class="app-breadcrumb"
separator="/"
>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<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 v-if="Object.is(this.navModel,'route')">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.id">
<span v-if="index === breadcrumbs.length-1" class="no-redirect">{{ item.title }}
<span v-if="isShowSelected(item)">
<dropdown trigger='click' @on-click="selectNavData($event,item)">
<span class="app-breadcrumb-selected">
<i class="el-icon-caret-bottom"></i>
</span>
<dropdown-menu slot='list'>
<dropdown-item v-for="(dataitem) in getPreNavData(item)" :name="dataitem.srfkey" :key="dataitem.srfkey">
<span :class="{'curselected':isCurSelected(item,dataitem)}">{{dataitem.srfmajortext}}</span>
</dropdown-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>
</el-breadcrumb>
</template>
......@@ -24,14 +33,41 @@
<script lang="ts">
import { Component, Vue, Watch, Prop } from 'vue-property-decorator'
import { RouteRecord, Route } from 'vue-router'
import { Environment } from "@/environments/environment";
import NavDataService from '@/service/app/navdata-service';
import {Subscription } from 'rxjs';
@Component({
})
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 {
this.getBreadcrumb()
}
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Dev
*/
public serviceStateEvent: Subscription | undefined;
/**
* vue 生命周期
*
* @memberof Breadcrumb
*/
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 {
* @memberof Breadcrumb
*/
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
})
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
*/
private handleLink(item: any) {
this.$router.push(item).catch(err => {
console.warn(err);
});
if(Object.is(this.navModel,"route")){
// 首页
if(Object.is(item.id,this.indexViewTag)){
this.$router.push((window.sessionStorage.getItem(Environment.AppName))as string);
}else{
// 非首页
this.$router.push(item.path).catch(err => {
console.warn(err);
});
}
this.navDataService.removeNavData(item.id);
}else{
if(item && item.meta && item.meta.viewType && Object.is(item.meta.viewType,"APPINDEX")){
let path: string | null = window.sessionStorage.getItem(Environment.AppName);
if (path) {
this.$router.push({ path: path });
} else {
this.$router.push("/");
}
}else{
this.$router.push(item).catch(err => {
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>
......
......@@ -6,7 +6,6 @@
<script lang="ts">
import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator';
@Component({
})
export default class AppDepartmentSelect extends Vue {
......
......@@ -100,6 +100,22 @@ export default class AppFileUpload extends Vue {
*/
@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 {
* @type {string}
* @memberof AppFileUpload
*/
@Prop() public uploadparams?: string;
@Prop() public uploadparams?: any;
/**
* 下载参数
......@@ -154,15 +170,7 @@ export default class AppFileUpload extends Vue {
* @type {string}
* @memberof AppFileUpload
*/
@Prop() public exportparams?: string;
/**
* 自定义参数
*
* @type {*}
* @memberof AppFileUpload
*/
@Prop() public customparams?: any;
@Prop() public exportparams?: any;
/**
* 上传文件路径
......@@ -186,20 +194,20 @@ export default class AppFileUpload extends Vue {
public files = [];
/**
* 上传keys
* 上传params
*
* @type {Array<any>}
* @memberof AppFileUpload
*/
public upload_keys: Array<any> = [];
public upload_params: Array<any> = [];
/**
* 导出keys
* 导出params
*
* @type {Array<any>}
* @memberof AppFileUpload
*/
public export_keys: Array<any> = [];
public export_params: Array<any> = [];
/**
* 自定义数组
......@@ -239,31 +247,37 @@ export default class AppFileUpload extends Vue {
* @memberof AppFileUpload
*/
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}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) {
_url = `${_url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`;
if (this.upload_params.length > 0 ) {
_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.files.forEach((file: any) => {
let url = `${this.downloadUrl}/${file.id}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) {
url = `${url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`;
if (this.export_params.length > 0) {
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;
});
}
/**
* vue 生命周期
*
......@@ -290,28 +304,37 @@ export default class AppFileUpload extends Vue {
public mounted() {
this.appData = this.$store.getters.getAppData();
let uploadparams: string = '';
let exportparams: string = '';
let uploadparams: any = {};
let exportparams: any = {};
let upload_keys: Array<string> = [];
let export_keys: Array<string> = [];
let upload_params: Array<string> = [];
let export_params: 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, '')) {
uploadparams = this.uploadparams;
upload_keys = uploadparams.split(';');
upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
}
if (this.exportparams && !Object.is(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) => {
custom_arr.push(`${name}=${this.customparams[name]}`);
});
for (const item in upload_params) {
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.dataProcess();
......
.app-form-group {
>.ivu-card-head {
>p {
>i {
......@@ -7,9 +8,12 @@
}
}
}
>.ivu-card-extra {
.item-extract-mode {
display: flex;
.item {
margin-left: 12px;
}
......@@ -18,6 +22,7 @@
}
.app-form-group.app-group-collapse-contant {
.ivu-card-body {
display: none;
}
......@@ -25,9 +30,12 @@
.app-group-flex {
height: 100%;
overflow: auto;
> .ivu-card-body {
overflow-y: auto;
overflow-x: hidden;
>.ivu-card-body {
height: calc(100% - 51px);
overflow: auto;
overflow-y: auto;
overflow-x: hidden;
}
}
\ No newline at end of file
<template>
<div class="app-form-group">
<div v-if="uiStyle=='STYLE2'">
<div :class="classes">
<template v-if="uiStyle=='STYLE2'">
<app-form-group2
:caption="caption"
:uiStyle="uiStyle"
......@@ -10,8 +10,8 @@
:titleBarCloseMode="titleBarCloseMode">
<slot></slot>
</app-form-group2>
</div>
<div v-else>
</template>
<template v-else>
<card v-if="isShowCaption === true" :bordered="false" :dis-hover="true" :class="classes">
<p class='' slot='title'>
<icon v-if="titleBarCloseMode !== 0" :type="collapseContant ? 'ios-arrow-dropright-circle' : 'ios-arrow-dropdown-circle'"
......@@ -87,17 +87,17 @@
</template>
</a >
</template>
<div v-if="Object.is(layoutType, 'FLEX')">
<template v-if="Object.is(layoutType, 'FLEX')">
<slot></slot>
</div>
<div v-if="!Object.is(layoutType, 'FLEX')">
</template>
<template v-if="!Object.is(layoutType, 'FLEX')">
<row :gutter="10"><slot></slot></row>
</div>
</template>
</card>
<row v-if="isShowCaption === false" :class="classes">
<slot></slot>
</row>
</div>
<template v-if="isShowCaption === false">
<slot></slot>
</template>
</template>
</div>
</template>
......
.app-form-item {
// margin-bottom: 16px;
>.ivu-form-item-label {
text-decoration: none;
display: block;
overflow: hidden;
white-space: nowrap;
}
>.ivu-form-item-content {
min-height: 36px;
}
height: 100%;
.editor {
height: 100%;
.ivu-form-item-content {
height: 100%;
min-height: 36px;
}
}
.app-form-item-label {
padding: 6px 10px 6px 0px;
}
}
.app-form-item-label-top {
>.ivu-form-item-label {
float: none;
display: inline-block;
padding: 0 0 10px;
}
.app-form-item.label-top, .app-form-item.label-bottom {
.app-form-item-label {
display: block;
}
}
.app-form-item-label-left{
.app-form-item-label{
float: left;
text-align: right;
padding-right: 12px;
.app-form-item.label-left, .app-form-item.label-right {
.app-form-item-label, .editor {
height: 100%;
}
}
.app-form-item-label-right{
.app-form-item-label{
float: right;
text-align: left;
padding-left: 12px;
.app-form-item.label-left {
.app-form-item-label {
float: left;
text-align: right;
}
}
.app-form-item-label-top{
.app-form-item-label{
display: block;
padding-bottom: 10px;
.app-form-item.label-right {
.app-form-item-label {
float: right;
padding: 6px 0px 6px 10px;
}
}
.app-form-item-label-bottom{
.app-form-item-label{
display: block;
padding-top: 10px;
.app-form-item.label-none {
.app-form-item-label {
display: none !important;
}
}
\ No newline at end of file
<template>
<div>
<div v-if="this.uiStyle === 'STYLE2'">
<app-form-item2
<div :class="classes">
<template v-if="this.uiStyle === 'STYLE2'">
<app-form-item2
:caption="caption"
:labelStyle="labelStyle"
:error="error"
......@@ -14,248 +14,261 @@
:itemRules="itemRules">
<slot></slot>
</app-form-item2>
</div>
<div v-if="this.uiStyle !== 'STYLE2'">
<form-item
:prop="name"
:error="error"
:required="required"
:rules="rules"
:class="classes">
<div v-if="Object.is(this.labelPos,'BOTTOM') || Object.is(this.labelPos,'NONE') || !this.labelPos" class="slot-editor" :style="slotstyle">
</template>
<template v-if="this.uiStyle !== 'STYLE2'">
<div
v-if="Object.is(this.labelPos,'BOTTOM') || Object.is(this.labelPos,'NONE') || !this.labelPos"
class="editor"
:style="slotstyle"
>
<form-item :prop="name" :error="error" :required="required" :rules="rules">
<slot></slot>
</div>
<span v-if="!Object.is(this.labelPos,'NONE') && this.isShowCaption && this.labelWidth > 0" :style="labelstyle" :class="labelclasses">
{{this.isEmptyCaption ? '' : this.caption}}
</span>
<div v-if="Object.is(this.labelPos,'TOP') || Object.is(this.labelPos,'LEFT') || Object.is(this.labelPos,'RIGHT')" class="slot-editor" :style="slotstyle">
</form-item>
</div>
<span
v-if="!Object.is(this.labelPos,'NONE') && this.isShowCaption && this.labelWidth > 0"
: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>
</div>
</form-item>
</div>
</form-item>
</div>
</template>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
import { Vue, Component, Prop, Watch } from "vue-property-decorator";
@Component({})
export default class AppFormItem extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public caption!: string;
/**
* 名称
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public caption!: string;
/**
* 错误信息
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public error?: string;
/**
* 错误信息
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public error?: string;
/**
* label样式
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public labelStyle?: string;
/**
* label样式
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public labelStyle?: string;
/**
* 标签位置
*
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppFormItem
*/
@Prop() public labelPos?: string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP';
/**
* 标签位置
*
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppFormItem
*/
@Prop() public labelPos?:
| string
| "BOTTOM"
| "LEFT"
| "NONE"
| "RIGHT"
| "TOP";
/**
* 标签宽度
*
* @type {number}
* @memberof AppFormItem
*/
@Prop({}) public labelWidth!: number;
/**
* 标签宽度
*
* @type {number}
* @memberof AppFormItem
*/
@Prop({}) public labelWidth!: number;
/**
* 是否显示标题
*
* @type {boolean}
* @memberof AppFormItem
*/
@Prop() public isShowCaption?: boolean;
/**
* 是否显示标题
*
* @type {boolean}
* @memberof AppFormItem
*/
@Prop() public isShowCaption?: boolean;
/**
* 标签是否空白
*
* @type {boolean}
* @memberof AppFormItem
*/
@Prop() public isEmptyCaption?: boolean;
/**
* 标签是否空白
*
* @type {boolean}
* @memberof AppFormItem
*/
@Prop() public isEmptyCaption?: boolean;
/**
* 表单项名称
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public name!: string;
/**
* 表单项名称
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public name!: string;
/**
* 内置样式
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public uiStyle?: string;
/**
* 内置样式
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public uiStyle?: string;
/**
* 表单项值规则
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public itemRules!: any;
/**
* 表单项值规则
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public itemRules!: any;
/**
* 值规则数组
*
* @type {any[]}
* @memberof AppFormItem
*/
public rules: any[] = [];
/**
* 值规则数组
*
* @type {any[]}
* @memberof AppFormItem
*/
public rules: any[] = [];
/**
* 是否必填
*
* @type {boolean}
* @memberof AppFormItem
*/
public required: boolean = false;
/**
* 是否必填
*
* @type {boolean}
* @memberof AppFormItem
*/
public required: boolean = false;
/**
* 表单项值规则监控
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppFormItem
*/
@Watch('itemRules',{deep:true})
onItemRulesChange(newVal: any, oldVal: any) {
if (newVal) {
try {
this.rules = [];
const _rules: any[] = newVal;
this.rules = [..._rules];
this.rules.some((rule: any) => {
if (rule.hasOwnProperty('required')) {
this.required = rule.required;
return true;
}
return false;
});
} catch (error) {
}
}
/**
* 表单项值规则监控
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppFormItem
*/
@Watch("itemRules", { deep: true })
onItemRulesChange(newVal: any, oldVal: any) {
if (newVal) {
try {
this.rules = [];
const _rules: any[] = newVal;
this.rules = [..._rules];
this.rules.some((rule: any) => {
if (rule.hasOwnProperty("required")) {
this.required = rule.required;
return true;
}
return false;
});
} catch (error) {}
}
}
/**
* 计算样式
*
* @readonly
* @type {string []}
* @memberof AppFormItem
*/
get classes(): string[] {
let posClass = '';
switch (this.labelPos) {
case 'TOP':
posClass = 'app-form-item-label-top';
break;
case 'LEFT':
posClass = 'app-form-item-label-left';
break;
case 'BOTTOM':
posClass = 'app-form-item-label-bottom';
break;
case 'RIGHT':
posClass = 'app-form-item-label-right';
break;
case 'NONE':
posClass = 'app-form-item-label-none';
break;
}
return [
'app-form-item',
posClass
];
/**
* 计算样式
*
* @readonly
* @type {string []}
* @memberof AppFormItem
*/
get classes(): string[] {
let posClass = "";
switch (this.labelPos) {
case "TOP":
posClass = "label-top";
break;
case "LEFT":
posClass = "label-left";
break;
case "BOTTOM":
posClass = "label-bottom";
break;
case "RIGHT":
posClass = "label-right";
break;
case "NONE":
posClass = "label-none";
break;
}
return [ "app-form-item", posClass ];
}
/**
* label样式
*
* @readonly
* @type {string}
* @memberof AppFormItem
*/
get labelclasses():string{
return this.labelStyle?this.labelStyle+' app-form-item-label':'app-form-item-label';
}
/**
* label样式
*
* @readonly
* @type {string}
* @memberof AppFormItem
*/
get labelclasses(): string {
return this.labelStyle
? this.labelStyle + " app-form-item-label"
: "app-form-item-label";
}
/**
* label行内样式
*
* @readonly
* @type {string}
* @memberof AppFormItem
*/
get labelstyle():any{
return {width:this.labelWidth+'px'};
/**
* label行内样式
*
* @readonly
* @type {string}
* @memberof AppFormItem
*/
get labelstyle(): any {
if (Object.is(this.labelPos, 'LEFT') || Object.is(this.labelPos, 'RIGHT')) {
return { width: this.labelWidth + "px" };
}
}
/**
* slot行内样式
*
* @readonly
* @type {string}
* @memberof AppFormItem
*/
get slotstyle():any{
if(Object.is(this.labelPos,'LEFT')){
return {marginLeft:this.labelWidth+'px'};
}else if(Object.is(this.labelPos,'RIGHT')){
return {marginRight:this.labelWidth+'px'};
}
/**
* slot行内样式
*
* @readonly
* @type {string}
* @memberof AppFormItem
*/
get slotstyle(): any {
if (Object.is(this.labelPos, "LEFT")) {
return { marginLeft: this.labelWidth + "px" };
} else if (Object.is(this.labelPos, "RIGHT")) {
return { marginRight: this.labelWidth + "px" };
}
}
/**
* vue 生命周期
*
* @memberof AppFormItem
*/
public mounted() {
if (this.itemRules) {
try {
const _rules: any[] = this.itemRules;
this.rules = [..._rules];
this.rules.some((rule: any) => {
if (rule.hasOwnProperty('required')) {
this.required = rule.required;
return true;
}
return false;
});
} catch (error) {
}
}
/**
* vue 生命周期
*
* @memberof AppFormItem
*/
public mounted() {
if (this.itemRules) {
try {
const _rules: any[] = this.itemRules;
this.rules = [..._rules];
this.rules.some((rule: any) => {
if (rule.hasOwnProperty("required")) {
this.required = rule.required;
return true;
}
return false;
});
} catch (error) {}
}
}
}
</script>
<style lang='less'>
@import './app-form-item.less';
@import "./app-form-item.less";
</style>
\ No newline at end of file
......@@ -15,7 +15,7 @@
overflow: auto;
> .ivu-tabs-tabpane {
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 {
*/
@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 {
@Provide() public files = [];
/**
* 上传keys
* 上传params
*
* @type {Array<any>}
* @memberof AppImageUpload
*/
public upload_keys: Array<any> = [];
public upload_params: Array<any> = [];
/**
* 导出keys
* 导出params
*
* @type {Array<any>}
* @memberof AppImageUpload
*/
public export_keys: Array<any> = [];
public export_params: Array<any> = [];
/**
* 自定义数组
......@@ -238,26 +254,31 @@ export default class AppImageUpload extends Vue {
* @memberof AppImageUpload
*/
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}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) {
_url = `${_url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`;
if (this.upload_params.length > 0 ) {
_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.files.forEach((file: any) => {
let url = `${this.downloadUrl}/${file.id}`;
if (upload_arr.length > 0 || this.custom_arr.length > 0) {
url = `${url}?${upload_arr.join('&')}${upload_arr.length > 0 ? '&' : ''}${this.custom_arr.join('&')}`;
if (this.export_params.length > 0) {
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;
});
......@@ -288,28 +309,35 @@ export default class AppImageUpload extends Vue {
public mounted() {
this.appData = this.$store.getters.getAppData();
let uploadparams: string = '';
let exportparams: string = '';
let uploadparams: any = {};
let exportparams: any = {};
let upload_keys: Array<string> = [];
let export_keys: Array<string> = [];
let upload_params: Array<string> = [];
let export_params: 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, '')) {
uploadparams = this.uploadparams;
upload_keys = uploadparams.split(';');
upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
}
if (this.exportparams && !Object.is(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) => {
custom_arr.push(`${name}=${this.customparams[name]}`);
});
for (const item in upload_params) {
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.dataProcess();
......
......@@ -324,10 +324,10 @@ export default class AppPickerSelectView extends Vue {
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();
}
......
......@@ -242,7 +242,7 @@ export default class AppPicker extends Vue {
* @param {*} oldVal
* @memberof AppPicker
*/
@Watch('value')
@Watch('value',{immediate: true})
public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
......
......@@ -148,11 +148,19 @@ export default class AppSpan extends Vue {
if(this.tag){
return; //代码表走codelist组件
}else if(this.editorType === "ADDRESSPICKUP"){
JSON.parse(this.value).forEach((item:any,index:number) => {
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext;
});
if(this.$util.isEmpty(this.value)){
this.text = '';
}else{
JSON.parse(this.value).forEach((item:any,index:number) => {
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext;
});
}
}else{
this.text = this.value;
if(this.$util.isEmpty(this.value)){
this.text = '';
}else{
this.text = this.value;
}
}
}
......
......@@ -5,4 +5,7 @@
margin-right: 10px;
padding: 0 5px;
}
}
.user-dropdownMenu{
margin-top: 9px;
}
\ No newline at end of file
<template>
<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'>
<span>{{user.name ? user.name : $t('components.appUser.name')}}</span>
&nbsp;&nbsp;<avatar :src="user.avatar" />
</div>
<dropdown-menu class='menu' slot='list' 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>
</dropdown-item>
</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 @@
top: 0;
right: 20px;
}
.ivu-input-number-input{
text-align: right;
}
}
\ No newline at end of file
<template>
<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"
:size="size"
:type="type"
v-model="CurrentVal"
:disabled="disabled ? true : false"
:autosize="autoSize"
@on-enter="enter"
></i-input>
<div class="unit-text">{{unit}}</div>
......@@ -62,13 +70,33 @@ export default class InputBox extends Vue {
*/
@Prop() public type?: string;
/**
* 精度
*
* @type {number}
* @memberof InputBox
*/
@Prop({default: 0}) public precision?: number;
/**
* 多行文本行数
*
* @type {string}
* @memberof InputBox
*/
@Prop() public autoSize?: any;
/**
* 当前值
*
* @memberof InputBox
*/
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 {
* @memberof Login
*/
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;
let validatestate: boolean = true;
form.validate((valid: boolean) => {
......
......@@ -227,7 +227,7 @@ export default class TabPageExp extends Vue {
* @memberof TabPageExp
*/
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;
}
this.$store.commit("setCurPageCaption", {
......
......@@ -103,7 +103,7 @@ export default class EditViewEngine extends ViewEngine {
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.setTabCaption(this.view.model.dataInfo);
this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
}
......@@ -117,7 +117,7 @@ export default class EditViewEngine extends ViewEngine {
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.setTabCaption(this.view.model.dataInfo);
this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.view.$emit('save',arg);
......@@ -245,14 +245,21 @@ export default class EditViewEngine extends ViewEngine {
*
* @memberof EditViewEngine
*/
public setTabCaption(info: string): void {
public setTabCaption(info: string,isNew:boolean): void {
let viewdata: any = this.view.model;
if (viewdata && info && !Object.is(info, '') && this.view.$tabPageExp && (viewdata.srfTitle.indexOf(" - ") === -1)) {
this.view.$tabPageExp.setCurPageCaption(viewdata.srfTitle, viewdata.srfTitle, info);
let index:number = viewdata.srfTitle.indexOf("-");
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){
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 {
* @memberof MDViewEngine
*/
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) {
this.view.$emit('viewload', args);
}
......@@ -391,11 +400,11 @@ export default class MDViewEngine extends ViewEngine {
}
// 快速分组和快速搜索栏
let otherQueryParam:any = {};
if(this.view && this.view.qucikGroupData){
Object.assign(otherQueryParam,this.view.qucikGroupData);
if(this.view && this.view.quickGroupData){
Object.assign(otherQueryParam,this.view.quickGroupData);
}
if(this.view && this.view.qucikFormData){
Object.assign(otherQueryParam,this.view.qucikFormData);
if(this.view && this.view.quickFormData){
Object.assign(otherQueryParam,this.view.quickFormData);
}
Object.assign(arg,{viewparams:otherQueryParam});
}
......
......@@ -6,50 +6,50 @@ import userCustom_en_US from '@locale/lanres/userCustom/userCustom_en_US';
export default {
app: {
commonWords:{
error: 'Error',
success: 'Success',
ok: 'OK',
cancel: 'Cancel',
error: "Error",
success: "Success",
ok: "OK",
cancel: "Cancel",
},
local:{
new: 'New'
new: "New"
},
gridpage: {
choicecolumns: 'Choice columns',
refresh: 'refresh',
show: 'Show',
records: 'records',
totle: 'totle',
choicecolumns: "Choice columns",
refresh: "refresh",
show: "Show",
records: "records",
totle: "totle",
},
tabpage: {
sureclosetip: {
title: 'Close warning',
content: 'Form data Changed, are sure close?',
title: "Close warning",
content: "Form data Changed, are sure close?",
},
closeall: 'Close all',
closeother: 'Close other',
closeall: "Close all",
closeother: "Close other",
},
fileUpload: {
caption: 'Upload',
caption: "Upload",
},
searchButton: {
search: 'Search',
reset: 'Reset',
search: "Search",
reset: "Reset",
},
calendar:{
today: 'today',
month: 'month',
week: 'week',
day: 'day',
list: 'list',
dateSelectModalTitle: 'select the time you wanted',
gotoDate: 'goto',
today: "today",
month: "month",
week: "week",
day: "day",
list: "list",
dateSelectModalTitle: "select the time you wanted",
gotoDate: "goto",
},
// 非实体视图
views: {
sdindexview: {
caption: 'ibizlab-disk',
title: 'ibizlab-disk',
caption: "ibizlab-disk",
title: "ibizlab-disk",
},
},
utilview:{
......@@ -59,7 +59,7 @@ export default {
},
menus: {
sdindexview: {
menuitem1: '文件',
menuitem1: "文件",
},
},
},
......
......@@ -6,50 +6,50 @@ import userCustom_zh_CN from '@locale/lanres/userCustom/userCustom_zh_CN';
export default {
app: {
commonWords:{
error: '失败',
success: '成功',
ok: '确认',
cancel: '取消',
error: "失败",
success: "成功",
ok: "确认",
cancel: "取消",
},
local:{
new: '新建'
new: "新建"
},
gridpage: {
choicecolumns: '选择列',
refresh: '刷新',
show: '显示',
records: '条',
totle: '共',
choicecolumns: "选择列",
refresh: "刷新",
show: "显示",
records: "条",
totle: "共",
},
tabpage: {
sureclosetip: {
title: '关闭提醒',
content: '表单数据已经修改,确定要关闭?',
title: "关闭提醒",
content: "表单数据已经修改,确定要关闭?",
},
closeall: '关闭所有',
closeother: '关闭其他',
closeall: "关闭所有",
closeother: "关闭其他",
},
fileUpload: {
caption: '上传',
caption: "上传",
},
searchButton: {
search: '搜索',
reset: '重置',
search: "搜索",
reset: "重置",
},
calendar:{
today: '今天',
month: '月',
week: '周',
day: '天',
list: '列',
dateSelectModalTitle: '选择要跳转的时间',
gotoDate: '跳转',
today: "今天",
month: "月",
week: "周",
day: "天",
list: "列",
dateSelectModalTitle: "选择要跳转的时间",
gotoDate: "跳转",
},
// 非实体视图
views: {
sdindexview: {
caption: 'ibizlab-disk',
title: 'ibizlab-disk',
caption: "ibizlab-disk",
title: "ibizlab-disk",
},
},
utilview:{
......@@ -59,7 +59,7 @@ export default {
},
menus: {
sdindexview: {
menuitem1: '文件',
menuitem1: "文件",
},
},
},
......
export default {
SysOperator: {
empty: '',
"empty": "",
},
};
\ No newline at end of file
export default {
SysOperator: {
empty: '',
"empty": "",
},
};
\ No newline at end of file
......@@ -3,11 +3,11 @@ export default {
views: {
gridview: {
caption: "文件",
title: '文件表格视图',
title: "文件表格视图",
},
editview: {
caption: "文件",
title: '文件编辑视图',
title: "文件编辑视图",
},
},
main_form: {
......
export default {
views: {
gridview: {
caption: '文件',
title: '文件表格视图',
caption: "文件",
title: "文件表格视图",
},
editview: {
caption: '文件',
title: '文件编辑视图',
caption: "文件",
title: "文件编辑视图",
},
},
main_form: {
details: {
group1: '文件基本信息',
formpage1: '基本信息',
srfupdatedate: '更新时间',
srforikey: '',
srfkey: '标识',
srfmajortext: '名称',
srftempmode: '',
srfuf: '',
srfdeid: '',
srfsourcekey: '',
filename: '名称',
filepath: '路径',
filesize: '文件大小',
fileext: '扩展名',
folder: '特定目录',
digestcode: '签名',
ownerid: '所属主体',
ownertype: '所属类型',
memo: '备注',
createman: '创建人',
createdate: '创建日期',
updateman: '更新人',
updatedate: '更新时间',
fileid: '标识',
group1: "文件基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "标识",
srfmajortext: "名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
filename: "名称",
filepath: "路径",
filesize: "文件大小",
fileext: "扩展名",
folder: "特定目录",
digestcode: "签名",
ownerid: "所属主体",
ownertype: "所属类型",
memo: "备注",
createman: "创建人",
createdate: "创建日期",
updateman: "更新人",
updatedate: "更新时间",
fileid: "标识",
},
uiactions: {
},
},
main_grid: {
columns: {
fileid: '标识',
filename: '名称',
filepath: '路径',
filesize: '文件大小',
fileext: '扩展名',
folder: '特定目录',
ownertype: '所属类型',
ownerid: '所属主体',
createdate: '创建日期',
updatedate: '更新时间',
fileid: "标识",
filename: "名称",
filepath: "路径",
filesize: "文件大小",
fileext: "扩展名",
folder: "特定目录",
ownertype: "所属类型",
ownerid: "所属主体",
createdate: "创建日期",
updatedate: "更新时间",
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: '常规条件',
n_filename_like: '名称(文本包含(%))',
formpage1: "常规条件",
n_filename_like: "名称(文本包含(%))",
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: '新建',
tip: '新建',
caption: "新建",
tip: "新建",
},
tbitem4: {
caption: '编辑',
tip: '编辑',
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: '拷贝',
tip: '拷贝',
caption: "拷贝",
tip: "拷贝",
},
tbitem7: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem8: {
caption: '删除',
tip: '删除',
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem13: {
caption: '导出',
tip: '导出',
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem16: {
caption: '其它',
tip: '其它',
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: '导出数据模型',
tip: '导出数据模型',
caption: "导出数据模型",
tip: "导出数据模型",
},
tbitem23: {
caption: '数据导入',
tip: '数据导入',
caption: "数据导入",
tip: "数据导入",
},
tbitem17: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem19: {
caption: '过滤',
tip: '过滤',
caption: "过滤",
tip: "过滤",
},
tbitem18: {
caption: '帮助',
tip: '帮助',
caption: "帮助",
tip: "帮助",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: '保存',
tip: '保存',
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: '保存并新建',
tip: '保存并新建',
caption: "保存并新建",
tip: "保存并新建",
},
tbitem5: {
caption: '保存并关闭',
tip: '保存并关闭',
caption: "保存并关闭",
tip: "保存并关闭",
},
tbitem6: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem7: {
caption: '删除并关闭',
tip: '删除并关闭',
caption: "删除并关闭",
tip: "删除并关闭",
},
tbitem8: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem12: {
caption: '新建',
tip: '新建',
caption: "新建",
tip: "新建",
},
tbitem13: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem14: {
caption: '拷贝',
tip: '拷贝',
caption: "拷贝",
tip: "拷贝",
},
tbitem16: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem23: {
caption: '第一个记录',
tip: '第一个记录',
caption: "第一个记录",
tip: "第一个记录",
},
tbitem24: {
caption: '上一个记录',
tip: '上一个记录',
caption: "上一个记录",
tip: "上一个记录",
},
tbitem25: {
caption: '下一个记录',
tip: '下一个记录',
caption: "下一个记录",
tip: "下一个记录",
},
tbitem26: {
caption: '最后一个记录',
tip: '最后一个记录',
caption: "最后一个记录",
tip: "最后一个记录",
},
tbitem21: {
caption: '-',
tip: '',
caption: "-",
tip: "",
},
tbitem22: {
caption: '帮助',
tip: '帮助',
caption: "帮助",
tip: "帮助",
},
},
};
\ No newline at end of file
......@@ -25,7 +25,7 @@ mock.onGet('v7/sdindex-viewappmenu').reply((config: any) => {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: 'Auto1',
resourcetag: '',
},
],
......
......@@ -3,92 +3,89 @@
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sdfileeditview"></app-studioaction>
<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>
</p>
<div slot="extra">
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='sx-tb-saveandnew'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)">
<i class='sx-tb-saveandclose'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)">
<i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)">
<i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.tip')}}</div>
</tooltip>
<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 class='fa fa-fast-backward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem23.tip')}}</div>
</tooltip>
<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 class='fa fa-step-backward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem24.tip')}}</div>
</tooltip>
<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 class='fa fa-step-forward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem25.tip')}}</div>
</tooltip>
<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 class='fa fa-fast-forward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem26.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem22.visabled" :disabled="toolBarModels.tbitem22.disabled" class='' @click="toolbar_click({ tag: 'tbitem22' }, $event)">
<i class='fa fa-question'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.tip')}}</div>
</tooltip>
</div>
</div>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='sx-tb-saveandnew'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem5.visabled" :disabled="toolBarModels.tbitem5.disabled" class='' @click="toolbar_click({ tag: 'tbitem5' }, $event)">
<i class='sx-tb-saveandclose'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem5.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem7.visabled" :disabled="toolBarModels.tbitem7.disabled" class='' @click="toolbar_click({ tag: 'tbitem7' }, $event)">
<i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem7.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem12.visabled" :disabled="toolBarModels.tbitem12.disabled" class='' @click="toolbar_click({ tag: 'tbitem12' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem12.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem14.visabled" :disabled="toolBarModels.tbitem14.disabled" class='' @click="toolbar_click({ tag: 'tbitem14' }, $event)">
<i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem14.tip')}}</div>
</tooltip>
<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 class='fa fa-fast-backward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem23.tip')}}</div>
</tooltip>
<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 class='fa fa-step-backward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem24.tip')}}</div>
</tooltip>
<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 class='fa fa-step-forward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem25.tip')}}</div>
</tooltip>
<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 class='fa fa-fast-forward'></i>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem26.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem22.visabled" :disabled="toolBarModels.tbitem22.disabled" class='' @click="toolbar_click({ tag: 'tbitem22' }, $event)">
<i class='fa fa-question'></i>
<span class='caption'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sdfile.editviewtoolbar_toolbar.tbitem22.tip')}}</div>
</tooltip>
</div>
</div>
<div class="content-container">
<div class='view-top-messages'>
</div>
......@@ -122,9 +119,10 @@
</template>
<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 { Subject } from 'rxjs';
import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import SDFileService from '@/service/sdfile/sdfile-service';
import EditViewEngine from '@engine/view/edit-view-engine';
......@@ -190,6 +188,15 @@ export default class SDFileEditViewBase extends Vue {
*/
@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 {
});
}
/**
* 应用导航服务
*
* @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 {
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof SDFileEditViewBase
*/
public viewCacheData:any;
/**
* 解析视图参数
*
* @public
* @memberof SDFileEditViewBase
*/
public parseViewParam(): void {
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
......@@ -417,12 +449,17 @@ export default class SDFileEditViewBase extends Vue {
});
});
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){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
......@@ -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 {
* @memberof SDFileEditViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_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 {
* @memberof SDFileEditViewBase
*/
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 {
* @memberof SDFileEditViewBase
*/
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 {
* @memberof SDFileEditViewBase
*/
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 {
* @memberof SDFileEditViewBase
*/
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 {
}
})
}
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';
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
......
......@@ -2,9 +2,9 @@
<div class='view-container degridview sdfile-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sdfilegridview"></app-studioaction>
<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>
</p>
</div>
<div class='content-container'>
<div class='view-top-messages'>
</div>
......@@ -146,9 +146,10 @@
<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 { Subject } from 'rxjs';
import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
import SDFileService from '@/service/sdfile/sdfile-service';
import GridViewEngine from '@engine/view/grid-view-engine';
......@@ -216,6 +217,15 @@ export default class SDFileGridViewBase extends Vue {
*/
@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 {
});
}
/**
* 应用导航服务
*
* @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 {
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof SDFileGridViewBase
*/
public viewCacheData:any;
/**
* 解析视图参数
*
* @public
* @memberof SDFileGridViewBase
*/
public parseViewParam(): void {
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
......@@ -448,12 +483,17 @@ export default class SDFileGridViewBase extends Vue {
});
});
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){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
......@@ -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 {
* @memberof SDFileGridViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_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){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'save')){
......@@ -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
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
......
......@@ -12,7 +12,6 @@ import i18n from '@/locale'
import 'element-ui/lib/theme-chalk/index.css';
import 'view-design/dist/styles/iview.css';
import 'ibiz-vue-lib/lib/ibiz-vue-lib.css';
import '@/styles/default.less';
// 模拟数据
......
......@@ -6,8 +6,8 @@
<sider :width="collapseChange ? 64 : 200" hide-trigger v-model="collapseChange">
<div class="sider-top">
<div class="page-logo">
<img v-show="collapseChange" src="../../../assets/img/logo.png" height="16" />
<span v-show="!collapseChange" style="display: block;text-align: center;font-weight: 300;font-size: 20px;">{{$t(model.srfCaption)}}</span>
<span class="menuicon" @click="contextMenuDragVisiable=!contextMenuDragVisiable"><Icon type="md-menu" /></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>
<view_appmenu
......@@ -16,7 +16,9 @@
:context="context"
:showBusyIndicator="true"
v-model="collapseChange"
:mode="mode"
:mode="mode"
:navModel="navModel"
viewtag="sdindex-view"
:selectTheme="selectTheme"
:isDefaultPage="isDefaultPage"
:defPSAppView="defPSAppView"
......@@ -24,6 +26,7 @@
ref='appmenu'
@closeview="closeView($event)">
</view_appmenu>
<context-menu-drag :contextMenuDragVisiable="contextMenuDragVisiable"></context-menu-drag>
</sider>
<layout>
<header class="index_header">
......@@ -31,7 +34,7 @@
<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-unfold" @click="handleClick"></i>
<app-breadcrumb :defPSAppView="defPSAppView"></app-breadcrumb>
<app-breadcrumb :navModel="navModel" indexViewTag="sdindex-view"></app-breadcrumb>
</div>
</div>
<div class="header-right" style="display: flex;align-items: center;justify-content: space-between;">
......@@ -42,8 +45,8 @@
<app-theme style="width:45px;display: flex;justify-content: center;"></app-theme>
</div>
</header>
<content class="index_content" :style="{'width':this.collapseChange ? 'calc(100vw - 64px)' : 'calc(100vw - 200px)' }">
<tab-page-exp></tab-page-exp>
<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 v-if="Object.is(navModel,'tab')"></tab-page-exp>
<app-keep-alive :routerList="getRouterList">
<router-view :key="getRouterViewKey"></router-view>
</app-keep-alive>
......@@ -56,9 +59,10 @@
</template>
<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 { 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 {
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
......@@ -237,6 +242,23 @@ export default class SDIndexViewBase extends Vue {
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 {
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof SDIndexViewBase
*/
public viewCacheData:any;
/**
* 解析视图参数
*
* @public
* @memberof SDIndexViewBase
*/
public parseViewParam(): void {
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
......@@ -293,6 +323,8 @@ export default class SDIndexViewBase extends Vue {
Object.assign(this.context,this.$store.getters.getAppData().context);
}
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
......@@ -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 {
* @memberof SDIndexViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_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 {
*/
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 @@
}
.sdindex-view{
position: relative;
}
.index_view{
margin-bottom: 1px;
width: 100%;
......@@ -19,6 +21,7 @@
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
.page-logo{
display: flex;
align-items: center;
......@@ -73,7 +76,6 @@
}
}
.ivu-layout .ivu-layout-sider .ivu-layout-sider-children .sider-top{
padding: 4px;
margin-top: -2px;
line-height: 58px;
text-align: center;
......@@ -81,11 +83,22 @@
cursor: pointer;
}
.sider-top{
padding: 0px;
margin-bottom: 1px;
height:65px;
box-shadow: 0 1px 2px 0 rgba(0,0,0,.15);
> .page-logo{
display: flex;
align-items: center;
height: 100%;
>.menuicon{
display: block;
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
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
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 {
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
----
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 @@
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 {
height: calc(100% - 65px);
padding: 0 12px;
margin: 0px 12px;
background: white;
box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
// flex-direction: column;
......@@ -74,18 +87,29 @@
// display: flex;
// flex-direction: column;
> .ivu-card-head{
height: 50px;
min-height: 42px;
border-color: rgb(221, 221, 221);
border-style: solid;
border-width: 0px 0px 1px;
margin: 0px 0px 11px;
padding: 6px 0px;
> p{
height: 50px;
padding: 6px 0px 2px;
> .header-container{
min-height: 42px;
display: flex;
flex-wrap: nowrap;
align-items: flex-start;
justify-content: space-between;
> .caption-info{
line-height: 50px;
line-height: 42px;
font-size: 18px;
color: #1890ff;
flex-shrink: 0;
}
> .toolbar-container{
margin-left: auto;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
}
......@@ -237,12 +261,6 @@
}
}
// 清除看板里视图的阴影
.dashboard .portlet .view-container{
-webkit-box-shadow: none ;
box-shadow: none;
}
/*** END:多数据视图属性布局 ***/
// 看板视图,卡片模式
......
......@@ -4,29 +4,6 @@
.app-theme-icon {
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 {
......@@ -34,7 +11,12 @@
background-color: #4276a4;
.sider-top {
color: hsla(0,0%,100%,.8);
background: #2d5f8b;
background-color: #4276a4;
>.page-logo{
>.menuicon:hover{
background-color: #2d5f8b;
}
}
}
}
}
......
......@@ -3,30 +3,7 @@
> .ivu-layout-has-sider > .ivu-layout > header{
.app-theme-icon {
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-sider {
......@@ -34,6 +11,11 @@
.sider-top {
color: hsla(0,0%,100%,.8);
background-color: #20222A;
>.page-logo{
>.menuicon:hover{
background-color:#060708;
}
}
}
}
}
......
......@@ -4,38 +4,18 @@
.app-theme-icon {
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-sider {
background-color: #f6f6f6;
.sider-top {
background-color: #e8eaec;
.ivu-icon {
color: #aaaaaa;
}
background-color: #f6f6f6;
>.page-logo{
>.menuicon:hover{
background-color: #fff;
color:#000;
}
}
}
}
}
......
......@@ -132,13 +132,16 @@ export class Interceptors {
* @memberof Interceptors
*/
private doNoLogin(data: any = {}): void {
// 清除user和token
// 清除user、token和cookie
if(localStorage.getItem('user')){
localStorage.removeItem('user');
}
if(localStorage.getItem('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, '')) {
let _url = encodeURIComponent(encodeURIComponent(window.location.href));
let loginurl: string = data.loginurl;
......
......@@ -99,15 +99,17 @@ export class ViewTool {
let routePath: string = '';
let [arg] = args;
arg = arg ? arg : {};
deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
let value:any = null;
if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) {
value = viewParam[parameterName];
} else if (arg[parameterName] && !Object.is(arg[parameterName], '') && !Object.is(arg[parameterName], 'null')) {
value = arg[parameterName];
}
routePath = `${routePath}/${pathName}/${value}`;
});
if(deResParameters && deResParameters.length >0){
deResParameters.forEach(({ pathName, parameterName }: { pathName: string, parameterName: string }) => {
let value:any = null;
if (viewParam[parameterName] && !Object.is(viewParam[parameterName], '') && !Object.is(viewParam[parameterName], 'null')) {
value = viewParam[parameterName];
} else if (arg[parameterName] && !Object.is(arg[parameterName], '') && !Object.is(arg[parameterName], 'null')) {
value = arg[parameterName];
}
routePath = `${routePath}/${pathName}/${value}`;
});
}
return routePath;
}
......@@ -124,21 +126,23 @@ export class ViewTool {
public static getActiveRoutePath(parameters: any[], args: any[], data: any): string {
let routePath: string = '';
// 不存在应用实体
if (parameters.length === 1) {
const [{ pathName, parameterName }] = parameters;
routePath = `/${pathName}`;
if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
}
} else if (parameters.length === 2) {
let [arg] = args;
arg = arg ? arg : {};
const [{ pathName: _pathName, parameterName: _parameterName }, { pathName: _pathName2, parameterName: _parameterName2 }] = parameters;
const _value: any = arg[_parameterName] && !Object.is(arg[_parameterName], '') ?
arg[_parameterName] : null;
routePath = `/${_pathName}/${_value}/${_pathName2}`;
if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
if(parameters && parameters.length >0){
if (parameters.length === 1) {
const [{ pathName, parameterName }] = parameters;
routePath = `/${pathName}`;
if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
}
} else if (parameters.length === 2) {
let [arg] = args;
arg = arg ? arg : {};
const [{ pathName: _pathName, parameterName: _parameterName }, { pathName: _pathName2, parameterName: _parameterName2 }] = parameters;
const _value: any = arg[_parameterName] && !Object.is(arg[_parameterName], '') ?
arg[_parameterName] : null;
routePath = `/${_pathName}/${_value}/${_pathName2}`;
if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
}
}
}
return routePath;
......
......@@ -118,11 +118,12 @@
</template>
<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 { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import SDIndexViewService from './sdindex-view-appmenu-service';
import SDIndexViewModel from './sdindex-view-appmenu-model';
......@@ -140,7 +141,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 名称
*
* @type {string}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() public name?: string;
......@@ -148,7 +149,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() public viewState!: Subject<ViewState>;
......@@ -156,7 +157,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 应用上下文
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() public context: any;
......@@ -164,7 +165,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 视图参数
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() public viewparams: any;
......@@ -173,7 +174,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @public
* @type {(Subscription | undefined)}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public viewStateEvent: Subscription | undefined;
......@@ -181,7 +182,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 获取部件类型
*
* @returns {string}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public getControlType(): string {
return 'APPMENU'
......@@ -193,7 +194,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 建构部件服务对象
*
* @type {SDIndexViewService}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public service: SDIndexViewService = new SDIndexViewService({ $store: this.$store });
......@@ -203,7 +204,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 关闭视图
*
* @param {any} args
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public closeView(args: any): void {
let _this: any = this;
......@@ -213,7 +214,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/**
* 计数器刷新
*
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public counterRefresh(){
const _this:any =this;
......@@ -231,7 +232,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 获取多项数据
*
* @returns {any[]}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public getDatas(): any[] {
return [];
......@@ -241,18 +242,34 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 获取单项树
*
* @returns {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public getData(): any {
return null;
}
/**
* 导航模式(route:面包屑模式、tab:分页导航模式)
*
* @type {string}
* @memberof SDIndexViewBase
*/
@Prop({default:'tab'}) public navModel?:string;
/**
* 视图标识
*
* @type {string}
* @memberof SDIndexViewBase
*/
@Prop() public viewtag!:string;
/**
* 菜单模型
*
* @public
* @type {SDIndexViewModel}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public menuMode: SDIndexViewModel = new SDIndexViewModel();
......@@ -260,7 +277,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 显示处理提示
*
* @type {boolean}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
......@@ -269,7 +286,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @public
* @type {any[]}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Provide()
public menus: any[] = [];
......@@ -278,7 +295,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 菜单收缩改变
*
* @type {boolean}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Model() public collapsechange?: boolean;
......@@ -287,7 +304,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Watch('collapsechange')
onCollapsechangeChange(newVal: any, oldVal: any) {
......@@ -300,7 +317,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 当前模式,菜单在顶部还是在底部
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() mode: any;
......@@ -308,7 +325,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 当前菜单是否在默认视图上
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop({ default: false }) isDefaultPage?: boolean;
......@@ -316,7 +333,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 默认打开视图
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() defPSAppView: any;
......@@ -324,7 +341,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 默认激活的index
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Provide() defaultActive: any = null;
......@@ -332,7 +349,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 当前选中主题
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Prop() selectTheme: any;
......@@ -340,7 +357,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 默认打开的index数组
*
* @type {any[]}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Provide() public defaultOpeneds: any[] = [];
......@@ -348,7 +365,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 是否展开
*
* @type {boolean}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Provide() public isCollapse: boolean = false;
......@@ -356,7 +373,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 触发方式,默认click
*
* @type {string}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
@Provide() trigger: string = 'click';
......@@ -364,13 +381,13 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 计数器数据
*
* @type {*}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public counterdata: any = {};
/**
* vue 生命周期
*
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public created() {
this.afterCreated();
......@@ -379,7 +396,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/**
* 执行created后的逻辑
*
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public afterCreated(){
if (Object.is(this.mode, 'horizontal')) {
......@@ -398,7 +415,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/**
* vue 生命周期
*
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public destroyed() {
this.afterDestroy();
......@@ -407,7 +424,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
/**
* 执行destroyed后的逻辑
*
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
......@@ -420,7 +437,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 处理菜单默认选中项
*
* @public
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public doMenuSelect(): void {
if (!this.isDefaultPage) {
......@@ -462,7 +479,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {any[]} items
* @param {string} appfunctag
* @returns {boolean}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public computeMenuSelect(items: any[], appfunctag: string): boolean {
const appFuncs: any[] = this.menuMode.getAppFuncs();
......@@ -498,7 +515,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {any[]} items
* @param {string} name
* @returns
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public compute(items: any[], name: string) {
const item: any = {};
......@@ -525,7 +542,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @public
* @param {*} item
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public setHideSideBar(item: any): void {
if (item.hidesidebar) {
......@@ -539,7 +556,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {*} index
* @param {any[]} indexs
* @returns
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public select(index: any, indexs: any[]) {
let item = this.compute(this.menus, index);
......@@ -554,13 +571,17 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @public
* @param {*} item 菜单数据
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public click(item: any) {
if (item) {
let navDataService = NavDataService.getInstance(this.$store);
if(Object.is(this.navModel,"route")){
navDataService.removeNavData(this.viewtag);
}
switch (item.appfunctag) {
case '_2':
this.click_2(item);
case 'Auto1':
this.clickAuto1(item);
return;
default:
console.warn('未指定应用功能');
......@@ -575,7 +596,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* @param {*} [item={}]
* @memberof SDIndexView
*/
public click_2(item: any = {}) {
public clickAuto1(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......@@ -584,14 +605,19 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
{ pathName: 'gridview', parameterName: 'gridview' },
];
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
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public load(data: any) {
this.handleMenusResource(this.menuMode.getAppMenuItems());
......@@ -601,7 +627,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 通过统一资源标识计算菜单
*
* @param {*} data
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public handleMenusResource(inputMenus:Array<any>){
if(Environment.enablePermissionValid){
......@@ -616,7 +642,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
* 计算有效菜单项
*
* @param {*} data
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public computedEffectiveMenus(inputMenus:Array<any>){
inputMenus.forEach((_item:any) =>{
......@@ -634,7 +660,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @public
* @param {any[]} items
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
public dataProcess(items: any[]): void {
items.forEach((_item: any) => {
......@@ -652,7 +678,7 @@ export default class SDIndexViewBase extends Vue implements ControlInterface {
*
* @readonly
* @type {string}
* @memberof SDIndexView
* @memberof SDIndexViewBase
*/
get popperClass(): string {
return 'app-popper-menu ' + this.selectTheme;
......
......@@ -29,7 +29,7 @@ export default class SDIndexViewModel {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: 'Auto1',
resourcetag: '',
authtag:'web-SDIndexView-menuitem1',
},
......@@ -44,7 +44,7 @@ export default class SDIndexViewModel {
*/
public funcs: any[] = [
{
appfunctag: '_2',
appfunctag: 'Auto1',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'sdfilegridview',
......
......@@ -99,6 +99,9 @@ export default class ControlService {
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
......@@ -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));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
......
......@@ -22,11 +22,12 @@
</i-form>
</template>
<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 { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import SDFileService from '@/service/sdfile/sdfile-service';
import DefaultService from './default-searchform-service';
......@@ -45,7 +46,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 名称
*
* @type {string}
* @memberof Default
* @memberof DefaultBase
*/
@Prop() public name?: string;
......@@ -53,7 +54,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Default
* @memberof DefaultBase
*/
@Prop() public viewState!: Subject<ViewState>;
......@@ -61,7 +62,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 应用上下文
*
* @type {*}
* @memberof Default
* @memberof DefaultBase
*/
@Prop() public context: any;
......@@ -69,7 +70,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 视图参数
*
* @type {*}
* @memberof Default
* @memberof DefaultBase
*/
@Prop() public viewparams: any;
......@@ -78,7 +79,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*
* @public
* @type {(Subscription | undefined)}
* @memberof Default
* @memberof DefaultBase
*/
public viewStateEvent: Subscription | undefined;
......@@ -86,7 +87,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 获取部件类型
*
* @returns {string}
* @memberof Default
* @memberof DefaultBase
*/
public getControlType(): string {
return 'SEARCHFORM'
......@@ -98,7 +99,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Default
* @memberof DefaultBase
*/
public counterServiceArray:Array<any> = [];
......@@ -106,7 +107,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 建构部件服务对象
*
* @type {DefaultService}
* @memberof Default
* @memberof DefaultBase
*/
public service: DefaultService = new DefaultService({ $store: this.$store });
......@@ -114,7 +115,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 实体服务对象
*
* @type {SDFileService}
* @memberof Default
* @memberof DefaultBase
*/
public appEntityService: SDFileService = new SDFileService({ $store: this.$store });
......@@ -124,7 +125,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
* 关闭视图
*
* @param {any} args
* @memberof Default
* @memberof DefaultBase
*/
public closeView(args: any): void {
let _this: any = this;
......@@ -134,7 +135,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
/**
* 计数器刷新
*
* @memberof Default
* @memberof DefaultBase
*/
public counterRefresh(){
const _this:any =this;
......
!!!!模版产生代码错误:----
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)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 349, column 14]
----
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import SDFileService from '@/service/sdfile/sdfile-service';
import DefaultModel from './default-searchform-model';
/**
* Default 部件服务对象
*
* @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
----
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
----
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
----
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 @@
margin-bottom: unset !important;
}
}
.el-table__body .edit-cell{
padding:0;
.app-form-item{
margin-top: 20px;
margin-bottom: 20px;
}
}
}
.grid-pagination {
height: 50px;
......
const path = require('path');
const os = require('os');
function resolve(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
----
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 @@
<artifactId>liquibase-core</artifactId>
</dependency>
<!--xxl-job定时服务 -->
<!--baomidou-jobs定时服务 -->
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<groupId>com.baomidou</groupId>
<artifactId>jobs-spring-boot-starter</artifactId>
</dependency>
</dependencies>
......
......@@ -174,3 +174,4 @@ public class SDFileServiceImpl implements ISDFileService {
package cn.ibizlab.core.util.config;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
/**
* xxl-job config
* 分布式任务调度平台XXL-JOB配置加载
* @author xuxueli 2017-04-28
*/
@ConditionalOnExpression("!'${jobs.admin-address:NA}'.equals('NA')")
@Configuration
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 @@
<!--httpClient -->
<openfeign-httpclient.version>11.0</openfeign-httpclient.version>
<!--xxl-job定时服务 -->
<xxl-job.version>2.1.0</xxl-job.version>
<!--baomidou-jobs定时服务 -->
<baomidou-jobs.version>1.0.3</baomidou-jobs.version>
<oracle.version>11.2.0.3</oracle.version>
<postgresql.version>42.2.6</postgresql.version>
......@@ -256,9 +256,9 @@
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>${xxl-job.version}</version>
<groupId>com.baomidou</groupId>
<artifactId>jobs-spring-boot-starter</artifactId>
<version>${baomidou-jobs.version}</version>
</dependency>
</dependencies>
......
......@@ -137,7 +137,7 @@ public class SDFileResource {
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")
@RequestMapping(method= RequestMethod.GET , value="/sdfiles/fetchdefault")
public ResponseEntity<List<SDFileDTO>> fetchDefault(SDFileSearchContext context) {
......@@ -150,7 +150,7 @@ public class SDFileResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-Default-all')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-searchDefault-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"文件" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sdfiles/searchdefault")
public ResponseEntity<Page<SDFileDTO>> searchDefault(@RequestBody SDFileSearchContext context) {
......
server:
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;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.*;
@Component
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) {
return null;
}
@Override
public Boolean deployBpmnFile(List<Map<String, Object>> bpmnfiles) {
return null;
}
}
......@@ -2,7 +2,7 @@ package cn.ibizlab.util.client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.*;
@FeignClient(value = "ibzwf-api",fallback = IBZWFFallback.class)
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")
List<String> getbusinesskeysByUserId(@PathVariable("system") String system,@PathVariable("userId") String userId,
@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;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;
import java.io.InputStream;
import java.util.*;
/**
* 权限:向uaa同步当前系统菜单、权限资源任务类
......@@ -21,15 +23,14 @@ import java.io.InputStream;
@ConditionalOnProperty( name = "ibiz.enablePermissionValid", havingValue = "true")
public class PermissionSyncJob implements ApplicationRunner {
@Autowired
@Lazy
private IBZUAAFeignClient client;
@Value("${ibiz.systemid:ibzdisk}")
private String systemId;
@Override
public void run(ApplicationArguments args) {
try {
......@@ -40,6 +41,7 @@ public class PermissionSyncJob implements ApplicationRunner {
system.put("pssystemid",systemId);
system.put("pssystemname",systemId);
system.put("sysstructure",JSONObject.parseObject(permissionResult));
system.put("md5check",DigestUtils.md5DigestAsHex(permissionResult.getBytes()));
if(client.syncSysAuthority(system)){
log.info("向[UAA]同步系统资源成功");
}else{
......@@ -49,5 +51,6 @@ public class PermissionSyncJob implements ApplicationRunner {
catch (Exception ex) {
log.error(String.format("向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]",ex));
}
}
}
\ No newline at end of file
......@@ -3,14 +3,14 @@ spring:
cloud:
nacos:
discovery:
server-addr: 172.16.102.211:8848
server-addr: 127.0.0.1:8848
cache:
redis:
time-to-live: 3600
caffeine:
spec: initialCapacity=5,maximumSize=500,expireAfterWrite=3600s
redis:
host: 172.16.100.243
host: 127.0.0.1
port: 6379
password:
database: 0
......@@ -22,7 +22,7 @@ spring:
min-idle: 8
datasource:
username: root
password: '123456'
password: 'root'
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
filters: stat,wall,log4j2
......@@ -67,6 +67,13 @@ feign:
enabled: true
sentinel:
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配置
logging:
......@@ -85,16 +92,17 @@ ibiz:
enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
#xxl-job定时服务
xxl:
job:
accessToken:
admin:
addresses: #127.0.0.1
executor:
appname: ibzdisk
ip:
port: 9999
logpath: /app/joblog
logretentiondays: -1
### jobs
jobs:
#admin-address: http://127.0.0.1:40005
app-name: ibzdisk
app-port: 9999
#app-ip: 127.0.0.1
### 启用Gzip压缩
server:
compression:
enabled: true
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 10240
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册