yangchengfei 5 months ago
parent
commit
5eab424dd7
2 changed files with 96 additions and 51 deletions
  1. 14 3
      src/page/Layout/layout.vue
  2. 82 48
      src/page/home.vue

+ 14 - 3
src/page/Layout/layout.vue

@@ -44,8 +44,6 @@ export default {
44
     // Applications
44
     // Applications
45
   },
45
   },
46
   data() {
46
   data() {
47
-    const u = localStorage.getItem("_userName");
48
-    const p = localStorage.getItem("_password");
49
     return {
47
     return {
50
       id: this.$route.params.id,
48
       id: this.$route.params.id,
51
       dat: {
49
       dat: {
@@ -56,9 +54,22 @@ export default {
56
       p: localStorage.getItem("_password"),
54
       p: localStorage.getItem("_password"),
57
       clientHeight: document.documentElement.clientHeight,
55
       clientHeight: document.documentElement.clientHeight,
58
       // url: `http://101.36.160.210:31055/crk/?k_username=${u}&k_password=${p}&code=1`,
56
       // url: `http://101.36.160.210:31055/crk/?k_username=${u}&k_password=${p}&code=1`,
59
-      url: `http://59.220.179.234:80/crk/?k_username=${u}&k_password=${p}&code=1`,
57
+      // url: `http://59.220.179.234:80/#/welcome/?username=${u}&password=${p}&code=1`,
58
+      // url: `http://172.18.93.228:80/#/welcome?username=${u}&password=${p}`,
59
+      url: "",
60
     };
60
     };
61
   },
61
   },
62
+  created() {
63
+    const u = localStorage.getItem("_userName");
64
+    const p = localStorage.getItem("_password");
65
+    const isProd = process.env.NODE_ENV === "production";
66
+    // let url;
67
+    if (!isProd) {
68
+      this.url = `http://101.36.160.210:31055/crk/?k_username=${u}&k_password=${p}`;
69
+    } else {
70
+      this.url = `http://172.18.93.228:80/#/welcome?username=${u}&password=${p}`;
71
+    }
72
+  },
62
   computed: {
73
   computed: {
63
     wrapHeight() {
74
     wrapHeight() {
64
       return this.clientHeight - 70 - 40;
75
       return this.clientHeight - 70 - 40;

+ 82 - 48
src/page/home.vue

@@ -1,12 +1,14 @@
1
 <template>
1
 <template>
2
-  <div class="content-main multi-column">
2
+  <div class="content-main multi-column" v-if="$store.state.flag == 2">
3
     <div class="column aside-column full-column">
3
     <div class="column aside-column full-column">
4
       <el-card class="box-card">
4
       <el-card class="box-card">
5
         <div slot="header" class="clearfix">
5
         <div slot="header" class="clearfix">
6
           <span>待办事项</span>
6
           <span>待办事项</span>
7
         </div>
7
         </div>
8
         <div class="text item">
8
         <div class="text item">
9
-          <span class="todoTips" @click="goTodo">智能粮库待办事项 <span style="color: red;">0</span> 条</span>
9
+          <span class="todoTips" @click="goTodo"
10
+            >智能粮库待办事项 <span style="color: red">0</span> 条</span
11
+          >
10
         </div>
12
         </div>
11
       </el-card>
13
       </el-card>
12
       <el-card class="box-card">
14
       <el-card class="box-card">
@@ -28,40 +30,50 @@
28
     </div>
30
     </div>
29
     <div class="column main-column full-column">
31
     <div class="column main-column full-column">
30
       <div class="main-top">
32
       <div class="main-top">
31
-        <div class="left" style="height: auto;display: flex;flex-direction: column">
33
+        <div
34
+          class="left"
35
+          style="height: auto; display: flex; flex-direction: column"
36
+        >
32
           <div class="welcome">
37
           <div class="welcome">
33
             <el-card class="box-card">
38
             <el-card class="box-card">
34
-              <div class="welcome-title"> {{ welcome }} <span style="margin-left: 5px;"> {{ $dateUtils.formatNow() }} </span></div>
39
+              <div class="welcome-title">
40
+                {{ welcome }}
41
+                <span style="margin-left: 5px">
42
+                  {{ $dateUtils.formatNow() }}
43
+                </span>
44
+              </div>
35
             </el-card>
45
             </el-card>
36
           </div>
46
           </div>
37
           <el-image
47
           <el-image
38
             v-if="birdsEye"
48
             v-if="birdsEye"
39
             :src="birdsEye"
49
             :src="birdsEye"
40
-            style="max-height:520px;flex: 1"
41
-            fit="fill"></el-image>
42
-<!--          <el-tabs type="border-card" style="min-height: 500px;">-->
43
-<!--            <el-tab-pane label="粮情">-->
44
-<!--              <div style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;">-->
45
-<!--              -->
46
-<!--              </div>-->
47
-<!--            </el-tab-pane>-->
48
-<!--&lt;!&ndash;            <el-tab-pane label="监控"></el-tab-pane>&ndash;&gt;-->
49
-<!--          </el-tabs>-->
50
+            style="max-height: 520px; flex: 1"
51
+            fit="fill"
52
+          ></el-image>
53
+          <!--          <el-tabs type="border-card" style="min-height: 500px;">-->
54
+          <!--            <el-tab-pane label="粮情">-->
55
+          <!--              <div style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;">-->
56
+          <!--              -->
57
+          <!--              </div>-->
58
+          <!--            </el-tab-pane>-->
59
+          <!--&lt;!&ndash;            <el-tab-pane label="监控"></el-tab-pane>&ndash;&gt;-->
60
+          <!--          </el-tabs>-->
50
         </div>
61
         </div>
51
         <div class="right">
62
         <div class="right">
52
           <el-card class="box-card">
63
           <el-card class="box-card">
53
             <div slot="header" class="clearfix">
64
             <div slot="header" class="clearfix">
54
               <span>当前作业</span>
65
               <span>当前作业</span>
55
             </div>
66
             </div>
56
-            <div class="text item">
57
-            </div>
67
+            <div class="text item"></div>
58
           </el-card>
68
           </el-card>
59
           <el-card class="box-card">
69
           <el-card class="box-card">
60
             <div slot="header" class="clearfix">
70
             <div slot="header" class="clearfix">
61
               <span>库存/库容比</span>
71
               <span>库存/库容比</span>
62
             </div>
72
             </div>
63
             <div class="text item">
73
             <div class="text item">
64
-              <el-image :src="require('@/assets/wisdom_images/chart1.png')"></el-image>
74
+              <el-image
75
+                :src="require('@/assets/wisdom_images/chart1.png')"
76
+              ></el-image>
65
             </div>
77
             </div>
66
           </el-card>
78
           </el-card>
67
           <el-card class="box-card">
79
           <el-card class="box-card">
@@ -69,7 +81,9 @@
69
               <span>储粮等级(单位: 吨)</span>
81
               <span>储粮等级(单位: 吨)</span>
70
             </div>
82
             </div>
71
             <div class="text item">
83
             <div class="text item">
72
-              <el-image :src="require('@/assets/wisdom_images/chart2.png')"></el-image>
84
+              <el-image
85
+                :src="require('@/assets/wisdom_images/chart2.png')"
86
+              ></el-image>
73
             </div>
87
             </div>
74
           </el-card>
88
           </el-card>
75
         </div>
89
         </div>
@@ -80,7 +94,9 @@
80
             <span>五温曲线图</span>
94
             <span>五温曲线图</span>
81
           </div>
95
           </div>
82
           <div class="text item">
96
           <div class="text item">
83
-            <el-image :src="require('@/assets/wisdom_images/chart3.png')"></el-image>
97
+            <el-image
98
+              :src="require('@/assets/wisdom_images/chart3.png')"
99
+            ></el-image>
84
           </div>
100
           </div>
85
         </el-card>
101
         </el-card>
86
         <el-card class="box-card">
102
         <el-card class="box-card">
@@ -88,32 +104,40 @@
88
             <span>粮食品种(单位: 吨)</span>
104
             <span>粮食品种(单位: 吨)</span>
89
           </div>
105
           </div>
90
           <div class="text item">
106
           <div class="text item">
91
-            <el-image :src="require('@/assets/wisdom_images/chart3.png')"></el-image>
107
+            <el-image
108
+              :src="require('@/assets/wisdom_images/chart3.png')"
109
+            ></el-image>
92
           </div>
110
           </div>
93
         </el-card>
111
         </el-card>
94
       </div>
112
       </div>
95
     </div>
113
     </div>
96
   </div>
114
   </div>
115
+  <div v-else class="content-wrap" style="width: 100vw; height: 86vh">
116
+    <iframe
117
+      id="iframeContainer"
118
+      :src="url"
119
+      style="width: 100%; height: 100%"
120
+    ></iframe>
121
+  </div>
97
 </template>
122
 </template>
98
 
123
 
99
 <script>
124
 <script>
100
-
101
-import commonSelect from "@/components/common/commonSelect"
102
-import { mapGetters } from 'vuex'
103
-import {depotImageList} from "@/api/system";
125
+import commonSelect from "@/components/common/commonSelect";
126
+import { mapGetters } from "vuex";
127
+import { depotImageList } from "@/api/system";
104
 export default {
128
 export default {
105
   name: "home",
129
   name: "home",
106
   components: {
130
   components: {
107
-    commonSelect
131
+    commonSelect,
108
   },
132
   },
109
   data() {
133
   data() {
110
     return {
134
     return {
111
-      welcome: '',
112
-      desc: '',
135
+      welcome: "",
136
+      desc: "",
113
       limit: {
137
       limit: {
114
         page: 1,
138
         page: 1,
115
         size: 10,
139
         size: 10,
116
-        total: 0
140
+        total: 0,
117
       },
141
       },
118
       depotImages: [],
142
       depotImages: [],
119
       tableData: [],
143
       tableData: [],
@@ -125,33 +149,45 @@ export default {
125
       listLoading: false,
149
       listLoading: false,
126
       addShow: false,
150
       addShow: false,
127
       birdsEye: null,
151
       birdsEye: null,
152
+      url: "",
153
+    };
154
+  },
155
+  created() {
156
+    const u = localStorage.getItem("_userName");
157
+    const p = localStorage.getItem("_password");
158
+    const isProd = process.env.NODE_ENV === "production";
159
+    // let url;
160
+    if (!isProd) {
161
+      this.url = `http://101.36.160.210:31055/crk/?k_username=${u}&k_password=${p}`;
162
+    } else {
163
+      this.url = `http://172.18.93.228:80/#/welcome?username=${u}&password=${p}`;
128
     }
164
     }
129
   },
165
   },
130
   computed: {
166
   computed: {
131
-    ...mapGetters(['orgName', 'orgId']),
167
+    ...mapGetters(["orgName", "orgId"]),
132
   },
168
   },
133
   mounted() {
169
   mounted() {
134
-    this.welcome = this.orgName + '欢迎您'
135
-    this.desc = this.$store.state.user.orgInfo.briefIntroduction
136
-    const orgInfo = JSON.parse(sessionStorage.getItem('orgInfo'))
137
-    console.log('orgInfo', orgInfo)
138
-    this.birdsEye = orgInfo.birdsEye
139
-    this.getDeopImages()
170
+    this.welcome = this.orgName + "欢迎您";
171
+    this.desc = this.$store.state.user.orgInfo.briefIntroduction;
172
+    const orgInfo = JSON.parse(sessionStorage.getItem("orgInfo"));
173
+    console.log("orgInfo", orgInfo);
174
+    this.birdsEye = orgInfo.birdsEye;
175
+    this.getDeopImages();
140
   },
176
   },
141
   methods: {
177
   methods: {
142
     getDeopImages() {
178
     getDeopImages() {
143
-      depotImageList({orgId: this.orgId}).then(resp => {
144
-        const list = resp || []
145
-        this.depotImages = list
146
-        console.log('轮播图片', list)
147
-      })
179
+      depotImageList({ orgId: this.orgId }).then((resp) => {
180
+        const list = resp || [];
181
+        this.depotImages = list;
182
+        console.log("轮播图片", list);
183
+      });
148
     },
184
     },
149
     goTodo() {
185
     goTodo() {
150
-      this.$store.commit('SET_TOP_MENU_INDEX', 1)
151
-      this.$router.push({ path: '/toDoNav/toDoThings' })
152
-    }
153
-  }
154
-}
186
+      this.$store.commit("SET_TOP_MENU_INDEX", 1);
187
+      this.$router.push({ path: "/toDoNav/toDoThings" });
188
+    },
189
+  },
190
+};
155
 </script>
191
 </script>
156
 
192
 
157
 <style scoped lang="scss">
193
 <style scoped lang="scss">
@@ -167,7 +203,7 @@ export default {
167
   }
203
   }
168
 
204
 
169
   .main-column {
205
   .main-column {
170
-    margin-left:5px;
206
+    margin-left: 5px;
171
     width: 76%;
207
     width: 76%;
172
   }
208
   }
173
 }
209
 }
@@ -182,7 +218,6 @@ export default {
182
 }
218
 }
183
 
219
 
184
 .welcome {
220
 .welcome {
185
-
186
 }
221
 }
187
 
222
 
188
 .welcome-title {
223
 .welcome-title {
@@ -224,5 +259,4 @@ export default {
224
 //.el-carousel__item:nth-child(2n+1) {
259
 //.el-carousel__item:nth-child(2n+1) {
225
 //  background-color: #d3dce6;
260
 //  background-color: #d3dce6;
226
 //}
261
 //}
227
-
228
 </style>
262
 </style>