文件名从 src/views/facilityManagement/InstrumentationInformation/component/Dailog.vue 修改 |
| | |
| | | <el-table-column align="center" sortable prop="address" label="巡检人" /> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="保养维修标准" name="six" v-if="Dailogtype"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | multiple |
| | | :on-preview="handlePreview" |
| | | :on-remove="handleRemove" |
| | | :before-remove="beforeRemove" |
| | | :limit="3" |
| | | :on-exceed="handleExceed" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"></div> |
| | | </template> |
| | | </el-upload> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | |
| | | import repairDailog from './repairDailog.vue'; |
| | | import standardDailog from './standardDailog.vue'; |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus'; |
| | | export default defineComponent({ |
| | | components: { categoryDailog, regionDailog, DailogSearchUser, maintenanceDailog, detectDailog, repairDailog, standardDailog }, |
| | | setup() { |
| | |
| | | resource: '', |
| | | desc: '', |
| | | }); |
| | | const openDailog = () => { |
| | | const Dailogtype=ref(false) |
| | | const openDailog = (type:boolean) => { |
| | | dialogVisible.value = true; |
| | | Dailogtype.value=type |
| | | }; |
| | | const activeName = ref('first'); |
| | | const tableData = [ |
| | |
| | | const openStandard = () => { |
| | | standardShow.value.openDailog(); |
| | | }; |
| | | // 上传 |
| | | const fileList = ref<UploadUserFile[]>([ |
| | | { |
| | | name: 'element-plus-logo.svg', |
| | | url: 'https://element-plus.org/images/element-plus-logo.svg', |
| | | }, |
| | | { |
| | | name: 'element-plus-logo2.svg', |
| | | url: 'https://element-plus.org/images/element-plus-logo.svg', |
| | | }, |
| | | ]); |
| | | |
| | | const handleRemove: UploadProps['onRemove'] = (file, uploadFiles) => { |
| | | console.log(file, uploadFiles); |
| | | }; |
| | | |
| | | const handlePreview: UploadProps['onPreview'] = (uploadFile) => { |
| | | console.log(uploadFile); |
| | | }; |
| | | |
| | | const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { |
| | | ElMessage.warning(`The limit is 3, you selected ${files.length} files this time, add up to ${files.length + uploadFiles.length} totally`); |
| | | }; |
| | | |
| | | const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { |
| | | return ElMessageBox.confirm(`Cancel the transfert of ${uploadFile.name} ?`).then( |
| | | () => true, |
| | | () => false |
| | | ); |
| | | }; |
| | | return { |
| | | dialogVisible, |
| | | Dailogtype, |
| | | form, |
| | | openDailog, |
| | | Search, |
| | |
| | | openRepair, |
| | | standardShow, |
| | | openStandard, |
| | | fileList, |
| | | handleRemove, |
| | | handlePreview, |
| | | handleExceed, |
| | | beforeRemove |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .el-form-item{ |
| | | width: 400px; |
| | | .el-form-item { |
| | | width: 400px; |
| | | } |
| | | .formType:after{ |
| | | content: ''; |
| | | width: 250px; |
| | | } |
| | | .formType{ |
| | | padding:20px 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | .formType:after { |
| | | content: ''; |
| | | width: 250px; |
| | | } |
| | | .formType { |
| | | padding: 20px 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | } |
| | | </style> |