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

ibizdev提交

上级 04773e3a
<template> <template>
<codelist v-if="tag" :tag="tag" :value="value" :codelistType="codelistType" :renderMode="renderMode" :valueSeparator="valueSeparator" :textSeparator="textSeparator"></codelist> <codelist v-if="tag" :tag="tag" :value="value" :codelistType="codelistType" :renderMode="renderMode" :valueSeparator="valueSeparator" :textSeparator="textSeparator"></codelist>
<app-upload-file-info v-else-if="Object.is(this.editorType,'PICTURE') || Object.is(this.editorType,'PICTURE_ONE') || Object.is(this.editorType,'FILEUPLOADER')" :value="value" :name="name"></app-upload-file-info>
<span class="app-span" v-else >{{text}}</span> <span class="app-span" v-else >{{text}}</span>
</template> </template>
...@@ -18,6 +19,14 @@ export default class DropDownList extends Vue { ...@@ -18,6 +19,14 @@ export default class DropDownList extends Vue {
*/ */
@Prop() public value?: any; @Prop() public value?: any;
/**
* 当前表单项名称
*
* @type {*}
* @memberof AppSpan
*/
@Prop() public name?: any;
/** /**
* 代码表标识 * 代码表标识
* *
...@@ -99,15 +108,6 @@ export default class DropDownList extends Vue { ...@@ -99,15 +108,6 @@ export default class DropDownList extends Vue {
public load(){ public load(){
if(!this.value || this.tag){ if(!this.value || this.tag){
return; //代码表走codelist组件 return; //代码表走codelist组件
} else if(Object.is(this.editorType,'PICTURE') || Object.is(this.editorType,'PICTURE_ONE') || Object.is(this.editorType,'FILEUPLOADER')){
let files: any[] = JSON.parse(this.value);
let names: any[] = [];
if(files.length && files.length > 0){
files.forEach((item:any) => {
names.push(item.name);
});
this.text = names.join(',');
}
}else{ }else{
this.text = this.value; this.text = this.value;
} }
......
...@@ -97,13 +97,15 @@ ...@@ -97,13 +97,15 @@
</i-col> </i-col>
<i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzdepartment.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzdepartment.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span :value="data.createdate" style=""></app-span> <app-span name='createdate'
:value="data.createdate" style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzdepartment.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzdepartment.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span :value="data.updatedate" style=""></app-span> <app-span name='updatedate'
:value="data.updatedate" style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
......
...@@ -66,13 +66,15 @@ ...@@ -66,13 +66,15 @@
</i-col> </i-col>
<i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.createdate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzorganization.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='createdate' :itemRules="this.rules.createdate" class='' :caption="$t('entities.ibzorganization.main_form.details.createdate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.createdate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span :value="data.createdate" style=""></app-span> <app-span name='createdate'
:value="data.createdate" style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.updatedate.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzorganization.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='updatedate' :itemRules="this.rules.updatedate" class='' :caption="$t('entities.ibzorganization.main_form.details.updatedate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.updatedate.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span :value="data.updatedate" style=""></app-span> <app-span name='updatedate'
:value="data.updatedate" style=""></app-span>
</app-form-item> </app-form-item>
</i-col> </i-col>
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
<profiles> <profiles>
...@@ -97,24 +94,7 @@ ...@@ -97,24 +94,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
......
...@@ -11,6 +11,9 @@ import org.springframework.context.annotation.Configuration; ...@@ -11,6 +11,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.mybatis.spring.annotation.MapperScan; 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.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
@Slf4j @Slf4j
@Import({ @Import({
...@@ -25,9 +28,15 @@ import org.springframework.boot.SpringApplication; ...@@ -25,9 +28,15 @@ import org.springframework.boot.SpringApplication;
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
}) })
public class webApplication{ public class webApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(webApplication.class,args); SpringApplication.run(webApplication.class,args);
} }
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver());
}
} }
...@@ -7,6 +7,9 @@ import org.springframework.context.annotation.Configuration; ...@@ -7,6 +7,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
@Slf4j @Slf4j
@EnableDiscoveryClient @EnableDiscoveryClient
...@@ -14,9 +17,15 @@ import org.springframework.cloud.openfeign.EnableFeignClients; ...@@ -14,9 +17,15 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableTransactionManagement @EnableTransactionManagement
@SpringBootApplication @SpringBootApplication
@EnableFeignClients(basePackages = {"cn.ibizlab" }) @EnableFeignClients(basePackages = {"cn.ibizlab" })
public class DevBootApplication{ public class DevBootApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DevBootApplication.class,args); SpringApplication.run(DevBootApplication.class,args);
} }
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver());
}
} }
[ {
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"entities":[
{ {
"dename":"IBZDepartment", "dename":"IBZDepartment",
"delogicname":"部门", "delogicname":"部门",
"sysmoudle":{"id":"OU","name":"ou"}, "sysmoudle":{"id":"OU","name":"ou"},
"dedataset":[{"id":"Default","name":"默认数据集"}], "dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}], "deaction":[{"id":"CREATE","name":"新建","type":"BUILTIN"},{"id":"UPDATE","name":"编辑","type":"BUILTIN"},{"id":"READ","name":"读取","type":"BUILTIN"},{"id":"DELETE","name":"删除","type":"BUILTIN"},{"id":"CUSTOM","name":"自定义行为","type":"USERCUSTOM"}]
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
} }
, ,
{ {
...@@ -15,8 +16,7 @@ ...@@ -15,8 +16,7 @@
"delogicname":"人员", "delogicname":"人员",
"sysmoudle":{"id":"OU","name":"ou"}, "sysmoudle":{"id":"OU","name":"ou"},
"dedataset":[{"id":"Default","name":"默认数据集"}], "dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}], "deaction":[{"id":"CREATE","name":"新建","type":"BUILTIN"},{"id":"UPDATE","name":"编辑","type":"BUILTIN"},{"id":"READ","name":"读取","type":"BUILTIN"},{"id":"DELETE","name":"删除","type":"BUILTIN"},{"id":"CUSTOM","name":"自定义行为","type":"USERCUSTOM"}]
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
} }
, ,
{ {
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
"delogicname":"单位机构", "delogicname":"单位机构",
"sysmoudle":{"id":"OU","name":"ou"}, "sysmoudle":{"id":"OU","name":"ou"},
"dedataset":[{"id":"Default","name":"默认数据集"}], "dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}], "deaction":[{"id":"CREATE","name":"新建","type":"BUILTIN"},{"id":"UPDATE","name":"编辑","type":"BUILTIN"},{"id":"READ","name":"读取","type":"BUILTIN"},{"id":"DELETE","name":"删除","type":"BUILTIN"},{"id":"CUSTOM","name":"自定义行为","type":"USERCUSTOM"}]
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
} }
] ]
}
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
<profiles> <profiles>
<profile> <profile>
...@@ -66,23 +63,7 @@ ...@@ -66,23 +63,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
......
...@@ -9,6 +9,9 @@ import org.springframework.context.annotation.Configuration; ...@@ -9,6 +9,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
@Slf4j @Slf4j
@EnableDiscoveryClient @EnableDiscoveryClient
...@@ -20,9 +23,15 @@ import org.mybatis.spring.annotation.MapperScan; ...@@ -20,9 +23,15 @@ import org.mybatis.spring.annotation.MapperScan;
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
}) })
public class ibzououapiApplication{ public class ibzououapiApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ibzououapiApplication.class, args); SpringApplication.run(ibzououapiApplication.class, args);
} }
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver());
}
} }
package cn.ibizlab.util.filter; package cn.ibizlab.util.filter;
import cn.ibizlab.util.security.AuthenticationUser;
import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
...@@ -106,16 +107,11 @@ public class SearchContextBase implements ISearchContext{ ...@@ -106,16 +107,11 @@ public class SearchContextBase implements ISearchContext{
} }
/** /**
* 用户上下文参数 * 获取用户上下文
*/ * @return
Map<String,Object> sessionparams = new HashMap<String,Object>() ; */
/**
* 获取用户上下文
* @return
*/
public Map<String,Object> getSessioncontext() { public Map<String,Object> getSessioncontext() {
return sessionparams; return AuthenticationUser.getAuthenticationUser().getSessionParams();
} }
@JsonAnyGetter @JsonAnyGetter
......
...@@ -55,7 +55,7 @@ public class AuthenticationUser implements UserDetails ...@@ -55,7 +55,7 @@ public class AuthenticationUser implements UserDetails
private String fontsize; private String fontsize;
private String lang; private String lang;
private String memo; private String memo;
private Map <String,String> sessionParams; private Map <String,Object> sessionParams;
@JsonIgnore @JsonIgnore
private Collection<GrantedAuthority> authorities; private Collection<GrantedAuthority> authorities;
@JsonIgnore @JsonIgnore
...@@ -65,7 +65,7 @@ public class AuthenticationUser implements UserDetails ...@@ -65,7 +65,7 @@ public class AuthenticationUser implements UserDetails
private String orglevel;//单位级别 private String orglevel;//单位级别
private String deptlevel;//部门级别 private String deptlevel;//部门级别
@JsonIgnore @JsonIgnore
private Map<String,String> userSessionParam;//用户自定义session值 private Map<String,Object> userSessionParam;//用户自定义session值
@JsonIgnore @JsonIgnore
private JSONObject orgInfo;//上下级组织信息 private JSONObject orgInfo;//上下级组织信息
...@@ -115,7 +115,7 @@ public class AuthenticationUser implements UserDetails ...@@ -115,7 +115,7 @@ public class AuthenticationUser implements UserDetails
return authuserdetail; return authuserdetail;
} }
public Map <String,String> getSessionParams() public Map <String,Object> getSessionParams()
{ {
if(this.sessionParams==null) if(this.sessionParams==null)
{ {
...@@ -139,7 +139,7 @@ public class AuthenticationUser implements UserDetails ...@@ -139,7 +139,7 @@ public class AuthenticationUser implements UserDetails
} }
return this.sessionParams; return this.sessionParams;
} }
private Map<String, String> getUserSessionParam() { private Map<String, Object> getUserSessionParam() {
if(userSessionParam!=null) if(userSessionParam!=null)
return userSessionParam; return userSessionParam;
else else
......
...@@ -104,7 +104,10 @@ public class SimpleUserService implements AuthenticationUserService{ ...@@ -104,7 +104,10 @@ public class SimpleUserService implements AuthenticationUserService{
JSONObject orgInfo=ouFeignClient.getOrgInfo(user.getLoginname()); JSONObject orgInfo=ouFeignClient.getOrgInfo(user.getLoginname());
if(orgInfo==null) if(orgInfo==null)
throw new RuntimeException("获取用户信息失败,请检查用户中心[IBZOU]中是否存在当前用户!"); throw new RuntimeException("获取用户信息失败,请检查用户中心[IBZOU]中是否存在当前用户!");
JSONObject curUser=orgInfo.getJSONObject("curuser");
user.setOrgInfo(orgInfo); user.setOrgInfo(orgInfo);
user.setMdeptid(curUser.getString("orgdept"));
user.setOrgid(curUser.getString("org"));
} }
} }
......
package cn.ibizlab.util.service;
import cn.ibizlab.util.filter.SearchContextBase;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import java.util.LinkedHashMap;
import java.util.Map;
@Slf4j
public class SearchContextHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
private static ObjectMapper objectMapper=new ObjectMapper();
@Override
public boolean supportsParameter(MethodParameter parameter) {
return SearchContextBase.class.isAssignableFrom(parameter.getParameterType());
}
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
Map<String, String[]> params = webRequest.getParameterMap();
LinkedHashMap<String,Object> set=new LinkedHashMap<>();
for (String key : params.keySet()) {
set.put(key,params.get(key)[0]);
}
String json=objectMapper.writeValueAsString(set);
return objectMapper.readValue(json,parameter.getParameterType());
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册