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

ibiz4j 发布系统代码

上级 e58f4427
## v7.0.0-alpha.17 [2020-8-9]
### Bug修复
修复系统级的操作标识异常问题
修复表格新增插件异常问题
修复表格单击行绑定数据异常bug
修复表格合计行样式问题
### 功能新增及优化
#### 模板
新增支持前后端分离部署
新增动态代码表预定义代码表支持
新增数据选择(调用接口)组件
新增部件样式表支持
优化数据服务逻辑
优化代码表服务基类、动态代码表
优化导航参数处理逻辑
优化数据拷贝逻辑
优化组织、部门、人员控件只绑定id逻辑
优化部件关联外键值
#### 基础文件
新增前后端分离部署
新增下拉列表控件支持树状代码表
新增数据选择(调用接口)组件
优化数据拷贝逻辑
优化组织、部门、人员控件只绑定id逻辑
## v7.0.0-alpha.16 [2020-8-2]
### Bug修复
......
......@@ -12,6 +12,7 @@ import { authServiceRegister } from '@/authservice/auth-service-register';
import { utilServiceRegister } from '@/utilservice/util-service-register';
import { entityServiceRegister } from '@/service/entity-service-register';
import { counterServiceRegister } from '@/counter/counter-service-register';
import { codeListRegister } from '@codelist/codelist-register';
import InputBox from './components/input-box/input-box.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'
import AppFormItem from './components/app-form-item/app-form-item.vue'
import AppPicker from './components/app-picker/app-picker.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 AppFormItem2 from './components/app-form-item2/app-form-item2.vue'
import CodeList from './components/codelist/codelist.vue'
......@@ -89,6 +91,8 @@ window['utilServiceRegister'] = utilServiceRegister;
window['entityServiceRegister'] = entityServiceRegister;
// 全局挂载计数器服务注册中心
window['counterServiceRegister'] = counterServiceRegister;
// 全局挂载代码表服务注册中心
window['codeListRegister'] = codeListRegister;
export const AppComponents = {
install(v: any, opt: any) {
......@@ -127,6 +131,7 @@ export const AppComponents = {
v.component('app-form-item',AppFormItem);
v.component('app-picker', AppPicker);
v.component('app-mpicker', AppMpicker);
v.component('app-upicker', AppUpicker);
v.component('app-form-group2', AppFormGroup2);
v.component('app-form-item2', AppFormItem2);
v.component('codelist', CodeList);
......
......@@ -18,7 +18,7 @@ export default class AuthService {
public $store: Store<any> | null = null;
/**
* 默认操作
* 默认操作标识
*
* @public
* @type {(any)}
......
/**
* 代码表服务注册中心
*
* @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 @@
<script lang="ts">
import { Vue, Component, Watch, Prop, Model } from 'vue-property-decorator';
import CodeListService from '@/service/app/codelist-service';
@Component({
})
export default class AppDepartmentSelect extends Vue {
......@@ -18,6 +19,20 @@ export default class AppDepartmentSelect extends Vue {
*/
@Prop() public url?: any;
/**
* 代码表标识
*
* @memberof AppDepartmentSelect
*/
@Prop() public tag?:string;
/**
* 代码表类型
*
* @memberof AppDepartmentSelect
*/
@Prop() public codelistType?:string;
/**
* 过滤项
*
......@@ -88,7 +103,7 @@ export default class AppDepartmentSelect extends Vue {
* @type {*}
* @memberof AppDepartmentSelect
*/
public oldurl: any[] = [];
public oldurl: any;
/**
* 获取节点数据
......@@ -121,14 +136,14 @@ export default class AppDepartmentSelect extends Vue {
}
this.oldurl = _url;
// 缓存机制
const result:any = this.$store.getters.getCopyData(_url);
const result:any = this.$store.getters.getDepData(_url);
if(result){
this.Nodesdata = result;
return;
}
this.$http.get(_url).then((response: any) => {
this.Nodesdata = response.data;
this.$store.commit('addDepData', { srfkey: this.filter, orgData: response.data });
this.$store.commit('addDepData', { srfkey: _url, depData: response.data });
}).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) });
......@@ -163,14 +178,20 @@ export default class AppDepartmentSelect extends Vue {
// 单选
if(!this.multiple){
if(this.fillMap && Object.keys(this.fillMap).length >0){
let templateValue = {};
let templateValue:any = {};
Object.keys(this.fillMap).forEach((item:any) =>{
if(this.data && 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]);
}
}
}else{
// 多选
if(this.fillMap && Object.keys(this.fillMap).length >0){
......@@ -188,10 +209,32 @@ export default class AppDepartmentSelect extends Vue {
})
}
})
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);
}
}
}
}
/**
* select事件处理
......@@ -208,10 +251,35 @@ export default class AppDepartmentSelect extends Vue {
let _name = this.fillMap[attribute];
let values = selectArr.map((item:any) => item[attribute]);
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>
......
......@@ -21,6 +21,7 @@
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import CodeListService from '@/service/app/codelist-service';
@Component({})
export default class AppGroupSelect extends Vue {
......@@ -64,6 +65,20 @@ export default class AppGroupSelect extends Vue {
*/
@Prop() data: any;
/**
* 代码表标识
*
* @memberof AppGroupSelect
*/
@Prop() public tag?:string;
/**
* 代码表类型
*
* @memberof AppGroupSelect
*/
@Prop() public codelistType?:string;
/**
* 过滤属性标识
*
......@@ -126,12 +141,12 @@ export default class AppGroupSelect extends Vue {
* @type {*}
* @memberof AppGroupSelect
*/
@Watch('value')
onValueChange(newVal: any) {
@Watch('data',{immediate:true,deep:true})
onValueChange(newVal: any, oldVal: any) {
this.selects = [];
if (newVal) {
let item: any = {};
item.label = newVal.split(',');
item.label = this.data[this.name]?this.data[this.name].split(','):[];
if(this.valueitem) {
item.id = this.data[this.valueitem] ? this.data[this.valueitem].split(',') : [];
}
......@@ -140,6 +155,7 @@ export default class AppGroupSelect extends Vue {
item[this.fillmap[key]] = this.data[key] ? this.data[key].split(',') : [];
}
}
const callback:any = (item:any) =>{
item.label.forEach((val: string, index: number) => {
let _item: any = {};
for(let key in item) {
......@@ -148,6 +164,16 @@ export default class AppGroupSelect extends Vue {
this.selects.push(_item)
})
}
if(item.label.length == 0 && item.id.length > 0){
this.fillLabel(item,item.id,(result:any) =>{
item.label = result.label;
callback(item);
});
}else{
callback(item);
}
}
}
/**
......@@ -259,7 +285,6 @@ export default class AppGroupSelect extends Vue {
}
});
} else {
item = this.selects.length > 0 ? this.selects[0] : {};
item[this.name] = this.selects.length > 0 ? this.selects[0].label : null;
if(this.valueitem) {
item[this.valueitem] = this.selects.length > 0 ? this.selects[0].id : null;
......@@ -274,6 +299,33 @@ export default class AppGroupSelect extends Vue {
this.$emit('formitemvaluechange', { name: key, value: item[key] });
}
}
/**
* 填充label
*
* @memberof AppGroupSelect
*/
public fillLabel(tempObject:any,valueItem:Array<any>,callback:any){
if(tempObject.label.length === 0 && tempObject.id.length >0 && 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 && valueItem.length >0){
let tempLabel:Array<any> = [];
valueItem.forEach((value:any) =>{
let result:any = items.find((item:any) =>{
return item.id === value;
})
tempLabel.push(result.label);
})
Object.assign(tempObject,{label:tempLabel});
}
callback(tempObject);
}).catch((error:any) =>{
console.log(error);
})
}
}
}
</script>
......
......@@ -6,6 +6,8 @@
<script lang = 'ts'>
import { Vue, Component, Prop, Watch } from "vue-property-decorator";
import { Http } from '@/utils';
import CodeListService from "@service/app/codelist-service";
import { observable } from 'rxjs';
@Component({})
export default class AppOrgSelect extends Vue {
......@@ -37,6 +39,20 @@ export default class AppOrgSelect extends Vue {
*/
@Prop() public filter?:string;
/**
* 代码表标识
*
* @memberof AppOrgSelect
*/
@Prop() public tag?:string;
/**
* 代码表类型
*
* @memberof AppOrgSelect
*/
@Prop() public codelistType?:string;
/**
* 是否多选
*
......@@ -138,14 +154,20 @@ export default class AppOrgSelect extends Vue {
// 单选
if(!this.multiple){
if(this.fillMap && Object.keys(this.fillMap).length >0){
let templateValue = {};
let templateValue:any = {};
Object.keys(this.fillMap).forEach((item:any) =>{
if(this.data && 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]);
}
}
}else{
// 多选
if(this.fillMap && Object.keys(this.fillMap).length >0){
......@@ -163,10 +185,32 @@ export default class AppOrgSelect extends Vue {
})
}
})
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 {
*/
public loadTreeData(requestUrl:string){
if(this.filter){
const result:any = this.$store.getters.getCopyData(this.filter);
const result:any = this.$store.getters.getOrgData(this.filter);
if(result){
this.NodesData = result;
return;
......@@ -209,7 +253,9 @@ export default class AppOrgSelect extends Vue {
tempValue.forEach((value:any,index:number) =>{
tempResult += index>0?`,${value[item]}`:`${value[item]}`;
})
setTimeout(() => {
this.emitValue(this.fillMap[item],tempResult);
}, 0);
})
}
}else{
......@@ -225,7 +271,9 @@ export default class AppOrgSelect extends Vue {
const tempValue:any = JSON.parse($event)[0];
if(this.fillMap && Object.keys(this.fillMap).length >0){
Object.keys(this.fillMap).forEach((item:any) =>{
setTimeout(() => {
this.emitValue(this.fillMap[item],tempValue[item]);
}, 0);
})
}
}else{
......@@ -247,6 +295,28 @@ export default class AppOrgSelect extends Vue {
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>
......
.app-upicker {
width: 100%;
.el-select {
.el-input__suffix {
display: none;
}
}
.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>
<div class='app-upicker'>
<el-select ref="appUpicker" :value="refvalue" size='small' filterable
@change="onSelect" :disabled="disabled" style='width:100%;' clearable
@clear="onClear" @visible-change="onSelectOpen">
<template v-if="items">
<el-option v-for="(_item,index) in items" :key="index" :value="_item.value" :label="_item.label"></el-option>
</template>
</el-select>
<span style='position: absolute;right: 5px;color: #c0c4cc;top:0;font-size: 13px;'>
<i v-show="open" class='el-icon-arrow-up' @click="closeDropdown"></i>
<i v-show="!open" class='el-icon-arrow-down' @click="openDropdown"></i>
</span>
</div>
</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 AppUpicker extends Vue {
/**
* 请求到的数据
* @type {any[]}
* @memberof AppUpicker
*/
public itemList: any[] = []
/**
* 列表项请求路径
*
* @type {string}
* @memberof AppUpicker
*/
public url: string = '';
/**
* 请求参数和请求数据的映射关系
*
* @type {*}
* @memberof AppUpicker
*/
public interaction:any = {};
/**
* 编辑器参数
*
* @type {*}
* @memberof AppUpicker
*/
@Prop() public itemParams?: any;
/**
* 视图上下文
*
* @type {*}
* @memberof AppUpicker
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppUpicker
*/
@Prop() public viewparams!: any;
/**
* 表单数据
*
* @type {*}
* @memberof AppUpicker
*/
@Prop() public data!: any;
/**
* 属性项名称
*
* @type {string}
* @memberof AppUpicker
*/
@Prop() public name!: string;
/**
* 是否启用
*
* @type {boolean}
* @memberof AppUpicker
*/
@Prop() public disabled?: boolean;
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof AppUpicker
*/
@Prop({default:true}) public showButton?: boolean;
/**
* 局部上下文导航参数
*
* @type {any}
* @memberof AppUpicker
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppUpicker
*/
@Prop() public localParam!:any;
/**
* 值项名称
*
* @type {string}
* @memberof AppUpicker
*/
@Prop() public valueitem!: string;
/**
* 排序
*
* @type {string}
* @memberof AppUpicker
*/
@Prop() public sort?: string;
/**
* 值
*
* @type {*}
* @memberof AppUpicker
*/
@Model('change') public value?: any;
/**
* 当前值
*
* @type {string}
* @memberof AppUpicker
*/
public curvalue: string = '';
/**
* 下拉数组
* @type {any[]}
* @memberof AppUpicker
*/
public items: any[] = [];
/**
* 下拉图标指向状态管理
* @type {boolean}
* @memberof AppUpicker
*/
public open: boolean = false;
/**
* 输入状态
*
* @type {boolean}
* @memberof AppUpicker
*/
public inputState: boolean = false;
/**
* vue 生命周期
*
* @memberof AppUpicker
*/
public created() {
this.analysis(this.itemParams);
}
/**
* 获取关联数据项值
*
* @readonly
* @memberof AppUpicker
*/
get refvalue() {
if (this.valueitem && this.data) {
return this.data[this.valueitem];
}
return this.curvalue;
}
/**
* 展开下拉
*
* @memberof AppUpicker
*/
public openDropdown() {
const appUpicker: any = this.$refs.appUpicker;
if(appUpicker) {
appUpicker.focus();
}
}
/**
* 收起下拉
*
* @memberof AppUpicker
*/
public closeDropdown() {
const appUpicker: any = this.$refs.appUpicker;
if(appUpicker) {
appUpicker.blur();
}
}
/**
* 下拉切换回调
* @param flag
*
* @memberof AppUpicker
*/
public onSelectOpen(flag: boolean): void {
this.open = flag;
if (this.open) {
this.fectchItemList(this.url);
}
}
/**
* 下拉选中
*
* @param {string} val
* @memberof AppUpicker
*/
public onSelect(val: string) {
let index = this.items.findIndex((item) => Object.is(item.value, val));
if (index >= 0) {
let item:any = this.items[index];
if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: item.value });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item.label });
}
}
}
/**
* 清除
*
* @memberof AppUpicker
*/
public onClear($event: any): void {
if (this.valueitem) {
this.$emit('formitemvaluechange', { name: this.valueitem, value: '' });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: '' });
}
this.$forceUpdate();
}
/**
* 值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppUpicker
*/
@Watch('value',{immediate:true})
public onValueChange(newVal: any, oldVal: any) {
this.analysis(this.itemParams);
if(newVal){
this.curvalue = newVal;
const value = this.data[this.valueitem];
const index = this.items.findIndex((item: any) => Object.is(item.value, value));
if (index !== -1) {
return;
}
this.items = [];
if (value) {
this.items.push({text: newVal, value: value});
}
}
}
/**
* 解析编辑器参数
* @param {*} itemparams
*
* @memberof AppUpicker
*/
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 AppUpicker
*/
public fectchItemList(url:string) {
let arg:any = {};
this.handlePublicParams(arg);
this.$http
.get(url,arg.param)
.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 AppUpicker
*/
public extractItem(itemList:any[],items:any[]) {
this.items = [];
itemList.forEach((item) => {
this.items.push({
label: item[this.interaction.label],
value: item[this.interaction.value],
});
});
}
/**
* 公共参数处理
*
* @param {*} arg
* @returns
* @memberof AppUpicker
*/
public handlePublicParams(arg: any): boolean {
if (!this.data) {
this.$Notice.error({ title: (this.$t('components.appPicker.error') as any), desc: (this.$t('components.appPicker.formdataException') as any) });
return false;
}
// 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理
if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context);
}
if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param);
}
return true;
}
}
</script>
<style lang="less">
@import './app-upicker.less';
</style>
......@@ -193,19 +193,19 @@ export default class EditViewEngine extends ViewEngine {
*/
public setTabCaption(info: string,isNew:boolean): void {
let viewdata: any = this.view.model;
let index:number = viewdata.srfTitle.indexOf("-");
let index:number = viewdata.srfCaption.indexOf("-");
if (viewdata && info && !Object.is(info, '')) {
if(index !== -1){
viewdata.srfTitle = viewdata.srfTitle.substr(0,index);
viewdata.srfCaption = viewdata.srfCaption.substr(0,index);
}
// 解决表格视图标题问题
if(this.view.$tabPageExp && this.view.viewDefaultUsage){
this.view.$tabPageExp.setCurPageCaption(this.view.$t(viewdata.srfTitle), this.view.$t(viewdata.srfTitle), info);
this.view.$tabPageExp.setCurPageCaption(this.view.$t(viewdata.srfCaption), this.view.$t(viewdata.srfCaption), info);
}
if(this.view.$route){
this.view.$route.meta.info = info;
}
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)}-${viewdata.dataInfo}`;
this.view.model.srfCaption = `${this.view.$t(viewdata.srfCaption)}-${viewdata.dataInfo}`;
this.view.initNavDataWithRoute(null,isNew);
}
}
......
......@@ -3,13 +3,14 @@ import { AuthServiceRegister } from '@/authservice/auth-service-register';
import { UtilServiceRegister } from '@/utilservice/util-service-register';
import { EntityServiceRegister } from '@/service/entity-service-register';
import { CounterServiceRegister } from '@/counter/counter-service-register';
import { CodeListRegister } from '@codelist/codelist-register';
declare global {
interface Window {
uiServiceRegister: UIServiceRegister,
authServiceRegister: AuthServiceRegister,
utilServiceRegister: UtilServiceRegister,
entityServiceRegister: EntityServiceRegister,
counterServiceRegister: CounterServiceRegister
counterServiceRegister: CounterServiceRegister,
codeListRegister:CodeListRegister
}
}
\ No newline at end of file
......@@ -194,6 +194,7 @@ export default {
back: "Back",
next: "Next",
complete: "Complete",
preactionmessage:"The calculation of the previous behavior is not configured"
},
viewLayoutPanel: {
appLogoutView: {
......
......@@ -193,6 +193,7 @@ export default {
back: "上一步",
next: "下一步",
complete: "完成",
preactionmessage:"未配置计算上一步行为"
},
viewLayoutPanel: {
appLogoutView: {
......
......@@ -25,7 +25,7 @@ mock.onGet('v7/notify-index-viewappmenu').reply((config: any) => {
iconcls: 'fa fa-ioxhost',
icon: '',
textcls: '',
appfunctag: '_3',
appfunctag: 'Auto2',
resourcetag: '',
},
{
......@@ -43,7 +43,7 @@ mock.onGet('v7/notify-index-viewappmenu').reply((config: any) => {
iconcls: 'fa fa-list-alt',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: 'Auto1',
resourcetag: '',
},
],
......
<template>
<div class="view-container deeditview msg-open-access-edit-view">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="msgopenaccesseditview"></app-studioaction>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="msgopenaccesseditview"></app-studioaction>
<card class='view-card ' :disHover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
......@@ -556,7 +556,7 @@ export default class MsgOpenAccessEditViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'msg-open-access-edit-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'msg-open-access-edit-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -567,7 +567,7 @@ export default class MsgOpenAccessEditViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'msg-open-access-edit-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'msg-open-access-edit-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
<template>
<div class='view-container degridview msg-open-access-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="msgopenaccessgridview"></app-studioaction>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="msgopenaccessgridview"></app-studioaction>
<card class='view-card ' :dis-hover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</div>
<div class='content-container'>
<div class='view-top-messages'>
......@@ -590,7 +590,7 @@ export default class MsgOpenAccessGridViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'msg-open-access-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'msg-open-access-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -601,7 +601,7 @@ export default class MsgOpenAccessGridViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'msg-open-access-grid-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'msg-open-access-grid-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
<template>
<div class='view-container depickupgridview msg-open-access-pickup-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="msgopenaccesspickupgridview"></app-studioaction>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="msgopenaccesspickupgridview"></app-studioaction>
<card class='view-card view-no-caption view-no-toolbar' :dis-hover="true" :bordered="false">
<div class='content-container pickup-grid-view'>
<view_searchform
......@@ -446,7 +446,7 @@ export default class MsgOpenAccessPickupGridViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'msg-open-access-pickup-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'msg-open-access-pickup-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -457,7 +457,7 @@ export default class MsgOpenAccessPickupGridViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'msg-open-access-pickup-grid-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'msg-open-access-pickup-grid-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
<template>
<div class="view-container depickupview msg-open-access-pickup-view">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="msgopenaccesspickupview"></app-studioaction>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="msgopenaccesspickupview"></app-studioaction>
<card class='view-card view-no-caption view-no-toolbar' :dis-hover="true" :padding="0" :bordered="false">
<div class="content-container pickup-view">
<view_pickupviewpanel
......@@ -439,7 +439,7 @@ export default class MsgOpenAccessPickupViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'msg-open-access-pickup-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'msg-open-access-pickup-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -450,7 +450,7 @@ export default class MsgOpenAccessPickupViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'msg-open-access-pickup-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'msg-open-access-pickup-view',tag:this.viewtag,srfkey:this.context.msgopenaccess,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
<template>
<div class="view-container deeditview msg-template-edit-view">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="msgtemplateeditview"></app-studioaction>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="msgtemplateeditview"></app-studioaction>
<card class='view-card ' :disHover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
......@@ -556,7 +556,7 @@ export default class MsgTemplateEditViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'msg-template-edit-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgtemplate,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'msg-template-edit-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgtemplate,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -567,7 +567,7 @@ export default class MsgTemplateEditViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'msg-template-edit-view',tag:this.viewtag,srfkey:this.context.msgtemplate,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'msg-template-edit-view',tag:this.viewtag,srfkey:this.context.msgtemplate,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
<template>
<div class='view-container degridview msg-template-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="msgtemplategridview"></app-studioaction>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="msgtemplategridview"></app-studioaction>
<card class='view-card ' :dis-hover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</div>
<div class='content-container'>
<div class='view-top-messages'>
......@@ -590,7 +590,7 @@ export default class MsgTemplateGridViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'msg-template-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgtemplate,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'msg-template-grid-view',tag:this.viewtag,srfkey:isNew ? null : this.context.msgtemplate,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -601,7 +601,7 @@ export default class MsgTemplateGridViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'msg-template-grid-view',tag:this.viewtag,srfkey:this.context.msgtemplate,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'msg-template-grid-view',tag:this.viewtag,srfkey:this.context.msgtemplate,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
......@@ -412,7 +412,7 @@ export default class NotifyIndexViewBase extends Vue {
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'notify-index-view',tag:this.viewtag,srfkey:isNew ? null : null,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
this.navDataService.addNavData({id:'notify-index-view',tag:this.viewtag,srfkey:isNew ? null : null,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
......@@ -423,7 +423,7 @@ export default class NotifyIndexViewBase extends Vue {
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'notify-index-view',tag:this.viewtag,srfkey:null,title:this.$t(this.model.srfTitle),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
this.navDataService.addNavDataByOnly({id:'notify-index-view',tag:this.viewtag,srfkey:null,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
......
......@@ -25,7 +25,7 @@ const router = new Router({
});
},
meta: {
caption: 'app.views.notifyindexview.title',
caption: 'app.views.notifyindexview.caption',
info:'',
viewType: 'APPINDEX',
parameters: [
......@@ -38,7 +38,7 @@ const router = new Router({
{
path: 'msgopenaccesses/:msgopenaccess?/editview/:editview?',
meta: {
caption: 'entities.msgopenaccess.views.editview.title',
caption: 'entities.msgopenaccess.views.editview.caption',
info:'',
parameters: [
{ pathName: 'notifyindexview', parameterName: 'notifyindexview' },
......@@ -52,7 +52,7 @@ const router = new Router({
{
path: 'msgtemplates/:msgtemplate?/gridview/:gridview?',
meta: {
caption: 'entities.msgtemplate.views.gridview.title',
caption: 'entities.msgtemplate.views.gridview.caption',
info:'',
parameters: [
{ pathName: 'notifyindexview', parameterName: 'notifyindexview' },
......@@ -66,7 +66,7 @@ const router = new Router({
{
path: 'msgopenaccesses/:msgopenaccess?/pickupgridview/:pickupgridview?',
meta: {
caption: 'entities.msgopenaccess.views.pickupgridview.title',
caption: 'entities.msgopenaccess.views.pickupgridview.caption',
info:'',
parameters: [
{ pathName: 'notifyindexview', parameterName: 'notifyindexview' },
......@@ -80,7 +80,7 @@ const router = new Router({
{
path: 'msgopenaccesses/:msgopenaccess?/pickupview/:pickupview?',
meta: {
caption: 'entities.msgopenaccess.views.pickupview.title',
caption: 'entities.msgopenaccess.views.pickupview.caption',
info:'',
parameters: [
{ pathName: 'notifyindexview', parameterName: 'notifyindexview' },
......@@ -94,7 +94,7 @@ const router = new Router({
{
path: 'msgtemplates/:msgtemplate?/editview/:editview?',
meta: {
caption: 'entities.msgtemplate.views.editview.title',
caption: 'entities.msgtemplate.views.editview.caption',
info:'',
parameters: [
{ pathName: 'notifyindexview', parameterName: 'notifyindexview' },
......@@ -108,7 +108,7 @@ const router = new Router({
{
path: 'msgopenaccesses/:msgopenaccess?/gridview/:gridview?',
meta: {
caption: 'entities.msgopenaccess.views.gridview.title',
caption: 'entities.msgopenaccess.views.gridview.caption',
info:'',
parameters: [
{ pathName: 'notifyindexview', parameterName: 'notifyindexview' },
......@@ -125,7 +125,7 @@ const router = new Router({
{
path: '/msgopenaccesses/:msgopenaccess?/editview/:editview?',
meta: {
caption: 'entities.msgopenaccess.views.editview.title',
caption: 'entities.msgopenaccess.views.editview.caption',
info:'',
parameters: [
{ pathName: 'msgopenaccesses', parameterName: 'msgopenaccess' },
......@@ -138,7 +138,7 @@ const router = new Router({
{
path: '/msgtemplates/:msgtemplate?/gridview/:gridview?',
meta: {
caption: 'entities.msgtemplate.views.gridview.title',
caption: 'entities.msgtemplate.views.gridview.caption',
info:'',
parameters: [
{ pathName: 'msgtemplates', parameterName: 'msgtemplate' },
......@@ -151,7 +151,7 @@ const router = new Router({
{
path: '/msgopenaccesses/:msgopenaccess?/pickupview/:pickupview?',
meta: {
caption: 'entities.msgopenaccess.views.pickupview.title',
caption: 'entities.msgopenaccess.views.pickupview.caption',
info:'',
parameters: [
{ pathName: 'msgopenaccesses', parameterName: 'msgopenaccess' },
......@@ -164,7 +164,7 @@ const router = new Router({
{
path: '/msgopenaccesses/:msgopenaccess?/pickupgridview/:pickupgridview?',
meta: {
caption: 'entities.msgopenaccess.views.pickupgridview.title',
caption: 'entities.msgopenaccess.views.pickupgridview.caption',
info:'',
parameters: [
{ pathName: 'msgopenaccesses', parameterName: 'msgopenaccess' },
......@@ -177,7 +177,7 @@ const router = new Router({
{
path: '/msgopenaccesses/:msgopenaccess?/gridview/:gridview?',
meta: {
caption: 'entities.msgopenaccess.views.gridview.title',
caption: 'entities.msgopenaccess.views.gridview.caption',
info:'',
parameters: [
{ pathName: 'msgopenaccesses', parameterName: 'msgopenaccess' },
......@@ -190,7 +190,7 @@ const router = new Router({
{
path: '/msgtemplates/:msgtemplate?/editview/:editview?',
meta: {
caption: 'entities.msgtemplate.views.editview.title',
caption: 'entities.msgtemplate.views.editview.caption',
info:'',
parameters: [
{ pathName: 'msgtemplates', parameterName: 'msgtemplate' },
......
import { Store } from 'vuex';
import store from '@/store';
import EntityService from '../entity-service';
/**
* 动态代码表服务类
......@@ -15,10 +16,10 @@ export default class CodeListService {
* @type {(any | null)}
* @memberof CodeListService
*/
private $store: Store<any> | null = null;
private $store: any;
constructor(opts: any = {}) {
this.$store = opts.$store;
this.$store = store;
}
/**
......@@ -27,7 +28,7 @@ export default class CodeListService {
* @returns {(any | null)}
* @memberof CodeListService
*/
public getStore(): Store<any> | null {
public getStore(): any {
return this.$store;
}
......@@ -48,6 +49,79 @@ export default class CodeListService {
*/
public static codelistCached:Map<string,any> = new Map();
/**
* 数据服务基类
*
* @type {Minorentity}
* @memberof CodeListService
*/
public entityService:EntityService = new EntityService();
/**
* 获取代码表服务
*
* @protected
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof EntityService
*/
public getService(name: string): Promise<any> {
return (window as any)['codeListRegister'].getService(name);
}
/**
* 获取静态代码表
*
* @param {string} tag 代码表标识
* @returns {Promise<any[]>}
* @memberof CodeListService
*/
public getStaticItems(tag: string):Promise<any[]>{
return new Promise((resolve:any,reject:any) =>{
const codelist = this.$store.getters.getCodeList(tag);
if (codelist) {
let items: Array<any> = [...JSON.parse(JSON.stringify(codelist.items))];
resolve(items);
}
})
}
/**
* 获取预定义代码表
*
* @param {string} tag 代码表标识
* @returns {Promise<any[]>}
* @memberof CodeListService
*/
public getPredefinedItems(tag: string,data?: any, isloading?: boolean):Promise<any[]>{
return new Promise((resolve:any,reject:any) =>{
if(CodeListService.codelistCached.get(`${tag}`)){
let items:any = CodeListService.codelistCached.get(`${tag}`).items;
if(items.length >0) resolve(items);
}
const callback:Function = (tag:string,promise:Promise<any>) =>{
promise.then((res:any) =>{
let result:any = res.data;
if(result.items && result.items.length > 0){
CodeListService.codelistCached.set(`${tag}`,{items:result.items});
return resolve(result.items);
}else{
return resolve([]);
}
}).catch((result:any) =>{
return reject(result);
})
}
// 加载中,UI又需要数据,解决连续加载同一代码表问题
if(CodeListService.codelistCache.get(`${tag}`)){
callback(tag,CodeListService.codelistCache.get(`${tag}`));
}else{
let result:Promise<any> = this.entityService.getPredefinedCodelist(tag);
CodeListService.codelistCache.set(`${tag}`,result);
callback(tag,result);
}
})
}
/**
* 获取动态代码表
......@@ -57,14 +131,21 @@ export default class CodeListService {
* @returns {Promise<any[]>}
* @memberof CodeListService
*/
public getItems(tag: string,context:any = {}, data?: any, isloading?: boolean,): Promise<any[]> {
public getItems(tag: string,context:any = {}, data?: any, isloading?: boolean): Promise<any[]> {
let _this: any = this;
if(context && context.srfsessionid){
delete context.srfsessionid;
}
let isEnableCache:boolean = _this[tag].isEnableCache;
let cacheTimeout:any = _this[tag].cacheTimeout;
return new Promise((resolve:any,reject:any) =>{
this.getService(tag).then((codelist:any) =>{
if(Object.is(codelist.predefinedType,"RUNTIME")){
this.getPredefinedItems(tag).then((res:any) =>{
resolve(res);
})
return;
}
let isEnableCache:boolean = codelist.isEnableCache;
let cacheTimeout:any = codelist.cacheTimeout;
// 启用缓存
if(isEnableCache){
// 加载完成,从本地缓存获取
......@@ -72,10 +153,10 @@ export default class CodeListService {
let items:any = CodeListService.codelistCached.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`).items;
if(items.length >0){
if(cacheTimeout !== -1){
if(new Date().getTime() > _this[tag].expirationTime){
_this[tag].getItems(context,data,isloading).then((result:any) =>{
if(new Date().getTime() > codelist.expirationTime){
codelist.getItems(context,data,isloading).then((result:any) =>{
CodeListService.codelistCached.set(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`,{items:result});
_this[tag].expirationTime = new Date().getTime() + cacheTimeout;
codelist.expirationTime = new Date().getTime() + cacheTimeout;
resolve(result);
}).catch((error:any) =>{
Promise.reject([]);
......@@ -88,7 +169,7 @@ export default class CodeListService {
}
}
}
if (_this[tag]) {
if (codelist) {
const callback:Function = (context:any ={},data:any ={},tag:string,promise:Promise<any>) =>{
promise.then((result:any) =>{
if(result.length > 0){
......@@ -105,17 +186,17 @@ export default class CodeListService {
if(CodeListService.codelistCache.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`)){
callback(context,data,tag,CodeListService.codelistCache.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`));
}else{
let result:Promise<any> = _this[tag].getItems(context,data,isloading);
let result:Promise<any> = codelist.getItems(context,data,isloading);
CodeListService.codelistCache.set(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`,result);
if(cacheTimeout !== -1){
_this[tag].expirationTime = new Date().getTime() + cacheTimeout;
codelist.expirationTime = new Date().getTime() + cacheTimeout;
}
callback(context,data,tag,result);
}
}
}else{
if (_this[tag]) {
_this[tag].getItems(context,data,isloading).then((result:any) =>{
if (codelist) {
codelist.getItems(context,data,isloading).then((result:any) =>{
resolve(result);
}).catch((error:any) =>{
Promise.reject([]);
......@@ -124,6 +205,10 @@ export default class CodeListService {
return Promise.reject([]);
}
}
}).catch((error:any) =>{
console.warn("获取代码表异常");
return Promise.reject([]);
})
})
}
}
\ No newline at end of file
import { Store } from 'vuex';
import { Http } from '@/utils';
import CodeListService from "@service/app/codelist-service";
......@@ -10,15 +9,6 @@ import CodeListService from "@service/app/codelist-service";
*/
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 {
* @memberof EntityService
*/
constructor(opts: any = {}) {
this.$store = opts.$store;
this.tempStorage = localStorage;
this.initBasicData();
}
/**
* 获取状态管理器
*
* @returns {(any | null)}
* @memberof EntityService
*/
public getStore(): Store<any> | null {
return this.$store;
}
/**
* 获取代码表
*
......@@ -123,22 +102,16 @@ export default class EntityService {
*/
public getCodeList(tag:string,codelistType:string,context:any = {},param:any ={}){
return new Promise((resolve:any,reject:any) =>{
let codeListService = new CodeListService();
if(tag && Object.is(codelistType,"STATIC")){
let returnItems:Array<any> = [];
const codelist = (this.getStore() as Store<any>).getters.getCodeList(tag);
if (codelist) {
returnItems = [...JSON.parse(JSON.stringify(codelist.items))];
} else {
console.log(`----${tag}----代码表不存在`);
}
resolve(returnItems);
codeListService.getStaticItems(tag).then((items:any) =>{
resolve(items);
})
}else if(tag && Object.is(codelistType,"DYNAMIC")){
let codeListService = new CodeListService({ $store: this.$store });
codeListService.getItems(tag,context,param).then((res:any) => {
resolve(res);
}).catch((error:any) => {
reject(`${tag}代码表不存在`);
console.log(`----${tag}----代码表不存在`);
});
}
})
......@@ -988,4 +961,15 @@ export default class EntityService {
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
......@@ -504,11 +504,11 @@ export default class NotifyIndexViewBase extends Vue implements ControlInterface
navDataService.removeNavData(this.viewtag);
}
switch (item.appfunctag) {
case '_3':
this.click_3(item);
case 'Auto2':
this.clickAuto2(item);
return;
case '_2':
this.click_2(item);
case 'Auto1':
this.clickAuto1(item);
return;
default:
console.warn('未指定应用功能');
......@@ -523,7 +523,7 @@ export default class NotifyIndexViewBase extends Vue implements ControlInterface
* @param {*} [item={}]
* @memberof NotifyIndexView
*/
public click_3(item: any = {}) {
public clickAuto2(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......@@ -546,7 +546,7 @@ export default class NotifyIndexViewBase extends Vue implements ControlInterface
* @param {*} [item={}]
* @memberof NotifyIndexView
*/
public click_2(item: any = {}) {
public clickAuto1(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......
......@@ -29,7 +29,7 @@ export default class NotifyIndexViewModel {
iconcls: 'fa fa-ioxhost',
icon: '',
textcls: '',
appfunctag: '_3',
appfunctag: 'Auto2',
resourcetag: '',
authtag:'web-NotifyIndexView-menuitem1',
},
......@@ -48,7 +48,7 @@ export default class NotifyIndexViewModel {
iconcls: 'fa fa-list-alt',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: 'Auto1',
resourcetag: '',
authtag:'web-NotifyIndexView-menuitem2',
},
......
......@@ -48,6 +48,7 @@
</i-col>
</row>
</i-form>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
......
......@@ -655,6 +655,9 @@ export default class MainBase extends Vue implements ControlInterface {
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
if(!this.data[name]){
falg.isPast = true;
}
return falg;
}
......@@ -1233,6 +1236,9 @@ export default class MainBase extends Vue implements ControlInterface {
if (Object.is('refresh', action)) {
this.refresh(data);
}
if (Object.is('panelaction', action)) {
this.panelAction(data.action,data.emitAction,data);
}
});
}
this.dataChang
......@@ -1724,6 +1730,50 @@ export default class MainBase extends Vue implements ControlInterface {
})
}
/**
* 面板行为
*
* @param {string} [action] 调用的实体行为
* @param {string} [emitAction] 抛出行为
* @param {*} [data={}] 传入数据
* @param {boolean} [showloading] 是否显示加载状态
*
* @memberof MainBase
*/
public panelAction(action:string,emitAction:string,data:any ={},showloading?:boolean):void{
if (!action || (action && Object.is(action, ''))) {
return;
}
const arg: any = { ...data };
const formdata = this.getValues();
Object.assign(arg, formdata);
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.frontLogic(action,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,emitAction);
this.$emit(emitAction, data);
this.$nextTick(() => {
this.formState.next({ type: emitAction, data: data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
/**
* 表单项更新
*
......
......@@ -1285,7 +1285,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
// 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.msg_open_access,$event.msg_open_access);
return Object.is(item.msgopenaccess,$event.msgopenaccess);
});
if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event)));
......
......@@ -36,7 +36,7 @@
height: 100%;
display:flex;
flex-direction: column;
justify-content: start;
justify-content: flex-start;
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
......@@ -66,6 +66,15 @@
margin-bottom: 20px;
}
}
.el-table__header-wrapper{
display: contents;
}
.el-table__body-wrapper{
height: auto !important;
}
.el-table__footer-wrapper{
display: contents;
}
}
.grid-pagination {
height: 50px;
......
......@@ -42,6 +42,7 @@
</i-col>
</row>
</i-form>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
......
......@@ -679,6 +679,9 @@ export default class MainBase extends Vue implements ControlInterface {
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
if(!this.data[name]){
falg.isPast = true;
}
return falg;
}
......@@ -1275,6 +1278,9 @@ export default class MainBase extends Vue implements ControlInterface {
if (Object.is('refresh', action)) {
this.refresh(data);
}
if (Object.is('panelaction', action)) {
this.panelAction(data.action,data.emitAction,data);
}
});
}
this.dataChang
......@@ -1766,6 +1772,50 @@ export default class MainBase extends Vue implements ControlInterface {
})
}
/**
* 面板行为
*
* @param {string} [action] 调用的实体行为
* @param {string} [emitAction] 抛出行为
* @param {*} [data={}] 传入数据
* @param {boolean} [showloading] 是否显示加载状态
*
* @memberof MainBase
*/
public panelAction(action:string,emitAction:string,data:any ={},showloading?:boolean):void{
if (!action || (action && Object.is(action, ''))) {
return;
}
const arg: any = { ...data };
const formdata = this.getValues();
Object.assign(arg, formdata);
Object.assign(arg,this.viewparams);
const post: Promise<any> = this.service.frontLogic(action,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
const data = response.data;
this.onFormLoad(data,emitAction);
this.$emit(emitAction, data);
this.$nextTick(() => {
this.formState.next({ type: emitAction, data: data });
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
/**
* 表单项更新
*
......
......@@ -1315,7 +1315,7 @@ export default class MainBase extends Vue implements ControlInterface {
}
// 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.msg_template,$event.msg_template);
return Object.is(item.msgtemplate,$event.msgtemplate);
});
if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event)));
......
......@@ -36,7 +36,7 @@
height: 100%;
display:flex;
flex-direction: column;
justify-content: start;
justify-content: flex-start;
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
......@@ -66,6 +66,15 @@
margin-bottom: 20px;
}
}
.el-table__header-wrapper{
display: contents;
}
.el-table__body-wrapper{
height: auto !important;
}
.el-table__footer-wrapper{
display: contents;
}
}
.grid-pagination {
height: 50px;
......
......@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
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;
@Slf4j
......@@ -30,6 +32,9 @@ import java.util.List;
})
public class webApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(webApplication.class,args);
}
......@@ -37,6 +42,6 @@ public class webApplication extends WebMvcConfigurerAdapter{
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver());
argumentResolvers.add(resolver);
}
}
......@@ -36,9 +36,13 @@ zuul:
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
oudict:
path: /dictionarys/**/ibzou**
path: /dictionarys/**/Ibzou**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
uaadict:
path: /dictionarys/**/SysOperator
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
dict:
path: /dictionarys/**
serviceId: ${ibiz.ref.service.dict:ibzdict-api}
......
......@@ -14,6 +14,8 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.List;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@EnableDiscoveryClient
......@@ -34,6 +36,9 @@ import java.util.List;
@EnableScheduling
public class DevBootApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(DevBootApplication.class,args);
}
......@@ -41,6 +46,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver());
argumentResolvers.add(resolver);
}
}
......@@ -25,9 +25,13 @@ zuul:
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
oudict:
path: /dictionarys/**/ibzou**
path: /dictionarys/**/Ibzou**
serviceId: ${ibiz.ref.service.ou:ibzou-api}
stripPrefix: false
uaadict:
path: /dictionarys/**/SysOperator
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
dict:
path: /dictionarys/**
serviceId: ${ibiz.ref.service.dict:ibzdict-api}
......
package cn.ibizlab.core.notify.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/**
* 实体[绑定消息账号]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZUSERAUTH",resultMap = "MsgUserAccountResultMap")
public class MsgUserAccount extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 标识
*/
@DEField(name = "authid" , isKeyField=true)
@TableId(value= "authid",type=IdType.ASSIGN_UUID)
@JSONField(name = "id")
@JsonProperty("id")
private String id;
/**
* 用户标识
*/
@TableField(value = "userid")
@JSONField(name = "userid")
@JsonProperty("userid")
private String userid;
/**
* 认证类型
*/
@DEField(name = "identity_type")
@TableField(value = "identity_type")
@JSONField(name = "identity_type")
@JsonProperty("identity_type")
private String identityType;
/**
* 认证标识
*/
@TableField(value = "identifier")
@JSONField(name = "identifier")
@JsonProperty("identifier")
private String identifier;
/**
* 凭据
*/
@TableField(value = "credential")
@JSONField(name = "credential")
@JsonProperty("credential")
private String credential;
/**
* 设置 [用户标识]
*/
public void setUserid(String userid){
this.userid = userid ;
this.modify("userid",userid);
}
/**
* 设置 [认证类型]
*/
public void setIdentityType(String identityType){
this.identityType = identityType ;
this.modify("identity_type",identityType);
}
/**
* 设置 [认证标识]
*/
public void setIdentifier(String identifier){
this.identifier = identifier ;
this.modify("identifier",identifier);
}
/**
* 设置 [凭据]
*/
public void setCredential(String credential){
this.credential = credential ;
this.modify("credential",credential);
}
/**
* 获取 [标识]
*/
public String getId(){
if(ObjectUtils.isEmpty(id)){
id=(String)getDefaultKey(true);
}
return id;
}
@Override
public Serializable getDefaultKey(boolean gen) {
if((!ObjectUtils.isEmpty(this.getUserid()))&&(!ObjectUtils.isEmpty(this.getIdentityType())))
return DigestUtils.md5DigestAsHex(String.format("%s||%s" ,this.getUserid(),this.getIdentityType()).getBytes());
return null;
}
}
package cn.ibizlab.core.notify.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.notify.domain.MsgUserAccount;
/**
* 关系型数据实体[MsgUserAccount] 查询条件对象
*/
@Slf4j
@Data
public class MsgUserAccountSearchContext extends QueryWrapperContext<MsgUserAccount> {
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
}
}
}
......@@ -21,14 +21,19 @@ public interface MsgTemplateMapper extends BaseMapper<MsgTemplate>{
Page<MsgTemplate> searchDefault(IPage page, @Param("srf") MsgTemplateSearchContext context, @Param("ew") Wrapper<MsgTemplate> wrapper) ;
@Override
@Cacheable( value="msgtemplate",key = "'row:'+#p0")
MsgTemplate selectById(Serializable id);
@Override
@CacheEvict( value="msgtemplate",key = "'row:'+#p0.tid")
int insert(MsgTemplate entity);
@Override
@CacheEvict( value="msgtemplate",key = "'row:'+#p0.tid")
int updateById(@Param(Constants.ENTITY) MsgTemplate entity);
@Override
@CacheEvict(value="msgtemplate",key = "'row:'+#p0.tid")
int update(@Param(Constants.ENTITY) MsgTemplate entity, @Param("ew") Wrapper<MsgTemplate> updateWrapper);
@Override
@CacheEvict( value="msgtemplate",key = "'row:'+#p0")
int deleteById(Serializable id);
/**
* 自定义查询SQL
......
package cn.ibizlab.core.notify.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.notify.domain.MsgUserAccount;
import cn.ibizlab.core.notify.filter.MsgUserAccountSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface MsgUserAccountMapper extends BaseMapper<MsgUserAccount>{
Page<MsgUserAccount> searchDefault(IPage page, @Param("srf") MsgUserAccountSearchContext context, @Param("ew") Wrapper<MsgUserAccount> wrapper) ;
@Override
MsgUserAccount selectById(Serializable id);
@Override
int insert(MsgUserAccount entity);
@Override
int updateById(@Param(Constants.ENTITY) MsgUserAccount entity);
@Override
int update(@Param(Constants.ENTITY) MsgUserAccount entity, @Param("ew") Wrapper<MsgUserAccount> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
......@@ -26,18 +26,23 @@ import com.baomidou.mybatisplus.extension.service.IService;
public interface IMsgTemplateService extends IService<MsgTemplate>{
boolean create(MsgTemplate et) ;
@CacheEvict(value="msgtemplate",allEntries=true)
void createBatch(List<MsgTemplate> list) ;
boolean update(MsgTemplate et) ;
@CacheEvict(value="msgtemplate",allEntries=true)
void updateBatch(List<MsgTemplate> list) ;
boolean remove(String key) ;
@CacheEvict(value="msgtemplate",allEntries=true)
void removeBatch(Collection<String> idList) ;
MsgTemplate get(String key) ;
MsgTemplate getDraft(MsgTemplate et) ;
boolean checkKey(MsgTemplate et) ;
boolean save(MsgTemplate et) ;
@CacheEvict(value="msgtemplate",allEntries=true)
void saveBatch(List<MsgTemplate> list) ;
Page<MsgTemplate> searchDefault(MsgTemplateSearchContext context) ;
List<MsgTemplate> selectByAccessId(String id) ;
@CacheEvict(value="msgtemplate",allEntries=true)
void removeByAccessId(String id) ;
/**
*自定义查询SQL
......
package cn.ibizlab.core.notify.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.core.notify.domain.MsgUserAccount;
import cn.ibizlab.core.notify.filter.MsgUserAccountSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[MsgUserAccount] 服务对象接口
*/
public interface IMsgUserAccountService extends IService<MsgUserAccount>{
boolean create(MsgUserAccount et) ;
void createBatch(List<MsgUserAccount> list) ;
boolean update(MsgUserAccount et) ;
void updateBatch(List<MsgUserAccount> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
MsgUserAccount get(String key) ;
MsgUserAccount getDraft(MsgUserAccount et) ;
boolean checkKey(MsgUserAccount et) ;
boolean save(MsgUserAccount et) ;
void saveBatch(List<MsgUserAccount> list) ;
Page<MsgUserAccount> searchDefault(MsgUserAccountSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
}
package cn.ibizlab.core.notify.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.notify.domain.MsgUserAccount;
import cn.ibizlab.core.notify.filter.MsgUserAccountSearchContext;
import cn.ibizlab.core.notify.service.IMsgUserAccountService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.notify.mapper.MsgUserAccountMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[绑定消息账号] 服务对象接口实现
*/
@Slf4j
@Service("MsgUserAccountServiceImpl")
public class MsgUserAccountServiceImpl extends ServiceImpl<MsgUserAccountMapper, MsgUserAccount> implements IMsgUserAccountService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(MsgUserAccount et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void createBatch(List<MsgUserAccount> list) {
this.saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(MsgUserAccount et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("authid",et.getId())))
return false;
CachedBeanCopier.copy(get(et.getId()),et);
return true;
}
@Override
public void updateBatch(List<MsgUserAccount> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public MsgUserAccount get(String key) {
MsgUserAccount et = getById(key);
if(et==null){
et=new MsgUserAccount();
et.setId(key);
}
else{
}
return et;
}
@Override
public MsgUserAccount getDraft(MsgUserAccount et) {
return et;
}
@Override
public boolean checkKey(MsgUserAccount et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(MsgUserAccount et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(MsgUserAccount et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<MsgUserAccount> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<MsgUserAccount> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<MsgUserAccount> searchDefault(MsgUserAccountSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<MsgUserAccount> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<MsgUserAccount>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
}
......@@ -32,7 +32,7 @@
<!--输出实体[MSG_TEMPLATE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-msg_template-95-2">
<changeSet author="a_A_5d9d78509" id="tab-msg_template-97-2">
<createTable tableName="IBZMSGTEMPL">
<column name="TID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_MSG_TEMPLATE_TID"/>
......@@ -56,7 +56,26 @@
</createTable>
</changeSet>
<!--输出实体[MSG_USER_ACCOUNT]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-msg_user_account-9-3">
<createTable tableName="IBZUSERAUTH">
<column name="AUTHID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_MSG_USER_ACCOUNT_AUTHID"/>
</column>
<column name="USERID" remarks="" type="VARCHAR(100)">
</column>
<column name="IDENTITY_TYPE" remarks="" type="VARCHAR(100)">
</column>
<column name="IDENTIFIER" remarks="" type="VARCHAR(200)">
</column>
<column name="CREDENTIAL" remarks="" type="VARCHAR(500)">
</column>
</createTable>
</changeSet>
<!--输出实体[MSG_OPEN_ACCESS]外键关系 -->
<!--输出实体[MSG_TEMPLATE]外键关系 -->
<!--输出实体[MSG_USER_ACCOUNT]外键关系 -->
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.notify.mapper.MsgUserAccountMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="MsgUserAccountResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`AUTHID`, t1.`CREDENTIAL`, t1.`IDENTIFIER`, t1.`IDENTITY_TYPE`, t1.`USERID` FROM `IBZUSERAUTH` t1 ) t1 where authid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="MsgUserAccountResultMap" type="cn.ibizlab.core.notify.domain.MsgUserAccount" autoMapping="true">
<id property="id" column="authid" /><!--主键字段映射-->
<result property="identityType" column="identity_type" />
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.notify.filter.MsgUserAccountSearchContext" resultMap="MsgUserAccountResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`AUTHID`, t1.`CREDENTIAL`, t1.`IDENTIFIER`, t1.`IDENTITY_TYPE`, t1.`USERID` FROM `IBZUSERAUTH` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`AUTHID`, t1.`CREDENTIAL`, t1.`IDENTIFIER`, t1.`IDENTITY_TYPE`, t1.`USERID` FROM `IBZUSERAUTH` t1
]]>
</sql>
</mapper>
......@@ -15,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
......@@ -40,6 +42,9 @@ import java.util.List;
@EnableScheduling
public class ibznotifyapiApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(ibznotifyapiApplication.class, args);
}
......@@ -47,6 +52,6 @@ public class ibznotifyapiApplication extends WebMvcConfigurerAdapter{
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver());
argumentResolvers.add(resolver);
}
}
......@@ -4,9 +4,9 @@ public class DTOClient extends DTOBase {
@Override
public void modify(String field,Object val) {
getExtensionparams().put("dirtyflagenable",true);
if(val==null){
this.getFocusNull().add(field.toLowerCase());
getExtensionparams().put("dirtyflagenable",true);
getExtensionparams().put(field.toLowerCase()+"dirtyflag",true);
}
else{
......
......@@ -30,6 +30,9 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value("${ibiz.systemid:ibznotify}")
private String systemId;
@Value("${ibiz.systemname:ibznotify}")
private String systemName;
@Override
public void run(ApplicationArguments args) {
......@@ -39,7 +42,7 @@ public class PermissionSyncJob implements ApplicationRunner {
String permissionResult = IOUtils.toString(permission,"UTF-8");
JSONObject system= new JSONObject();
system.put("pssystemid",systemId);
system.put("pssystemname",systemId);
system.put("pssystemname",systemName);
system.put("sysstructure",JSONObject.parseObject(permissionResult));
system.put("md5check",DigestUtils.md5DigestAsHex(permissionResult.getBytes()));
if(client.syncSysAuthority(system)){
......
......@@ -10,10 +10,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
public class SearchContextHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
@Value("${ibiz.pageLimit:1000}")
private int pageLimit=1000;
private static ObjectMapper objectMapper=new ObjectMapper();
@Override
......@@ -29,6 +35,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for (String key : params.keySet()) {
set.put(key,params.get(key)[0]);
}
if((!set.containsKey("size")) ){
set.put("size",pageLimit);
}
String json=objectMapper.writeValueAsString(set);
return objectMapper.readValue(json,parameter.getParameterType());
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册