index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. <template>
  2. <div class="app-container">
  3. <div class="app-container">
  4. <el-form
  5. :inline="true"
  6. :model="get_table_dataParm"
  7. class="demo-form-inline"
  8. >
  9. <el-form-item>
  10. <el-input
  11. v-model="get_table_dataParm.parammaps.ename"
  12. placeholder="姓名"
  13. style="width: 180px"
  14. class="filter-item"
  15. size="small"
  16. clearable
  17. />
  18. </el-form-item>
  19. <el-form-item>
  20. <el-select
  21. v-model="get_table_dataParm.parammaps.departmentId"
  22. placeholder="部门"
  23. class="filter-item"
  24. size="small"
  25. filterable
  26. style="width: 130px"
  27. clearable
  28. >
  29. <el-option
  30. v-for="(item, index) in departmentList"
  31. :key="index"
  32. :label="item.name"
  33. :value="item.id"
  34. />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button
  39. size="small"
  40. type="info"
  41. plain
  42. icon="el-icon-search"
  43. @click="form_search"
  44. >查询</el-button
  45. >
  46. <el-button
  47. size="small"
  48. type="info"
  49. plain
  50. icon="el-icon-refresh"
  51. @click="form_clear"
  52. >重置</el-button
  53. >
  54. <el-button
  55. size="small"
  56. type="primary"
  57. icon="el-icon-download"
  58. @click="handleExport"
  59. >导出</el-button
  60. >
  61. <el-button
  62. size="small"
  63. type="success"
  64. icon="el-icon-plus"
  65. @click="form_add"
  66. >新增</el-button
  67. >
  68. </el-form-item>
  69. </el-form>
  70. <div class="table">
  71. <el-table
  72. v-loading="listLoading"
  73. element-loading-text="给我一点时间"
  74. :data="list"
  75. border
  76. fit
  77. highlight-current-row
  78. style="width: 100%"
  79. :row-style="rowStyle"
  80. :cell-style="cellStyle"
  81. class="elTable"
  82. row-key="id"
  83. >
  84. <el-table-column
  85. label="序号"
  86. align="center"
  87. type="index"
  88. width="50px"
  89. >
  90. <template slot-scope="scope">
  91. <span>{{ scope.$index + (pageNum - 1) * pageSize + 1 }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="姓名" header-align="center" align="center">
  95. <template slot-scope="scope">
  96. <span>{{ scope.row.ename }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="部门" header-align="center" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.dname }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="电话" header-align="center" align="center">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.telephone }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. label="备注"
  111. width="200px"
  112. header-align="center"
  113. align="center"
  114. >
  115. <template slot-scope="scope">
  116. <span>{{ scope.row.remark }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="顺序" header-align="center" align="center">
  120. <template slot-scope="scope">
  121. <span>{{ scope.row.sort }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="启用" header-align="center" align="center">
  125. <template slot-scope="scope">
  126. <el-switch
  127. v-model="scope.row.enable"
  128. active-color="#13ce66"
  129. inactive-color="#ff4949"
  130. :active-value="1"
  131. :inactive-value="0"
  132. @change="change_enable(scope.$index, scope.row)"
  133. />
  134. </template>
  135. </el-table-column>
  136. <el-table-column
  137. label="操作"
  138. header-align="center"
  139. align="center"
  140. class-name="small-padding fixed-width"
  141. width="250px"
  142. fixed="right"
  143. >
  144. <template slot-scope="{ row }">
  145. <el-button type="primary" size="mini" @click="form_edit(row)">
  146. 编辑
  147. </el-button>
  148. <el-button
  149. v-if="row.status != '已删'"
  150. size="mini"
  151. type="danger"
  152. @click="handleDelete(row)"
  153. >
  154. 删除
  155. </el-button>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. <pagination
  160. v-show="total >= 0"
  161. :total="total"
  162. :page.sync="get_table_dataParm.offset"
  163. :limit.sync="get_table_dataParm.pagecount"
  164. :page-sizes="[10, 50, 100, 200, 500]"
  165. :layout="'total, sizes, prev, pager, next, jumper'"
  166. @pagination="get_table_data"
  167. />
  168. </div>
  169. <el-dialog
  170. :title="textMap[dialogStatus]"
  171. :visible.sync="dialogFormVisible"
  172. :close-on-click-modal="false"
  173. width="40%"
  174. >
  175. <el-form
  176. ref="dataForm"
  177. :rules="rules"
  178. :model="deptform"
  179. label-position="left"
  180. label-width="100px"
  181. style="width: 400px; margin-left: 50px"
  182. >
  183. <el-form-item label="姓名" prop="ename">
  184. <el-input ref="ename" v-model="deptform.ename" />
  185. </el-form-item>
  186. <el-form-item label="部门" prop="parentid">
  187. <tree-select
  188. :disabled="disabled"
  189. :height="280"
  190. :width="200"
  191. size="small"
  192. :data="parent"
  193. :default-props="defaultProps"
  194. clearable
  195. :expandAll="true"
  196. :node-key="nodeKey"
  197. :checked-keys="defaultCheckedKeys"
  198. @popoverHide="popoverHide"
  199. />
  200. </el-form-item>
  201. <el-form-item label="电话" prop="telephone">
  202. <el-input
  203. ref="telephone"
  204. v-model="deptform.telephone"
  205. maxlength="11"
  206. />
  207. </el-form-item>
  208. <el-form-item label="备注" prop="remark">
  209. <el-input ref="remark" v-model="deptform.remark" />
  210. </el-form-item>
  211. <el-form-item label="顺序" prop="sort">
  212. <el-input ref="sort" v-model="deptform.sort" />
  213. </el-form-item>
  214. <el-form-item label="启用" prop="enable">
  215. <el-switch
  216. ref="enable"
  217. v-model="deptform.enable"
  218. active-color="#13ce66"
  219. inactive-color="#ff4949"
  220. :active-value="1"
  221. :inactive-value="0"
  222. />
  223. </el-form-item>
  224. </el-form>
  225. <div slot="footer" class="dialog-footer">
  226. <el-button
  227. class="cancelClose"
  228. @click="
  229. dialogFormVisible = false;
  230. get_table_data();
  231. "
  232. >关闭</el-button
  233. >
  234. <el-button
  235. class="success"
  236. @click="
  237. dialogStatus === 'create' ? add_dialog_save() : form_edit_save()
  238. "
  239. >确认</el-button
  240. >
  241. </div>
  242. </el-dialog>
  243. </div>
  244. </div>
  245. </template>
  246. <script>
  247. import TreeSelect from "@/components/TreeSelect";
  248. import waves from "@/directive/waves"; // waves directive
  249. import Cookies from "js-cookie";
  250. import { isIntegerZero } from "@/utils/validate";
  251. import {
  252. PostDataByName,
  253. GetDataByName,
  254. transData,
  255. failproccess,
  256. } from "@/api/common";
  257. import { MessageBox } from "element-ui";
  258. import Pagination from "@/components/Pagination";
  259. import XLSX from "xlsx";
  260. export default {
  261. name: "StaffManagement",
  262. components: { TreeSelect, Pagination },
  263. directives: { waves },
  264. filters: {
  265. menutypeFilter(menutype) {
  266. const menutypeMap = {
  267. menu: "",
  268. button: "warning",
  269. };
  270. return menutypeMap[menutype];
  271. },
  272. },
  273. data() {
  274. return {
  275. disabled: false,
  276. tableKey: 0,
  277. list: [{ deptname: "公司", id: 1, parentid: -1, remark: "" }],
  278. parent: [],
  279. parentmenu: [],
  280. parentButton: [],
  281. departmentList: [],
  282. requestParam: {
  283. name: "insertEmployees",
  284. parammaps: {},
  285. },
  286. deptform: {
  287. id: "",
  288. ename: "",
  289. remark: "",
  290. sort: "",
  291. parentid: "0",
  292. telephone: "",
  293. enable: "1",
  294. },
  295. get_table_dataParm: {
  296. name: "getEmployees",
  297. page: 1,
  298. offset: 1,
  299. pagecount: 10,
  300. returntype: "Map",
  301. parammaps: {
  302. ename: "",
  303. departmentId: "",
  304. },
  305. },
  306. listLoading: true,
  307. tableKey: 0,
  308. list: [],
  309. total: 0,
  310. getRecuListParm: { name: "getDepartmentCascade" },
  311. getRecuListBParm: {
  312. name: "getMenuListBRecu",
  313. idname: "id",
  314. parammaps: { id: 0 },
  315. },
  316. rules: {
  317. ename: [
  318. {
  319. type: "string",
  320. required: true,
  321. message: "姓名必填",
  322. trigger: "change",
  323. },
  324. ],
  325. parentid: [
  326. { required: true, message: "部门名称必填", trigger: "change" },
  327. ],
  328. telephone: [
  329. { required: true, message: "电话不能为空" },
  330. { min: 11, max: 11, message: "必填11个字符", trigger: "blur" },
  331. ],
  332. sort: [{ validator: isIntegerZero, trigger: "blur" }],
  333. },
  334. dialogFormVisible: false,
  335. dialogStatus: "",
  336. textMap: {
  337. update: "编辑",
  338. create: "新增",
  339. },
  340. rowStyle: { maxHeight: 50 + "px", height: 45 + "px" },
  341. cellStyle: { padding: 0 + "px" },
  342. defaultProps: {
  343. children: "children",
  344. label: "title",
  345. },
  346. nodeKey: "id",
  347. defaultCheckedKeys: [],
  348. };
  349. },
  350. created() {
  351. this.get_table_data();
  352. this.get_select_list();
  353. },
  354. methods: {
  355. popoverHide(checkedIds, checkedData) {
  356. this.deptform.parentid = checkedIds;
  357. },
  358. form_search() {
  359. console.log("点击了查询");
  360. this.get_table_dataParm.offset = 1;
  361. this.get_table_data();
  362. },
  363. form_clear() {
  364. console.log("点击了重置");
  365. this.get_table_dataParm.parammaps.departmentId = "";
  366. this.get_table_dataParm.parammaps.ename = "";
  367. this.get_table_dataParm.offset = 1;
  368. this.get_table_data();
  369. },
  370. get_table_data() {
  371. this.listLoading = true;
  372. GetDataByName(this.get_table_dataParm).then((response) => {
  373. if (response.data.list !== null) {
  374. for (var i = 0; i < response.data.list.length; i++) {
  375. response.data.list[i].enable = parseInt(
  376. response.data.list[i].enable
  377. );
  378. }
  379. this.list = response.data.list;
  380. this.pageNum = response.data.pageNum;
  381. this.pageSize = response.data.pageSize;
  382. this.total = response.data.total;
  383. } else {
  384. this.list = [];
  385. }
  386. setTimeout(() => {
  387. this.listLoading = false;
  388. }, 0.5 * 1000);
  389. });
  390. },
  391. get_select_list() {
  392. GetDataByName(this.getRecuListParm).then((response) => {
  393. if (response.data.list !== null) {
  394. this.parentmenu = transData(
  395. response.data.list,
  396. "id",
  397. "parentid",
  398. "children"
  399. );
  400. }
  401. });
  402. GetDataByName({
  403. name: "getDepartmentsSelect",
  404. offset: 0,
  405. pagecount: 0,
  406. parammaps: {},
  407. }).then((response) => {
  408. console.log("部门下拉框", response);
  409. this.departmentList = response.data.list;
  410. });
  411. },
  412. refreshDownList() {
  413. for (var val of this.parentmenu) {
  414. this.parent = [];
  415. this.parent.push({
  416. id: val.id,
  417. title: val.title,
  418. parentid: val.parentid,
  419. });
  420. }
  421. },
  422. resetRequestParam() {
  423. this.deptform.parentid = "0";
  424. this.deptform.departmentid = "0";
  425. this.deptform.ename = "";
  426. this.deptform.remark = "";
  427. this.deptform.sort = "0";
  428. this.deptform.telephone = "";
  429. this.deptform.id = "";
  430. this.deptform.enable = 1;
  431. },
  432. form_add() {
  433. this.resetRequestParam();
  434. this.dialogStatus = "create";
  435. this.parent = this.parentmenu;
  436. this.dialogFormVisible = true;
  437. this.$nextTick(() => {
  438. this.$refs["dataForm"].clearValidate();
  439. });
  440. },
  441. add_dialog_save() {
  442. this.$refs["dataForm"].validate((valid) => {
  443. if (valid) {
  444. this.requestParam.name = "insertEmployees";
  445. if (this.deptform.parentid === "") this.deptform.parentid = "0";
  446. this.requestParam.parammaps = {
  447. id: "",
  448. ename: this.deptform.ename,
  449. telephone: this.deptform.telephone,
  450. remark: this.deptform.remark,
  451. sort: this.deptform.sort,
  452. departmentId: this.deptform.parentid,
  453. enable: this.deptform.enable,
  454. };
  455. PostDataByName(this.requestParam).then((response) => {
  456. console.log("新增保存发送参数", this.requestParam);
  457. if (response.msg !== "fail") {
  458. this.get_table_data();
  459. this.dialogFormVisible = false;
  460. this.$notify({
  461. title: "成功",
  462. message: "保存成功",
  463. type: "success",
  464. duration: 2000,
  465. });
  466. } else {
  467. this.$notify({
  468. title: "失败",
  469. message: "保存失败",
  470. type: "error",
  471. duration: 2000,
  472. });
  473. }
  474. });
  475. }
  476. });
  477. },
  478. form_edit(row) {
  479. this.parent = this.parentmenu;
  480. console.log("row=====>", row);
  481. this.defaultCheckedKeys = [row.departmentid];
  482. console.log(this.defaultCheckedKeys);
  483. this.deptform.departmentid = row.departmentid;
  484. this.deptform.parentid = row.departmentid;
  485. this.deptform.ename = row.ename;
  486. this.deptform.remark = row.remark;
  487. this.deptform.sort = row.sort;
  488. this.deptform.telephone = row.telephone;
  489. this.deptform.id = row.id;
  490. this.deptform.enable = row.enable;
  491. this.dialogStatus = "update";
  492. this.dialogFormVisible = true;
  493. this.$nextTick(() => {
  494. this.$refs["dataForm"].clearValidate();
  495. });
  496. },
  497. form_edit_save() {
  498. this.$refs["dataForm"].validate((valid) => {
  499. if (valid) {
  500. this.requestParam.name = "updateEmployees";
  501. this.requestParam.parammaps = {
  502. id: this.deptform.id,
  503. ename: this.deptform.ename,
  504. telephone: this.deptform.telephone,
  505. remark: this.deptform.remark,
  506. sort: this.deptform.sort,
  507. departmentId: this.deptform.parentid,
  508. enable: this.deptform.enable,
  509. };
  510. console.log(this.requestParam);
  511. PostDataByName(this.requestParam).then((response) => {
  512. console.log("编辑保存发送参数", this.requestParam);
  513. if (response.msg !== "fail") {
  514. this.get_table_data();
  515. this.dialogFormVisible = false;
  516. this.$notify({
  517. title: "成功",
  518. message: "保存成功",
  519. type: "success",
  520. duration: 2000,
  521. });
  522. } else {
  523. this.$notify({
  524. title: "失败",
  525. message: "保存失败",
  526. type: "error",
  527. duration: 2000,
  528. });
  529. }
  530. });
  531. }
  532. });
  533. },
  534. change_enable(index, row) {
  535. this.requestParam.name = "updateEmployees";
  536. this.requestParam.parammaps = {
  537. id: row.id,
  538. ename: row.ename,
  539. telephone: row.telephone,
  540. remark: row.remark,
  541. sort: row.sort,
  542. departmentId: row.departmentid,
  543. enable: row.enable,
  544. };
  545. PostDataByName(this.requestParam).then((response) => {
  546. console.log("编辑保存发送参数", this.requestParam);
  547. if (response.msg !== "fail") {
  548. this.get_table_data();
  549. this.dialogFormVisible = false;
  550. this.$notify({
  551. title: "成功",
  552. message: "保存成功",
  553. type: "success",
  554. duration: 2000,
  555. });
  556. } else {
  557. this.$notify({
  558. title: "失败",
  559. message: "保存失败",
  560. type: "error",
  561. duration: 2000,
  562. });
  563. }
  564. });
  565. },
  566. handleDelete(row) {
  567. MessageBox.confirm("确认删除此信息?", {
  568. confirmButtonText: "确认",
  569. cancelButtonText: "取消",
  570. type: "warning",
  571. }).then(() => {
  572. this.requestParam.name = "delEmployees";
  573. this.requestParam.parammaps = {
  574. id: row.id,
  575. };
  576. PostDataByName(this.requestParam).then(() => {
  577. this.get_table_data();
  578. this.dialogFormVisible = false;
  579. this.$notify({
  580. title: "成功",
  581. message: "删除成功",
  582. type: "success",
  583. duration: 2000,
  584. });
  585. });
  586. });
  587. },
  588. async handleExport() {
  589. try {
  590. const exportParams = {
  591. name: "getEmployees",
  592. returntype: "Map",
  593. parammaps: this.get_table_dataParm.parammaps,
  594. };
  595. const response = await GetDataByName(exportParams);
  596. if (response.msg !== "ok") {
  597. this.$message.error("获取导出数据失败");
  598. return;
  599. }
  600. const data = response.data.list || [];
  601. if (data.length === 0) {
  602. this.$message.warning("暂无数据可导出");
  603. return;
  604. }
  605. const headers = [
  606. "序号",
  607. "姓名",
  608. "部门",
  609. "电话",
  610. "备注",
  611. "顺序",
  612. "启用状态",
  613. ];
  614. const rows = data.map((item, index) => [
  615. index + 1,
  616. item.ename || "",
  617. item.dname || "",
  618. item.telephone || "",
  619. item.remark || "",
  620. item.sort,
  621. item.enable === 1 ? "启用" : "禁用",
  622. ]);
  623. const wb = XLSX.utils.book_new();
  624. const wsData = [headers, ...rows];
  625. const ws = XLSX.utils.aoa_to_sheet(wsData);
  626. const colWidths = [
  627. { wch: 8 },
  628. { wch: 15 },
  629. { wch: 20 },
  630. { wch: 15 },
  631. { wch: 30 },
  632. { wch: 10 },
  633. { wch: 10 },
  634. ];
  635. ws["!cols"] = colWidths;
  636. XLSX.utils.book_append_sheet(wb, ws, "职工列表");
  637. const fileName = `职工列表_${this.getFormattedDateTime()}.xlsx`;
  638. XLSX.writeFile(wb, fileName);
  639. this.$message.success("导出成功");
  640. } catch (error) {
  641. console.error("导出失败:", error);
  642. this.$message.error("导出失败");
  643. }
  644. },
  645. getFormattedDateTime() {
  646. const now = new Date();
  647. const year = now.getFullYear();
  648. const month = String(now.getMonth() + 1).padStart(2, "0");
  649. const day = String(now.getDate()).padStart(2, "0");
  650. const hours = String(now.getHours()).padStart(2, "0");
  651. const minutes = String(now.getMinutes()).padStart(2, "0");
  652. const seconds = String(now.getSeconds()).padStart(2, "0");
  653. return `${year}${month}${day}${hours}${minutes}${seconds}`;
  654. },
  655. },
  656. };
  657. </script>
  658. <style lang="scss" scoped>
  659. .app-container {
  660. padding: 15px;
  661. background-color: #f5f7fa;
  662. .demo-form-inline {
  663. background-color: #fff;
  664. padding: 15px;
  665. border-radius: 4px;
  666. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  667. margin-bottom: 15px;
  668. :deep(.el-form-item) {
  669. margin-bottom: 0;
  670. margin-right: 10px;
  671. vertical-align: top;
  672. // 统一输入框和选择框高度
  673. .el-input,
  674. .el-select {
  675. .el-input__inner {
  676. height: 32px;
  677. line-height: 32px;
  678. }
  679. }
  680. }
  681. :deep(.el-button) {
  682. margin-left: 5px;
  683. height: 32px;
  684. line-height: 30px;
  685. padding: 0 15px;
  686. font-weight: 500;
  687. border-radius: 4px;
  688. font-size: 14px;
  689. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  690. &:hover {
  691. transform: translateY(-1px);
  692. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  693. }
  694. &[type="primary"] {
  695. background-color: #409eff;
  696. border-color: #409eff;
  697. &:hover {
  698. background-color: #66b1ff;
  699. border-color: #66b1ff;
  700. }
  701. }
  702. &[type="success"] {
  703. background-color: #67c23a;
  704. border-color: #67c23a;
  705. &:hover {
  706. background-color: #85ce61;
  707. border-color: #85ce61;
  708. }
  709. }
  710. &[type="info"] {
  711. &.is-plain {
  712. color: #909399;
  713. background: #f4f4f5;
  714. border-color: #d3d4d6;
  715. &:hover {
  716. color: #409eff;
  717. background-color: #ecf5ff;
  718. border-color: #b3d8ff;
  719. }
  720. }
  721. }
  722. &[type="danger"] {
  723. background-color: #f56c6c;
  724. border-color: #f56c6c;
  725. &:hover {
  726. background-color: #f78989;
  727. border-color: #f78989;
  728. }
  729. }
  730. // 图标样式
  731. [class*="el-icon-"] {
  732. margin-right: 5px;
  733. & + span {
  734. margin-left: 0;
  735. }
  736. }
  737. }
  738. }
  739. .table {
  740. background-color: #fff;
  741. padding: 15px;
  742. border-radius: 4px;
  743. box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  744. :deep(.el-table) {
  745. .el-button--mini {
  746. height: 32px;
  747. padding: 0 15px;
  748. font-weight: 500;
  749. border-radius: 4px;
  750. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  751. margin: 2px 4px;
  752. &:hover {
  753. transform: translateY(-1px);
  754. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  755. }
  756. &[type="primary"] {
  757. background-color: #409eff;
  758. border-color: #409eff;
  759. &:hover {
  760. background-color: #66b1ff;
  761. border-color: #66b1ff;
  762. }
  763. }
  764. &[type="danger"] {
  765. background-color: #f56c6c;
  766. border-color: #f56c6c;
  767. &:hover {
  768. background-color: #f78989;
  769. border-color: #f78989;
  770. }
  771. }
  772. }
  773. }
  774. }
  775. }
  776. .search {
  777. margin-bottom: 15px;
  778. }
  779. .operation {
  780. margin-bottom: 15px;
  781. }
  782. .pagination-container {
  783. margin-top: 15px;
  784. }
  785. // 弹窗按钮样式
  786. :deep(.el-dialog) {
  787. .dialog-footer {
  788. padding: 15px 20px;
  789. text-align: right;
  790. background: #f8f9fa;
  791. border-top: 1px solid #e9ecef;
  792. border-radius: 0 0 4px 4px;
  793. .el-button {
  794. height: 32px;
  795. line-height: 30px;
  796. padding: 0 20px;
  797. font-size: 14px;
  798. font-weight: 500;
  799. border-radius: 4px;
  800. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  801. margin-left: 10px;
  802. &:first-child {
  803. margin-left: 0;
  804. }
  805. &:hover {
  806. transform: translateY(-1px);
  807. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  808. }
  809. &.cancelClose {
  810. color: #606266;
  811. background: #fff;
  812. border-color: #dcdfe6;
  813. &:hover {
  814. color: #409eff;
  815. border-color: #c6e2ff;
  816. background-color: #ecf5ff;
  817. }
  818. }
  819. &.success {
  820. color: #fff;
  821. background-color: #67c23a;
  822. border-color: #67c23a;
  823. &:hover {
  824. background-color: #85ce61;
  825. border-color: #85ce61;
  826. }
  827. }
  828. }
  829. }
  830. }
  831. </style>