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

ibiz4j 部署微服务应用

上级 4c65a059
<template> <template>
<Select v-model="dataRight" style="width:586px" multiple> <Select
<Option @on-open-change="transferRefresh"
class="hidden" @on-change="dataChange"
:value="item" v-model="dataRight"
v-for="(item,i) in dataRight" :style="{width:width}"
:key="i" multiple
>{{dataLeft[item-1].label}}</Option> >
<Option class="hidden" :value="item" v-for="(item,i) in dataRight" :key="i">{{findLabel(item)}}</Option>
<el-transfer v-model="dataRight" :data="dataLeft" @change="dataChange" :titles="['未选择', '已选择']"></el-transfer> <el-transfer v-model="dataRight" :data="dataLeft" @change="dataChange" :titles="['未选择', '已选择']"></el-transfer>
</Select> </Select>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Watch, Prop, Model } from "vue-property-decorator"; import { Vue, Component, Watch, Prop, Model } from "vue-property-decorator";
import CodeListService from "@service/app/codelist-service"; import CodeListService from "@service/app/codelist-service";
import { ElSelect } from "element-ui/types/select";
@Component({}) @Component({})
export default class AppTransfer extends Vue { export default class AppTransfer extends Vue {
/**
* 表单传递右侧框中的数据
*/
@Prop() public data?: any;
/** /**
* 左侧框数据 * 左侧框数据
*/ */
public dataLeft: any[] = []; public dataLeft: any[] = [];
/** /**
* 右侧框数据 * 右侧框数据
*/ */
public dataRight: any[] = []; public dataRight: any[] = [];
/**
* 穿梭框宽度
*/
@Prop() public width:any;
/** /**
* 代码表服务对象 * 代码表服务对象
* *
...@@ -38,14 +44,6 @@ export default class AppTransfer extends Vue { ...@@ -38,14 +44,6 @@ export default class AppTransfer extends Vue {
$store: this.$store $store: this.$store
}); });
/**
* 额外参数
*
* @type {*}
* @memberof AppTransfer
*/
public otherParam: any;
/** /**
* 查询参数 * 查询参数
* @type {*} * @type {*}
...@@ -53,12 +51,16 @@ export default class AppTransfer extends Vue { ...@@ -53,12 +51,16 @@ export default class AppTransfer extends Vue {
*/ */
public queryParam: any; public queryParam: any;
/**
* 表单传入字符串值分隔符
*/
@Prop() public valueSeparator?: string;
/** /**
* 当前选中值 * 当前选中值
* @type {any} * @type {any}
* @memberof AppTransfer * @memberof AppTransfer
*/ */
@Model("change") readonly itemValue!: any; @Model("change") public itemValue!: any;
/** /**
* 代码表标识 * 代码表标识
...@@ -76,33 +78,18 @@ export default class AppTransfer extends Vue { ...@@ -76,33 +78,18 @@ export default class AppTransfer extends Vue {
*/ */
@Prop() public codelistType?: string; @Prop() public codelistType?: string;
/**
* 监听表单数据
*
* @memberof AppTransfer
*/
@Watch("data", { deep: true })
onDataChange(newVal: any, val: any) {
if (newVal) {
}
}
/** /**
* 组件change事件,右侧框数据变化时 * 组件change事件,右侧框数据变化时
* @memberof AppTransfer * @memberof AppTransfer
*/ */
dataChange(e: any) { dataChange(e: any) {
console.log(e);
let val: any[] = [];
let newVal: any; let newVal: any;
this.dataLeft.forEach((elem: any) => { newVal = e.join(`${this.valueSeparator}`);
e.forEach((item: any) => { if (newVal) {
if (elem.key === item) val.push(elem.value); this.$emit("change", newVal);
}); } else {
}); this.$emit("change", null);
newVal = val.join(","); }
console.log(newVal, typeof newVal);
if (newVal) this.$emit("change", newVal);
} }
/** /**
...@@ -151,55 +138,6 @@ export default class AppTransfer extends Vue { ...@@ -151,55 +138,6 @@ export default class AppTransfer extends Vue {
*/ */
@Prop() public placeholder?: string; @Prop() public placeholder?: string;
/**
* 获取值对象
*
* @memberof AppTransfer
*/
get currentVal() {
return this.itemValue;
}
/**
* 代码表
*
* @type {any[]}
* @memberof AppTransfer
*/
// public items: any[] = [];
/**
* 公共参数处理
*
* @param {*} arg
* @returns
* @memberof AppTransfer
*/
public handlePublicParams(arg: any) {
// 合并表单参数
arg.param = this.viewparams
? JSON.parse(JSON.stringify(this.viewparams))
: {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理
if (this.itemParam && this.itemParam.context) {
let _context = this.$util.formatData(
this.data,
arg.context,
this.itemParam.context
);
Object.assign(arg.context, _context);
}
if (this.itemParam && this.itemParam.param) {
let _param = this.$util.formatData(
this.data,
arg.param,
this.itemParam.param
);
Object.assign(arg.param, _param);
}
}
/** /**
* vue 生命周期 * vue 生命周期
* *
...@@ -219,13 +157,11 @@ export default class AppTransfer extends Vue { ...@@ -219,13 +157,11 @@ export default class AppTransfer extends Vue {
this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))]; this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))];
this.initLeft(); this.initLeft();
this.initRight(); this.initRight();
console.log(this.dataLeft);
console.log(this.dataRight);
} else { } else {
console.log(`----${this.tag}----代码表不存在`); console.log(`----${this.tag}----代码表不存在`);
} }
} else if (this.tag && Object.is(this.codelistType, "DYNAMIC")) { } else if (this.tag && Object.is(this.codelistType, "DYNAMIC")) {
// 公共参数处理 // 处理公共参数
let data: any = {}; let data: any = {};
this.handlePublicParams(data); this.handlePublicParams(data);
// 参数处理 // 参数处理
...@@ -235,7 +171,6 @@ export default class AppTransfer extends Vue { ...@@ -235,7 +171,6 @@ export default class AppTransfer extends Vue {
.getItems(this.tag, _context, _param) .getItems(this.tag, _context, _param)
.then((res: any) => { .then((res: any) => {
this.dataLeft = res; this.dataLeft = res;
console.log(this.dataLeft);
this.initLeft(); this.initLeft();
this.initRight(); this.initRight();
}) })
...@@ -244,6 +179,38 @@ export default class AppTransfer extends Vue { ...@@ -244,6 +179,38 @@ export default class AppTransfer extends Vue {
}); });
} }
} }
/**
* 公共参数处理
*
* @param {*} arg
* @returns
* @memberof AppTransfer
*/
public handlePublicParams(arg: any) {
// 合并表单参数
arg.param = this.viewparams
? JSON.parse(JSON.stringify(this.viewparams))
: {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理
if (this.itemParam && this.itemParam.context) {
let _context = this.$util.formatData(
this.itemValue,
arg.context,
this.itemParam.context
);
Object.assign(arg.context, _context);
}
if (this.itemParam && this.itemParam.param) {
let _param = this.$util.formatData(
this.itemValue,
arg.param,
this.itemParam.param
);
Object.assign(arg.param, _param);
}
}
/** /**
* 初始化左侧框数据 * 初始化左侧框数据
*/ */
...@@ -253,8 +220,7 @@ export default class AppTransfer extends Vue { ...@@ -253,8 +220,7 @@ export default class AppTransfer extends Vue {
this.dataLeft = []; this.dataLeft = [];
left.forEach((elem: any, i: any) => { left.forEach((elem: any, i: any) => {
this.dataLeft.push({ this.dataLeft.push({
key: i + 1, key: elem.id,
id: elem.id,
value: elem.value, value: elem.value,
label: elem.label, label: elem.label,
disabled: elem.disabled disabled: elem.disabled
...@@ -265,10 +231,9 @@ export default class AppTransfer extends Vue { ...@@ -265,10 +231,9 @@ export default class AppTransfer extends Vue {
* 初始化右侧框数据 * 初始化右侧框数据
*/ */
public initRight() { public initRight() {
let _data: string = this.data; let _data: any = this.itemValue;
console.log(_data);
if (_data) { if (_data) {
let newData: any[] = _data.split(","); let newData: any[] = _data.split(`${this.valueSeparator}`);
this.dataLeft.forEach((elem: any) => { this.dataLeft.forEach((elem: any) => {
newData.forEach((item: any) => { newData.forEach((item: any) => {
if (item === elem.value) { if (item === elem.value) {
...@@ -278,6 +243,25 @@ export default class AppTransfer extends Vue { ...@@ -278,6 +243,25 @@ export default class AppTransfer extends Vue {
}); });
} }
} }
/**
* 穿梭框打开时刷新数据
*/
public transferRefresh(e: any) {
if (e && this.codelistType === "DYNAMIC") {
this.dataLeft = [];
this.dataRight = [];
this.dataHandle();
}
}
/**
* 找到dataLeft中key与dataRight中item相等的元素,返回label
*/
public findLabel(item: any) {
for (const elem of this.dataLeft) {
if (elem.key === item) return elem.label;
}
}
} }
</script> </script>
......
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
git clone -b master $para2 ibzuaa/ git clone -b master $para2 ibzuaa/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd ibzuaa/ cd ibzuaa/
mvn clean package -Papi mvn clean package -Pweb
cd ibzuaa-provider/ibzuaa-provider-api cd ibzuaa-app/ibzuaa-app-web
mvn -Papi docker:build mvn -Pweb docker:build
mvn -Papi docker:push mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-provider-api.yaml ibzlab-rt --with-registry-auth docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-app-web.yaml ibzlab-rt --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \ ...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \ sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar
EXPOSE 8080 EXPOSE 30002
ADD ibzuaa-app-web.jar /ibzuaa-app-web.jar ADD ibzuaa-app-web.jar /ibzuaa-app-web.jar
...@@ -3,9 +3,23 @@ services: ...@@ -3,9 +3,23 @@ services:
ibzuaa-app-web: ibzuaa-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
ports: ports:
- "8080:8080" - "30002:30002"
networks: networks:
- agent_network - agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=30002
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
- ABC=1
- DEC=2
deploy: deploy:
resources: resources:
limits: limits:
......
...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \ ...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \ sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-provider-api.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-provider-api.jar
EXPOSE 40002 EXPOSE 8081
ADD ibzuaa-provider-api.jar /ibzuaa-provider-api.jar ADD ibzuaa-provider-api.jar /ibzuaa-provider-api.jar
...@@ -3,21 +3,9 @@ services: ...@@ -3,21 +3,9 @@ services:
ibzuaa-provider-api: ibzuaa-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-provider-api:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-provider-api:latest
ports: ports:
- "40002:40002" - "8081:8081"
networks: networks:
- agent_network - agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=40002
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
deploy: deploy:
resources: resources:
limits: limits:
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册