refactor(设备管理): 替换dict-tag为el-tag并优化按钮图标显示

统一将字典标签组件dict-tag替换为el-tag组件,使用不同颜色区分状态
优化按钮图标显示方式,使用i标签替代icon属性
调整radio-group的value绑定方式为label属性
This commit is contained in:
2025-09-30 18:33:26 +08:00
parent 5e252eccae
commit 924e6b8a54
4 changed files with 110 additions and 76 deletions

View File

@@ -53,7 +53,7 @@
<el-table-column prop="name" label="点检检名称" align="center" :show-overflow-tooltip="true" v-if="columns_showColumn('name')" />
<el-table-column prop="innerType" label="类别" align="center" v-if="columns_showColumn('innerType')">
<template slot-scope="scope">
<dict-tag :options="options.innerTypeOptions" :value="scope.row.innerType" />
<el-tag :type="scope.row.innerType === 1 ? 'success' : 'primary'">{{ scope.row.innerType === 1 ? '检查' : '保养' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="添加设备" align="center">
@@ -72,7 +72,7 @@
<el-table-column prop="status" label="点检状态" align="center" v-if="columns_showColumn('status')">
<template slot-scope="scope">
<dict-tag :options="options.statusOptions" :value="scope.row.status" />
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '启用' : '停用' }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns_showColumn('remark')" />
@@ -108,7 +108,8 @@
<el-col :lg="12">
<el-form-item label="类别" prop="innerType">
<el-radio-group v-model="form.innerType">
<el-radio v-for="item in options.innerTypeOptions" :key="item.dictValue" :value="parseInt(item.dictValue)" :label="item.dictLabel">
<el-radio v-for="item in options.innerTypeOptions" :key="item.dictValue" :label="item.dictValue">
{{ item.dictLabel }}
</el-radio>
</el-radio-group>
</el-form-item>
@@ -116,7 +117,8 @@
<el-col :lg="12">
<el-form-item label="点检状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio v-for="item in options.statusOptions" :key="item.dictValue" :value="parseInt(item.dictValue)" :label="item.dictLabel">
<el-radio v-for="item in options.statusOptions" :key="item.dictValue" :label="item.dictValue">
{{ item.dictLabel }}
</el-radio>
</el-radio-group>
</el-form-item>
@@ -139,7 +141,7 @@
<Devicelist :message="messageFromParent" :flag="point"></Devicelist>
<template slot="footer">
<el-button text @click="open_device = false">取消</el-button>
<el-button type="primary" @click="open_device = false">提交</el-button>
<el-button type="primary" @click="open_device = false">确认</el-button>
</template>
</el-dialog>
</div>