index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <el-card class="box-card">
  3. <test v-model="formData" :form-config="formConfig" :labelWidth="60" :clearable="false" :disabled="false" :label-width="100" :span="2">
  4. <template v-slot:testSlot>
  5. {{ '测试插槽' }}
  6. </template>
  7. </test>
  8. </el-card>
  9. </template>
  10. <script>
  11. import * as API from '@/api/Internet-of-things/Industry-management.js'
  12. import test from '@/components/form-test'
  13. export default {
  14. name: 'Industry-management',
  15. components: { test },
  16. data() {
  17. return {
  18. formData: {
  19. pageNum: 1,
  20. pageSize: 10,
  21. keyword: '',
  22. },
  23. formConfig: {
  24. keyword: {
  25. label: '关键字',
  26. span: 6,
  27. },
  28. operation: {
  29. // 搜索按钮操作
  30. query: () => {
  31. this.formData.pageNum = 1
  32. this.getList()
  33. },
  34. // 重置按钮操作
  35. reset: () => {
  36. this.formData = { pageNum: 1, pageSize: 10, keyword: '' }
  37. this.formData.pageNum = 1
  38. this.getList()
  39. },
  40. },
  41. otherButton: [
  42. {
  43. name: '新建行业',
  44. methodsText: 'add',
  45. add: () => {
  46. this.handleAdd()
  47. },
  48. },
  49. ],
  50. },
  51. }
  52. },
  53. created() {},
  54. mounted() {
  55. this.getList()
  56. },
  57. methods: {
  58. getList() {
  59. this.loading = true
  60. API.tdaApplicationPage(this.formData).then(
  61. (res) => {
  62. console.log(res)
  63. this.loading = false
  64. },
  65. (err) => {
  66. console.log('tdaApplicationPage: ' + err)
  67. this.loading = false
  68. },
  69. )
  70. },
  71. handleAdd() {
  72. console.log('add')
  73. },
  74. },
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. * {
  79. font-size: 12px;
  80. }
  81. .box-card {
  82. height: calc(100vh - 110px);
  83. overflow-y: auto;
  84. }
  85. .searchBtn {
  86. background: #20b2aa;
  87. color: #fff;
  88. border: 1px solid #20b2aa;
  89. }
  90. ::v-deep {
  91. .el-input__inner {
  92. border-radius: 1px;
  93. }
  94. .el-button--mini {
  95. border-radius: 1px;
  96. }
  97. .tableHeader th {
  98. background-color: #edf0f5;
  99. height: 35px;
  100. padding: 0;
  101. }
  102. }
  103. </style>