Forráskód Böngészése

1. 智慧餐厅面板筛选框样式已调整;2.运营分析对应名称修改

Bella 2 éve
szülő
commit
5ee4bfabcd

+ 1 - 1
src/components/breadcrumb/iotBreadcrumb.vue

@@ -51,7 +51,7 @@ export default {
   height: 40px; 
   margin: 10px 10px;
   border-radius: 4px;
-  background-color: #ffffff;
+  // background-color: #ffffff;
   padding-top: 10px;
   padding-left: 30px;
   font-size: 14px;

+ 15 - 15
src/components/business/analysis/analysis.vue

@@ -176,54 +176,54 @@ export default {
             </card>
             <card :title="'用水趋势'" v-else-if="queryData.energy == 'water'">
               <div class="analysis-energy-body-left">
-                <BusinessElectricChart
+                <BusinessWaterChart
                   ref="anaChart"
                   :query-data="queryData"
                   :height="430"
-                ></BusinessElectricChart>
+                ></BusinessWaterChart>
               </div>
             </card>
             <card :title="'用热趋势'" v-else-if="queryData.energy == 'hot'">
               <div class="analysis-energy-body-left">
                 <div style="margin-top: 15px">
-                  <BusinessElectricChart
+                  <BusinessHotChart
                     ref="anaChart"
                     :query-data="queryData"
                     :height="450"
-                  ></BusinessElectricChart>
+                  ></BusinessHotChart>
                 </div>
               </div>
             </card>
             <card :title="'用冷趋势'" v-else-if="queryData.energy == 'cold'">
               <div class="analysis-energy-body-left">
                 <div style="margin-top: 15px">
-                  <BusinessElectricChart
+                  <BusinessColdChart
                     ref="anaChart"
                     :query-data="queryData"
                     :height="450"
-                  ></BusinessElectricChart>
+                  ></BusinessColdChart>
                 </div>
               </div>
             </card>
             <card :title="'光伏趋势'" v-else-if="queryData.energy == 'pv'">
               <div class="analysis-energy-body-left">
                 <div style="margin-top: 15px">
-                  <BusinessElectricChart
+                  <BusinessPvChart
                     ref="anaChart"
                     :query-data="queryData"
                     :height="450"
-                  ></BusinessElectricChart>
+                  ></BusinessPvChart>
                 </div>
               </div>
             </card>
             <card :title="'能源趋势'" v-else-if="queryData.energy == '0'">
               <div class="analysis-energy-body-left">
                 <div style="margin-top: 15px">
-                  <BusinessElectricChart
+                  <BusinessEnergyChart
                     ref="anaChart"
                     :query-data="queryData"
                     :height="450"
-                  ></BusinessElectricChart>
+                  ></BusinessEnergyChart>
                 </div>
               </div>
             </card>
@@ -241,7 +241,7 @@ export default {
             </card>
             <card :title="'用水分析'" v-else-if="queryData.energy == 'water'">
               <div class="analysis-energy-body-right">
-                <BusinessElectricDetail
+                <BusinessWaterDetail
                   ref="anaDetail"
                   :query-data="queryData"
                 />
@@ -250,7 +250,7 @@ export default {
             <card :title="'用热分析'" v-else-if="queryData.energy == 'hot'">
               <div class="analysis-energy-body-right">
                 <div style="margin-top: 15px">
-                  <BusinessElectricDetail
+                  <BusinessHotDetail
                     ref="anaDetail"
                     :query-data="queryData"
                   />
@@ -260,7 +260,7 @@ export default {
             <card :title="'用冷分析'" v-else-if="queryData.energy == 'cold'">
               <div class="analysis-energy-body-right">
                 <div style="margin-top: 15px">
-                  <BusinessElectricDetail
+                  <BusinessColdDetail
                     ref="anaDetail"
                     :query-data="queryData"
                   />
@@ -270,7 +270,7 @@ export default {
             <card :title="'光伏分析'" v-else-if="queryData.energy == 'pv'">
               <div class="analysis-energy-body-right">
                 <div style="margin-top: 15px">
-                  <BusinessElectricDetail
+                  <BusinessPvDetail
                     ref="anaDetail"
                     :query-data="queryData"
                   />
@@ -280,7 +280,7 @@ export default {
             <card :title="'能源分析'" v-else-if="queryData.energy == '0'">
               <div class="analysis-energy-body-right">
                 <div style="margin-top: 15px">
-                  <BusinessElectricDetail
+                  <BusinessEnergyDetail
                     ref="anaDetail"
                     :query-data="queryData"
                   />

+ 113 - 57
src/components/common/query.vue

@@ -2,36 +2,92 @@
   <div class="ioc-query-form">
     <a-form layout="inline" :form="formData">
       <a-form-item label="单位名称:" class="formItem" v-if="visible.company">
-        <a-select default-value="0" style="width: 200px" v-model="formData.companyId">
+        <a-select
+          default-value="0"
+          style="width: 200px"
+          v-model="formData.companyId"
+        >
           <!--<a-select-option value="0"> 全部 </a-select-option>-->
-          <a-select-option v-for="item in companyData" :key="item.value" :value="item.value"> {{ item.label }} </a-select-option>
+          <a-select-option
+            v-for="item in companyData"
+            :key="item.value"
+            :value="item.value"
+          >
+            {{ item.label }}
+          </a-select-option>
         </a-select>
       </a-form-item>
       <a-form-item label="部门名称:" class="formItem" v-if="visible.dept">
-        <a-select default-value="0" style="width: 200px" v-model="formData.deptId">
+        <a-select
+          default-value="0"
+          style="width: 200px"
+          v-model="formData.deptId"
+        >
           <a-select-option value="0"> 全部 </a-select-option>
-          <a-select-option v-for="item in deptData" :key="item.value" :value="item.value"> {{ item.label }} </a-select-option>
+          <a-select-option
+            v-for="item in deptData"
+            :key="item.value"
+            :value="item.value"
+          >
+            {{ item.label }}
+          </a-select-option>
         </a-select>
       </a-form-item>
       <a-form-item label="楼层:" class="formItem" v-if="visible.floor">
-        <a-select default-value="1" style="width: 120px" v-model="formData.floorId">
-          <a-select-option v-for="item in floorData" :key="item.value" :value="item.value"> {{ item.label }} </a-select-option>
+        <a-select
+          default-value="1"
+          style="width: 120px"
+          v-model="formData.floorId"
+        >
+          <a-select-option
+            v-for="item in floorData"
+            :key="item.value"
+            :value="item.value"
+          >
+            {{ item.label }}
+          </a-select-option>
         </a-select>
       </a-form-item>
       <a-form-item label="能源类型:" class="formItem" v-if="visible.energy">
-        <a-select default-value="0" style="width: 200px" v-model="formData.energy">
+        <a-select
+          default-value="0"
+          style="width: 200px"
+          v-model="formData.energy"
+        >
           <a-select-option value="0"> 全部 </a-select-option>
-          <a-select-option v-for="item in energyData" :key="item.value" :value="item.value"> {{ item.label }} </a-select-option>
+          <a-select-option
+            v-for="item in energyData"
+            :key="item.value"
+            :value="item.value"
+          >
+            {{ item.label }}
+          </a-select-option>
         </a-select>
       </a-form-item>
       <a-form-item label="时间范围:" class="formItem" v-if="visible.time">
-        <timeRange :time-range.sync="formData.timeRange" ref="timeRange" style="width: 250px"></timeRange>
+        <timeRange
+          :time-range.sync="formData.timeRange"
+          ref="timeRange"
+          style="width: 250px"
+        ></timeRange>
       </a-form-item>
       <slot name="extraItem"></slot>
-      <a-form-item class="formItem" style="float: right;margin-right: 3%">
+      <a-form-item class="formItem" style="float: right; margin-right: 3%">
         <a-space size="middle">
-          <a-button type="primary" size="small" style="width: 70px;background-color: #B3B3B3;border: none;" @click="formReset">重置</a-button>
-          <a-button type="primary" size="small" style="width: 70px;" @click="search(formData)">查询</a-button>
+          <a-button
+            type="primary"
+            size="small"
+            style="width: 70px; background-color: #b3b3b3; border: none"
+            @click="formReset"
+            >重置</a-button
+          >
+          <a-button
+            type="primary"
+            size="small"
+            style="width: 70px"
+            @click="search(formData)"
+            >查询</a-button
+          >
         </a-space>
       </a-form-item>
     </a-form>
@@ -51,22 +107,22 @@ export default {
     search: Function,
     floorOptions: Array,
   },
-  emits: ['update:queryData'],
+  emits: ["update:queryData"],
   setup(props, context) {
     const methods = {
       updateFormData(obj) {
-        context.emit('update:queryData', obj)
-      }
-    }
-    return methods
+        context.emit("update:queryData", obj);
+      },
+    };
+    return methods;
   },
   watch: {
     formData: {
       handler: function (val) {
-        this.updateFormData(val)
+        this.updateFormData(val);
       },
       deep: true,
-    }
+    },
   },
   data() {
     return {
@@ -76,7 +132,7 @@ export default {
         floor: false,
         dept: false,
         energy: false,
-        time: false
+        time: false,
       },
       formData: {},
       // 单位数据
@@ -86,8 +142,8 @@ export default {
         //  value: '1'
         //},
         {
-          label: '北京电信规划院',
-          value: '0'
+          label: "北京电信规划院",
+          value: "0",
         },
         //{
         //  label: '上分',
@@ -98,81 +154,81 @@ export default {
       floorData: [
         {
           value: -3,
-          label: "B3"
+          label: "B3",
         },
         {
           value: -2,
-          label: "B2"
+          label: "B2",
         },
         {
           value: -1,
-          label: "B1"
+          label: "B1",
         },
         {
-          value: '1',
-          label: "1F"
+          value: "1",
+          label: "1F",
         },
         {
           value: 7,
-          label: "7F"
+          label: "7F",
         },
         {
           value: 8,
-          label: "8F"
+          label: "8F",
         },
         {
           value: 9,
-          label: "9F"
+          label: "9F",
         },
         {
           value: 21,
-          label: "21F"
-        }
+          label: "21F",
+        },
       ],
       // 部门数据
       deptData: [
         {
-          label: '业务一部',
-          value: '1'
+          label: "业务一部",
+          value: "1",
         },
         {
-          label: '业务二部',
-          value: '2'
+          label: "业务二部",
+          value: "2",
         },
         {
-          label: '业务三部',
-          value: '3'
-        }
+          label: "业务三部",
+          value: "3",
+        },
       ],
       // 能源类型
       energyData: [
         {
-          label: '用电',
-          value: 'electric'
+          label: "用电",
+          value: "electric",
         },
         {
-          label: '用水',
-          value: 'water'
+          label: "用水",
+          value: "water",
         },
         {
-          label: '用热',
-          value: 'hot'
+          label: "用热",
+          value: "hot",
         },
         {
-          label: '用冷',
-          value: 'cold'
+          label: "用冷",
+          value: "cold",
         },
         {
-          label: '光伏',
-          value: 'pv'
-        }
-      ]
+          label: "光伏",
+          value: "pv",
+        },
+      ],
     };
   },
   created() {
     if (this.show) {
       for (let i = 0; i < this.show.length; i++) {
-        this.visible[this.show[i]] = true
+        this.visible[this.show[i]] = true;
       }
     }
   },
@@ -182,8 +238,8 @@ export default {
     }
     if (this.queryData) {
       this.formData = JSON.parse(JSON.stringify(this.queryData));
-      if (this.queryData.floorId == '0') {
-        this.formData.floorId = '1'
+      if (this.queryData.floorId == "0") {
+        this.formData.floorId = "1";
       }
       this.oriQueryData = JSON.parse(JSON.stringify(this.queryData));
     }
@@ -192,8 +248,8 @@ export default {
     formReset() {
       this.formData = JSON.parse(JSON.stringify(this.oriQueryData));
       this.search();
-    }
-  }
+    },
+  },
 };
 </script>
 
@@ -201,4 +257,4 @@ export default {
 .formItem {
   margin: 0px 15px;
 }
-</style>
+</style>

+ 115 - 80
src/components/life/restaurant/lifeRestaurant.vue

@@ -15,49 +15,49 @@ export default {
     let range = this.$util.dateUtil.getNearlyMonthRange();
     return {
       chartsHeight: 290,
-      topSelect: '5',
-      eatTimeSelect: '1',
+      topSelect: "5",
+      eatTimeSelect: "1",
       queryData: {
-        companyId: '0',
-        deptId: '0',
-        timeRange: range
+        companyId: "0",
+        deptId: "0",
+        timeRange: range,
       },
       coreData: [
         {
-          title: '当天就餐人数预测',
+          title: "当天就餐人数预测",
           num: 0,
           isHighLight: true,
-          historyDesc: '同比',
+          historyDesc: "同比",
         },
         {
-          title: '当天累计就餐人数(人)',
+          title: "当天累计就餐人数(人)",
           num: 0,
-          historyDesc: '环比',
-          historyNum: 0
+          historyDesc: "环比",
+          historyNum: 0,
         },
         {
-          title: '消费总额(万元)',
+          title: "消费总额(万元)",
           num: 0,
-          historyDesc: '同比',
-          historyNum: 0
+          historyDesc: "同比",
+          historyNum: 0,
         },
         {
-          title: '订单均价(元)',
+          title: "订单均价(元)",
           num: 0,
-          historyDesc: '同比',
-          historyNum: 0
+          historyDesc: "同比",
+          historyNum: 0,
         },
         {
           type: 1,
-          title: '值得关注',
+          title: "值得关注",
           showStar: true,
-          content: ''
+          content: "",
         },
       ],
       oriDailyMenu: [],
       dailyMenu: [],
       topMenu: [],
-    }
+    };
   },
   components: {
     Query,
@@ -74,82 +74,88 @@ export default {
     let app = this;
     window.onresize = () => {
       app.$forceUpdate();
-    }
+    };
   },
   mounted() {
-    this.$nextTick(()=>{
-      this.init()
-    })
+    this.$nextTick(() => {
+      this.init();
+    });
   },
   methods: {
     init() {
       this.$util.asyncPromise(
-          this.getCoreData(),
-          this.getDailyMenu(),
-          this.getTopMenu(),
-      )
-    },
-    reset() {
+        this.getCoreData(),
+        this.getDailyMenu(),
+        this.getTopMenu()
+      );
     },
+    reset() {},
     search(data) {
       this.$util.asyncPromise(
-          this.getCoreData(),
-          this.getDailyMenu(),
-          this.getTopMenu(),
-          this.$refs.LifeRestEatChart.getData(),
-          this.$refs.LifeRestConsumeChart.getData(),
-          this.$refs.LifeRestPayChart.getData(),
-          this.$refs.LifeRestProfitChart.getData(),
+        this.getCoreData(),
+        this.getDailyMenu(),
+        this.getTopMenu(),
+        this.$refs.LifeRestEatChart.getData(),
+        this.$refs.LifeRestConsumeChart.getData(),
+        this.$refs.LifeRestPayChart.getData(),
+        this.$refs.LifeRestProfitChart.getData()
       );
       this.$forceUpdate();
     },
     getCoreData() {
-      return apiLifeRestaurant.getCoreData(this.queryData).then(res=>{
-        this.coreData[0].num = res.list[0].value
-        this.coreData[0].historyNum = res.list[0].compare
-        this.coreData[1].num = res.list[1].value
-        this.coreData[1].historyNum = res.list[1].compare
-        this.coreData[2].num = res.list[2].value
-        this.coreData[2].historyNum = res.list[2].compare
-        this.coreData[3].num = res.list[3].value
-        this.coreData[3].historyNum = res.list[3].compare
+      return apiLifeRestaurant.getCoreData(this.queryData).then((res) => {
+        this.coreData[0].num = res.list[0].value;
+        this.coreData[0].historyNum = res.list[0].compare;
+        this.coreData[1].num = res.list[1].value;
+        this.coreData[1].historyNum = res.list[1].compare;
+        this.coreData[2].num = res.list[2].value;
+        this.coreData[2].historyNum = res.list[2].compare;
+        this.coreData[3].num = res.list[3].value;
+        this.coreData[3].historyNum = res.list[3].compare;
         this.coreData[4].content = res.worthAttention;
-      })
+      });
     },
     getDailyMenu() {
-      this.queryData['type'] = this.eatTimeSelect;
-      return apiLifeRestaurant.getTodayMenu(this.queryData).then(res=>{
+      this.queryData["type"] = this.eatTimeSelect;
+      return apiLifeRestaurant.getTodayMenu(this.queryData).then((res) => {
         this.oriDailyMenu = res;
         this.filterTimeMenu();
-      })
+      });
     },
     filterTimeMenu() {
-      this.dailyMenu = this.oriDailyMenu.filter(item=>item.cuisineType==this.eatTimeSelect);
-      this.dailyMenu.sort((a,b)=>{
-        if (a.cuisineTypeTwo>=b.cuisineTypeTwo) {
+      this.dailyMenu = this.oriDailyMenu.filter(
+        (item) => item.cuisineType == this.eatTimeSelect
+      );
+      this.dailyMenu.sort((a, b) => {
+        if (a.cuisineTypeTwo >= b.cuisineTypeTwo) {
           return 1;
         } else {
           return -1;
         }
-      })
+      });
     },
     getTopMenu() {
-      return apiLifeRestaurant.getWelcomeDishes(this.queryData).then(res=>{
-        this.topMenu = res
-        this.topMenu = this.topMenu.slice(0,this.topSelect)
-      })
+      return apiLifeRestaurant.getWelcomeDishes(this.queryData).then((res) => {
+        this.topMenu = res;
+        this.topMenu = this.topMenu.slice(0, this.topSelect);
+      });
     },
-  }
-}
+  },
+};
 </script>
 
 <template>
   <div class="lifeRestaurant">
     <div class="page-query-core">
       <a-row>
-        <a-col>
+        <a-col style="margin-bottom: 10px">
           <div class="lifeRestaurant-query">
-            <Query :query-data.sync="queryData" :show="['company','dept','time']" :reset="reset" :search="search"></Query>
+            <Query
+              :query-data.sync="queryData"
+              :show="['company', 'dept', 'time']"
+              :reset="reset"
+              :search="search"
+            ></Query>
           </div>
         </a-col>
         <a-col>
@@ -166,22 +172,38 @@ export default {
         <div class="lifeRestaurant-left">
           <div class="lifeRestaurant-eat ioc-card-content">
             <Card title="用餐分析">
-              <LifeRestEatChart ref="LifeRestEatChart" :query-data="queryData" :height="chartsHeight"></LifeRestEatChart>
+              <LifeRestEatChart
+                ref="LifeRestEatChart"
+                :query-data="queryData"
+                :height="chartsHeight"
+              ></LifeRestEatChart>
             </Card>
           </div>
           <div class="lifeRestaurant-consume ioc-card-content">
             <Card title="消费分析">
-              <LifeRestConsumeChart ref="LifeRestConsumeChart" :query-data="queryData" :height="chartsHeight"></LifeRestConsumeChart>
+              <LifeRestConsumeChart
+                ref="LifeRestConsumeChart"
+                :query-data="queryData"
+                :height="chartsHeight"
+              ></LifeRestConsumeChart>
             </Card>
           </div>
-          <div class="lifeRestaurant-profit ">
+          <div class="lifeRestaurant-profit">
             <Card title="收入分析">
-              <LifeRestProfitChart ref="LifeRestProfitChart" :query-data="queryData" :height="chartsHeight"></LifeRestProfitChart>
+              <LifeRestProfitChart
+                ref="LifeRestProfitChart"
+                :query-data="queryData"
+                :height="chartsHeight"
+              ></LifeRestProfitChart>
             </Card>
           </div>
-          <div class="lifeRestaurant-pay ">
+          <div class="lifeRestaurant-pay">
             <Card title="支付分析">
-              <LifeRestPayChart ref="LifeRestPayChart" :query-data="queryData" :height="chartsHeight"></LifeRestPayChart>
+              <LifeRestPayChart
+                ref="LifeRestPayChart"
+                :query-data="queryData"
+                :height="chartsHeight"
+              ></LifeRestPayChart>
             </Card>
           </div>
         </div>
@@ -189,12 +211,18 @@ export default {
       <a-col :span="6">
         <div class="lifeRestaurant-right">
           <div class="lifeRestaurant-top ioc-card-content">
-            <Card title="受欢迎菜品" style="height: 350px ">
-              <div style="height: 300px;overflow-y: auto">
-                <LifeRestTopMenu :table-data="topMenu" ></LifeRestTopMenu>
+            <Card title="受欢迎菜品" style="height: 350px">
+              <div style="height: 300px; overflow-y: auto">
+                <LifeRestTopMenu :table-data="topMenu"></LifeRestTopMenu>
               </div>
               <template #title-extra>
-                <a-select v-model="topSelect" default-value="5" style="width: 100px;" size="small" @change="getTopMenu">
+                <a-select
+                  v-model="topSelect"
+                  default-value="5"
+                  style="width: 100px"
+                  size="small"
+                  @change="getTopMenu"
+                >
                   <a-select-option value="5">TOP5</a-select-option>
                   <a-select-option value="10">TOP10</a-select-option>
                   <a-select-option value="15">TOP15</a-select-option>
@@ -204,26 +232,28 @@ export default {
           </div>
           <div class="lifeRestaurant-cookbook ioc-card-content">
             <Card title="每日菜谱" style="height: 700px">
-              <div style="height: 650px;overflow-y: auto">
-                <LifeRestDailyMenu :table-data="dailyMenu"  ></LifeRestDailyMenu>
+              <div style="height: 650px; overflow-y: auto">
+                <LifeRestDailyMenu :table-data="dailyMenu"></LifeRestDailyMenu>
               </div>
 
               <template #title-extra>
-                <a-select v-model="eatTimeSelect" default-value="1" style="width: 100px;" size="small" @change="filterTimeMenu">
+                <a-select
+                  v-model="eatTimeSelect"
+                  default-value="1"
+                  style="width: 100px"
+                  size="small"
+                  @change="filterTimeMenu"
+                >
                   <a-select-option value="1">早餐</a-select-option>
                   <a-select-option value="2">午餐</a-select-option>
                   <a-select-option value="3">晚餐</a-select-option>
                 </a-select>
               </template>
-
             </Card>
           </div>
         </div>
       </a-col>
-
-
     </a-row>
-
   </div>
 </template>
 
@@ -236,6 +266,11 @@ export default {
   vertical-align: top;
   .lifeRestaurant-query {
     width: 100%;
+    background: #fff;
+    height: 60px;
+    padding: 10px;
+    border-radius: 3px;
+    box-shadow: 1px 1px 4px #ccc;
   }
   .lifeRestaurant-core {
     width: 100%;
@@ -286,6 +321,6 @@ export default {
   border: none;
   border-radius: 6px;
   padding: 0px 12px;
-  color: #B2B2B2;
+  color: #b2b2b2;
 }
-</style>
+</style>

+ 3 - 2
src/style/common.css

@@ -18,8 +18,9 @@
 }
 
 .page-query-core {
-  background-color: #ffffff;
-  padding: 12px 12px 8px;
+  /* background-color: #ffffff; */
+  /* border:1px solid red; */
+  /* padding: 12px 12px 8px; */
   border-radius: 4px;
 }