ymy 1 year ago
parent
commit
910fbe500a

+ 3 - 0
src/components/address/address.vue

@@ -77,6 +77,9 @@
       config.value = c;
       config.value = c;
     }
     }
   }
   }
+  onUnmounted(() => {
+    $bus.off('areaEvent');
+  });
 
 
   //获取配置
   //获取配置
   const getConfig = () => {
   const getConfig = () => {

+ 12 - 9
src/views/base/equipment/components/stateRadio.vue

@@ -7,7 +7,7 @@
 
 
 <script setup>
 <script setup>
   import { otherEquipState } from '@/api/base/equipment.js'
   import { otherEquipState } from '@/api/base/equipment.js'
-  import { nextTick, ref } from 'vue'
+  import { nextTick, ref, onMounted } from 'vue'
 
 
   const emit = defineEmits();
   const emit = defineEmits();
   const radio = ref(null)
   const radio = ref(null)
@@ -46,14 +46,17 @@
     setValue,getValue
     setValue,getValue
   })
   })
 
 
-  nextTick(() => {
-    if(props.parentValue){
-      setValue(props.parentValue.onState)
-    }else{
-      radio.value = 1
-      change()
-    }
-  })
+  // const onMounted = () =>{
+    // nextTick(() => {
+    //   if(props.parentValue && Number(props.parentValue.onState) >= 0){
+    //     setValue(props.parentValue.onState)
+    //   }else{
+    //     radio.value = 1
+    //     change()
+    //   }
+    // })
+  // }
+  
   
   
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 2 - 0
src/views/base/merchantManage/components/upload.vue

@@ -1,7 +1,9 @@
 <template>
 <template>
   <div class="upload">
   <div class="upload">
+    <div>{{ pathUrl + pathImg }}</div>
     <el-button type="primary" @click="uploadHandle" v-if="!pathImg">点击上传</el-button>
     <el-button type="primary" @click="uploadHandle" v-if="!pathImg">点击上传</el-button>
     <div class="msg" v-if="!pathImg">只能上传jpg/png文件,且不超过2MB</div>
     <div class="msg" v-if="!pathImg">只能上传jpg/png文件,且不超过2MB</div>
+    
     <div class="uopload-box" v-if="pathImg">
     <div class="uopload-box" v-if="pathImg">
       <div class="upload-img">
       <div class="upload-img">
         <el-image
         <el-image

+ 81 - 3
src/views/base/shopManage/components/appletView.vue

@@ -1,17 +1,51 @@
 <template>
 <template>
   <div class="page-box">
   <div class="page-box">
     <moduleView :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @onRefresh="getList" @resert="queryList" @search="queryList" @clickHandle="clickHandle" @modalHandle="modalHandle" @detail="detail" />
     <moduleView :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @onRefresh="getList" @resert="queryList" @search="queryList" @clickHandle="clickHandle" @modalHandle="modalHandle" @detail="detail" />
+    <el-drawer
+      size="50%"
+      v-model="drawer"
+      close-on-click-modal
+      title="操作日志"
+      direction="rtl"
+    >
+      <el-table ref="operlogRef" :data="logData">
+        <el-table-column label="日志编号" align="center" prop="operId" width="130" />
+        <el-table-column label="操作类型" align="center" prop="businessType">
+          <template #default="scope">
+              <dict-tag :options="sys_oper_type" :value="scope.row.businessType" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作人员" align="center" width="110" prop="operName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
+        <el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
+        <el-table-column label="操作状态" align="center" prop="status">
+          <template #default="scope">
+              <dict-tag :options="sys_common_status" :value="scope.row.status" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作日期" align="center" prop="operTime" width="180" sortable="custom" :sort-orders="['descending', 'ascending']">
+          <template #default="scope">
+              <span>{{ parseTime(scope.row.operTime) }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="page-log">
+        <el-pagination layout="prev, pager, next" :total="logPage.total" @current-change="handleCurrentChange"
+        :current-page="logPage.pageNo" />
+      </div>
+    </el-drawer>
   </div>
   </div>
-</template>
+</template> 
 
 
 <script setup>
 <script setup>
   import { computed,getCurrentInstance,ref, shallowRef  } from "vue";
   import { computed,getCurrentInstance,ref, shallowRef  } from "vue";
   const { proxy } = getCurrentInstance();
   const { proxy } = getCurrentInstance();
   import {appList,addApp,updateApp,deleApp,disableApp,enableApp} from '@/api/base/shopManage'
   import {appList,addApp,updateApp,deleApp,disableApp,enableApp} from '@/api/base/shopManage'
+  const { sys_oper_type, sys_common_status } = proxy.useDict("sys_oper_type","sys_common_status");
+  import { list} from "@/api/monitor/operlog";
   import txt from "./txt.vue";
   import txt from "./txt.vue";
   // import merchant from "./merchant.vue";
   // import merchant from "./merchant.vue";
   import stateRadio from "@/components/stateRadio/stateRadio.vue";
   import stateRadio from "@/components/stateRadio/stateRadio.vue";
-
+  const drawer = ref(false)
   const config = ref({
   const config = ref({
     attr:{
     attr:{
       calculateH:true
       calculateH:true
@@ -42,7 +76,16 @@
         add:true,
         add:true,
         search:true,
         search:true,
         refresh:true
         refresh:true
-      }
+      },
+      customTools:[{
+        name: '操作日志', 
+        icon: 'Notebook',
+        event:{
+          click:() =>{
+            drawer.value = true
+          }
+        }
+      }]
     },
     },
     table:{
     table:{
       attr:{
       attr:{
@@ -227,10 +270,33 @@
       }
       }
     }
     }
   })
   })
+  const logData = ref([])
+  const logPage = ref({
+    pageNo: 1, //当前页
+    pageSize: 20, //每页条数
+    total: 0 //总条数
+  })
+
   const load = ref(false)
   const load = ref(false)
   const isSearch = ref(false)
   const isSearch = ref(false)
   const timeNum = ref(0);
   const timeNum = ref(0);
+  const initLog= () => {
+    list({
+      pageNum:logPage.value.pageNo,
+      pageSize:logPage.value.pageSize,
+      title:'小程序'
+    }).then(res => {
+      logData.value = res.rows;
+      logPage.value.total = res.total;
+
+    }).catch(()=> {
 
 
+    })
+  }
+  const handleCurrentChange = v => {
+    logPage.value.pageNo = v;
+    initLog()
+  }
   // 禁用
   // 禁用
   const disableHandle = item => {
   const disableHandle = item => {
     disableApp(item.appkey).then(() => {
     disableApp(item.appkey).then(() => {
@@ -239,6 +305,7 @@
         type: 'success'
         type: 'success'
       })
       })
       getList()
       getList()
+      initLog()
     }).catch(() => {})
     }).catch(() => {})
   }
   }
   //启用
   //启用
@@ -249,6 +316,7 @@
         type: 'success'
         type: 'success'
       })
       })
       getList()
       getList()
+      initLog()
     }).catch(() => {})
     }).catch(() => {})
   }
   }
 
 
@@ -396,4 +464,14 @@
   defineExpose({
   defineExpose({
     calculateTable
     calculateTable
   })
   })
+
+  initLog()
 </script>
 </script>
+
+<style scoped>
+.page-log{
+  width: 100%;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 7 - 1
src/views/base/shopManage/components/mapRang.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div class="rang">
   <div class="rang">
     <div class="mapRang" :id="_id" :style="{height:attrs.height?attrs.height+'px':'300px'}"></div>
     <div class="mapRang" :id="_id" :style="{height:attrs.height?attrs.height+'px':'300px'}"></div>
-    <el-button v-if="lnglat && lnglat.length > 0" type="primary" class="clear" @click="clearValue">清除</el-button>
+    <el-button type="primary" class="clear" @click="clearValue">清除</el-button>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -143,6 +143,9 @@
         if(geocoder.value){
         if(geocoder.value){
           if(address.value){
           if(address.value){
             zoom.value = 17;
             zoom.value = 17;
+          }else if(props.parentValue.addrInfo) {
+            address.value = props.parentValue.addrInfo
+            zoom.value = 17;
           }
           }
           geocoder.value.getPoint(area.value + address.value, searchResult);
           geocoder.value.getPoint(area.value + address.value, searchResult);
         }
         }
@@ -151,6 +154,9 @@
     $bus.on('addressEvent',data => {
     $bus.on('addressEvent',data => {
       address.value = data;
       address.value = data;
       if(address.value && geocoder.value){
       if(address.value && geocoder.value){
+        if(!area.value && props.parentValue.addrCodeInfo) {
+          area.value = props.parentValue.addrCodeInfo.replaceAll('/','');
+        }
         zoom.value = 17;
         zoom.value = 17;
         geocoder.value.getPoint(area.value + address.value, searchResult);
         geocoder.value.getPoint(area.value + address.value, searchResult);
       }
       }

+ 1 - 1
src/views/base/userManage/index.vue

@@ -94,7 +94,7 @@
         field:'endTime'
         field:'endTime'
       },
       },
       {
       {
-        title:'累计消费额',
+        title:'累计消费额',
         field:'totalPrice'
         field:'totalPrice'
       }]
       }]
     }
     }

+ 2 - 2
src/views/index.vue

@@ -47,8 +47,8 @@
         <div class="title">
         <div class="title">
           <span>设备</span>
           <span>设备</span>
           <div class="eqiup-state">
           <div class="eqiup-state">
-            <div class="success"><span class="label-state">正常使用:</span>{{suc}}台</div>
-            <div class="disad"><span class="label-state">禁止使用:</span>{{dis}}台</div>
+            <div class="success"><span class="label-state">正常使用:</span>{{suc?suc:0}}台</div>
+            <div class="disad"><span class="label-state">禁止使用:</span>{{dis?dis:0}}台</div>
             <!-- <div class="maintenance"><span class="label-state">维护中:</span>{{maintenance}}台</div> -->
             <!-- <div class="maintenance"><span class="label-state">维护中:</span>{{maintenance}}台</div> -->
           </div>
           </div>
         </div>
         </div>