LeftBox.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <transition
  3. appear
  4. name="animate__animated animate__move"
  5. enter-active-class="animate__slideInLeft"
  6. leave-active-class="animate__slideOutLeft"
  7. >
  8. <div class="widget-ProjectOverview">
  9. <div class="head">
  10. <div class="title">
  11. <div class="icon"></div>
  12. <span class="site-info">停工日期设置</span>
  13. <div class="addDiv" @click="addStopDate"></div>
  14. </div>
  15. </div>
  16. <div class="bodyBox" :class="{ activeNoData: stopDateList.length == 0 }">
  17. <div class="inputStopDate" v-if="stopDateList.length > 0">
  18. <template v-for="(item, index) in stopDateList">
  19. <div :key="'inputStopDate_' + index" class="dateTimeDiv">
  20. <el-date-picker
  21. v-model="item.value"
  22. type="daterange"
  23. format="yyyy-MM-dd HH:mm:ss"
  24. value-format="yyyy-MM-dd HH:mm:ss"
  25. range-separator="至"
  26. start-placeholder="开始日期"
  27. end-placeholder="结束日期"
  28. ></el-date-picker>
  29. <div class="removeDiv" @click="removeStopDate(index)">
  30. <i class="removeDate el-icon-remove-outline" style="color: #78b6e7"></i>
  31. </div>
  32. </div>
  33. </template>
  34. </div>
  35. <div class="tableBox" v-if="tableData.length">
  36. <div class="title">【方案1】因停工导致延期的施工工序</div>
  37. <el-table :data="tableData" size="mini" style="width: 100%" height="250">
  38. <el-table-column prop="step" label="施工工序" width="88"> </el-table-column>
  39. <el-table-column prop="joint_unit" label="联合单元" width="90"> </el-table-column>
  40. <el-table-column label="施工天数">
  41. <el-table-column prop="start_time" label="停工起" width="65"
  42. ><template slot-scope="{ row }">{{ getDate(row.start_time) }}</template></el-table-column
  43. >
  44. <el-table-column prop="end_time" label="停工止" width="65">
  45. <template slot-scope="{ row }">{{ getDate(row.end_time) }}</template></el-table-column
  46. >
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. </div>
  51. <!-- <div class="bottonListDiv">
  52. <el-button type="primary" @click="removeStopDate(-1)">重置</el-button>
  53. <el-button type="primary" @click="saveStopDate">确认</el-button>
  54. </div> -->
  55. </div>
  56. </transition>
  57. </template>
  58. <script>
  59. import eventBus from '@/utils/eventBus.js'
  60. export default {
  61. data() {
  62. return {
  63. stopDateList: [],
  64. tableData: []
  65. }
  66. },
  67. mounted() {
  68. eventBus.one('best_schedule', (i) => (this.tableData = i))
  69. this.getPageData()
  70. },
  71. methods: {
  72. getPageData() {},
  73. /**
  74. *添加时间段
  75. */
  76. addStopDate() {
  77. const item = {
  78. value: ''
  79. }
  80. this.stopDateList.push(item)
  81. },
  82. /**
  83. *删除时间段
  84. */
  85. removeStopDate(index) {
  86. if (index == -1) {
  87. this.stopDateList = []
  88. } else {
  89. this.stopDateList.splice(index, 1)
  90. }
  91. },
  92. getDate(isoDate) {
  93. const date = new Date(isoDate)
  94. const year = date.getFullYear()
  95. const month = String(date.getMonth() + 1).padStart(2, '0')
  96. const day = String(date.getDate()).padStart(2, '0')
  97. const hours = String(date.getHours()).padStart(2, '0')
  98. const minutes = String(date.getMinutes()).padStart(2, '0')
  99. const seconds = String(date.getSeconds()).padStart(2, '0')
  100. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  101. },
  102. changeTable(r) {
  103. r.map((i) => {
  104. this.stopDateList.push({ value: [i.start, i.end] })
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style>
  111. .tableBox th.el-table__cell,
  112. .tableBox .el-table,
  113. .tableBox .el-table__expanded-cell,
  114. .tableBox .el-table tr {
  115. background-color: rgba(14, 167, 255, 0) !important;
  116. }
  117. .tableBox .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
  118. background-color: rgba(14, 167, 255, 0) !important;
  119. }
  120. .tableBox .el-table td.el-table__cell,
  121. .tableBox .el-table th.el-table__cell.is-leaf {
  122. border-bottom: 1px solid #216294;
  123. }
  124. .tableBox .el-table {
  125. color: #fff !important;
  126. }
  127. .tableBox .el-table th.el-table__cell > .cell {
  128. font-weight: 500;
  129. font-size: 14px;
  130. color: #2ba7ff;
  131. }
  132. .tableBox .el-table--border .el-table__cell,
  133. .tableBox .el-table__body-wrapper .el-table--border.is-scrolling-left ~ .el-table__fixed {
  134. border-right: 1px solid #216294;
  135. }
  136. .tableBox .el-table--border,
  137. .tableBox .el-table--group {
  138. border: 1px solid #216294;
  139. }
  140. .tableBox .el-table--border th.el-table__cell,
  141. .tableBox .el-table__fixed-right-patch {
  142. border-bottom: 1px solid #216294;
  143. }
  144. .tableBox .el-table--border::after,
  145. .tableBox .el-table--group::after,
  146. .tableBox .el-table::before {
  147. background-color: rgba(14, 167, 255, 0);
  148. }
  149. </style>
  150. <style>
  151. .dateTimeDiv input.el-range-input {
  152. background-color: rgba(255, 255, 255, 0);
  153. color: #fff;
  154. }
  155. .dateTimeDiv .el-date-editor .el-range__icon,
  156. .dateTimeDiv .el-date-editor .el-range-separator {
  157. line-height: 30px;
  158. height: auto;
  159. }
  160. .dateTimeDiv .el-date-editor .el-range-input{
  161. width: 35% !important;
  162. }
  163. .dateTimeDiv .el-range-separator {
  164. color: #d9d8d8;
  165. }
  166. .tableBox .el-table .el-table__cell {
  167. padding: 0px;
  168. }
  169. .activeNoData {
  170. height: 100%;
  171. background: url('~@/assets/images/jczc/noData.png') no-repeat top right;
  172. background-size: 202.4px 307.5px;
  173. background-position-x: 107px;
  174. }
  175. </style>
  176. <style lang="scss" scoped>
  177. .bodyBox {
  178. padding: 15px;
  179. }
  180. .tableBox {
  181. margin-top: 20px;
  182. padding-top: 15px;
  183. border-top: dashed 1px rgba(42, 147, 255, 0.3);
  184. }
  185. .tableBox .title {
  186. font-weight: 500;
  187. font-size: 16px;
  188. margin-bottom: 10px;
  189. }
  190. .dateTimeDiv > div:first-child {
  191. background-color: rgba(255, 255, 255, 0);
  192. border-radius: 2px;
  193. height: 30px;
  194. border: 1px solid #216294;
  195. }
  196. .dateTimeDiv {
  197. display: flex;
  198. margin-top: 10px;
  199. }
  200. .removeDiv {
  201. width: 24px !important;
  202. height: 24px !important;
  203. margin: auto 0px auto 10px !important;
  204. cursor: pointer !important;
  205. }
  206. .addDiv {
  207. color: #9bd2fa;
  208. font-size: 14px;
  209. font-weight: normal;
  210. cursor: pointer;
  211. background: url('~@/assets/images/jczc/add.png') no-repeat center;
  212. background-size: 100% 100%;
  213. width: 40px;
  214. height: 22px;
  215. }
  216. .animate__slideInLeft,
  217. .animate__slideOutLeft {
  218. animation-duration: 3s; //动画持续时间
  219. animation-delay: 0s; //动画延迟时间
  220. }
  221. .widget-ProjectOverview {
  222. $size10: 0.052083rem /* 10/192 */;
  223. $size20: 0.104167rem /* 20/192 */;
  224. z-index: 2;
  225. //position
  226. top: 0.505208rem /* 97/192 */;
  227. margin-left: $size20 /* 20/192 */;
  228. position: absolute;
  229. //size
  230. height: calc(100% - 1.57292rem - 115px);
  231. width: 2.083333rem /* 400/192 */;
  232. overflow: hidden;
  233. color: #eee;
  234. background: linear-gradient(0deg, rgba(14, 167, 255, 0.24) 0%, rgba(14, 167, 255, 0.05) 100%);
  235. .head {
  236. height: 0.166667rem /* 32/192 */;
  237. width: 100%;
  238. background: linear-gradient(-90deg, rgba(43, 167, 255, 0.2) 0%, rgba(43, 167, 255, 0.08) 100%);
  239. font-family: Source Han Sans CN-HEAVY;
  240. .title {
  241. width: 100%;
  242. height: 100%;
  243. display: flex;
  244. font-weight: 400;
  245. align-items: center;
  246. .icon {
  247. height: 0.166667rem /* 32/192 */;
  248. width: 0.34375rem /* 66/192 */;
  249. background: url('~@/views/groupPage/images/模块图标/项目概况.png') no-repeat center center;
  250. background-size: 100% 100%;
  251. }
  252. span {
  253. flex: 1;
  254. font-weight: bold;
  255. font-size: 0.083333rem /* 16/192 */;
  256. color: #ffffff;
  257. padding: 0.041667rem /* 8/192 */;
  258. background: linear-gradient(0deg, #9bd2fa 0%, #ffffff 100%);
  259. background-clip: text;
  260. -webkit-text-fill-color: transparent;
  261. }
  262. }
  263. }
  264. }
  265. </style>