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

ibizdev提交

上级 35b39874
......@@ -25,6 +25,7 @@
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
"interactjs": "^1.9.4",
"moment": "^2.24.0",
"path-to-regexp": "^6.1.0",
"qs": "^6.9.1",
"rxjs": "^6.5.4",
......
......@@ -66,6 +66,7 @@ import AppColumnLink from './components/app-column-link/app-column-link.vue'
import AppDataUploadView from './components/app-data-upload/app-data-upload.vue'
import DropDownListDynamic from './components/dropdown-list-dynamic/dropdown-list-dynamic.vue'
import AppImagePreview from './components/app-image-preview/app-image-preview.vue'
import AppFormatData from './components/app-format-data/app-format-data.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
......@@ -141,5 +142,6 @@ export const AppComponents = {
v.component('app-data-upload', AppDataUploadView);
v.component('dropdown-list-dynamic', DropDownListDynamic);
v.component('app-image-preview', AppImagePreview);
v.component('app-format-data', AppFormatData);
},
};
\ No newline at end of file
.app-format-data{
display: inline-block;
}
\ No newline at end of file
<template>
<span class="app-format-data">
{{getcurValue()}}
</span>
</template>
<script lang = 'ts'>
import { Component, Vue, Prop } from 'vue-property-decorator';
import moment from "moment";
@Component({})
export default class AppFormatData extends Vue {
/**
* 格式化正则
*
* @type {string}
* @memberof AppFormatData
*/
@Prop({default:'YYYY-MM-DD HH:mm:ss'}) public format?:string;
/**
* 传入数据
*
* @type {*}
* @memberof AppFormatData
*/
@Prop() public data!:any;
/**
* 显示值
*
* @memberof AppFormatData
*/
getcurValue(){
return moment(this.data).format(this.format);
}
}
</script>
<style lang="less">
@import './app-format-data.less';
</style>
\ No newline at end of file
<template>
<radio-group class="app-radio-group" v-model="selectArray" >
<radio-group class="app-radio-group" v-model="value" >
<radio v-for="(_item,index) in items" :key = "index" :label="_item.value" :disabled="isDisabled || _item.disabled">
<span>{{Object.is(codelistType,'STATIC') ? $t('codelist.'+tag+'.'+_item.value) : _item.text}}</span>
</radio>
......@@ -25,39 +25,41 @@ export default class AppRadioGroup extends Vue {
* @type {*}
* @memberof AppRadioGroup
*/
@Model('change') value?: any;
@Model('change') item?: any;
/**
* 代码表标识
* 获取值
*
* @type {string}
* @memberof AppRadioGroup
*/
@Prop() public tag?: string;
get value() {
return this.item;
}
/**
* 代码表类型
* 设置值
*
* @type {string}
* @memberof AppRadioGroup
*/
@Prop() public codelistType?: string;
set value(val: any) {
this.$emit('change', val);
}
/**
* 代码表值分隔符
* 代码表标识
*
* @type {string}
* @memberof AppRadioGroup
*/
@Prop({default:';'}) public valueSeparator?: string;
@Prop() public tag?: string;
/**
* 模式(数字或者字符串)
* 代码表类型
*
* @type {*}
* @memberof AppCheckBox
* @type {string}
* @memberof AppRadioGroup
*/
@Prop({default:'str'}) mode: any;
@Prop() public codelistType?: string;
/**
* 是否禁用
......@@ -113,59 +115,6 @@ export default class AppRadioGroup extends Vue {
})
}
}
/**
* 选中数组
*
* @memberof AppRadioGroup
*/
get selectArray() {
if (this.value) {
if (Object.is(this.mode, 'num') && this.items) {
let selectsArray: Array<any> = [];
let num: number = parseInt(this.value, 10);
this.items.forEach((item: any) => {
if ((num & item.value) == item.value) {
selectsArray.push(item.value);
}
});
return selectsArray;
} else if (Object.is(this.mode, 'str')) {
if (this.value !== '') {
return this.value.split(this.valueSeparator);
}
}
} else {
return [];
}
}
/**
* 设置选中
*
* @memberof AppRadioGroup
*/
set selectArray(val: any) {
let value: null | string | number = null;
if (Object.is(this.mode, 'num')) {
let temp: number = 0;
val.forEach((item: any) => {
temp = temp | parseInt(item, 10);
});
value = temp;
} else if (Object.is(this.mode, 'str')) {
let _datas: string[] = [];
this.items.forEach((item: any) => {
const index = val.findIndex((_key: any) => Object.is(item.value, _key));
if (index === -1) {
return;
}
_datas.push(item.value);
});
value = _datas.join(this.valueSeparator);
}
this.$emit('change', value);
}
}
</script>
<style lang="less">
......
.app-span{
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
overflow: hidden;
}
<template>
<codelist v-if="tag" :tag="tag" :value="value" :codelistType="codelistType" :renderMode="renderMode" :valueSeparator="valueSeparator" :textSeparator="textSeparator"></codelist>
<span v-else >{{text}}</span>
<span class="app-span" v-else >{{text}}</span>
</template>
<script lang="ts">
......@@ -39,7 +39,7 @@ export default class DropDownList extends Vue {
* @type {boolean}
* @memberof SelectPicker
*/
@Prop() public renderMode?: string;
@Prop({default:"STR"}) public renderMode?: string;
/**
* 文本分隔符
......@@ -92,12 +92,12 @@ export default class DropDownList extends Vue {
}
/**
* 加载代码表
* 处理数据
*
* @memberof AppSpan
*/
public load(){
if(this.tag){
if(!this.value || this.tag){
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);
......
......@@ -54,7 +54,7 @@ export default class CodeList extends Vue {
* @type {boolean}
* @memberof SelectPicker
*/
@Prop() public renderMode?: string;
@Prop({default:"STR"}) public renderMode?: string;
/**
* 文本分隔符
......@@ -213,5 +213,10 @@ export default class CodeList extends Vue {
</script>
<style lang='less'>
.codelist {
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
overflow: hidden;
}
</style>
\ No newline at end of file
......@@ -68,7 +68,7 @@
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('ibzdictitem.main_grid.columns.updatedate')" :width="250" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.updatedate}}</span>
<app-format-data format="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS" :data="row.updatedate"></app-format-data>
</template>
</el-table-column>
</template>
......
......@@ -33,7 +33,7 @@
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('ibzdict.main_grid.columns.updatedate')" :width="250" :align="'left'" :sortable="'custom'">
<template v-slot="{row,column}">
<span>{{row.updatedate}}</span>
<app-format-data format="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS" :data="row.updatedate"></app-format-data>
</template>
</el-table-column>
</template>
......
......@@ -6965,7 +6965,7 @@ mockjs@^1.1.0:
dependencies:
commander "*"
moment@2.24.0:
moment@2.24.0, moment@^2.24.0:
version "2.24.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
......
......@@ -23,13 +23,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IIBZDictItemService extends IService<IBZDictItem>{
IBZDictItem get(String itemId) ;
IBZDictItem get(IBZDictItem iBZDictItem) ;
IBZDictItem getDraft(IBZDictItem iBZDictItem) ;
boolean checkKey(IBZDictItem iBZDictItem) ;
boolean remove(String itemId) ;
boolean create(IBZDictItem iBZDictItem) ;
boolean update(IBZDictItem iBZDictItem) ;
IBZDictItem get(String key) ;
IBZDictItem getDraft(IBZDictItem et) ;
boolean save(IBZDictItem et) ;
void saveBatch(List<IBZDictItem> list, int batchSize) ;
boolean checkKey(IBZDictItem et) ;
boolean Remove(String key) ;
void removeBatch(Collection<String> idList, int batchSize) ;
boolean create(IBZDictItem et) ;
void createBatch(List<IBZDictItem> list, int batchSize) ;
boolean update(IBZDictItem et) ;
void updateBatch(List<IBZDictItem> list, int batchSize) ;
Page<IBZDictItem> searchDefault(IBZDictItemSearchContext context) ;
}
......
......@@ -23,13 +23,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IIBZDictService extends IService<IBZDict>{
IBZDict get(String dictId) ;
IBZDict get(IBZDict iBZDict) ;
boolean create(IBZDict iBZDict) ;
boolean checkKey(IBZDict iBZDict) ;
IBZDict getDraft(IBZDict iBZDict) ;
boolean update(IBZDict iBZDict) ;
boolean remove(String dictId) ;
IBZDict get(String key) ;
boolean create(IBZDict et) ;
void createBatch(List<IBZDict> list, int batchSize) ;
boolean checkKey(IBZDict et) ;
IBZDict getDraft(IBZDict et) ;
boolean update(IBZDict et) ;
void updateBatch(List<IBZDict> list, int batchSize) ;
boolean Remove(String key) ;
void removeBatch(Collection<String> idList, int batchSize) ;
boolean save(IBZDict et) ;
void saveBatch(List<IBZDict> list, int batchSize) ;
Page<IBZDict> searchDefault(IBZDictSearchContext context) ;
}
......
......@@ -44,25 +44,24 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
@Override
@Transactional
public IBZDictItem get(String itemid) {
IBZDictItem ibzdictitem = getById(itemid);
return ibzdictitem;
public IBZDictItem get(String key) {
IBZDictItem et = getById(key);
if(et==null)
{
et=new IBZDictItem();
et.setItemid(key);
}
@Override
@Transactional
public IBZDictItem get(IBZDictItem ibzdictitem) {
return null ;
return et;
}
@Override
public IBZDictItem getDraft(IBZDictItem ibzdictitem) {
return ibzdictitem;
public IBZDictItem getDraft(IBZDictItem et) {
return et;
}
@Override
public boolean checkKey(IBZDictItem ibzdictitem) {
public boolean checkKey(IBZDictItem et) {
return true;
}
@Override
......@@ -75,17 +74,17 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
}
@Override
@Transactional
public boolean create(IBZDictItem ibzdictitem) {
boolean bOk = false ;
bOk = save(ibzdictitem);
return bOk ;
public boolean create(IBZDictItem et) {
boolean ret = this.retBool(this.baseMapper.insert(et));
if(!ret) return ret;
return ret ;
}
@Override
@Transactional
public boolean update(IBZDictItem ibzdictitem) {
public boolean update(IBZDictItem et) {
boolean bOk = false ;
bOk = update(ibzdictitem, (Wrapper)ibzdictitem.getUpdateWrapper(true).eq("ibzdictitemid",ibzdictitem.getItemId()));
bOk = update(et, (Wrapper)et.getUpdateWrapper(true).eq("ibzdictitemid",et.getItemId()));
return bOk ;
}
......
......@@ -44,39 +44,47 @@ public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> impl
@Override
@Transactional
public IBZDict get(String dictid) {
IBZDict ibzdict = getById(dictid);
return ibzdict;
public IBZDict get(String key) {
IBZDict et = getById(key);
if(et==null)
{
et=new IBZDict();
et.setDictid(key);
}
@Override
@Transactional
public IBZDict get(IBZDict ibzdict) {
return null ;
return et;
}
@Override
@Transactional
public boolean create(IBZDict ibzdict) {
boolean bOk = false ;
bOk = save(ibzdict);
return bOk ;
public boolean create(IBZDict et) {
boolean ret = this.retBool(this.baseMapper.insert(et));
if(!ret) return ret;
//嵌套[字典项目]
if(et.getItems()!=null){
for (cn.ibizlab.core.dict.domain.IBZDictItem sub: et.getItems()) {
sub.setDictid(et.getDictid())
}
if(et.getItems().size()>0)
ibzdictitemService.createBatch(sub,500) ;
et.setItems(null);
}
return ret ;
}
@Override
public boolean checkKey(IBZDict ibzdict) {
public boolean checkKey(IBZDict et) {
return true;
}
@Override
public IBZDict getDraft(IBZDict ibzdict) {
return ibzdict;
public IBZDict getDraft(IBZDict et) {
return et;
}
@Override
@Transactional
public boolean update(IBZDict ibzdict) {
public boolean update(IBZDict et) {
boolean bOk = false ;
bOk = update(ibzdict, (Wrapper)ibzdict.getUpdateWrapper(true).eq("ibzdictid",ibzdict.getDictId()));
bOk = update(et, (Wrapper)et.getUpdateWrapper(true).eq("ibzdictid",et.getDictId()));
return bOk ;
}
@Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册