index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. <script setup lang="ts">
  2. import BatchModal from "@/views/common/modal/batchModal.vue"
  3. import dayjs from "dayjs"
  4. import apis from "@/api/breeding"
  5. import type{Header} from "@/components/table/models"
  6. const headers = ref<Header[]>([
  7. {
  8. field: "recordDate",
  9. name: "记录日期",
  10. visible: true,
  11. isSort: false,
  12. tooltip: true,
  13. width: "100px",
  14. },
  15. {
  16. field: "周龄",
  17. name: "周龄",
  18. visible: true,
  19. isSort: false,
  20. tooltip: true,
  21. width: "230px",
  22. children: [
  23. {
  24. field: "dayCount",
  25. name: "天",
  26. visible: true,
  27. isSort: false,
  28. width: "50px",
  29. tooltip: true,
  30. },
  31. {
  32. field: "weekAge",
  33. name: "生长周龄",
  34. visible: true,
  35. isSort: false,
  36. width: "80px",
  37. tooltip: true
  38. },
  39. {
  40. field: "layingWeekAge",
  41. name: "产蛋周龄",
  42. visible: true,
  43. isSort: false,
  44. width: "80px",
  45. tooltip: true
  46. }
  47. ]
  48. },
  49. {
  50. field: "存栏鸡数", name: "存栏鸡数", visible: true, isSort: false, width:"300px",
  51. children: [
  52. {
  53. field: "chicken1Count",
  54. name: "母鸡",
  55. visible: true,
  56. isSort: false,
  57. width: "100px",
  58. tooltip: true
  59. },
  60. {
  61. field: "chicken0Count",
  62. name: "公鸡",
  63. visible: true,
  64. isSort: false,
  65. width: "100px",
  66. tooltip: true
  67. },
  68. {
  69. field: "chicken2Count",
  70. name: "未知",
  71. visible: true,
  72. isSort: false,
  73. width: "100px",
  74. tooltip: true
  75. },
  76. {
  77. field: "chickenCountTotal",
  78. name: "合计",
  79. visible: true,
  80. isSort: false,
  81. width: "100px",
  82. tooltip: true
  83. }
  84. ]
  85. },
  86. { field: "maleFemaleRatio", name: "公母比例(%)", visible: true, isSort: false, tooltip: true, width: "80px" },
  87. {
  88. field: "母鸡死淘",
  89. name: `母鸡死淘`,
  90. width: "600px",
  91. children: [
  92. {
  93. field: "母鸡死淘数量",
  94. name: "母鸡死淘数量",
  95. visible: true,
  96. isSort: false,
  97. width: "500px",
  98. tooltip: true,
  99. children: [
  100. {
  101. field: "death1",
  102. name: "死亡",
  103. visible: true,
  104. isSort: false,
  105. width: "100px",
  106. },
  107. {
  108. field: "cull1",
  109. name: "淘汰",
  110. visible: true,
  111. isSort: false,
  112. width: "100px",
  113. }, {
  114. field: "packageCull1",
  115. name: "打包淘汰",
  116. visible: true,
  117. isSort: false,
  118. width: "100px",
  119. }, {
  120. field: "deathCullTotal1",
  121. name: "合计",
  122. visible: true,
  123. isSort: false,
  124. width: "100px",
  125. }, {
  126. field: "deathCullRate1",
  127. name: "死淘率(%)",
  128. visible: true,
  129. isSort: false,
  130. width: "100px",
  131. }
  132. ]
  133. },
  134. {
  135. field: '累计',
  136. name: '累计',
  137. visible: true,
  138. isSort: false,
  139. width: "100px",
  140. children: [
  141. {
  142. field: "accumCullTotal1",
  143. name: "死淘",
  144. visible: true,
  145. isSort: false,
  146. width: "100px",
  147. }, {
  148. field: "accumCullRate1",
  149. name: "死淘率(%)",
  150. visible: true,
  151. isSort: false,
  152. width: "100px",
  153. }
  154. ]
  155. }
  156. ]
  157. },
  158. {
  159. field: "公鸡死淘",
  160. name: `公鸡死淘`,
  161. width: "600px",
  162. children: [
  163. {
  164. field: "公鸡死淘数量",
  165. name: "公鸡死淘数量",
  166. visible: true,
  167. isSort: false,
  168. width: "500px",
  169. tooltip: true,
  170. children: [
  171. {
  172. field: "death0",
  173. name: "死亡",
  174. visible: true,
  175. isSort: false,
  176. width: "100px",
  177. },
  178. {
  179. field: "cull0",
  180. name: "淘汰",
  181. visible: true,
  182. isSort: false,
  183. width: "100px",
  184. }, {
  185. field: "packageCull0",
  186. name: "打包淘汰",
  187. visible: true,
  188. isSort: false,
  189. width: "100px",
  190. }, {
  191. field: "deathCullTotal0",
  192. name: "合计",
  193. visible: true,
  194. isSort: false,
  195. width: "100px",
  196. }, {
  197. field: "deathCullRate0",
  198. name: "死淘率(%)",
  199. visible: true,
  200. isSort: false,
  201. width: "100px",
  202. }
  203. ]
  204. },
  205. {
  206. field: '累计',
  207. name: '累计',
  208. visible: true,
  209. isSort: false,
  210. width: "100px",
  211. children: [
  212. {
  213. field: "accumCullTotal0",
  214. name: "死淘",
  215. visible: true,
  216. isSort: false,
  217. width: "100px",
  218. }, {
  219. field: "accumCullRate0",
  220. name: "死淘率(%)",
  221. visible: true,
  222. isSort: false,
  223. width: "100px",
  224. }
  225. ]
  226. }
  227. ]
  228. },
  229. {
  230. field: "未知死淘",
  231. name: `未知死淘`,
  232. width: "600px",
  233. children: [
  234. {
  235. field: "未知死淘数量",
  236. name: "未知死淘数量",
  237. visible: true,
  238. isSort: false,
  239. width: "500px",
  240. tooltip: true,
  241. children: [
  242. {
  243. field: "death2",
  244. name: "死亡",
  245. visible: true,
  246. isSort: false,
  247. width: "100px",
  248. },
  249. {
  250. field: "cull2",
  251. name: "淘汰",
  252. visible: true,
  253. isSort: false,
  254. width: "100px",
  255. }, {
  256. field: "packageCull2",
  257. name: "打包淘汰",
  258. visible: true,
  259. isSort: false,
  260. width: "100px",
  261. }, {
  262. field: "deathCullTotal2",
  263. name: "合计",
  264. visible: true,
  265. isSort: false,
  266. width: "100px",
  267. }, {
  268. field: "deathCullRate2",
  269. name: "死淘率(%)",
  270. visible: true,
  271. isSort: false,
  272. width: "100px",
  273. }
  274. ]
  275. },
  276. {
  277. field: '累计',
  278. name: '累计',
  279. visible: true,
  280. isSort: false,
  281. width: "100px",
  282. children: [
  283. {
  284. field: "accumCullTotal2",
  285. name: "死淘",
  286. visible: true,
  287. isSort: false,
  288. width: "100px",
  289. }, {
  290. field: "accumCullRate2",
  291. name: "死淘率(%)",
  292. visible: true,
  293. isSort: false,
  294. width: "100px",
  295. }
  296. ]
  297. }
  298. ]
  299. },
  300. {
  301. field: "耗料",
  302. name: "耗料",
  303. visible: true,
  304. isSort: false,
  305. width: "900px",
  306. children: [
  307. {
  308. field: "耗料量(g)",
  309. name: "耗料量(g)",
  310. visible: true,
  311. isSort: false,
  312. width: "250px",
  313. children: [
  314. {
  315. field: "poultDailyFeed1",
  316. name: "母鸡",
  317. visible: true,
  318. isSort: false,
  319. width: "100px",
  320. },
  321. {
  322. field: "poultDailyFeed0",
  323. name: "公鸡",
  324. visible: true,
  325. isSort: false,
  326. width: "100px",
  327. },
  328. {
  329. field: "poultDailyFeed2",
  330. name: "未知",
  331. visible: true,
  332. isSort: false,
  333. width: "100px",
  334. },
  335. {
  336. field: "poultDailyFeedTotal ",
  337. name: "合计",
  338. visible: true,
  339. isSort: false,
  340. width: "100px",
  341. }
  342. ]
  343. },
  344. {
  345. field: "耗料量/只/日(g)",
  346. name: "耗料量/只/日(g)",
  347. visible: true,
  348. isSort: false,
  349. width: "250px",
  350. children: [
  351. {
  352. field: "poultDailyFeedAvg1",
  353. name: "母鸡",
  354. visible: true,
  355. isSort: false,
  356. width: "100px",
  357. },
  358. {
  359. field: "poultDailyFeedAvg0",
  360. name: "公鸡",
  361. visible: true,
  362. isSort: false,
  363. width: "100px",
  364. },
  365. {
  366. field: "poultDailyFeedAvg2",
  367. name: "未知",
  368. visible: true,
  369. isSort: false,
  370. width: "100px",
  371. }
  372. ]
  373. },
  374. {
  375. field: "feed1",
  376. name: "母鸡喂料",
  377. visible: true,
  378. isSort: false,
  379. width: "200px",
  380. tooltip: true,
  381. },
  382. {
  383. field: "feed0",
  384. name: "公鸡喂料",
  385. visible: true,
  386. isSort: false,
  387. width: "200px",
  388. tooltip: true,
  389. },
  390. {
  391. field: "feed2",
  392. name: "未知喂料",
  393. visible: true,
  394. isSort: false,
  395. width: "200px",
  396. tooltip: true,
  397. }
  398. ]
  399. },
  400. {
  401. field: "日体重数据",
  402. name: "日体重数据",
  403. visible: true,
  404. isSort: false,
  405. width: "900px",
  406. children: [
  407. {
  408. field: "实际母鸡",
  409. name: "实际母鸡",
  410. visible: true,
  411. isSort: false,
  412. width: "100px",
  413. children: [
  414. {
  415. field: "weight1",
  416. name: "体重",
  417. visible: true,
  418. isSort: false,
  419. width: "100px",
  420. },
  421. {
  422. field: "uniformity1",
  423. name: "均匀度(%)",
  424. visible: true,
  425. isSort: false,
  426. width: "100px",
  427. }
  428. ]
  429. },
  430. {
  431. field: "实际公鸡",
  432. name: "实际公鸡",
  433. visible: true,
  434. isSort: false,
  435. width: "100px",
  436. children: [
  437. {
  438. field: "weight0",
  439. name: "体重",
  440. visible: true,
  441. isSort: false,
  442. width: "100px",
  443. },
  444. {
  445. field: "uniformity0",
  446. name: "均匀度(%)",
  447. visible: true,
  448. isSort: false,
  449. width: "100px",
  450. }
  451. ]
  452. },
  453. {
  454. field: "实际未知",
  455. name: "实际未知",
  456. visible: true,
  457. isSort: false,
  458. width: "100px",
  459. children: [
  460. {
  461. field: "weight2",
  462. name: "体重",
  463. visible: true,
  464. isSort: false,
  465. width: "100px",
  466. },
  467. {
  468. field: "uniformity2",
  469. name: "均匀度(%)",
  470. visible: true,
  471. isSort: false,
  472. width: "100px",
  473. }
  474. ]
  475. },
  476. {
  477. field: "母系标准体重",
  478. name: "母系标准体重",
  479. visible: true,
  480. isSort: false,
  481. width: "100px",
  482. children: [
  483. {
  484. field: "standardWeight1",
  485. name: "母鸡",
  486. visible: true,
  487. isSort: false,
  488. width: "100px",
  489. },
  490. {
  491. field: "standardWeight0",
  492. name: "公鸡",
  493. visible: true,
  494. isSort: false,
  495. width: "100px",
  496. },
  497. {
  498. field: "standardWeight2",
  499. name: "未知",
  500. visible: true,
  501. isSort: false,
  502. width: "100px",
  503. }
  504. ]
  505. }
  506. ]
  507. },
  508. {
  509. field: "产蛋情况",
  510. name: "产蛋情况",
  511. visible: true,
  512. isSort: false,
  513. width: "auto",
  514. children: [
  515. {
  516. field: "totalEggs",
  517. name: "总产蛋数",
  518. visible: true,
  519. isSort: false,
  520. width: "100px",
  521. },
  522. {
  523. field: "eggCount0",
  524. name: "上缴种蛋",
  525. visible: true,
  526. isSort: false,
  527. width: "100px",
  528. },
  529. {
  530. field: "商品蛋",
  531. name: "商品蛋",
  532. visible: true,
  533. isSort: false,
  534. width: "100px",
  535. children: [
  536. {
  537. field: "eggCount1",
  538. name: "纯系种蛋",
  539. visible: true,
  540. isSort: false,
  541. width: "100px",
  542. },
  543. {
  544. field: "eggCount2",
  545. name: "祖代蛋",
  546. visible: true,
  547. isSort: false,
  548. width: "100px",
  549. },
  550. {
  551. field: "eggCount3",
  552. name: "父母代蛋",
  553. visible: true,
  554. isSort: false,
  555. width: "100px",
  556. },
  557. {
  558. field: "eggCount4",
  559. name: "菜蛋",
  560. visible: true,
  561. isSort: false,
  562. width: "100px",
  563. },
  564. {
  565. field: "eggCount5",
  566. name: "畸形蛋",
  567. visible: true,
  568. isSort: false,
  569. width: "100px",
  570. },
  571. {
  572. field: "eggCount6",
  573. name: "破蛋",
  574. visible: true,
  575. isSort: false,
  576. width: "100px",
  577. }
  578. ]
  579. },
  580. {
  581. field: "eggWeight",
  582. name: "实际蛋重(g)",
  583. visible: true,
  584. isSort: false,
  585. width: "100px",
  586. }
  587. ]
  588. }
  589. ]);
  590. // 初始化默认日期范围为最近一个月
  591. const getDefaultDateRange = () => {
  592. const endDate = dayjs()
  593. const startDate = endDate.subtract(1, 'month')
  594. return [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')]
  595. }
  596. const formData = ref({
  597. batchNum: "",
  598. recordDate: "",
  599. dateRange: getDefaultDateRange(),
  600. params: {},
  601. type: 0
  602. })
  603. // 批次选择模态框相关
  604. const batchModalRef = ref()
  605. const selectedBatch = ref("")
  606. // 打开批次选择模态框
  607. function openBatchModal() {
  608. batchModalRef.value?.open()
  609. }
  610. // 批次选择确认回调
  611. function onBatchConfirm(batches: any[]) {
  612. if (batches && batches.length > 0) {
  613. selectedBatch.value = batches[0].batchNum
  614. formData.value.batchNum = selectedBatch.value
  615. }
  616. }
  617. // 育种场信息数据
  618. const batchInfo = ref({
  619. batchNum: "",
  620. chickenCount0: "",
  621. chickenCount1: "",
  622. chickenCount2: "",
  623. factoryName: "",
  624. coopNames: "",
  625. lineage: "",
  626. generation: "",
  627. hatchDate: "",
  628. source: "",
  629. })
  630. const reportDataItems=ref([])
  631. // 查询处理函数
  632. function handleSearch() {
  633. console.log('执行查询操作,批次号:', formData.value.batchNum)
  634. console.log('日期范围:', formData.value.dateRange)
  635. formData.value.params = {
  636. beginRecordDate: formData.value.dateRange[0],
  637. endRecordDate: formData.value.dateRange[1]
  638. }
  639. if(!formData.value.batchNum) {
  640. message.msgError("请选择批次")
  641. return
  642. }
  643. apis.batchDayStatisticsApi.getBatchDetail(formData.value.batchNum).then((res: any) => {
  644. console.log(res)
  645. batchInfo.value = res.data
  646. })
  647. apis.batchDayStatisticsApi.listQuery(formData.value).then((res: any) => {
  648. console.log(res)
  649. reportDataItems.value = res.data
  650. })
  651. // 这里可以添加实际的查询逻辑
  652. // 例如调用API获取数据等
  653. }
  654. // 导出处理函数
  655. function handleExport() {
  656. console.log('导出报表,批次号:', formData.value.batchNum)
  657. if(!formData.value.batchNum) {
  658. message.msgError("请选择批次")
  659. return
  660. }
  661. formData.value.params = {
  662. beginRecordDate: formData.value.dateRange[0],
  663. endRecordDate: formData.value.dateRange[1]
  664. }
  665. apis.batchDayStatisticsApi.export(formData.value, formData.value.batchNum + "日报表.xlsx").then((res: any) => {
  666. console.log(res)
  667. message.msgSuccess("导出成功")
  668. }).catch((error: any) => {
  669. console.error("导出失败:", error)
  670. message.msgError("导出失败")
  671. })
  672. }
  673. function handleGenerateReport(type) {
  674. if(!formData.value.batchNum) {
  675. message.msgError("请选择批次")
  676. return
  677. }
  678. formData.value.recordDate = formData.value.dateRange[1]
  679. formData.value.type = type
  680. apis.batchDayStatisticsApi.genReportFun(formData.value).then(() => {
  681. message.msgSuccess("生成成功")
  682. })
  683. }
  684. // 日期格式化函数
  685. const formatDate = (row, column, cellValue) => {
  686. return dayjs(cellValue).format('YYYY/MM/DD')
  687. }
  688. // 单元格样式
  689. const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
  690. // 日期列居中对齐
  691. if (columnIndex === 0) { // 日期列
  692. return { textAlign: 'center' }
  693. }
  694. // 数字列右对齐
  695. if (columnIndex >= 3) { // 从第4列开始右对齐
  696. return { textAlign: 'right' }
  697. }
  698. return { textAlign: 'center' }
  699. }
  700. // 将函数暴露给模板使用
  701. defineExpose({
  702. formatDate,
  703. //headerCellStyle,
  704. cellStyle
  705. })
  706. </script>
  707. <template>
  708. <div class="app-container py-5">
  709. <div
  710. class="w-100 d-flex flex-column align-items-center mx-auto"
  711. :style="{ maxWidth: 1500 + 'px' }">
  712. <div class="header d-flex justify-content-center align-items-center mb-10">
  713. <el-form :model="formData" label-width="auto" :inline="true" style="margin-left: 20px">
  714. <el-form-item label="批次" prop="batchNum">
  715. <el-input v-model="formData.batchNum" placeholder="请选择批次" readonly>
  716. <template #append>
  717. <el-button @click="openBatchModal">选择</el-button>
  718. </template>
  719. </el-input>
  720. </el-form-item>
  721. <el-form-item label="日期范围" prop="dateRange">
  722. <el-date-picker
  723. v-model="formData.dateRange"
  724. type="daterange"
  725. range-separator="至"
  726. start-placeholder="开始日期"
  727. end-placeholder="结束日期"
  728. value-format="YYYY-MM-DD"
  729. format="YYYY-MM-DD"
  730. style="width: 220px;">
  731. </el-date-picker>
  732. </el-form-item>
  733. <el-form-item>
  734. <el-button type="primary" @click="handleSearch">查询</el-button>
  735. <el-button type="warning" @click="handleExport">导出</el-button>
  736. <div class="hidden-buttons-container">
  737. <el-button type="success" @click="handleGenerateReport(0)">生成日报表0</el-button>
  738. <el-button type="success" @click="handleGenerateReport(1)">生成日报表1</el-button>
  739. </div>
  740. </el-form-item>
  741. </el-form>
  742. </div>
  743. </div>
  744. <!-- 批次选择模态框 -->
  745. <!-- 育种场信息表格 -->
  746. <div class="farm-info-container">
  747. <table class="table table-bordered farm-info-table">
  748. <tbody>
  749. <tr>
  750. <th rowspan="3">{{ batchInfo.factoryName }}<br>日报表</th>
  751. <th>鸡场</th>
  752. <th class="important-cell">弥勒{{ batchInfo.factoryName }}</th>
  753. <th>批号</th>
  754. <th class="important-cell">{{ batchInfo.batchNum }}</th>
  755. <th>5%产蛋周龄</th>
  756. <th class="important-cell"></th>
  757. <th>育雏舍</th>
  758. <th class="important-cell"></th>
  759. </tr>
  760. <tr>
  761. <th>品种</th>
  762. <th class="important-cell">{{ batchInfo.lineage }}系</th>
  763. <th>栋号</th>
  764. <th class="important-cell">{{ batchInfo.coopNames }}</th>
  765. <th>母鸡进苗数</th>
  766. <th class="important-cell">{{ batchInfo.chickenCount1 }}</th>
  767. <th>育成舍</th>
  768. <th class="important-cell"></th>
  769. </tr>
  770. <tr>
  771. <th>来源</th>
  772. <th class="important-cell">{{ batchInfo.source }}</th>
  773. <th>进鸡日期</th>
  774. <th class="important-cell">{{dayjs(batchInfo.hatchDate).isValid() ? dayjs(batchInfo.hatchDate).format("YYYY年MM月DD日") : "-" }}</th>
  775. <th>公鸡进苗数</th>
  776. <th class="important-cell">{{ batchInfo.chickenCount0 }}</th>
  777. <th>产蛋舍</th>
  778. <th class="important-cell"></th>
  779. </tr>
  780. </tbody>
  781. </table>
  782. </div>
  783. <!-- 使用 Element Plus 的 el-table 替换原生表格 -->
  784. <div class="table-container">
  785. <vb-data-table
  786. :columns="headers"
  787. :data="reportDataItems"
  788. ref="tableRef"
  789. keyField="id"
  790. :no-page="true"
  791. :fixed-number="9"
  792. :scroll="{ x: 5100 }"
  793. :check-multiple="false"
  794. :show-toolbar="false">
  795. <template #recordDate="{ row }">
  796. {{ dayjs(row.recordDate).format("YYYY-MM-DD") }}
  797. </template>
  798. <template #poultDailyFeedTotal="{ row }">
  799. {{ (row.poultDailyFeed0 || 0) + (row.poultDailyFeed1 || 0) + (row.poultDailyFeed2 || 0) }}
  800. </template>
  801. </vb-data-table>
  802. </div>
  803. </div>
  804. <BatchModal ref="batchModalRef" :multiple="false" @confirm="onBatchConfirm" />
  805. </template>
  806. <style scoped>
  807. .table-container {
  808. overflow-x: auto;
  809. scrollbar-width: thin;
  810. scrollbar-color: #a0cfff #f1f1f1;
  811. border-radius: 8px;
  812. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  813. margin: 20px 0;
  814. }
  815. .table {
  816. min-width: 100%;
  817. border-collapse: separate;
  818. border-spacing: 0;
  819. width: 100%;
  820. border-radius: 8px;
  821. overflow: hidden;
  822. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  823. }
  824. .table th,
  825. .table td {
  826. padding: 12px 15px;
  827. text-align: center;
  828. white-space: nowrap;
  829. border-right: 1px solid #d0d7e0;
  830. border-bottom: 1px solid #d0d7e0;
  831. }
  832. .table th {
  833. background-color: #e6f0ff;
  834. color: #2c5aa0;
  835. font-weight: 600;
  836. text-transform: uppercase;
  837. letter-spacing: 0.5px;
  838. font-size: 13px;
  839. /* 垂直居中对齐 */
  840. vertical-align: middle;
  841. }
  842. .table td {
  843. /* 垂直居中对齐 */
  844. vertical-align: middle;
  845. }
  846. .table th:last-child,
  847. .table td:last-child {
  848. border-right: none;
  849. }
  850. /* 斑马纹样式 */
  851. .table tbody tr:nth-child(even) {
  852. background-color: #fafcff;
  853. }
  854. /* 悬停效果 */
  855. .table tbody tr:hover {
  856. background-color: #f0f7ff;
  857. transition: background-color 0.2s ease;
  858. }
  859. /* 表头第一行特殊样式 */
  860. .table thead tr:first-child th {
  861. background-color: #d1e4ff;
  862. }
  863. /* 数字列右对齐 */
  864. .table td:nth-child(n+10) {
  865. text-align: right;
  866. }
  867. /* 育种场信息表格样式 */
  868. .farm-info-container {
  869. margin: 10px auto;
  870. }
  871. /* 隐藏按钮容器样式 */
  872. .hidden-buttons-container {
  873. position: fixed;
  874. right: 0;
  875. top: 50%;
  876. transform: translateY(-50%);
  877. z-index: 1000;
  878. padding: 10px 0;
  879. background: rgba(255, 255, 255, 0.95);
  880. border-radius: 8px 0 0 8px;
  881. box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  882. opacity: 0;
  883. transition: opacity 0.3s ease;
  884. }
  885. .hidden-buttons-container:hover {
  886. opacity: 1;
  887. }
  888. .hidden-buttons-container .el-button {
  889. display: block;
  890. width: 50px;
  891. height: 50px;
  892. margin: 5px 10px;
  893. padding: 0;
  894. border-radius: 50%;
  895. opacity: 0;
  896. transition: all 0.3s ease;
  897. transform: translateX(100%);
  898. }
  899. .hidden-buttons-container:hover .el-button {
  900. transform: translateX(0);
  901. opacity: 1;
  902. }
  903. .hidden-buttons-container .el-button:first-child {
  904. margin-bottom: 10px;
  905. }
  906. .farm-info-table {
  907. width: 100%;
  908. border-collapse: separate;
  909. border-spacing: 0;
  910. background-color: #ffffff;
  911. font-size: 13px;
  912. border:1px solid #d0d7e0;
  913. }
  914. .farm-info-table td {
  915. padding: 6px 10px;
  916. text-align: center;
  917. border-right: 1px solid #d0d7e0;
  918. border-bottom: 1px solid #d0d7e0;
  919. vertical-align: middle;
  920. }
  921. .farm-info-table td:last-child {
  922. border-right: none;
  923. }
  924. .farm-info-table tr:last-child td {
  925. border-bottom: none;
  926. }
  927. /* 合并单元格的背景色 */
  928. .farm-info-table td[rowspan],
  929. .farm-info-table td[colspan] {
  930. background-color: #fafdff;
  931. font-weight: 500;
  932. }
  933. /* 数据单元格的样式 */
  934. .farm-info-table td:not([rowspan]):not([colspan]) {
  935. background-color: #ffffff;
  936. text-align: center;
  937. }
  938. /* 需要从后端获取数据的列样式(实际第3、5、7、9列) */
  939. /* 第1行 */
  940. .important-cell {
  941. background-color: #fffefe !important;
  942. font-weight: 600;
  943. color: #3d4144 !important;
  944. border-radius: 4px;
  945. padding: 4px 8px;
  946. }
  947. </style>