¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button v-if="queryParam.equipmentId" @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <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 @click="handlePreview(record)">é¢è§</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®ä¸è½½æä»¶å?" @confirm="() => handleDownload(record)"> |
| | | <a>ä¸è½½</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <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 --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <eamEquipmentAttachment-modal ref="modalForm" @ok="modalFormOk" :equipmentId="queryParam.equipmentId"></eamEquipmentAttachment-modal> |
| | | <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import EamEquipmentAttachmentModal from './modules/EamEquipmentAttachmentModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { downFile } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'EamEquipmentAttachmentList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamEquipmentAttachmentModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'è®¾å¤ææ¡£å°è´¦ä½¿ç¨ç®¡ç页é¢', |
| | | disableMixinCreated: true, |
| | | fileUrl: '', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'æä»¶å å¯å', |
| | | align: 'center', |
| | | dataIndex: 'fileEncodeName', |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | align: 'center', |
| | | dataIndex: 'fileName', |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æä»¶è·¯å¾', |
| | | align: 'center', |
| | | dataIndex: 'filePath', |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æä»¶åç¼å', |
| | | align: 'center', |
| | | dataIndex: 'fileSuffix' |
| | | }, |
| | | { |
| | | title: 'æä»¶å¤§å°', |
| | | align: 'center', |
| | | dataIndex: 'fileSize' |
| | | }, |
| | | { |
| | | title: 'æè¿°', |
| | | align: 'center', |
| | | dataIndex: 'description', |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/eam/equipmentAttachment/list', |
| | | delete: '/eam/equipmentAttachment/delete', |
| | | deleteBatch: '/eam/equipmentAttachment/deleteBatch', |
| | | download: '/eam/equipmentAttachment/downloadFile', |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: { |
| | | handleDownload(record) { |
| | | downFile(this.url.download, { id: record.id }).then((res) => { |
| | | if (!res) { |
| | | this.$message.warning('æä»¶ä¸è½½å¤±è´¥') |
| | | return |
| | | } else { |
| | | let fileName = record.fileName; |
| | | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
| | | window.navigator.msSaveBlob(new Blob([res]), fileName); |
| | | } else { |
| | | let url = window.URL.createObjectURL(new Blob([res])); |
| | | let link = document.createElement('a'); |
| | | link.style.display = 'none'; |
| | | link.href = url; |
| | | link.setAttribute('download', fileName); |
| | | document.body.appendChild(link); |
| | | link.click() |
| | | document.body.removeChild(link) //ä¸è½½å®æç§»é¤å
ç´ |
| | | window.URL.revokeObjectURL(url) //éæ¾æblob对象 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | handlePreview: function (record) { |
| | | this.$refs.lxFilePreview.preview(record.filePath); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <!-- tableåºå-end --> |
| | | |
| | | <a-tabs v-model="activeTabKey" @change="handleTabChange"> |
| | | <a-tab-pane tab="è®¾å¤ææ¡£" :key="1">è®¾å¤ææ¡£</a-tab-pane> |
| | | <a-tab-pane tab="è®¾å¤ææ¡£" :key="1"> |
| | | <eam-equipment-attachment-list ref="tabPaneTableListRef1" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="ç¹æ£å·¥å" :key="2"> |
| | | <eam-inspection-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/> |
| | | </a-tab-pane> |
| | |
| | | import EamMaintenanceStandardList from '@views/eam/base/EamMaintenanceStandardList.vue' |
| | | import EamRepairOrderList from '../repair/EamRepairOrderList' |
| | | import EamInspectionOrderList from '../maintenance/EamInspectionOrderList' |
| | | import EamEquipmentAttachmentList from '@views/eam/equipment/EamEquipmentAttachmentList.vue' |
| | | |
| | | export default { |
| | | name: 'EamEquipmentList', |
| | |
| | | EamMaintenanceStandardList, |
| | | ResumeDrawer, |
| | | NameplateModal, |
| | | EamEquipmentModal |
| | | EamEquipmentModal, |
| | | EamEquipmentAttachmentList |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectionRows = selectionRows |
| | | this.$refs['tabPaneTableListRef' + this.activeTabKey].queryParam.equipmentId = null; |
| | | this.$refs['tabPaneTableListRef' + this.activeTabKey].dataSource = [] |
| | | this.$refs['tabPaneTableListRef' + this.activeTabKey].onClearSelected() |
| | | if (selectedRowKeys.length === 1) this.loadTabPaneTableData(selectedRowKeys[0]) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-form-model-item |
| | | label="ä¸ä¼ " |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | v-if="!editable" |
| | | prop="fileList"> |
| | | <lx-upload :returnUrl="false" |
| | | :isMultiple="false" |
| | | v-model="model.fileList" |
| | | biz="test"> |
| | | </lx-upload> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileName" label="æä»¶åç§°" v-if="editable"> |
| | | <a-input placeholder="请è¾å
¥æä»¶åç§°" v-model="model.fileName" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description" label="æè¿°"> |
| | | <a-textarea placeholder="请è¾å
¥æè¿°" v-model="model.description" /> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: "EamEquipmentAttachmentModal", |
| | | props: { |
| | | equipmentId: { |
| | | type: String, |
| | | required: true, |
| | | default: '-1' |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules:{ |
| | | fileName: [ |
| | | { required: true, message: '请è¾å
¥æä»¶åç§°!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/equipmentAttachment/add", |
| | | edit: "/eam/equipmentAttachment/edit", |
| | | }, |
| | | editable: false, |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.editable = false; |
| | | //åå§åé»è®¤å¼ |
| | | this.model = {}; |
| | | this.visible = true |
| | | }, |
| | | edit (record) { |
| | | this.editable = true; |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | that.model.equipmentId = that.equipmentId; |
| | | httpAction(httpurl, that.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> |