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

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

上级 623da59d
......@@ -68,10 +68,7 @@ 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 AppTransfer from './components/app-transfer/app-transfer.vue'
......@@ -159,8 +156,8 @@ 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);
......
......@@ -2,7 +2,7 @@
<div class="app-actionbar">
<div class="app-actionbar-item" v-for="(item,index) in items" :key="index">
<Badge v-if="item.counterService&&item.counterService.counterData" :count="item.counterService.counterData[item.counterId]" type="primary">
<i-button @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
<i-button @click="handleClick(item.viewlogicname)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
</Badge>
<i-button v-else @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
</div>
......
......@@ -4,7 +4,7 @@
<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="item.isselected === true">
<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>
......@@ -195,6 +195,15 @@ export default class Breadcrumb extends Vue {
}
}
/**
* 是否显示下拉列表
*
* @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 {
......
......@@ -93,6 +93,11 @@
<template v-if="!Object.is(layoutType, 'FLEX')">
<row :gutter="10"><slot></slot></row>
</template>
<template v-if="isManageContainer">
<i-button type="primary" :icon="manageContainerStatus?'ios-repeat':'ios-more'" @click="doManageContainer">
{{manageContainerStatus?$t('components.appFormGroup.hide'):$t('components.appFormGroup.showMore')}}
</i-button>
</template>
</card>
<template v-if="isShowCaption === false">
<slot></slot>
......@@ -115,6 +120,22 @@ export default class AppFormGroup extends Vue {
*/
@Prop() public caption?: string;
/**
* 是否为管理容器
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop({ default: false }) public isManageContainer?: boolean;
/**
* 管理容器状态
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop({ default: false }) public manageContainerStatus?: boolean;
/**
* 内置界面样式
*
......@@ -244,6 +265,16 @@ export default class AppFormGroup extends Vue {
public doUIAction($event: any, item: any): void {
this.$emit('groupuiactionclick', { event: $event, item: item });
}
/**
* 操作管理容器
*
* @param {*} $event
* @memberof AppFormGroup
*/
public doManageContainer(){
this.$emit('managecontainerclick');
}
}
</script>
<style lang='less'>
......
<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
......@@ -44,6 +44,11 @@ export default class AppMpicker extends Vue {
*/
@Prop() curvalue?: any;
/**
* 值项
*/
@Prop() valueitem?: any;
/**
* 局部上下文导航参数
*
......@@ -144,14 +149,34 @@ export default class AppMpicker extends Vue {
this.value = [];
this.selectItems = [];
if (newVal) {
this.selectItems = this.parseValue(JSON.parse(newVal));
this.selectItems.forEach((item: any) => {
this.value.push(item[this.deKeyField]);
let index = this.items.findIndex((i) => Object.is(i[this.deKeyField], item[this.deKeyField]));
if (index < 0) {
this.items.push({ [this.deMajorField]: item[this.deMajorField], [this.deKeyField]: item[this.deKeyField] });
try {
this.selectItems = this.parseValue(JSON.parse(newVal));
this.selectItems.forEach((item: any) => {
this.value.push(item[this.deKeyField]);
let index = this.items.findIndex((i) => Object.is(i[this.deKeyField], item[this.deKeyField]));
if (index < 0) {
this.items.push({ [this.deMajorField]: item[this.deMajorField], [this.deKeyField]: item[this.deKeyField] });
}
});
} catch (error) {
if(error.name === 'SyntaxError'){
let srfkeys:any = newVal.split(',');
let srfmajortexts:any = null;
if(this.valueitem && this.activeData[this.valueitem]){
srfmajortexts = this.activeData[this.valueitem].split(',');
}
});
if(srfkeys.length && srfkeys.length > 0 && srfmajortexts.length && srfmajortexts.length > 0 && srfkeys.length == srfmajortexts.length){
srfkeys.forEach((id: any, index: number) => {
this.value.push(id);
this.selectItems.push({[this.deKeyField]: id, [this.deMajorField]: srfmajortexts[index]});
let _index = this.items.findIndex((i) => Object.is(i[this.deKeyField],id));
if (_index < 0) {
this.items.push({[this.deKeyField]: id, [this.deMajorField]: srfmajortexts[index]});
}
});
}
}
}
}
this.$forceUpdate();
}
......
......@@ -5,4 +5,7 @@
margin-right: 10px;
padding: 0 5px;
}
}
.user-dropdownMenu{
margin-top: 9px;
}
\ No newline at end of file
......@@ -3,11 +3,10 @@
left: 201px !important;
}
.ivu-drawer {
top: 52px !important;
top: 64px !important;
}
.ivu-drawer-body {
padding: 32px !important;
background-color: #f7fafc;
.menuItems {
display: flex;
flex-wrap: wrap;
......@@ -49,10 +48,9 @@
}
.ivu-drawer-body {
padding: 0px !important;
background-color: #f7fafc;
}
.ivu-drawer {
top: 52px !important;
top: 64px !important;
}
.context-menu-drag {
display: flex;
......
<template>
<el-select size="small" class="filter-mode" placeholder="条件逻辑" v-model="curVal" @change="onChange">
<el-option
v-for="mode in filterMode"
:key="mode.value"
:label="getLabel(mode)"
:value="mode.value"
>
</el-option>
</el-select>
</template>
<script lang="ts">
import { Vue, Component, Model } from "vue-property-decorator";
@Component({})
export default class FilterMode extends Vue {
/**
* 值属性
*
* @type {*}
* @memberof FilterMode
*/
@Model('change') readonly value: any;
get curVal() {
return this.value;
}
set curVal(val: any) {
const type: string = this.$util.typeOf(val);
val = Object.is(type, 'null') || Object.is(type, 'undefined') ? undefined : val;
this.$emit('change', val);
}
/**
* 过滤模式
*
* @type {*}
* @memberof FilterMode
*/
public filterMode: any[] = [
// { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' },
{ 'zh-CN': '等于(=)', 'en-US': 'EQ', value: '$eq' },
{ 'zh-CN': '不等于(<>)', 'en-US': 'NE', value: '$ne' },
{ 'zh-CN': '大于(>)', 'en-US': 'GT', value: '$gt' },
{ 'zh-CN': '大于等于(>=)', 'en-US': 'GE', value: '$gte' },
{ 'zh-CN': '小于(<)', 'en-US': 'LT', value: '$lt' },
{ 'zh-CN': '小于(<=)', 'en-US': 'LE', value: '$lte' },
{ 'zh-CN': '值为空(Nil)', 'en-US': 'IS_NULL', value: '$null' },
{ 'zh-CN': '值不为空(NotNil)', 'en-US': 'IS_NOT_NULL', value: '$notNull' },
{ 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' },
{ 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' },
{ 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' },
{ 'zh-CN': '文本左包含(%#)', 'en-US': 'LIFTLIKE', value: '$startsWith' },
{ 'zh-CN': '文本右包含(#%)', 'en-US': 'RIGHTLIKE', value: '$endsWith' },
// { 'zh-CN': '', en: 'EXISTS', value: '$exists' },
// { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' }
];
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/**
* 值改变
*
* @memberof FilterMode
*/
public onChange() {
this.$emit('mode-change', this.value);
}
}
</script>
\ No newline at end of file
.filter-tree {
.el-tree-node__content {
height: 40px;
.filter-tree-item {
display: flex;
width: 100%;
>div {
margin-right: 10px;
}
>div:nth-last-child(1) {
margin-right: 0;
}
.filter-tree-action {
display: none;
align-items: center;
.ivu-btn {
margin-right: 5px;
}
.ivu-icon-md-close {
color: red;
font-size: 24px;
}
}
}
.filter-tree-item:hover {
.filter-tree-action {
display: flex;
}
}
}
}
\ No newline at end of file
<template>
<el-tree class="filter-tree" :data="treeItems" :expand-on-click-node="false" default-expand-all>
<template slot-scope="{ node, data }">
<template v-if="Object.is(data.label, '$and') || Object.is(data.label, '$or')">
<div class="filter-tree-item">
<el-select size="small" v-model="data.label" :disabled="data.isroot">
<el-option v-for="mode in relationModes" :key="mode.value" :label="getLabel(mode)" :value="mode.value"></el-option>
</el-select>
<div class="filter-tree-action">
<i-button title="添加条件" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加条件</i-button>
<i-button title="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</i-button>
<icon v-if="!data.isroot" type="md-close" @click="onRemoveItem(node, data)"/>
</div>
</div>
</template>
<template v-else>
<div class="filter-tree-item">
<el-select size="small" class="filter-item-field" v-model="data.field" clearable placeholder="属性" @change="onFieldChange(data)">
<el-option
v-for="item in fields"
:key="item.prop"
:label="item.label"
:value="item.name">
</el-option>
</el-select>
<filter-mode class="filter-item-mode" v-model="data.mode"></filter-mode>
<div class="filter-item-value">
<i-input v-if="!data.field"></i-input>
<slot v-else :data="data"></slot>
</div>
<div class="filter-tree-action">
<icon type="md-close" @click="onRemoveItem(node, data)"/>
</div>
</div>
</template>
</template>
</el-tree>
</template>
<script lang="ts">
import {Vue, Component, Prop} from 'vue-property-decorator';
import FilterMode from './filter-mode.vue';
@Component({
components: {
FilterMode
}
})
export default class FilterTree extends Vue {
/**
* 数据集
*
* @type {*}
* @memberof FilterTree
*/
@Prop() datas: any;
/**
* 过滤项集合
*
* @type {*}
* @memberof FilterTree
*/
@Prop() fields: any;
/**
* 组条件集合
*
* @type {*}
* @memberof FilterTree
*/
protected relationModes: any[] = [
{ 'zh-CN': '并且', 'en-US': 'AND', value: '$and' },
{ 'zh-CN': '或', 'en-US': 'OR', value: '$or' }
];
/**
* 树数据集合
*
* @type {*}
* @memberof FilterTree
*/
get treeItems() {
let root: any = {
label: '$and',
isroot: true,
children: this.datas
};
if(this.datas.length == 0) {
this.onAddItem(root);
this.onAddItem(root);
}
return [root];
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/**
* 属性变化
*
* @return {*}
* @memberof FilterTree
*/
public onFieldChange(data: any) {
if(!data.mode) {
data.mode = '$eq';
}
}
/**
* 添加条件
*
* @return {*}
* @memberof FilterTree
*/
public onAddItem(data: any) {
if(data && data.children) {
data.children.push({
field: null,
mode: null
});
}
}
/**
* 添加组
*
* @return {*}
* @memberof FilterTree
*/
public onAddGroup(data: any) {
if(data && data.children) {
data.children.push({
label: '$and',
children: []
})
}
}
/**
* 删除条件/组
*
* @return {*}
* @memberof FilterTree
*/
public onRemoveItem(node: any, data: any) {
if(node && node.parent) {
let pData: any = node.parent.data;
if(pData.children.indexOf(data) >= 0) {
pData.children.splice(pData.children.indexOf(data), 1)
}
}
}
}
</script>
<style lang="less">
@import './filter-tree.less';
</style>
\ No newline at end of file
......@@ -13,7 +13,7 @@
:type="type"
v-model="CurrentVal"
:disabled="disabled ? true : false"
:autosize="autoSize"
:element-id="textareaId"
@on-enter="enter"
></i-input>
<div class="unit-text">{{unit}}</div>
......@@ -34,6 +34,20 @@ export default class InputBox extends Vue {
*/
@Model("change") readonly itemValue?: any;
/**
* 生命周期 (多行文本十行高度问题)
* @type {any}
* @memberof InputBox
*/
public mounted(){
if(this.textareaId){
let textarea :any= document.getElementById(this.textareaId);
if(textarea){
textarea.style=this.textareaStyle;
}
}
}
/**
* 单位
* @type {String}
......@@ -41,6 +55,20 @@ export default class InputBox extends Vue {
*/
@Prop() public unit?: string;
/**
* 多行文本十行 特殊参数样式(模型高度自带)
* @type {String}
* @memberof InputBoxUnit
*/
@Prop() public textareaStyle?: string;
/**
* 多行文本十行 特殊参数id(模型高度自带)
* @type {String}
* @memberof InputBoxUnit
*/
@Prop() public textareaId?: string;
/**
* 大小
* @type {String}
......
......@@ -148,7 +148,8 @@
border-bottom:2px solid transparent !important;
}
.el-tabs__header{
margin:0 0 1 0;
margin:0;
border-bottom: none;
}
}
}
......
......@@ -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,7 +245,7 @@ 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;
let index:number = viewdata.srfTitle.indexOf("-");
if (viewdata && info && !Object.is(info, '')) {
......
......@@ -395,6 +395,9 @@ export default class MDViewEngine extends ViewEngine {
if (this.getSearchForm() && this.view.isExpandSearchForm) {
Object.assign(arg, this.getSearchForm().getData());
}
if (this.view && this.view.searchbar) {
Object.assign(arg, this.view.searchbar.getData());
}
if (this.view && !this.view.isExpandSearchForm) {
Object.assign(arg, { query: this.view.query });
}
......
......@@ -170,4 +170,8 @@ export default {
YouYuan: 'YouYuan',
},
},
appFormGroup: {
hide: 'hide',
showMore: 'show more',
},
};
\ No newline at end of file
......@@ -171,4 +171,8 @@ export default {
YouYuan: '幼圆',
},
},
appFormGroup: {
hide: '隐藏字段',
showMore: '显示更多字段',
},
};
\ No newline at end of file
......@@ -46,6 +46,22 @@ export class FormDetailModel {
*/
public visible: boolean = true;
/**
* 成员是否显示(旧)
*
* @type {boolean}
* @memberof FormDetailModel
*/
public oldVisible: boolean = true;
/**
* 成员是否为受控内容
*
* @type {boolean}
* @memberof FormDetailModel
*/
public isControlledContent: boolean = false;
/**
* 成员是否显示标题
*
......@@ -53,6 +69,7 @@ export class FormDetailModel {
* @memberof FormDetailModel
*/
public isShowCaption: boolean = true;
/**
* Creates an instance of FormDetailModel.
......@@ -67,7 +84,9 @@ export class FormDetailModel {
this.form = opts.form ? opts.form : {};
this.name = !Object.is(opts.name, '') ? opts.name : '';
this.visible = opts.visible ? true : false;
this.oldVisible = opts.visible ? true : false;
this.isShowCaption = opts.isShowCaption ? true : false;
this.isControlledContent = opts.isControlledContent ? true : false;
}
/**
......
......@@ -16,6 +16,30 @@ export class FormGroupPanelModel extends FormDetailModel {
* @memberof FormGroupPanelModel
*/
public uiActionGroup: any = {};
/**
* 受控内容组
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public showMoreModeItems: any = [];
/**
* 是否为管理容器
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public isManageContainer: boolean = false;
/**
* 管理容器状态 true显示 false隐藏
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public manageContainerStatus: boolean = true;
/**
* Creates an instance of FormGroupPanelModel.
......@@ -27,5 +51,17 @@ export class FormGroupPanelModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
Object.assign(this.uiActionGroup, opts.uiActionGroup);
this.showMoreModeItems = opts.showMoreModeItems;
this.isManageContainer = opts.isManageContainer ? true : false;
}
/**
* 设置管理容器状态
*
* @param {boolean} state
* @memberof FormGroupPanelModel
*/
public setManageContainerStatus(state: boolean): void {
this.manageContainerStatus = state;
}
}
\ No newline at end of file
import { Subject } from 'rxjs';
export interface Message {
/**
* 名称(通常是应用实体名称)
*
* @memberof Message
*/
name: string;
/**
* 行为(操作数据行为)
*
* @memberof Message
*/
action: string;
/**
* 数据(操作数据)
*
* @memberof Message
*/
data: any;
}
/**
* 应用中心服务类
*
* @export
* @class AppCenterService
*/
export default class AppCenterService {
/**
* Vue 状态管理器
*
* @private
* @type {*}
* @memberof AppCenterService
*/
private static store: any;
/**
* 应用数据状态管理对象
*
* @private
* @type {Subject<any>}
* @memberof AppCenterService
*/
private static subject:Subject<any> = new Subject<any>();
/**
* 单例变量声明
*
* @private
* @static
* @type {AppCenterService}
* @memberof AppCenterService
*/
private static appCenterService: AppCenterService;
/**
* 初始化实例
*
* @memberof AppCenterService
*/
constructor() {}
/**
* 获取 AppCenterService 单例对象
*
* @static
* @returns {AppCenterService}
* @memberof AppCenterService
*/
public static getInstance(store: any): AppCenterService {
if (!AppCenterService.appCenterService) {
AppCenterService.appCenterService = new AppCenterService();
}
this.store = store;
return this.appCenterService;
}
/**
* 通知消息
*
* @static
* @memberof AppCenterService
*/
public static notifyMessage(message:Message){
this.subject.next(message);
}
/**
* 获取消息中心
*
* @static
* @memberof AppCenterService
*/
public static getMessageCenter():Subject<any>{
return this.subject;
}
}
\ No newline at end of file
......@@ -51,5 +51,4 @@ export const getAuthMenu = (state: any) => (menu:any) =>{
}else{
return true;
}
}
\ No newline at end of file
......@@ -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;
}
}
}
}
}
......
......@@ -63,7 +63,7 @@ export class ViewTool {
public static buildUpRoutePath(route: Route, viewParam: any = {}, deResParameters: any[], parameters: any[], args: any[], data: any): string {
const indexRoutePath = this.getIndexRoutePath(route);
const deResRoutePath = this.getDeResRoutePath(viewParam, deResParameters, args);
const deRoutePath = this.getActiveRoutePath(parameters, args, data);
const deRoutePath = this.getActiveRoutePath(parameters, args, data,viewParam);
return `${indexRoutePath}${deResRoutePath}${deRoutePath}`;
}
......@@ -123,7 +123,7 @@ export class ViewTool {
* @returns {string}
* @memberof ViewTool
*/
public static getActiveRoutePath(parameters: any[], args: any[], data: any): string {
public static getActiveRoutePath(parameters: any[], args: any[], data: any,viewParam: any = {}): string {
let routePath: string = '';
// 不存在应用实体
if(parameters && parameters.length >0){
......@@ -137,8 +137,7 @@ export class ViewTool {
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;
const _value: any = arg[_parameterName] || viewParam[_parameterName] || null;
routePath = `/${_pathName}/${_value}/${_pathName2}`;
if (Object.keys(data).length > 0) {
routePath = `${routePath}?${qs.stringify(data, { delimiter: ';' })}`;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册