0714Star 9 months ago
parent
commit
d84584d12b

+ 0 - 1
.idea/vcs.xml

@@ -2,6 +2,5 @@
 <project version="4">
   <component name="VcsDirectoryMappings">
     <mapping directory="$PROJECT_DIR$" vcs="Git" />
-    <mapping directory="$PROJECT_DIR$/InsectNew/khandy" vcs="Git" />
   </component>
 </project>

+ 9 - 1
display_model_for_smartagriculture/src/App.vue

@@ -1,4 +1,6 @@
 <template>
+  <div class="container">
+
   <transition name="bounce">
     <welcome v-if="welcome" @loaddingend="loaddingend"></welcome>
   </transition>
@@ -162,6 +164,9 @@
       </div>
     </div>
   </transition>
+
+
+  </div>
 </template>
 
 <script>
@@ -386,7 +391,10 @@ export default {
 }
 </script>
 
-<style>
+<style scoped>
+.container{
+
+}
 .flex {
   display: flex;
 }

BIN
vue/src/assets/audio/提示音.mp3


BIN
vue/src/assets/imgs/bg.jpg


BIN
vue/src/assets/imgs/lunbo1.jpg


BIN
vue/src/assets/imgs/query_result.png


+ 0 - 0
vue/src/assets/jk1.mp4 → vue/src/assets/video/jk1.mp4


+ 0 - 0
vue/src/assets/jk2.mp4 → vue/src/assets/video/jk2.mp4


+ 1 - 0
vue/src/main.js

@@ -17,6 +17,7 @@ Vue.prototype.$monment = monment
 Vue.prototype.$echarts= echarts
 Vue.prototype.$request = request
 Vue.prototype.$baseUrl = process.env.VUE_APP_BASEURL
+Vue.prototype.$flaskUrl= process.env.VUE_APP_FLASKURL
 Vue.use(ElementUI, {size: "small"})
 new Vue({
     router,

+ 1 - 1
vue/src/router/index.js

@@ -29,7 +29,7 @@ const routes = [
       { path: 'shopStatements', name: 'ShopStatements', meta: { name: '店铺报表' }, component: () => import('../views/manager/Shop/ShopStatements.vue') },
       { path: 'monitor', name: 'Monitor', meta: { name: '农村监控模块' }, component: () => import('../views/manager/AI/Monitor.vue') },
       { path: 'pestAnalysis', name: 'PestAnalysis', meta: { name: '害虫识别模块' }, component: () => import('../views/manager/AI/PestAnalysis.vue') },
-      // { path: 'audit', name: 'Audit', meta: { name: '店铺申请审核' }, component: () => import('../views/manager/Manager/Audit.vue') },
+      { path: 'audit', name: 'Audit', meta: { name: '店铺申请审核' }, component: () => import('../views/front/ApplyForUp.vue') },
     ]
   },
   { // 这是管理员界面/orders/selectPage

+ 3 - 2
vue/src/views/Login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="container">
     <div style="width: 400px; padding: 30px; background-color: white; border-radius: 5px;">
-      <div style="text-align: center; font-size: 20px; margin-bottom: 20px; color: #333">欢迎使用123</div>
+      <div style="text-align: center; font-size: 20px; margin-bottom: 20px; color: #333">欢迎登陆</div>
       <el-form :model="form" :rules="rules" ref="formRef">
         <el-form-item prop="username">
           <el-input prefix-icon="el-icon-user" placeholder="请输入账号" v-model="form.username"></el-input>
@@ -27,7 +27,8 @@
         <div style="display: flex; align-items: center">
           <div style="flex: 1"></div>
           <div style="flex: 1; text-align: right">
-            <el-link @click="wxLogin()"> 微信登录 </el-link>  注册店家: <a href="/register">注册</a>
+<!--            <el-link @click="wxLogin()"> 微信登录 </el-link>  -->
+            注册店家: <a href="/register">注册</a>
           </div>
         </div>
       </el-form>

+ 26 - 12
vue/src/views/Manager.vue

@@ -84,7 +84,7 @@
 <!--          </el-submenu>-->
           <el-submenu index = 'Charts'>
             <template slot="title">
-              <i class="el-icon-menu"></i><span>报表</span>
+              <i class="el-icon-menu"></i><span>物联网设备查看</span>
             </template>
             <template>
               <div class="centered-link">
@@ -102,7 +102,9 @@
         <router-view @update:user="updateUser" />
       </div>
     </div>
-
+  <audio ref="audioPlayer" muted="muted"src="../assets/audio/提示音.mp3" >
+<!--    <source >-->
+  </audio>
   </div>
 </template>
 
@@ -113,7 +115,9 @@ export default {
     return {
       user: JSON.parse(localStorage.getItem('xm-user') || '{}'),
       linkUrl: 'http://localhost:3000/#/index',
-      ordersCount:null
+      audioUrl: '@/assets/audio/提示音.mp3',
+      ordersCount:null,
+      timer:null,
     }
   },
   created() {
@@ -121,24 +125,34 @@ export default {
       this.$message.error("请登陆后重试!")
       this.$router.push('/login')
     }
+    // TODO 计时器
+    this.timer =  setInterval(this.getUnfinishedNums, 1000)
+  },
+  unmounted() {
+    clearTimeout(this.timer)
   },
   methods: {
     updateUser() {
       this.user = JSON.parse(localStorage.getItem('xm-user') || '{}')   // 重新获取下用户的最新信息
     },
     goToPerson() {
-        this.$router.push('/adminMgr/applyForUp')
+        this.$router.push('/audit')
     },
     logout() {
       localStorage.removeItem('xm-user')
       this.$router.push('/login')
       this.$message.success("成功退出登陆")
     },
-    // async getUnfinishedNums(){
-    //   const res = await this.$request.get("/orders/getnums/"+this.user)
-    //   console.log(res,"async")
-    //   return res.data;
-    // }
+    getUnfinishedNums(){
+      this.$request.get("/orders/getnums/"+this.user?.storeId).then(res=>{
+        if(res.data>this.ordersCount){
+          // console.log(this.$refs.audioPlayer)
+          this.$refs.audioPlayer.play(); // 播放音效
+        }
+        this.ordersCount = res.data==0?null:res.data
+      })
+
+    }
   }
 }
 </script>
@@ -150,10 +164,10 @@ export default {
 }
 
 .custom-link {
-  color: red; /* 设置链接文本颜色为红色 */
-  text-decoration: underline; /* 添加下划线效果 */
+  color: #d3d3d3; /* 设置链接文本颜色为红色 */
+  //text-decoration: underline; /* 添加下划线效果 */
   cursor: pointer; /* 修改鼠标指针样式为手型 */
-  font-size: 16px; /* 设置字体大小为16像素 */
+  font-size: 14px; /* 设置字体大小为16像素 */
   /* 这里你可以添加其他样式以符合你的设计需求 */
 }
 @import "@/assets/css/manager.css";

+ 1 - 1
vue/src/views/Register.vue

@@ -85,7 +85,7 @@ export default {
 .container {
   height: 100vh;
   overflow: hidden;
-  background-image: url("@/assets/imgs/bg1.jpg");
+  background-image: url("@/assets/imgs/bg.jpg");
   background-size: 100%;
   display: flex;
   align-items: center;

+ 12 - 2
vue/src/views/front/ApplyForUp.vue

@@ -83,6 +83,9 @@ export default {
     updateFarm(data){this.formData.picsUrl= data[0].url},//农村图片
     updateDeleFarm(data){this.formData.picsUrl = null},//删除选中的图片
     showCheck(data){this.isSubmit = false},
+    backHome(){
+      this.$router.push('/home')
+    }
   }
 }
 
@@ -139,11 +142,18 @@ export default {
     </el-form>
 
   </el-card>
-  <el-card v-if="isSubmit">
+  <el-card v-if="isSubmit && this.state != '审核通过'">
 <!--    显示申请状态-->
     <el-tag >{{state}}</el-tag>
 <!--    点击查看申请列表  -->
-    <el-button @click="showCheck()"></el-button>
+<!--    <el-button @click="showCheck()">查看详情</el-button>-->
+  </el-card>
+  <el-card v-if="isSubmit && this.state=='审核通过'" >
+    <el-result icon="success" title="审核已通过" subTitle="欢迎您使用">
+      <template slot="extra">
+        <el-button type="primary" size="medium" @click="backHome()">返回</el-button>
+      </template>
+    </el-result>
   </el-card>
 </div>
 </template>

+ 24 - 16
vue/src/views/manager/AI/CorpGrown.vue

@@ -8,7 +8,9 @@
             <img class="user-img" :src="this.store?.storePicUrl" />
             <ul>
               <li style="list-style-type: none;">{{this.user.role}}</li>
+              <el-divider></el-divider>
               <li style="list-style-type: none;">{{this.user?.name}}</li>
+              <el-divider></el-divider>
               <i class="el-icon-s-check">
                 <el-tag type="success">认证成功</el-tag>
               </i>
@@ -17,14 +19,16 @@
 
           </div>
           <ul class="login-info">
-            <li>当前时间:<span>{{this.time}}</span></li>
-            <li>上次登录地址:<span>日本-我孙子市</span></li>
+            <li style="list-style: none">北京时间:<span>{{this.time}}</span>
+            </li>
+            <li style="list-style: none">上次登录地址:<el-divider direction="vertical"></el-divider> <span>江西省</span> <el-divider direction="vertical"></el-divider> <span>南昌市</span>
+            </li>
           </ul>
         </el-card>
 
 
         <el-card class="table" shadow="always">
-          <el-table :data="todayData" style="width: 100%">
+          <el-table :data="todayData" height="380" style="width: 100%;">
             <el-table-column
                 v-for="(val, key) in labelToday"
                 :key="key"
@@ -80,7 +84,7 @@ import * as DateUtil from "/src/utils/DateUtil";
 export default {
   data() {
     return {
-      user:[], //用户本地信息
+      user: JSON.parse(localStorage.getItem('xm-user') || '{}'),
       store:[], //店铺信息
       XYData:{monthX:[],barProductNames:[],
         barLastMonthAmount:[],barLastMonthCount:[], //上月
@@ -89,9 +93,9 @@ export default {
       YMax:{saleMax:0}, //店铺营销额Y轴
       labelToday:{
         productName:"商品名称",
-        productTypeName:"商品类型",
-        count: "销量",
-        amount: "今日金额",
+        // productTypeName:"商品类型",
+        count: "销量",
+        amount: "金额",
       },
       todayData:[], // 当天的订单列表
       factData:[],
@@ -134,13 +138,15 @@ export default {
           color: "#5ab1ef",
         },
       ],
-      time:new Date(),
+      timer:null,
+      time:Date.now(),
     };
   },
 
   async mounted() {
-
-    this.user = JSON.parse(localStorage.getItem('xm-user') || '{}')   // 重新获取下用户的最新信息
+    this.timer = setInterval(()=>{
+      this.time =new Date().toLocaleTimeString()
+    },1000)
     await this.loadData()
     // 基于准备好的dom,初始化echarts实例
     var bar = echarts.init(document.getElementById("bar"));
@@ -277,7 +283,7 @@ export default {
     pie.setOption({
       title: {
         left: "center",
-        text: "营业总收入季度分布图",
+        text: "24年营业总收入季度分布图",
         textStyle: {
           color: "#6d6",
         },
@@ -366,7 +372,7 @@ export default {
     });
   },
   methods:{
-
+    hilarity(){},
     /**
      * 数据加载
      */
@@ -377,8 +383,8 @@ export default {
         that.store = await that.loadStore();
         that.store = that.store[0]
         console.log(that.store,"??",that.store?.storePicUrl)
-        that.todayData = await that.loadAccountByBatch([1, 2], "2024-01-01", "2024-05-03")
-
+        that.todayData = await that.loadAccountByBatch(that.store?.productsIds)
+        that.todayData = that.todayData.filter(data=>{return  data!=null})
         // 加载月销量数据
         const monthAndSeason = await that.loadFactData();
         that.factData = monthAndSeason["monthAccount"]
@@ -408,9 +414,10 @@ export default {
     async loadAccountByBatch( list,from,end){
       const res = await this.$request.post("/saleStatement/getByPIdBatch",{
         productIds:list,
-        timeStart: from,
-        timeOver: end
+        timeStart: from?from:"0000-01-01",
+        timeOver: end?end:"9999-12-31"
       })
+      console.log(res,"AccountByBAtch")
       return res.data;
     },
     async loadFactData(){// 加载月销量数据和
@@ -435,6 +442,7 @@ export default {
           timeOver: DateUtil.getCurrentDate()
         }
       })
+      console.log(res,resCur,"上月-当月")
       return {
         curMonth:resCur.data,
         lastMonth:res.data,

+ 1 - 2
vue/src/views/manager/AI/Monitor.vue

@@ -6,7 +6,7 @@ export default {
   },
   data(){
     return{
-      videoUrl:require("@/assets/video/监控视频.mp4"),
+      videoUrl:require("@/assets/video/jk1.mp4"),
       img:require("@/assets/imgs/bg.jpg")
     }
   }
@@ -23,7 +23,6 @@ export default {
 <div>
   <el-col style="align-items: center">
     <el-card >
-      <!--    <HLSPlay ref="hlsplayRef" :src="videoUrl" :cover_url="img" ></HLSPlay>-->
       <el-row>
         <video :src="videoUrl" width="70%" height="auto" controls="controls" autoplay="false"></video>
       </el-row>

+ 73 - 17
vue/src/views/manager/AI/PestAnalysis.vue

@@ -1,35 +1,89 @@
 <template>
 
   <div class="container">
-    <div class="row">
-      <div class="col-md-6">
-        <h2>上传结果</h2>
-        <pre>{{ uploadResult }}</pre>
-      </div>
-      <div class="col-md-6">
-        <h2>返回结果</h2>
-        <pre>{{ returnResult }}</pre>
-      </div>
+
+    <div class="result-container">
+<!--      <span style="width: 400px;height: 300px">自定义</span>-->
+      <el-skeleton style="width:600px;height: 300px" :loading="isLoading" animated>
+        <template slot="template">
+          <el-skeleton-item
+              variant="image"
+              style="width: 600px; height: 300px;"
+          />
+          <div style="padding: 14px;">
+            <el-skeleton-item variant="h3" style="width: 50%;" />
+            <div
+                style="display: flex; align-items: center; justify-items: space-between; margin-top: 16px; height: 16px;"
+            >
+              <el-skeleton-item variant="text" style="margin-right: 16px;" />
+              <el-skeleton-item variant="text" style="width: 30%;" />
+            </div>
+          </div>
+        </template>
+        <template>
+          <el-card :body-style="{ padding: '0px', marginBottom: '1px' }">
+            <img
+                :src="resPic"
+                class="image"
+                width="auto"
+                height="300px"
+            />
+            <div style="padding: 14px;">
+              <span>检测结果</span>
+
+            </div>
+          </el-card>
+        </template>
+      </el-skeleton>
+
+<!--      <el-card style="width: 700px;height: 300px">-->
+<!--&lt;!&ndash;      &ndash;&gt;-->
+<!--      <el-image  :src="resPic" v-if="resPic!=null">-->
+<!--        <div slot="placeholder" class="image-slot">-->
+<!--          加载结果<span class="dot">...</span>-->
+<!--        </div>-->
+<!--      </el-image>-->
+<!--    </el-card>-->
+    </div>
+
+    <div class="upload-container">
+      <el-upload
+          class="avatar-uploader"
+          :action="$baseUrl + '/files/upload'"
+          :headers="{ token: user.token }"
+          list-type="picture"
+          :on-success="handleUploadSuccess"
+      >
+        <el-button type="primary">上传商品害虫图片</el-button>
+      </el-upload>
     </div>
+
+
   </div>
 
 </template>
 
 <script>
+
 export default {
   name: "PestAnalysis",
   data() {
     return {
+      user :JSON.parse(localStorage.getItem('xm-user') || '{}'),
       uploadResult: null,
       returnResult: null,
       flaskBaseUrl: process.env.VUE_FLASK_BASEURL, // Flask地址
+      resPic:null,
+      isLoading:false,
     };
   },
   methods: {
-    handleUploadChange(file) {
-      // 模拟上传成功后的处理
-
-      // 模拟接收返回结果
+    handleUploadSuccess(file) {
+      this.isLoading = true;
+      setTimeout(()=>{
+        this.resPic = require("/src/assets/imgs/query_result.png")
+        this.isLoading = false; // 加载完成
+      },2000)
       return file
     }
   }
@@ -43,17 +97,19 @@ export default {
   background-image: url("@/assets/imgs/bg.jpg");
   background-size: 100%;
   display: flex;
+  flex-direction: column;
   align-items: center;
   justify-content: center;
   color: #666;
 }
 
+.upload-container, .result-container {
+  text-align: center;
+  margin-top: 50px;
 
-.upload-area {
-  margin-top: 20px;
 }
 
-.result-area {
-  margin-top: 20px;
+.result-container {
+  margin-top: 20px; /* 调整上方间距 */
 }
 </style>

+ 17 - 5
vue/src/views/manager/Home.vue

@@ -31,6 +31,11 @@
         </div>
       </el-card>
     </el-col>
+     <el-col :span="8">
+       <div id="lunbo" style="margin: 5px">
+        <el-image :src='imgUrls'></el-image>
+       </div>
+     </el-col>
 <!--    <el-col :span="18"></el-col>-->
      <el-col :span="8">
        <el-card>
@@ -39,20 +44,20 @@
            <el-tag type="success">认证成功</el-tag>
          </i>
          <el-divider></el-divider>
-         <el-row>
+         <el-row >
           <span>店铺功能</span>
          </el-row>
-         <el-row>
-           <el-calendar :range="['2019-03-04', '2019-03-24']"> </el-calendar>
-         </el-row>
+
        </el-card>
      </el-col>
+
    </el-row>
   </div>
 </template>
 
 <script>
 
+
 export default {
   name: 'Home',
   data() {
@@ -68,7 +73,8 @@ export default {
         color: '#0bbd87'
       }, {
         size: 'large'
-      }]
+      }],
+      imgUrls: require('@/assets/imgs/lunbo1.jpg')
     }
   },
   created() {
@@ -78,3 +84,9 @@ export default {
   }
 }
 </script>
+
+<style>
+#lunbo{
+
+}
+</style>

+ 11 - 7
vue/src/views/manager/Shop/ShopOrders.vue

@@ -205,16 +205,19 @@
 <!--          {{formProductDetails.user?.phone}}-->
 <!--        </el-descriptions-item>-->
 <!--      </el-descriptions>-->
-      <!--      下单商品  -->
-      <el-table :data="formProductDetails.products" style="margin-top: 5px">
-        <el-table-column prop="name" label="商品名称">
+      <!--      下单商品FPD  -->
+      <el-table :data="formProductDetails.orderProductsLists" style="margin-top: 5px">
+        <el-table-column prop="productName" label="商品名称">
         </el-table-column>
-        <el-table-column prop="originPay" label="商品原价价格">
+        <el-table-column prop="count" label="商品数量">
+          <template v-slot="scope">
+            <span icon="el-icon-close"></span> {{scope.row.count}}
+          </template>
         </el-table-column>
-        <el-table-column prop="avatar" label="图片">
+        <el-table-column prop="productIcons" label="图片">
           <template v-slot="scope">
             <div>
-              <el-image style="width: 50px; height: 50px" :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]"/>
+              <el-image style="width: 50px; height: 50px" :src="scope.row.productIcons" :preview-src-list="[scope.row.avatar]"/>
             </div>
           </template>
         </el-table-column>
@@ -335,10 +338,11 @@ export default {
     handleCurrentChange(pageNum) {
       this.load(pageNum)
     },
-    showDetails(row){
+    showDetails(row){ // FPD
       console.log("showDetails",row)
       this.fromProductsVisible = true;
       this.formProductDetails = JSON.parse(JSON.stringify(row));
+      console.log(row,"row")
     },
     gettagByState(state){
       return this.STATE_COLOR[state]

+ 2 - 6
vue/src/views/manager/Shop/ShopProducts.vue

@@ -101,11 +101,7 @@
 
 
         </el-form-item>
-<!--        <el-form-item label="产品类型ids" prop="productTypeIds">-->
-<!--          <el-input v-model="form.productTypeIds" placeholder="产品类型ids">-->
 
-<!--          </el-input>-->
-<!--        </el-form-item>-->
         <el-form-item label="定价" prop="productBidPrice">
 <!--          <el-input v-model="form.productBidPrice" placeholder="定价"></el-input>-->
           <el-input-number v-model="form.productBidPrice" :step="1" step-strictly></el-input-number>
@@ -123,7 +119,7 @@
           </el-tag>
         </el-form-item>
 
-<!--TODO-->
+<!--TODO ADD-->
         <el-form-item label="添加商品" prop="productTypeIds">
           <el-select v-model="form.type" placeholder="请选择">
             <el-option
@@ -301,7 +297,7 @@ export default {
     addToSubList() {
       console.log(this.productTypeList);
       let pId = this.form.type;
-      if (this.form.productType == null || this.form.productType.length === 0) {
+      if (this.form.productTypes == null || this.form.productTypes.length === 0) {
         for (let item of this.productTypeList) {
           if (item.id === pId) {
             this.$set(this.form, 'productTypes', [item]);