This commit is contained in:
parent
1ae12a2609
commit
6c5a60748d
|
|
@ -137,6 +137,7 @@
|
|||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>数量</th>
|
||||
<th>使用到期时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -147,6 +148,11 @@
|
|||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
<td>{{item.devNum}}</td>
|
||||
<td>
|
||||
{{ item.useStartTime ? item.useStartTime : '-' }}
|
||||
至
|
||||
{{ item.useEndTime ? item.useEndTime : '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -140,6 +140,8 @@
|
|||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>数量</th>
|
||||
<th>最大使用年限</th>
|
||||
<th>剩余使用年限</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -150,6 +152,8 @@
|
|||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
<td>{{item.devNum}}</td>
|
||||
<td>{{item.maxWorkingHours}}</td>
|
||||
<td>{{item.remainingHours}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@
|
|||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>数量</th>
|
||||
<th>使用到期时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -134,6 +135,11 @@
|
|||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
<td>{{item.devNum}}</td>
|
||||
<td>
|
||||
{{ item.useStartTime ? item.useStartTime : '-' }}
|
||||
至
|
||||
{{ item.useEndTime ? item.useEndTime : '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@
|
|||
<el-table-column align="center" prop="feature1" label="特征项1"/>
|
||||
<el-table-column align="center" prop="featureValue1" label="特征值1"/>
|
||||
|
||||
<el-table-column align="center" label="操作" :width="220">
|
||||
<el-table-column align="center" label="操作" :width="199" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-popconfirm
|
||||
width="220"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
||||
<el-form-item label="厂家编号" prop="supplierCode">
|
||||
<el-input
|
||||
v-model="queryParams.supplierCode"
|
||||
|
|
@ -41,45 +41,49 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 120px;">
|
||||
<el-form-item label="状态" prop="status" >
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 215px;">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="停用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-form-item style="margin-left: 10px">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['machinery:type:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
<div class="action-bar">
|
||||
<el-row :gutter="10" style="margin-bottom: 10px">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['machinery:type:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="supplierId">
|
||||
|
|
@ -772,7 +776,7 @@
|
|||
},
|
||||
|
||||
handleExport() {
|
||||
this.download('/material/wh_house_info/export', {
|
||||
this.download('/material-mall/ma_supplier_info/export', {
|
||||
...this.queryParams
|
||||
}, `仓库管理_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
|
@ -866,4 +870,13 @@
|
|||
color: #fff;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
/* 新增:统一的操作栏容器样式,用于将所有按钮和工具栏放在右侧 */
|
||||
.action-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end !important; /* 关键:整体内容靠右对齐 */
|
||||
gap: 10px; /* 统一设置内部元素的间距 */
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
<el-form-item label="工具编码" prop="toolCode">
|
||||
<el-input
|
||||
v-model="queryParams.toolCode"
|
||||
placeholder="请输入规格型号"
|
||||
placeholder="请输入工具编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
style="width: 240px"
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
</el-form-item>
|
||||
|
||||
<!-- 表单按钮 -->
|
||||
<el-form-item style="margin-left:1100px">
|
||||
<el-form-item style="margin-left: 1100px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
<el-form-item label="施工类型" prop="greatGrandparentName">
|
||||
<el-input
|
||||
v-model="dialogForm.greatGrandparentName"
|
||||
placeholder="请输入工具专业"
|
||||
placeholder="请输入施工类型"
|
||||
readonly
|
||||
style="width: 240px"
|
||||
/>
|
||||
|
|
@ -162,19 +162,19 @@
|
|||
<el-form-item label="工具类型" prop="grandparentTypeName">
|
||||
<el-input
|
||||
v-model="dialogForm.grandparentTypeName"
|
||||
placeholder="请输入工具专业"
|
||||
placeholder="请输入工具类型"
|
||||
readonly
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工具名称" prop="parentTypeName">
|
||||
<el-input v-model="dialogForm.parentTypeName" placeholder="请输入工具专业" readonly style="width: 240px" />
|
||||
<el-input v-model="dialogForm.parentTypeName" placeholder="请输入工具名称" readonly style="width: 240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="typeName">
|
||||
<el-input v-model="dialogForm.typeName" placeholder="请输入工具专业" readonly style="width: 240px" />
|
||||
<el-input v-model="dialogForm.typeName" placeholder="请输入规格型号" readonly style="width: 240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工具编码" prop="toolCode">
|
||||
<el-input v-model="dialogForm.toolCode" placeholder="请输入工具专业" readonly style="width: 240px" />
|
||||
<el-input v-model="dialogForm.toolCode" placeholder="请输入工具编码" readonly style="width: 240px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计量单位" prop="unitName">
|
||||
<el-select v-model="dialogForm.unitName" placeholder="请选择计量单位" clearable style="width: 240px">
|
||||
|
|
@ -242,7 +242,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工具状态">
|
||||
<el-input v-model="dialogForm.identifyCode" readonly style="width: 240px" />
|
||||
<el-input v-model="dialogForm.statusName" readonly style="width: 240px" />
|
||||
</el-form-item>
|
||||
<div v-for="(item, index) in dialogForm.propertyVoList" :key="index">
|
||||
<el-form-item label="特征项">
|
||||
|
|
@ -266,15 +266,89 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 附件区域(仅修改这里的图标显示) -->
|
||||
<el-form-item label="附件" prop="fileList">
|
||||
<FileUpload
|
||||
v-model="dialogForm.fileList"
|
||||
:value="dialogForm.fileList"
|
||||
:limit="9"
|
||||
:fileType="['doc', 'xls', 'pdf', 'jpg', 'jpeg', 'png']"
|
||||
:isView="isView"
|
||||
@input="handleImage"
|
||||
/>
|
||||
<div class="custom-file-upload">
|
||||
<el-upload
|
||||
multiple
|
||||
:action="uploadFileUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:file-list="dialogForm.fileList"
|
||||
:limit="9"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
ref="fileUpload"
|
||||
:disabled="isView"
|
||||
>
|
||||
<!-- 上传按钮 -->
|
||||
<el-button size="mini" type="primary">选取文件</el-button>
|
||||
<!-- 上传提示 -->
|
||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||
请上传大小不超过5MB格式为 doc、xls、pdf、jpg、jpeg、png 的文件
|
||||
</div>
|
||||
</el-upload>
|
||||
|
||||
<!-- 文件列表(图标统一靠左) -->
|
||||
<transition-group class="upload-file-list" name="el-fade-in-linear" tag="ul">
|
||||
<li
|
||||
:key="file.uid"
|
||||
class="file-item"
|
||||
v-for="(file, index) in dialogForm.fileList"
|
||||
>
|
||||
<!-- 图标统一靠左 -->
|
||||
<div class="file-icon-container">
|
||||
<img
|
||||
v-if="isPdfFile(file)"
|
||||
src="@/assets/images/pdf.png"
|
||||
class="file-type-icon"
|
||||
alt="PDF文件"
|
||||
/>
|
||||
<img
|
||||
v-else-if="isWordFile(file)"
|
||||
src="@/assets/images/word.png"
|
||||
class="file-type-icon"
|
||||
alt="Word文件"
|
||||
/>
|
||||
<img
|
||||
v-else-if="isExcelFile(file)"
|
||||
src="@/assets/images/pdf.png"
|
||||
class="file-type-icon"
|
||||
alt="Excel文件"
|
||||
/>
|
||||
<img
|
||||
v-else-if="isImageFile(file)"
|
||||
src="@/assets/images/pdf.png"
|
||||
class="file-type-icon"
|
||||
alt="图片文件"
|
||||
/>
|
||||
<i v-else class="el-icon-file file-default-icon"></i>
|
||||
</div>
|
||||
|
||||
<el-link
|
||||
:href="file.url"
|
||||
:underline="false"
|
||||
target="_blank"
|
||||
class="file-name-link"
|
||||
>
|
||||
{{ getFileName(file.name) }}
|
||||
</el-link>
|
||||
|
||||
<div class="file-action">
|
||||
<el-link
|
||||
v-if="!isView"
|
||||
:underline="false"
|
||||
@click.stop="handleDeleteFile(index)"
|
||||
type="danger"
|
||||
>
|
||||
删除
|
||||
</el-link>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
|
@ -289,12 +363,11 @@
|
|||
<script>
|
||||
import { getListCodeApi, getToolSelectApi, updateByIdApi } from '@/api/toolsManage'
|
||||
import { getManufacturerSelectApi } from '@/api/EquipmentLedger'
|
||||
import FileUpload from '@/components/FileUpload'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: 'CodeToolsLedger',
|
||||
dicts: ['dev_unit_type'],
|
||||
components: { FileUpload },
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
|
|
@ -330,21 +403,18 @@ export default {
|
|||
prop: "status",
|
||||
width: 120,
|
||||
render: (h, { row }) => {
|
||||
// 定义状态与 el-tag 属性的映射关系
|
||||
// 这样做比 switch/case 更清晰,也更容易维护
|
||||
const statusOptions = {
|
||||
0: { text: "在库", type: "success" },
|
||||
1: { text: "在用", type: "info" },
|
||||
2: { text: "在修", type: "warning" },
|
||||
3: { text: "已报废", type: "danger" },
|
||||
};
|
||||
// 获取当前状态对应的配置,如果没有则用默认值
|
||||
const option = statusOptions[row.status] || {
|
||||
text: "未知状态",
|
||||
type: "",
|
||||
};
|
||||
return h(
|
||||
"el-tag", // 1. 要创建的组件是 el-tag
|
||||
"el-tag",
|
||||
{
|
||||
props: {
|
||||
type: option.type,
|
||||
|
|
@ -355,7 +425,6 @@ export default {
|
|||
);
|
||||
},
|
||||
},
|
||||
|
||||
{ label: '下次检验时间', prop: 'nextCheckDate' },
|
||||
{ label: '生产厂家', prop: 'supplierName', width: 200 },
|
||||
{ label: '出厂日期', prop: 'productionDate' },
|
||||
|
|
@ -380,10 +449,20 @@ export default {
|
|||
originCost: null,
|
||||
identifyCode: '',
|
||||
nextCheckDate: '',
|
||||
statusName: '',
|
||||
propertyVoList: [],
|
||||
fileList: null,
|
||||
fileList: [], // 初始化文件列表为数组
|
||||
},
|
||||
manufacturerSelect: [],
|
||||
// 上传相关配置(从FileUpload组件迁移)
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', // 上传文件服务器地址
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken()
|
||||
},
|
||||
fileSize: 5, // 文件大小限制(MB)
|
||||
fileType: ['doc', 'xls', 'pdf', 'jpg', 'jpeg', 'png'], // 允许上传的文件类型
|
||||
showTip: true, // 是否显示上传提示
|
||||
number: 0, // 上传文件计数
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -482,34 +561,135 @@ export default {
|
|||
}
|
||||
},
|
||||
handleDialog(row, type) {
|
||||
this.dialogTitle = type ? '编码设备管理' : '编码设备详情'
|
||||
this.dialogTitle = type ? '编码设备详情' : '编码设备编辑'
|
||||
this.isView = type
|
||||
this.dialogVisible = true
|
||||
this.getManufacturerSelect()
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dialogForm.resetFields()
|
||||
this.dialogForm = { ...this.dialogForm, ...row }
|
||||
if (!this.dialogForm.propertyVoList || this.dialogForm.propertyVoList.length == 0) {
|
||||
this.dialogForm.propertyVoList = [
|
||||
{
|
||||
propertyName: '',
|
||||
propertyValue: '',
|
||||
},
|
||||
]
|
||||
// 深拷贝行数据
|
||||
this.dialogForm = { ...this.dialogForm, ...JSON.parse(JSON.stringify(row)) }
|
||||
// 处理状态名称
|
||||
const statusMap = { 0: '在库', 1: '在用', 2: '在修', 3: '已报废' }
|
||||
this.dialogForm.statusName = statusMap[this.dialogForm.status] || '未知状态'
|
||||
// 确保fileList是数组格式
|
||||
if (!Array.isArray(this.dialogForm.fileList)) {
|
||||
this.dialogForm.fileList = this.dialogForm.fileList ?
|
||||
this.dialogForm.fileList.split(',').map(url => ({
|
||||
name: url.split('/').pop(),
|
||||
url: url,
|
||||
uid: new Date().getTime() + Math.random()
|
||||
})) : []
|
||||
} else {
|
||||
// 为数组中的文件添加uid
|
||||
this.dialogForm.fileList = this.dialogForm.fileList.map(file => ({
|
||||
...file,
|
||||
uid: file.uid || new Date().getTime() + Math.random()
|
||||
}))
|
||||
}
|
||||
console.log('🚀 ~ this.dialogForm:', this.dialogForm)
|
||||
})
|
||||
},
|
||||
handleImage(file) {
|
||||
console.log('🚀 ~ file:', file)
|
||||
console.log('🚀 ~ file.url:', this.dialogForm.fileList)
|
||||
// 上传前校检格式和大小(从FileUpload组件迁移)
|
||||
handleBeforeUpload(file) {
|
||||
// 校检文件类型
|
||||
if (this.fileType) {
|
||||
const fileName = file.name.split('.')
|
||||
const fileExt = fileName[fileName.length - 1]
|
||||
const isTypeOk = this.fileType.indexOf(fileExt) >= 0
|
||||
if (!isTypeOk) {
|
||||
this.$message.error(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 校检文件大小
|
||||
if (this.fileSize) {
|
||||
const isLt = file.size / 1024 / 1024 < this.fileSize
|
||||
if (!isLt) {
|
||||
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.number++
|
||||
return true
|
||||
},
|
||||
// 文件个数超出(从FileUpload组件迁移)
|
||||
handleExceed() {
|
||||
this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`)
|
||||
},
|
||||
// 上传失败(从FileUpload组件迁移)
|
||||
handleUploadError(err) {
|
||||
this.$message.error('上传文件失败,请重试')
|
||||
this.number--
|
||||
},
|
||||
// 上传成功回调(从FileUpload组件迁移)
|
||||
handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
const newFile = {
|
||||
name: res.data.url.split('/').pop(),
|
||||
url: res.data.url,
|
||||
uid: file.uid
|
||||
}
|
||||
this.dialogForm.fileList.push(newFile)
|
||||
this.$message.success('文件上传成功')
|
||||
} else {
|
||||
this.$message.error(res.msg || '上传失败')
|
||||
}
|
||||
this.number--
|
||||
},
|
||||
// 删除文件
|
||||
handleDeleteFile(index) {
|
||||
this.$confirm('确定要删除该文件吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dialogForm.fileList.splice(index, 1)
|
||||
this.$message.success('文件删除成功')
|
||||
}).catch(() => {
|
||||
// 取消删除
|
||||
})
|
||||
},
|
||||
// 获取文件名称(从FileUpload组件迁移)
|
||||
getFileName(name) {
|
||||
if (name.lastIndexOf('/') > -1) {
|
||||
return name.slice(name.lastIndexOf('/') + 1)
|
||||
} else {
|
||||
return name
|
||||
}
|
||||
},
|
||||
// 判断是否为PDF文件
|
||||
isPdfFile(file) {
|
||||
const fileName = this.getFileName(file.name || '')
|
||||
return fileName.toLowerCase().endsWith('.pdf')
|
||||
},
|
||||
// 判断是否为Word文件
|
||||
isWordFile(file) {
|
||||
const fileName = this.getFileName(file.name || '')
|
||||
return fileName.toLowerCase().endsWith('.doc') || fileName.toLowerCase().endsWith('.docx')
|
||||
},
|
||||
// 判断是否为Excel文件
|
||||
isExcelFile(file) {
|
||||
const fileName = this.getFileName(file.name || '')
|
||||
return fileName.toLowerCase().endsWith('.xls') || fileName.toLowerCase().endsWith('.xlsx')
|
||||
},
|
||||
// 判断是否为图片文件
|
||||
isImageFile(file) {
|
||||
const fileName = this.getFileName(file.name || '')
|
||||
const ext = fileName.toLowerCase().split('.').pop()
|
||||
return ['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(ext)
|
||||
},
|
||||
async submit() {
|
||||
console.log('🚀 ~ methods.submit:', this.dialogForm)
|
||||
this.isLoading = true
|
||||
try {
|
||||
await updateByIdApi(this.dialogForm)
|
||||
// 处理文件列表为字符串格式(如果接口需要)
|
||||
const submitForm = {
|
||||
...this.dialogForm,
|
||||
fileList: this.dialogForm.fileList.map(file => file.url).join(',')
|
||||
}
|
||||
await updateByIdApi(submitForm)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
|
|
@ -518,6 +698,7 @@ export default {
|
|||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
this.$message.error('操作失败,请重试')
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
|
|
@ -527,7 +708,77 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-input-number.is-without-controls .el-input__inner {
|
||||
text-align: left;
|
||||
// 核心样式:确保图标统一靠左
|
||||
.custom-file-upload {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 上传提示文本样式
|
||||
::v-deep .el-upload__tip {
|
||||
margin-bottom: 10px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
// 文件列表容器
|
||||
.upload-file-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
// 文件列表项样式
|
||||
.file-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 8px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 图标容器(关键:固定宽度确保图标对齐)
|
||||
.file-icon-container {
|
||||
width: 24px; // 固定宽度,确保所有图标左对齐且对齐线一致
|
||||
display: flex;
|
||||
justify-content: flex-start; // 强制靠左
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
// 图标样式
|
||||
.file-type-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.file-default-icon {
|
||||
font-size: 18px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
// 文件名链接样式
|
||||
.file-name-link {
|
||||
|
||||
color: #606266;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: left; // 文件名也靠左
|
||||
}
|
||||
|
||||
// 操作按钮区域
|
||||
.file-action {
|
||||
margin-left: 10px;
|
||||
white-space: nowrap; // 防止删除按钮换行
|
||||
}
|
||||
|
||||
// 确保删除按钮样式正确
|
||||
::v-deep .file-action .el-link {
|
||||
color: #f56c6c;
|
||||
&:hover {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue