ShortcutModal.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <el-dialog
  3. title="快捷键大全"
  4. width="60%"
  5. :show-close="false"
  6. :modal-append-to-body="false"
  7. :visible="modalVisible"
  8. >
  9. <el-table :data="dataSource">
  10. <el-table-column align="center" prop="shortcutName" label="功能">
  11. </el-table-column>
  12. <el-table-column align="center" prop="codeName" label="快捷键">
  13. </el-table-column>
  14. </el-table>
  15. <div slot="footer" class="dialog-footer">
  16. <el-button @click="cancel">关闭</el-button>
  17. </div>
  18. </el-dialog>
  19. </template>
  20. <script>
  21. import { flowConfig } from "../config/args-config.js";
  22. export default {
  23. data() {
  24. return {
  25. modalVisible: false,
  26. columns: [
  27. {
  28. title: "功能",
  29. align: "center",
  30. key: "shortcutName",
  31. dataIndex: "shortcutName",
  32. width: "50%",
  33. },
  34. {
  35. title: "快捷键",
  36. align: "center",
  37. key: "codeName",
  38. dataIndex: "codeName",
  39. width: "50%",
  40. },
  41. ],
  42. dataSource: [],
  43. };
  44. },
  45. methods: {
  46. open() {
  47. const that = this;
  48. that.modalVisible = true;
  49. let obj = Object.assign({}, flowConfig.shortcut);
  50. for (let k in obj) {
  51. that.dataSource.push(obj[k]);
  52. }
  53. },
  54. close() {
  55. this.dataSource = [];
  56. this.modalVisible = false;
  57. },
  58. saveSetting() {
  59. this.close();
  60. },
  61. cancel() {
  62. this.close();
  63. },
  64. },
  65. };
  66. </script>
  67. <style>
  68. </style>