cuikaidong
2025-06-12 64931370717723655d4ecec4802dcdc54ec015f5
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<template>
  <a-spin :spinning='load'>
    <a-card :bordered='false'>
      <div>
        <a-table
          ref='table'
          :columns='columns'
          :customRow='clickThenSelect'
          :dataSource='dataSource'
          :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
          bordered
          class='j-table-force-nowrap'
          rowKey='name'
          size='middle'
          :pagination=false
          style='height: 400px; overflow-y: auto;'
        >
        </a-table>
      </div>
    </a-card>
  </a-spin>
</template>
 
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JInput from '@/components/jeecg/JInput'
import JEllipsis from '@/components/jeecg/JEllipsis'
import { getAction } from '@/api/manage'
 
export default {
  name: 'FunctionInformation',
  mixins: [JeecgListMixin],
  components: {
    JDictSelectTag,
    JInput,
    JEllipsis
  },
  created() {
  },
  data() {
    return {
      columns: [
        {
          title: '',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '名称',
          align: 'center',
          dataIndex: 'name'
        },
        {
          title: '描述',
          align: 'center',
          dataIndex: 'describe'
        },
        {
          title: '声明',
          align: 'center',
          dataIndex: 'state'
        },
        {
          title: '数据类型',
          align: 'center',
          dataIndex: 'dataType'
        },
        {
          title: '变量',
          align: 'center',
          dataIndex: 'tag'
        }
      ],
      load: false,
      url: {
        list: '/empty/parameter/function'
      }
    }
  },
  methods: {
    // 查询终端列表
    loadData(arg) {
      if (arg === undefined){
        arg = 'Convert'
      }
      this.onClearSelected()
      var params = this.getQueryParams()//查询条件
      params.functionType = arg
      this.loading = true
      getAction(this.url.list, params).then((res) => {
        if (res.result) {
          this.dataSource = res.result
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
 
    },
    clickThenSelect(record) {
      return {
        on: {
          click: () => {
            this.onSelectChange(record.name.split(','), [record])
          }
        }
      }
    },
    onSelectChange(selectedRowKeys, selectionRows) {
      this.selectedRowKeys = selectedRowKeys
      // 调用父组件方法存储参数
      this.$emit('ok', selectionRows)
    },
    modalFormOk(val) {
      // 调用父组件方法
      this.$emit('tree')
      // 新增/修改 成功时,重载列表
      this.loadData()
      this.selectedRowKeys = [val.id]
    },
    searchQuery() {
      this.loadData()
      this.onClearSelected()
    },
    searchReset() {
      this.queryParam = {}
      this.loadData()
      this.onClearSelected()
    },
    handleEdit(record) {
      this.$refs.modalForm.edit(record)
      this.$refs.modalForm.title = '编辑'
      this.$refs.modalForm.disableSubmit = false
    }
  }
}
</script>
<style scoped>
.ant-table-row {
  height: 50px;
}
</style>