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

ShineKOT 发布系统代码 [后台服务,演示应用]

上级 927ddcf7
......@@ -230,6 +230,11 @@ export default {
uiactions: {
},
},
orderdetailstotal_list: {
nodata:"",
uiactions: {
},
},
histogram_chart: {
nodata:"",
},
......
......@@ -229,6 +229,11 @@ export default {
uiactions: {
},
},
orderdetailstotal_list: {
nodata:"",
uiactions: {
},
},
histogram_chart: {
nodata:"",
},
......
......@@ -330,6 +330,44 @@ mock.onPost(new RegExp(/^\/ibizbooks\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
console.groupEnd();
return [status, data];
});
// UpdatePress
mock.onPut(new RegExp(/^\/ibizbooks\/?([a-zA-Z0-9\-\;]{0,35})\/updatepress$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizbook 方法: UpdatePress");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['ibizbookid'];
const matchArray:any = new RegExp(/^\/ibizbooks\/([a-zA-Z0-9\-\;]{1,35})\/updatepress$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.ibizbookid, tempValue.ibizbookid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['ibizbookid'] == tempValue['ibizbookid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/ibizbooks\/fetchdefault$/)).reply((config: any) => {
......
......@@ -170,6 +170,20 @@ export default class IBIZBOOKServiceBase extends EntityService {
return res;
}
/**
* UpdatePress接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async UpdatePress(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().put(`/ibizbooks/${context.ibizbook}/updatepress`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......
......@@ -259,6 +259,20 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
*/
@Prop() public fetchAction!: string;
/**
* 打开新建数据视图
*
* @type {any}
* @memberof OrderDetailsListBase
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof OrderDetailsListBase
*/
@Prop() public opendata: any;
/**
* this引用
......@@ -487,7 +501,7 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
*/
public load(opt: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDashboardView' + (this.$t('app.list.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailListView' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
......@@ -600,7 +614,7 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDashboardView' + (this.$t('app.list.notConfig.removeAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailListView' + (this.$t('app.list.notConfig.removeAction') as string) });
return;
}
if (datas.length === 0) {
......@@ -695,7 +709,7 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDashboardView' + (this.$t('app.list.notConfig.createAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZOrderDetailListView' + (this.$t('app.list.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
......@@ -703,7 +717,7 @@ export default class OrderDetailsListBase extends Vue implements ControlInterfac
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: 'IBIZOrderDashboardView' + (this.$t('app.list.notConfig.updateAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: 'IBIZOrderDetailListView' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.ibizorderdetail){
......
......@@ -10,7 +10,7 @@ export default class OrderDetailsListModel {
* 获取数据项集合
*
* @returns {any[]}
* @memberof OrderDetailsListDashboard_sysportlet4_listMode
* @memberof OrderDetailsListListMode
*/
public getDataItems(): any[] {
return [
......
/**
* OrderDetailsTotal 部件模型
*
* @export
* @class OrderDetailsTotalModel
*/
export default class OrderDetailsTotalModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof OrderDetailsTotalDashboard_sysportlet4_listMode
*/
public getDataItems(): any[] {
return [
{
name: 'srftotal',
prop: 'quantity',
dataType: 'INT',
},
{
name: 'srfkey',
prop: 'ibizorderdetailid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'ibizorderdetailname',
dataType: 'TEXT',
},
{
name: 'ibizorderid',
prop: 'ibizorderid',
dataType: 'PICKUP',
},
{
name: 'ibizuniproductid',
prop: 'ibizuniproductid',
dataType: 'PICKUP',
},
{
name: 'ibizorderdetail',
prop: 'ibizorderdetailid',
dataType: 'FONTKEY',
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'sort',
prop:'sort'
},
{
name:'page',
prop:'page'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZOrderDetailService from '@/service/ibizorder-detail/ibizorder-detail-service';
import OrderDetailsTotalModel from './order-details-total-list-model';
/**
* OrderDetailsTotal 部件服务对象
*
* @export
* @class OrderDetailsTotalService
*/
export default class OrderDetailsTotalService extends ControlService {
/**
* 订单明细服务对象
*
* @type {IBIZOrderDetailService}
* @memberof OrderDetailsTotalService
*/
public appEntityService: IBIZOrderDetailService = new IBIZOrderDetailService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof OrderDetailsTotalService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of OrderDetailsTotalService.
*
* @param {*} [opts={}]
* @memberof OrderDetailsTotalService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new OrderDetailsTotalModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof OrderDetailsTotalService
*/
@Errorlog
public search(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then(async (response) => {
await this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof OrderDetailsTotalService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.remove(Context,Data , isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof OrderDetailsTotalService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof OrderDetailsTotalService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data,isloading);
}else{
result =_appEntityService.Update(Context,Data,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
\ No newline at end of file
// this is less
.app-list {
height:100%;
flex-grow: 1;
overflow-y: auto;
.el-collapse-item__header.is-active{
color: #409eff;
background-color: #ecf5ff;
}
.el-collapse{
.el-collapse-item{
.el-collapse-item__wrap{
.el-collapse-item__content{
padding: 10px 0 10px 0;
}
}
}
}
.app-list-item {
line-height: 34px;
padding: 12px 6px;
min-height: 24px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #f0f0f0;
.app-list-item-content {
width: 70%;
display: flex;
align-items: center;
.item-icon {
width: 40px;
height: 40px;
margin-right: 14px;
img {
width: 40px;
height: 40px;
border-radius: 50%;
}
}
.item-content-text {
display: flex;
flex-direction: column;
.item-text {
font-size: 18px;
font-weight: bold;
}
.item-subtext {
color: #8c8c8c;
}
}
}
.app-list-item-date {
position: relative;
color: #8c8c8c;
}
}
.app-list-item.isSelect {
background: #ecf5ff;
border-radius: 2px;
border-color: rgb(197, 197, 197);
}
.app-list-item:hover {
background: #ecf5ff;
}
.loadmore {
text-align: center;
padding: 10px;
text-decoration: underline;
color: #82bff7;
cursor: default;
}
}
.app-list-empty {
height:100%;
color: #909399;
display: flex;
justify-content: center;
align-items: center;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import OrderDetailsTotalBase from './order-details-total-list-base.vue';
@Component({
components: {
}
})
export default class OrderDetailsTotal extends OrderDetailsTotalBase {
}
</script>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZOrderDetailPortalComponentsList3Base from './portal-components-list3-portlet-base.vue';
import view_dashboard_sysportlet4_list from '@widgets/ibizorder-detail/order-details-list-list/order-details-list-list.vue';
import view_dashboard_sysportlet4_list from '@widgets/ibizorder-detail/order-details-total-list/order-details-total-list.vue';
@Component({
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.sample.service.impl.IBIZBOOKServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.sample.domain.IBIZBOOK;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[图书] 自定义服务对象
*/
@Slf4j
@Primary
@Service("IBIZBOOKExService")
public class IBIZBOOKExService extends IBIZBOOKServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* [UpdatePress:更新出版社] 行为扩展
* @param et
* @return
*/
@Override
@Transactional
public IBIZBOOK updatePress(IBIZBOOK et) {
return super.updatePress(et);
}
}
......@@ -36,6 +36,7 @@ public interface IIBIZBOOKService extends IService<IBIZBOOK> {
boolean checkKey(IBIZBOOK et);
boolean save(IBIZBOOK et);
void saveBatch(List<IBIZBOOK> list);
IBIZBOOK updatePress(IBIZBOOK et);
Page<IBIZBOOK> searchDefault(IBIZBOOKSearchContext context);
JSONObject importData(List<IBIZBOOK> entities, int batchSize, boolean isIgnoreError);
......
......@@ -150,6 +150,13 @@ public class IBIZBOOKServiceImpl extends ServiceImpl<IBIZBOOKMapper, IBIZBOOK> i
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public IBIZBOOK updatePress(IBIZBOOK et) {
//自定义代码
return et;
}
/**
......
......@@ -21,7 +21,7 @@
"delogicname":"图书",
"sysmoudle":{"id":"SAMPLE","name":"示例"},
"dedataset":[{"id":"Default" , "name":"数据集"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"UpdatePress" , "name":"更新出版社" , "type":"USERCUSTOM" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
......
......@@ -136,6 +136,17 @@ public class IBIZBOOKResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','DemoSys-IBIZBOOK-UpdatePress-all')")
@ApiOperation(value = "更新出版社", tags = {"图书" }, notes = "更新出版社")
@RequestMapping(method = RequestMethod.PUT, value = "/ibizbooks/{ibizbook_id}/updatepress")
public ResponseEntity<IBIZBOOKDTO> updatePress(@PathVariable("ibizbook_id") String ibizbook_id, @RequestBody IBIZBOOKDTO ibizbookdto) {
IBIZBOOK domain = ibizbookMapping.toDomain(ibizbookdto);
domain.setIbizbookid(ibizbook_id);
domain = ibizbookService.updatePress(domain);
ibizbookdto = ibizbookMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(ibizbookdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','DemoSys-IBIZBOOK-searchDefault-all') and hasPermission(#context,'DemoSys-IBIZBOOK-Get')")
@ApiOperation(value = "获取数据集", tags = {"图书" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/ibizbooks/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册