¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ åç¼ç "> |
| | | <a-input placeholder="请è¾å
¥æ åç¼ç " v-model="queryParam.standardCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ ååç§°"> |
| | | <a-input placeholder="请è¾å
¥æ ååç§°" v-model="queryParam.standardName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç¼å·" v-model="queryParam.equipmentCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä¿å
»åç±»"> |
| | | <a-input placeholder="请è¾å
¥ä¿å
»åç±»" v-model="queryParam.maintenanceCategory"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a @click="handleToggleSearch" style="margin-left: 8px"> |
| | | {{ toggleSearchStatus ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('ä¿å
»æ å')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" |
| | | @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"> |
| | | <a-icon type="delete" /> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a |
| | | style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'EamMaintenanceStandardList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamMaintenanceStandardModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'ä¿å
»æ å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ åç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'standardCode' |
| | | }, |
| | | { |
| | | title: 'æ ååç§°', |
| | | align: 'center', |
| | | dataIndex: 'standardName' |
| | | }, |
| | | { |
| | | title: 'ä¿å
»å¨æ', |
| | | align: 'center', |
| | | dataIndex: 'maintenancePeriod' |
| | | }, |
| | | { |
| | | title: 'ä¿å
»åç±»', |
| | | align: 'center', |
| | | dataIndex: 'maintenanceCategory' |
| | | }, |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentCode' |
| | | }, |
| | | { |
| | | title: 'æ åç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'standardStatus' |
| | | }, |
| | | { |
| | | title: 'æ åçæ¬', |
| | | align: 'center', |
| | | dataIndex: 'standardVersion' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/eam/maintenanceStandard/list', |
| | | delete: '/eam/maintenanceStandard/delete', |
| | | deleteBatch: '/eam/maintenanceStandard/deleteBatch', |
| | | exportXlsUrl: 'eam/maintenanceStandard/exportXls', |
| | | importExcelUrl: 'eam/maintenanceStandard/importExcel' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="1200" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="æ åç¼ç "> |
| | | <a-input placeholder="ç¼ç ç³»ç»èªå¨çæ" v-model="model.standardCode" disabled /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="æ ååç§°"> |
| | | <a-input placeholder="请è¾å
¥æ ååç§°" v-model="model.standardName" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceCategory" label="ä¿å
»åç±»"> |
| | | <j-dict-select-tag dict-code="maintenance_category" placeholder="è¯·éæ©ä¿å
»åç±»" v-model="model.maintenanceCategory" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileCode" label="æä»¶ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥ä¿å
»æ åæä»¶ç¼å·" v-model="model.fileCode"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialDate" label="åå§æ¥æ"> |
| | | <a-date-picker placeholder="è¯·éæ©åå§æ¥æ" v-model="model.initialDate" format="yyyy-MM-dd" style="width: 100%"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="ä¿å
»å¨æ"> |
| | | <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" style="width: 100%"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设å¤ç¼å·"> |
| | | <lx-search-equipment-select placeholder="请è¾å
¥è®¾å¤ç¼å·æåç§°æç´¢" v-model="model.equipmentId"></lx-search-equipment-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardStatus" label="æ åç¶æ"> |
| | | <j-dict-select-tag dict-code="maintenance_standard_status" v-model="model.standardStatus" disabled/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardVersion" label="æ åçæ¬"> |
| | | <a-input-number v-model="model.standardVersion" style="width: 100%" disabled/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item |
| | | label="åèæä»¶" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="fileList"> |
| | | <lx-upload :returnUrl="false" |
| | | :isMultiple="false" |
| | | v-model="model.fileList" |
| | | biz="EamMaintenanceStandard"> |
| | | </lx-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :bordered="true" |
| | | :alwaysEdit="true" |
| | | :toolbar="true" |
| | | :toolbarConfig="detail.toolbarConfig" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;"/> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect' |
| | | |
| | | export default { |
| | | name: "EamMaintenanceStandardModal", |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | LxSearchEquipmentSelect, |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | standardName: [ |
| | | { required: true, message: '请è¾å
¥æ ååç§°!' } |
| | | ], |
| | | maintenanceCategory: [ |
| | | { required: true, message: 'è¯·éæ©ä¿å
»åç±»!' } |
| | | ], |
| | | initialDate: [ |
| | | { required: true, message: 'è¯·éæ©åå§æ¥æ!' } |
| | | ], |
| | | maintenancePeriod: [ |
| | | { required: true, message: '请è¾å
¥ä¿å
»å¨æï¼åä½ï¼å¤©!' } |
| | | ], |
| | | equipmentId: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/maintenanceStandard/add", |
| | | edit: "/eam/maintenanceStandard/edit", |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: 'ID', |
| | | key: 'id', |
| | | type: JVXETypes.hidden, |
| | | }, |
| | | { |
| | | title: 'standardId', |
| | | key: 'standardId', |
| | | type: JVXETypes.hidden, |
| | | }, |
| | | { |
| | | title: 'åºå·', |
| | | key: 'itemCode', |
| | | type: JVXETypes.inputNumber, |
| | | width: '10%', |
| | | align:"center", |
| | | validateRules: [ |
| | | {required : true, unique: true, message: 'åºå·ä¸è½éå¤'} |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹', |
| | | key: 'itemName', |
| | | type: JVXETypes.textarea, |
| | | width: '20%', |
| | | align:"center", |
| | | validateRules: [ |
| | | {required : true} |
| | | ] |
| | | }, |
| | | { |
| | | title: 'åä¿å
»é¡¹', |
| | | key: 'subItemName', |
| | | type: JVXETypes.textarea, |
| | | width: '25%', |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è¦æ±', |
| | | key: 'itemDemand', |
| | | type: JVXETypes.textarea, |
| | | width: '30%', |
| | | align:"center", |
| | | validateRules: [ |
| | | {required : true} |
| | | ] |
| | | }, |
| | | ], |
| | | toolbarConfig: { |
| | | // prefix åç¼ï¼suffix åç¼ |
| | | slot: ['prefix', 'suffix'], |
| | | // add æ°å¢æé®ï¼remove å 餿é®ï¼clearSelection æ¸
ç©ºéæ©æé® |
| | | btn: ['add', 'remove', 'clearSelection'] |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | //åå§åé»è®¤å¼ |
| | | this.edit({}); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | async handleOk () { |
| | | const that = this; |
| | | let errMap = await that.$refs.editableDetailTable.validateTable(); |
| | | if(errMap){ |
| | | this.$message.warning("æ°æ®æ ¡éªå¤±è´¥ï¼"); |
| | | return; |
| | | } |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | debugger; |
| | | let tableData = that.$refs.editableDetailTable.getTableData(); |
| | | let newData = that.$refs.editableDetailTable.getNewData(); |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData(); |
| | | |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | httpAction(httpurl,this.model,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | that.close(); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | <a-select |
| | | showSearch |
| | | labelInValue |
| | | :disabled="disabled" |
| | | :getPopupContainer="getParentContainer" |
| | | @search="loadData" |
| | | :placeholder="placeholder" |
| | | v-model="selectedAsyncValue" |
| | | style="width: 100%" |
| | | :filterOption="false" |
| | | @change="handleAsyncChange" |
| | | allowClear |
| | | :notFoundContent="loading ? undefined : null" |
| | | :mode="mode" |
| | | > |
| | | <template #suffixIcon> |
| | | <a-icon type="search" /> |
| | | </template> |
| | | <a-spin v-if="loading" slot="notFoundContent" size="small"/> |
| | | <a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option> |
| | | </a-select> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { ajaxGetDictItems,getDictItemsFromCache } from '@/api/api' |
| | | import debounce from 'lodash/debounce'; |
| | | import { getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'LxSearchEquipmentSelect', |
| | | props:{ |
| | | disabled: Boolean, |
| | | value: [String, Number], |
| | | dictOptions: Array, |
| | | placeholder:{ |
| | | type:String, |
| | | default:"è¯·éæ©", |
| | | required:false |
| | | }, |
| | | pageSize:{ |
| | | type: Number, |
| | | default: 20, |
| | | required: false |
| | | }, |
| | | mode:{ |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | }, |
| | | data(){ |
| | | this.loadData = debounce(this.loadData, 800);//æ¶æ |
| | | this.lastLoad = 0; |
| | | return { |
| | | loading:false, |
| | | selectedValue:[], |
| | | selectedAsyncValue:[], |
| | | options: [], |
| | | } |
| | | }, |
| | | created(){ |
| | | this.initDictData(); |
| | | }, |
| | | watch:{ |
| | | "value":{ |
| | | immediate:true, |
| | | handler(val){ |
| | | if(!val){ |
| | | if(val==0){ |
| | | this.initSelectValue() |
| | | }else{ |
| | | this.selectedValue=[] |
| | | this.selectedAsyncValue=[] |
| | | } |
| | | }else{ |
| | | this.initSelectValue() |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | methods:{ |
| | | initSelectValue(){ |
| | | if(!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key!=this.value){ |
| | | console.log("è¿æè¯·æ±åå°") |
| | | //update-begin-author:taoyan date:20220112 for: æ¹æ³initSelectValue æ ¹æ®ä¸ææ¡å®é
弿¥è¯¢ä¸ææ¡çæ¾ç¤ºçææ¬ å åå°æ¥å£åªå¤ç3ä¸ªåæ°ï¼æä»¥å°è¿æ»¤æ¡ä»¶å»æ |
| | | // TODO 鿣 æ¥è¯¢æçé®é¢ è¿æ¯åºè¯¥å¨åå°ä½çé |
| | | let itemDictStr = this.dict |
| | | let arr = itemDictStr.split(',') |
| | | if(arr && arr.length==4){ |
| | | // å 餿åä¸ä¸ªå
ç´ |
| | | arr.pop(); |
| | | itemDictStr = arr.join(',') |
| | | } |
| | | //update-end-author:taoyan date:20220112 for: æ¹æ³initSelectValue æ ¹æ®ä¸ææ¡å®é
弿¥è¯¢ä¸ææ¡çæ¾ç¤ºçææ¬ å åå°æ¥å£åªå¤ç3ä¸ªåæ°ï¼æä»¥å°è¿æ»¤æ¡ä»¶å»æ |
| | | getAction(`/eam/equipment/asyncLoadEquipment`,{key:this.value}).then(res=>{ |
| | | if(res.success){ |
| | | //update-begin---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | //夿æ¯å¦å¤é |
| | | if(this.mode === 'multiple'){ |
| | | if(res.result && res.result.length>0){ |
| | | let itemArray = []; |
| | | let valueArray = this.value.split(",") |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | itemArray.push({ |
| | | key:valueArray[i], |
| | | label:res.result[i] |
| | | }) |
| | | } |
| | | this.selectedAsyncValue = itemArray |
| | | }else{ |
| | | this.selectedAsyncValue = [] |
| | | this.selectedValue = [] |
| | | } |
| | | }else{ |
| | | let obj = { |
| | | key:this.value, |
| | | label:res.result |
| | | } |
| | | this.selectedAsyncValue = {...obj} |
| | | } |
| | | //update-end---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é-------------- |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | loadData(value){ |
| | | console.log("æ°æ®å è½½",value) |
| | | this.lastLoad +=1 |
| | | const currentLoad = this.lastLoad |
| | | this.options = [] |
| | | this.loading=true |
| | | // åå
¸codeæ ¼å¼ï¼table,text,code |
| | | getAction(`/eam/equipment/asyncLoadEquipment`,{keyword:value, pageSize: this.pageSize}).then(res=>{ |
| | | this.loading=false |
| | | if(res.success){ |
| | | if(currentLoad!=this.lastLoad){ |
| | | return |
| | | } |
| | | this.options = res.result |
| | | console.log("ææ¯ç¬¬ä¸ä¸ª",res) |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | } |
| | | |
| | | }) |
| | | |
| | | }, |
| | | initDictData(){ |
| | | //弿¥ä¸å¼å§ä¹å è½½ä¸ç¹æ°æ® |
| | | this.loading=true |
| | | getAction(`/eam/equipment/asyncLoadEquipment`,{pageSize: this.pageSize, keyword:''}).then(res=>{ |
| | | this.loading=false |
| | | if(res.success){ |
| | | this.options = res.result |
| | | }else{ |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | }, |
| | | handleChange (selectedValue) { |
| | | console.log("selectedValue",selectedValue) |
| | | this.selectedValue = selectedValue |
| | | this.callback() |
| | | }, |
| | | handleAsyncChange(selectedObj){ |
| | | //update-begin-author:scott date:20201222 for:ãæç´¢ãæç´¢æ¥è¯¢ç»ä»¶ï¼å 餿¡ä»¶ï¼é»è®¤ä¸æè¿æ¯ä¸æ¬¡çç¼åæ°æ®ï¼ä¸å¥½ JT-191 |
| | | if(selectedObj){ |
| | | this.selectedAsyncValue = selectedObj |
| | | //update-begin---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | if(this.mode ==='multiple'){ |
| | | let keyArray = [] |
| | | for (let i = 0; i < selectedObj.length; i++) { |
| | | keyArray.push(selectedObj[i].key) |
| | | } |
| | | this.selectedValue = keyArray |
| | | }else{ |
| | | this.selectedValue = selectedObj.key |
| | | } |
| | | //update-end---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | }else{ |
| | | this.selectedAsyncValue = null |
| | | this.selectedValue = null |
| | | this.options = null |
| | | this.loadData("") |
| | | } |
| | | this.callback() |
| | | //update-end-author:scott date:20201222 for:ãæç´¢ãæç´¢æ¥è¯¢ç»ä»¶ï¼å 餿¡ä»¶ï¼é»è®¤ä¸æè¿æ¯ä¸æ¬¡çç¼åæ°æ®ï¼ä¸å¥½ JT-191 |
| | | }, |
| | | callback(){ |
| | | //update-begin---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | if(this.mode === 'multiple'){ |
| | | this.$emit('change', this.selectedValue.join(",")); |
| | | }else{ |
| | | this.$emit('change', this.selectedValue); |
| | | } |
| | | //update-end---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | }, |
| | | getParentContainer(node){ |
| | | if(typeof this.getPopupContainer === 'function'){ |
| | | return this.getPopupContainer(node) |
| | | } else if(!this.popContainer){ |
| | | return node.parentNode |
| | | }else{ |
| | | return document.querySelector(this.popContainer) |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | model: { |
| | | prop: 'value', |
| | | event: 'change' |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |