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

ibiz4j 发布系统代码

上级 47013101
...@@ -12,6 +12,7 @@ import { authServiceRegister } from '@/authservice/auth-service-register'; ...@@ -12,6 +12,7 @@ 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';
import { codeListRegister } from '@codelist/codelist-register';
import InputBox from './components/input-box/input-box.vue' import InputBox from './components/input-box/input-box.vue'
import AppKeepAlive from './components/app-keep-alive/app-keep-alive.vue' import AppKeepAlive from './components/app-keep-alive/app-keep-alive.vue'
...@@ -38,6 +39,7 @@ import AppFormGroup from './components/app-form-group/app-form-group.vue' ...@@ -38,6 +39,7 @@ import AppFormGroup from './components/app-form-group/app-form-group.vue'
import AppFormItem from './components/app-form-item/app-form-item.vue' import AppFormItem from './components/app-form-item/app-form-item.vue'
import AppPicker from './components/app-picker/app-picker.vue' import AppPicker from './components/app-picker/app-picker.vue'
import AppMpicker from './components/app-mpicker/app-mpicker.vue' import AppMpicker from './components/app-mpicker/app-mpicker.vue'
import AppUpicker from './components/app-upicker/app-upicker.vue'
import AppFormGroup2 from './components/app-form-group2/app-form-group2.vue' import AppFormGroup2 from './components/app-form-group2/app-form-group2.vue'
import AppFormItem2 from './components/app-form-item2/app-form-item2.vue' import AppFormItem2 from './components/app-form-item2/app-form-item2.vue'
import CodeList from './components/codelist/codelist.vue' import CodeList from './components/codelist/codelist.vue'
...@@ -89,6 +91,8 @@ window['utilServiceRegister'] = utilServiceRegister; ...@@ -89,6 +91,8 @@ window['utilServiceRegister'] = utilServiceRegister;
window['entityServiceRegister'] = entityServiceRegister; window['entityServiceRegister'] = entityServiceRegister;
// 全局挂载计数器服务注册中心 // 全局挂载计数器服务注册中心
window['counterServiceRegister'] = counterServiceRegister; window['counterServiceRegister'] = counterServiceRegister;
// 全局挂载代码表服务注册中心
window['codeListRegister'] = codeListRegister;
export const AppComponents = { export const AppComponents = {
install(v: any, opt: any) { install(v: any, opt: any) {
...@@ -127,6 +131,7 @@ export const AppComponents = { ...@@ -127,6 +131,7 @@ export const AppComponents = {
v.component('app-form-item',AppFormItem); v.component('app-form-item',AppFormItem);
v.component('app-picker', AppPicker); v.component('app-picker', AppPicker);
v.component('app-mpicker', AppMpicker); v.component('app-mpicker', AppMpicker);
v.component('app-upicker', AppUpicker);
v.component('app-form-group2', AppFormGroup2); v.component('app-form-group2', AppFormGroup2);
v.component('app-form-item2', AppFormItem2); v.component('app-form-item2', AppFormItem2);
v.component('codelist', CodeList); v.component('codelist', CodeList);
......
/**
* 代码表服务注册中心
*
* @export
* @class CodeListRegister
*/
export class CodeListRegister {
/**
* 所有实体数据服务Map
*
* @protected
* @type {*}
* @memberof CodeListRegister
*/
protected allCodeList: Map<string, () => Promise<any>> = new Map();
/**
* 已加载实体数据服务Map缓存
*
* @protected
* @type {Map<string, any>}
* @memberof CodeListRegister
*/
protected serviceCache: Map<string, any> = new Map();
/**
* Creates an instance of CodeListRegister.
* @memberof CodeListRegister
*/
constructor() {
this.init();
}
/**
* 初始化
*
* @protected
* @memberof CodeListRegister
*/
protected init(): void {
}
/**
* 加载实体数据服务
*
* @protected
* @param {string} serviceName
* @returns {Promise<any>}
* @memberof CodeListRegister
*/
protected async loadService(serviceName: string): Promise<any> {
const service = this.allCodeList.get(serviceName);
if (service) {
return service();
}
}
/**
* 获取应用实体数据服务
*
* @param {string} name
* @returns {Promise<any>}
* @memberof CodeListRegister
*/
public async getService(name: string): Promise<any> {
if (this.serviceCache.has(name)) {
return this.serviceCache.get(name);
}
const CodeList: any = await this.loadService(name);
if (CodeList && CodeList.default) {
const instance: any = new CodeList.default();
this.serviceCache.set(name, instance);
return instance;
}
}
}
export const codeListRegister: CodeListRegister = new CodeListRegister();
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script lang="ts"> <script lang="ts">
import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator'; import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator';
import CodeListService from '@/service/app/codelist-service';
@Component({ @Component({
}) })
export default class AppDepartmentSelect extends Vue { export default class AppDepartmentSelect extends Vue {
...@@ -18,6 +19,20 @@ export default class AppDepartmentSelect extends Vue { ...@@ -18,6 +19,20 @@ export default class AppDepartmentSelect extends Vue {
*/ */
@Prop() public url?: any; @Prop() public url?: any;
/**
* 代码表标识
*
* @memberof AppDepartmentSelect
*/
@Prop() public tag?:string;
/**
* 代码表类型
*
* @memberof AppDepartmentSelect
*/
@Prop() public codelistType?:string;
/** /**
* 过滤项 * 过滤项
* *
...@@ -121,14 +136,14 @@ export default class AppDepartmentSelect extends Vue { ...@@ -121,14 +136,14 @@ export default class AppDepartmentSelect extends Vue {
} }
this.oldurl = _url; this.oldurl = _url;
// 缓存机制 // 缓存机制
const result:any = this.$store.getters.getCopyData(_url); const result:any = this.$store.getters.getDepData(this.filter);
if(result){ if(result){
this.Nodesdata = result; this.Nodesdata = result;
return; return;
} }
this.$http.get(_url).then((response: any) => { this.$http.get(_url).then((response: any) => {
this.Nodesdata = response.data; this.Nodesdata = response.data;
this.$store.commit('addDepData', { srfkey: this.filter, orgData: response.data }); this.$store.commit('addDepData', { srfkey: this.filter, depData: response.data });
}).catch((response: any) => { }).catch((response: any) => {
if (!response || !response.status || !response.data) { if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.sysException') as string) }); this.$Notice.error({ title: (this.$t('app.commonWords.error') as string), desc: (this.$t('app.commonWords.sysException') as string) });
...@@ -163,13 +178,19 @@ export default class AppDepartmentSelect extends Vue { ...@@ -163,13 +178,19 @@ export default class AppDepartmentSelect extends Vue {
// 单选 // 单选
if(!this.multiple){ if(!this.multiple){
if(this.fillMap && Object.keys(this.fillMap).length >0){ if(this.fillMap && Object.keys(this.fillMap).length >0){
let templateValue = {}; let templateValue:any = {};
Object.keys(this.fillMap).forEach((item:any) =>{ Object.keys(this.fillMap).forEach((item:any) =>{
if(this.data && this.data[this.fillMap[item]]){ if(this.data && this.data[this.fillMap[item]]){
Object.assign(templateValue,{[item]:this.data[this.fillMap[item]]}); Object.assign(templateValue,{[item]:this.data[this.fillMap[item]]});
} }
}) })
this.selectTreeValue = JSON.stringify([templateValue]); if(!templateValue.label && templateValue.id && this.tag && this.codelistType && Object.is(this.codelistType,"DYNAMIC")){
this.fillLabel(templateValue,templateValue.id,(templateValue:any) =>{
this.selectTreeValue = JSON.stringify([templateValue]);
});
}else{
this.selectTreeValue = JSON.stringify([templateValue]);
}
} }
}else{ }else{
// 多选 // 多选
...@@ -188,8 +209,30 @@ export default class AppDepartmentSelect extends Vue { ...@@ -188,8 +209,30 @@ export default class AppDepartmentSelect extends Vue {
}) })
} }
}) })
this.selectTreeValue = JSON.stringify(tempArray); let tempflag:boolean = false;
if(tempArray.length >0 && tempArray.length >0){
tempArray.forEach((item:any) =>{
if(!item.label) tempflag = true;
})
} }
if(tempflag && this.tag && this.codelistType && Object.is(this.codelistType,"DYNAMIC")){
let tempStatus:number = 0;
tempArray.forEach((item:any) =>{
if(!item.label){
tempStatus += 1;
this.fillLabel(item,item.id,(result:any) =>{
item = result;
tempStatus -= 1;
if(tempStatus === 0){
this.selectTreeValue = JSON.stringify(tempArray);
}
})
}
})
}else{
this.selectTreeValue = JSON.stringify(tempArray);
}
}
} }
} }
...@@ -208,10 +251,35 @@ export default class AppDepartmentSelect extends Vue { ...@@ -208,10 +251,35 @@ export default class AppDepartmentSelect extends Vue {
let _name = this.fillMap[attribute]; let _name = this.fillMap[attribute];
let values = selectArr.map((item:any) => item[attribute]); let values = selectArr.map((item:any) => item[attribute]);
let _value = $event === "[]" ? null : values.join(","); let _value = $event === "[]" ? null : values.join(",");
this.$emit('select-change',{name: this.fillMap[attribute], value: _value}) setTimeout(() => {
this.$emit('select-change',{name: this.fillMap[attribute], value: _value});
},0);
}); });
} }
} }
/**
* 填充label
*
* @memberof AppOrgSelect
*/
public fillLabel(tempObject:any,valueItem:any,callback:any){
if(!tempObject.label && tempObject.id && this.tag && this.codelistType && Object.is(this.codelistType,"DYNAMIC")){
let codeListService:CodeListService = new CodeListService();
codeListService.getItems(this.tag).then((items:any) =>{
if(items && items.length >0){
let result:any = items.find((item:any) =>{
return item.id === valueItem;
})
Object.assign(tempObject,{label:result.label});
}
callback(tempObject);
}).catch((error:any) =>{
console.log(error);
})
}
}
} }
</script> </script>
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<script lang = 'ts'> <script lang = 'ts'>
import { Vue, Component, Prop, Watch } from "vue-property-decorator"; import { Vue, Component, Prop, Watch } from "vue-property-decorator";
import { Http } from '@/utils'; import { Http } from '@/utils';
import CodeListService from "@service/app/codelist-service";
import { observable } from 'rxjs';
@Component({}) @Component({})
export default class AppOrgSelect extends Vue { export default class AppOrgSelect extends Vue {
...@@ -37,6 +39,20 @@ export default class AppOrgSelect extends Vue { ...@@ -37,6 +39,20 @@ export default class AppOrgSelect extends Vue {
*/ */
@Prop() public filter?:string; @Prop() public filter?:string;
/**
* 代码表标识
*
* @memberof AppOrgSelect
*/
@Prop() public tag?:string;
/**
* 代码表类型
*
* @memberof AppOrgSelect
*/
@Prop() public codelistType?:string;
/** /**
* 是否多选 * 是否多选
* *
...@@ -138,13 +154,19 @@ export default class AppOrgSelect extends Vue { ...@@ -138,13 +154,19 @@ export default class AppOrgSelect extends Vue {
// 单选 // 单选
if(!this.multiple){ if(!this.multiple){
if(this.fillMap && Object.keys(this.fillMap).length >0){ if(this.fillMap && Object.keys(this.fillMap).length >0){
let templateValue = {}; let templateValue:any = {};
Object.keys(this.fillMap).forEach((item:any) =>{ Object.keys(this.fillMap).forEach((item:any) =>{
if(this.data && this.data[this.fillMap[item]]){ if(this.data && this.data[this.fillMap[item]]){
Object.assign(templateValue,{[item]:this.data[this.fillMap[item]]}); Object.assign(templateValue,{[item]:this.data[this.fillMap[item]]});
}
})
if(!templateValue.label && templateValue.id && this.tag && this.codelistType && Object.is(this.codelistType,"DYNAMIC")){
this.fillLabel(templateValue,templateValue.id,(templateValue:any) =>{
this.selectTreeValue = JSON.stringify([templateValue]);
});
}else{
this.selectTreeValue = JSON.stringify([templateValue]);
} }
})
this.selectTreeValue = JSON.stringify([templateValue]);
} }
}else{ }else{
// 多选 // 多选
...@@ -163,8 +185,30 @@ export default class AppOrgSelect extends Vue { ...@@ -163,8 +185,30 @@ export default class AppOrgSelect extends Vue {
}) })
} }
}) })
this.selectTreeValue = JSON.stringify(tempArray); let tempflag:boolean = false;
if(tempArray.length >0 && tempArray.length >0){
tempArray.forEach((item:any) =>{
if(!item.label) tempflag = true;
})
}
if(tempflag && this.tag && this.codelistType && Object.is(this.codelistType,"DYNAMIC")){
let tempStatus:number = 0;
tempArray.forEach((item:any) =>{
if(!item.label){
tempStatus += 1;
this.fillLabel(item,item.id,(result:any) =>{
item = result;
tempStatus -= 1;
if(tempStatus === 0){
this.selectTreeValue = JSON.stringify(tempArray);
}
})
}
})
}else{
this.selectTreeValue = JSON.stringify(tempArray);
} }
}
} }
} }
...@@ -175,7 +219,7 @@ export default class AppOrgSelect extends Vue { ...@@ -175,7 +219,7 @@ export default class AppOrgSelect extends Vue {
*/ */
public loadTreeData(requestUrl:string){ public loadTreeData(requestUrl:string){
if(this.filter){ if(this.filter){
const result:any = this.$store.getters.getCopyData(this.filter); const result:any = this.$store.getters.getOrgData(this.filter);
if(result){ if(result){
this.NodesData = result; this.NodesData = result;
return; return;
...@@ -209,7 +253,9 @@ export default class AppOrgSelect extends Vue { ...@@ -209,7 +253,9 @@ export default class AppOrgSelect extends Vue {
tempValue.forEach((value:any,index:number) =>{ tempValue.forEach((value:any,index:number) =>{
tempResult += index>0?`,${value[item]}`:`${value[item]}`; tempResult += index>0?`,${value[item]}`:`${value[item]}`;
}) })
this.emitValue(this.fillMap[item],tempResult); setTimeout(() => {
this.emitValue(this.fillMap[item],tempResult);
}, 0);
}) })
} }
}else{ }else{
...@@ -225,7 +271,9 @@ export default class AppOrgSelect extends Vue { ...@@ -225,7 +271,9 @@ export default class AppOrgSelect extends Vue {
const tempValue:any = JSON.parse($event)[0]; const tempValue:any = JSON.parse($event)[0];
if(this.fillMap && Object.keys(this.fillMap).length >0){ if(this.fillMap && Object.keys(this.fillMap).length >0){
Object.keys(this.fillMap).forEach((item:any) =>{ Object.keys(this.fillMap).forEach((item:any) =>{
this.emitValue(this.fillMap[item],tempValue[item]); setTimeout(() => {
this.emitValue(this.fillMap[item],tempValue[item]);
}, 0);
}) })
} }
}else{ }else{
...@@ -247,6 +295,28 @@ export default class AppOrgSelect extends Vue { ...@@ -247,6 +295,28 @@ export default class AppOrgSelect extends Vue {
this.$emit('select-change',{name:name,value:value}); this.$emit('select-change',{name:name,value:value});
} }
/**
* 填充label
*
* @memberof AppOrgSelect
*/
public fillLabel(tempObject:any,valueItem:any,callback:any){
if(!tempObject.label && tempObject.id && this.tag && this.codelistType && Object.is(this.codelistType,"DYNAMIC")){
let codeListService:CodeListService = new CodeListService();
codeListService.getItems(this.tag).then((items:any) =>{
if(items && items.length >0){
let result:any = items.find((item:any) =>{
return item.id === valueItem;
})
Object.assign(tempObject,{label:result.label});
}
callback(tempObject);
}).catch((error:any) =>{
console.log(error);
})
}
}
} }
</script> </script>
......
.app-picker {
width: 100%;
.el-select {
.el-input__suffix {
right: 20px;
}
}
.text-value {
.el-icon-circle-close {
display: none;
}
}
.text-value:hover {
.el-icon-circle-close {
display: inline-block;
}
}
.ivu-icon-ios-open-outline {
margin-top: -2px;
margin-left: 5px;
font-size: 15px;
}
}
\ No newline at end of file
<template>
<el-select style="width: 100%;" size='small' @change="onSelect" v-model="value" :disabled="disabled" @visible-change="onSelectOpen">
<el-option v-for="(item, index) in items" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</template>
<script lang="ts">
import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator";
import { Subject } from "rxjs";
import { AppModal } from "@/utils";
@Component({})
export default class AppPicker extends Vue {
/**
* 表单数据
*
* @type {*}
* @memberof AppPicker
*/
@Prop() public data!: any;
/**
* 属性项名称
*
* @type {string}
* @memberof AppPicker
*/
@Prop() public name!: string;
/**
* 视图上下文
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@Prop() public context!: any;
/**
* 编辑器禁用
*
* @type {boolean}
* @memberof AppUpicker
*/
@Prop() disabled?: boolean;
/**
* 视图参数
*
* @type {*}
* @memberof SelectFormBase
*/
@Prop() public viewparams: any;
/**
* 请求参数和请求数据的映射关系
*
* @type {*}
* @memberof AppUpicker
*/
public interaction:any = {};
/**
* 当前表单项绑定的值
*
* @type {string}
* @memberof AppUpicker
*/
public value: string = "";
/**
* 编辑器参数
*
* @type {*}
* @memberof AppUpicker
*/
@Prop() public itemParams?: any;
/**
* 编辑器参数
*
* @type {string}
* @memberof AppUpicker
*/
@Prop() public valueItem?: string;
/**
* 列表项请求路径
*
* @type {string}
* @memberof AppUpicker
*/
public url: string = '';
/**
* 下拉数组
* @type {any[]}
* @memberof AppPicker
*/
public items: any[] = [];
/**
* 请求到的数据
* @type {any[]}
* @memberof AppPicker
*/
public itemList: any[] = [{a:1,b:"zhangsan"},{a:2,b:"lisi"},{a:3,b:"wangwu"}]
/**
* vue 生命周期
*
* @memberof AppPicker
*/
public mounted() {
// 解析编辑器参数
this.analysis(this.itemParams);
// 请求下拉数据
this.fectchItemList(this.url);
}
/**
* 下拉重新加载数据
*
* @memberof AppPicker
*/
public onSelectOpen() {
this.fectchItemList(this.url);
}
/**
* 解析编辑器参数
* @param {*} itemparams
* @memberof AppPicker
*/
public analysis(itemparams:any) {
Object.keys(itemparams).forEach((param)=>{
if(param==='path'){
this.url = itemparams[param]
}else{
this.interaction[param] = itemparams[param]
}
})
}
/**
* 请求下拉列表数据
* @param {string} url
* @memberof AppPicker
*/
public fectchItemList(url:string) {
this.$http
.get(url)
.then((response: any) => {
if (response && response.status==200 && response.data) {
this.itemList = response.data;
// 提取需要的值(value,label)
this.extractItem(this.itemList,this.items);
}
})
.catch((response: any) => {
if (!response || !response.status || !response.data) {
this.$Notice.error({
title: this.$t("app.commonWords.error") as string,
desc: this.$t("app.commonWords.sysException") as string,
});
return;
}
});
}
/**
* 解析下拉列表数据
* @param {any[]} itemList 请求到的数据
* @param {any[]} items 下拉数组
* @memberof AppPicker
*/
public extractItem(itemList:any[],items:any[]) {
this.items.length = 0;
itemList.forEach((item) => {
items.push({
label: item[this.interaction.label],
value: item[this.interaction.value],
});
});
}
public onSelect(val: string) {
let index = this.items.findIndex((item) => Object.is(item.value, val));
if (index >= 0) {
this.onACSelect(this.items[index]);
}
}
/**
* 选中数据回调
* @param item
*/
public onACSelect(item: any): void {
if(this.name){
this.$emit('formitemvaluechange', { name: this.name, value: item.value });
}
if(this.valueItem){
this.$emit('formitemvaluechange', { name: this.valueItem, value: item.value });
}
}
}
</script>
<style lang="less">
@import './app-upicker.less';
</style>
...@@ -3,13 +3,14 @@ import { AuthServiceRegister } from '@/authservice/auth-service-register'; ...@@ -3,13 +3,14 @@ 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';
import { CodeListRegister } from '@codelist/codelist-register';
declare global { declare global {
interface Window { interface Window {
uiServiceRegister: UIServiceRegister, uiServiceRegister: UIServiceRegister,
authServiceRegister: AuthServiceRegister, authServiceRegister: AuthServiceRegister,
utilServiceRegister: UtilServiceRegister, utilServiceRegister: UtilServiceRegister,
entityServiceRegister: EntityServiceRegister, entityServiceRegister: EntityServiceRegister,
counterServiceRegister: CounterServiceRegister counterServiceRegister: CounterServiceRegister,
codeListRegister:CodeListRegister
} }
} }
\ No newline at end of file
...@@ -97,7 +97,7 @@ mock.onGet('v7/mainappmenu').reply((config: any) => { ...@@ -97,7 +97,7 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
iconcls: 'fa fa-slack', iconcls: 'fa fa-slack',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_2', appfunctag: 'Auto13',
resourcetag: '', resourcetag: '',
}, },
], ],
......
import { Store } from 'vuex';
import { Http } from '@/utils'; import { Http } from '@/utils';
import CodeListService from "@service/app/codelist-service"; import CodeListService from "@service/app/codelist-service";
...@@ -10,15 +9,6 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -10,15 +9,6 @@ import CodeListService from "@service/app/codelist-service";
*/ */
export default class EntityService { export default class EntityService {
/**
* Vue 状态管理器
*
* @private
* @type {(any | null)}
* @memberof EntityService
*/
private $store: Store<any> | null = null;
/** /**
* 获取实体数据服务 * 获取实体数据服务
* *
...@@ -101,21 +91,10 @@ export default class EntityService { ...@@ -101,21 +91,10 @@ export default class EntityService {
* @memberof EntityService * @memberof EntityService
*/ */
constructor(opts: any = {}) { constructor(opts: any = {}) {
this.$store = opts.$store;
this.tempStorage = localStorage; this.tempStorage = localStorage;
this.initBasicData(); this.initBasicData();
} }
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof EntityService
*/
public getStore(): Store<any> | null {
return this.$store;
}
/** /**
* 获取代码表 * 获取代码表
* *
...@@ -123,22 +102,16 @@ export default class EntityService { ...@@ -123,22 +102,16 @@ export default class EntityService {
*/ */
public getCodeList(tag:string,codelistType:string,context:any = {},param:any ={}){ public getCodeList(tag:string,codelistType:string,context:any = {},param:any ={}){
return new Promise((resolve:any,reject:any) =>{ return new Promise((resolve:any,reject:any) =>{
let codeListService = new CodeListService();
if(tag && Object.is(codelistType,"STATIC")){ if(tag && Object.is(codelistType,"STATIC")){
let returnItems:Array<any> = []; codeListService.getStaticItems(tag).then((items:any) =>{
const codelist = (this.getStore() as Store<any>).getters.getCodeList(tag); resolve(items);
if (codelist) { })
returnItems = [...JSON.parse(JSON.stringify(codelist.items))];
} else {
console.log(`----${tag}----代码表不存在`);
}
resolve(returnItems);
}else if(tag && Object.is(codelistType,"DYNAMIC")){ }else if(tag && Object.is(codelistType,"DYNAMIC")){
let codeListService = new CodeListService({ $store: this.$store });
codeListService.getItems(tag,context,param).then((res:any) => { codeListService.getItems(tag,context,param).then((res:any) => {
resolve(res); resolve(res);
}).catch((error:any) => { }).catch((error:any) => {
reject(`${tag}代码表不存在`); reject(`${tag}代码表不存在`);
console.log(`----${tag}----代码表不存在`);
}); });
} }
}) })
...@@ -988,4 +961,15 @@ export default class EntityService { ...@@ -988,4 +961,15 @@ export default class EntityService {
return Http.getInstance().post(`/v7/changepwd`,data,isloading); return Http.getInstance().post(`/v7/changepwd`,data,isloading);
} }
/**
* 获取数字字典
*
* @param tag
* @param data
* @param isloading
*/
public async getPredefinedCodelist(tag:string,data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/dictionarys/codelist/${tag}`,data,isloading);
}
} }
\ No newline at end of file
...@@ -582,8 +582,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -582,8 +582,8 @@ export default class MainBase extends Vue implements ControlInterface {
navDataService.removeNavData(this.viewtag); navDataService.removeNavData(this.viewtag);
} }
switch (item.appfunctag) { switch (item.appfunctag) {
case '_2': case 'Auto13':
this.click_2(item); this.clickAuto13(item);
return; return;
case 'Auto10': case 'Auto10':
this.clickAuto10(item); this.clickAuto10(item);
...@@ -610,7 +610,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -610,7 +610,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Main * @memberof Main
*/ */
public click_2(item: any = {}) { public clickAuto13(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
......
...@@ -105,7 +105,7 @@ export default class MainModel { ...@@ -105,7 +105,7 @@ export default class MainModel {
iconcls: 'fa fa-slack', iconcls: 'fa fa-slack',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_2', appfunctag: 'Auto13',
resourcetag: '', resourcetag: '',
authtag:'web-Main-menuitem4', authtag:'web-Main-menuitem4',
}, },
...@@ -120,7 +120,7 @@ export default class MainModel { ...@@ -120,7 +120,7 @@ export default class MainModel {
*/ */
public funcs: any[] = [ public funcs: any[] = [
{ {
appfunctag: '_2', appfunctag: 'Auto13',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'sysopenaccessgridview', codename: 'sysopenaccessgridview',
......
...@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan; ...@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -30,6 +32,9 @@ import java.util.List; ...@@ -30,6 +32,9 @@ import java.util.List;
}) })
public class webApplication extends WebMvcConfigurerAdapter{ public class webApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(webApplication.class,args); SpringApplication.run(webApplication.class,args);
} }
...@@ -37,6 +42,6 @@ public class webApplication extends WebMvcConfigurerAdapter{ ...@@ -37,6 +42,6 @@ public class webApplication extends WebMvcConfigurerAdapter{
@Override @Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers); super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver()); argumentResolvers.add(resolver);
} }
} }
...@@ -14,6 +14,8 @@ import org.springframework.context.annotation.ComponentScan; ...@@ -14,6 +14,8 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.List; import java.util.List;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@EnableDiscoveryClient @EnableDiscoveryClient
...@@ -34,6 +36,9 @@ import java.util.List; ...@@ -34,6 +36,9 @@ import java.util.List;
@EnableScheduling @EnableScheduling
public class DevBootApplication extends WebMvcConfigurerAdapter{ public class DevBootApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DevBootApplication.class,args); SpringApplication.run(DevBootApplication.class,args);
} }
...@@ -41,6 +46,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{ ...@@ -41,6 +46,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
@Override @Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers); super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver()); argumentResolvers.add(resolver);
} }
} }
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<!--输出实体[SYS_USER_AUTH]数据结构 --> <!--输出实体[SYS_USER_AUTH]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_user_auth-13-7"> <changeSet author="a_A_5d9d78509" id="tab-sys_user_auth-14-7">
<createTable tableName="IBZUSERAUTH"> <createTable tableName="IBZUSERAUTH">
<column name="AUTHID" remarks="" type="VARCHAR(100)"> <column name="AUTHID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_AUTH_AUTHID"/> <constraints primaryKey="true" primaryKeyName="PK_SYS_USER_AUTH_AUTHID"/>
......
...@@ -15,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter ...@@ -15,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -40,6 +42,9 @@ import java.util.List; ...@@ -40,6 +42,9 @@ import java.util.List;
@EnableScheduling @EnableScheduling
public class ibzuaaapiApplication extends WebMvcConfigurerAdapter{ public class ibzuaaapiApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ibzuaaapiApplication.class, args); SpringApplication.run(ibzuaaapiApplication.class, args);
} }
...@@ -47,6 +52,6 @@ public class ibzuaaapiApplication extends WebMvcConfigurerAdapter{ ...@@ -47,6 +52,6 @@ public class ibzuaaapiApplication extends WebMvcConfigurerAdapter{
@Override @Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers); super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver()); argumentResolvers.add(resolver);
} }
} }
...@@ -10,10 +10,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; ...@@ -10,10 +10,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer; import org.springframework.web.method.support.ModelAndViewContainer;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Slf4j @Slf4j
@Configuration
public class SearchContextHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { public class SearchContextHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
@Value("${ibiz.pageLimit:1000}")
private int pageLimit=1000;
private static ObjectMapper objectMapper=new ObjectMapper(); private static ObjectMapper objectMapper=new ObjectMapper();
@Override @Override
...@@ -29,6 +35,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod ...@@ -29,6 +35,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for (String key : params.keySet()) { for (String key : params.keySet()) {
set.put(key,params.get(key)[0]); set.put(key,params.get(key)[0]);
} }
if((!set.containsKey("size")) ){
set.put("size",pageLimit);
}
String json=objectMapper.writeValueAsString(set); String json=objectMapper.writeValueAsString(set);
return objectMapper.readValue(json,parameter.getParameterType()); return objectMapper.readValue(json,parameter.getParameterType());
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册