Commit 40f47753 authored by 纪泽龙's avatar 纪泽龙

基本完成,准备修改设备路径

parent 76fe364a
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
pipeList: [], pipeList: [],
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
...@@ -211,6 +211,8 @@ export default { ...@@ -211,6 +211,8 @@ export default {
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form流量计",this.form)
// return;
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
fileList: [], fileList: [],
// 表单校验 // 表单校验
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
...@@ -209,6 +209,8 @@ export default { ...@@ -209,6 +209,8 @@ export default {
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form)",this.form)
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
fileArr: [], fileArr: [],
pipeList: [], pipeList: [],
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
...@@ -209,6 +209,7 @@ export default { ...@@ -209,6 +209,7 @@ export default {
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form",this.form)
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
......
...@@ -132,9 +132,10 @@ export default { ...@@ -132,9 +132,10 @@ export default {
deviceMore() { deviceMore() {
console.log(this.obj.polyline.getExtData().lineData) console.log(this.obj.polyline.getExtData().lineData)
this.obj.polyline.getExtData().class.view.$router.push({ this.obj.polyline.getExtData().class.view.$router.push({
path: "/realtimeData/realtimedetail", path: "/dataMonitoring/realtimedetail",
query: { query: {
deviceId: this.obj.polyline.getExtData().lineData.pipeId, deviceId: this.obj.polyline.getExtData().lineData.pipeId,
deviceType:"0"
}, },
}); });
}, },
......
...@@ -54,8 +54,11 @@ router.afterEach((to, from) => { ...@@ -54,8 +54,11 @@ router.afterEach((to, from) => {
// console.log('全局后置钩子',to, from) // console.log('全局后置钩子',to, from)
if (to.path == "/enterprise/mapView") { if (to.path == "/enterprise/mapView") {
store.dispatch("app/toggleDevice", "mobile"); store.dispatch("app/toggleDevice", "mobile");
store.dispatch("app/closeSideBar", { withoutAnimation: true });
} else { } else {
store.dispatch("app/toggleDevice", "desktop"); store.dispatch("app/toggleDevice", "desktop");
store.dispatch("app/closeSideBar", { withoutAnimation: false });
} }
NProgress.done(); NProgress.done();
}); });
This diff is collapsed.
...@@ -342,6 +342,7 @@ export default { ...@@ -342,6 +342,7 @@ export default {
created() { created() {
// 让左边的框隐藏 // 让左边的框隐藏
this.$store.dispatch("app/toggleDevice", "mobile"); this.$store.dispatch("app/toggleDevice", "mobile");
console.log("sasdasdas")
}, },
mounted() { mounted() {
...@@ -396,7 +397,6 @@ export default { ...@@ -396,7 +397,6 @@ export default {
} }
}); });
}, },
getDeviceInfo(queryParams) { getDeviceInfo(queryParams) {
this.loading = true; this.loading = true;
return getAllDeviceInfo(queryParams).then((response) => { return getAllDeviceInfo(queryParams).then((response) => {
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
code: [{ required: true, trigger: "change", message: "验证码不能为空" }] code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
}, },
loading: false, loading: false,
redirect: "/index" redirect: ""
}; };
}, },
watch: { watch: {
...@@ -134,7 +134,9 @@ export default { ...@@ -134,7 +134,9 @@ export default {
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); // this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
// console.log(this.redirect)
this.$router.push({ path: "/enterprise/mapView" || "/" }).catch(()=>{});
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.getCode(); this.getCode();
......
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