zenglf
2023-09-28 997835429a1d66643364091e8437ebbbeb8ff97a
src/views/mdc/base/MdcDriveTypeParamConfigList.vue
@@ -14,10 +14,15 @@
            :sm="24"
          >
            <a-form-item label="控制系统类型">
              <j-dict-select-tag
                placeholder="请选择控制系统类型"
              <!--<j-dict-select-tag-->
                <!--placeholder="请选择控制系统类型"-->
                <!--v-model="queryParam.controlSystemType"-->
              <!--/>-->
              <a-auto-complete
                v-model="queryParam.controlSystemType"
                dictCode="mdc_driveType"
                :data-source="driveTypeList"
                placeholder="请选择控制系统类型"
                :filter-option="filterOption"
              />
            </a-form-item>
          </a-col>
@@ -55,11 +60,15 @@
              :sm="24"
            >
              <a-form-item label="显示标志">
                <j-switch
                  placeholder="请选择显示标志"
                  v-model="queryParam.showFlag"
                  query
                ></j-switch>
                <!--<j-switch-->
                  <!--placeholder="请选择显示标志"-->
                  <!--v-model="queryParam.showFlag"-->
                  <!--query-->
                <!--&gt;</j-switch>-->
                <a-select v-model='queryParam.showFlag' placeholder="请选择显示标志">
                  <a-select-option  value="Y">是</a-select-option>
                  <a-select-option value="N">否</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col
@@ -69,11 +78,15 @@
              :sm="24"
            >
              <a-form-item label="工作曲线标志">
                <j-switch
                  placeholder="请选择工作曲线标志"
                  v-model="queryParam.curveGenerationFlags"
                  query
                ></j-switch>
                <!--<j-switch-->
                  <!--placeholder="请选择工作曲线标志"-->
                  <!--v-model="queryParam.curveGenerationFlags"-->
                  <!--query-->
                <!--&gt;</j-switch>-->
                <a-select v-model='queryParam.curveGenerationFlags' placeholder="请选择工作曲线标志">
                  <a-select-option  value="Y">是</a-select-option>
                  <a-select-option value="N">否</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </template>
@@ -122,7 +135,7 @@
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('设备驱动参数配置')"
        @click="handleExportXls('驱动参数管理')"
      >导出</a-button>
      <a-upload
        name="file"
@@ -261,6 +274,7 @@
    <mdc-drive-type-param-config-modal
      ref="modalForm"
      @ok="modalFormOk"
      :driveTypeList="driveTypeList"
    ></mdc-drive-type-param-config-modal>
  </a-card>
</template>
@@ -273,6 +287,7 @@
import MdcDriveTypeParamConfigModal from './modules/mdcDriveTypeParamConfig/MdcDriveTypeParamConfigModal'
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
import api from '@/api/mdc'
export default {
  name: 'MdcDriveTypeParamConfigList',
  mixins: [JeecgListMixin, mixinDevice],
@@ -345,16 +360,22 @@
        deleteBatch: "/mdc/mdcDriveTypeParamConfig/deleteBatch",
        exportXlsUrl: "/mdc/mdcDriveTypeParamConfig/exportXls",
        importExcelUrl: "mdc/mdcDriveTypeParamConfig/importExcel",
      },
      dictOptions: {},
      superFieldList: [],
      driveTypeList:[]
    }
  },
  provide(){
    return {
      driveTypeList:this.driveTypeList
    }
  },
  created() {
    this.$set(this.dictOptions, 'showFlag', [{ text: '是', value: 'Y' }, { text: '否', value: 'N' }])
    this.$set(this.dictOptions, 'curveGenerationFlags', [{ text: '是', value: 'Y' }, { text: '否', value: 'N' }])
    this.getSuperFieldList();
    this.getDriveTypeByApi()
  },
  computed: {
    importExcelUrl: function () {
@@ -372,7 +393,6 @@
      fieldList.push({ type: 'int', value: 'sortNo', text: '序号', dictCode: '' })
      fieldList.push({ type: 'switch', value: 'showFlag', text: '显示标志' })
      fieldList.push({ type: 'switch', value: 'curveGenerationFlags', text: '工作曲线标志' })
      this.superFieldList = fieldList
    },
@@ -389,6 +409,25 @@
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    /**
     * 调用接口获取控制系统类型
     */
    getDriveTypeByApi(){
      api.getDriveTypeApi().then((res)=>{
        this.driveTypeList=res.result.map(item=>item.value)
      })
    },
    /**
     * 联想输入框筛选功能
     * @param input 输入的内容
     * @param option 配置
     * @returns {boolean} 判断是否筛选
     */
    filterOption(input, option) {
      return (
        option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
      );
    },
  }
}