Commit 720ce621 authored by 王晓旭's avatar 王晓旭

增加基础配置,要求填入ip的表单

parent fa332ed6
...@@ -89,6 +89,48 @@ ...@@ -89,6 +89,48 @@
</div> </div>
<!-- 第四步 --> <!-- 第四步 -->
<div v-show="active == 3"> <div v-show="active == 3">
<div class="label">ip配置</div>
<div class="line"></div>
<el-form :model="ippzForm" :rules="ippzRules" ref="ippzForm" label-width="80px">
<el-form-item prop="clientToServerIp">
<div class="elinput">
<el-input placeholder="请输入设备通讯ip,不能输入端口号" v-model="ippzForm.clientToServerIp">
<template slot="prepend">
<div style="width:80px;text-align: center;">设备通讯ip</div>
</template>
</el-input>
</div>
</el-form-item>
<el-form-item prop="domain">
<div class="elinput">
<el-input placeholder="请输入域名" v-model="ippzForm.domain">
<template slot="prepend">
<div style="width:80px;text-align: center;">
域名
</div>
</template>
</el-input>
</div>
</el-form-item>
<el-form-item prop="innerServerIp">
<div class="elinput">
<el-input placeholder="请输入内网ip,不能输入端口号" v-model="ippzForm.innerServerIp">
<template slot="prepend">
<div style="width:80px;text-align: center;">
内网ip
</div>
</template>
</el-input>
</div>
</el-form-item>
<div style="margin: 40px 0;"></div>
<div class="line"></div>
<el-button type="primary" @click="active = 2">上一步</el-button>
<el-button type="primary" @click="submitJCForm('ippzForm')" :loading="loading">下一步</el-button>
</el-form>
</div>
<!-- 第五步 -->
<div v-show="active == 4">
<div class="label">完成</div> <div class="label">完成</div>
<div class="line"></div> <div class="line"></div>
<div class="wancheng"> <div class="wancheng">
...@@ -120,6 +162,33 @@ export default { ...@@ -120,6 +162,33 @@ export default {
mixins: [tree], mixins: [tree],
data() { data() {
return { return {
// 表单
ippzForm: {
clientToServerIp:"",//设备通讯ip
domain:"", //域名
innerServerIp:""//内网ip
},
// 表单验证
ippzRules: {
clientToServerIp: [
{ required: true, message: '请输入设备通讯ip', trigger: 'blur' },
{
pattern:/^((2[0-4]\d.)|(25[0-5].)|(1\d{2}.)|(\d{1,2}.))((2[0-5]{2}.)|(1\d{2}.)|(\d{1,2}.){2})((1\d{2})|(2[0-5]{2})|(\d{1,2}))/, //正则校验不用字符串
message: "请填写正确的设备通讯ip", trigger: "blur"
}
],
domain: [
{ required: true, message: '请输入域名', trigger: 'blur' }
],
innerServerIp: [
{ required: true, message: '请输入内网ip', trigger: 'blur' },
{
pattern:/^((2[0-4]\d.)|(25[0-5].)|(1\d{2}.)|(\d{1,2}.))((2[0-5]{2}.)|(1\d{2}.)|(\d{1,2}.){2})((1\d{2})|(2[0-5]{2})|(\d{1,2}))/, //正则校验不用字符串
message: "请填写正确的内网ip", trigger: "blur"
}
]
},
// 用户导入参数 // 用户导入参数
upload: { upload: {
// 请求头 // 请求头
...@@ -143,11 +212,11 @@ export default { ...@@ -143,11 +212,11 @@ export default {
"1、项目文件包导入", "1、项目文件包导入",
"2、创建站点", "2、创建站点",
"3、部署", "3、部署",
"4、完成" "4、基础配置",
"5、完成"
], ],
loading: false, loading: false,
fileList: [], fileList: [],
// timer: "",
config: { config: {
columns: [ columns: [
{ {
...@@ -180,6 +249,7 @@ export default { ...@@ -180,6 +249,7 @@ export default {
} }
}, },
methods: { methods: {
// 上传资源包
objInstall() { objInstall() {
//检测是否初始安装 //检测是否初始安装
this.$get("/setup/project/check") this.$get("/setup/project/check")
...@@ -212,8 +282,31 @@ export default { ...@@ -212,8 +282,31 @@ export default {
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
// 以下第三部分 // 以下第四部分
submitJCForm(formName){
let that = this
this.$refs[formName].validate((vaild)=>{
if (vaild) {
that.$post("/setup/project/serverIp/update", {
...that.ippzForm
}).then((res) => {
if (res.code == 1) {
// 跳转到下一页
that.active = 4
}else{
that.$message.warning(res.msg);
}
}).catch((err)=>{
that.$message.warning("请输入正确的表单内容!");
})
} else {
that.$message.warning("请输入正确的表单内容!");
return false;
}
})
},
// 以下第三部分
// 默认拉取数据 // 默认拉取数据
async getData() { async getData() {
this.tableData.loading = true; this.tableData.loading = true;
...@@ -235,6 +328,7 @@ export default { ...@@ -235,6 +328,7 @@ export default {
}, 300); }, 300);
}); });
}, },
// 刷新状态
syncProjectStatus() { syncProjectStatus() {
this.$post("/setup/project/projectStatusUpdate", { }) this.$post("/setup/project/projectStatusUpdate", { })
.then((res) => { .then((res) => {
...@@ -243,6 +337,7 @@ export default { ...@@ -243,6 +337,7 @@ export default {
} }
}) })
}, },
// 格式转换
formatterStatus(row, column, val) { formatterStatus(row, column, val) {
const content = formatter(this.tableData, column, val); const content = formatter(this.tableData, column, val);
if (content) { if (content) {
...@@ -288,6 +383,7 @@ export default { ...@@ -288,6 +383,7 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.selection = val.map((i) => i.id); this.selection = val.map((i) => i.id);
}, },
// 表格勾选部署
handleSelectableMethod(row, index) { handleSelectableMethod(row, index) {
if(row.projectStatus==1){ if(row.projectStatus==1){
return true; return true;
...@@ -302,6 +398,7 @@ export default { ...@@ -302,6 +398,7 @@ export default {
return false; return false;
} }
}, },
// 点击部署
batchDistribute(){ batchDistribute(){
let setlist = this.tableData.data.filter((item)=>{ let setlist = this.tableData.data.filter((item)=>{
return item.projectStatus != 1 return item.projectStatus != 1
...@@ -436,6 +533,7 @@ export default { ...@@ -436,6 +533,7 @@ export default {
margin-left:0 !important; margin-left:0 !important;
} }
// 第四部分 // 第四部分
// 第五部分
.wancheng { .wancheng {
margin-bottom: 350px; margin-bottom: 350px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment