houshuai
2025-07-03 6bbceeae0a692ef60f429dbca889752fcb09ec9a
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
<template>
  <!-- 定义在这里的参数都是不可在外部覆盖的,防止出现问题 -->
  <j-select-biz-component
    :value="value"
    :ellipsisLength="25"
    :listUrl="url.list"
    :columns="columns"
    v-on="$listeners"
    v-bind="attrs"
  />
</template>
 
<script>
  import JDate from '@comp/jeecg/JDate'
  import JSelectBizComponent from '../../../../components/jeecgbiz/JSelectBizComponent'
 
  export default {
    name: 'JSelectMultiInspectionTools',
    components: {JDate, JSelectBizComponent},
    props: {
      value: null, // any type
      queryConfig: {
        type: Array,
        default: () => []
      },
    },
    data() {
      return {
        url: { list: '/qms/inspectionTools/list' },
        columns: [
          { title: '工具编码', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'toolCode' },
          { title: '工具名称', align: 'center', width: '25%', dataIndex: 'toolName' },
          { title: '工具状态', align: 'center', width: '20%', dataIndex: 'toolStatus' },
          { title: '备注', align: 'center', width: '20%', dataIndex: 'remark' }
        ],
        // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
        default: {
          name: '工具',
          width: 1200,
          displayKey: 'toolCode',
          returnKeys: ['id', 'toolName'],
          queryParamText: '工具编码',
        },
        // 多条件查询配置
        queryConfigDefault: [
          {
            key: 'toolName',
            label: '检验工具名称',
          },
        ],
      }
    },
    computed: {
      attrs() {
        return Object.assign(this.default, this.$attrs, {
          queryConfig: this.queryConfigDefault.concat(this.queryConfig)
        })
      }
    }
  }
</script>
 
<style lang="less" scoped></style>