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

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

上级 004cce52
......@@ -8,6 +8,7 @@ import { AppPopover } from './utils/app-popover/app-popover';
import { AppModal } from './utils/app-modal/app-modal';
import { AppDrawer } from './utils/app-drawer/app-drawer';
import { uiServiceRegister } from '@/uiservice/ui-service-register';
import { authServiceRegister } from '@/authservice/auth-service-register';
import { utilServiceRegister } from '@/utilservice/util-service-register';
import { entityServiceRegister } from '@/service/entity-service-register';
import { counterServiceRegister } from '@/counter/counter-service-register';
......@@ -77,8 +78,11 @@ 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'
import UpdatePwd from './components/app-update-password/app-update-password.vue'
import AppMenuItem from './components/app-menu-item/app-menu-item.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载实体权限服务注册中心
window['authServiceRegister'] = authServiceRegister;
// 全局挂载功能服务注册中心
window['utilServiceRegister'] = utilServiceRegister;
// 全局挂载数据服务注册中心
......@@ -165,5 +169,6 @@ export const AppComponents = {
v.component('app-transfer',AppTransfer);
v.component('context-menu-drag',ContextMenuDrag);
v.component('app-update-password',UpdatePwd);
v.component('app-menu-item', AppMenuItem);
},
};
\ No newline at end of file
import { Store } from 'vuex';
/**
* 实体权限服务
*
* @export
* @class AuthService
*/
export default class AuthService {
/**
* Vue 状态管理器
*
* @public
* @type {(any | null)}
* @memberof AuthService
*/
public $store: Store<any> | null = null;
/**
* 默认操作标识
*
* @public
* @type {(any)}
* @memberof AuthService
*/
public defaultOPPrivs: any = { UPDATE: 1, CREATE: 1, READ: 1, DELETE: 1, WFSTART:1,DENY:1,NONE:1 };
/**
* Creates an instance of AuthService.
*
* @param {*} [opts={}]
* @memberof AuthService
*/
constructor(opts: any = {}) {
this.$store = opts.$store;
}
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof AuthService
*/
public getStore(): Store<any> | null {
return this.$store;
}
/**
* 获取实体权限服务
*
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof AuthService
*/
public getService(name: string): Promise<any> {
return (window as any)['authServiceRegister'].getService(name);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {string} name 实体名称
* @returns {any}
* @memberof AuthService
*/
public getOPPrivs(data: any): any {
return null;
}
/**
* 根据菜单项获取菜单权限
*
* @param {*} item 菜单标识
* @returns {boolean}
* @memberof AuthService
*/
public getMenusPermission(item: any): boolean {
return true;
}
/**
* 根据统一资源标识获取统一资源权限
*
* @param {*} tag 统一资源标识
* @returns {boolean}
* @memberof AuthService
*/
public getResourcePermission(tag: any): boolean {
return true;
}
}
\ No newline at end of file
<template>
<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)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
<Badge v-if="item.counterService&&item.counterService.counterData" v-show="item.visabled" :count="item.counterService.counterData[item.counterId]" type="primary">
<i-button :style="{'pointer-events':item.disabled?'none':'auto'}" @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>
<i-button v-show="item.visabled" :style="{'pointer-events':item.disabled?'none':'auto'}" v-else @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
</div>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Model, Emit } from "vue-property-decorator";
import { Subject } from "rxjs";
import { Vue, Component, Prop, Model, Emit,Inject, Watch } from "vue-property-decorator";
import { Subject,Subscription } from "rxjs";
@Component({})
export default class AppActionBar extends Vue {
......@@ -24,6 +24,49 @@ export default class AppActionBar extends Vue {
*/
@Prop() public items!:any;
/**
* 注入的UI服务
*
* @type {*}
* @memberof AppActionBar
*/
@Prop() public uiService!: any;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppActionBar
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ActionlinetestBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 组件初始化
*
* @memberof AppActionBar
*/
public created(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, "app-actionbar")) {
return;
}
if(Object.is(action,'loadmodel')){
this.calcActionItemAuthState(data,this.items,this.uiService);
}
});
}
}
/**
* 触发界面行为
*
......@@ -33,6 +76,52 @@ export default class AppActionBar extends Vue {
this.$emit('itemClick',$event);
}
/**
* 计算界面行为项权限状态
*
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof AppActionBar
*/
public calcActionItemAuthState(data:any,ActionModel:any,UIService:any){
for (const key in ActionModel) {
if (!ActionModel.hasOwnProperty(key)) {
return;
}
const _item = ActionModel[key];
if(_item && _item['dataaccaction'] && UIService && data && Object.keys(data).length >0){
let dataActionResult:any = UIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_item.visabled = false;
}else{
_item.visabled = true;
}
}
if(dataActionResult === 1){
_item.visabled = true;
_item.disabled = false;
}
}
}
}
/**
* 组件销毁
*
* @memberof AppActionBar
*/
public destory(){
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
......
......@@ -66,7 +66,7 @@ export default class AppAddressSelection extends Vue {
axios.get("../../assets/json/city_code.json").then((response: any) => {
this.format(response.data);
}).catch((response: any) => {
console.log("城市数据加载失败");
console.log((this.$t('components.appAddressSelection.loadDataFail') as string));
});
......
......@@ -161,6 +161,7 @@ export default class Breadcrumb extends Vue {
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.$store.commit("removeAllPage");
this.$router.push({ path: path });
} else {
this.$router.push("/");
......
......@@ -276,7 +276,7 @@ export default class AppCheckBox extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any)=>{
console.log(`----${this.tag}----代码表不存在!`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
})
}
}
......
......@@ -191,7 +191,7 @@ export default class AppColumnLink extends Vue {
private openRedirectView($event: any, view: any, data: any): void {
this.$http.get(view.url, data).then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '请求异常' });
this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.reqException') as string) });
}
if (response.status === 401) {
return;
......@@ -243,7 +243,7 @@ export default class AppColumnLink extends Vue {
}
}).catch((response: any) => {
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常!' });
this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.reqException') as string) });
return;
}
if (response.status === 401) {
......
......@@ -443,13 +443,13 @@ export default class AppDataUploadView extends Vue {
if (codelist) {
resolve([...JSON.parse(JSON.stringify(codelist.items))]);
} else {
console.log(`----${codeListObject.tag}----代码表不存在`);
console.log(`----${codeListObject.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}
}else if(codeListObject.tag && Object.is(codeListObject.type,"DYNAMIC")){
this.codeListService.getItems(codeListObject.tag).then((res:any) => {
resolve(res);
}).catch((error:any) => {
console.log(`----${codeListObject.tag}----代码表不存在`);
console.log(`----${codeListObject.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
})
......
<template>
<div class="app-department-select">
<ibiz-select-tree :NodesData="Nodesdata" v-model="selectTreeValue" :multiple="multiple" @select="onSelect"></ibiz-select-tree>
<ibiz-select-tree :NodesData="Nodesdata" v-model="selectTreeValue" :disabled="disabled" :multiple="multiple" @select="onSelect"></ibiz-select-tree>
</div>
</template>
......@@ -42,6 +42,14 @@ export default class AppDepartmentSelect extends Vue {
*/
@Prop({default:false}) public multiple?: any;
/**
* 是否禁用
*
* @type {*}
* @memberof AppDepartmentSelect
*/
@Prop({default:false}) public disabled?: boolean;
/**
* 表单数据
*
......@@ -123,7 +131,7 @@ export default class AppDepartmentSelect extends Vue {
this.$store.commit('addDepData', { srfkey: this.filter, orgData: response.data });
}).catch((response: any) => {
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常!' });
this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
......
......@@ -107,18 +107,18 @@ export default class AppExportExcel extends Vue {
this.visible = false;
} else if (Object.is(type, 'custom')) {
if (!this.startPage || !this.endPage) {
this.$Notice.warning({ title: '警告', desc: '请输入起始页' });
this.$Notice.warning({ title: (this.$t('app.commonWords.warning') as string), desc: (this.$t('components.appExportExcel.desc') as string) });
return;
}
const startPage: any = Number.parseInt(this.startPage, 10);
const endPage: any = Number.parseInt(this.endPage, 10);
if (Number.isNaN(startPage) || Number.isNaN(endPage)) {
this.$Notice.warning({ title: '警告', desc: '请输入有效的起始页' });
this.$Notice.warning({ title: (this.$t('app.commonWords.warning') as string), desc: (this.$t('components.appExportExcel.desc1') as string) });
return;
}
if (startPage < 1 || endPage < 1 || startPage > endPage) {
this.$Notice.warning({ title: '警告', desc: '请输入有效的起始页' });
this.$Notice.warning({ title: (this.$t('app.commonWords.warning') as string), desc: (this.$t('components.appExportExcel.desc1') as string) });
return;
}
this.startPage = null;
......
......@@ -136,7 +136,8 @@ export default class AppFileUpload extends Vue {
if (this.ignorefieldvaluechange) {
return;
}
this.setFiles(newval)
this.getParams();
this.setFiles(newval);
this.dataProcess();
}
......@@ -288,6 +289,7 @@ export default class AppFileUpload extends Vue {
this.formStateEvent = this.formState.subscribe(($event: any) => {
// 表单加载完成
if (Object.is($event.type, 'load')) {
this.getParams();
this.setFiles(this.value);
this.dataProcess();
}
......@@ -303,27 +305,37 @@ export default class AppFileUpload extends Vue {
*/
public mounted() {
this.appData = this.$store.getters.getAppData();
this.getParams();
this.setFiles(this.value);
this.dataProcess();
}
let uploadparams: any = {};
let exportparams: any = {};
/**
*获取上传,导出参数
*
*@memberof AppFileUpload
*/
public getParams(){
let uploadparams: any = JSON.parse(JSON.stringify(this.uploadparams));
let exportparams: any = JSON.parse(JSON.stringify(this.exportparams));
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_params = this.$util.computedNavData(_data,param,context,uploadparams);
}
if (this.exportparams && !Object.is(this.exportparams, '')) {
exportparams = this.exportparams;
export_params = this.$util.computedNavData(_data,param,context,exportparams);
}
this.upload_params = [];
this.export_params = [];
for (const item in upload_params) {
this.upload_params.push({
......@@ -335,9 +347,6 @@ export default class AppFileUpload extends Vue {
[item]:export_params[item]
})
}
this.setFiles(this.value);
this.dataProcess();
}
/**
......
......@@ -271,6 +271,7 @@ export default class AppFormDRUIPart extends Vue {
//设置顶层视图唯一标识
Object.assign(tempContext,this.context);
Object.assign(tempContext,{srfparentdename:this.parentName,srfparentkey:_paramitem});
Object.assign(tempParam,{srfparentdename:this.parentName,srfparentkey:_paramitem});
// 设置局部上下文
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localContext);
......@@ -292,9 +293,9 @@ export default class AppFormDRUIPart extends Vue {
}
}
if(!this.isForbidLoad){
this.$nextTick(() => {
setTimeout(() => {
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
});
}, 0);
}
}
......@@ -386,7 +387,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart
*/
public mditemsload(){
console.log('多数据视图加载完成,触发后续表单项更新');
console.log((this.$t('components.appFormDRUIPart.viewLoadComp') as string));
}
/**
......@@ -397,7 +398,7 @@ export default class AppFormDRUIPart extends Vue {
*/
public drdatasaved($event:any){
this.$emit('drdatasaved',$event);
console.log(this.viewname+'关系数据保存完成');
console.log(this.viewname+(this.$t('components.appFormDRUIPart.save') as string));
}
/**
......@@ -407,7 +408,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart
*/
public drdatachange(){
console.log('DEMEDITVIEW9 关系数据值变化');
console.log('DEMEDITVIEW9 '+(this.$t('components.appFormDRUIPart.change') as string));
}
/**
......@@ -417,7 +418,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart
*/
public viewdataschange(){
console.log('视图数据变化');
console.log((this.$t('components.appFormDRUIPart.change1') as string));
}
/**
......@@ -427,7 +428,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart
*/
public viewload(){
console.log('视图加载完成');
console.log((this.$t('components.appFormDRUIPart.loadComp') as string));
}
}
</script>
......
......@@ -27,7 +27,7 @@
</a>
<dropdown-menu slot='list' v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<dropdown-item v-for="(detail,index) in (uiActionGroup.details)" :key="index" :name="detail.name">
<span class='item' @click="doUIAction($event, detail)">
<span class='item' v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto'}" @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i>
......@@ -58,7 +58,7 @@
<span class='item-extract-mode'>
<template v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<div v-for="(detail,index) in uiActionGroup.details" :key="index">
<span class='item' @click="doUIAction($event, detail)">
<span v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto'}" class='item' @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i>
......@@ -107,7 +107,7 @@
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator';
import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
@Component({})
export default class AppFormGroup extends Vue {
......@@ -120,6 +120,70 @@ export default class AppFormGroup extends Vue {
*/
@Prop() public caption?: string;
/**
* 注入的UI服务
*
* @type {*}
* @memberof AppFormGroup
*/
@Prop() public uiService!: any;
/**
* 注入数据
*
* @type {*}
* @memberof AppFormGroup
*/
@Prop() public data!: any;
/**
* 监听值变化
*
* @memberof AppFormGroup
*/
@Watch('data')
onSrfupdatedateChange(newVal: any, oldVal: any) {
if((newVal !== oldVal) && this.uiActionGroup.details.length >0){
this.calcActionItemAuthState(newVal,this.uiActionGroup.details,this.uiService);
}
}
/**
* 计算界面行为项权限状态
*
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof AppFormGroup
*/
public calcActionItemAuthState(data:any,ActionModel:any,UIService:any){
for (const key in ActionModel) {
if (!ActionModel.hasOwnProperty(key)) {
return;
}
const _item = ActionModel[key];
if(_item && _item['dataaccaction'] && UIService && data && Object.keys(data).length >0){
let dataActionResult:any = UIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_item.visabled = false;
}else{
_item.visabled = true;
}
}
if(dataActionResult === 1){
_item.visabled = true;
_item.disabled = false;
}
}
}
}
/**
* 是否为管理容器
*
......
......@@ -9,8 +9,8 @@
</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>
<el-button size="small" type="primary" @click="onOK">{{$t('app.commonWords.ok')}}</el-button>
<el-button size="small" @click="onCancel">{{$t('app.commonWords.cancel')}}</el-button>
</div>
</div>
</template>
......
......@@ -171,7 +171,7 @@ export default class AppGroupSelect extends Vue {
public openView() {
const view: any = {
viewname: 'app-group-picker',
title: '分组选择'
title: (this.$t('components.appGroupSelect.groupSelect') as string)
};
const context: any = JSON.parse(JSON.stringify(this.context));
let filtervalue:string = "";
......
......@@ -135,6 +135,7 @@ export default class AppImageUpload extends Vue {
if (this.ignorefieldvaluechange) {
return;
}
this.getParams();
this.setFiles(newval)
this.dataProcess();
}
......@@ -294,6 +295,7 @@ export default class AppImageUpload extends Vue {
this.formStateEvent = this.formState.subscribe(($event: any) => {
// 表单加载完成
if (Object.is($event.type, 'load')) {
this.getParams();
this.setFiles(this.value);
this.dataProcess();
}
......@@ -308,26 +310,37 @@ export default class AppImageUpload extends Vue {
*/
public mounted() {
this.appData = this.$store.getters.getAppData();
this.getParams();
this.setFiles(this.value);
this.dataProcess();
}
let uploadparams: any = {};
let exportparams: any = {};
/**
*获取上传,导出参数
*
*@memberof AppImageUpload
*/
public getParams(){
let uploadparams: any = JSON.parse(JSON.stringify(this.uploadparams));
let exportparams: any = JSON.parse(JSON.stringify(this.exportparams));
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_params = this.$util.computedNavData(_data,param,context,uploadparams);
upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
}
if (this.exportparams && !Object.is(this.exportparams, '')) {
exportparams = this.exportparams;
export_params = this.$util.computedNavData(_data,param,context,exportparams);
}
this.upload_params = [];
this.export_params = [];
for (const item in upload_params) {
this.upload_params.push({
[item]:upload_params[item]
......@@ -338,9 +351,6 @@ export default class AppImageUpload extends Vue {
[item]:export_params[item]
})
}
this.setFiles(this.value);
this.dataProcess();
}
/**
......@@ -397,7 +407,7 @@ export default class AppImageUpload extends Vue {
* @memberof AppImageUpload
*/
public onError(error: any, file: any, fileList: any) {
this.$Notice.error({ title: '上传失败' });
this.$Notice.error({ title: (this.$t('components.appImageUpload.uploadFail') as string) });
}
/**
......
.ivu-dropdown{
cursor: pointer;
}
\ No newline at end of file
<template>
<div class="app-menu-item">
<template v-for="item in menus">
<template v-if="item.items && Array.isArray(item.items) && item.items.length > 0">
<el-submenu v-show="!item.hidden" :index="item.name" :popper-class="popperClass" :key="item.id">
<template slot='title'>
<template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' />
</template>
<template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template>
<span class='text' :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
</template>
<app-menu-item :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popperclass="popperClass"></app-menu-item>
</el-submenu>
</template>
<template v-else>
<template v-if="item.type =='MENUITEM'">
<el-menu-item v-show="!item.hidden" :index="item.name" :key="item.id">
<template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' />
</template>
<template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template>
<template slot="title">
<span class="text" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
<template v-if="item.type =='SEPERATOR'">
<divider :key="item.id" />
</template>
</template>
</template>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
@Component({})
export default class AppMenuItem extends Vue {
/**
* 菜单数据
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop( {default: []} ) public menus!: any;
/**
* 部件名称
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public ctrlName!: string;
/**
* 计数器数据
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public counterdata!: any;
/**
* 提示框主题样式
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public popperClass!: any;
/**
* 是否是一级菜单
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public isFirst!: boolean;
}
</script>
\ No newline at end of file
<template>
<div class="app-org-select">
<ibiz-select-tree :NodesData="NodesData" v-model="selectTreeValue" :multiple="multiple" @select="treeSelectChange"></ibiz-select-tree>
<ibiz-select-tree :NodesData="NodesData" v-model="selectTreeValue" :disabled="disabled" :multiple="multiple" @select="treeSelectChange"></ibiz-select-tree>
</div>
</template>
<script lang = 'ts'>
......@@ -44,6 +44,14 @@ export default class AppOrgSelect extends Vue {
*/
@Prop({default:false}) public multiple?:boolean;
/**
* 是否禁用
*
* @type {*}
* @memberof AppDepartmentSelect
*/
@Prop({default:false}) public disabled?: boolean;
/**
* 查询单位路径
*
......@@ -175,7 +183,7 @@ export default class AppOrgSelect extends Vue {
}
Http.getInstance().get(requestUrl).then((res:any) =>{
if(!res.status && res.status !== 200){
console.error("加载数据失败");
console.error((this.$t('components.appOrgSelect.loadFail') as string));
return;
}
this.NodesData = res.data;
......
......@@ -242,7 +242,7 @@ export default class AppPicker extends Vue {
* @param {*} oldVal
* @memberof AppPicker
*/
@Watch('value',{immediate: true})
@Watch('value',{immediate:true})
public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
......@@ -268,6 +268,9 @@ export default class AppPicker extends Vue {
if(Object.is(this.editortype, 'dropdown')){
this.onSearch("", null, true);
}
if(!Object.is(this.editortype, 'pickup-no-ac') && !Object.is(this.editortype, 'dropdown')){
this.curvalue = this.value;
}
}
/**
......
......@@ -88,7 +88,7 @@ export default class AppRadioGroup extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any)=>{
console.log(`----${this.tag}----代码表不存在!`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
})
}
}
......@@ -204,7 +204,7 @@ export default class AppRadioGroup extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any)=>{
console.log(`----${this.tag}----代码表不存在!`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
})
}
}
......
......@@ -105,6 +105,62 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor
*/
public langu: any = localStorage.getItem('local') ? localStorage.getItem('local') : 'zh-CN' ;
/**
* 上传params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public upload_params: Array<any> = [];
/**
* 导出params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public export_params: Array<any> = [];
/**
* 上传参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() public uploadparams?: any;
/**
* 下载参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() public exportparams?: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppRichTextEditor
*/
@Prop() public viewparams!: any;
/**
* 视图上下文
*
* @type {*}
* @memberof AppRichTextEditor
*/
@Prop() public context!: any;
/**
* 表单数据
*
* @type {string}
* @memberof AppRichTextEditor
*/
@Prop() public data!: string;
/**
* 语言映射文件
......@@ -142,6 +198,7 @@ export default class AppRichTextEditor extends Vue {
if(this.formState) {
this.formState.subscribe(({ type, data }) => {
if (Object.is('load', type)) {
this.getParams();
if (!this.value) {
this.init();
}
......@@ -202,6 +259,7 @@ export default class AppRichTextEditor extends Vue {
if (newval) {
this.init();
}
this.getParams();
}
/**
......@@ -259,13 +317,33 @@ export default class AppRichTextEditor extends Vue {
images_upload_handler: (bolbinfo: any, success: any, failure: any) => {
const formData = new FormData();
formData.append('file', bolbinfo.blob(), bolbinfo.filename());
const _url = richtexteditor.uploadUrl;
let _url = richtexteditor.uploadUrl;
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;
richtexteditor.uploadFile(_url, formData).subscribe((file: any) => {
let downloadUrl = richtexteditor.downloadUrl;
if (file.filename) {
const id: string = file.fileid;
const url: string = `${richtexteditor.downloadUrl}/${id}`
const url: string = `${downloadUrl}/${id}`
success(url);
}
if (this.export_params.length > 0) {
downloadUrl +='?';
this.export_params.forEach((item:any,i:any)=>{
downloadUrl += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.export_params.length-1){
downloadUrl += '&';
}
})
}
}, (error: any) => {
console.log(error);
failure('HTTP Error: ' + error.status);
......@@ -310,8 +388,45 @@ export default class AppRichTextEditor extends Vue {
});
return subject;
}
/**
*获取上传,导出参数
*
*@memberof AppRichTextEditor
*/
public getParams(){
let uploadparams: any = JSON.parse(JSON.stringify(this.uploadparams));
let exportparams: any = JSON.parse(JSON.stringify(this.exportparams));
let upload_params: Array<string> = [];
let export_params: 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, '')) {
upload_params = this.$util.computedNavData(_data,param,context,uploadparams);
}
if (this.exportparams && !Object.is(this.exportparams, '')) {
export_params = this.$util.computedNavData(_data,param,context,exportparams);
}
this.upload_params = [];
this.export_params = [];
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]
})
}
}
}
</script>
<style lang="less">
@import './app-rich-text-editor.less';
</style>
\ No newline at end of file
......@@ -76,6 +76,7 @@ export default class AppSlider extends Vue {
*/
@Watch('value')
public onValueChange(newVal: any, oldVal: any) {
newVal = (newVal === null) ? 0 : newVal;
this.currentVal = parseInt(newVal);
}
......
......@@ -6,7 +6,7 @@
<script lang="ts">
import { Vue, Component, Prop, Watch, Model } from 'vue-property-decorator';
import moment from "moment";
@Component({})
export default class AppSpan extends Vue {
......@@ -18,6 +18,38 @@ export default class AppSpan extends Vue {
*/
@Prop() public value?: any;
/**
* 数据类型
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public dataType?: string;
/**
* 单位名称
*
* @type {string}
* @memberof AppSpan
*/
@Prop({default:''}) public unitName?: string;
/**
* 精度
*
* @type {number}
* @memberof AppSpan
*/
@Prop({default:'2'}) public precision?:number;
/**
* 日期值格式化
*
* @type {string}
* @memberof AppSpan
*/
@Prop() public valueFormat?: string;
/**
* 当前表单项名称
*
......@@ -158,12 +190,52 @@ export default class AppSpan extends Vue {
}else{
if(this.$util.isEmpty(this.value)){
this.text = '';
}else if(this.dataType){
this.dataFormat();
}else{
this.text = this.value;
}
}
}
/**
* 数据格式化
*
* @memberof AppSpan
*/
public dataFormat(){
if(this.valueFormat){
this.dateFormat() ;
return;
}
if(Object.is(this.dataType,"CURRENCY")){
let number:any = Number(this.value);
this.text = Number(number.toFixed(this.precision)).toLocaleString('en-US')+ ' '+ this.unitName;
}else if(Object.is(this.dataType,"FLOAT") || Object.is(this.dataType,"DECIMAL")){
let number:any = Number(this.value);
this.text = number.toFixed(this.precision);
}else {
this.text = this.value;
}
}
/**
* 日期格式化
*
* @memberof AppSpan
*/
public dateFormat(){
if(this.valueFormat){
if(this.valueFormat.indexOf('%1$t') !== -1){
this.text= moment(this.data).format("YYYY-MM-DD HH:mm:ss");
}else if(this.valueFormat.indexOf('%1$s') == -1){
this.text= moment(this.data).format(this.valueFormat);
}else{
this.text= this.value;
}
}
}
}
</script>
......
......@@ -15,7 +15,7 @@
v-model="dataRight"
:data="dataLeft"
@change="dataChange"
:titles="['未选择', '已选择']"/>
:titles="titles"/>
</Select>
</template>
......@@ -123,6 +123,13 @@ export default class AppTransfer extends Vue {
*/
@Model("change") public itemValue!: any;
/**
* 左右侧标题
* @type{Array<string>}
* @memberof AppTransfer
*/
public titles?: Array<string>;
/**
* 左侧框数据
*
......@@ -153,6 +160,7 @@ export default class AppTransfer extends Vue {
*/
public created() {
this.dataHandle();
this.titles= [(this.$t('components.appTransfer.title1') as string),(this.$t('components.appTransfer.title2') as string)];
}
/**
......@@ -167,7 +175,7 @@ export default class AppTransfer extends Vue {
this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))];
this.initData()
} else {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}
} else if (this.tag && Object.is(this.codelistType, "DYNAMIC")) {
// 处理公共参数
......@@ -183,7 +191,7 @@ export default class AppTransfer extends Vue {
this.initData()
})
.catch((error: any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......
......@@ -2,24 +2,24 @@
<div class="update-password">
<div class="password-item">
<label for>
原密码:
{{$t('components.appUpdatePassword.oldPwd')}}
<Input type="password" v-model="oldPwd" @on-blur="oldPwdVaild"/>
</label>
</div>
<div class="password-item">
<label for>
新密码:
{{$t('components.appUpdatePassword.newPwd')}}
<Input type="password" v-model="newPwd" @on-blur="newPwdVaild"/>
</label>
</div>
<div class="password-item">
<label for>
确认密码:
{{$t('components.appUpdatePassword.confirmPwd')}}
<Input type="password" v-model="confirmPwd" :disabled="!this.newPwd" @on-blur="confirmVaild" />
</label>
</div>
<div class="password-item password-btn">
<Button type="primary" long :disabled="!oldPwd || !newPwd || !confirmPwd || disUpdate" @click="updatePwd">确认修改</Button>
<Button type="primary" long :disabled="!oldPwd || !newPwd || !confirmPwd || disUpdate" @click="updatePwd">{{$t('components.appUpdatePassword.sure')}}</Button>
</div>
</div>
</template>
......@@ -73,7 +73,7 @@ export default class AppUpdatePassword extends Vue {
public oldPwdVaild(){
if(!this.oldPwd){
this.$Notice.error({
title:'原密码不能为空!',
title: (this.$t('components.appUpdatePassword.oldPwdErr') as string),
duration: 3
});
}
......@@ -88,7 +88,7 @@ export default class AppUpdatePassword extends Vue {
public newPwdVaild(){
if(!this.newPwd){
this.$Notice.error({
title:'新密码不能为空!',
title: (this.$t('components.appUpdatePassword.newPwdErr') as string),
duration: 3
});
}
......@@ -104,7 +104,7 @@ export default class AppUpdatePassword extends Vue {
if (this.newPwd && this.confirmPwd) {
if (this.confirmPwd !== this.newPwd) {
this.$Notice.error({
title:'两次输入密码不一致!',
title: (this.$t('components.appUpdatePassword.confirmPwdErr') as string),
duration: 3
});
}else{
......@@ -136,7 +136,7 @@ export default class AppUpdatePassword extends Vue {
}
}).catch((error: any) =>{
this.$Notice.error({
title:'系统异常',
title: (this.$t('app.codeNotExist.sysException') as string),
duration: 3
});
console.error(error);
......
......@@ -7,8 +7,8 @@
</div>
<dropdown-menu class='menu' slot='list' style='font-size: 15px !important;'>
<dropdown-item name='updatepwd' style='font-size: 15px !important;'>
<span><i aria-hidden='true' class='fa fa-cogs' style='margin-right: 8px;'></i></span>
<span>修改密码</span>
<span><Icon type="ios-create-outline" style='margin-right: 8px;'/></span>
<span>{{$t('components.appUser.changepwd')}}</span>
</dropdown-item>
<dropdown-item name='logout' style='font-size: 15px !important;'>
<span><i aria-hidden='true' class='ivu-icon ivu-icon-md-power' style='margin-right: 8px;'></i></span>
......@@ -51,7 +51,7 @@ export default class AppUser extends Vue {
}
});
}else if (Object.is(data, 'updatepwd')) {
let container: Subject<any> = this.$appmodal.openModal({ viewname: 'app-update-password', title: "修改密码", width: 500, height: 500, }, {}, {});
let container: Subject<any> = this.$appmodal.openModal({ viewname: 'app-update-password', title: (this.$t('components.appUser.changepwd') as string), width: 500, height: 400, }, {}, {});
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -2,7 +2,7 @@
<div class='app-wf-approval'>
<div class="app-wf-approval-header">
<span class="approval-header-left">{{data.startTime}}</span>
<span>{{data.startUserName}}提交</span>
<span>{{data.startUserName}}{{$t('components.appWFApproval.commit')}}</span>
</div>
<div class="app-wf-approval-content" v-if="data.usertasks && data.usertasks.length >0">
<div class="approval-content-item" v-for="(usertask,index) in data.usertasks" :key="index">
......@@ -11,7 +11,7 @@
</div>
<div class="approval-content-item-right">
<div class="approval-content-item-wait" v-if="usertask.identitylinks.length >0">
等待<span v-for="(identitylink,inx) in usertask.identitylinks" :key="inx">{{identitylink.displayname}}<span v-if="inx >0"></span></span>处理
{{$t('components.appWFApproval.wait')}}<span v-for="(identitylink,inx) in usertask.identitylinks" :key="inx">{{identitylink.displayname}}<span v-if="inx >0"></span></span>{{$t('components.appWFApproval.handle')}}
</div>
<div class="approval-content-item-info" v-if="usertask.comments.length >0">
<div v-for="(comment,commentInx) in usertask.comments" :key="commentInx">
......@@ -25,13 +25,13 @@
</div>
</div>
<div class="approval-content-item-memo" v-if="usertask.userTaskId === viewparams.userTaskId">
<el-input type="textarea" v-model="initmemo" :rows="2" @blur="handleBlur" placeholder="请输入内容"></el-input>
<el-input type="textarea" v-model="initmemo" :rows="2" @blur="handleBlur" :placeholder="$t('components.appWFApproval.placeholder')"></el-input>
</div>
</div>
</div>
</div>
<div class="app-wf-approval-bottom">
<span v-if="data.endTime">{{data.endTime}}结束</span>
<span v-if="data.endTime">{{data.endTime}}{{$t('components.appWFApproval.end')}}</span>
</div>
</div>
</template>
......
......@@ -192,7 +192,7 @@ export default class CodeList extends Vue {
let items = res;
_this.setItems(items, _this);
}).catch((error: any) => {
console.log(`----${_this.tag}----代码表不存在`);
console.log(`----${_this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
// 静态处理
} else if(Object.is(this.codelistType, "STATIC")){
......
......@@ -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>
<Drawer class-name="sider-drawer" placement="left" :closable="false" :mask="false" width="240" v-model="leftDrawerVisiable">
<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">
......@@ -7,7 +7,7 @@
<Icon type="md-apps" />
</div>
<div class="content">
<span>全部应用</span>
<span>{{$t('components.contextMenuDrag.allApp')}}</span>
</div>
<div class="forward">
<Icon type="ios-arrow-forward" />
......@@ -221,7 +221,7 @@ export default class ContextMenuDrag extends Vue {
const put: Promise<any> = this.entityService.updateChooseApp(null,params);
window.location.href = item.addr;
}else{
this.$message.info("未找到该应用");
this.$message.info((this.$t('components.contextMenuDrag.noFind') as string));
}
}
......
......@@ -201,7 +201,7 @@ export default class DropDownListDynamic extends Vue {
if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))];
} else {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}
}else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理
......@@ -213,7 +213,7 @@ export default class DropDownListDynamic extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......@@ -236,7 +236,7 @@ export default class DropDownListDynamic extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......
......@@ -3,14 +3,15 @@
class='dropdown-list-mpicker'
multiple
:transfer="true"
transfer-class-name="dropdown-list-mpicker-transfer"
v-model="currentVal"
:disabled="disabled === true ? true : false"
:clearable="true"
:filterable="filterable === true ? true : false"
@on-open-change="onClick"
:placeholder="$t('components.dropDownListMpicker.placeholder')">
<i-option v-for="(item, index) in items" :key="index" :value="item.value" :label="item.text">
<Checkbox :value = "(currentVal.indexOf(item.value))==-1?false:true">
<i-option v-for="(item, index) in items" :key="index" :value="item.value.toString()" :label="item.text">
<Checkbox :value = "(currentVal.indexOf(item.value.toString()))==-1?false:true">
{{Object.is(codelistType,'STATIC') ? $t('codelist.'+tag+'.'+item.value) : item.text}}
</Checkbox>
</i-option>
......@@ -186,7 +187,7 @@ export default class DropDownListMpicker extends Vue {
if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))];
} else {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}
}else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理
......@@ -198,7 +199,7 @@ export default class DropDownListMpicker extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......@@ -220,7 +221,7 @@ export default class DropDownListMpicker extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......
......@@ -8,7 +8,7 @@
:filterable="filterable === true ? true : false"
@on-open-change="onClick"
:placeholder="$t('components.dropDownList.placeholder')">
<i-option v-for="(item, index) in items" :key="index" :value="item.value">{{($t('codelist.'+tag+'.'+item.value)!== ('codelist.'+tag+'.'+item.value))?$t('codelist.'+tag+'.'+item.value) : item.text}}</i-option>
<i-option v-for="(item, index) in items" :key="index" :value="item.value.toString()">{{($t('codelist.'+tag+'.'+item.value)!== ('codelist.'+tag+'.'+item.value))?$t('codelist.'+tag+'.'+item.value) : item.text}}</i-option>
</i-select>
</template>
......@@ -157,7 +157,7 @@ export default class DropDownList extends Vue {
* @memberof DropDownList
*/
get currentVal() {
return this.itemValue;
return this.itemValue ? this.itemValue.toString() : undefined;
}
/**
......@@ -201,7 +201,7 @@ export default class DropDownList extends Vue {
if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))];
} else {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}
}else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理
......@@ -213,7 +213,7 @@ export default class DropDownList extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......@@ -236,7 +236,7 @@ export default class DropDownList extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
}).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`);
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
});
}
}
......
<template>
<el-select size="small" class="filter-mode" placeholder="条件逻辑" v-model="curVal" @change="onChange">
<el-select size="small" class="filter-mode" :placeholder="$t('components.filterMode.placeholder')" v-model="curVal" @change="onChange">
<el-option
v-for="mode in filterMode"
v-for="mode in fieldFilterMode"
:key="mode.value"
:label="getLabel(mode)"
:value="mode.value"
......@@ -11,7 +11,7 @@
</template>
<script lang="ts">
import { Vue, Component, Model } from "vue-property-decorator";
import { Vue, Component, Model, Prop, Watch } from "vue-property-decorator";
@Component({})
export default class FilterMode extends Vue {
......@@ -24,6 +24,19 @@ export default class FilterMode extends Vue {
*/
@Model('change') readonly value: any;
/**
* 自定义逻辑集合
*
* @type {*}
* @memberof FilterMode
*/
@Prop() modes!: any[];
@Watch('modes')
onModesChange(newVal: any) {
this.setDefValue();
}
get curVal() {
return this.value;
}
......@@ -34,6 +47,21 @@ export default class FilterMode extends Vue {
this.$emit('change', val);
}
get fieldFilterMode() {
if(this.modes && this.modes.length > 0) {
let index: number = this.modes.findIndex((mode: any) => Object.is(mode.mode, 'all'));
if(index < 0) {
let items: any[] = [];
this.modes.forEach((mode: any) => {
let item: any = this.filterMode.find((filter: any) => Object.is(filter['en-US'], mode.mode));
items.push(item);
})
return items;
}
}
return this.filterMode;
}
/**
* 过滤模式
*
......@@ -44,13 +72,13 @@ export default class FilterMode extends Vue {
// { 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': 'NOTEQ', value: '$ne' },
{ 'zh-CN': '大于(>)', 'en-US': 'GT', value: '$gt' },
{ 'zh-CN': '大于等于(>=)', 'en-US': 'GE', value: '$gte' },
{ 'zh-CN': '大于等于(>=)', 'en-US': 'GTANDEQ', 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': '小于等于(<=)', 'en-US': 'LTANDEQ', value: '$lte' },
{ 'zh-CN': '值为空(Nil)', 'en-US': 'ISNULL', value: '$null' },
{ 'zh-CN': '值不为空(NotNil)', 'en-US': 'ISNOTNULL', 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' },
......@@ -60,13 +88,37 @@ export default class FilterMode extends Vue {
// { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' }
];
/**
* 生命周期
*
* @return {void}
* @memberof FilterMode
*/
public mounted() {
this.setDefValue()
}
/**
* 设置默认值
*
* @return {void}
* @memberof FilterMode
*/
public setDefValue() {
if(this.fieldFilterMode.length > 0) {
this.curVal = this.fieldFilterMode[0].value;
this.onChange();
}
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel(mode: any): string {
public getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
......@@ -79,7 +131,16 @@ export default class FilterMode extends Vue {
* @memberof FilterMode
*/
public onChange() {
this.$emit('mode-change', this.value);
this.$nextTick(() => {
let item: any = this.filterMode.find((filter: any) => Object.is(filter.value, this.curVal));
if(this.modes && this.modes.length > 0) {
let mode: any = this.modes.find((mode: any) => Object.is(mode.mode, item['en-US']));
if(!mode) {
mode = this.modes.find((mode: any) => Object.is(mode.mode, 'all'));
}
this.$emit('on-change', mode);
}
})
}
}
......
......@@ -7,26 +7,28 @@
<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>
<i-button :title="$t('components.filterTree.title1')" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> {{$t('components.filterTree.title1')}}</i-button>
<i-button :title="$t('components.filterTree.title2')" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> {{$t('components.filterTree.title2')}}</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-select size="small" class="filter-item-field" v-model="data.field" clearable :placeholder="$t('components.filterTree.placeholder')">
<el-option
v-for="item in fields"
:key="item.prop"
v-for="item in fieldItems"
:key="item.value"
:label="item.label"
:value="item.name">
:value="item.value">
</el-option>
</el-select>
<filter-mode class="filter-item-mode" v-model="data.mode"></filter-mode>
<filter-mode class="filter-item-mode" v-model="data.mode" :modes="getModes(data.field)" @on-change="onModeChange($event, data)"></filter-mode>
<div class="filter-item-value">
<i-input v-if="!data.field"></i-input>
<slot v-else :data="data"></slot>
<i-input v-if="!data.editor"></i-input>
<div v-else :key="data.editor">
<slot :data="data"></slot>
</div>
</div>
<div class="filter-tree-action">
<icon type="md-close" @click="onRemoveItem(node, data)"/>
......@@ -64,6 +66,14 @@ export default class FilterTree extends Vue {
*/
@Prop() fields: any;
/**
* 属性项集合
*
* @type {*}
* @memberof FilterTree
*/
protected fieldItems: any[] = [];
/**
* 组条件集合
*
......@@ -89,34 +99,81 @@ export default class FilterTree extends Vue {
};
if(this.datas.length == 0) {
this.onAddItem(root);
this.onAddItem(root);
}
return [root];
}
/**
* 获取语言文本
* 生命周期
*
* @return {string}
* @return {void}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
public created() {
if(!this.fields) {
return;
}
return mode['zh-CN'];
this.fields.forEach((field: any) => {
let index: number = this.fieldItems.findIndex((item: any) => Object.is(item.value, field.prop));
if(index < 0) {
this.fieldItems.push({
label: field.label,
value: field.prop,
modes: this.getFieldModes(field.prop)
})
}
});
}
/**
* 属性变化
* 获取逻辑模式集合
*
* @return {*}
* @return {void}
* @memberof FilterTree
*/
public onFieldChange(data: any) {
if(!data.mode) {
data.mode = '$eq';
public getModes(field: string) {
if(this.fieldItems.length > 0) {
let item: any = this.fieldItems.find((item: any) => Object.is(item.value, field));
if(item) {
return item.modes;
}
}
return [];
}
/**
* 获取属性逻辑模式集合
*
* @return {void}
* @memberof FilterTree
*/
public getFieldModes(name: string) {
let modes: any[] = [];
for(let i = 0; i < this.fields.length; i++) {
let field: any = this.fields[i];
if(!Object.is(field.prop, name)) {
continue;
}
modes.push({
name: field.name,
mode: field.mode ? field.mode : 'all'
})
}
return modes;
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/**
......@@ -129,7 +186,8 @@ export default class FilterTree extends Vue {
if(data && data.children) {
data.children.push({
field: null,
mode: null
mode: null,
editor: null
});
}
}
......@@ -163,6 +221,18 @@ export default class FilterTree extends Vue {
}
}
}
/**
* 条件逻辑变化
*
* @return {*}
* @memberof FilterTree
*/
public onModeChange(mode: any, data: any) {
if(mode && data) {
data.editor = mode.name;
}
}
}
</script>
......
......@@ -5,7 +5,13 @@
top: 0;
right: 20px;
}
.ivu-input-number{
width: 100%;
}
.ivu-input-number-input{
text-align: right;
}
.ivu-input-number-input:hover{
padding-right:22px;
}
}
\ No newline at end of file
<template>
<div class="input-unit">
<InputNumber v-if="type === 'number'"
:id="numberId"
:placeholder="placeholder"
:size="size"
:precision="precision"
v-model="CurrentVal"
:disabled="disabled ? true : false"
:active-change="false"
></InputNumber>
<i-input v-else
:placeholder="placeholder"
......@@ -27,6 +29,7 @@ import { debounceTime, distinctUntilChanged } from "rxjs/operators";
@Component({})
export default class InputBox extends Vue {
/**
* 双向绑定值
* @type {any}
......@@ -40,11 +43,12 @@ export default class InputBox extends Vue {
* @memberof InputBox
*/
public mounted(){
this.addEvent();
if(this.textareaId){
let textarea :any= document.getElementById(this.textareaId);
if(textarea){
textarea.style=this.textareaStyle;
}
let textarea :any= document.getElementById(this.textareaId);
if(textarea){
textarea.style=this.textareaStyle;
}
}
}
......@@ -114,6 +118,11 @@ export default class InputBox extends Vue {
*/
@Prop() public autoSize?: any;
/**
* 数值框numberId
*/
public numberId :string= this.$util.createUUID();
/**
* 当前值
*
......@@ -158,6 +167,27 @@ export default class InputBox extends Vue {
}
return $event;
}
/**
* 给数值框中的箭头按钮添加事件
*
* @memberof InputBox
*/
public addEvent(){
if(Object.is(this.type, "number")){
let inputNumber :any = document.getElementById(this.numberId);
let handlerWrap :any = inputNumber.firstElementChild;
handlerWrap.onmouseover=()=>{
inputNumber.style.paddingRight="15px";
inputNumber.style.transition="all 0.2s linear";
}
handlerWrap.onmouseout=()=>{
inputNumber.style.paddingRight="0px";
}
}
}
}
</script>
......
......@@ -15,7 +15,7 @@
size='large'
prefix='ios-contact'
v-model.trim="form.loginname"
placeholder="用户名"
:placeholder="$t('components.login.placeholder1')"
@keyup.enter.native="handleSubmit">
</i-input>
</form-item>
......@@ -26,7 +26,7 @@
prefix='ios-key'
v-model.trim="form.password"
type='password'
placeholder="密码"
:placeholder="$t('components.login.placeholder2')"
@keyup.enter.native="handleSubmit">
</i-input>
</form-item>
......@@ -34,18 +34,18 @@
<i-button
@click="handleSubmit"
type='primary'
class="login_btn">登录
class="login_btn">{{$t('components.login.name')}}
</i-button>
<i-button
@click="goReset"
type='success'
class="login_reset">重置
class="login_reset">{{$t('components.login.reset')}}
</i-button>
</form-item>
<form-item>
<div style="text-align: center">
<span class="form_tipinfo">其他登录方式</span>
<span class="form_tipinfo">{{$t('components.login.other')}}</span>
</div>
<div style="text-align: center">
<div class="sign-btn" @click="tencentHandleClick('tencent')">
......@@ -89,7 +89,7 @@ export default class Login extends Vue {
* @type {*}
* @memberof Login
*/
public form: any = {loginname: 'guest', password: 'guest'};
public form: any = {loginname: 'ibzadmin', password: '123456'};
/**
* 登录提示语
......@@ -197,13 +197,13 @@ export default class Login extends Vue {
if (data && data.message) {
this.loginTip = data.message;
this.$Message.error({
content: "登录失败," + data.message,
content: (this.$t('components.login.loginfailed') as string)+' ' + data.message,
duration: 5,
closable: true
});
} else {
this.$Message.error({
content: "登录失败",
content: (this.$t('components.login.loginfailed') as string),
duration: 5,
closable: true
});
......@@ -261,7 +261,7 @@ export default class Login extends Vue {
* @param thirdpart
*/
public tencentHandleClick(thirdpart: any) {
this.$Message.warning("qq授权登录暂未支持")
this.$Message.warning((this.$t('components.login.warning1') as string))
}
/**
......@@ -269,7 +269,7 @@ export default class Login extends Vue {
* @param thirddpart
*/
public wechatHandleClick(thirddpart: any) {
this.$Message.warning("微信授权登录暂未支持")
this.$Message.warning((this.$t('components.login.warning2') as string))
}
}
......
......@@ -21,7 +21,7 @@
<div v-show="$store.state.pageMetas.length > 0" class="right">
<el-dropdown @command="handlerClose">
<el-button size="mini" type="primary">
更多<i class="el-icon-arrow-down el-icon--right"></i>
{{$t('components.tabPageExp.more')}}<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="item" v-for="(item,index) in actions" :key="index">{{ $t(item.text) }}</el-dropdown-item>
......
......@@ -20,8 +20,8 @@
:on-exceeded-size="exceededsize"
:on-progress="progress">
<div class="upload-text">
<p>将图片拖到这里替换</p>
<p><span class="text-style">本地上传</span><span class="text-style">从素材库选择</span></p>
<p>{{$t('components.uploadFile.imgMsg')}}</p>
<p><span class="text-style">{{$t('components.uploadFile.localUpload')}}</span>{{$t('components.uploadFile.or')}}<span class="text-style">{{$t('components.uploadFile.imgMsg1')}}</span></p>
</div>
</upload>
</div>
......
......@@ -106,6 +106,7 @@ export default class EditViewEngine extends ViewEngine {
this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
}
/**
......@@ -120,6 +121,7 @@ export default class EditViewEngine extends ViewEngine {
this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
this.view.$emit('save',arg);
this.view.$emit('viewdataschange',JSON.stringify({action:'save',status:'success',data:arg}));
}
......@@ -144,66 +146,10 @@ export default class EditViewEngine extends ViewEngine {
* @memberof EditViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
// if (Object.is(tag, 'Help')) {
// this.doHelp();
// return;
// }
// if (Object.is(tag, 'SaveAndStart')) {
// this.doSaveAndStart();
// return;
// }
// if (Object.is(tag, 'SaveAndExit')) {
// this.doSaveAndExit();
// return;
// }
// if (Object.is(tag, 'SaveAndNew')) {
// this.doSaveAndNew();
// return;
// }
if (Object.is(tag, 'Save')) {
this.doSave();
return;
}
// if (Object.is(tag, 'Print')) {
// this.doPrint();
// return;
// }
// if (Object.is(tag, 'Copy')) {
// this.doCopy();
// return;
// }
// if (Object.is(tag, 'RemoveAndExit')) {
// this.doRemoveAndExit();
// return;
// }
// if (Object.is(tag, 'Refresh')) {
// this.doRefresh();
// return;
// }
// if (Object.is(tag, 'New')) {
// this.doNew();
// return;
// }
// if (Object.is(tag, 'FirstRecord')) {
// this.doMoveToRecord('first');
// return;
// }
// if (Object.is(tag, 'PrevRecord')) {
// this.doMoveToRecord('prev');
// return;
// }
// if (Object.is(tag, 'NextRecord')) {
// this.doMoveToRecord('next');
// return;
// }
// if (Object.is(tag, 'LastRecord')) {
// this.doMoveToRecord('last');
// return;
// }
// if (Object.is(tag, 'Exit') || Object.is(tag, 'Close')) {
// this.doExit();
// return;
// }
super.doSysUIAction(tag, actionmode);
}
......@@ -261,6 +207,7 @@ export default class EditViewEngine extends ViewEngine {
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)}-${viewdata.dataInfo}`;
// this.view.initNavDataWithRoute();
}
return this.getForm().transformData(arg);
}
}
\ No newline at end of file
......@@ -150,9 +150,9 @@ export default class ListViewEngine extends MDViewEngine {
arg.srfkeys = keys;
}
const grid: any = this.getMDCtrl();
if (grid) {
grid.remove(arg);
const list: any = this.getMDCtrl();
if (list) {
list.remove(arg);
}
}
......
......@@ -358,6 +358,9 @@ export default class MDViewEngine extends ViewEngine {
}
const state = args.length > 0 && !Object.is(args[0].srfkey, '') ? false : true;
this.calcToolbarItemState(state);
if(args && args.length > 0){
this.calcToolbarItemAuthState(this.transformData(args[0]));
}
}
/**
......@@ -436,4 +439,17 @@ export default class MDViewEngine extends ViewEngine {
return this.propertypanel;
}
/**
* 转化数据
*
* @memberof EditViewEngine
*/
public transformData(arg:any){
if(!this.getMDCtrl() || !(this.getMDCtrl().transformData instanceof Function)){
return null;
}
return this.getMDCtrl().transformData(arg);
}
}
\ No newline at end of file
......@@ -169,7 +169,47 @@ export default class ViewEngine {
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if(_item.noprivdisplaymode && _item.noprivdisplaymode === 6){
_item.visabled = false;
}
}
}
/**
* 计算工具栏权限状态
*
* @param {boolean} state
* @param {*} [dataaccaction]
* @memberof ViewEngine
*/
public calcToolbarItemAuthState(data:any){
const _this: any = this;
for (const key in _this.view.toolBarModels) {
if (!_this.view.toolBarModels.hasOwnProperty(key)) {
return;
}
const _item = _this.view.toolBarModels[key];
if(_item && _item['dataaccaction'] && _this.view.appUIService && data && Object.keys(data).length >0){
let dataActionResult:any = _this.view.appUIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_this.view.toolBarModels[key].disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_this.view.toolBarModels[key].visabled = false;
}else{
_this.view.toolBarModels[key].visabled = true;
}
}
if(dataActionResult === 1){
_this.view.toolBarModels[key].visabled = true;
_this.view.toolBarModels[key].disabled = false;
}
}
}
}
}
\ No newline at end of file
import { UIServiceRegister } from '@/uiservice/ui-service-register';
import { AuthServiceRegister } from '@/authservice/auth-service-register';
import { UtilServiceRegister } from '@/utilservice/util-service-register';
import { EntityServiceRegister } from '@/service/entity-service-register';
import { CounterServiceRegister } from '@/counter/counter-service-register';
......@@ -6,8 +7,9 @@ import { CounterServiceRegister } from '@/counter/counter-service-register';
declare global {
interface Window {
uiServiceRegister: UIServiceRegister,
utilServiceRegister:UtilServiceRegister,
entityServiceRegister:EntityServiceRegister,
counterServiceRegister:CounterServiceRegister
authServiceRegister: AuthServiceRegister,
utilServiceRegister: UtilServiceRegister,
entityServiceRegister: EntityServiceRegister,
counterServiceRegister: CounterServiceRegister
}
}
\ No newline at end of file
......@@ -55,6 +55,8 @@ export default {
max: 'At Most',
row: 'Lines',
currentPage: 'Current Page',
desc:'Please enter the start page',
desc1:'Please enter a valid start page',
},
appFileUpload: {
preview: 'preview',
......@@ -64,6 +66,11 @@ export default {
},
appFormDRUIPart: {
blockUITipInfo: 'Please save the major data first',
viewLoadComp:'After the multi data view is loaded, the subsequent form item update will be triggered',
save:'Relationship data save complete',
change:'Relationship data value change',
change1:'View data changes',
loadComp:'View loading complete',
},
appHeaderMenus: {
ibizlab:{
......@@ -130,19 +137,25 @@ export default {
endPlaceholder: 'End Dat4e',
},
dropDownList: {
placeholder: 'please select...'
placeholder: 'please select...',
},
dropDownListDynamic: {
placeholder: 'please select...'
placeholder: 'please select...',
},
dropDownListMpicker: {
placeholder: 'please select...'
placeholder: 'please select...',
},
login: {
error: 'Error',
caption: 'Welcome to login',
placeholder1:'User name',
placeholder2:'Password',
name: 'Login',
reset:'Reset',
other:'Other login methods',
tip: 'Enter username and password',
warning1:'QQ authorization login not supported',
warning2:'Wechat authorized login not supported',
loginname: {
placeholder: 'Username',
message: 'The username cannot be empty',
......@@ -174,4 +187,65 @@ export default {
hide: 'hide',
showMore: 'show more',
},
appUpdatePassword: {
oldPwd: 'Original password',
newPwd: 'New password',
confirmPwd: 'Confirm password',
sure: 'Confirm modification',
oldPwdErr: 'The original password cannot be empty!',
newPwdErr: 'New password cannot be empty!',
confirmPwdErr: 'The two input passwords are inconsistent!',
},
appAddressSelection: {
loadDataFail: 'City data loading failed'
},
appGroupSelect:{
groupSelect:'Group selection',
},
appImageUpload:{
uploadFail:'Upload failed'
},
appOrgSelect:{
loadFail:'Failed to load data'
},
appTransfer:{
title1:'Not selected',
title2:'Selected',
},
appWFApproval:{
commit:'Commit',
wait:'Waiting',
handle:'Handle',
placeholder:'Please enter the content',
end:'End'
},
contextMenuDrag:{
allApp:'All applications',
noFind:'The app was not found'
},
filterMode:{
placeholder:'Conditional logic',
},
filterTree:{
title1:'Add condition',
title2:'Add group',
placeholder:'Attribute',
},
iBizGroupPicker:{
ok:'Ok',
cancel:'Cancel',
},
iBizGroupSelect:{
groupSelect:'Group selection'
},
tabPageExp:{
more:'More',
},
uploadFile:{
imgMsg:'Drag the picture here to replace it',
localUpload:'Local upload',
or:'Or',
imgMsg1:'Select from stock'
}
};
\ No newline at end of file
......@@ -25,7 +25,7 @@ export default {
appColumnLink: {
error: '错误',
valueItemException:"值项异常",
rowDataException:"表格行数据异常"
rowDataException:"表格行数据异常",
},
appColumnRender: {
select: '请选择...',
......@@ -55,6 +55,8 @@ export default {
max: '最大',
row: '行',
currentPage: '当前页',
desc:'请输入起始页',
desc1:'请输入有效的起始页',
},
appFileUpload: {
preview: '查看',
......@@ -65,6 +67,11 @@ export default {
},
appFormDRUIPart: {
blockUITipInfo: '请先保存主数据',
viewLoadComp:'多数据视图加载完成,触发后续表单项更新',
save:'关系数据保存完成',
change:'关系数据值变化',
change1:'视图数据变化',
loadComp:'视图加载完成',
},
appHeaderMenus: {
ibizlab:{
......@@ -131,19 +138,25 @@ export default {
endPlaceholder: '结束日期',
},
dropDownList: {
placeholder: '请选择...'
placeholder: '请选择...',
},
dropDownListDynamic: {
placeholder: '请选择...'
placeholder: '请选择...',
},
dropDownListMpicker: {
placeholder: '请选择...'
placeholder: '请选择...',
},
login: {
error: '错误',
caption: '欢迎登录',
placeholder1:'用户名',
placeholder2:'密码',
name: '登录',
reset:'重置',
other:'其他登录方式',
tip: '输入用户名和密码',
warning1:'qq授权登录暂未支持',
warning2:'微信授权登录暂未支持',
loginname: {
placeholder: '请输入用户名',
message: '用户名不能为空',
......@@ -175,4 +188,64 @@ export default {
hide: '隐藏字段',
showMore: '显示更多字段',
},
appUpdatePassword: {
oldPwd: '原密码',
newPwd: '新密码',
confirmPwd: '确认密码',
sure: '确认修改',
oldPwdErr: '原密码不能为空!',
newPwdErr: '新密码不能为空!',
confirmPwdErr: '两次输入密码不一致!',
},
appAddressSelection: {
loadDataFail: '城市数据加载失败'
},
appGroupSelect:{
groupSelect:'分组选择',
},
appImageUpload:{
uploadFail:'上传失败'
},
appOrgSelect:{
loadFail:'加载数据失败'
},
appTransfer:{
title1:'未选择',
title2:'已选择',
},
appWFApproval:{
commit:'提交',
wait:'等待',
handle:'处理',
placeholder:'请输入内容',
end:'结束'
},
contextMenuDrag:{
allApp:'全部应用',
noFind:'未找到该应用'
},
filterMode:{
placeholder:'条件逻辑',
},
filterTree:{
title1:'添加条件',
title2:'添加组',
placeholder:'属性',
},
iBizGroupPicker:{
ok:'确认',
cancel:'取消',
},
iBizGroupSelect:{
groupSelect:'分组选择'
},
tabPageExp:{
more:'更多',
},
uploadFile:{
imgMsg:'将图片拖到这里替换',
localUpload:'本地上传',
or:'或',
imgMsg1:'从素材库选择'
}
};
\ No newline at end of file
......@@ -294,7 +294,8 @@ export default class EntityService {
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME) as any);
if(result){
let tempResult:any = result.filter((item:any) =>{
return !( Object.is(item[this.APPDEKEY],data[this.APPDEKEY]) && Object.is(item[this.APPDETEXT],data[this.APPDETEXT]));
// return !( Object.is(item[this.APPDEKEY],data[this.APPDEKEY]) && Object.is(item[this.APPDETEXT],data[this.APPDETEXT]));
return !Object.is(item[this.APPDEKEY],data[this.APPDEKEY]);
})
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempResult));
return {"status":200,"data":data};
......@@ -596,6 +597,19 @@ export default class EntityService {
return Http.getInstance().post(`/${this.APPDENAME}/batch`,data,isloading);
}
/**
* saveBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof EntityService
*/
public async saveBatch(context: any = {},data: any, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/${this.APPDENAME}/savebatch`,data,isloading);
}
/**
* updateBatch接口方法
*
......@@ -930,7 +944,6 @@ export default class EntityService {
public async updateChooseApp(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().put(`uaa/access-center/app-switcher/default`,data,isloading);
}
/**
* 修改密码
*
......
......@@ -6,7 +6,7 @@
export const getAppView = (state: any) => (viewtag: string) => {
const createdview = state.createdviews.find((appview: any) => Object.is(appview.secondtag, viewtag));
if (!createdview) {
console.log(`----视图 ${viewtag} 不存在-----`)
console.warn(`获取应用视图实例,,视图「${viewtag}」不存在`)
return null;
}
return createdview;
......@@ -20,7 +20,7 @@ export const getAppView = (state: any) => (viewtag: string) => {
export const getViewDataChangeState = (state:any) => (viewtag: string) => {
const createdview = state.createdviews.find((appview: any) => Object.is(appview.secondtag, viewtag));
if (!createdview) {
console.log(`----视图 ${viewtag} 不存在-----`)
console.warn(`获取视图数据状态,,视图「${viewtag}」不存在`)
return false;
}
return createdview.viewdatachange;
......@@ -34,7 +34,7 @@ export const getViewDataChangeState = (state:any) => (viewtag: string) => {
export const getRefreshData = (state: any) => (viewtag: string) => {
const createdview = state.createdviews.find((appview: any) => Object.is(appview.secondtag, viewtag));
if (!createdview) {
console.log(`----视图 ${viewtag} 不存在-----`)
console.warn(`获取数据刷新状态,视图「${viewtag}」不存在`)
return null;
}
return createdview.refreshdata;
......
......@@ -6,15 +6,10 @@
* @param param1
*/
export const createdView = (state: any, { viewtag, secondtag }: { viewtag: string, secondtag: string }) => {
// 该视图是否被创建
// const index = state.createdviews.findIndex((view: any) => Object.is(view.secondtag, viewtag));
// if (index !== -1) {
// return;
// }
// 原始数据中是否存在
const appview = state.appviews.find((appview: any) => Object.is(appview.viewtag, viewtag));
if (!appview) {
console.log(`----视图标识 ${viewtag} 不存在-----`)
console.warn(`视图「${viewtag}」原始数据不存在`);
return;
}
const _appview: any = JSON.parse(JSON.stringify(appview));
......@@ -48,7 +43,7 @@ export const removeView = (state: any, viewtag: string) => {
export const setViewDataChange = (state: any, { viewtag, viewdatachange }: { viewtag: string, viewdatachange: boolean }) => {
const createdview = state.createdviews.find((appview: any) => Object.is(appview.secondtag, viewtag));
if (!createdview) {
console.log(`----视图标识 ${viewtag} 不存在-----`)
console.warn(`设置数据状态变更,视图「${viewtag}」不存在`)
return;
}
createdview.viewdatachange = viewdatachange;
......@@ -63,7 +58,7 @@ export const setViewDataChange = (state: any, { viewtag, viewdatachange }: { vie
export const refreshViewData = (state: any, { viewtag }: { viewtag: string }) => {
const createdview = state.createdviews.find((appview: any) => Object.is(appview.secondtag, viewtag));
if (!createdview) {
console.log(`----视图标识 ${viewtag} 不存在-----`)
console.warn(`刷新视图数据,视图「${viewtag}」不存在`)
return;
}
createdview.refreshdata += 1;
......
......@@ -17,6 +17,13 @@ export default class UIService {
*/
private $store: Store<any> | null = null;
/**
* 所依赖权限服务
*
* @memberof UIService
*/
public authService:any;
/**
* Creates an instance of UIService.
*
......
.el-popover {
overflow-y: auto;
//z-index: 99 !important;
background: #ffffff;
border: 1px solid #dee0e4;
padding: 0px;
z-index: 2000;
color: var(--app-color-font-content);
line-height: 1.4;
text-align: justify;
font-size: 14px;
overflow-y: hidden;
overflow-x: hidden;
.el-card__header {
padding: 5px 10px;
border-bottom: 1px solid #dee0e4;
color: var(--app-color-font-content);
}
.el-card{
min-width: 150px;
border: none;
background-color: #ffffff;
color: var(--app-color-font-content);
}
.el-card__body {
padding: 0px;
overflow-x:hidden;
overflow-y: auto;
.viewcontainer2{
.content-container{
margin: 0;
}
}
}
}
.clearfix{
position: relative;
.cancel{
position: absolute;
right: 5px;
top: 5px;
}
.app-popover-wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
.app-popover.app-popper {
border-radius: 5px;
overflow: auto;
border: 1px solid #bfbfbf;
padding: 5px;
background: #e8e8e8;
}
}
\ No newline at end of file
import { Notice } from 'view-design';
export function Errorlog(target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<any>){
let origin=descriptor.value;
let $Notice: any = Notice;
descriptor.value=function(...args:any[]){
return new Promise((resolve: any, reject: any) => {
// 原方法调用方法
......@@ -12,7 +9,7 @@ export function Errorlog(target: Object, propertyKey: string, descriptor: TypedP
}).catch((error:any)=>{
// 开发模式下页面报错
if (process.env.NODE_ENV === 'development') {
$Notice.error({ title: '错误', desc: target.constructor.name+'类'+propertyKey+'方法产生异常' });
console.error(target.constructor.name+'类'+propertyKey+'方法产生异常');
}
// 控制台报错
console.error(error);
......
......@@ -114,6 +114,12 @@ export class Interceptors {
if (res.status === 401) {
this.doNoLogin(_data.data);
}
if(res.status === 403){
if(res.data && res.data.status && Object.is(res.data.status,"FORBIDDEN")){
let alertMessage:string ="非常抱歉,您无权操作此数据,如需操作请联系管理员!";
Object.assign(res.data,{localizedMessage:alertMessage,message:alertMessage});
}
}
// if (res.status === 404) {
// this.router.push({ path: '/404' });
// } else if (res.status === 500) {
......
......@@ -93,6 +93,17 @@ export declare interface ViewTool {
* @memberof ViewTool
*/
getIndexViewParam(): any;
/**
* 计算界面行为项权限状态
*
* @static
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof ViewTool
*/
calcActionItemAuthState(data:any,ActionModel:any,UIService:any):any;
}
declare module "vue/types/vue" {
......
......@@ -241,4 +241,41 @@ export class ViewTool {
public static getIndexViewParam(): any {
return this.indexViewParam;
}
/**
* 计算界面行为项权限状态
*
* @static
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof ViewTool
*/
public static calcActionItemAuthState(data:any,ActionModel:any,UIService:any){
for (const key in ActionModel) {
if (!ActionModel.hasOwnProperty(key)) {
return;
}
const _item = ActionModel[key];
if(_item && _item['dataaccaction'] && UIService && data && Object.keys(data).length >0){
let dataActionResult:any = UIService.getAllOPPrivs(data)[_item['dataaccaction']];
// 无权限:0;有权限:1
if(dataActionResult === 0){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_item.visabled = false;
}else{
_item.visabled = true;
}
}
if(dataActionResult === 1){
_item.visabled = true;
_item.disabled = false;
}
}
}
}
}
\ No newline at end of file
......@@ -181,7 +181,7 @@ export default class ControlService {
let dataItems: any[] = model.getDataItems();
dataItems.forEach(dataitem => {
let val = data.hasOwnProperty(dataitem.prop) ? data[dataitem.prop] : null;
if (!val) {
if (val === null) {
val = data.hasOwnProperty(dataitem.name) ? data[dataitem.name] : null;
}
if((isCreate === undefined || isCreate === null ) && Object.is(dataitem.dataType, 'GUID') && Object.is(dataitem.name, 'srfkey') && (val && !Object.is(val, ''))){
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册