src/views/system/modules/SelectDeviceDrawer.vue
@@ -8,15 +8,24 @@
  >
    <a-spin :spinning="loading">
      <!-- showLine -->
      <a-form>
        <a-form-item>
          <a-input-search @search="handleSearch" style="width:100%;" placeholder="检索 类别编码/名称" allowClear
                          v-model="searchInput" @change="handleChange"/>
        </a-form-item>
        <a-form-item label="车间层级:">
      <div class="content-container">
        <a-form>
          <a-form-item>
            <a-input-search @search="handleSearch" style="width:100%;" placeholder="检索 类别编码/名称" allowClear
                            v-model="searchInput" @change="handleChange"/>
          </a-form-item>
          <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
            <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{
            checkedKeys.length }}</a>项&nbsp;&nbsp;
            <a style="margin-left: 24px" @click="checkedKeys=[]">清空</a>
          </div>
        </a-form>
        <div>
          <a-tree showLine ref="tree" :expandedKeys.sync="expandedKeys" :autoExpandParent="autoExpandParent"
                  :treeData="treeDataSource" checkable @check="onCheck" v-model="checkedKeys"
                  @select="handleSelectChange"
                  @expand="onExpand">
            <template slot="title" slot-scope="{ title, parentId, entity, key}">
              <span v-if="title.indexOf(searchValue) > -1">{{ title.substr(0, title.indexOf(searchValue)) }}
@@ -26,9 +35,8 @@
              <span v-else>{{ title }}</span>
            </template>
          </a-tree>
        </a-form-item>
      </a-form>
        </div>
      </div>
    </a-spin>
@@ -227,11 +235,20 @@
      refreshTree() {
        this.queryTreeData()
      },
      /**
       * 节点被选中时触发(点击名称)
       * @param selectedKeys 选中的节点key集合
       * @param event 事件对象
       */
      handleSelectChange(selectedKeys, event) {
        event.node.$el.childNodes[1].click()
      },
      onCheck(value, obj) {
        this.checkedKeys = value
        console.log('obj,', obj)
        this.deviceNodes = obj.checkedNodes.filter(item => item.data.props.equipmentId).map(item => item.data.props.equipmentId)
        console.log(this.deviceNodes)
      },
      handleCancel() {
        this.visible = false