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

tony001 部署微服务应用 [TrainSys,Mob]

上级 15b37626
...@@ -13,11 +13,23 @@ window.Environment = { ...@@ -13,11 +13,23 @@ window.Environment = {
// mockDcSystemId: '941127f9d839f87308f1c4db3b0a2de4', // mockDcSystemId: '941127f9d839f87308f1c4db3b0a2de4',
// appId: 'trainsys__mob', // appId: 'trainsys__mob',
// mockDcSystemId: '84847aa970ba3db7bbe00754aed3888d', // mockDcSystemId: '84847aa970ba3db7bbe00754aed3888d',
appId: 'sztrainsys__mob',
mockDcSystemId: 'ac2720c74d5456b40e24aeaf6ffffbd2',
// appId: 'ibizdemoold__sample', // appId: 'ibizdemoold__sample',
// mockDcSystemId: 'ibizdemoold', // mockDcSystemId: 'ibizdemoold',
appId: 'ls__lsmob', // appId: 'ls__lsmob',
mockDcSystemId: 'LS', // mockDcSystemId: 'LS',
// appId: 'pms__sclpmsmob',
// mockDcSystemId: 'pms',
appId: 'demosys__mobvue3',
mockDcSystemId: 'demosys',
// 创新孵化
// appId: 'cxfhmgmt__cxfhappmob',
// mockDcSystemId: 'cxfhmgmt',
// 应用标题 // 应用标题
AppTitle: '应用首页', AppTitle: '应用首页',
hub: false, hub: false,
enableMqtt: true,
mqttUrl: '/portal/mqtt/mqtt',
// isLocalModel: true,
}; };
@mixin login-view-form-item-style {
@include flex(row, flex-start, center);
ion-icon {
margin-right: 5%;
}
.van-field {
position: relative;
padding: 0;
overflow: visible;
.van-field__error-message {
position: absolute;
top: 20px;
}
}
input {
color: #fff;
background: #373447;
border: none;
&:-webkit-autofill {
box-shadow: 0 0 0 1000px #373447 inset;
-webkit-text-fill-color: #fff;
}
}
.van-field__control::placeholder {
color: #fff;
background: #373447;
}
height: 40%;
font-size: 14px;
border-bottom: 1px solid #565366;
}
@include b(login-view) {
width: 100vw;
height: 100vh;
color: #fff;
background: #373447;
@include b(login-view-logo) {
height: 40%;
@include flex(column, center, center);
@include b(login-view-logo-img) {
margin-top: 15%;
}
@include b(login-view-title) {
margin-top: 5%;
font-size: 16px;
}
}
@include b(login-view-form) {
height: 20%;
padding: 0 10%;
@include b(login-view-user) {
@include login-view-form-item-style;
}
@include b(login-view-password) {
@include login-view-form-item-style;
}
}
@include b(login-view-btns) {
height: 40%;
padding: 0 10%;
@include b(login-view-login-btn) {
width: 100%;
margin: 0;
font-size: 15px;
color: #fff;
background: #312e3f;
border: none;
border-radius: 0;
&:hover {
background: #4a4658;
}
}
}
}
import { CoreConst } from '@ibiz-template/core';
import { useNamespace } from '@ibiz-template/vue3-util';
import { computed, defineComponent, reactive, Ref, ref } from 'vue';
import { useRoute } from 'vue-router';
import './login-view.scss';
import { getCookie } from 'qx-util';
export const LoginView = defineComponent({
setup() {
const loading = ref(false);
const formRef = ref<IData | null>(null);
const route = useRoute();
const ru = (route.query.ru as string) || '/';
const loginData = reactive({
username: '',
password: '',
});
const login = async () => {
try {
if (!loginData.username) {
ibiz.notification.error({
desc: '请填写用户名',
});
return;
}
if (!loginData.password) {
ibiz.notification.error({
desc: '请填写密码',
});
return;
}
loading.value = true;
const bol = await ibiz.auth.login(
loginData.username,
loginData.password,
);
if (bol) {
window.location.hash = ru;
window.location.reload();
}
loading.value = false;
} catch (error) {
ibiz.notification.error({
desc: (error as IData)?.response?.data?.message || '登录失败',
});
loading.value = false;
}
};
const title = computed(() => {
return ibiz.env.AppTitle;
});
// 请求头
const headers: Ref<IData> = ref({
Authorization: `Bearer ${getCookie(CoreConst.TOKEN)}`,
});
const uploadFile = (file: IData) => {
console.log(file);
// 创建一个空对象实例
const formData = new FormData();
// 调用append()方法添加数据
formData.append('file', file.file);
return new Promise((resolve, reject) => {
ibiz.net
.axios({
url: '/api/demosys__mobvue3/viewtests/asyncimportdata2?srfimporttag=DataImport',
method: 'POST',
data: formData,
headers: headers.value,
})
.then(res => {
if (res.status === 200) {
console.log(88, res);
resolve(true);
} else {
reject();
}
})
.catch(() => {
reject();
});
});
};
const test = (data: IData) => {
uploadFile(data);
};
return { loginData, login, title, loading, formRef, test };
},
render() {
const ns = useNamespace('login-view');
return (
<div class={ns.b()}>
<div class={ns.b('logo')}>
<img class={ns.b('logo-img')} src='./assets/img/login-logo.png' />
<div class={ns.b('title')}>{this.title}</div>
</div>
<van-form class={ns.b('form')} ref='formRef'>
<div class={ns.b('user')}>
<ion-icon name='person'></ion-icon>
<van-field
placeholder='请输入用户名'
name='用户名'
v-model={this.loginData.username}
rules={[{ required: true, message: '请填写用户名' }]}
></van-field>
</div>
<div class={ns.b('password')}>
<ion-icon name='lock-closed'></ion-icon>
<van-field
placeholder='请输入密码'
name='密码'
type='password'
v-model={this.loginData.password}
rules={[{ required: true, message: '请填写密码' }]}
></van-field>
</div>
</van-form>
<div class={ns.b('btns')}>
<van-button
loading={this.loading}
class={ns.b('login-btn')}
onClick={this.login}
>
登录
</van-button>
<van-uploader after-read={this.test}>测试导入</van-uploader>
</div>
</div>
);
},
});
...@@ -2,13 +2,13 @@ import { Router, createRouter, createWebHashHistory } from 'vue-router'; ...@@ -2,13 +2,13 @@ import { Router, createRouter, createWebHashHistory } from 'vue-router';
import { import {
AppRedirectView, AppRedirectView,
View404, View404,
LoginView,
useViewStack, useViewStack,
} from '@ibiz-template/mob-vue3-components'; } from '@ibiz-template/mob-vue3-components';
import { Modal, ViewMode } from '@ibiz-template/runtime'; import { Modal, ViewMode } from '@ibiz-template/runtime';
import { isNilOrEmpty } from 'qx-util'; import { isNilOrEmpty } from 'qx-util';
import { AuthGuard } from '../guard'; import { AuthGuard } from '../guard';
import { RouterShell, HomeView } from '@/components'; import { RouterShell, HomeView } from '@/components';
import { LoginView } from '@/components/login-view/login-view';
const getPropsCallback = (depth: number) => { const getPropsCallback = (depth: number) => {
if (depth === 1) { if (depth === 1) {
......
...@@ -55,6 +55,36 @@ ...@@ -55,6 +55,36 @@
git clone -b master $para2 trainsys/ git clone -b master $para2 trainsys/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd trainsys/ cd trainsys/
mkdir -p /var/lib/jenkins/appcache/64777BB9-78E2-44DD-AEF6-FF87AC45C1D5
if [ -e app_Mob/.dynamic ]
then
cd app_Mob
else
cd app_Mob/app
fi
sed -i "s#dstimage#$para5#g" swarm.yaml
if [[ $para3 = all ]];then
mv Dockerfile-ALL Dockerfile
set +e
sed -i "s#/api#/sztrainsys__mob#g" src/environments/environment.ts
sed -i "s#outputDir#//outputDir#g" vue.config.js
set -e
yarn
ln -s /var/lib/jenkins/appcache/64777BB9-78E2-44DD-AEF6-FF87AC45C1D5 node_modules/.cache
yarn build
else
if [ -e .dynamic ]
then
mv ../trainsys-core/src/main/resources/model/cn/ibizlab/trainsys/PSSYSAPPS/Mob model
else
mv ../../trainsys-core/src/main/resources/model/cn/ibizlab/trainsys/PSSYSAPPS/Mob model
fi
sed -i "s#srcimagename#$para4#g" Dockerfile-MODEL
mv Dockerfile-MODEL Dockerfile
fi
docker build -t $para5 .
docker push $para5
docker -H $para1 stack deploy --compose-file=swarm.yaml ebsx --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -1432,16 +1432,16 @@ ...@@ -1432,16 +1432,16 @@
"codeName" : "VMGroup2", "codeName" : "VMGroup2",
"name" : "视图消息组2", "name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ { "getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息2", "name" : "视图消息",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg3" "id" : "ViewMsg2"
} }
}, { }, {
"name" : "视图消息", "name" : "视图消息2",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg2" "id" : "ViewMsg3"
} }
} ] } ]
}, { }, {
......
...@@ -11189,16 +11189,16 @@ ...@@ -11189,16 +11189,16 @@
"codeName" : "VMGroup2", "codeName" : "VMGroup2",
"name" : "视图消息组2", "name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ { "getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息2", "name" : "视图消息",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg3" "id" : "ViewMsg2"
} }
}, { }, {
"name" : "视图消息", "name" : "视图消息2",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg2" "id" : "ViewMsg3"
} }
} ] } ]
}, { }, {
...@@ -11233,16 +11233,16 @@ ...@@ -11233,16 +11233,16 @@
"id" : "ViewMsg4" "id" : "ViewMsg4"
} }
}, { }, {
"name" : "消息类型-警告信息", "name" : "消息类型-错误信息",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg5" "id" : "ViewMsg6"
} }
}, { }, {
"name" : "消息类型-错误信息", "name" : "消息类型-警告信息",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg6" "id" : "ViewMsg5"
} }
} ] } ]
}, { }, {
...@@ -11259,34 +11259,41 @@ ...@@ -11259,34 +11259,41 @@
"codeName" : "VMGroup4", "codeName" : "VMGroup4",
"name" : "视图消息位置测试", "name" : "视图消息位置测试",
"getPSAppViewMsgGroupDetails" : [ { "getPSAppViewMsgGroupDetails" : [ {
"name" : "消息位置-视图内容区", "name" : "消息位置-弹出",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg9" "id" : "ViewMsg10"
} }
}, { }, {
"name" : "消息位置-视图方", "name" : "消息位置-视图方",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg7" "id" : "ViewMsg8"
} }
}, { }, {
"name" : "消息位置-弹出", "name" : "消息位置-视图内容区",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg10" "id" : "ViewMsg9"
} }
}, { }, {
"name" : "消息位置-视图方", "name" : "消息位置-视图方",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg8" "id" : "ViewMsg7"
} }
} ] } ]
}, { }, {
"codeName" : "VMGroup8", "codeName" : "VMGroup8",
"name" : "【静态测试】", "name" : "【静态测试】",
"getPSAppViewMsgGroupDetails" : [ { "getPSAppViewMsgGroupDetails" : [ {
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
},
"position" : "POPUP"
}, {
"name" : "关闭模式-无删除-上方-常规", "name" : "关闭模式-无删除-上方-常规",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
...@@ -11300,16 +11307,16 @@ ...@@ -11300,16 +11307,16 @@
}, },
"position" : "POPUP" "position" : "POPUP"
}, { }, {
"name" : "消息位置-视图内容区", "name" : "关闭模式-默认删除-上方-错误",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg9" "id" : "ViewMsg12"
} }
}, { }, {
"name" : "关闭模式-默认删除-上方-错误", "name" : "消息位置-视图内容区",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg12" "id" : "ViewMsg9"
} }
}, { }, {
"name" : "消息位置-视图下方", "name" : "消息位置-视图下方",
...@@ -11330,13 +11337,6 @@ ...@@ -11330,13 +11337,6 @@
"id" : "ViewMsg5" "id" : "ViewMsg5"
}, },
"position" : "POPUP" "position" : "POPUP"
}, {
"name" : "消息类型-错误信息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg6"
},
"position" : "POPUP"
} ] } ]
}, { }, {
"codeName" : "VMGroup5", "codeName" : "VMGroup5",
...@@ -11364,16 +11364,16 @@ ...@@ -11364,16 +11364,16 @@
"codeName" : "VMGroup6", "codeName" : "VMGroup6",
"name" : "视图消息动态模式测试", "name" : "视图消息动态模式测试",
"getPSAppViewMsgGroupDetails" : [ { "getPSAppViewMsgGroupDetails" : [ {
"name" : "动态模式-静态内容", "name" : "动态模式-实体数据集",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg15" "id" : "ViewMsg14"
} }
}, { }, {
"name" : "动态模式-实体数据集", "name" : "动态模式-静态内容",
"getPSAppViewMsg" : { "getPSAppViewMsg" : {
"modelref" : true, "modelref" : true,
"id" : "ViewMsg14" "id" : "ViewMsg15"
} }
} ] } ]
} ], } ],
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册