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

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

上级 39df1c66
......@@ -1987,6 +1987,8 @@ export default {
treeexp_treeview: {
nodata:"",
nodes: {
orderstatus: "订单状态",
ordertype: "订单类型",
root: "默认根节点",
},
uiactions: {
......
......@@ -1986,6 +1986,8 @@ export default {
treeexp_treeview: {
nodata:"",
nodes: {
orderstatus: "订单状态",
ordertype: "订单类型",
root: "默认根节点",
},
uiactions: {
......
......@@ -739,6 +739,7 @@ export const viewstate: any = {
viewaction: '',
viewdatachange: false,
refviews: [
'ac9add3724d90fba46e7298ac051fa5f',
],
},
{
......
......@@ -15,11 +15,6 @@
<template slot="empty">
{{$t('entities.ibizbook.treetable_treegridex.nodata')}}
</template>
<el-table-column show-overflow-tooltip prop="author" label="作者" :width="50" :align="''">
<template v-slot="{ row }">
<span>{{ getColumnValue(row, 'author') }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="subtext" label="图书描述" :width="50" :align="''">
<template v-slot="{ row }">
<span>{{ getColumnValue(row, 'subtext') }}</span>
......@@ -30,6 +25,11 @@
<span>{{ getColumnValue(row, 'ibizbookname') }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="author" label="作者" :width="50" :align="''">
<template v-slot="{ row }">
<span>{{ getColumnValue(row, 'author') }}</span>
</template>
</el-table-column>
</el-table>
</template>
......
......@@ -4,6 +4,7 @@ import IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import TreeExpModel from './tree-exp-treeview-model';
import CodeListService from "@/codelist/codelist-service";
import i18n from '@/locale';
import IBIZOrderTypeService from '@service/ibizorder-type/ibizorder-type-service';
/**
......@@ -53,6 +54,14 @@ export default class TreeExpService extends ControlService {
public codeListService:CodeListService = new CodeListService({ $store: this.getStore() });
/**
* 订单类型服务对象
*
* @type {IBIZOrderTypeService}
* @memberof TreeExpService
*/
public ibizordertypeService: IBIZOrderTypeService = new IBIZOrderTypeService({ $store: this.getStore() });
/**
* 节点分隔符号
*
......@@ -62,6 +71,33 @@ export default class TreeExpService extends ControlService {
*/
public TREENODE_SEPARATOR: string = ';';
/**
* 订单状态节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_ORDERSTATUS: string = 'orderstatus';
/**
* 订单类型节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_ORDERTYPE: string = 'orderType';
/**
* 订单状态代码表节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_ORDERSTATUSDATA: string = 'orderStatusData';
/**
* 默认根节点节点分隔符号
*
......@@ -71,6 +107,15 @@ export default class TreeExpService extends ControlService {
*/
public TREENODE_ROOT: string = 'ROOT';
/**
* 订单类型实体节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_ORDERTYPEDATA: string = 'orderTypeData';
/**
* 获取节点数据
*
......@@ -145,13 +190,251 @@ export default class TreeExpService extends ControlService {
}
}
if (Object.is(strNodeType, this.TREENODE_ORDERSTATUS)) {
await this.fillOrderstatusNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_ORDERTYPE)) {
await this.fillOrdertypeNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_ORDERSTATUSDATA)) {
await this.fillOrderstatusdataNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_ROOT)) {
await this.fillRootNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_ORDERTYPEDATA)) {
await this.fillOrdertypedataNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
return Promise.resolve({ status: 500, data: { title: '失败', message: `树节点${strTreeNodeId}标识无效` } });
}
/**
* 填充 树视图节点[订单状态]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillOrderstatusNodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
let treeNode: any = {};
Object.assign(treeNode, { text: i18n.t('entities.ibizorder.treeexp_treeview.nodes.orderstatus') });
Object.assign(treeNode, { isUseLangRes: true });
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = 'orderstatus';
// 没有指定节点值,直接使用父节点值
Object.assign(treeNode, { srfkey: filter.strRealNodeId });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += filter.strRealNodeId;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isAutoexpand });
Object.assign(treeNode, { leaf: false });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "STATIC" });
list.push(treeNode);
resolve(list);
});
}
/**
* 填充 树视图节点[订单状态]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillOrderstatusNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充订单状态代码表
let OrderstatusdataRsNavContext:any = {};
let OrderstatusdataRsNavParams:any = {};
let OrderstatusdataRsParams:any = {};
await this.fillOrderstatusdataNodes(context, filter, list ,OrderstatusdataRsNavContext,OrderstatusdataRsNavParams,OrderstatusdataRsParams);
} else {
// 填充订单状态代码表
let OrderstatusdataRsNavContext:any = {};
let OrderstatusdataRsNavParams:any = {};
let OrderstatusdataRsParams:any = {};
await this.fillOrderstatusdataNodes(context, filter, list ,OrderstatusdataRsNavContext,OrderstatusdataRsNavParams,OrderstatusdataRsParams);
}
}
/**
* 填充 树视图节点[订单类型]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillOrdertypeNodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
let treeNode: any = {};
Object.assign(treeNode, { text: i18n.t('entities.ibizorder.treeexp_treeview.nodes.ordertype') });
Object.assign(treeNode, { isUseLangRes: true });
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = 'orderType';
// 没有指定节点值,直接使用父节点值
Object.assign(treeNode, { srfkey: filter.strRealNodeId });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += filter.strRealNodeId;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isAutoexpand });
Object.assign(treeNode, { leaf: false });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "STATIC" });
list.push(treeNode);
resolve(list);
});
}
/**
* 填充 树视图节点[订单类型]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillOrdertypeNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充订单类型实体
let OrdertypedataRsNavContext:any = {};
let OrdertypedataRsNavParams:any = {};
let OrdertypedataRsParams:any = {};
await this.fillOrdertypedataNodes(context, filter, list ,OrdertypedataRsNavContext,OrdertypedataRsNavParams,OrdertypedataRsParams);
} else {
// 填充订单类型实体
let OrdertypedataRsNavContext:any = {};
let OrdertypedataRsNavParams:any = {};
let OrdertypedataRsParams:any = {};
await this.fillOrdertypedataNodes(context, filter, list ,OrdertypedataRsNavContext,OrdertypedataRsNavParams,OrdertypedataRsParams);
}
}
/**
* 填充 树视图节点[订单状态代码表]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillOrderstatusdataNodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
let codeListIems:Array<any> = [];
if (this.getStore()) {
codeListIems = (this.getStore() as any).getters.getCodeListItems('ORDERSTATE');
}
if(codeListIems && codeListIems.length >0){
const handleChildData = (context:any,item:any,) =>{
Object.assign(item,{srfappctx:context});
Object.assign(item, { text: i18n.t('codelist.ORDERSTATE.'+item.value) });
Object.assign(item, { isUseLangRes: true });
Object.assign(item, { srfmajortext: item.text });
let strNodeId: string = "orderStatusData";
Object.assign(item, { srfkey: item.value });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += item.value;
Object.assign(item, { id: strNodeId });
Object.assign(item, { expanded: filter.isautoexpand });
Object.assign(item, { nodeid: item.srfkey });
Object.assign(item, { nodeid2: item.pvalue });
Object.assign(item, { nodeType: 'STATIC' });
}
codeListIems = this.handleDataSet(JSON.parse(JSON.stringify(codeListIems)),context,handleChildData);
codeListIems.forEach((item:any) => {
let treeNode: any = {};
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { text: i18n.t('codelist.ORDERSTATE.'+item.value) });
Object.assign(treeNode, { isUseLangRes: true });
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = "orderStatusData";
Object.assign(treeNode, { srfkey: item.value });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += item.value;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isautoexpand });
Object.assign(treeNode, { leaf: true });
if(item.children && item.children.length >0){
Object.assign(treeNode, { children: item.children });
}
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: 'STATIC' });
list.push(treeNode);
resolve(list);
})
}else{
resolve(list);
}
});
}
/**
* 填充 树视图节点[订单状态代码表]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillOrderstatusdataNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
} else {
}
}
/**
* 填充 树视图节点[默认根节点]
*
......@@ -184,7 +467,7 @@ export default class TreeExpService extends ControlService {
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isAutoexpand });
Object.assign(treeNode, { leaf: true });
Object.assign(treeNode, { leaf: false });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "STATIC" });
......@@ -205,6 +488,159 @@ export default class TreeExpService extends ControlService {
*/
@Errorlog
public async fillRootNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充订单状态
let OrderstatusRsNavContext:any = {};
let OrderstatusRsNavParams:any = {};
let OrderstatusRsParams:any = {};
await this.fillOrderstatusNodes(context, filter, list ,OrderstatusRsNavContext,OrderstatusRsNavParams,OrderstatusRsParams);
// 填充订单类型
let OrdertypeRsNavContext:any = {};
let OrdertypeRsNavParams:any = {};
let OrdertypeRsParams:any = {};
await this.fillOrdertypeNodes(context, filter, list ,OrdertypeRsNavContext,OrdertypeRsNavParams,OrdertypeRsParams);
} else {
// 填充订单状态
let OrderstatusRsNavContext:any = {};
let OrderstatusRsNavParams:any = {};
let OrderstatusRsParams:any = {};
await this.fillOrderstatusNodes(context, filter, list ,OrderstatusRsNavContext,OrderstatusRsNavParams,OrderstatusRsParams);
// 填充订单类型
let OrdertypeRsNavContext:any = {};
let OrdertypeRsNavParams:any = {};
let OrdertypeRsParams:any = {};
await this.fillOrdertypeNodes(context, filter, list ,OrdertypeRsNavContext,OrdertypeRsNavParams,OrdertypeRsParams);
}
}
/**
* 填充 树视图节点[订单类型实体]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillOrdertypedataNodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
let searchFilter: any = {};
Object.assign(searchFilter, { total: false });
let bFirst: boolean = true;
let records: any[] = [];
try {
this.searchOrdertypedata(context, searchFilter, filter).then((records:any) =>{
if(records && records.length >0){
records.forEach((entity: any) => {
let treeNode: any = {};
// 整理context
let strId: string = entity.ibizordertypeid;
let strText: string = entity.ibizordertypename;
Object.assign(treeNode,{srfparentdename:'IBIZOrderType',srfparentkey:entity.ibizordertypeid});
let tempContext:any = JSON.parse(JSON.stringify(context));
Object.assign(tempContext,{srfparentdename:'IBIZOrderType',srfparentkey:entity.ibizordertypeid,ibizordertype:strId})
Object.assign(treeNode,{srfappctx:tempContext});
Object.assign(treeNode,{'ibizordertype':strId});
Object.assign(treeNode, { srfkey: strId });
Object.assign(treeNode, { text: strText, srfmajortext: strText });
let strNodeId: string = 'orderTypeData';
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += strId;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isautoexpand });
Object.assign(treeNode, { leaf: true });
Object.assign(treeNode, { curData: entity });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "DE",appEntityName:"ibizordertype" });
list.push(treeNode);
resolve(list);
bFirst = false;
});
}else{
resolve(list);
}
});
} catch (error) {
console.error(error);
}
});
}
/**
* 获取查询集合
*
* @public
* @param {any{}} context
* @param {*} searchFilter
* @param {*} filter
* @returns {any[]}
* @memberof TestEnetityDatasService
*/
@Errorlog
public searchOrdertypedata(context:any={}, searchFilter: any, filter: any): Promise<any> {
return new Promise((resolve:any,reject:any) =>{
if(filter.viewparams){
Object.assign(searchFilter,filter.viewparams);
}
if(!searchFilter.page){
Object.assign(searchFilter,{page:0});
}
if(!searchFilter.size){
Object.assign(searchFilter,{size:1000});
}
if(context && context.srfparentdename){
Object.assign(searchFilter,{srfparentdename:JSON.parse(JSON.stringify(context)).srfparentdename});
}
if(context && context.srfparentkey){
Object.assign(searchFilter,{srfparentkey:JSON.parse(JSON.stringify(context)).srfparentkey});
}
const _appEntityService: any = this.ibizordertypeService;
let list: any[] = [];
if (_appEntityService['FetchDefault'] && _appEntityService['FetchDefault'] instanceof Function) {
const response: Promise<any> = _appEntityService['FetchDefault'](context, searchFilter, false);
response.then((response: any) => {
if (!response.status || response.status !== 200) {
resolve([]);
console.log(JSON.stringify(context));
console.error('查询FetchDefault数据集异常!');
}
const data: any = response.data;
if (Object.keys(data).length > 0) {
list = JSON.parse(JSON.stringify(data));
resolve(list);
} else {
resolve([]);
}
}).catch((response: any) => {
resolve([]);
console.log(JSON.stringify(context));
console.error('查询FetchDefault数据集异常!');
});
}
})
}
/**
* 填充 树视图节点[订单类型实体]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillOrdertypedataNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
} else {
}
......
......@@ -330,6 +330,20 @@ export default class TreeExpViewtreeexpbarBase extends Vue implements ControlInt
if (!expmode) {
expmode = '';
}
if (Object.is(expmode, 'ORDERSTATUSDATA')) {
return {
viewname: 'ibizorder-grid-view9',
parentdata: {},
deKeyField:'ibizorder'
};
}
if (Object.is(expmode, 'ORDERTYPEDATA')) {
return {
viewname: 'ibizorder-grid-view9',
parentdata: {},
deKeyField:'ibizorder'
};
}
return null;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册