lex 1 jaar geleden
bovenliggende
commit
7bb23bc2f8

+ 2 - 2
src/school/train-report/components/list.tsx

@@ -156,7 +156,7 @@ export default defineComponent({
       >
         <div class={'searchGroup'} style="background: transparent">
           <div
-            class={['searchItem', state.showPopoverTime && 'searchItem-active']}
+            class={['searchItem', styles.itemChild, state.showPopoverTime && 'searchItem-active']}
             onClick={() => {
               state.showPopoverTime = true
             }}
@@ -165,7 +165,7 @@ export default defineComponent({
             <i class={'arrow'}></i>
           </div>
           <div
-            class={['searchItem', state.orchestraStatus && 'searchItem-active']}
+            class={['searchItem', styles.itemChild, state.orchestraStatus && 'searchItem-active']}
             onClick={() => {
               state.orchestraStatus = true
             }}

+ 4 - 0
src/school/train-report/index.module.less

@@ -66,4 +66,8 @@
       flex: 0 auto;
     }
   }
+}
+
+.itemChild {
+  flex: 1;
 }

+ 40 - 6
src/school/train-report/modal/student-attendance.tsx

@@ -83,21 +83,55 @@ export default defineComponent({
           //   textColor = '#F67146'
           // }
         } else {
-          titleList.push(reportCourseType[i])
-          valueList.push(Math.ceil(data[i] * 100))
+          // titleList.push(reportCourseType[i])
+          // valueList.push(Math.ceil(data[i] * 100))
+          const value = data[i]
+          if (Array.isArray(value)) {
+            value.forEach((v: any) => {
+              titleList.push(v.name)
+              valueList.push(Math.ceil(v.value * 100))
+            })
+          }
         }
       }
 
       const chartDom = document.getElementById('studentEcharts')
       myChart = echarts.init(chartDom as HTMLDivElement)
       const option = {
+        dataZoom: [
+          {
+            type: 'inside',
+            realtime: true,
+            startValue: 0,
+            endValue: 4,
+            filterMode: 'none',
+            zoomLock: true
+          }
+        ],
         xAxis: {
           type: 'category',
           data: titleList,
           axisLabel: {
-            rotate: 45,
-            fontSize: 10,
-            color: '#333'
+            // rotate: 45,
+            interval: 0,
+            fontSize: 9,
+            color: '#333',
+            width: 54,
+            formatter: (value: any) => {
+              let ret = '' // 拼接加\n返回的类目项
+              const valLength = value.length // X轴类目项的文字个数
+              const rowN = Math.ceil(valLength / 6) // 类目项需要换行的行数
+              if (rowN > 1) {
+                ret =
+                  value.substring(0, 6) +
+                  '\n' +
+                  value.substring(6, 11) +
+                  (valLength > 11 ? '... ' : '')
+                return ret
+              } else {
+                return value + '\n' //+ '{b|添加}'
+              }
+            }
           },
           axisLine: {
             lineStyle: {
@@ -119,7 +153,7 @@ export default defineComponent({
           {
             type: 'bar',
             showBackground: false,
-            barWidth: 15,
+            barWidth: 20,
             itemStyle: {
               color: lineColor
             },

+ 50 - 9
src/school/train-report/modal/teacher-attendance.tsx

@@ -84,8 +84,15 @@ export default defineComponent({
         if (i === 'TOTAL') {
           forms.total = Math.ceil(data[i] * 100)
         } else {
-          titleList.push(reportCourseType[i])
-          valueList.push(data[i])
+          // titleList.push(reportCourseType[i])
+          // valueList.push(data[i])
+          const value = data[i]
+          if (Array.isArray(value)) {
+            value.forEach((v: any) => {
+              titleList.push(v.name)
+              valueList.push(v.value)
+            })
+          }
         }
       }
 
@@ -93,18 +100,26 @@ export default defineComponent({
       const dataNot = props.reportDataNot || {}
       for (const i in dataNot) {
         if (i === 'TOTAL') {
-          forms.total2 = Math.ceil(data[i] * 100)
+          forms.total2 = Math.ceil(dataNot[i] * 100)
         } else {
-          valueList2.push(dataNot[i])
+          const value = dataNot[i]
+          if (Array.isArray(value)) {
+            value.forEach((v: any) => {
+              // titleList.push(v.name)
+              valueList2.push(v.value)
+            })
+          }
+          // valueList2.push(dataNot[i])
         }
       }
+      console.log(valueList, valueList2)
       if (forms.type.includes('YES')) {
         seriesList.push({
           name: '出勤课时数',
           type: 'bar',
           stack: 'work',
           showBackground: false,
-          barWidth: 15,
+          barWidth: 20,
           itemStyle: {
             color: '#5EA4FF'
           },
@@ -123,7 +138,7 @@ export default defineComponent({
           type: 'bar',
           stack: 'work',
           showBackground: false,
-          barWidth: 15,
+          barWidth: 20,
           itemStyle: {
             color: '#69DDE8'
           },
@@ -140,13 +155,39 @@ export default defineComponent({
       const chartDom = document.getElementById('teacherEcharts')
       myChart = echarts.init(chartDom as HTMLDivElement)
       const option = {
+        dataZoom: [
+          {
+            type: 'inside',
+            realtime: true,
+            startValue: 0,
+            endValue: 4,
+            filterMode: 'none',
+            zoomLock: true
+          }
+        ],
         xAxis: {
           type: 'category',
           data: titleList,
           axisLabel: {
-            rotate: 45,
-            fontSize: 10,
-            color: '#333'
+            interval: 0,
+            fontSize: 9,
+            color: '#333',
+            width: 54,
+            formatter: (value: any) => {
+              let ret = '' // 拼接加\n返回的类目项
+              const valLength = value.length // X轴类目项的文字个数
+              const rowN = Math.ceil(valLength / 6) // 类目项需要换行的行数
+              if (rowN > 1) {
+                ret =
+                  value.substring(0, 6) +
+                  '\n' +
+                  value.substring(6, 11) +
+                  (valLength > 11 ? '... ' : '')
+                return ret
+              } else {
+                return value + '\n' //+ '{b|添加}'
+              }
+            }
           },
           axisLine: {
             lineStyle: {

+ 37 - 6
src/school/train-report/modal/train-class.tsx

@@ -79,21 +79,52 @@ export default defineComponent({
         if (i === 'TOTAL') {
           forms.total = data[i]
         } else {
-          titleList.push(reportCourseType[i])
-          valueList.push(data[i])
+          const value = data[i]
+          if (Array.isArray(value)) {
+            value.forEach((v: any) => {
+              titleList.push(v.name)
+              valueList.push(v.value)
+            })
+          }
         }
       }
 
       const chartDom = document.getElementById('classEcharts')
       myChart = echarts.init(chartDom as HTMLDivElement)
       const option = {
+        dataZoom: [
+          {
+            type: 'inside',
+            realtime: true,
+            startValue: 0,
+            endValue: 4,
+            filterMode: 'none',
+            zoomLock: true
+          }
+        ],
         xAxis: {
           type: 'category',
           data: titleList,
           axisLabel: {
-            rotate: 45,
-            fontSize: 10,
-            color: '#333'
+            interval: 0,
+            fontSize: 9,
+            color: '#333',
+            width: 54,
+            formatter: (value: any) => {
+              let ret = '' // 拼接加\n返回的类目项
+              const valLength = value.length // X轴类目项的文字个数
+              const rowN = Math.ceil(valLength / 6) // 类目项需要换行的行数
+              if (rowN > 1) {
+                ret =
+                  value.substring(0, 6) +
+                  '\n' +
+                  value.substring(6, 11) +
+                  (valLength > 11 ? '... ' : '')
+                return ret
+              } else {
+                return value + '\n' //+ '{b|添加}'
+              }
+            }
           },
           axisLine: {
             lineStyle: {
@@ -116,7 +147,7 @@ export default defineComponent({
           {
             type: 'bar',
             showBackground: false,
-            barWidth: 15,
+            barWidth: 20,
             itemStyle: {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 { offset: 0, color: '#69DCE8' },

+ 39 - 6
src/school/train-report/modal/train-over-work.tsx

@@ -84,21 +84,54 @@ export default defineComponent({
           // forms.total = data[i]
           forms.total = Math.ceil(data[i] * 100)
         } else {
-          titleList.push(reportCourseType[i])
-          valueList.push(Math.ceil(data[i] * 100))
+          // titleList.push(reportCourseType[i])
+          // valueList.push(Math.ceil(data[i] * 100))
+          const value = data[i]
+          if (Array.isArray(value)) {
+            value.forEach((v: any) => {
+              titleList.push(v.name)
+              valueList.push(Math.ceil(v.value * 100))
+            })
+          }
         }
       }
 
       const chartDom = document.getElementById('overWorkEcharts')
       myChart = echarts.init(chartDom as HTMLDivElement)
       const option = {
+        dataZoom: [
+          {
+            type: 'inside',
+            realtime: true,
+            startValue: 0,
+            endValue: 4,
+            filterMode: 'none',
+            zoomLock: true
+          }
+        ],
         xAxis: {
           type: 'category',
           data: titleList,
           axisLabel: {
-            rotate: 45,
-            fontSize: 10,
-            color: '#333'
+            interval: 0,
+            fontSize: 9,
+            color: '#333',
+            width: 54,
+            formatter: (value: any) => {
+              let ret = '' // 拼接加\n返回的类目项
+              const valLength = value.length // X轴类目项的文字个数
+              const rowN = Math.ceil(valLength / 6) // 类目项需要换行的行数
+              if (rowN > 1) {
+                ret =
+                  value.substring(0, 6) +
+                  '\n' +
+                  value.substring(6, 11) +
+                  (valLength > 11 ? '... ' : '')
+                return ret
+              } else {
+                return value + '\n' //+ '{b|添加}'
+              }
+            }
           },
           axisLine: {
             lineStyle: {
@@ -120,7 +153,7 @@ export default defineComponent({
           {
             type: 'bar',
             showBackground: false,
-            barWidth: 15,
+            barWidth: 20,
             itemStyle: {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                 { offset: 0, color: '#69DCE8' },

+ 1 - 1
vite.config.ts

@@ -12,7 +12,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://online.lexiaoya.cn/';
-const proxyUrl = 'https://test.lexiaoya.cn/'
+const proxyUrl = 'https://dev.lexiaoya.cn/'
 // const proxyUrl = 'http://47.98.131.38:8989/'
 // const proxyUrl = 'http://192.168.3.20:8989/' // 邹旋
 // const proxyUrl = 'http://192.168.3.143:8989/' // 尚科