Prechádzať zdrojové kódy

Merge branch 'test_zyh' of United_Software/k_online_ui into test

Jack Zhou 4 dní pred
rodič
commit
bdd3a17b45

+ 2 - 0
.gitignore

@@ -17,6 +17,8 @@ components.d.ts
 package-lock.json
 pnpm-lock.yaml
 auto-imports.d.ts
+*.rar
+*.zip
 
 stats.html
 

+ 2 - 6
src/components/AddRules/src/components/NotiMethods.vue

@@ -77,11 +77,7 @@ defineExpose({
   <div style="margin-top: 11px">
     <div class="Method">
       <el-checkbox-group v-model="checkMethodList" @change="changeMethod">
-        <el-checkbox
-          class="methodcheckbox"
-          value="By Email"
-          v-if="user_type != null && user_type != 'customer'"
-        >
+        <el-checkbox class="methodcheckbox" value="By Email">
           <div>By Email</div>
           <div class="methos_image"><img src="../images/illustration_email@2x.png" /></div>
         </el-checkbox>
@@ -109,4 +105,4 @@ defineExpose({
 .methos_image {
   margin: 9px 0;
 }
-</style>
+</style>

+ 2 - 6
src/components/CreateAddRules/src/components/NotiMethods.vue

@@ -65,11 +65,7 @@ const user_type = localStorage.getItem('user_type')
   <div style="margin-top: 11px">
     <div class="Method">
       <el-checkbox-group v-model="checkMethodList" @change="changeMethod">
-        <el-checkbox
-          class="methodcheckbox"
-          value="By Email"
-          v-if="user_type != null && user_type != 'customer'"
-        >
+        <el-checkbox class="methodcheckbox" value="By Email">
           <div>By Email</div>
           <div class="methos_image"><img src="../images/illustration_email@2x.png" /></div>
         </el-checkbox>
@@ -97,4 +93,4 @@ const user_type = localStorage.getItem('user_type')
 .methos_image {
   margin: 9px 0;
 }
-</style>
+</style>

+ 1 - 1
src/views/Booking/src/BookingView.vue

@@ -27,7 +27,7 @@ const filterData = reactive({
   daterangeData: [] as Array<string>,
   morefiltersData: [] as Array<string>
 })
-onMounted(() => {})
+
 const tagsData: any = ref([])
 const handleClose = (tag: any) => {
   emitter.emit('clearTag', tag)

+ 2 - 2
src/views/Dashboard/src/DashboardView.vue

@@ -1235,10 +1235,10 @@ function handleImageClick(event) {
                       :Interval="Top1OInterval_dest"
                       v-vloading="TopOriginLoading"
                       saveImageName="Top 10 Destination"
-                      style="height: 272px"
+                      style="height: 310px"
                     ></SellerChart>
                   </div>
-                  <div class="map" style="height: 272px">
+                  <div class="map" style="height: 310px">
                     <!-- <TopMap :obj="dashboardObj.Top10faultData" ref="Top10Destinationref"></TopMap> -->
                     <TopMap ref="Top10Destinationref"></TopMap>
                   </div>

+ 15 - 11
src/views/Dashboard/src/components/BarChart.vue

@@ -23,7 +23,7 @@ watch(
     initOption.yAxis.interval = interval.value
     initOption.title.text = bar_title.value
     nextTick(() => {
-      initChart()
+      barChart.value.setOption(initOption)
     })
   },
   {
@@ -65,7 +65,7 @@ const Name = computed(() => {
 const initOption = reactive({
   //标题
   title: {
-    text: bar_title.value || 'Total:', //主标题
+    text: bar_title.value || '', //主标题
     left: 19,
     top: 9.5,
     textStyle: {
@@ -206,25 +206,30 @@ const initOption = reactive({
 onMounted(() => {
   initChart()
   clickParams()
+
   watch(
     () => themeStore.theme,
     (newVal) => {
       if (newVal === 'dark') {
-        // initOption.title.textStyle.color = '#f0f1f3'
+        initOption.title.textStyle.color = '#f0f1f3'
         initOption.xAxis.axisLine.lineStyle.color = '#8d9095'
         initOption.yAxis.axisLine.lineStyle.color = '#8d9095'
         initOption.yAxis.splitLine.lineStyle.color = '#8d9095'
         initOption.toolbox.iconStyle.borderColor = '#f0f1f3'
         initOption.toolbox.feature.saveAsImage.backgroundColor = '#3F434A'
-        initChart()
+        nextTick(() => {
+          barChart.value.setOption(initOption)
+        })
       } else {
-        // initOption.title.textStyle.color = '#2B2F36'
+        initOption.title.textStyle.color = '#2B2F36'
         initOption.xAxis.axisLine.lineStyle.color = '#eaebed'
         initOption.yAxis.axisLine.lineStyle.color = '#eaebed'
         initOption.yAxis.splitLine.lineStyle.color = '#eaebed'
         initOption.toolbox.iconStyle.borderColor = '#2B2F36'
         initOption.toolbox.feature.saveAsImage.backgroundColor = '#fff'
-        initChart()
+        nextTick(() => {
+          barChart.value.setOption(initOption)
+        })
       }
     },
     {
@@ -240,21 +245,20 @@ const paramsdata = ref({
   type: ''
 })
 const clickParams = () => {
-  const bar_chart = echarts.init(bar_ref.value)
   // 监听点击事件
-  bar_chart.on('click', function (params) {
+  barChart.value.on('click', function (params) {
     paramsdata.value.name = params.name
     paramsdata.value.type = params.seriesName
     emits('ClickParams')
   })
 }
+const barChart = ref()
 const initChart = () => {
-  const bar_chart = echarts.init(bar_ref.value)
+  barChart.value = echarts.init(bar_ref.value)
   //图表响应式
   window.addEventListener('resize', () => {
-    bar_chart.resize()
+    barChart.value.resize()
   })
-  bar_chart.setOption(initOption)
 }
 
 defineExpose({

+ 4 - 8
src/views/Dashboard/src/components/PieChart.vue

@@ -235,18 +235,14 @@ const emits = defineEmits(['ClickParams'])
 const paramsdata = ref()
 const pieChart = ref()
 const clickParams = () => {
-  // pieChart.value = echarts.init(pie_ref.value)
-  // pieChart.value = pie_chart
   // 监听点击事件
-  pieChart.value &&
-    pieChart.value.on('click', function (params) {
-      paramsdata.value = params.data
-      emits('ClickParams')
-    })
+  pieChart.value.on('click', function (params) {
+    paramsdata.value = params.data
+    emits('ClickParams')
+  })
 }
 const initChart = () => {
   pieChart.value = echarts.init(pie_ref.value)
-  pieChart.value.setOption(initOption)
   //图表响应式
   window.addEventListener('resize', () => {
     pieChart.value.resize()

+ 13 - 83
src/views/Dashboard/src/components/RevenueChart.vue

@@ -25,7 +25,7 @@ watch(
     initOption.legend.data = Name.value
     initOption.toolbox.show = isShowTooltips.value
     nextTick(() => {
-      initChart()
+      revenueChart.value.setOption(initOption)
     })
   },
   {
@@ -39,7 +39,7 @@ watch(
     initOption.yAxis.max = Max.value
     initOption.yAxis.interval = interval.value
     nextTick(() => {
-      initChart()
+      revenueChart.value.setOption(initOption)
     })
   },
   {
@@ -81,80 +81,6 @@ const Name = computed(() => {
 const isShowTooltips = computed(() => {
   return bar_data.value?.isShowTooltips
 })
-const exportData = ({ filename }: any) => {
-  $api
-    .RevenueDownload({
-      date_start: props.RevenueStartDate,
-      date_end: props.RevenueEndDate
-    })
-    .then((res: any) => {
-      if (res.code === 200) {
-        let header: any = []
-        let data: any = []
-        let sheetname: any = []
-        let filterA = res.data.r2_cloumn.map((el: any) => {
-          return el.dataIndex
-        })
-        let titleA = res.data.r2_cloumn.map((el: any) => {
-          return el.title
-        })
-        let filterB = res.data.r3_cloumn.map((el: any) => {
-          return el.dataIndex
-        })
-        let titleB = res.data.r3_cloumn.map((el: any) => {
-          return el.title
-        })
-        let result: any = [
-          {
-            tHeader: titleA,
-            filterVal: filterA,
-            tableDatas: res.data.r2,
-            sheetName: res.data.r2_title
-          },
-          {
-            tHeader: titleB,
-            filterVal: filterB,
-            tableDatas: res.data.r3,
-            sheetName: res.data.r3_title
-          }
-        ]
-        let formatJson = (filterVal: any, jsonData: any) => {
-          return jsonData.map((v: any) => filterVal.map((j: any) => v[j]))
-        }
-        for (var i in result) {
-          header.push(result[i].tHeader)
-          sheetname.push(result[i].sheetName)
-          data.push(formatJson(result[i].filterVal, result[i].tableDatas))
-        }
-        // 将表头插入数据数组中
-        for (let i = 0; i < header.length; i++) {
-          data[i].unshift(header[i])
-        }
-        let ws_name = sheetname
-        // 创建工作簿对象
-        let wb = XLSX.utils.book_new()
-        let ws: any = []
-        // 创建每个工作表并设置列宽
-        for (let j = 0; j < header.length; j++) {
-          ws.push(XLSX.utils.aoa_to_sheet(data[j]))
-          let arr: any = []
-          header[j].forEach((val: any) => {
-            arr.push({
-              wpx: 120
-            })
-          })
-          ws[j]['!cols'] = arr
-        }
-        // 将工作表对象添加到工作簿中
-        for (let k = 0; k < header.length; k++) {
-          wb.SheetNames.push(ws_name[k])
-          wb.Sheets[ws_name[k]] = ws[k]
-        }
-        XLSX.writeFile(wb, filename + '.xlsx') // 导出文件
-      }
-    })
-    .finally(() => {})
-}
 
 // 数额
 const initOption = reactive({
@@ -316,7 +242,9 @@ onMounted(() => {
         initOption.legend.textStyle.color = 'rgba(240,241,243,0.7)'
         initOption.toolbox.iconStyle.borderColor = '#f0f1f3'
         initOption.toolbox.feature.saveAsImage.backgroundColor = '#3F434A'
-        initChart()
+        nextTick(() => {
+          revenueChart.value.setOption(initOption)
+        })
       } else {
         initOption.title.textStyle.color = '#2B2F36'
         initOption.xAxis.axisLine.lineStyle.color = '#eaebed'
@@ -325,7 +253,9 @@ onMounted(() => {
         initOption.legend.textStyle.color = '#646A73'
         initOption.toolbox.iconStyle.borderColor = '#2B2F36'
         initOption.toolbox.feature.saveAsImage.backgroundColor = '#fff'
-        initChart()
+        nextTick(() => {
+          revenueChart.value.setOption(initOption)
+        })
       }
     },
     {
@@ -335,13 +265,14 @@ onMounted(() => {
   )
 })
 
+const revenueChart = ref()
 const initChart = () => {
-  const bar_chart = echarts.init(bar_ref.value)
+  revenueChart.value = echarts.init(bar_ref.value)
   //图表响应式
   window.addEventListener('resize', () => {
-    bar_chart.resize()
+    revenueChart.value.resize()
   })
-  bar_chart.on('legendselectchanged', function (event: any) {
+  revenueChart.value.on('legendselectchanged', function (event: any) {
     const selected = event.selected
     let trueCount = 0
     let trueObj: any = {}
@@ -386,9 +317,8 @@ const initChart = () => {
       initOption.yAxis.max = max
       initOption.yAxis.interval = interval
     }
-    bar_chart.setOption(initOption)
+    revenueChart.value.setOption(initOption)
   })
-  bar_chart.setOption(initOption)
 }
 </script>
 

+ 2 - 0
src/views/Layout/src/components/Menu/MenuView.vue

@@ -148,6 +148,7 @@ router.afterEach(() => {
 
 // 路由跳转函数
 const changeRouter = (path: any) => {
+  sessionStorage.removeItem('reportList')
   if (localStorage.getItem('loginAI')) {
     localStorage.removeItem('loginAI')
     emitter.emit('login-success')
@@ -165,6 +166,7 @@ const changeRouter = (path: any) => {
   }
   if (sessionStorage.getItem('searchTableQeuryTracking')) {
     sessionStorage.removeItem('searchTableQeuryTracking')
+    sessionStorage.removeItem('tagsList')
   }
   if (sessionStorage.getItem('clickParams')) {
     sessionStorage.removeItem('clickParams')

+ 34 - 45
src/views/Tracking/src/TrackingView.vue

@@ -39,18 +39,18 @@ const handleClose = (tag: any) => {
     sessionStorage.getItem('reportList') != null ||
     sessionStorage.getItem('reportList') != '{}'
   ) {
-    const reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
+    const reportList = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
     let data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
     if (tag.includes('Transport')) {
-      delete reportlist.transport_mode
+      delete reportList.transport_mode
     } else if (tag.includes('Day') || tag.includes('CO2e')) {
-      delete reportlist._reportRef
-      delete reportlist._reportType
-      delete reportlist._reportRefe_date
-      delete reportlist._reportRefb_date
-      delete reportlist._reportStationType
-      delete reportlist._reportDataType
-      delete reportlist._reportStationType
+      delete reportList._reportRef
+      delete reportList._reportType
+      delete reportList._reportRefe_date
+      delete reportList._reportRefb_date
+      delete reportList._reportStationType
+      delete reportList._reportDataType
+      delete reportList._reportStationType
       filterData.dashboardData = []
       data = {}
     } else if (tag.includes('ETD')) {
@@ -59,24 +59,24 @@ const handleClose = (tag: any) => {
           filterData.daterangeData.splice(index, 1)
         }
       })
-      delete reportlist.etd_start
-      delete reportlist.etd_end
+      delete reportList.etd_start
+      delete reportList.etd_end
     } else if (tag.includes('ETA')) {
       filterData.daterangeData.forEach((item: any, index: any) => {
         if (item.includes('ETA')) {
           filterData.daterangeData.splice(index, 1)
         }
       })
-      delete reportlist.eta_start
-      delete reportlist.eta_end
+      delete reportList.eta_start
+      delete reportList.eta_end
     } else if (tag.includes('Origin')) {
-      delete reportlist.shipper_city
-      delete reportlist._city_name
+      delete reportList.shipper_city
+      delete reportList._city_name
       filterData.dashboardData = []
     } else if (tag.includes('Destination')) {
-      delete reportlist.consignee_city
+      delete reportList.consignee_city
     }
-    sessionStorage.setItem('reportList', JSON.stringify(reportlist))
+    sessionStorage.setItem('reportList', JSON.stringify(reportList))
     sessionStorage.setItem('tagsList', JSON.stringify(data))
   }
   if (tag.includes('Transport')) {
@@ -251,7 +251,6 @@ const DateRangeSearch = (dateRangeData: any) => {
     { title: 'ETA', keys: ['eta_start', 'eta_end'] },
     { title: 'Creation Time', keys: ['created_time_start', 'created_time_end'] }
   ]
-  console.log('dateRangeData', dateRangeData)
   fieldList.forEach((item) => {
     if (!dateRangeData.hasOwnProperty(item.title)) {
       // 删除不存在的字段
@@ -432,19 +431,18 @@ const clearfilters = () => {
     sessionStorage.getItem('reportList') != null ||
     sessionStorage.getItem('reportList') != '{}'
   ) {
-    let reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
-    let data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
-    reportlist = {}
-    data = {}
-    sessionStorage.setItem('reportList', JSON.stringify(reportlist))
-    sessionStorage.setItem('tagsList', JSON.stringify(data))
-  } else {
-    searchTableQeuryTracking.filterTag = ['All']
+    // sessionStorage.removeItem('reportList')
+    sessionStorage.removeItem('tagsList')
   }
   getTrackingData()
   renderTagsData()
 }
 const renderTagsData = () => {
+  const data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
+  if (Object.keys(data).length != 0) {
+    let str = `${data.title}:${data.name}`
+    !filterData.dashboardData.includes(str) && filterData.dashboardData.push(str)
+  }
   tagsData.value = []
   if (filterData.transportData.length) {
     tagsData.value.push(filterData.transportData[0])
@@ -635,18 +633,14 @@ onMounted(() => {
     sessionStorage.getItem('clickParams') != null &&
     sessionStorage.getItem('clickParams') != '{}'
   ) {
-    if (sessionStorage.getItem('searchTableQeuryTracking') != null) {
-      searchTableQeuryTracking = {}
-    }
-    const data = JSON.parse(sessionStorage.getItem('tagsList') as string) || {}
-    const reportlist = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
-    for (const key in reportlist) {
+    const reportList = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
+    for (const key in reportList) {
       let str = ''
       switch (key) {
         case 'etd_start':
-          const startDate = dayjs(reportlist['etd_start'], valueFormatDate).format(formatDate)
+          const startDate = dayjs(reportList['etd_start'], valueFormatDate).format(formatDate)
           searchTableQeuryTracking['etd_start'] = startDate
-          const endDate = dayjs(reportlist['etd_end'], valueFormatDate).format(formatDate)
+          const endDate = dayjs(reportList['etd_end'], valueFormatDate).format(formatDate)
           searchTableQeuryTracking['etd_end'] = endDate
           const startEnd = startDate + ' To ' + endDate
           str = `ETD:${startEnd}`
@@ -656,9 +650,9 @@ onMounted(() => {
         case 'etd_end':
           break
         case 'eta_start':
-          const etaStart = dayjs(reportlist['eta_start'], valueFormatDate).format(formatDate)
+          const etaStart = dayjs(reportList['eta_start'], valueFormatDate).format(formatDate)
           searchTableQeuryTracking['eta_start'] = etaStart
-          const etaEnd = dayjs(reportlist['eta_end'], valueFormatDate).format(formatDate)
+          const etaEnd = dayjs(reportList['eta_end'], valueFormatDate).format(formatDate)
           searchTableQeuryTracking['eta_end'] = etaEnd
           str = `ETA:${etaStart} To ${etaEnd}`
           // filterData.daterangeData.push(str)
@@ -667,11 +661,11 @@ onMounted(() => {
         case 'eta_end':
           break
         case 'created_time_start':
-          const createdTimeStart = dayjs(reportlist['created_time_start'], valueFormatDate).format(
+          const createdTimeStart = dayjs(reportList['created_time_start'], valueFormatDate).format(
             formatDate
           )
           searchTableQeuryTracking['created_time_start'] = createdTimeStart
-          const createdTimeEnd = dayjs(reportlist['created_time_end'], valueFormatDate).format(
+          const createdTimeEnd = dayjs(reportList['created_time_end'], valueFormatDate).format(
             formatDate
           )
           searchTableQeuryTracking['created_time_end'] = createdTimeEnd
@@ -681,16 +675,11 @@ onMounted(() => {
         case 'created_time_end':
           break
         default:
-          searchTableQeuryTracking[key] = reportlist[key]
-      }
-    }
-    if (reportlist._city_name == '' || reportlist._city_name == undefined) {
-      if (Object.keys(data).length != 0) {
-        let str = `${data.title}:${data.name}`
-        filterData.dashboardData.push(str)
+          searchTableQeuryTracking[key] = reportList[key]
       }
     }
 
+    // sessionStorage.removeItem('reportList')
     sessionStorage.setItem('searchTableQeuryTracking', JSON.stringify(searchTableQeuryTracking))
     getTrackingData()
   }