wyh 1 vuosi sitten
vanhempi
commit
75da6742b6
1 muutettua tiedostoa jossa 33 lisäystä ja 3 poistoa
  1. 33 3
      itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

+ 33 - 3
itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

@@ -29,7 +29,7 @@
     <uGantt :configColumns="configColumns" :taskLists="taskLists" ref="uGantt" @dbclick="rowDblclick" @addRow="addRow">
       <!-- 其他需要自定义的弹窗数据 -->
       <!-- 双击事件弹窗 -->
-      <el-dialog :title="title" :visible.sync="dialogVisible" width="35%">
+      <el-dialog :title="title" :visible.sync="dialogVisible" width="45%">
         <el-form ref="currentDbEdit" :model="currentDbEdit" :rules="rules" label-width="80px">
           <el-form-item label="开始时间" prop="start_date">
             <el-date-picker v-model="currentDbEdit.start_date" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" @change="dataChange"></el-date-picker>
@@ -51,9 +51,36 @@
                   :value="item.value">
                 </el-option>
               </el-select>
-              <div class="search-btn" @click="handleEqCalendar">查看</div>
+              <div class="search-btn" @click="handleEqCalendar">{{openRl == 1 ? '收起': '展开'}}</div>
             </div>
           </el-form-item>
+          <el-calendar v-if="openRl == 1">
+            <template slot="dateCell" slot-scope="{date, data}">
+              <!-- <div> -->
+                <!-- 如果是当前选择月 -->
+                <template v-if="data.type === 'current-month'">
+                  <!-- 这里加了周六周天的判断 -->
+                  <div :class="(date.getDay()==6 || date.getDay()==0)?'weeked' :'notweeked'">{{data.day.substring(8,10)}}</div>
+                  <!-- <div :class="(date.getDay()==6 || date.getDay()==0)?'weeked' :'notweeked'">{{data.day.split('-').slice(2).join('-')}}</div> -->
+                  <!-- 方法二:在方法中判断设置返回 -->
+                  <template v-if="dealMyDate(data.day)">
+                    <template v-for="(item, index) in dealMyDate(data.day)">
+                      <el-tag type="danger" :key="index" style="margin-right: 2px;" @click="chooseDevice(item)">
+                        {{ item.deviceName }}
+                      </el-tag>
+                    </template>
+                  </template>
+                  <!-- <el-tag type="danger" v-if="dealMyDate(data.day).length > 0">
+                    {{ dealMyDate(data.day)[0].deviceName }}
+                  </el-tag> -->
+                </template>
+                <!-- 不是 -->
+                <template v-else>
+                  <div style="text-align: right;">{{ data.day.split('-').slice(1).join('-') }}</div>
+                </template>
+              <!-- </div> -->
+            </template>
+          </el-calendar>
           <el-form-item label="传感器" prop="chuanganqiArray">
             <el-select v-model="currentDbEdit.chuanganqiArray" multiple placeholder="请选择传感器" style="width: 100%;">
               <el-option
@@ -313,6 +340,7 @@ export default {
       rules: {
       },
       // 日历弹窗
+      openRl: 1,
       showCalendarDialog: false,
       scheduleData: [],
     }
@@ -336,7 +364,8 @@ export default {
       })
     },
     handleEqCalendar(){
-      this.showCalendarDialog = true
+      this.openRl = -this.openRl
+      // this.showCalendarDialog = true
     },
     dealMyDate(v) {
       let res = ''
@@ -471,6 +500,7 @@ export default {
     // 双击事件
     rowDblclick(current){
       console.log(current)
+      this.openRl = 1
       this.currentDbEdit = current
       this.title = this.currentDbEdit.sampleName + '-' + this.currentDbEdit.testItems + '-' + this.currentDbEdit.pm
       // 根据开始时间结束时间计算持续时间