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

zhouweidong 发布系统代码 [ibz-dst,应用]

上级 24237821
......@@ -86,21 +86,43 @@ mock.onDelete(new RegExp(/^\/metamodels\/batch$/)).reply((config: any) => {
return [status, {}];
});
// exportFile
mock.onPost(new RegExp(/^\/metamodels\/exportfile$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/metamodels\/?([a-zA-Z0-9\-\;]{0,35})\/exportfile$/)).reply((config: any) => {
console.groupCollapsed("实体:metamodel 方法: exportFile");
console.table({url:config.url, method: config.method, data:config.data});
// exportFile
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/metamodels\/([a-zA-Z0-9\-\;]{1,35})\/exportfile$/).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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, data];
});
// Select
......
......@@ -386,7 +386,7 @@ export default class MetaModelGridViewBase extends Vue {
public toolBarModels: any = {
tbitem1_import: { name: 'tbitem1_import', actiontarget: 'NONE', caption: '模型导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'import', target: 'NONE' } },
tbitem1_export: { name: 'tbitem1_export', actiontarget: 'NONE', caption: '模型导出', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'export', target: 'MULTIKEY' } },
tbitem1_export: { name: 'tbitem1_export', actiontarget: 'NONE', caption: '模型导出', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'export', target: 'SINGLEKEY' } },
tbitem2: { name: 'tbitem2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem3: { name: 'tbitem3', actiontarget: 'NONE', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '' } },
......
......@@ -48,10 +48,8 @@ export default class MetaModelServiceBase extends EntityService {
* @memberof MetaModelServiceBase
*/
public async exportFile(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/metamodels/exportfile`,isloading);
res.data.metamodel = data.metamodel;
return res;
let res:any = Http.getInstance().get(`/metamodels/${context.metamodel}/exportfile`,data,isloading);
return res;
}
/**
......
......@@ -194,7 +194,7 @@ export default class MetaModelUIServiceBase extends UIService {
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'MULTIKEY';
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { metamodel: '%metamodel%' });
Object.assign(params, { id: '%metamodel%' });
Object.assign(params, { name: '%name%' });
......@@ -234,7 +234,7 @@ export default class MetaModelUIServiceBase extends UIService {
}
const backend = () => {
const curService:MetaModelService = new MetaModelService();
curService.exportFileBatch(context,data, true).then((response: any) => {
curService.exportFile(context,data, true).then((response: any) => {
if (!response || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: response.message });
return;
......
......@@ -328,7 +328,7 @@
<!--输出实体[META_MODEL]数据结构 -->
<changeSet author="root" id="tab-meta_model-68-12">
<changeSet author="root" id="tab-meta_model-69-12">
<createTable tableName="IBZMODEL">
<column name="MODELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_MODEL_MODELID"/>
......
......@@ -49,7 +49,7 @@ public class MetaModelResource {
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-MetaModel-ExportFile-all')")
@ApiOperation(value = "导出文件", tags = {"模型" }, notes = "导出文件")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels/{metamodel_id}/exportfile")
@RequestMapping(method = RequestMethod.GET, value = "/metamodels/{metamodel_id}/exportfile")
public ResponseEntity<Void> exportFile(@PathVariable("metamodel_id") String metamodel_id, @RequestBody MetaModelDTO metamodeldto) {
MetaModel domain = metamodelMapping.toDomain(metamodeldto);
domain.setId(metamodel_id);
......@@ -59,7 +59,7 @@ public class MetaModelResource {
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-MetaModel-ExportFile-all')")
@ApiOperation(value = "批量处理[导出文件]", tags = {"模型" }, notes = "批量处理[导出文件]")
@RequestMapping(method = RequestMethod.POST, value = "/metamodels/exportfilebatch")
@RequestMapping(method = RequestMethod.GET, value = "/metamodels/exportfilebatch")
public ResponseEntity<Void> exportFileBatch(@RequestBody List<MetaModelDTO> metamodeldtos) {
List<MetaModel> domains = metamodelMapping.toDomain(metamodeldtos);
boolean result = metamodelService.exportFileBatch(domains);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册