cloudroam
2025-03-28 cef2bb0eeeb91a22860cf5d23c7348af1ba921dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
  <div class="custom-crud-page">
    <el-bus-crud ref="crud" v-bind="tableConfig"></el-bus-crud>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      tableConfig: {
        url: 'flower/api/code/value',
        newUrl: 'flower/api/code/value/add',
        editUrl: 'flower/api/code/value/edit',
        deleteUrl: 'flower/api/code/value/delete',
        extraQuery: {
          type: this.$route.params.id,
        },
        extraBody: {
          typeCode: this.$route.params.id,
        },
        hasPagination: false,
        columns: [
          { label: '序号', type: 'index' },
          { label: '类型', prop: 'typeCode' },
          { label: '数据值', prop: 'value' },
          { label: '标签名', prop: 'label' },
          { label: '描述', prop: 'description' },
          { label: '更新时间', prop: 'updatedDate' },
        ],
        form: [
          {
            label: '类型:',
            id: 'typeCode',
            type: 'input',
            readonly: true,
            default: this.$route.params.id,
          },
          {
            label: '数据值:',
            id: 'value',
            type: 'input',
            rules: { required: true, message: '请输入数据值', trigger: 'blur' },
          },
          {
            label: '标签名:',
            id: 'label',
            type: 'input',
            rules: { required: true, message: '请输入标签名', trigger: 'blur' },
          },
          {
            label: '描述:',
            id: 'description',
            type: 'input',
            el: {
              type: 'textarea',
              rows: '6',
            },
          },
        ],
      },
    }
  },
  head() {
    return {
      title: '字典项',
    }
  },
}
</script>
 
<style scoped lang="scss">
.el-bus-crud {
  padding-top: 20px;
}
</style>