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

Merge branch 'dev'

上级 4abfad32
...@@ -8,6 +8,7 @@ import { AppPopover } from './utils/app-popover/app-popover'; ...@@ -8,6 +8,7 @@ import { AppPopover } from './utils/app-popover/app-popover';
import { AppModal } from './utils/app-modal/app-modal'; import { AppModal } from './utils/app-modal/app-modal';
import { AppDrawer } from './utils/app-drawer/app-drawer'; import { AppDrawer } from './utils/app-drawer/app-drawer';
import { uiServiceRegister } from '@/uiservice/ui-service-register'; import { uiServiceRegister } from '@/uiservice/ui-service-register';
import { authServiceRegister } from '@/authservice/auth-service-register';
import { utilServiceRegister } from '@/utilservice/util-service-register'; import { utilServiceRegister } from '@/utilservice/util-service-register';
import { entityServiceRegister } from '@/service/entity-service-register'; import { entityServiceRegister } from '@/service/entity-service-register';
import { counterServiceRegister } from '@/counter/counter-service-register'; import { counterServiceRegister } from '@/counter/counter-service-register';
...@@ -79,6 +80,8 @@ import AppGroupSelect from './components/app-group-select/app-group-select.vue' ...@@ -79,6 +80,8 @@ import AppGroupSelect from './components/app-group-select/app-group-select.vue'
import UpdatePwd from './components/app-update-password/app-update-password.vue' import UpdatePwd from './components/app-update-password/app-update-password.vue'
// 全局挂载UI实体服务注册中心 // 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister; window['uiServiceRegister'] = uiServiceRegister;
// 全局挂载实体权限服务注册中心
window['authServiceRegister'] = authServiceRegister;
// 全局挂载功能服务注册中心 // 全局挂载功能服务注册中心
window['utilServiceRegister'] = utilServiceRegister; window['utilServiceRegister'] = utilServiceRegister;
// 全局挂载数据服务注册中心 // 全局挂载数据服务注册中心
......
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 };
/**
* 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
...@@ -66,7 +66,7 @@ export default class AppAddressSelection extends Vue { ...@@ -66,7 +66,7 @@ export default class AppAddressSelection extends Vue {
axios.get("../../assets/json/city_code.json").then((response: any) => { axios.get("../../assets/json/city_code.json").then((response: any) => {
this.format(response.data); this.format(response.data);
}).catch((response: any) => { }).catch((response: any) => {
console.log("城市数据加载失败"); console.log((this.$t('components.appAddressSelection.loadDataFail') as string));
}); });
......
...@@ -276,7 +276,7 @@ export default class AppCheckBox extends Vue { ...@@ -276,7 +276,7 @@ export default class AppCheckBox extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any)=>{ }).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 { ...@@ -191,7 +191,7 @@ export default class AppColumnLink extends Vue {
private openRedirectView($event: any, view: any, data: any): void { private openRedirectView($event: any, view: any, data: any): void {
this.$http.get(view.url, data).then((response: any) => { this.$http.get(view.url, data).then((response: any) => {
if (!response || response.status !== 200) { 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) { if (response.status === 401) {
return; return;
...@@ -243,7 +243,7 @@ export default class AppColumnLink extends Vue { ...@@ -243,7 +243,7 @@ export default class AppColumnLink extends Vue {
} }
}).catch((response: any) => { }).catch((response: any) => {
if (!response || !response.status || !response.data) { 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; return;
} }
if (response.status === 401) { if (response.status === 401) {
......
...@@ -443,13 +443,13 @@ export default class AppDataUploadView extends Vue { ...@@ -443,13 +443,13 @@ export default class AppDataUploadView extends Vue {
if (codelist) { if (codelist) {
resolve([...JSON.parse(JSON.stringify(codelist.items))]); resolve([...JSON.parse(JSON.stringify(codelist.items))]);
} else { } 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")){ }else if(codeListObject.tag && Object.is(codeListObject.type,"DYNAMIC")){
this.codeListService.getItems(codeListObject.tag).then((res:any) => { this.codeListService.getItems(codeListObject.tag).then((res:any) => {
resolve(res); resolve(res);
}).catch((error:any) => { }).catch((error:any) => {
console.log(`----${codeListObject.tag}----代码表不存在`); console.log(`----${codeListObject.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}); });
} }
}) })
......
...@@ -131,7 +131,7 @@ export default class AppDepartmentSelect extends Vue { ...@@ -131,7 +131,7 @@ export default class AppDepartmentSelect extends Vue {
this.$store.commit('addDepData', { srfkey: this.filter, orgData: response.data }); this.$store.commit('addDepData', { srfkey: this.filter, orgData: response.data });
}).catch((response: any) => { }).catch((response: any) => {
if (!response || !response.status || !response.data) { 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; return;
} }
}); });
......
...@@ -107,18 +107,18 @@ export default class AppExportExcel extends Vue { ...@@ -107,18 +107,18 @@ export default class AppExportExcel extends Vue {
this.visible = false; this.visible = false;
} else if (Object.is(type, 'custom')) { } else if (Object.is(type, 'custom')) {
if (!this.startPage || !this.endPage) { 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; return;
} }
const startPage: any = Number.parseInt(this.startPage, 10); const startPage: any = Number.parseInt(this.startPage, 10);
const endPage: any = Number.parseInt(this.endPage, 10); const endPage: any = Number.parseInt(this.endPage, 10);
if (Number.isNaN(startPage) || Number.isNaN(endPage)) { 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; return;
} }
if (startPage < 1 || endPage < 1 || startPage > endPage) { 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; return;
} }
this.startPage = null; this.startPage = null;
......
...@@ -136,7 +136,8 @@ export default class AppFileUpload extends Vue { ...@@ -136,7 +136,8 @@ export default class AppFileUpload extends Vue {
if (this.ignorefieldvaluechange) { if (this.ignorefieldvaluechange) {
return; return;
} }
this.setFiles(newval) this.getParams();
this.setFiles(newval);
this.dataProcess(); this.dataProcess();
} }
...@@ -288,6 +289,7 @@ export default class AppFileUpload extends Vue { ...@@ -288,6 +289,7 @@ export default class AppFileUpload extends Vue {
this.formStateEvent = this.formState.subscribe(($event: any) => { this.formStateEvent = this.formState.subscribe(($event: any) => {
// 表单加载完成 // 表单加载完成
if (Object.is($event.type, 'load')) { if (Object.is($event.type, 'load')) {
this.getParams();
this.setFiles(this.value); this.setFiles(this.value);
this.dataProcess(); this.dataProcess();
} }
...@@ -303,27 +305,36 @@ export default class AppFileUpload extends Vue { ...@@ -303,27 +305,36 @@ export default class AppFileUpload extends Vue {
*/ */
public mounted() { public mounted() {
this.appData = this.$store.getters.getAppData(); 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 upload_params: Array<string> = [];
let export_params: Array<string> = []; let export_params: Array<string> = [];
let custom_arr: Array<string> = [];
let param:any = this.viewparams; let param:any = this.viewparams;
let context:any = this.context; let context:any = this.context;
let _data:any = JSON.parse(this.data); let _data:any = JSON.parse(this.data);
if (this.uploadparams && !Object.is(this.uploadparams, '')) { 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, '')) { if (this.exportparams && !Object.is(this.exportparams, '')) {
exportparams = this.exportparams;
export_params = this.$util.computedNavData(_data,param,context,exportparams); export_params = this.$util.computedNavData(_data,param,context,exportparams);
} }
this.upload_params = [];
this.export_params = [];
for (const item in upload_params) { for (const item in upload_params) {
this.upload_params.push({ this.upload_params.push({
...@@ -335,9 +346,6 @@ export default class AppFileUpload extends Vue { ...@@ -335,9 +346,6 @@ export default class AppFileUpload extends Vue {
[item]:export_params[item] [item]:export_params[item]
}) })
} }
this.setFiles(this.value);
this.dataProcess();
} }
/** /**
......
...@@ -386,7 +386,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -386,7 +386,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart * @memberof AppFormDRUIPart
*/ */
public mditemsload(){ public mditemsload(){
console.log('多数据视图加载完成,触发后续表单项更新'); console.log((this.$t('components.appFormDRUIPart.viewLoadComp') as string));
} }
/** /**
...@@ -397,7 +397,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -397,7 +397,7 @@ export default class AppFormDRUIPart extends Vue {
*/ */
public drdatasaved($event:any){ public drdatasaved($event:any){
this.$emit('drdatasaved',$event); this.$emit('drdatasaved',$event);
console.log(this.viewname+'关系数据保存完成'); console.log(this.viewname+(this.$t('components.appFormDRUIPart.save') as string));
} }
/** /**
...@@ -407,7 +407,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -407,7 +407,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart * @memberof AppFormDRUIPart
*/ */
public drdatachange(){ public drdatachange(){
console.log('DEMEDITVIEW9 关系数据值变化'); console.log('DEMEDITVIEW9 '+(this.$t('components.appFormDRUIPart.change') as string));
} }
/** /**
...@@ -417,7 +417,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -417,7 +417,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart * @memberof AppFormDRUIPart
*/ */
public viewdataschange(){ public viewdataschange(){
console.log('视图数据变化'); console.log((this.$t('components.appFormDRUIPart.change1') as string));
} }
/** /**
...@@ -427,7 +427,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -427,7 +427,7 @@ export default class AppFormDRUIPart extends Vue {
* @memberof AppFormDRUIPart * @memberof AppFormDRUIPart
*/ */
public viewload(){ public viewload(){
console.log('视图加载完成'); console.log((this.$t('components.appFormDRUIPart.loadComp') as string));
} }
} }
</script> </script>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</a> </a>
<dropdown-menu slot='list' v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)"> <dropdown-menu slot='list' v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<dropdown-item v-for="(detail,index) in (uiActionGroup.details)" :key="index" :name="detail.name"> <dropdown-item v-for="(detail,index) in (uiActionGroup.details)" :key="index" :name="detail.name">
<span class='item' @click="doUIAction($event, detail)"> <span class='item' v-show="detail.visabled" :style="{'pointer-events':detail.disabled?'none':'auto'}" @click="doUIAction($event, detail)">
<template v-if="detail.isShowIcon"> <template v-if="detail.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')"> <template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i> <i :class="detail.icon" ></i>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<span class='item-extract-mode'> <span class='item-extract-mode'>
<template v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)"> <template v-if="uiActionGroup.details && Array.isArray(uiActionGroup.details)">
<div v-for="(detail,index) in uiActionGroup.details" :key="index"> <div v-for="(detail,index) in uiActionGroup.details" :key="index">
<span class='item' @click="doUIAction($event, detail)"> <span 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.isShowIcon">
<template v-if="detail.icon && !Object.is(detail.icon, '')"> <template v-if="detail.icon && !Object.is(detail.icon, '')">
<i :class="detail.icon" ></i> <i :class="detail.icon" ></i>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppFormGroup extends Vue { export default class AppFormGroup extends Vue {
...@@ -120,6 +120,69 @@ export default class AppFormGroup extends Vue { ...@@ -120,6 +120,69 @@ export default class AppFormGroup extends Vue {
*/ */
@Prop() public caption?: string; @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){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_item.visabled = false;
}else{
_item.visabled = true;
}
}else{
_item.visabled = true;
_item.disabled = false;
}
}
}
}
/** /**
* 是否为管理容器 * 是否为管理容器
* *
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
</div> </div>
</div> </div>
<div class="ibiz-group-footer"> <div class="ibiz-group-footer">
<el-button size="small" type="primary" @click="onOK">确认</el-button> <el-button size="small" type="primary" @click="onOK">{{$t('app.commonWords.ok')}}</el-button>
<el-button size="small" @click="onCancel">取消</el-button> <el-button size="small" @click="onCancel">{{$t('app.commonWords.cancel')}}</el-button>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -171,7 +171,7 @@ export default class AppGroupSelect extends Vue { ...@@ -171,7 +171,7 @@ export default class AppGroupSelect extends Vue {
public openView() { public openView() {
const view: any = { const view: any = {
viewname: 'app-group-picker', viewname: 'app-group-picker',
title: '分组选择' title: (this.$t('components.appGroupSelect.groupSelect') as string)
}; };
const context: any = JSON.parse(JSON.stringify(this.context)); const context: any = JSON.parse(JSON.stringify(this.context));
let filtervalue:string = ""; let filtervalue:string = "";
......
...@@ -135,6 +135,7 @@ export default class AppImageUpload extends Vue { ...@@ -135,6 +135,7 @@ export default class AppImageUpload extends Vue {
if (this.ignorefieldvaluechange) { if (this.ignorefieldvaluechange) {
return; return;
} }
this.getParams();
this.setFiles(newval) this.setFiles(newval)
this.dataProcess(); this.dataProcess();
} }
...@@ -294,6 +295,7 @@ export default class AppImageUpload extends Vue { ...@@ -294,6 +295,7 @@ export default class AppImageUpload extends Vue {
this.formStateEvent = this.formState.subscribe(($event: any) => { this.formStateEvent = this.formState.subscribe(($event: any) => {
// 表单加载完成 // 表单加载完成
if (Object.is($event.type, 'load')) { if (Object.is($event.type, 'load')) {
this.getParams();
this.setFiles(this.value); this.setFiles(this.value);
this.dataProcess(); this.dataProcess();
} }
...@@ -308,26 +310,37 @@ export default class AppImageUpload extends Vue { ...@@ -308,26 +310,37 @@ export default class AppImageUpload extends Vue {
*/ */
public mounted() { public mounted() {
this.appData = this.$store.getters.getAppData(); 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 upload_params: Array<string> = [];
let export_params: Array<string> = []; let export_params: Array<string> = [];
let custom_arr: Array<string> = [];
let param:any = this.viewparams; let param:any = this.viewparams;
let context:any = this.context; let context:any = this.context;
let _data:any = JSON.parse(this.data); let _data:any = JSON.parse(this.data);
if (this.uploadparams && !Object.is(this.uploadparams, '')) { 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, '')) { if (this.exportparams && !Object.is(this.exportparams, '')) {
exportparams = this.exportparams;
export_params = this.$util.computedNavData(_data,param,context,exportparams); export_params = this.$util.computedNavData(_data,param,context,exportparams);
} }
this.upload_params = [];
this.export_params = [];
for (const item in upload_params) { for (const item in upload_params) {
this.upload_params.push({ this.upload_params.push({
[item]:upload_params[item] [item]:upload_params[item]
...@@ -338,9 +351,6 @@ export default class AppImageUpload extends Vue { ...@@ -338,9 +351,6 @@ export default class AppImageUpload extends Vue {
[item]:export_params[item] [item]:export_params[item]
}) })
} }
this.setFiles(this.value);
this.dataProcess();
} }
/** /**
...@@ -397,7 +407,7 @@ export default class AppImageUpload extends Vue { ...@@ -397,7 +407,7 @@ export default class AppImageUpload extends Vue {
* @memberof AppImageUpload * @memberof AppImageUpload
*/ */
public onError(error: any, file: any, fileList: any) { public onError(error: any, file: any, fileList: any) {
this.$Notice.error({ title: '上传失败' }); this.$Notice.error({ title: (this.$t('components.appImageUpload.uploadFail') as string) });
} }
/** /**
......
...@@ -183,7 +183,7 @@ export default class AppOrgSelect extends Vue { ...@@ -183,7 +183,7 @@ export default class AppOrgSelect extends Vue {
} }
Http.getInstance().get(requestUrl).then((res:any) =>{ Http.getInstance().get(requestUrl).then((res:any) =>{
if(!res.status && res.status !== 200){ if(!res.status && res.status !== 200){
console.error("加载数据失败"); console.error((this.$t('components.appOrgSelect.loadFail') as string));
return; return;
} }
this.NodesData = res.data; this.NodesData = res.data;
......
...@@ -242,7 +242,7 @@ export default class AppPicker extends Vue { ...@@ -242,7 +242,7 @@ export default class AppPicker extends Vue {
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPicker * @memberof AppPicker
*/ */
@Watch('value',{immediate: true}) @Watch('value')
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
this.curvalue = newVal; this.curvalue = newVal;
if (Object.is(this.editortype, 'dropdown') && this.valueitem) { if (Object.is(this.editortype, 'dropdown') && this.valueitem) {
...@@ -268,6 +268,9 @@ export default class AppPicker extends Vue { ...@@ -268,6 +268,9 @@ export default class AppPicker extends Vue {
if(Object.is(this.editortype, 'dropdown')){ if(Object.is(this.editortype, 'dropdown')){
this.onSearch("", null, true); 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 { ...@@ -88,7 +88,7 @@ export default class AppRadioGroup extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any)=>{ }).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 { ...@@ -204,7 +204,7 @@ export default class AppRadioGroup extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any)=>{ }).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 { ...@@ -105,6 +105,62 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor * @memberof AppRichTextEditor
*/ */
public langu: any = localStorage.getItem('local') ? localStorage.getItem('local') : 'zh-CN' ; 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 { ...@@ -142,6 +198,7 @@ export default class AppRichTextEditor extends Vue {
if(this.formState) { if(this.formState) {
this.formState.subscribe(({ type, data }) => { this.formState.subscribe(({ type, data }) => {
if (Object.is('load', type)) { if (Object.is('load', type)) {
this.getParams();
if (!this.value) { if (!this.value) {
this.init(); this.init();
} }
...@@ -202,6 +259,7 @@ export default class AppRichTextEditor extends Vue { ...@@ -202,6 +259,7 @@ export default class AppRichTextEditor extends Vue {
if (newval) { if (newval) {
this.init(); this.init();
} }
this.getParams();
} }
/** /**
...@@ -259,13 +317,33 @@ export default class AppRichTextEditor extends Vue { ...@@ -259,13 +317,33 @@ export default class AppRichTextEditor extends Vue {
images_upload_handler: (bolbinfo: any, success: any, failure: any) => { images_upload_handler: (bolbinfo: any, success: any, failure: any) => {
const formData = new FormData(); const formData = new FormData();
formData.append('file', bolbinfo.blob(), bolbinfo.filename()); 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) => { richtexteditor.uploadFile(_url, formData).subscribe((file: any) => {
let downloadUrl = richtexteditor.downloadUrl;
if (file.filename) { if (file.filename) {
const id: string = file.fileid; const id: string = file.fileid;
const url: string = `${richtexteditor.downloadUrl}/${id}` const url: string = `${downloadUrl}/${id}`
success(url); 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) => { }, (error: any) => {
console.log(error); console.log(error);
failure('HTTP Error: ' + error.status); failure('HTTP Error: ' + error.status);
...@@ -310,8 +388,45 @@ export default class AppRichTextEditor extends Vue { ...@@ -310,8 +388,45 @@ export default class AppRichTextEditor extends Vue {
}); });
return subject; 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> </script>
<style lang="less"> <style lang="less">
@import './app-rich-text-editor.less';
</style> </style>
\ No newline at end of file
...@@ -76,6 +76,7 @@ export default class AppSlider extends Vue { ...@@ -76,6 +76,7 @@ export default class AppSlider extends Vue {
*/ */
@Watch('value') @Watch('value')
public onValueChange(newVal: any, oldVal: any) { public onValueChange(newVal: any, oldVal: any) {
newVal = (newVal === null) ? 0 : newVal;
this.currentVal = parseInt(newVal); this.currentVal = parseInt(newVal);
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
v-model="dataRight" v-model="dataRight"
:data="dataLeft" :data="dataLeft"
@change="dataChange" @change="dataChange"
:titles="['未选择', '已选择']"/> :titles="titles"/>
</Select> </Select>
</template> </template>
...@@ -123,6 +123,13 @@ export default class AppTransfer extends Vue { ...@@ -123,6 +123,13 @@ export default class AppTransfer extends Vue {
*/ */
@Model("change") public itemValue!: any; @Model("change") public itemValue!: any;
/**
* 左右侧标题
* @type{Array<string>}
* @memberof AppTransfer
*/
public titles?: Array<string>;
/** /**
* 左侧框数据 * 左侧框数据
* *
...@@ -153,6 +160,7 @@ export default class AppTransfer extends Vue { ...@@ -153,6 +160,7 @@ export default class AppTransfer extends Vue {
*/ */
public created() { public created() {
this.dataHandle(); 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 { ...@@ -167,7 +175,7 @@ export default class AppTransfer extends Vue {
this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))]; this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))];
this.initData() this.initData()
} else { } 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")) { } else if (this.tag && Object.is(this.codelistType, "DYNAMIC")) {
// 处理公共参数 // 处理公共参数
...@@ -183,7 +191,7 @@ export default class AppTransfer extends Vue { ...@@ -183,7 +191,7 @@ export default class AppTransfer extends Vue {
this.initData() this.initData()
}) })
.catch((error: any) => { .catch((error: any) => {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}); });
} }
} }
......
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
<div class="update-password"> <div class="update-password">
<div class="password-item"> <div class="password-item">
<label for> <label for>
原密码: {{$t('components.appUpdatePassword.oldPwd')}}
<Input type="password" v-model="oldPwd" @on-blur="oldPwdVaild"/> <Input type="password" v-model="oldPwd" @on-blur="oldPwdVaild"/>
</label> </label>
</div> </div>
<div class="password-item"> <div class="password-item">
<label for> <label for>
新密码: {{$t('components.appUpdatePassword.newPwd')}}
<Input type="password" v-model="newPwd" @on-blur="newPwdVaild"/> <Input type="password" v-model="newPwd" @on-blur="newPwdVaild"/>
</label> </label>
</div> </div>
<div class="password-item"> <div class="password-item">
<label for> <label for>
确认密码: {{$t('components.appUpdatePassword.confirmPwd')}}
<Input type="password" v-model="confirmPwd" :disabled="!this.newPwd" @on-blur="confirmVaild" /> <Input type="password" v-model="confirmPwd" :disabled="!this.newPwd" @on-blur="confirmVaild" />
</label> </label>
</div> </div>
<div class="password-item password-btn"> <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>
</div> </div>
</template> </template>
...@@ -73,7 +73,7 @@ export default class AppUpdatePassword extends Vue { ...@@ -73,7 +73,7 @@ export default class AppUpdatePassword extends Vue {
public oldPwdVaild(){ public oldPwdVaild(){
if(!this.oldPwd){ if(!this.oldPwd){
this.$Notice.error({ this.$Notice.error({
title:'原密码不能为空!', title: (this.$t('components.appUpdatePassword.oldPwdErr') as string),
duration: 3 duration: 3
}); });
} }
...@@ -88,7 +88,7 @@ export default class AppUpdatePassword extends Vue { ...@@ -88,7 +88,7 @@ export default class AppUpdatePassword extends Vue {
public newPwdVaild(){ public newPwdVaild(){
if(!this.newPwd){ if(!this.newPwd){
this.$Notice.error({ this.$Notice.error({
title:'新密码不能为空!', title: (this.$t('components.appUpdatePassword.newPwdErr') as string),
duration: 3 duration: 3
}); });
} }
...@@ -104,7 +104,7 @@ export default class AppUpdatePassword extends Vue { ...@@ -104,7 +104,7 @@ export default class AppUpdatePassword extends Vue {
if (this.newPwd && this.confirmPwd) { if (this.newPwd && this.confirmPwd) {
if (this.confirmPwd !== this.newPwd) { if (this.confirmPwd !== this.newPwd) {
this.$Notice.error({ this.$Notice.error({
title:'两次输入密码不一致!', title: (this.$t('components.appUpdatePassword.confirmPwdErr') as string),
duration: 3 duration: 3
}); });
}else{ }else{
...@@ -136,7 +136,7 @@ export default class AppUpdatePassword extends Vue { ...@@ -136,7 +136,7 @@ export default class AppUpdatePassword extends Vue {
} }
}).catch((error: any) =>{ }).catch((error: any) =>{
this.$Notice.error({ this.$Notice.error({
title:'系统异常', title: (this.$t('app.codeNotExist.sysException') as string),
duration: 3 duration: 3
}); });
console.error(error); console.error(error);
......
...@@ -51,7 +51,7 @@ export default class AppUser extends Vue { ...@@ -51,7 +51,7 @@ export default class AppUser extends Vue {
} }
}); });
}else if (Object.is(data, 'updatepwd')) { }else if (Object.is(data, 'updatepwd')) {
let container: Subject<any> = this.$appmodal.openModal({ viewname: 'app-update-password', title: "修改密码", width: 500, height: 400, }, {}, {}); 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) => { container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) { if (!result || !Object.is(result.ret, 'OK')) {
return; return;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class='app-wf-approval'> <div class='app-wf-approval'>
<div class="app-wf-approval-header"> <div class="app-wf-approval-header">
<span class="approval-header-left">{{data.startTime}}</span> <span class="approval-header-left">{{data.startTime}}</span>
<span>{{data.startUserName}}提交</span> <span>{{data.startUserName}}{{$t('components.appWFApproval.commit')}}</span>
</div> </div>
<div class="app-wf-approval-content" v-if="data.usertasks && data.usertasks.length >0"> <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"> <div class="approval-content-item" v-for="(usertask,index) in data.usertasks" :key="index">
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</div> </div>
<div class="approval-content-item-right"> <div class="approval-content-item-right">
<div class="approval-content-item-wait" v-if="usertask.identitylinks.length >0"> <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>
<div class="approval-content-item-info" v-if="usertask.comments.length >0"> <div class="approval-content-item-info" v-if="usertask.comments.length >0">
<div v-for="(comment,commentInx) in usertask.comments" :key="commentInx"> <div v-for="(comment,commentInx) in usertask.comments" :key="commentInx">
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
</div> </div>
</div> </div>
<div class="approval-content-item-memo" v-if="usertask.userTaskId === viewparams.userTaskId"> <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> </div>
</div> </div>
<div class="app-wf-approval-bottom"> <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>
</div> </div>
</template> </template>
......
...@@ -192,7 +192,7 @@ export default class CodeList extends Vue { ...@@ -192,7 +192,7 @@ export default class CodeList extends Vue {
let items = res; let items = res;
_this.setItems(items, _this); _this.setItems(items, _this);
}).catch((error: any) => { }).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")){ } else if(Object.is(this.codelistType, "STATIC")){
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<Icon type="md-apps" /> <Icon type="md-apps" />
</div> </div>
<div class="content"> <div class="content">
<span>全部应用</span> <span>{{$t('components.contextMenuDrag.allApp')}}</span>
</div> </div>
<div class="forward"> <div class="forward">
<Icon type="ios-arrow-forward" /> <Icon type="ios-arrow-forward" />
...@@ -221,7 +221,7 @@ export default class ContextMenuDrag extends Vue { ...@@ -221,7 +221,7 @@ export default class ContextMenuDrag extends Vue {
const put: Promise<any> = this.entityService.updateChooseApp(null,params); const put: Promise<any> = this.entityService.updateChooseApp(null,params);
window.location.href = item.addr; window.location.href = item.addr;
}else{ }else{
this.$message.info("未找到该应用"); this.$message.info((this.$t('components.contextMenuDrag.noFind') as string));
} }
} }
......
...@@ -201,7 +201,7 @@ export default class DropDownListDynamic extends Vue { ...@@ -201,7 +201,7 @@ export default class DropDownListDynamic extends Vue {
if (codelist) { if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))]; this.items = [...JSON.parse(JSON.stringify(codelist.items))];
} else { } 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")){ }else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理 // 公共参数处理
...@@ -213,7 +213,7 @@ export default class DropDownListDynamic extends Vue { ...@@ -213,7 +213,7 @@ export default class DropDownListDynamic extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any) => { }).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 { ...@@ -236,7 +236,7 @@ export default class DropDownListDynamic extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any) => { }).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}); });
} }
} }
......
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
class='dropdown-list-mpicker' class='dropdown-list-mpicker'
multiple multiple
:transfer="true" :transfer="true"
transfer-class-name="dropdown-list-mpicker-transfer"
v-model="currentVal" v-model="currentVal"
:disabled="disabled === true ? true : false" :disabled="disabled === true ? true : false"
:clearable="true" :clearable="true"
:filterable="filterable === true ? true : false" :filterable="filterable === true ? true : false"
@on-open-change="onClick" @on-open-change="onClick"
:placeholder="$t('components.dropDownListMpicker.placeholder')"> :placeholder="$t('components.dropDownListMpicker.placeholder')">
<i-option v-for="(item, index) in items" :key="index" :value="item.value" :label="item.text"> <i-option v-for="(item, index) in items" :key="index" :value="item.value.toString()" :label="item.text">
<Checkbox :value = "(currentVal.indexOf(item.value))==-1?false:true"> <Checkbox :value = "(currentVal.indexOf(item.value.toString()))==-1?false:true">
{{Object.is(codelistType,'STATIC') ? $t('codelist.'+tag+'.'+item.value) : item.text}} {{Object.is(codelistType,'STATIC') ? $t('codelist.'+tag+'.'+item.value) : item.text}}
</Checkbox> </Checkbox>
</i-option> </i-option>
...@@ -186,7 +187,7 @@ export default class DropDownListMpicker extends Vue { ...@@ -186,7 +187,7 @@ export default class DropDownListMpicker extends Vue {
if (codelist) { if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))]; this.items = [...JSON.parse(JSON.stringify(codelist.items))];
} else { } 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")){ }else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理 // 公共参数处理
...@@ -198,7 +199,7 @@ export default class DropDownListMpicker extends Vue { ...@@ -198,7 +199,7 @@ export default class DropDownListMpicker extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any) => { }).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 { ...@@ -220,7 +221,7 @@ export default class DropDownListMpicker extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any) => { }).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}); });
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:filterable="filterable === true ? true : false" :filterable="filterable === true ? true : false"
@on-open-change="onClick" @on-open-change="onClick"
:placeholder="$t('components.dropDownList.placeholder')"> :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> </i-select>
</template> </template>
...@@ -157,7 +157,7 @@ export default class DropDownList extends Vue { ...@@ -157,7 +157,7 @@ export default class DropDownList extends Vue {
* @memberof DropDownList * @memberof DropDownList
*/ */
get currentVal() { get currentVal() {
return this.itemValue; return this.itemValue ? this.itemValue.toString() : undefined;
} }
/** /**
...@@ -201,7 +201,7 @@ export default class DropDownList extends Vue { ...@@ -201,7 +201,7 @@ export default class DropDownList extends Vue {
if (codelist) { if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))]; this.items = [...JSON.parse(JSON.stringify(codelist.items))];
} else { } 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")){ }else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理 // 公共参数处理
...@@ -213,7 +213,7 @@ export default class DropDownList extends Vue { ...@@ -213,7 +213,7 @@ export default class DropDownList extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any) => { }).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 { ...@@ -236,7 +236,7 @@ export default class DropDownList extends Vue {
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; this.items = res;
}).catch((error:any) => { }).catch((error:any) => {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
}); });
} }
} }
......
<template> <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 <el-option
v-for="mode in filterMode" v-for="mode in fieldFilterMode"
:key="mode.value" :key="mode.value"
:label="getLabel(mode)" :label="getLabel(mode)"
:value="mode.value" :value="mode.value"
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Model } from "vue-property-decorator"; import { Vue, Component, Model, Prop, Watch } from "vue-property-decorator";
@Component({}) @Component({})
export default class FilterMode extends Vue { export default class FilterMode extends Vue {
...@@ -24,6 +24,19 @@ export default class FilterMode extends Vue { ...@@ -24,6 +24,19 @@ export default class FilterMode extends Vue {
*/ */
@Model('change') readonly value: any; @Model('change') readonly value: any;
/**
* 自定义逻辑集合
*
* @type {*}
* @memberof FilterMode
*/
@Prop() modes!: any[];
@Watch('modes')
onModesChange(newVal: any) {
this.setDefValue();
}
get curVal() { get curVal() {
return this.value; return this.value;
} }
...@@ -34,6 +47,21 @@ export default class FilterMode extends Vue { ...@@ -34,6 +47,21 @@ export default class FilterMode extends Vue {
this.$emit('change', val); 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 { ...@@ -44,13 +72,13 @@ export default class FilterMode extends Vue {
// { name: 'AND', value: '$and' }, // { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' }, // { name: 'OR', value: '$or' },
{ 'zh-CN': '等于(=)', 'en-US': 'EQ', value: '$eq' }, { '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': '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': 'LT', value: '$lt' },
{ 'zh-CN': '小于(<=)', 'en-US': 'LE', value: '$lte' }, { 'zh-CN': '小于等于(<=)', 'en-US': 'LTANDEQ', value: '$lte' },
{ 'zh-CN': '值为空(Nil)', 'en-US': 'IS_NULL', value: '$null' }, { 'zh-CN': '值为空(Nil)', 'en-US': 'ISNULL', value: '$null' },
{ 'zh-CN': '值不为空(NotNil)', 'en-US': 'IS_NOT_NULL', value: '$notNull' }, { 'zh-CN': '值不为空(NotNil)', 'en-US': 'ISNOTNULL', value: '$notNull' },
{ 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' }, { 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' },
{ 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' }, { 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' },
{ 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' }, { 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' },
...@@ -60,13 +88,37 @@ export default class FilterMode extends Vue { ...@@ -60,13 +88,37 @@ export default class FilterMode extends Vue {
// { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' } // { '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} * @return {string}
* @memberof FilterMode * @memberof FilterMode
*/ */
getLabel(mode: any): string { public getLabel(mode: any): string {
if(this.$i18n.locale) { if(this.$i18n.locale) {
return mode[this.$i18n.locale]; return mode[this.$i18n.locale];
} }
...@@ -79,7 +131,16 @@ export default class FilterMode extends Vue { ...@@ -79,7 +131,16 @@ export default class FilterMode extends Vue {
* @memberof FilterMode * @memberof FilterMode
*/ */
public onChange() { 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,25 +7,25 @@ ...@@ -7,25 +7,25 @@
<el-option v-for="mode in relationModes" :key="mode.value" :label="getLabel(mode)" :value="mode.value"></el-option> <el-option v-for="mode in relationModes" :key="mode.value" :label="getLabel(mode)" :value="mode.value"></el-option>
</el-select> </el-select>
<div class="filter-tree-action"> <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="$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="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</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)"/> <icon v-if="!data.isroot" type="md-close" @click="onRemoveItem(node, data)"/>
</div> </div>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="filter-tree-item"> <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 <el-option
v-for="item in fields" v-for="item in fieldItems"
:key="item.prop" :key="item.value"
:label="item.label" :label="item.label"
:value="item.name"> :value="item.value">
</el-option> </el-option>
</el-select> </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"> <div class="filter-item-value">
<i-input v-if="!data.field"></i-input> <i-input v-if="!data.editor"></i-input>
<slot v-else :data="data"></slot> <slot v-else :data="data"></slot>
</div> </div>
<div class="filter-tree-action"> <div class="filter-tree-action">
...@@ -64,6 +64,14 @@ export default class FilterTree extends Vue { ...@@ -64,6 +64,14 @@ export default class FilterTree extends Vue {
*/ */
@Prop() fields: any; @Prop() fields: any;
/**
* 属性项集合
*
* @type {*}
* @memberof FilterTree
*/
protected fieldItems: any[] = [];
/** /**
* 组条件集合 * 组条件集合
* *
...@@ -93,29 +101,77 @@ export default class FilterTree extends Vue { ...@@ -93,29 +101,77 @@ export default class FilterTree extends Vue {
return [root]; return [root];
} }
/** /**
* 获取语言文本 * 生命周期
* *
* @return {string} * @return {void}
* @memberof FilterTree * @memberof FilterTree
*/ */
getLabel(mode: any): string { public created() {
if(this.$i18n.locale) { if(!this.fields) {
return mode[this.$i18n.locale]; 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 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 * @memberof FilterTree
*/ */
public onFieldChange(data: any) { public getFieldModes(name: string) {
if(!data.mode) { let modes: any[] = [];
data.mode = '$eq'; 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'];
} }
/** /**
...@@ -128,7 +184,8 @@ export default class FilterTree extends Vue { ...@@ -128,7 +184,8 @@ export default class FilterTree extends Vue {
if(data && data.children) { if(data && data.children) {
data.children.push({ data.children.push({
field: null, field: null,
mode: null mode: null,
editor: null
}); });
} }
} }
...@@ -162,6 +219,18 @@ export default class FilterTree extends Vue { ...@@ -162,6 +219,18 @@ export default class FilterTree extends Vue {
} }
} }
} }
/**
* 条件逻辑变化
*
* @return {*}
* @memberof FilterTree
*/
public onModeChange(mode: any, data: any) {
if(mode && data) {
data.editor = mode.name;
}
}
} }
</script> </script>
......
...@@ -5,7 +5,13 @@ ...@@ -5,7 +5,13 @@
top: 0; top: 0;
right: 20px; right: 20px;
} }
.ivu-input-number{
width: 100%;
}
.ivu-input-number-input{ .ivu-input-number-input{
text-align: right; text-align: right;
} }
.ivu-input-number-input:hover{
padding-right:22px;
}
} }
\ No newline at end of file
<template> <template>
<div class="input-unit"> <div class="input-unit">
<InputNumber v-if="type === 'number'" <InputNumber v-if="type === 'number'"
:id="numberId"
:placeholder="placeholder" :placeholder="placeholder"
:size="size" :size="size"
:precision="precision" :precision="precision"
v-model="CurrentVal" v-model="CurrentVal"
:disabled="disabled ? true : false" :disabled="disabled ? true : false"
:formatter="formatter"
:parser="parser"
></InputNumber> ></InputNumber>
<i-input v-else <i-input v-else
:placeholder="placeholder" :placeholder="placeholder"
...@@ -27,6 +30,7 @@ import { debounceTime, distinctUntilChanged } from "rxjs/operators"; ...@@ -27,6 +30,7 @@ import { debounceTime, distinctUntilChanged } from "rxjs/operators";
@Component({}) @Component({})
export default class InputBox extends Vue { export default class InputBox extends Vue {
/** /**
* 双向绑定值 * 双向绑定值
* @type {any} * @type {any}
...@@ -40,11 +44,12 @@ export default class InputBox extends Vue { ...@@ -40,11 +44,12 @@ export default class InputBox extends Vue {
* @memberof InputBox * @memberof InputBox
*/ */
public mounted(){ public mounted(){
this.addEvent();
if(this.textareaId){ if(this.textareaId){
let textarea :any= document.getElementById(this.textareaId); let textarea :any= document.getElementById(this.textareaId);
if(textarea){ if(textarea){
textarea.style=this.textareaStyle; textarea.style=this.textareaStyle;
} }
} }
} }
...@@ -114,6 +119,11 @@ export default class InputBox extends Vue { ...@@ -114,6 +119,11 @@ export default class InputBox extends Vue {
*/ */
@Prop() public autoSize?: any; @Prop() public autoSize?: any;
/**
* 数值框numberId
*/
public numberId :string= this.$util.createUUID();
/** /**
* 当前值 * 当前值
* *
...@@ -158,6 +168,49 @@ export default class InputBox extends Vue { ...@@ -158,6 +168,49 @@ export default class InputBox extends Vue {
} }
return $event; 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";
}
}
}
/**
* 指定输入框展示值的格式
*/
public formatter(value:any){
if(this.precision===0) return this.CurrentVal;
if(value.indexOf('.')!==-1){
let arr:Array<any> = value.split('.');
if(arr[1]==='00'){
return arr[0];
}
if(parseInt(arr[1])%10===0){
return arr[0]+'.'+parseInt(arr[1])/10;
}
}
return value;
}
/**
* 指定从 formatter 里转换回数字的方式
*/
public parser(value:any){
return value;
}
} }
</script> </script>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
size='large' size='large'
prefix='ios-contact' prefix='ios-contact'
v-model.trim="form.loginname" v-model.trim="form.loginname"
placeholder="用户名" :placeholder="$t('components.login.placeholder1')"
@keyup.enter.native="handleSubmit"> @keyup.enter.native="handleSubmit">
</i-input> </i-input>
</form-item> </form-item>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
prefix='ios-key' prefix='ios-key'
v-model.trim="form.password" v-model.trim="form.password"
type='password' type='password'
placeholder="密码" :placeholder="$t('components.login.placeholder2')"
@keyup.enter.native="handleSubmit"> @keyup.enter.native="handleSubmit">
</i-input> </i-input>
</form-item> </form-item>
...@@ -32,18 +32,18 @@ ...@@ -32,18 +32,18 @@
<i-button <i-button
@click="handleSubmit" @click="handleSubmit"
type='primary' type='primary'
class="login_btn">登录 class="login_btn">{{$t('components.login.name')}}
</i-button> </i-button>
<i-button <i-button
@click="goReset" @click="goReset"
type='success' type='success'
class="login_reset">重置 class="login_reset">{{$t('components.login.reset')}}
</i-button> </i-button>
</form-item> </form-item>
<form-item> <form-item>
<div style="text-align: center"> <div style="text-align: center">
<span class="form_tipinfo">其他登录方式</span> <span class="form_tipinfo">{{$t('components.login.other')}}</span>
</div> </div>
<div style="text-align: center"> <div style="text-align: center">
<div class="sign-btn" @click="tencentHandleClick('tencent')"> <div class="sign-btn" @click="tencentHandleClick('tencent')">
...@@ -195,13 +195,13 @@ export default class Login extends Vue { ...@@ -195,13 +195,13 @@ export default class Login extends Vue {
if (data && data.message) { if (data && data.message) {
this.loginTip = data.message; this.loginTip = data.message;
this.$Message.error({ this.$Message.error({
content: "登录失败," + data.message, content: (this.$t('components.login.loginfailed') as string)+' ' + data.message,
duration: 5, duration: 5,
closable: true closable: true
}); });
} else { } else {
this.$Message.error({ this.$Message.error({
content: "登录失败", content: (this.$t('components.login.loginfailed') as string),
duration: 5, duration: 5,
closable: true closable: true
}); });
...@@ -259,7 +259,7 @@ export default class Login extends Vue { ...@@ -259,7 +259,7 @@ export default class Login extends Vue {
* @param thirdpart * @param thirdpart
*/ */
public tencentHandleClick(thirdpart: any) { public tencentHandleClick(thirdpart: any) {
this.$Message.warning("qq授权登录暂未支持") this.$Message.warning((this.$t('components.login.warning1') as string))
} }
/** /**
...@@ -267,7 +267,7 @@ export default class Login extends Vue { ...@@ -267,7 +267,7 @@ export default class Login extends Vue {
* @param thirddpart * @param thirddpart
*/ */
public wechatHandleClick(thirddpart: any) { public wechatHandleClick(thirddpart: any) {
this.$Message.warning("微信授权登录暂未支持") this.$Message.warning((this.$t('components.login.warning2') as string))
} }
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div v-show="$store.state.pageMetas.length > 0" class="right"> <div v-show="$store.state.pageMetas.length > 0" class="right">
<el-dropdown @command="handlerClose"> <el-dropdown @command="handlerClose">
<el-button size="mini" type="primary"> <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-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="item" v-for="(item,index) in actions" :key="index">{{ $t(item.text) }}</el-dropdown-item> <el-dropdown-item :command="item" v-for="(item,index) in actions" :key="index">{{ $t(item.text) }}</el-dropdown-item>
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
:on-exceeded-size="exceededsize" :on-exceeded-size="exceededsize"
:on-progress="progress"> :on-progress="progress">
<div class="upload-text"> <div class="upload-text">
<p>将图片拖到这里替换</p> <p>{{$t('components.uploadFile.imgMsg')}}</p>
<p><span class="text-style">本地上传</span><span class="text-style">从素材库选择</span></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> </div>
</upload> </upload>
</div> </div>
......
...@@ -106,6 +106,7 @@ export default class EditViewEngine extends ViewEngine { ...@@ -106,6 +106,7 @@ export default class EditViewEngine extends ViewEngine {
this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0')); this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1'); const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata); this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
} }
/** /**
...@@ -120,6 +121,7 @@ export default class EditViewEngine extends ViewEngine { ...@@ -120,6 +121,7 @@ export default class EditViewEngine extends ViewEngine {
this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0')); this.setTabCaption(this.view.model.dataInfo,Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1'); const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata); this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
this.view.$emit('save',arg); this.view.$emit('save',arg);
this.view.$emit('viewdataschange',JSON.stringify({action:'save',status:'success',data:arg})); this.view.$emit('viewdataschange',JSON.stringify({action:'save',status:'success',data:arg}));
} }
...@@ -144,66 +146,10 @@ export default class EditViewEngine extends ViewEngine { ...@@ -144,66 +146,10 @@ export default class EditViewEngine extends ViewEngine {
* @memberof EditViewEngine * @memberof EditViewEngine
*/ */
public doSysUIAction(tag: string, actionmode?: string): void { 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')) { if (Object.is(tag, 'Save')) {
this.doSave(); this.doSave();
return; 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); super.doSysUIAction(tag, actionmode);
} }
...@@ -263,4 +209,16 @@ export default class EditViewEngine extends ViewEngine { ...@@ -263,4 +209,16 @@ export default class EditViewEngine extends ViewEngine {
} }
} }
/**
* 转化数据
*
* @memberof EditViewEngine
*/
public transformData(arg:any){
if(!this.getForm() || !(this.getForm().transformData instanceof Function)){
return null;
}
return this.getForm().transformData(arg);
}
} }
\ No newline at end of file
...@@ -150,9 +150,9 @@ export default class ListViewEngine extends MDViewEngine { ...@@ -150,9 +150,9 @@ export default class ListViewEngine extends MDViewEngine {
arg.srfkeys = keys; arg.srfkeys = keys;
} }
const grid: any = this.getMDCtrl(); const list: any = this.getMDCtrl();
if (grid) { if (list) {
grid.remove(arg); list.remove(arg);
} }
} }
......
...@@ -358,6 +358,9 @@ export default class MDViewEngine extends ViewEngine { ...@@ -358,6 +358,9 @@ export default class MDViewEngine extends ViewEngine {
} }
const state = args.length > 0 && !Object.is(args[0].srfkey, '') ? false : true; const state = args.length > 0 && !Object.is(args[0].srfkey, '') ? false : true;
this.calcToolbarItemState(state); this.calcToolbarItemState(state);
if(args && args.length > 0){
this.calcToolbarItemAuthState(this.transformData(args[0]));
}
} }
/** /**
...@@ -395,8 +398,8 @@ export default class MDViewEngine extends ViewEngine { ...@@ -395,8 +398,8 @@ export default class MDViewEngine extends ViewEngine {
if (this.getSearchForm() && this.view.isExpandSearchForm) { if (this.getSearchForm() && this.view.isExpandSearchForm) {
Object.assign(arg, this.getSearchForm().getData()); Object.assign(arg, this.getSearchForm().getData());
} }
if (this.view && this.view.searchbar) { if (this.view && this.view.$refs.searchbar) {
Object.assign(arg, this.view.searchbar.getData()); Object.assign(arg, this.view.$refs.searchbar.getData());
} }
if (this.view && !this.view.isExpandSearchForm) { if (this.view && !this.view.isExpandSearchForm) {
Object.assign(arg, { query: this.view.query }); Object.assign(arg, { query: this.view.query });
...@@ -436,4 +439,17 @@ export default class MDViewEngine extends ViewEngine { ...@@ -436,4 +439,17 @@ export default class MDViewEngine extends ViewEngine {
return this.propertypanel; 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,45 @@ export default class ViewEngine { ...@@ -169,7 +169,45 @@ export default class ViewEngine {
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) { if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state; _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){
// 禁用: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;
}
}else{
_this.view.toolBarModels[key].visabled = true;
}
}
}
}
} }
\ No newline at end of file
import { UIServiceRegister } from '@/uiservice/ui-service-register'; import { UIServiceRegister } from '@/uiservice/ui-service-register';
import { AuthServiceRegister } from '@/authservice/auth-service-register';
import { UtilServiceRegister } from '@/utilservice/util-service-register'; import { UtilServiceRegister } from '@/utilservice/util-service-register';
import { EntityServiceRegister } from '@/service/entity-service-register'; import { EntityServiceRegister } from '@/service/entity-service-register';
import { CounterServiceRegister } from '@/counter/counter-service-register'; import { CounterServiceRegister } from '@/counter/counter-service-register';
...@@ -6,8 +7,9 @@ import { CounterServiceRegister } from '@/counter/counter-service-register'; ...@@ -6,8 +7,9 @@ import { CounterServiceRegister } from '@/counter/counter-service-register';
declare global { declare global {
interface Window { interface Window {
uiServiceRegister: UIServiceRegister, uiServiceRegister: UIServiceRegister,
utilServiceRegister:UtilServiceRegister, authServiceRegister: AuthServiceRegister,
entityServiceRegister:EntityServiceRegister, utilServiceRegister: UtilServiceRegister,
counterServiceRegister:CounterServiceRegister entityServiceRegister: EntityServiceRegister,
counterServiceRegister: CounterServiceRegister
} }
} }
\ No newline at end of file
...@@ -55,6 +55,8 @@ export default { ...@@ -55,6 +55,8 @@ export default {
max: 'At Most', max: 'At Most',
row: 'Lines', row: 'Lines',
currentPage: 'Current Page', currentPage: 'Current Page',
desc:'Please enter the start page',
desc1:'Please enter a valid start page',
}, },
appFileUpload: { appFileUpload: {
preview: 'preview', preview: 'preview',
...@@ -64,6 +66,11 @@ export default { ...@@ -64,6 +66,11 @@ export default {
}, },
appFormDRUIPart: { appFormDRUIPart: {
blockUITipInfo: 'Please save the major data first', 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: { appHeaderMenus: {
ibizlab:{ ibizlab:{
...@@ -130,19 +137,25 @@ export default { ...@@ -130,19 +137,25 @@ export default {
endPlaceholder: 'End Dat4e', endPlaceholder: 'End Dat4e',
}, },
dropDownList: { dropDownList: {
placeholder: 'please select...' placeholder: 'please select...',
}, },
dropDownListDynamic: { dropDownListDynamic: {
placeholder: 'please select...' placeholder: 'please select...',
}, },
dropDownListMpicker: { dropDownListMpicker: {
placeholder: 'please select...' placeholder: 'please select...',
}, },
login: { login: {
error: 'Error', error: 'Error',
caption: 'Welcome to login', caption: 'Welcome to login',
placeholder1:'User name',
placeholder2:'Password',
name: 'Login', name: 'Login',
reset:'Reset',
other:'Other login methods',
tip: 'Enter username and password', tip: 'Enter username and password',
warning1:'QQ authorization login not supported',
warning2:'Wechat authorized login not supported',
loginname: { loginname: {
placeholder: 'Username', placeholder: 'Username',
message: 'The username cannot be empty', message: 'The username cannot be empty',
...@@ -174,4 +187,65 @@ export default { ...@@ -174,4 +187,65 @@ export default {
hide: 'hide', hide: 'hide',
showMore: 'show more', 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 { ...@@ -25,7 +25,7 @@ export default {
appColumnLink: { appColumnLink: {
error: '错误', error: '错误',
valueItemException:"值项异常", valueItemException:"值项异常",
rowDataException:"表格行数据异常" rowDataException:"表格行数据异常",
}, },
appColumnRender: { appColumnRender: {
select: '请选择...', select: '请选择...',
...@@ -55,6 +55,8 @@ export default { ...@@ -55,6 +55,8 @@ export default {
max: '最大', max: '最大',
row: '行', row: '行',
currentPage: '当前页', currentPage: '当前页',
desc:'请输入起始页',
desc1:'请输入有效的起始页',
}, },
appFileUpload: { appFileUpload: {
preview: '查看', preview: '查看',
...@@ -65,6 +67,11 @@ export default { ...@@ -65,6 +67,11 @@ export default {
}, },
appFormDRUIPart: { appFormDRUIPart: {
blockUITipInfo: '请先保存主数据', blockUITipInfo: '请先保存主数据',
viewLoadComp:'多数据视图加载完成,触发后续表单项更新',
save:'关系数据保存完成',
change:'关系数据值变化',
change1:'视图数据变化',
loadComp:'视图加载完成',
}, },
appHeaderMenus: { appHeaderMenus: {
ibizlab:{ ibizlab:{
...@@ -131,19 +138,25 @@ export default { ...@@ -131,19 +138,25 @@ export default {
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
}, },
dropDownList: { dropDownList: {
placeholder: '请选择...' placeholder: '请选择...',
}, },
dropDownListDynamic: { dropDownListDynamic: {
placeholder: '请选择...' placeholder: '请选择...',
}, },
dropDownListMpicker: { dropDownListMpicker: {
placeholder: '请选择...' placeholder: '请选择...',
}, },
login: { login: {
error: '错误', error: '错误',
caption: '欢迎登录', caption: '欢迎登录',
placeholder1:'用户名',
placeholder2:'密码',
name: '登录', name: '登录',
reset:'重置',
other:'其他登录方式',
tip: '输入用户名和密码', tip: '输入用户名和密码',
warning1:'qq授权登录暂未支持',
warning2:'微信授权登录暂未支持',
loginname: { loginname: {
placeholder: '请输入用户名', placeholder: '请输入用户名',
message: '用户名不能为空', message: '用户名不能为空',
...@@ -175,4 +188,64 @@ export default { ...@@ -175,4 +188,64 @@ export default {
hide: '隐藏字段', hide: '隐藏字段',
showMore: '显示更多字段', 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
...@@ -17,6 +17,13 @@ export default class UIService { ...@@ -17,6 +17,13 @@ export default class UIService {
*/ */
private $store: Store<any> | null = null; private $store: Store<any> | null = null;
/**
* 所依赖权限服务
*
* @memberof UIService
*/
public authService:any;
/** /**
* Creates an instance of UIService. * Creates an instance of UIService.
* *
......
...@@ -93,6 +93,17 @@ export declare interface ViewTool { ...@@ -93,6 +93,17 @@ export declare interface ViewTool {
* @memberof ViewTool * @memberof ViewTool
*/ */
getIndexViewParam(): any; getIndexViewParam(): any;
/**
* 计算界面行为项权限状态
*
* @static
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof ViewTool
*/
calcActionItemAuthState(data:any,ActionModel:any,UIService:any):any;
} }
declare module "vue/types/vue" { declare module "vue/types/vue" {
......
...@@ -241,4 +241,40 @@ export class ViewTool { ...@@ -241,4 +241,40 @@ export class ViewTool {
public static getIndexViewParam(): any { public static getIndexViewParam(): any {
return this.indexViewParam; 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){
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if(_item.noprivdisplaymode === 1){
_item.disabled = true;
}
if((_item.noprivdisplaymode === 2) || (_item.noprivdisplaymode === 6)){
_item.visabled = false;
}else{
_item.visabled = true;
}
}else{
_item.visabled = true;
_item.disabled = false;
}
}
}
}
} }
\ No newline at end of file
...@@ -181,7 +181,7 @@ export default class ControlService { ...@@ -181,7 +181,7 @@ export default class ControlService {
let dataItems: any[] = model.getDataItems(); let dataItems: any[] = model.getDataItems();
dataItems.forEach(dataitem => { dataItems.forEach(dataitem => {
let val = data.hasOwnProperty(dataitem.prop) ? data[dataitem.prop] : null; let val = data.hasOwnProperty(dataitem.prop) ? data[dataitem.prop] : null;
if (!val) { if (val === null) {
val = data.hasOwnProperty(dataitem.name) ? data[dataitem.name] : 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, ''))){ if((isCreate === undefined || isCreate === null ) && Object.is(dataitem.dataType, 'GUID') && Object.is(dataitem.name, 'srfkey') && (val && !Object.is(val, ''))){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册