KtCommonTable.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <div style="position: relative" ref="commonTable">
  3. <!--表格栏-->
  4. <el-table
  5. id="commonTable"
  6. ref="doLayout"
  7. :data="data.content"
  8. :highlight-current-row="highlightCurrentRow"
  9. @selection-change="selectionChange"
  10. @row-click="rowClick"
  11. @current-change="handleCurrentChange"
  12. :element-loading-text="$t('action.loading')"
  13. :border="border"
  14. :stripe="stripe"
  15. :show-summary="showSummary"
  16. :summary-method="getSummaries"
  17. :show-overflow-tooltip="showOverflowTooltip"
  18. :height="tableHeights ? tableHeights : tableHeight"
  19. :size="size"
  20. :align="align"
  21. :header-cell-style="{
  22. background: '#F2F7FC',
  23. fontWeight: '900',
  24. color: '#606266',
  25. }"
  26. style="width: 100%"
  27. :row-class-name="tableRowClassName"
  28. >
  29. <el-table-column type="expand" v-if="showSysUserAccountCardList" style="display: flex;">
  30. <template slot-scope="scope">
  31. <el-table
  32. :data="scope.row.sysUserAccountCardList"
  33. size="small"
  34. :header-cell-style="{
  35. background: '#ccc',
  36. fontWeight: '900',
  37. color: '#606266',
  38. }"
  39. style="width: 55%"
  40. >
  41. <el-table-column
  42. type="index"
  43. width="50"
  44. align="center"
  45. label="序号"
  46. >
  47. </el-table-column>
  48. <el-table-column prop="bankAccount" label="银行" style="flex: 1">
  49. </el-table-column>
  50. <el-table-column prop="bankAddress" label="开户行" style="flex: 1">
  51. </el-table-column>
  52. <el-table-column prop="bankNumber" label="银行卡号" style="flex: 1">
  53. </el-table-column>
  54. </el-table>
  55. </template>
  56. </el-table-column>
  57. <el-table-column
  58. type="selection"
  59. width="50"
  60. fixed
  61. align="center"
  62. v-if="
  63. showBatchDelete ||
  64. showBatchSettled ||
  65. showBatchPrint ||
  66. customToolseletted
  67. "
  68. ></el-table-column>
  69. <el-table-column
  70. v-if="SerialShow"
  71. label="序号"
  72. type="index"
  73. width="50"
  74. align="center"
  75. ></el-table-column>
  76. <template v-for="column in columns">
  77. <el-table-column
  78. header-align="center"
  79. align="center"
  80. :prop="column.prop"
  81. :label="column.label"
  82. :width="column.width"
  83. :min-width="column.minWidth"
  84. :fixed="column.fixed"
  85. :key="column.prop"
  86. :type="column.type"
  87. :formatter="column.formatter"
  88. :sortable="column.sortable ? column.sortable : false"
  89. v-if="column.signIcon || column.isImg || column.isBtn"
  90. >
  91. <template slot-scope="scope">
  92. <el-switch
  93. :disabled="column.isDisabled"
  94. v-if="column.signIcon"
  95. v-model="scope.row[column.prop]"
  96. active-value="1"
  97. inactive-value="0"
  98. @change="signStateChanged(scope.$index, scope.row)"
  99. ></el-switch>
  100. <img
  101. v-if="column.isImg"
  102. :width="column.imgWidth"
  103. :height="column.imgHeight"
  104. :src="scope.row[column.prop]"
  105. />
  106. <kt-button
  107. v-if="column.isBtn"
  108. icon="fa fa-edit"
  109. :label="column.btnName"
  110. :size="size"
  111. :perms="column.permsEdit"
  112. @click="handleBtnEdit(scope.$index, scope.row)"
  113. />
  114. </template>
  115. </el-table-column>
  116. <el-table-column
  117. header-align="center"
  118. align="center"
  119. :prop="column.prop"
  120. :label="column.label"
  121. :width="column.width"
  122. :min-width="column.minWidth"
  123. :fixed="column.fixed"
  124. :key="column.prop"
  125. :type="column.type"
  126. :formatter="column.formatter"
  127. :sortable="column.sortable ? column.sortable : false"
  128. v-else
  129. >
  130. <template v-for="columnchildren in column.children">
  131. <el-table-column
  132. v-if="columnchildren"
  133. header-align="center"
  134. align="center"
  135. :prop="columnchildren.prop"
  136. :label="columnchildren.label"
  137. :width="columnchildren.width"
  138. :min-width="columnchildren.minWidth"
  139. :fixed="columnchildren.fixed"
  140. :key="columnchildren.prop"
  141. :type="columnchildren.type"
  142. :formatter="columnchildren.formatter"
  143. :sortable="
  144. columnchildren.sortable == null ? true : columnchildren.sortable
  145. "
  146. >
  147. </el-table-column>
  148. </template>
  149. </el-table-column>
  150. </template>
  151. <el-table-column
  152. :label="$t('action.operation')"
  153. :width="operationWidth"
  154. fixed="right"
  155. v-if="showOperation"
  156. header-align="center"
  157. align="center"
  158. >
  159. <template slot-scope="scope">
  160. <kt-button
  161. type="primary"
  162. v-if="editButtonName"
  163. icon="fa fa-edit"
  164. :label="editButtonName"
  165. :perms="permsEdit"
  166. :size="size"
  167. @click="handleEdit(scope.$index, scope.row)"
  168. />
  169. <kt-button
  170. v-if="deleteButtonName"
  171. icon="fa fa-trash"
  172. :label="deleteButtonName"
  173. :perms="permsDelete"
  174. :size="size"
  175. type="danger"
  176. @click="handleDeleteFlag(scope.$index, scope.row)"
  177. />
  178. <kt-button
  179. :style="{
  180. background: button1Background + '',
  181. border: '1px solid' + button1Background,
  182. color: '#fff',
  183. }"
  184. v-if="button1Name"
  185. :label="button1Name"
  186. :perms="permsButton1"
  187. :size="size"
  188. :icon="button1Icon"
  189. @click="handleButton1(scope.$index, scope.row)"
  190. />
  191. <kt-button
  192. v-if="button2Name"
  193. :label="button2Name"
  194. :perms="permsButton2"
  195. :size="size"
  196. :type="button2Type"
  197. :icon="button2Icon"
  198. @click="handleButton2(scope.$index, scope.row)"
  199. />
  200. <kt-button
  201. v-if="button3Name"
  202. :label="button3Name"
  203. :perms="permsButton3"
  204. :size="size"
  205. :type="button3Type"
  206. :icon="button3Icon"
  207. @click="handleButton3(scope.$index, scope.row)"
  208. />
  209. <kt-button
  210. v-if="button4Name"
  211. :icon="button4Icon"
  212. :type="button4Type"
  213. :label="button4Name"
  214. :perms="permsButton4"
  215. :size="size"
  216. @click="handleButton4(scope.$index, scope.row)"
  217. />
  218. <kt-button
  219. v-if="button5Name"
  220. :label="button5Name"
  221. :size="size"
  222. :type="button5Type"
  223. :icon="button5Icon"
  224. @click="handleButton5(scope.$index, scope.row)"
  225. />
  226. <kt-button
  227. v-if="button6Name"
  228. :label="button6Name"
  229. :size="size"
  230. :type="button6Type"
  231. @click="handleButton6(scope.$index, scope.row)"
  232. />
  233. <el-button type="text" size="small" v-if="buttonDropdown.length>0">
  234. <el-dropdown trigger="click">
  235. <span class="el-dropdown-link">
  236. 更多
  237. <i class="el-icon-arrow-down el-icon--right"></i>
  238. </span>
  239. <el-dropdown-menu slot="dropdown">
  240. <el-dropdown-item v-for="val in buttonDropdown" :key="val.label">
  241. <el-button style="width:100%" size="mini" type="text" v-if="!val.hide || (val.hide && val.hide(scope.row))" @click="val.click(scope.row)">{{ val.label }}</el-button>
  242. </el-dropdown-item>
  243. </el-dropdown-menu>
  244. </el-dropdown>
  245. </el-button>
  246. </template>
  247. </el-table-column>
  248. </el-table>
  249. <!--分页栏-->
  250. <!-- 底部分页 -->
  251. <div class="bottomFixed" ref="bottomFixed">
  252. <kt-button
  253. :label="customToolName"
  254. :perms="permscustomTool"
  255. :size="size"
  256. type="danger"
  257. @click="customToolMethod()"
  258. :disabled="selections.length === 0"
  259. style="float: left"
  260. v-if="customToolseletted"
  261. />
  262. <kt-button
  263. class="debutton"
  264. :label="deleteName"
  265. :perms="permsDelete"
  266. :size="size"
  267. type="danger"
  268. @click="handleBatchDelete()"
  269. :disabled="selections.length === 0"
  270. style="float: left"
  271. v-if="showBatchDelete & showOperation"
  272. />
  273. <kt-button
  274. :label="settledName"
  275. :perms="permsSettled"
  276. :size="size"
  277. type="danger"
  278. @click="handleBatchSettled()"
  279. :disabled="selections.length === 0"
  280. style="float: left"
  281. v-if="showBatchSettled"
  282. />
  283. <kt-button
  284. label="导出Excel"
  285. :perms="permsExcel"
  286. :size="size"
  287. type="danger"
  288. @click="handleBatchPrint()"
  289. style="float: left"
  290. v-if="showBatchPrint"
  291. />
  292. <el-pagination
  293. background
  294. @size-change="handleSizeChange"
  295. layout="total, sizes, prev, pager, next, jumper"
  296. @current-change="refreshPageRequest"
  297. :current-page="data.pageNum"
  298. :page-size="data.pageSize"
  299. :page-sizes="[10, 20, 50, 100, 200, 300, 400, 500]"
  300. :total="data.totalSize"
  301. style="float: left; margin-left: 20px"
  302. v-if="isshowpagination"
  303. >
  304. </el-pagination>
  305. </div>
  306. </div>
  307. </template>
  308. <script>
  309. import KtButton from "@/views/Core/KtButton";
  310. import BigNumber from "bignumber.js";
  311. export default {
  312. name: "KtCommonTable",
  313. components: {
  314. KtButton,
  315. },
  316. props: {
  317. tableHeights: {
  318. type: Number,
  319. },
  320. operationWidth: {
  321. type: Number,
  322. default: 200,
  323. },
  324. showBatchSettled: {
  325. //显示批量结算
  326. type: Boolean,
  327. default: false,
  328. },
  329. SerialShow: {
  330. type: Boolean,
  331. default: true,
  332. },
  333. customToolName: {
  334. type: String,
  335. },
  336. permscustomTool: {
  337. type: String,
  338. },
  339. customToolseletted: {
  340. // 自定义操作组件
  341. type: Boolean,
  342. default: false,
  343. },
  344. settledName: {
  345. //批量按钮name
  346. type: String,
  347. },
  348. deleteName: {
  349. type: String,
  350. },
  351. showBatchPrint: {
  352. //显示批量导出
  353. type: Boolean,
  354. default: false,
  355. },
  356. //显示合计
  357. showSummary: {
  358. type: Boolean,
  359. default: false,
  360. },
  361. button1Name: {
  362. type: String,
  363. },
  364. button2Name: {
  365. type: String,
  366. },
  367. button3Name: {
  368. type: String,
  369. },
  370. button4Name: {
  371. type: String,
  372. },
  373. button5Name: {
  374. type: String,
  375. },
  376. button6Name: {
  377. type: String,
  378. },
  379. buttonDropdown:{
  380. type: Array,
  381. default: () => [],
  382. },
  383. permsButton1: {
  384. type: String,
  385. },
  386. permsButton2: {
  387. type: String,
  388. },
  389. permsButton3: {
  390. type: String,
  391. },
  392. permsButton4: {
  393. type: String,
  394. },
  395. button1Background: {
  396. type: String,
  397. default: "#f56c6c",
  398. },
  399. button2Background: {
  400. type: String,
  401. default: "rgb(222, 80, 76)",
  402. },
  403. button3Background: {
  404. type: String,
  405. default: "rgb(14, 194, 22)",
  406. },
  407. button4Background: {
  408. type: String,
  409. default: "#1e87ed",
  410. },
  411. button1Icon: {
  412. type: String,
  413. default: "fa fa-trash",
  414. },
  415. button2Icon: {
  416. type: String,
  417. default: "",
  418. },
  419. button3Icon: {
  420. type: String,
  421. default: "",
  422. },
  423. button4Icon: {
  424. type: String,
  425. default: "",
  426. },
  427. button5Icon: {
  428. type: String,
  429. default: "",
  430. },
  431. button2Type: {
  432. type: String,
  433. default: "primary",
  434. },
  435. button3Type: {
  436. type: String,
  437. default: "primary",
  438. },
  439. button4Type: {
  440. type: String,
  441. default: "primary",
  442. },
  443. button5Type: {
  444. type: String,
  445. default: "primary",
  446. },
  447. button6Type: {
  448. type: String,
  449. default: "primary",
  450. },
  451. editButtonName: {
  452. type: String,
  453. },
  454. deleteButtonName: {
  455. type: String,
  456. },
  457. isshowpagination: {
  458. //是否显示分页栏
  459. type: Boolean,
  460. default: true,
  461. },
  462. showSummaryFieldList: Array, //自定义合计列配置
  463. keyName: String, //主键字段名
  464. columns: Array, // 表格列配置
  465. data: {}, // 表格分页数据
  466. permsEdit: String, // 编辑权限标识
  467. permsDelete: String, // 底部按钮标识
  468. permsSettled: String, // 底部按钮标识
  469. permsExcel: String, // 底部按钮标识
  470. size: {
  471. // 尺寸样式
  472. type: String,
  473. default: "small ",
  474. },
  475. align: {
  476. // 文本对齐方式
  477. type: String,
  478. default: "left",
  479. },
  480. // maxHeight: { // 表格最大高度
  481. // type: Number,
  482. // default: 1420
  483. // },
  484. // height: { // 表格最大高度
  485. // type: Number,
  486. // default: 250
  487. // },
  488. showOperation: {
  489. // 是否显示操作组件
  490. type: Boolean,
  491. default: true,
  492. },
  493. border: {
  494. // 是否显示边框
  495. type: Boolean,
  496. default: true,
  497. },
  498. stripe: {
  499. // 是否显示斑马线
  500. type: Boolean,
  501. default: true,
  502. },
  503. highlightCurrentRow: {
  504. // 是否高亮当前行
  505. type: Boolean,
  506. default: true,
  507. },
  508. showOverflowTooltip: {
  509. // 是否单行显示
  510. type: Boolean,
  511. default: true,
  512. },
  513. showBatchDelete: {
  514. // 是否显示操作组件
  515. type: Boolean,
  516. default: false,
  517. },
  518. showSysUserAccountCardList: {
  519. // 是否显示二级列组件
  520. type: Boolean,
  521. default: false,
  522. },
  523. },
  524. data() {
  525. return {
  526. tableHeight: 0,
  527. loading: false, // 加载标识
  528. selections: [], // 列表选中列
  529. pageRequest: {
  530. pageNum: 1,
  531. pageSize: 20,
  532. },
  533. };
  534. },
  535. methods: {
  536. tableRowClassName(row, rowIndex) {
  537. // if (!!row.fieldName24 && row.fieldName24.indexOf("未") >= 0) {
  538. // return "warningRow";
  539. // } else if (!!row.fieldName24 && row.fieldName24.indexOf("已") >= 0) {
  540. // return "successRow";
  541. // }
  542. this.$emit("tableRowClassName", row);
  543. // return '';
  544. },
  545. getSummaries(param) {
  546. const { columns, data } = param;
  547. const sums = [];
  548. columns.forEach((column, index) => {
  549. if (index === 0) {
  550. sums[index] = "合计"; // 假设第一列显示文本'合计'
  551. return;
  552. }
  553. if (this.showSummaryFieldList) {
  554. // 如果当前列名不在需要计算的列名数组中,直接返回空值或其他标记
  555. if (!this.showSummaryFieldList.includes(column.property)) {
  556. sums[index] = "-";
  557. return;
  558. }
  559. }
  560. let sum = new BigNumber(0);
  561. data.forEach((item) => {
  562. let value = item[column.property];
  563. let number = new BigNumber(value);
  564. if (!number.isNaN()) {
  565. sum = sum.plus(number);
  566. }
  567. });
  568. sums[index] = sum.toFixed(); // 转换成字符串避免精度问题
  569. });
  570. return sums;
  571. },
  572. // 分页查询
  573. findPage: function () {
  574. this.loading = true;
  575. let callback = (res) => {
  576. this.loading = false;
  577. //解决操作栏位置偏移问题
  578. this.$nextTick(() => {
  579. this.$refs.doLayout.doLayout();
  580. }, 200);
  581. };
  582. this.$emit("findPage", {
  583. pageRequest: this.pageRequest,
  584. callback: callback,
  585. });
  586. },
  587. hideLoading() {
  588. this.loading = false;
  589. },
  590. // 选择切换
  591. selectionChange: function (selections) {
  592. this.selections = selections;
  593. this.$emit("selectionChange", {
  594. selections: selections,
  595. });
  596. },
  597. // 选择切换
  598. handleCurrentChange: function (val) {
  599. this.$emit("handleCurrentChange", {
  600. val: val,
  601. });
  602. },
  603. rowClick: function (row) {
  604. this.$emit("rowClick", {
  605. row: row,
  606. });
  607. },
  608. // 换页刷新
  609. refreshPageRequest: function (pageNum) {
  610. this.pageRequest.pageNum = pageNum;
  611. this.pageRequest.pageSize = 20;
  612. this.findPage();
  613. },
  614. // 每页条数发生改变
  615. handleSizeChange(pageSize) {
  616. this.pageRequest.pageSize = pageSize;
  617. this.findPage();
  618. },
  619. signStateChanged(index, row) {
  620. this.$emit("signStateChanged", {
  621. index: index,
  622. row: row,
  623. });
  624. },
  625. // 按钮编辑
  626. handleBtnEdit: function (index, row) {
  627. this.$emit("handleBtnEdit", {
  628. index: index,
  629. row: row,
  630. });
  631. },
  632. // 编辑
  633. handleEdit: function (index, row) {
  634. this.$emit("handleEdit", {
  635. index: index,
  636. row: row,
  637. });
  638. // this.$emit('findLeftTreeData')
  639. },
  640. // 删除
  641. handleDelete: function (index, row) {
  642. let _keyName = "id";
  643. if (!!this.keyName) {
  644. _keyName = this.keyName;
  645. }
  646. this.delete(row[_keyName]);
  647. },
  648. handleButton1: function (index, row) {
  649. this.$emit("handleButton1", {
  650. index: index,
  651. row: row,
  652. });
  653. },
  654. handleButton2: function (index, row) {
  655. this.$emit("handleButton2", {
  656. index: index,
  657. row: row,
  658. });
  659. },
  660. handleButton3: function (index, row) {
  661. this.$emit("handleButton3", {
  662. index: index,
  663. row: row,
  664. });
  665. },
  666. handleButton4: function (index, row) {
  667. this.$emit("handleButton4", {
  668. index: index,
  669. row: row,
  670. });
  671. },
  672. handleButton5: function (index, row) {
  673. this.$emit("handleButton5", {
  674. index: index,
  675. row: row,
  676. });
  677. },
  678. handleButton6: function (index, row) {
  679. this.$emit("handleButton6", {
  680. index: index,
  681. row: row,
  682. });
  683. },
  684. handleButton: function (index, row) {
  685. this.$emit("handleButton", {
  686. index: index,
  687. row: row,
  688. });
  689. },
  690. //删除单个
  691. handleDeleteFlag: function (index, row) {
  692. this.$emit("handleDeleteFlag", { index: index, row: row });
  693. // var _keyName = "id";
  694. // if (!!this.keyName) {
  695. // _keyName = this.keyName;
  696. // }
  697. // let ids = row[_keyName];
  698. // this.$confirm("确认删除吗?", "提示", {
  699. // type: "warning",
  700. // })
  701. // .then(() => {
  702. // let params = [];
  703. // let idArray = (ids + "").split(",");
  704. // for (var i = 0; i < idArray.length; i++) {
  705. // var obj = {};
  706. // obj[_keyName] = idArray[i];
  707. // params.push(obj);
  708. // }
  709. // this.loading = true;
  710. // let callback = (res) => {
  711. // if (res.code == 200) {
  712. // this.$message({
  713. // message: "操作成功",
  714. // type: "success",
  715. // });
  716. // this.findPage();
  717. // // this.$emit('findLeftTreeData')
  718. // } else {
  719. // this.$message({
  720. // message: "操作失败, " + res.msg,
  721. // type: "error",
  722. // });
  723. // }
  724. // };
  725. // this.$emit("handleDeleteFlag", {
  726. // params: params,
  727. // callback: callback,
  728. // });
  729. // this.loading = false;
  730. // })
  731. // .catch(() => {
  732. // this.loading = false;
  733. // });
  734. },
  735. // 批量删除
  736. handleBatchDelete: function () {
  737. let idlist = [];
  738. this.selections.map((item) => idlist.push(item.id));
  739. this.$emit("handleDelete", idlist);
  740. },
  741. //自定义批量操作按钮
  742. customToolMethod() {
  743. let idlist = [];
  744. this.selections.map((item) => idlist.push(item.id));
  745. this.$emit("customTool", idlist);
  746. },
  747. // 删除操作
  748. delete: function (ids) {
  749. var _keyName = "id";
  750. if (!!this.keyName) {
  751. _keyName = this.keyName;
  752. }
  753. this.$confirm("确认删除吗?", "提示", {
  754. type: "warning",
  755. })
  756. .then(() => {
  757. let params = [];
  758. let idArray = (ids + "").split(",");
  759. for (var i = 0; i < idArray.length; i++) {
  760. var obj = {};
  761. obj[_keyName] = idArray[i];
  762. params.push(obj);
  763. }
  764. let callback = (res) => {
  765. if (res.code == 200) {
  766. this.$message({
  767. message: "操作成功",
  768. type: "success",
  769. });
  770. this.findPage();
  771. // this.$emit('findLeftTreeData')
  772. } else {
  773. this.$message({
  774. message: "操作失败, " + res.msg,
  775. type: "error",
  776. });
  777. }
  778. };
  779. this.$emit("handleDelete", {
  780. params: params,
  781. callback: callback,
  782. });
  783. })
  784. .catch(() => {});
  785. },
  786. //批量结算
  787. handleBatchSettled: function () {
  788. let _keyName = "orderno";
  789. if (!!this.keyName) {
  790. _keyName = this.keyName;
  791. }
  792. let idlist = [];
  793. this.selections.map((item) => idlist.push(item[_keyName]));
  794. this.$emit("handleSettled", idlist);
  795. },
  796. //批量打印
  797. handleBatchPrint: function () {
  798. // let _keyName = "orderno";
  799. // if(!!this.keyName){
  800. // _keyName = this.keyName;
  801. // }
  802. // let ids = this.selections.map(item => item[_keyName]).toString()
  803. // console.log(ids);
  804. this.$emit("handlePrint");
  805. },
  806. },
  807. mounted() {
  808. const that = this;
  809. that.refreshPageRequest(1);
  810. setTimeout(() => {
  811. let tableTop = that.$refs.commonTable.offsetTop;
  812. let bottomTop = that.$refs.bottomFixed.offsetTop;
  813. that.tableHeight = bottomTop - tableTop - 120 + "px";
  814. }, 10);
  815. // window.onresize = function () {
  816. // let tableTop = that.$refs.commonTable.offsetTop;
  817. // let bottomTop = that.$refs.bottomFixed.offsetTop;
  818. // that.tableHeight = bottomTop - tableTop - 120 + "px";
  819. // };
  820. },
  821. };
  822. </script>
  823. <style scoped>
  824. /* 底部固定分页 */
  825. .bottomFixed {
  826. height: 40px;
  827. position: fixed;
  828. bottom: 0;
  829. width: 100%;
  830. background: #fff;
  831. /* margin-top: 10px; */
  832. /* box-shadow: 0 -2px 0 0 #efefef; */
  833. }
  834. .el-table .warningRow {
  835. background: oldlace;
  836. }
  837. .el-table .successRow {
  838. background: #f0f9eb;
  839. }
  840. .el-dropdown-link{
  841. cursor: pointer;
  842. color: var(--themeColor);
  843. font-size: 12px;
  844. }
  845. </style>