occupation_setting.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="mainContainer">
  3. <div class="mainTitle">职业技能配置</div>
  4. <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
  5. <el-table-column prop="name" label="名称" width="200"></el-table-column>
  6. <el-table-column prop="slug" label="别名" width="200"></el-table-column>
  7. <el-table-column prop="sort" label="排序"></el-table-column>
  8. <el-table-column label="操作">
  9. <template slot-scope="scope">
  10. <el-button size="mini" type="success" v-if="scope.row.children">新增技能</el-button>
  11. <el-button size="mini" type="primary" v-else @click="editDialog = true">编辑</el-button>
  12. </template>
  13. </el-table-column>
  14. </el-table>
  15. <el-button type="primary" size="medium" @click="save">保存</el-button>
  16. <el-dialog title="编辑技能" :visible.sync="editDialog" width="500px">
  17. <el-form :model="form" :label-position="labelPosition" label-width="70px">
  18. <el-form-item label="技能名称">
  19. <el-input v-model="form.name" autocomplete="off"></el-input>
  20. </el-form-item>
  21. <el-form-item label="技能别名" >
  22. <el-input v-model="form.slug" autocomplete="off"></el-input>
  23. </el-form-item>
  24. <el-form-item label="排序" >
  25. <el-input v-model="form.sort" autocomplete="off" placeholder="请输入数字"></el-input>
  26. </el-form-item>
  27. </el-form>
  28. <div slot="footer" class="dialog-footer">
  29. <el-button size="medium" @click="editDialog = false">取消</el-button>
  30. <el-button size="medium" type="primary" @click="editDialog = false">确定</el-button>
  31. </div>
  32. </el-dialog>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. tableData: [{
  40. id: 1,
  41. name: '后端',
  42. slug: 'houduan',
  43. sort: 10,
  44. children: [{
  45. id: 3,
  46. name: 'PHP',
  47. slug: 'php',
  48. sort: 1
  49. }, {
  50. id: 4,
  51. name: 'JS',
  52. slug: 'js',
  53. sort: 2
  54. }]
  55. }],
  56. editDialog: false,
  57. labelPosition: 'right',
  58. form: {
  59. name: '',
  60. slug: '',
  61. sort: ''
  62. }
  63. }
  64. },
  65. computed: {
  66. },
  67. mounted() {
  68. // this.getFinanceList();
  69. },
  70. methods: {
  71. // // 获取列表数据
  72. // async getFinanceList() {
  73. // let body = {
  74. // page: this.currentPage,
  75. // size: this.currentPageSize,
  76. // user: this.$route.query.user
  77. // };
  78. // const res = await this.$post("/api/admin/user_credit/get_orders", body);
  79. // var data = res.data;
  80. // this.finaceList = data.orders;
  81. // console.log(data.count);
  82. // this.totalCount = Number(data.count.all);
  83. // this.waitCount = Number(data.count.wait);
  84. // this.successCount = Number(data.count.approve);
  85. // this.failCount = Number(data.count.reject);
  86. // },
  87. // async downFinanceList() {
  88. // let body = {
  89. // page: this.currentPage,
  90. // page_size: this.currentPageSize,
  91. // user: this.$route.query.user
  92. // };
  93. // var url =
  94. // window.location.host + "/api/admin/order/export?" + "artificial_mark=1";
  95. // console.log(url);
  96. // window.location.href = "https://" + url;
  97. // },
  98. save() {
  99. console.log(this.tableData);
  100. },
  101. }
  102. };
  103. </script>
  104. <style lang="scss" scoped>
  105. .custom-tree-node {
  106. flex: 1;
  107. display: flex;
  108. align-items: center;
  109. justify-content: space-between;
  110. font-size: 14px;
  111. padding-right: 8px;
  112. }
  113. </style>