lyy 1 год назад
Родитель
Сommit
e736a2849b
4 измененных файлов с 67 добавлено и 43 удалено
  1. 0 4
      components.d.ts
  2. 1 0
      package.json
  3. 16 4
      pnpm-lock.yaml
  4. 50 35
      src/views/carplanman/index.vue

+ 0 - 4
components.d.ts

@@ -25,7 +25,6 @@ declare module 'vue' {
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElHeader: typeof import('element-plus/es')['ElHeader']
     ElIcon: typeof import('element-plus/es')['ElIcon']
-    ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
@@ -38,10 +37,7 @@ declare module 'vue' {
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
-    ElTabPane: typeof import('element-plus/es')['ElTabPane']
-    ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
-    ElUpload: typeof import('element-plus/es')['ElUpload']
     HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
     IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default']
     IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default']

+ 1 - 0
package.json

@@ -17,6 +17,7 @@
   "dependencies": {
     "@element-plus/icons-vue": "^2.3.1",
     "axios": "^1.6.8",
+    "dayjs": "^1.11.13",
     "element-plus": "^2.7.2",
     "nprogress": "^0.2.0",
     "pinia": "^2.1.7",

+ 16 - 4
pnpm-lock.yaml

@@ -14,6 +14,9 @@ importers:
       axios:
         specifier: ^1.6.8
         version: 1.6.8
+      dayjs:
+        specifier: ^1.11.13
+        version: 1.11.13
       element-plus:
         specifier: ^2.7.2
         version: 2.7.2(vue@3.4.27(typescript@5.4.5))
@@ -353,46 +356,55 @@ packages:
     resolution: {integrity: sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==}
     cpu: [arm]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-arm-musleabihf@4.17.2':
     resolution: {integrity: sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==}
     cpu: [arm]
     os: [linux]
+    libc: [musl]
 
   '@rollup/rollup-linux-arm64-gnu@4.17.2':
     resolution: {integrity: sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==}
     cpu: [arm64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-arm64-musl@4.17.2':
     resolution: {integrity: sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==}
     cpu: [arm64]
     os: [linux]
+    libc: [musl]
 
   '@rollup/rollup-linux-powerpc64le-gnu@4.17.2':
     resolution: {integrity: sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==}
     cpu: [ppc64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-riscv64-gnu@4.17.2':
     resolution: {integrity: sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==}
     cpu: [riscv64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-s390x-gnu@4.17.2':
     resolution: {integrity: sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==}
     cpu: [s390x]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-x64-gnu@4.17.2':
     resolution: {integrity: sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==}
     cpu: [x64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-x64-musl@4.17.2':
     resolution: {integrity: sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==}
     cpu: [x64]
     os: [linux]
+    libc: [musl]
 
   '@rollup/rollup-win32-arm64-msvc@4.17.2':
     resolution: {integrity: sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==}
@@ -836,8 +848,8 @@ packages:
     resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==}
     engines: {node: '>= 0.4'}
 
-  dayjs@1.11.11:
-    resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==}
+  dayjs@1.11.13:
+    resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==}
 
   de-indent@1.0.2:
     resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
@@ -3061,7 +3073,7 @@ snapshots:
       es-errors: 1.3.0
       is-data-view: 1.0.1
 
-  dayjs@1.11.11: {}
+  dayjs@1.11.13: {}
 
   de-indent@1.0.2: {}
 
@@ -3158,7 +3170,7 @@ snapshots:
       '@types/lodash-es': 4.17.12
       '@vueuse/core': 9.13.0(vue@3.4.27(typescript@5.4.5))
       async-validator: 4.2.5
-      dayjs: 1.11.11
+      dayjs: 1.11.13
       escape-html: 1.0.3
       lodash: 4.17.21
       lodash-es: 4.17.21

+ 50 - 35
src/views/carplanman/index.vue

@@ -1,6 +1,50 @@
 
 
 <script setup lang="ts">
+import dayjs from 'dayjs'
+let todayweek=dayjs().day()
+let fristDay=ref(dayjs())
+let endDay=ref(dayjs())
+let noshowday=ref([])
+switch(todayweek){
+  case 0:
+    fristDay.value=dayjs()
+    endDay.value=dayjs().add(34, 'day')
+    noshowday.value=[]
+    break;
+  case 1:
+    fristDay.value=dayjs().add(-1, 'day')
+    endDay.value=dayjs().add(33, 'day')
+    noshowday.value=[dayjs().add(-1, 'day').format('YYYY-MM-DD')]
+    break;
+  case 2:
+  fristDay.value=dayjs().add(-2, 'day')
+  endDay.value=dayjs().add(32, 'day')
+  noshowday.value=[dayjs().add(-1, 'day').format('YYYY-MM-DD'),dayjs().add(-2, 'day').format('YYYY-MM-DD')]
+    break;
+  case 3:
+  fristDay.value=dayjs().add(-3, 'day')
+  endDay.value=dayjs().add(31, 'day')
+  noshowday.value=[dayjs().add(-1, 'day').format('YYYY-MM-DD'),dayjs().add(-2, 'day').format('YYYY-MM-DD'),dayjs().add(-3, 'day').format('YYYY-MM-DD')]
+    break;
+  case 4:
+  fristDay.value=dayjs().add(-4, 'day')
+  endDay.value=dayjs().add(30, 'day')
+  noshowday.value=[dayjs().add(-1, 'day').format('YYYY-MM-DD'),dayjs().add(-2, 'day').format('YYYY-MM-DD'),dayjs().add(-3, 'day').format('YYYY-MM-DD'),dayjs().add(-4, 'day').format('YYYY-MM-DD')]
+    break;
+  case 5:
+  fristDay.value=dayjs().add(-5, 'day')
+  endDay.value=dayjs().add(29, 'day')
+  noshowday.value=[dayjs().add(-1, 'day').format('YYYY-MM-DD'),dayjs().add(-2, 'day').format('YYYY-MM-DD'),dayjs().add(-3, 'day').format('YYYY-MM-DD'),dayjs().add(-4, 'day').format('YYYY-MM-DD'),dayjs().add(-5, 'day').format('YYYY-MM-DD')]
+    break;
+    
+  case 6:
+    fristDay.value=dayjs().add(-6, 'day')
+    endDay.value=dayjs().add(28, 'day')
+    noshowday.value=[dayjs().add(-1, 'day').format('YYYY-MM-DD'),dayjs().add(-2, 'day').format('YYYY-MM-DD'),dayjs().add(-3, 'day').format('YYYY-MM-DD'),dayjs().add(-4, 'day').format('YYYY-MM-DD'),dayjs().add(-5, 'day').format('YYYY-MM-DD'),dayjs().add(-6, 'day').format('YYYY-MM-DD')]
+    break;
+
+}
 
 import { ref,onMounted,reactive } from 'vue'
 import { Search,Download,Tools,Plus,Check,Close } from "@element-plus/icons-vue";
@@ -17,8 +61,6 @@ interface RuleForm {
   mdate: string,
   mtime: string,
   remark: string,
-  startSites: string,
-  endSites: string,
   isauto: any,
   pprice: any
 }
@@ -29,8 +71,6 @@ const initData={
   "mdate": "",
   "mtime": "",
   "remark": "",
-  "startSites": "",
-  "endSites": "",
   "isauto": '0',
   "pprice": ''
 }
@@ -43,8 +83,6 @@ const ruleForm = reactive<RuleForm>({
   "mdate": "",
   "mtime": "",
   "remark": "",
-  "startSites": "",
-  "endSites": "",
   "isauto": '0',
   "pprice": ''
 })
@@ -198,30 +236,7 @@ const getTableData=()=>{
         if(route){
           tableData.value[i].pathName=route.name
         }
-        /////////////////////////////////////////////////////
-        let startSites=stationList.value.filter(station=>{
-          
-          return station.id===tableData.value[i].startSites
-        })[0]
-
-       
-       
-        if(startSites){
-          tableData.value[i].startSitesName=startSites.name
-        }
-       
-
-
-        let endSites=stationList.value.filter(station=>{
-          
-          return station.id===tableData.value[i].endSites
-        })[0]
-
-       
-       
-        if(endSites){
-          tableData.value[i].endSitesName=endSites.name
-        }
+    
         
       }
 
@@ -378,7 +393,7 @@ onMounted(()=>{
                             <div>{{ nowselRoute.name }} - 排班表</div>
                             <el-switch style="margin:0 6px" @change="isautoChange" v-model="isauto" />
                             <div style="color: #4B5563;font-size:14px;font-weight: 400;">自动续排</div>
-                            <el-button size="mini" v-if="viewType==2" style="margin-left:6px;padding:0 2px;" type="primary"  @click="addItem({})">添加排班 </el-button>
+                            <!-- <el-button size="mini" v-if="viewType==2" style="margin-left:6px;padding:0 2px;" type="primary"  @click="addItem({})">添加排班 </el-button> -->
                         </div>
                         <div class="title-right">
                             <el-button @click="viewType=1">月视图 </el-button>
@@ -386,14 +401,14 @@ onMounted(()=>{
                         </div>
                     </div>
                     <div class="common-chart-wrap" id="caruse-wrap">
-                        <el-calendar v-if="viewType==1">
+                        <el-calendar :range="[fristDay,endDay]" v-if="viewType==1">
                           <template #date-cell="{ data }">
                             <!-- <p :class="data.isSelected ? 'is-selected' : ''">
                               {{ data.day.split('-').slice(1).join('-') }}
                               {{ data.isSelected ? '✔️' : '' }}
                             </p> -->
 
-                            <div>
+                            <div v-if="noshowday.indexOf(data.day)==-1">
                              
                               {{ data.day.split('-').slice(1).join('-') }}
                               <div v-for="item in tableData" :key="item.id">
@@ -441,7 +456,7 @@ onMounted(()=>{
                         />
                       </el-select>
 
-                      <el-select
+                      <!-- <el-select
                       style="margin-left:10px"
                   v-model="pathId"
                   placeholder="路线"
@@ -454,7 +469,7 @@ onMounted(()=>{
                     :label="item.name"
                     :value="item.id"
                   />
-                </el-select>
+                </el-select> -->
                         <el-button @click="searchClick" style="margin-left:10px">筛选</el-button>
                       </div>
                       <div class="right-part">