index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <template>
  2. <div class="calendar-dialog">
  3. <el-row :gutter="10">
  4. <!--table数据-->
  5. <el-col :span="24" :xs="24">
  6. <div class="main-right-box">
  7. <!-- 搜索条件 -->
  8. <div class="main-search-box">
  9. <el-form
  10. :model="queryParams"
  11. ref="queryForm"
  12. size="small"
  13. :inline="true"
  14. v-show="showSearch"
  15. >
  16. <el-form-item label="机构名称">
  17. <org-tree
  18. v-model="queryParams.orgId"
  19. @defaultKey="getDefaultKey"
  20. @checkChange="changeCheckBox"
  21. @click="handleNodeClick"
  22. :showCheckSub="false"
  23. :defaultCheckSub="false"
  24. ref="orgTree"
  25. ></org-tree>
  26. </el-form-item>
  27. </el-form>
  28. </div>
  29. <div style="display: flex">
  30. <div style="width: 65%">
  31. <el-calendar v-model="calendarDate">
  32. <!-- <template
  33. slot="dateCell"
  34. slot-scope="{date, data}">
  35. <p :class="data.isSelected ? 'is-selected' : ''">
  36. {{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : ''}}
  37. </p>
  38. </template> -->
  39. <template slot="dateCell" slot-scope="{ data }">
  40. <div class="card-group" @click="selectedDate(data)">
  41. <!-- <div
  42. :class="
  43. data.isSelected
  44. ? 'is-selected card-calendar-text'
  45. : 'card-calendar-text'
  46. "
  47. >
  48. <span>{{ getDate(data.day) }}</span>
  49. <el-icon
  50. class="el-icon-check"
  51. v-if="data.isSelected"
  52. ></el-icon>
  53. </div> -->
  54. <div v-if="isSetedWorkTime(data)" :class="getSelectedTdClass(data)">
  55. <span
  56. v-for="(item, index) in tableList"
  57. :key="index"
  58. class="card"
  59. >
  60. <div v-if="item.ymdDate === data.day" class="card-flag">
  61. <div :class="getDayClass(data, item)">
  62. <span>{{ getDate(data.day) }}</span>
  63. <el-icon
  64. class="el-icon-check"
  65. v-if="data.isSelected"
  66. ></el-icon>
  67. </div>
  68. <div :class="'card' + getColorIndexByWorkTime(data,item)">
  69. <div class="visits-val">
  70. {{ item.isDuty === "1" ? "值班" : "" }}
  71. </div>
  72. </div>
  73. </div>
  74. </span>
  75. </div>
  76. <div v-else :class="getSelectedTdClass(data)">
  77. <span class="card">
  78. <div class="card-flag">
  79. <div :class="getDayClass(data, null)">
  80. <span>{{ getDate(data.day) }}</span>
  81. <el-icon
  82. class="el-icon-check"
  83. v-if="data.isSelected"
  84. ></el-icon>
  85. </div>
  86. <div :class="'card' + getColorIndexByWorkTime(data,null)">
  87. <div class="visits-val">{{ "" }}</div>
  88. </div>
  89. </div>
  90. </span>
  91. </div>
  92. </div>
  93. </template>
  94. </el-calendar>
  95. </div>
  96. <div
  97. style="
  98. width: 35%;
  99. background-color: #fff;
  100. margin-left: 10px;
  101. box-shadow: 2px 2px 8px #ccc;
  102. "
  103. >
  104. <el-form
  105. :model="formData"
  106. :rules="formData.isEnable ? currentRules : {}"
  107. size="small"
  108. ref="form"
  109. label-position="right"
  110. label-width="120px"
  111. label-prefix=":"
  112. :disabled="!canSave()"
  113. >
  114. <el-row :gutter="20">
  115. <!-- <el-col :span="24">
  116. <el-form-item prop="orgName" label="机构:" >
  117. <span>{{formData.orgName}}</span>
  118. </el-form-item>
  119. </el-col> -->
  120. <el-col :span="24">
  121. <el-form-item label="日期:">
  122. <span>{{ formData.ymdDate }}</span>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="24">
  126. <el-form-item label="星期:">
  127. <span>{{ parseTime(formData.ymdDate, "dddd") }}</span>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="24">
  131. <el-form-item prop="isEnable" label="状态:">
  132. <template>
  133. <el-radio-group
  134. v-model="formData.isEnable"
  135. @change="onEnableChange(formData)"
  136. >
  137. <el-radio text-color="#48bb78" label="1"
  138. >营业</el-radio
  139. >
  140. <el-radio text-color="#f56565" label="0"
  141. >歇业</el-radio
  142. >
  143. </el-radio-group>
  144. </template>
  145. </el-form-item>
  146. </el-col>
  147. <el-col :span="24">
  148. <el-form-item prop="isEnable" label="值班打卡:">
  149. <template>
  150. <el-radio-group v-model="formData.isDuty">
  151. <el-radio text-color="#48bb78" label="1">是</el-radio>
  152. <el-radio text-color="#f56565" label="0">否</el-radio>
  153. </el-radio-group>
  154. </template>
  155. </el-form-item>
  156. </el-col>
  157. <el-col v-if="formData.isEnable == '1'" :span="24">
  158. <el-form-item prop="workTime" label="上班时间:">
  159. <template>
  160. <el-time-select
  161. :picker-options="pickerOptions"
  162. v-model="formData.workTime"
  163. />
  164. </template>
  165. </el-form-item>
  166. </el-col>
  167. <el-col v-if="formData.isEnable == '1'" :span="24">
  168. <el-form-item prop="workOffTime" label="下班时间:">
  169. <template>
  170. <el-time-select
  171. :picker-options="pickerOptions"
  172. v-model="formData.workOffTime"
  173. />
  174. </template>
  175. </el-form-item>
  176. </el-col>
  177. <el-col v-if="formData.isEnable == '1'" :span="24">
  178. <el-form-item prop="openTime" label="营业开始:">
  179. <template>
  180. <el-time-select
  181. :picker-options="pickerOptions"
  182. v-model="formData.openTime"
  183. />
  184. </template>
  185. </el-form-item>
  186. </el-col>
  187. <el-col v-if="formData.isEnable == '1'" :span="24">
  188. <el-form-item prop="closeTime" label="营业结束:">
  189. <template>
  190. <el-time-select
  191. :picker-options="pickerOptions"
  192. v-model="formData.closeTime"
  193. />
  194. </template>
  195. </el-form-item>
  196. </el-col>
  197. <el-col v-if="canSave()" :span="24">
  198. <el-form-item>
  199. <el-button type="primary" @click="onSubmit"
  200. >保存</el-button
  201. >
  202. </el-form-item>
  203. </el-col>
  204. <el-col v-if="canSave()" :span="24">
  205. <el-form-item>
  206. <el-button type="primary" @click="submitCopyMouth"
  207. >复制到全月并保存</el-button
  208. >
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. </el-form>
  213. </div>
  214. </div>
  215. </div>
  216. </el-col>
  217. </el-row>
  218. <dialog-template ref="modalTemplate" @ok="getList"></dialog-template>
  219. </div>
  220. </template>
  221. <script>
  222. import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
  223. import { mapGetters } from "vuex";
  224. import { tableList } from "./api";
  225. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  226. import dayjs from "dayjs";
  227. import { timeCheck } from "@/utils/ruoyi";
  228. import { editWorkTime, addWorkTimeDay } from "@/views/system/workTimeSet/api";
  229. import DialogTemplate from "./dialog.template";
  230. //初始化查询日期
  231. // let sDate =new Date(dayjs().subtract(1, 'month').startOf('month'));
  232. // let eDate = new Date(dayjs().add(1, 'month').endOf('month'));
  233. export default {
  234. // emits: ['selectedDate'],
  235. /** 得先引入字典才能使用 */
  236. dicts: ["sys_business_type", "sys_org_type"],
  237. /** 引入基础minxins*/
  238. components: { DataRangePicker, OrgTree, DialogTemplate },
  239. data() {
  240. return {
  241. nowTime: null,
  242. isNeedLoadedCalendarDate: true,
  243. // 遮罩层
  244. loading: false,
  245. calendarDate: new Date(),
  246. tableList: null,
  247. // 显示搜索条件
  248. showSearch: true,
  249. // 查询参数
  250. queryParams: {
  251. checkSub: false,
  252. orgId: null,
  253. pageNum: 1,
  254. pageSize: 200,
  255. range: [
  256. new Date(dayjs().subtract(1, "month").startOf("month")),
  257. new Date(dayjs().add(1, "month").endOf("month")),
  258. ],
  259. noWorkTime: false,
  260. },
  261. formData: {},
  262. // formDataRules: {
  263. // isEnable: [{ required: true, message: "请选择状态" }],
  264. // workTime: [{ required: true, message: "请输入上班时间" }],
  265. // workOffTime: [{ required: true, message: "请输入下班时间" }],
  266. // openTime: [{ required: true, message: "请输入营业开始时间" }],
  267. // closeTime: [{ required: true, message: "请输入营业结束时间" }],
  268. // },
  269. };
  270. },
  271. mounted() {
  272. let dayBtn = document.querySelector(
  273. ".el-calendar__button-group .el-button-group>button:nth-child(2)"
  274. );
  275. dayBtn.disabled=true;
  276. let dayBtnText = document.querySelector(
  277. ".el-calendar__button-group .el-button-group>button:nth-child(2)>span"
  278. );
  279. dayBtnText.textContent=dayjs(this.calendarDate).format("YYYY-MM");
  280. let prevBtn = document.querySelector(
  281. ".el-calendar__button-group .el-button-group>button:nth-child(1)"
  282. );
  283. prevBtn.addEventListener("click", () => {
  284. this.judgeDate(this.calendarDate);
  285. // dayBtn.innerHTML(dayjs(this.calendarDate).format("YYYY-MM"))
  286. dayBtnText.textContent=dayjs(this.calendarDate).format("YYYY-MM");
  287. });
  288. // console.log("dayBtnText",dayBtnText,dayBtnText.textContent)
  289. // dayBtnText.innerHTML("xxxx")
  290. // dayBtn.addEventListener("click", () => {
  291. // this.judgeDate(this.calendarDate);
  292. // });
  293. let nextBtn = document.querySelector(
  294. ".el-calendar__button-group .el-button-group>button:nth-child(3)"
  295. );
  296. nextBtn.addEventListener("click", () => {
  297. this.judgeDate(this.calendarDate);
  298. dayBtnText.textContent=dayjs(this.calendarDate).format("YYYY-MM");
  299. });
  300. let parent = document.querySelector(
  301. ".el-calendar__header .el-calendar__button-group .el-button-group"
  302. );
  303. // 创建一个颜色含义图示
  304. let btnDuty = this.createButton("营业", "btnDuty", "10px");
  305. let btnUnDuty = this.createButton("歇业", "btnUnDuty", "10px");
  306. let btnUnSetWorkTime = this.createButton("未配置", "btnUnSetWorkTime", "100px");
  307. let btnTemplate = this.createButton("按周配置", "btnTemplate", "10px");
  308. btnTemplate.onclick = function () {
  309. // 触发事件
  310. showWorkTimeTemp();
  311. };
  312. var that = this;
  313. function showWorkTimeTemp() {
  314. // 事件内容
  315. that.showTemplateDailog();
  316. }
  317. parent.insertBefore(btnTemplate, parent.firstChild);
  318. parent.insertBefore(btnUnSetWorkTime, parent.firstChild);
  319. parent.insertBefore(btnUnDuty, parent.firstChild);
  320. parent.insertBefore(btnDuty, parent.firstChild);
  321. },
  322. computed: {
  323. ...mapGetters(["orgId"]),
  324. pickerOptions() {
  325. return {
  326. start: "00:00",
  327. end: "24:00",
  328. step: "00:05",
  329. };
  330. },
  331. currentRules: function () {
  332. if (!this.canSave()) {
  333. return {};
  334. } else {
  335. return {
  336. isEnable: [{ required: true, message: "请选择状态" }],
  337. workTime: [{ required: true, message: "请输入上班时间" }],
  338. workOffTime: [{ required: true, message: "请输入下班时间" }],
  339. openTime: [{ required: true, message: "请输入营业开始时间" }],
  340. closeTime: [{ required: true, message: "请输入营业结束时间" }],
  341. };
  342. }
  343. },
  344. },
  345. created() {
  346. this.getNowTime();
  347. },
  348. watch: {
  349. calendarDate(val, oldVal) {
  350. if (
  351. val &&
  352. dayjs(val).format("YYYY-MM") != dayjs(oldVal).format("YYYY-MM")
  353. ) {
  354. console.log("calendarDate", val);
  355. this.judgeDate(val);
  356. }
  357. },
  358. },
  359. methods: {
  360. dayjs,
  361. createButton(btnContent, backgroundColorCss, marginRight) {
  362. let button = document.createElement("button");
  363. button.type = "button"; // 类型
  364. button.className = `el-button el-button--plain el-button--mini ${backgroundColorCss}`; // Calendar默认按钮样式
  365. button.textContent = btnContent; // 文本
  366. button.style.cssText = `color:white;margin-left:auto;margin-right:${marginRight}`; // 样式
  367. return button;
  368. },
  369. showTemplateDailog() {
  370. this.$refs.modalTemplate.show(this.queryParams.orgId);
  371. },
  372. judgeDate(calendarDate) {
  373. console.log(
  374. "judgeDate calendarDate",
  375. dayjs(calendarDate).format("YYYY-MM-DD")
  376. );
  377. let sDate = new Date(
  378. dayjs(calendarDate).subtract(1, "month").startOf("month")
  379. );
  380. let eDate = new Date(dayjs(calendarDate).add(1, "month").endOf("month"));
  381. this.queryParams.range = [sDate, eDate];
  382. this.isNeedLoadedCalendarDate=true;
  383. this.getList();
  384. },
  385. selectedDate(data) {
  386. console.log("selectedDate--->prefix", data);
  387. this.loadFormData(data.day);
  388. },
  389. loadFormData(day) {
  390. // console.log('selectedDate--->prefix', data)
  391. let selectedData = null;
  392. if (this.tableList && this.tableList.length > 0) {
  393. let index = this.tableList.findIndex((x) => x.ymdDate === day);
  394. if (index > -1) {
  395. selectedData = this.tableList[index];
  396. this.formData = selectedData;
  397. } else {
  398. this.formData = this.reset(day);
  399. }
  400. } else {
  401. this.formData = this.reset(day);
  402. }
  403. this.$nextTick(() => {
  404. this.$refs.form.clearValidate();
  405. });
  406. // this.$refs.form.clearValidate();
  407. console.log("selectedDate--->suffix", selectedData);
  408. },
  409. calendarDateChanged() {
  410. if (this.isNeedLoadedCalendarDate) {
  411. // this.loadFormData(dayjs().format("YYYY-MM-DD"));
  412. this.loadFormData(dayjs(this.calendarDate).format("YYYY-MM-DD"));
  413. this.isNeedLoadedCalendarDate = false;
  414. }
  415. },
  416. reset(day) {
  417. return {
  418. orgId: this.queryParams.orgId,
  419. isEnable: "1",
  420. isDuty: "0",
  421. openTime: null,
  422. closeTime: null,
  423. workTime: null,
  424. workOffTime: null,
  425. ymdDate: day,
  426. };
  427. },
  428. isSetedWorkTime(data) {
  429. // console.log("isSetedWorkTime",data,this.tableList)
  430. if (this.tableList && this.tableList.length > 0) {
  431. // console.log("isSetedWorkTime indexOf",this.tableList.findIndex(x=>x.ymdDate === data.day))
  432. if (this.tableList.findIndex((x) => x.ymdDate === data.day) > -1) {
  433. return true;
  434. }
  435. }
  436. return false;
  437. },
  438. getDayClass(data, item) {
  439. let tempColorIndex = this.getColorIndexByWorkTime(data,item);
  440. return data.isSelected
  441. ? "is-selected" + " " + "card-text" + tempColorIndex
  442. : "card-text" + tempColorIndex;
  443. },
  444. getSelectedTdClass(data)
  445. {
  446. if(data.isSelected)
  447. {
  448. return 'tdClass tdSelected';
  449. }
  450. else{
  451. return 'tdClass';
  452. }
  453. },
  454. getColorIndexByWorkTime(data,item) {
  455. // if( data.isSelected) return "4";
  456. if (item) return item.isEnable == "1" ? "2" : "3";
  457. else return "1";
  458. },
  459. getDate(day) {
  460. return dayjs(day).format("MM-DD");
  461. },
  462. getNowTime() {
  463. const dateObj = new Date(); // 获取当前时间对象
  464. const year = dateObj.getFullYear(); // 获取年份
  465. const month = String(dateObj.getMonth() + 1).padStart(2, "0"); // 获取月份,并补齐两位数
  466. const day = String(dateObj.getDate()).padStart(2, "0"); // 获取日期,并补齐两位数
  467. this.nowTime = `${year}-${month}-${day}`;
  468. },
  469. getDefaultKey(key) {
  470. this.queryParams.orgId = key;
  471. this.getList();
  472. },
  473. /** 下穿状态改变*/
  474. changeCheckBox() {
  475. this.queryParams.checkSub = !this.queryParams.checkSub;
  476. this.getList();
  477. },
  478. /** 查询列表 */
  479. getList() {
  480. this.loading = true;
  481. console.log(this.queryParams, "pages");
  482. tableList(this.queryParams)
  483. .then((response) => {
  484. this.tableList = response.rows;
  485. this.total = response.total;
  486. this.loading = false;
  487. this.calendarDateChanged();
  488. })
  489. .catch((err) => {
  490. this.loading = false;
  491. });
  492. },
  493. // 节点单击事件
  494. handleNodeClick(data) {
  495. this.queryParams.orgId = data.id;
  496. this.getList();
  497. },
  498. canSave() {
  499. console.log(
  500. "canSave",
  501. this.calendarDate,
  502. dayjs(this.calendarDate).startOf("day"),
  503. dayjs(this.calendarDate).startOf("day").isBefore(dayjs())
  504. );
  505. if (dayjs(this.calendarDate).startOf("day").isBefore(dayjs())) {
  506. return false;
  507. }
  508. return true;
  509. },
  510. onSubmit() {
  511. this.$refs.form.validate((isValidate) => {
  512. if (!isValidate) return;
  513. if (
  514. !timeCheck([
  515. this.formData.workTime,
  516. this.formData.openTime,
  517. this.formData.closeTime,
  518. this.formData.workOffTime,
  519. ])
  520. ) {
  521. this.$message.error(
  522. `请按照(上班时间<营业时间<营业结束<下班时间)顺序配置`
  523. );
  524. return false;
  525. }
  526. editWorkTime(this.formData).then((res) => {
  527. this.$message.success("保存成功");
  528. this.getList();
  529. });
  530. });
  531. },
  532. /* 重置搜索 */
  533. resetForm(name) {
  534. this.queryParams.isEnable = null;
  535. this.queryParams.pageNum = 1;
  536. this.queryParams.pageSize = 10;
  537. this.queryParams.orgId = this.orgId;
  538. this.queryParams.checkSub = true;
  539. this.queryParams.noWorkTime = false;
  540. this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
  541. this.queryParams.range = [
  542. dayjs().startOf("month"),
  543. dayjs().endOf("month"),
  544. ];
  545. this.getList();
  546. },
  547. submitCopyMouth() {
  548. if (!this.formData.ymdDate) return this.$message.error("请选择日期");
  549. if (this.formData.isEnable === null)
  550. return this.$message.error("请选择营业状态");
  551. if (this.formData.isEnable == "1") {
  552. if (!this.formData.openTime)
  553. return this.$message.error("请选择开始时间");
  554. if (!this.formData.closeTime)
  555. return this.$message.error("请选择结束时间");
  556. if (!this.formData.workTime)
  557. return this.$message.error("请选择上班时间");
  558. if (!this.formData.workOffTime)
  559. return this.$message.error("请选择下班时间");
  560. if (!timeCheck([this.formData.openTime, this.formData.closeTime]))
  561. return this.$message.error("开始时间不能大于结束时间");
  562. if (!timeCheck([this.formData.workTime, this.formData.workOffTime]))
  563. return this.$message.error("上班时间不能大于下班时间");
  564. }
  565. let data = {
  566. orgIdList: [this.formData.orgId],
  567. workTimeList: this.copyDataToMonth(),
  568. };
  569. console.log("submitCopyMouth", data);
  570. addWorkTimeDay(data).then((res) => {
  571. this.$message.success("保存成功");
  572. this.getList();
  573. });
  574. },
  575. copyDataToMonth() {
  576. let startOfMonthDay = dayjs(this.formData.ymdDate).startOf("month");
  577. let endOfMonthDay = dayjs(this.formData.ymdDate).endOf("month");
  578. let dataList = [];
  579. while (startOfMonthDay.isBefore(endOfMonthDay)) {
  580. let temp = { ...this.formData };
  581. temp.ymdDate = startOfMonthDay.format("YYYY-MM-DD");
  582. dataList.push(temp);
  583. startOfMonthDay = startOfMonthDay.add(1, "day");
  584. }
  585. return dataList;
  586. },
  587. },
  588. };
  589. </script>
  590. <style lang="scss">
  591. $border: 25px;
  592. // 更改elementplus组件的样式
  593. .calendar-dialog {
  594. // // 日历边框背景颜色
  595. // :deep(.el-calendar-table td, .el-calendar-table tr:first-child td, .el-calendar-table tr td:first-child) {
  596. // border-color: $border !important;
  597. // }
  598. // // 日历取消的背景
  599. // :deep(.el-calendar-table td.is-selected) {
  600. // background-color: $hoverOrSelectBG;
  601. // }
  602. // /* 日历单元格鼠标滑过背景色 */
  603. // :deep(.el-calendar-table .el-calendar-day:hover) {
  604. // background-color: $hoverOrSelectBG !important;
  605. // }
  606. // .is-selected, .is-today {
  607. // color: #37e2ce;
  608. // background-color: $hoverOrSelectBG !important;
  609. // }
  610. .el-calendar-table .el-calendar-day {
  611. padding: 0;
  612. }
  613. .el-icon {
  614. height: 8px;
  615. }
  616. .card-group.card-calendar-text {
  617. display: flex;
  618. justify-content: space-between;
  619. }
  620. .el-calendar {
  621. box-shadow: 0 0 12px 0 #e4e7ed;
  622. .el-calendar-table {
  623. thead {
  624. background-color: #f5f7fa;
  625. }
  626. }
  627. }
  628. }
  629. </style>
  630. <style lang="scss" scoped>
  631. $titleHeight: 25px;
  632. $dutyColor: rgb(47, 133, 90);
  633. $unSetWorkTime: #bdbdbd;
  634. $unDutyColor: rgb(183, 121, 31);
  635. $btnTemplate: #008CD6;
  636. $hoverOrSelectedBG:#7a8185;
  637. @mixin btn-o($btnBgColor) {
  638. background-color: $btnBgColor;
  639. }
  640. @mixin card-o($bgColor) {
  641. position: relative;
  642. display: block;
  643. width: 100%;
  644. height: 100%;
  645. font-size: 15px;
  646. color: #FFF;
  647. background-color: $bgColor;
  648. }
  649. @mixin card-text-o($bgColor) {
  650. display: flex;
  651. justify-content: space-between;
  652. height: $titleHeight;
  653. max-height: $titleHeight;
  654. min-height: $titleHeight;
  655. padding-left:10px;
  656. padding-top:5px;
  657. font-size: 20px;
  658. color: #FFF;
  659. background-color: $bgColor;
  660. }
  661. .calendar-dialog {
  662. ::v-deep .el-calendar{
  663. .el-calendar__header{
  664. .el-calendar__button-group{
  665. .el-button-group{
  666. .btnDuty{
  667. @include btn-o($dutyColor);
  668. }
  669. .btnUnDuty{
  670. @include btn-o($unDutyColor);
  671. }
  672. .btnUnSetWorkTime{
  673. @include btn-o($unSetWorkTime);
  674. }
  675. .btnTemplate{
  676. @include btn-o($btnTemplate);
  677. }
  678. }
  679. }
  680. }
  681. }
  682. .tdSelected{
  683. // background-color: $hoverOrSelectedBG;
  684. border: 5px solid #f14704;
  685. ::v-deep .card{
  686. .card-flag{
  687. .card1 .card-text1 .card2 .card-text2 .card3 .card-text3{
  688. // background-color: $hoverOrSelectedBG !important;
  689. }
  690. }
  691. }
  692. }
  693. .card-group {
  694. width: 100%;
  695. height: 100%;
  696. .card-calendar-text {
  697. height: $titleHeight;
  698. max-height: $titleHeight;
  699. min-height: $titleHeight;
  700. }
  701. .card {
  702. position: relative;
  703. // top: -$titleHeight;
  704. }
  705. .card-flag {
  706. height: calc(100% - $titleHeight);
  707. }
  708. .card1 {
  709. @include card-o($unSetWorkTime);
  710. }
  711. .card-text1 {
  712. @include card-text-o($unSetWorkTime);
  713. }
  714. .card2 {
  715. @include card-o($dutyColor);
  716. }
  717. .card-text2 {
  718. @include card-text-o($dutyColor);
  719. }
  720. .card3 {
  721. @include card-o($unDutyColor);
  722. }
  723. .card-text3 {
  724. @include card-text-o($unDutyColor);
  725. }
  726. .card4 {
  727. @include card-o($hoverOrSelectedBG);
  728. }
  729. .card-text4 {
  730. @include card-text-o($hoverOrSelectedBG);
  731. }
  732. .tdClass{
  733. height: 100%;
  734. }
  735. .tdClass :hover .card1{
  736. cursor: pointer;
  737. background-color: $hoverOrSelectedBG;
  738. }
  739. .tdClass :hover .card-text1{
  740. cursor: pointer;
  741. background-color: $hoverOrSelectedBG;
  742. }
  743. .tdClass :hover .card2{
  744. cursor: pointer;
  745. background-color: $hoverOrSelectedBG;
  746. }
  747. .tdClass :hover .card-text2{
  748. cursor: pointer;
  749. background-color: $hoverOrSelectedBG;
  750. }
  751. .tdClass :hover .card3{
  752. cursor: pointer;
  753. background-color: $hoverOrSelectedBG;
  754. }
  755. .tdClass :hover .card-text3{
  756. cursor: pointer;
  757. background-color: $hoverOrSelectedBG;
  758. }
  759. .visits-val {
  760. position: absolute;
  761. right: 0;
  762. bottom: 0;
  763. }
  764. }
  765. .card-group:focus,
  766. .card-group:hover {
  767. background-color: #33a3de;
  768. }
  769. }
  770. </style>