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

zoo457790531 发布系统代码 [ibz-lite,应用]

上级 d07b7c59
...@@ -128,6 +128,14 @@ function getLocaleResourceBase(){ ...@@ -128,6 +128,14 @@ function getLocaleResourceBase(){
}, },
}, },
gridviewtoolbar_toolbar: { gridviewtoolbar_toolbar: {
tbitem1_publish: {
caption: commonLogic.appcommonhandle("发布模型",null),
tip: commonLogic.appcommonhandle("发布模型",null),
},
tbitem2: {
caption: commonLogic.appcommonhandle("-",null),
tip: commonLogic.appcommonhandle("",null),
},
tbitem3: { tbitem3: {
caption: commonLogic.appcommonhandle("新建",null), caption: commonLogic.appcommonhandle("新建",null),
tip: commonLogic.appcommonhandle("新建",null), tip: commonLogic.appcommonhandle("新建",null),
......
...@@ -128,6 +128,14 @@ function getLocaleResourceBase(){ ...@@ -128,6 +128,14 @@ function getLocaleResourceBase(){
}, },
}, },
gridviewtoolbar_toolbar: { gridviewtoolbar_toolbar: {
tbitem1_publish: {
caption: commonLogic.appcommonhandle("发布模型",null),
tip: commonLogic.appcommonhandle("发布模型",null),
},
tbitem2: {
caption: commonLogic.appcommonhandle("-",null),
tip: commonLogic.appcommonhandle("",null),
},
tbitem3: { tbitem3: {
caption: commonLogic.appcommonhandle("New",null), caption: commonLogic.appcommonhandle("New",null),
tip: commonLogic.appcommonhandle("New",null), tip: commonLogic.appcommonhandle("New",null),
......
...@@ -128,6 +128,14 @@ function getLocaleResourceBase(){ ...@@ -128,6 +128,14 @@ function getLocaleResourceBase(){
}, },
}, },
gridviewtoolbar_toolbar: { gridviewtoolbar_toolbar: {
tbitem1_publish: {
caption: commonLogic.appcommonhandle("发布模型",null),
tip: commonLogic.appcommonhandle("发布模型",null),
},
tbitem2: {
caption: commonLogic.appcommonhandle("-",null),
tip: commonLogic.appcommonhandle("",null),
},
tbitem3: { tbitem3: {
caption: commonLogic.appcommonhandle("新建",null), caption: commonLogic.appcommonhandle("新建",null),
tip: commonLogic.appcommonhandle("新建",null), tip: commonLogic.appcommonhandle("新建",null),
......
...@@ -12,6 +12,14 @@ ...@@ -12,6 +12,14 @@
<i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;padding-left: 24px' placeholder="名称" /> <i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;padding-left: 24px' placeholder="名称" />
<div class='pull-right'> <div class='pull-right'>
<div class='toolbar-container'> <div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem1_publish.visabled" :disabled="toolBarModels.tbitem1_publish.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem1_publish' }, $event)">
<i class=''></i>
<span class='caption'>{{$t('entities.metadynamicmodel.gridviewtoolbar_toolbar.tbitem1_publish.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.metadynamicmodel.gridviewtoolbar_toolbar.tbitem1_publish.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600"> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem3' }, $event)"> <i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-file-text-o'></i> <i class='fa fa-file-text-o'></i>
...@@ -369,6 +377,9 @@ export default class MetaDynamicModelGridViewBase extends Vue { ...@@ -369,6 +377,9 @@ export default class MetaDynamicModelGridViewBase extends Vue {
* @memberof MetaDynamicModelGridView * @memberof MetaDynamicModelGridView
*/ */
public toolBarModels: any = { public toolBarModels: any = {
tbitem1_publish: { name: 'tbitem1_publish', actiontarget: 'NONE', caption: '发布模型', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'publish', 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: '' } }, tbitem3: { name: 'tbitem3', actiontarget: 'NONE', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '' } },
tbitem4: { name: 'tbitem4', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } }, tbitem4: { name: 'tbitem4', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
...@@ -744,6 +755,9 @@ export default class MetaDynamicModelGridViewBase extends Vue { ...@@ -744,6 +755,9 @@ export default class MetaDynamicModelGridViewBase extends Vue {
* @memberof MetaDynamicModelGridViewBase * @memberof MetaDynamicModelGridViewBase
*/ */
public toolbar_click($event: any, $event2?: any) { public toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem1_publish')) {
this.toolbar_tbitem1_publish_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem3')) { if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2); this.toolbar_tbitem3_click(null, '', $event2);
} }
...@@ -886,6 +900,35 @@ export default class MetaDynamicModelGridViewBase extends Vue { ...@@ -886,6 +900,35 @@ export default class MetaDynamicModelGridViewBase extends Vue {
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem1_publish_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
const curUIService:MetaDynamicModelUIService = new MetaDynamicModelUIService();
curUIService.MetaDynamicModel_publish(datas,contextJO, paramJO, $event, xData,this,"MetaDynamicModel");
}
/** /**
* 逻辑事件 * 逻辑事件
* *
......
...@@ -116,6 +116,87 @@ export default class MetaDynamicModelUIServiceBase extends UIService { ...@@ -116,6 +116,87 @@ export default class MetaDynamicModelUIServiceBase extends UIService {
public initDeMainStateOPPrivsMap(){ public initDeMainStateOPPrivsMap(){
} }
/**
* 发布模型
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async MetaDynamicModel_publish(args: any[],context:any = {}, params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { metadynamicmodel: '%metadynamicmodel%' });
Object.assign(params, { configid: '%metadynamicmodel%' });
Object.assign(params, { configname: '%configname%' });
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
if(Object.is(actionTarget,"MULTIKEY")){
let tempDataArray:Array<any> = [];
if((_args.length >1) && (Object.keys(data).length >0)){
for(let i =0;i<_args.length;i++){
let tempObject:any = {};
Object.keys(data).forEach((key:string) =>{
Object.assign(tempObject,{[key]:data[key].split(',')[i]});
})
tempDataArray.push(tempObject);
}
}else{
tempDataArray.push(data);
}
data = tempDataArray;
}
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
if(!Object.is(actionTarget,"MULTIKEY")){
Object.assign(data,parentObj);
}
Object.assign(context,parentObj);
// 直接调实体服务需要转换的数据
if(context && context.srfsessionid){
context.srfsessionkey = context.srfsessionid;
delete context.srfsessionid;
}
const backend = () => {
const curService:MetaDynamicModelService = new MetaDynamicModelService();
curService.Publish(context,data, true).then((response: any) => {
if (!response || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: response.message });
return;
}
actionContext.$Notice.success({ title: '成功', desc: '发布模型成功!' });
const _this: any = actionContext;
return response;
}).catch((response: any) => {
if (response && response.status && response.data) {
actionContext.$Notice.error({ title: (actionContext.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
actionContext.$Notice.error({ title: (actionContext.$t('app.commonWords.wrong') as string), desc: (actionContext.$t('app.commonWords.sysException') as string) });
return;
}
return response;
});
};
backend();
}
/** /**
* 获取指定数据的重定向页面 * 获取指定数据的重定向页面
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
<!--输出实体[META_DYNAMICMODEL]数据结构 --> <!--输出实体[META_DYNAMICMODEL]数据结构 -->
<changeSet author="root" id="tab-meta_dynamicmodel-29-12"> <changeSet author="root" id="tab-meta_dynamicmodel-31-12">
<createTable tableName="IBZDYNAMICMODEL"> <createTable tableName="IBZDYNAMICMODEL">
<column name="DYNAINSTID" remarks="" type="VARCHAR(100)"> <column name="DYNAINSTID" remarks="" type="VARCHAR(100)">
</column> </column>
...@@ -448,10 +448,10 @@ ...@@ -448,10 +448,10 @@
<!--输出实体[DST_VIEW]外键关系 --> <!--输出实体[DST_VIEW]外键关系 -->
<!--输出实体[META_DATASET]外键关系 --> <!--输出实体[META_DATASET]外键关系 -->
<!--输出实体[META_DYNAMICMODEL]外键关系 --> <!--输出实体[META_DYNAMICMODEL]外键关系 -->
<changeSet author="root" id="fk-meta_dynamicmodel-29-18"> <changeSet author="root" id="fk-meta_dynamicmodel-31-18">
<addForeignKeyConstraint baseColumnNames="SYSTEMID" baseTableName="IBZDYNAMICMODEL" constraintName="DER1N_META_DYNAMICMODEL_DST_SY" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PSSYSTEMID" referencedTableName="IBZPSSYSTEM" validate="true"/> <addForeignKeyConstraint baseColumnNames="SYSTEMID" baseTableName="IBZDYNAMICMODEL" constraintName="DER1N_META_DYNAMICMODEL_DST_SY" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PSSYSTEMID" referencedTableName="IBZPSSYSTEM" validate="true"/>
</changeSet> </changeSet>
<changeSet author="root" id="fk-meta_dynamicmodel-29-19"> <changeSet author="root" id="fk-meta_dynamicmodel-31-19">
<addForeignKeyConstraint baseColumnNames="PDYNAINSTID" baseTableName="IBZDYNAMICMODEL" constraintName="DER1N_META_DYNAMICMODEL_META_D" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONFIGID" referencedTableName="IBZDYNAMICMODEL" validate="true"/> <addForeignKeyConstraint baseColumnNames="PDYNAINSTID" baseTableName="IBZDYNAMICMODEL" constraintName="DER1N_META_DYNAMICMODEL_META_D" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONFIGID" referencedTableName="IBZDYNAMICMODEL" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[META_ENTITY]外键关系 --> <!--输出实体[META_ENTITY]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册