ymy 1 anno fa
parent
commit
42a5de14f8

+ 1 - 0
package.json

@@ -26,6 +26,7 @@
     "js-cookie": "3.0.1",
     "jsencrypt": "3.3.1",
     "lodash": "^4.17.21",
+    "mitt": "^3.0.1",
     "nprogress": "0.2.0",
     "pinia": "2.0.22",
     "vue": "3.2.45",

+ 15 - 0
src/api/base/shopManage.js

@@ -108,3 +108,18 @@ export function deleApp(data) {
   })
 }
 
+// 禁用小程序
+export function disableApp(data) {
+  return request({
+    url:'/app/stopApp/' + data,
+    method: 'put',
+  })
+}
+
+//启用小程序
+export function enableApp(data) {
+  return request({
+    url:'/app/recoverApp/' + data,
+    method: 'put',
+  })
+}

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

@@ -0,0 +1,100 @@
+<template>
+  <vxe-input 
+    ref="input"
+    v-model="value"
+    :placeholder="placeholder"
+    :maxlength="attrs.maxlength"
+    :minlength="attrs.minlength"
+    :clearable="attrs.clearable"
+    :disabled="attrs.disabled"
+    :size="attrs.size?attrs.size:'medium'"
+    :type="attrs.type"
+    :min="attrs.min"
+    :max="attrs.max"
+    :step="attrs.step"
+    :align="attrs.align"
+    :prefix-icon="attrs.prefixIcon"
+    :suffix-icon="attrs.suffixIcon"
+    :readonly="attrs.readonly"
+    @input="onChange"
+    @clear="onChange"
+    ></vxe-input>
+</template>
+
+<script setup>
+  import { computed,getCurrentInstance,nextTick  } from "vue";
+  import $bus from '@/benyun/utils/bus.js'
+  const { proxy } = getCurrentInstance();
+  const value = ref('')
+  const config = ref({})
+  const emit = defineEmits();
+  const props = defineProps({
+    propConfig:{},
+    propValue:{},
+    parentValue:{}
+  })
+  const attrs = computed({
+    get() {
+      return config.value.attr ? config.value.attr : {};
+    }
+  })
+  const placeholder = computed({
+    get() {
+      if(attrs.value.disabled){
+        return ''
+      }
+      if(attrs.value.placeholder){
+        return attrs.value.placeholder
+      }
+      return ''
+    }
+  })
+
+  const setValue = data => {
+    if(data || data === 0){
+      value.value = proxy.lodash.cloneDeep(data);
+      if(attrs.value.type == 'number'){
+        value.value = Number(data);
+      }
+    }else{
+      value.value = null;
+    }
+  }
+
+  const getValue = () => {
+    return proxy.lodash.cloneDeep(value.value);
+  }
+  const clearValue = () => {
+    value.value = ''
+  }
+  const onChange = () => {
+    emit('onChange',value.value);
+    $bus.emit('addressEvent',value.value);// 提供数据
+  }
+  //设置配置
+  const setConfig = c => {
+    if(c){
+      config.value = c;
+    }
+  }
+
+  //获取配置
+  const getConfig = () => {
+    return lodash.cloneDeep(config.value)
+  }
+
+  if(props.propConfig){
+    setConfig(props.propConfig)
+  }
+  if(props.propValue){
+    setValue(props.propValue)
+  }
+
+  defineExpose({
+    getValue,setValue,getConfig,setConfig,clearValue
+  })  
+</script>
+
+<style scoped>
+
+</style>

+ 18 - 5
src/components/mapMaker/index.vue

@@ -12,6 +12,8 @@
   const lat = ref(null) //纬度
   const map = ref(null) //地图
   const zoom = ref(13) //地图层级
+  const area = ref('') //区域值
+  const address = ref('') //详情值
   const emit = defineEmits();
   const _id = ref('')
   const geocoder = ref('');
@@ -100,6 +102,7 @@
           lat.value = props.parentValue[attrs.value.lat]
         }
         if(lng.value && lat.value){
+          zoom.value = 17
           if(!map.value){
             initMap(() => {
               getLngLat({lng:lng.value,lat:lat.value})
@@ -140,15 +143,25 @@
   })
   // 接收数据
   onMounted(()=>{
-    $bus.on('areaEvent',(data)=>{
-      let area = data.area ? data.area : '';
-      if(area){
-        area = area.replaceAll('/','');
+    $bus.on('areaEvent',data => {
+      let areaValue = data.area ? data.area : '';
+      if(areaValue){
+        area.value = areaValue.replaceAll('/','');
         if(geocoder.value){
-          geocoder.value.getPoint(area, searchResult);
+          if(address.value){
+            zoom.value = 17;
+          }
+          geocoder.value.getPoint(area.value + address.value, searchResult);
         }
       }
     })
+    $bus.on('addressEvent',data => {
+      address.value = data;
+      if(address.value && geocoder.value){
+        zoom.value = 17;
+        geocoder.value.getPoint(area.value + address.value, searchResult);
+      }
+    })
   })
 
 </script>

+ 38 - 0
src/components/stateRadio/stateRadio.vue

@@ -0,0 +1,38 @@
+<template>
+  <el-radio-group v-model="radio" @change="change">
+    <el-radio :label="1">启用</el-radio>
+    <el-radio :label="0">禁用</el-radio>
+  </el-radio-group>
+</template>
+
+<script setup>
+  import { ref } from 'vue'
+  const emit = defineEmits();
+  const radio = ref(1)
+  const props = defineProps({
+    propConfig:{},
+    propValue:{},
+    parentValue:{}
+  })
+  const setValue = data => {
+    radio.value = data
+  }
+  const change = () => {
+    emit('onChange',radio.value);
+  }
+
+  defineExpose({
+    setValue
+  })
+
+  if(props.propValue){
+    setValue(props.propValue)
+  }else{
+    radio.value = 1
+  }
+  
+  change()
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 12 - 8
src/views/base/adManage/index.vue

@@ -9,7 +9,7 @@
   const { proxy } = getCurrentInstance();
   import goodsImg from "./components/goodsImg.vue";
   import equipList from "./components/equipList.vue";
-  // import rangTime from './components/rangTime.vue';
+  import rangTime from './components/rangTime.vue';
   import {list,upDownShelves,detailHandle} from '@/api/base/adManage'
 
   const config = ref({
@@ -40,9 +40,9 @@
           }
         },
         {
-          span:8,
-          labelWidth:70,
-          label:'时间',
+          span:10,
+          labelWidth:100,
+          label:'创建时间',
           prop:'time',
           component:'by-date',
           compConfig:{
@@ -113,10 +113,14 @@
         }
       },
       {
-        title:'时间',
-        field:'planCreateTime',
-        // width:150,
-        // component:shallowRef(rangTime)
+        title:'时间段',
+        field:'time',
+        width:150,
+        component:shallowRef(rangTime)
+      },
+      {
+        title:'创建时间',
+        field:'planCreateTime'
       },
       {
         title:'操作',

+ 2 - 2
src/views/base/adPlan/components/auSuccess.vue

@@ -33,7 +33,7 @@
         {
           span:8,
           // labelWidth:16,
-          label:'推送时间',
+          label:'推送时间',
           prop:'time',
           component:'by-date',
           compConfig:{
@@ -76,7 +76,7 @@
         field:'commercialName'
       },
       {
-        title:'推广设备',
+        title:'推广设备',
         field:'equipmentCount'
       },
       {

+ 2 - 2
src/views/base/adPlan/components/auditView.vue

@@ -36,7 +36,7 @@
         {
           span:8,
           // labelWidth:16,
-          label:'推送时间',
+          label:'推送时间',
           prop:'time',
           component:'by-date',
           compConfig:{
@@ -79,7 +79,7 @@
         field:'commercialName'
       },
       {
-        title:'推广设备',
+        title:'推广设备',
         field:'equipmentCount'
       },
       {

+ 2 - 2
src/views/base/adPlan/components/refuseView.vue

@@ -34,7 +34,7 @@
           span:8,
           // labelWidth:16,
           prop:'time',
-          label:'推送时间',
+          label:'推送时间',
           component:'by-date',
           compConfig:{
             attr:{
@@ -76,7 +76,7 @@
         field:'commercialName'
       },
       {
-        title:'推广设备',
+        title:'推广设备',
         field:'equipmentCount'
       },
       {

+ 2 - 1
src/views/base/equipment/index.vue

@@ -9,6 +9,7 @@
 <script setup>
   import stateRadio from './components/stateRadio.vue';
   import adModal from './components/adModal.vue';
+  import address from '../../../components/address/address.vue';
   import { list, add, adSetting, update,del,adList,adMove } from '@/api/base/equipment.js'
   import { computed,getCurrentInstance,ref,markRaw,shallowRef } from "vue";
   const { proxy } = getCurrentInstance();
@@ -303,7 +304,7 @@
           [{
             label:'详细地址',
             prop:'addrInfo',
-            component:'by-input'
+            component:shallowRef(address)
           }],
           [{
             label:'标记',

+ 1 - 0
src/views/base/merchantManage/components/stateRadio.vue

@@ -29,6 +29,7 @@
     setValue(props.propValue)
   }else{
     radio.value = 1
+    change()
   }
   
   change()

+ 2 - 2
src/views/base/productManage/index.vue

@@ -35,7 +35,7 @@
         {
           span:8,
           labelWidth:80,
-          label:'时间',
+          label:'创建时间',
           prop:'time',
           component:'by-date',
           compConfig:{
@@ -90,7 +90,7 @@
         field:'goodsPrice'
       },
       {
-        title:'时间',
+        title:'创建时间',
         field:'createTime'
       }]
     }

+ 74 - 2
src/views/base/shopManage/components/appletView.vue

@@ -7,9 +7,10 @@
 <script setup>
   import { computed,getCurrentInstance,ref, shallowRef  } from "vue";
   const { proxy } = getCurrentInstance();
-  import {appList,addApp,updateApp,deleApp} from '@/api/base/shopManage'
+  import {appList,addApp,updateApp,deleApp,disableApp,enableApp} from '@/api/base/shopManage'
   import txt from "./txt.vue";
-  import merchant from "./merchant.vue";
+  // import merchant from "./merchant.vue";
+  import stateRadio from "@/components/stateRadio/stateRadio.vue";
 
   const config = ref({
     attr:{
@@ -64,9 +65,54 @@
         title:'所属商户',
         field:'commercialName'
       },
+      {
+        title:'状态',
+        field:'state',
+        component: 'textChange',
+        compConfig:{
+          attr:{
+            data:[{
+              label:'已启用',
+              value:1,
+              backgroundColor:'#f0f9eb',
+              color:'#67c23a'
+            },{
+              label:'已禁用',
+              value:0,
+              backgroundColor:'#fef0f0',
+              color:'#f56c6c'
+            }]
+          }
+        }
+      },
       {
         title:'创建时间',
         field:'createTime'
+      },
+      {
+        title:'操作',
+        action:true,
+        plugins:[{
+          name:'禁用',
+          event:{
+            show:row => {
+              return row.state == 1
+            },
+            click:item => {
+             disableHandle(item)
+            }
+          }
+        },{
+          name:'启用',
+          event:{
+            show:row => {
+              return row.state == 0
+            },
+            click:item => {
+              enableHandle(item)
+            }
+          }
+        }]
       }]
     },
     modal:{
@@ -152,6 +198,11 @@
               }
             }
           }],
+          [{
+            label:'状态',
+            prop:'state',
+            component:shallowRef(stateRadio)
+          }],
           [{
             label:'应用ID',
             prop:'appkey',
@@ -180,6 +231,27 @@
   const isSearch = ref(false)
   const timeNum = ref(0);
 
+  // 禁用
+  const disableHandle = item => {
+    disableApp(item.appkey).then(() => {
+      proxy.$message({
+        message: '“' + item.appName + '”' + '已成功禁用!',
+        type: 'success'
+      })
+      getList()
+    }).catch(() => {})
+  }
+  //启用
+  const enableHandle = item => {
+    enableApp(item.appkey).then(() => {
+      proxy.$message({
+        message:  '“' + item.appName + '”' + '已成功启用!',
+        type: 'success'
+      })
+      getList()
+    }).catch(() => {})
+  }
+
   const detail = () => {
     config.value.modal.tool.tools.save = true;
     delete config.value.modal.tool.tools.add;

+ 17 - 4
src/views/base/shopManage/components/mapRang.vue

@@ -15,9 +15,11 @@
   // const lng = ref(null) // 经度
   // const lat = ref(null) //纬度
   const map = ref(null) //地图
-  const zoom = ref(15) //地图层级
+  const zoom = ref(13) //地图层级
   const emit = defineEmits();
   const geocoder = ref('');
+  const area = ref('') //区域值
+  const address = ref('') //详情值
   const _id = ref('')
   const handler = ref(null)
   const props = defineProps({
@@ -93,6 +95,7 @@
       if(v) {
         try{
           lnglat.value = JSON.parse(v)
+          zoom.value = 17
           if(!map.value){
             initMap(() => {
               initPoint()
@@ -125,14 +128,24 @@
   // 接收数据
   onMounted(()=>{
     $bus.on('areaEvent',(data)=>{
-      let area = data.area ? data.area : '';
+      let areaValue = data.area ? data.area : '';
       if(area){
-        area = area.replaceAll('/','');
+        area.value = areaValue.replaceAll('/','');
         if(geocoder.value){
-          geocoder.value.getPoint(area, searchResult);
+          if(address.value){
+            zoom.value = 17;
+          }
+          geocoder.value.getPoint(area.value + address.value, searchResult);
         }
       }
     })
+    $bus.on('addressEvent',data => {
+      address.value = data;
+      if(address.value && geocoder.value){
+        zoom.value = 17;
+        geocoder.value.getPoint(area.value + address.value, searchResult);
+      }
+    })
   })
 
   defineExpose({

+ 2 - 1
src/views/base/shopManage/components/offlineShop.vue

@@ -12,6 +12,7 @@
   import {listShop,delShop,addShop,updateShop} from '@/api/base/shopManage'
   import mapRang from "./mapRang.vue";
   import equipModal from "./equipModal.vue";
+  import address from '@/components/address/address.vue';
   // import noAddEquip from "./noAddEquip.vue";
 
   const config = ref({
@@ -164,7 +165,7 @@
           [{
             label:'详细地址',
             prop:'addrInfo',
-            component:'by-input'
+            component:shallowRef(address)
           }],
           [{
             label:'范围',

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

@@ -86,11 +86,11 @@
         field:'startTime'
       },
       {
-        title:'进去扫描设备',
+        title:'近期扫描设备',
         field:'endEquipmentName'
       },
       {
-        title:'进去扫描时间',
+        title:'近期扫描时间',
         field:'endTime'
       },
       {