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

ibizdev提交

上级 525e883f
......@@ -68,6 +68,7 @@ import DropDownListDynamic from './components/dropdown-list-dynamic/dropdown-lis
import AppImagePreview from './components/app-image-preview/app-image-preview.vue'
import AppFormatData from './components/app-format-data/app-format-data.vue'
import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file-info.vue'
import ContextMenu from './components/context-menu/context-menu'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
......@@ -145,5 +146,6 @@ export const AppComponents = {
v.component('app-image-preview', AppImagePreview);
v.component('app-format-data', AppFormatData);
v.component('app-upload-file-info', AppUploadFileInfo);
v.component('context-menu',ContextMenu);
},
};
\ No newline at end of file
......@@ -17,6 +17,22 @@ export default class AppFormatData extends Vue {
*/
@Prop({default:'YYYY-MM-DD HH:mm:ss'}) public format?:string;
/**
* 类型格式
*
* @type {string}
* @memberof AppFormatData
*/
@Prop() public dataType?:string;
/**
* 精度
*
* @type {string}
* @memberof AppFormatData
*/
@Prop({default:'2'}) public precision?:string;
/**
* 传入数据
*
......@@ -32,7 +48,30 @@ export default class AppFormatData extends Vue {
*/
getcurValue(){
if(this.data){
if(this.format){
if(Object.is(this.dataType,"DECIMAL") || Object.is(this.dataType,"FLOAT") || Object.is(this.dataType,"CURRENCY")){
let number = Number(this.data);
let precision = Number(this.precision);
if(Object.is(number,NaN)){
return this.data;
}else{
let result = "";
if(Object.is(this.dataType,"CURRENCY")){
result = Number(number.toFixed((Object.is(precision,NaN) ? 2 : precision))).toLocaleString('en-US');
}else{
result = number.toFixed((Object.is(precision,NaN) ? 2 : precision));
}
let index = result.indexOf(".");
let fornum = (Object.is(precision,NaN) ? 2 : precision) - result.length + index + 1;
if(Object.is(index,-1) && !Object.is(precision,0)){
result += ".";
}
for (let i = 0; i < fornum; i++) {
result += '0';
}
return result;
}
} else if (this.format){
if(this.format.indexOf('%1$t') !== -1){
return moment(this.data).format("YYYY-MM-DD HH:mm:ss");
}else{
......
.context-menu-container {
// width: 100vw;
// height: 100vh;
// z-index: -10000;
// position: absolute;
// top: 0;
// left: 0;
line-height: 1;
.context-menu-content {
z-index: 10001;
position: absolute;
background: #FFF;
// border: 1px solid #e3e3e3;
}
.context-menus {
.context-menus-item {
list-style: none;
line-height: 36px;
padding: 0 13px;
margin: 0;
font-size: 14px;
color: #606266;
cursor: pointer;
outline: none;
display: flex;
.icon {
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
width: 20px;
margin-right: 8px;
}
}
.context-menus-item:hover {
background-color: #ecf5ff;
color: #66b1ff;
}
}
}
.context-menu {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
\ No newline at end of file
class ContextMenuService {
/**
* 容器Dom对象
*
* @private
* @memberof ContextMenuService
*/
private container: Element | undefined;
/**
* Creates an instance of ContextMenuService.
* @memberof ContextMenuService
*/
constructor() {
document.addEventListener('click', () => {
this.clearContainer();
});
}
/**
* 设置容器
*
* @param {Element} container
* @memberof ContextMenuService
*/
public setContainer(container: Element) {
if (container) {
this.clearContainer();
this.container = container;
} else {
console.error('容器Dom节点不存在');
}
}
/**
* 清楚容器
*
* @memberof ContextMenuService
*/
public clearContainer() {
if (this.container) {
this.container.remove();
}
}
}
const service = new ContextMenuService();
import { Vue, Component, Provide, Prop, Emit } from 'vue-property-decorator';
import './context-menu.less';
@Component({})
export default class ContextMenu extends Vue {
/**
* 设置右键菜单Class
*
* @type {string}
* @memberof ContextMenu
*/
@Prop()
public contextMenuClass?: string;
/**
* 设置右键菜单Style
*
* @type {*}
* @memberof ContextMenu
*/
@Prop()
public contextMenuStyle?: any;
/**
* 右键菜单数据,在调用renderContent时会传回去。
*
* @type {*}
* @memberof ContextMenu
*/
@Prop()
public data?: any;
/**
* 用于绘制右键菜单内容
*
* @type {any}
* @memberof ContextMenu
*/
@Prop()
public renderContent?: any;
/**
* 菜单数据
*
* @type {any[]}
* @memberof ContextMenu
*/
@Prop()
public menus?: any[]
/**
* 显示右键菜单
*
* @param {*} x x轴坐标
* @param {*} y y轴坐标
*/
public showContextMenu(x: number, y: number) {
// 创建全屏覆盖容器
const container = document.createElement('div');
service.setContainer(container);
container.oncontextmenu = () => {
container.remove();
};
document.body.appendChild(container);
// 创建Vue实例挂载
const mount = document.createElement('div');
container.appendChild(mount);
this.renderContextMenu({
top: y + 'px',
left: x + 'px'
}, mount, container);
}
/**
* 绘制菜单
*
* @param {*} position 菜单显示位置
* @param {*} mount Vue实例挂载
* @param {*} container 容器
* @returns
*/
public renderContextMenu(position: any, mount: any, container: any) {
const self = this;
new Vue({
data() {
return {
menus: self.menus
};
},
methods: {
destroy($event: Event) {
container.remove();
this.$destroy();
$event.stopPropagation();
},
onContextMenu($event: any) {
$event.preventDefault();
},
renderContent() {
let menus;
if (this.menus) {
menus = this.menus.map((item) => {
let icon;
if (item.icon) {
icon = <img src={item.icon} />;
}
if (item.iconcls) {
icon = <i class={item.iconcls}></i>;
}
return (
<li class='context-menus-item' on-click={() => self.menuClick(item, self.data)}>
{icon ? <div class="icon">{icon}</div> : null}
<div class="text">{item.text}</div>
</li>
);
});
}
return <ul class='context-menus'>{menus}</ul>;
}
},
render() {
let content;
if (self.renderContent) {
content = self.renderContent(self.data);
}
if (self.$slots.content) {
content = self.$slots.content;
}
if (this.menus) {
content = this.renderContent();
}
return (
<div class='context-menu-container context-menu' on-contextmenu={($event: any) => this.onContextMenu($event)} on-click={($event: Event) => this.destroy($event)}>
<div class='context-menu-content' style={position}>
{content}
</div>
</div>
);
}
}).$mount(mount);
}
/**
* 组件挂在完毕
*
* @memberof ContextMenu
*/
public mounted() {
const contextRef: any = this.$refs.context;
if (contextRef) {
contextRef.oncontextmenu = (event: MouseEvent) => {
event.preventDefault();
this.showContextMenu(event.clientX, event.clientY);
};
}
}
/**
* 菜单点击
*
* @param {*} data
* @memberof ContextMenu
*/
@Emit('menu-click')
public menuClick(item: any, data: any) { }
/**
* 绘制内容
*
* @returns
* @memberof ContextMenu
*/
public render() {
return (
<div class={'context-menu-component ' + this.contextMenuClass} style={this.contextMenuStyle} ref='context'>
{this.$slots.default}
</div>
);
}
}
\ No newline at end of file
......@@ -155,7 +155,7 @@ export default class EntityService {
public async CreateTemp(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME),'undefined')){
let tempData:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME) as any);
data[this.APPDEKEY] = null;
data.srffrontuf = "0";
tempData.push(data);
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData));
return {"status":200,"data":data};
......
......@@ -79,6 +79,13 @@ export default class IBZDictServiceBase extends EntityService {
let ibzdictitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_ibzdictitems'),'undefined')){
ibzdictitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_ibzdictitems') as any);
if(ibzdictitemsData && ibzdictitemsData.length && ibzdictitemsData.length > 0){
ibzdictitemsData.forEach((item:any) => {
if(Object.is(item.srffrontuf,"0")){
item.itemid = null;
}
});
}
}
masterData.ibzdictitems = ibzdictitemsData;
Object.assign(data,masterData);
......@@ -132,6 +139,13 @@ export default class IBZDictServiceBase extends EntityService {
let ibzdictitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_ibzdictitems'),'undefined')){
ibzdictitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_ibzdictitems') as any);
if(ibzdictitemsData && ibzdictitemsData.length && ibzdictitemsData.length > 0){
ibzdictitemsData.forEach((item:any) => {
if(Object.is(item.srffrontuf,"0")){
item.itemid = null;
}
});
}
}
masterData.ibzdictitems = ibzdictitemsData;
Object.assign(data,masterData);
......@@ -168,6 +182,13 @@ export default class IBZDictServiceBase extends EntityService {
let ibzdictitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_ibzdictitems'),'undefined')){
ibzdictitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_ibzdictitems') as any);
if(ibzdictitemsData && ibzdictitemsData.length && ibzdictitemsData.length > 0){
ibzdictitemsData.forEach((item:any) => {
if(Object.is(item.srffrontuf,"0")){
item.itemid = null;
}
});
}
}
masterData.ibzdictitems = ibzdictitemsData;
Object.assign(data,masterData);
......
......@@ -19,6 +19,12 @@ export default class DefaultModel {
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'n_ibzdictitemname_like',
prop: 'itemname',
......
......@@ -382,6 +382,14 @@ export default class MainBase extends Vue implements ControlInterface {
*/
protected drcounter: number = 0;
/**
* 需要等待关系界面保存时,第一次调用save参数的备份
*
* @type {number}
* @memberof Main
*/
protected drsaveopt: any = {};
/**
* 表单保存回调存储对象
*
......@@ -1304,7 +1312,6 @@ export default class MainBase extends Vue implements ControlInterface {
protected async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
opt.saveEmit = opt.saveEmit === undefined ? true :false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
return;
......@@ -1316,6 +1323,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (ifStateNext) {
this.drcounter = 0;
if(this.drcounter !== 0){
this.drsaveopt = opt;
this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
this.saveState = resolve;
return;
......@@ -1339,9 +1347,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'save');
if(!opt.saveEmit){
this.$emit('save', data);
}
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......@@ -1662,8 +1668,9 @@ export default class MainBase extends Vue implements ControlInterface {
if(this.drcounter > 0){
return;
}
this.save({}, undefined, false).then((res) =>{
this.save(this.drsaveopt, undefined, false).then((res) =>{
this.saveState(res);
this.drsaveopt = {};
if(Object.is(_this.currentAction, "saveAndNew")){
_this.ResetData(res);
_this.loadDraft({});
......
......@@ -19,6 +19,12 @@ export default class MainModel {
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
......
......@@ -72,9 +72,6 @@
</template>
</el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
<row class='grid-pagination' v-show="items.length > 0">
<page class='pull-right' @on-change="pageOnChange($event)"
......@@ -1301,17 +1298,6 @@ export default class MainBase extends Vue implements ControlInterface {
return column.show ? true : false;
}
/**
* 表格列是否自适应布局
*
* @readonly
* @type {boolean}
* @memberof Main
*/
get adaptiveState(): boolean {
return !this.allColumns.find((column: any) => column.show && Object.is(column.util, 'STAR'));
}
/**
* 保存
*
......
......@@ -120,7 +120,13 @@ export default class MainModel {
{
name:'srfparentdata',
prop:'srfparentdata'
}
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
......
......@@ -19,6 +19,12 @@ export default class DefaultModel {
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'n_ibzdictid_like',
prop: 'dictid',
......
......@@ -345,6 +345,14 @@ export default class MainBase extends Vue implements ControlInterface {
*/
protected drcounter: number = 0;
/**
* 需要等待关系界面保存时,第一次调用save参数的备份
*
* @type {number}
* @memberof Main
*/
protected drsaveopt: any = {};
/**
* 表单保存回调存储对象
*
......@@ -1120,7 +1128,6 @@ export default class MainBase extends Vue implements ControlInterface {
protected async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
opt.saveEmit = opt.saveEmit === undefined ? true :false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
return;
......@@ -1132,6 +1139,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (ifStateNext) {
this.drcounter = 0;
if(this.drcounter !== 0){
this.drsaveopt = opt;
this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
this.saveState = resolve;
return;
......@@ -1155,9 +1163,7 @@ export default class MainBase extends Vue implements ControlInterface {
const data = response.data;
this.onFormLoad(data,'save');
if(!opt.saveEmit){
this.$emit('save', data);
}
this.$emit('save', data);
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$nextTick(() => {
this.formState.next({ type: 'save', data: data });
......@@ -1478,8 +1484,9 @@ export default class MainBase extends Vue implements ControlInterface {
if(this.drcounter > 0){
return;
}
this.save({}, undefined, false).then((res) =>{
this.save(this.drsaveopt, undefined, false).then((res) =>{
this.saveState(res);
this.drsaveopt = {};
if(Object.is(_this.currentAction, "saveAndNew")){
_this.ResetData(res);
_this.loadDraft({});
......
......@@ -19,6 +19,12 @@ export default class MainModel {
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
......
......@@ -37,9 +37,6 @@
</template>
</el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
<row class='grid-pagination' v-show="items.length > 0">
<page class='pull-right' @on-change="pageOnChange($event)"
......@@ -1231,17 +1228,6 @@ export default class MainBase extends Vue implements ControlInterface {
return column.show ? true : false;
}
/**
* 表格列是否自适应布局
*
* @readonly
* @type {boolean}
* @memberof Main
*/
get adaptiveState(): boolean {
return !this.allColumns.find((column: any) => column.show && Object.is(column.util, 'STAR'));
}
/**
* 保存
*
......
......@@ -95,7 +95,13 @@ export default class MainModel {
{
name:'srfparentdata',
prop:'srfparentdata'
}
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
......
......@@ -19,7 +19,9 @@ import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.context.annotation.Profile;
@Profile("web-prod")
@Configuration
@EnableWebSecurity
public class webSecurityConfig extends WebSecurityConfigurerAdapter {
......
......@@ -109,7 +109,6 @@ public class IBZDictItemResource {
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZDictItem" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdictitems/fetchdefault")
public ResponseEntity<List<IBZDictItemDTO>> fetchDefault(IBZDictItemSearchContext context) {
Page<IBZDictItem> domains = ibzdictitemService.searchDefault(context) ;
List<IBZDictItemDTO> list = ibzdictitemMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
......@@ -122,7 +121,6 @@ public class IBZDictItemResource {
@ApiOperation(value = "searchDEFAULT", tags = {"IBZDictItem" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdictitems/searchdefault")
public ResponseEntity<Page<IBZDictItemDTO>> searchDefault(IBZDictItemSearchContext context) {
Page<IBZDictItem> domains = ibzdictitemService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzdictitemMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
......@@ -194,7 +192,6 @@ public class IBZDictItemResource {
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZDictItem" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/fetchdefault")
public ResponseEntity<List<IBZDictItemDTO>> fetchIBZDictItemDefault(@PathVariable("ibzdict_id") String ibzdict_id,IBZDictItemSearchContext context) {
context.setN_dictid_eq(ibzdict_id);
Page<IBZDictItem> domains = ibzdictitemService.searchDefault(context) ;
List<IBZDictItemDTO> list = ibzdictitemMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
......@@ -207,7 +204,6 @@ public class IBZDictItemResource {
@ApiOperation(value = "searchDEFAULT", tags = {"IBZDictItem" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/searchdefault")
public ResponseEntity<Page<IBZDictItemDTO>> searchIBZDictItemDefault(@PathVariable("ibzdict_id") String ibzdict_id,IBZDictItemSearchContext context) {
context.setN_dictid_eq(ibzdict_id);
Page<IBZDictItem> domains = ibzdictitemService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzdictitemMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
......
......@@ -109,7 +109,6 @@ public class IBZDictResource {
@ApiOperation(value = "fetchDEFAULT", tags = {"IBZDict" } ,notes = "fetchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdicts/fetchdefault")
public ResponseEntity<List<IBZDictDTO>> fetchDefault(IBZDictSearchContext context) {
Page<IBZDict> domains = ibzdictService.searchDefault(context) ;
List<IBZDictDTO> list = ibzdictMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
......@@ -122,7 +121,6 @@ public class IBZDictResource {
@ApiOperation(value = "searchDEFAULT", tags = {"IBZDict" } ,notes = "searchDEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdicts/searchdefault")
public ResponseEntity<Page<IBZDictDTO>> searchDefault(IBZDictSearchContext context) {
Page<IBZDict> domains = ibzdictService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzdictMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册