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 44
     // Applications
45 45
   },
46 46
   data() {
47
-    const u = localStorage.getItem("_userName");
48
-    const p = localStorage.getItem("_password");
49 47
     return {
50 48
       id: this.$route.params.id,
51 49
       dat: {
@@ -56,9 +54,22 @@ export default {
56 54
       p: localStorage.getItem("_password"),
57 55
       clientHeight: document.documentElement.clientHeight,
58 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 73
   computed: {
63 74
     wrapHeight() {
64 75
       return this.clientHeight - 70 - 40;

+ 82 - 48
src/page/home.vue

@@ -1,12 +1,14 @@
1 1
 <template>
2
-  <div class="content-main multi-column">
2
+  <div class="content-main multi-column" v-if="$store.state.flag == 2">
3 3
     <div class="column aside-column full-column">
4 4
       <el-card class="box-card">
5 5
         <div slot="header" class="clearfix">
6 6
           <span>待办事项</span>
7 7
         </div>
8 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 12
         </div>
11 13
       </el-card>
12 14
       <el-card class="box-card">
@@ -28,40 +30,50 @@
28 30
     </div>
29 31
     <div class="column main-column full-column">
30 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 37
           <div class="welcome">
33 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 45
             </el-card>
36 46
           </div>
37 47
           <el-image
38 48
             v-if="birdsEye"
39 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 61
         </div>
51 62
         <div class="right">
52 63
           <el-card class="box-card">
53 64
             <div slot="header" class="clearfix">
54 65
               <span>当前作业</span>
55 66
             </div>
56
-            <div class="text item">
57
-            </div>
67
+            <div class="text item"></div>
58 68
           </el-card>
59 69
           <el-card class="box-card">
60 70
             <div slot="header" class="clearfix">
61 71
               <span>库存/库容比</span>
62 72
             </div>
63 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 77
             </div>
66 78
           </el-card>
67 79
           <el-card class="box-card">
@@ -69,7 +81,9 @@
69 81
               <span>储粮等级(单位: 吨)</span>
70 82
             </div>
71 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 87
             </div>
74 88
           </el-card>
75 89
         </div>
@@ -80,7 +94,9 @@
80 94
             <span>五温曲线图</span>
81 95
           </div>
82 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 100
           </div>
85 101
         </el-card>
86 102
         <el-card class="box-card">
@@ -88,32 +104,40 @@
88 104
             <span>粮食品种(单位: 吨)</span>
89 105
           </div>
90 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 110
           </div>
93 111
         </el-card>
94 112
       </div>
95 113
     </div>
96 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 122
 </template>
98 123
 
99 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 128
 export default {
105 129
   name: "home",
106 130
   components: {
107
-    commonSelect
131
+    commonSelect,
108 132
   },
109 133
   data() {
110 134
     return {
111
-      welcome: '',
112
-      desc: '',
135
+      welcome: "",
136
+      desc: "",
113 137
       limit: {
114 138
         page: 1,
115 139
         size: 10,
116
-        total: 0
140
+        total: 0,
117 141
       },
118 142
       depotImages: [],
119 143
       tableData: [],
@@ -125,33 +149,45 @@ export default {
125 149
       listLoading: false,
126 150
       addShow: false,
127 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 166
   computed: {
131
-    ...mapGetters(['orgName', 'orgId']),
167
+    ...mapGetters(["orgName", "orgId"]),
132 168
   },
133 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 177
   methods: {
142 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 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 191
 </script>
156 192
 
157 193
 <style scoped lang="scss">
@@ -167,7 +203,7 @@ export default {
167 203
   }
168 204
 
169 205
   .main-column {
170
-    margin-left:5px;
206
+    margin-left: 5px;
171 207
     width: 76%;
172 208
   }
173 209
 }
@@ -182,7 +218,6 @@ export default {
182 218
 }
183 219
 
184 220
 .welcome {
185
-
186 221
 }
187 222
 
188 223
 .welcome-title {
@@ -224,5 +259,4 @@ export default {
224 259
 //.el-carousel__item:nth-child(2n+1) {
225 260
 //  background-color: #d3dce6;
226 261
 //}
227
-
228 262
 </style>