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

ibizdev提交

上级 c4c3ce23
......@@ -46,6 +46,14 @@ export default {
},
},
gridviewtoolbar_toolbar: {
tbitem1_xd: {
caption: "下单",
tip: "tbitem1_xd",
},
tbitem2: {
caption: "-",
tip: "tbitem2",
},
tbitem3: {
caption: "New",
tip: "tbitem3",
......
......@@ -45,6 +45,14 @@ export default {
},
},
gridviewtoolbar_toolbar: {
tbitem1_xd: {
caption: '下单',
tip: '下单',
},
tbitem2: {
caption: '-',
tip: '',
},
tbitem3: {
caption: '新建',
tip: '新建',
......
......@@ -61,6 +61,44 @@ mock.onPost(new RegExp(/^\/ps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any)
return [status, mockDatas[0]];
});
// XD
mock.onPost(new RegExp(/^\/ps\/?([a-zA-Z0-9\-\;]{0,35})\/xd$/)).reply((config: any) => {
console.groupCollapsed("实体:ps 方法: XD");
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> = ['psid'];
const matchArray:any = new RegExp(/^\/ps\/([a-zA-Z0-9\-\;]{1,35})\/xd$/).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.psid, tempValue.psid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['psid'] == tempValue['psid'] ){
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];
});
// GetDraft
mock.onGet(new RegExp(/^\/ps\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:ps 方法: GetDraft");
......
......@@ -13,6 +13,13 @@
<div class='pull-right'>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem1_xd.visabled" :disabled="toolBarModels.tbitem1_xd.disabled" class='' @click="toolbar_click({ tag: 'tbitem1_xd' }, $event)">
<i class=''></i>
<span class='caption'>{{$t('ps.gridviewtoolbar_toolbar.tbitem1_xd.caption')}}</span>
</i-button>
<div slot='content'>{{$t('ps.gridviewtoolbar_toolbar.tbitem1_xd.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('ps.gridviewtoolbar_toolbar.tbitem3.caption')}}</span>
......@@ -317,6 +324,9 @@ export default class PSGridViewBase extends Vue {
* @memberof PSGridView
*/
public toolBarModels: any = {
tbitem1_xd: { name: 'tbitem1_xd', caption: '下单', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'XD', target: 'SINGLEKEY' } },
tbitem2: { name: 'tbitem2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem3: { name: 'tbitem3', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'New', target: '' } },
tbitem4: { name: 'tbitem4', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
......@@ -507,6 +517,9 @@ export default class PSGridViewBase extends Vue {
* @memberof PSGridViewBase
*/
protected toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem1_xd')) {
this.toolbar_tbitem1_xd_click($event, '', $event2);
}
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click($event, '', $event2);
}
......@@ -649,6 +662,33 @@ export default class PSGridViewBase extends Vue {
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected toolbar_tbitem1_xd_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()];
}
// 界面行为
const curUIService:PSUIService = new PSUIService();
curUIService.PS_XD(datas,contextJO, paramJO, $event, xData,this,"PS");
}
/**
* 逻辑事件
*
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import XDLogic from '@/service/ps/xd-logic';
......@@ -96,6 +97,21 @@ export default class PSServiceBase extends EntityService {
}
/**
* XD接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof PSServiceBase
*/
public async XD(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let appLogic:XDLogic = new XDLogic();
const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result};
}
/**
* GetDraft接口方法
*
......
import { Verify } from '@/utils/verify/verify';
/**
* 下单
*
* @export
* @class XDLogicBase
*/
export default class XDLogicBase {
/**
* 名称
*
* @memberof XDLogicBase
*/
private name:string ="XD";
/**
* 唯一标识
*
* @memberof XDLogicBase
*/
private id:string = "ACDDC51E-15B7-4939-BF9A-F8AFF9CACEE6";
/**
* 默认参数名称
*
* @memberof XDLogicBase
*/
private defaultParamName:string = "Default";
/**
* Creates an instance of XDLogicBase.
*
* @param {*} [opts={}]
* @memberof XDLogicBase
*/
constructor(opts: any = {}) {
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public onExecute(context:any,params:any,isloading:boolean){
return this.executeBegin(context,params,isloading);
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
if(this.compute0Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
/**
* HEALTHCHECK
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import XDLogicBase from './xd-logic-base';
/**
* 下单
*
* @export
* @class XDLogic
*/
export default class XDLogic extends XDLogicBase{
/**
* Creates an instance of XDLogic
*
* @param {*} [opts={}]
* @memberof XDLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -158,6 +158,62 @@ export default class PSUIServiceBase extends UIService {
backend();
}
/**
* 下单
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async PS_XD(args: any[],context:any = {}, params?: any, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
let data: any = {};
const _args: any[] = Util.deepCopy(args);
const _this: any = actionContext;
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { ps: '%ps%' });
Object.assign(params, { psid: '%ps%' });
Object.assign(params, { psname: '%psname%' });
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
Object.assign(context,parentObj);
// 直接调实体服务需要转换的数据
if(context && context.srfsessionid){
context.srfsessionkey = context.srfsessionid;
delete context.srfsessionid;
}
const backend = () => {
const curService:PSService = new PSService();
curService.XD(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: '错误', desc: '系统异常!' });
return;
}
if (response.status === 401) {
return;
}
return response;
});
};
backend();
}
/**
* 获取指定数据的重定向页面
......
......@@ -40,14 +40,14 @@
mvn install
cd ..
mvn install
cd ps-boot
mvn clean package
cd ps-app/ps-app-web
mvn clean package -Pprod
echo &apos;echo &quot;$para1&quot;&apos; &gt; apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;mkdir -p /ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ./target/ps.jar root@172.16.102.61:/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;ps -ef | grep &apos;/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep -v grep | grep &apos;jar&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m /ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5/ps.jar &gt;&gt;/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5/ps_apips 服务-`date --date=&apos;0 days ago&apos; +%Y-%m-%d`.log 2&gt;&amp;1 &amp;&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;mkdir -p /ibiz/nodes/node1/7B163728-8A01-45A9-862D-13C620F053F6&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ./target/ps-app-web.jar root@172.16.102.61:/ibiz/nodes/node1/7B163728-8A01-45A9-862D-13C620F053F6
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;ps -ef | grep &apos;/ibiz/nodes/node1/7B163728-8A01-45A9-862D-13C620F053F6&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep -v grep | grep &apos;jar&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh root@172.16.102.61 &quot;source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m /ibiz/nodes/node1/7B163728-8A01-45A9-862D-13C620F053F6/ps-app-web.jar &gt;&gt;/ibiz/nodes/node1/7B163728-8A01-45A9-862D-13C620F053F6/ps_appps 应用-`date --date=&apos;0 days ago&apos; +%Y-%m-%d`.log 2&gt;&amp;1 &amp;&quot;
</command>
</hudson.tasks.Shell>
</builders>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册