-
+
重置
@@ -326,7 +311,11 @@
-
+
-
-
+
+
-
+
-
+
查看
@@ -427,42 +417,42 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -486,57 +476,57 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -559,42 +549,42 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -629,17 +619,17 @@
-
+
-
+
-
+
@@ -655,22 +645,22 @@
-
+
-
+
-
+
-
+
@@ -686,7 +676,7 @@
-
+
@@ -713,7 +703,7 @@
-
+
@@ -738,7 +728,7 @@ import {
delDevice,
updateDeviceAPI,
getDeviceDetailAPI,
- getManufacturerSelectApi
+ getManufacturerSelectApi,
} from '@/api/EquipmentLedger/index.js'
import { firstLevel, secondAndThirdLevel } from '@/api/EquipmentEntryApply'
import { getMaxFeatureAPI, getProvinceListAPI } from '@/api/EquipmentLedger/equ-out.js'
@@ -773,14 +763,14 @@ export default {
featureItem: undefined, // 特征项
featureValue: undefined, // 特征值
pageNum: 1,
- pageSize: 10
+ pageSize: 10,
},
// 查询表单验证规则
queryRules: {},
// 树形结构配置
defaultProps: {
children: 'children',
- label: 'name'
+ label: 'name',
},
treeData: [],
defaultExpandedKeys: [], // 存储默认展开的节点 key
@@ -790,6 +780,7 @@ export default {
processList: [], // 工序
serviceLifeList: [], // 使用年限
manufacturerList: [], // 生产厂家
+ columns2: [],
columns: [
{ key: 0, label: `所属省份`, prop: 'province', visible: true },
{ key: 1, label: `产权单位`, prop: 'propertyUnit', visible: true },
@@ -835,7 +826,7 @@ export default {
{ key: 40, label: `特征项8`, prop: 'featureItem8', visible: true },
{ key: 41, label: `特征值8`, prop: 'featureValue8', visible: true },
{ key: 42, label: `特征项9`, prop: 'featureItem9', visible: true },
- { key: 43, label: `特征值9`, prop: 'featureValue9', visible: true }
+ { key: 43, label: `特征值9`, prop: 'featureValue9', visible: true },
],
tableData: [],
tableColumns: 0,
@@ -879,18 +870,18 @@ export default {
personPhone: '',
nextCheckTime: '',
brand: '',
- propertyVoList: []
+ propertyVoList: [],
},
// 表单验证规则
formRules: {
name: [{ required: true, message: '请输入装备名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入装备编号', trigger: 'blur' }],
- changeStatus: [{ required: true, message: '请选择装备状态', trigger: 'change' }]
+ changeStatus: [{ required: true, message: '请选择装备状态', trigger: 'change' }],
},
maxFeatureCount: 5, // 最大特征项数量限制
dialogVisible: false,
dialogTitle: '',
- dialogList: []
+ dialogList: [],
}
},
methods: {
@@ -898,8 +889,9 @@ export default {
initDefaultExpandedKeys() {
const keys = []
const traverse = (data, level) => {
- data.forEach(node => {
- if (level <= 1) { // 只展开第1级和第2级
+ data.forEach((node) => {
+ if (level <= 1) {
+ // 只展开第1级和第2级
keys.push(node.id) // 假设你的节点唯一标识是 `id`
if (node.children && node.children.length > 0) {
traverse(node.children, level + 1)
@@ -925,13 +917,13 @@ export default {
},
filterTree(nodes) {
return nodes
- .map(node => {
+ .map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
- .filter(node => node.status !== '1')
+ .filter((node) => node.status !== '1')
},
// 获取厂家
getManufacturerSelectList() {
@@ -969,7 +961,7 @@ export default {
list.forEach((item) => {
map[item.value] = {
value: item.value.toString(),
- label: item.label
+ label: item.label,
}
})
@@ -1099,7 +1091,7 @@ export default {
collectFirstAndSecondLevelKeys(nodes) {
if (!nodes || !nodes.length) return
- nodes.forEach(firstLevelNode => {
+ nodes.forEach((firstLevelNode) => {
// 展开第一级节点
if (firstLevelNode.id) {
this.defaultExpandedKeys.push(firstLevelNode.id)
@@ -1109,7 +1101,7 @@ export default {
// 检查是否有子节点(第二级节点)
if (firstLevelNode.children && firstLevelNode.children.length) {
// 遍历所有第二级节点
- firstLevelNode.children.forEach(secondLevelNode => {
+ firstLevelNode.children.forEach((secondLevelNode) => {
if (secondLevelNode.id) {
this.defaultExpandedKeys.push(secondLevelNode.id)
console.log(`展开第二级节点: ${secondLevelNode.name}, ID: ${secondLevelNode.id}`)
@@ -1172,7 +1164,7 @@ export default {
if (!treeData || !treeData.length) return []
return treeData
- .map(node => {
+ .map((node) => {
// 深拷贝节点
const newNode = { ...node }
@@ -1198,7 +1190,7 @@ export default {
return null
}
})
- .filter(node => node !== null)
+ .filter((node) => node !== null)
},
/**
@@ -1210,7 +1202,7 @@ export default {
collectMatchedNodeIds(treeData, key, expandedIds) {
if (!treeData || !treeData.length) return
- treeData.forEach(node => {
+ treeData.forEach((node) => {
// 若当前节点匹配关键词,记录其ID(用于展开)
if (key ? node.name.includes(key) : true) {
if (node.id) expandedIds.push(node.id)
@@ -1301,6 +1293,15 @@ export default {
const listResult = await getDeviceListAPI(this.queryParams)
this.tableData = listResult.data?.rows || []
this.total = listResult.data?.total || 0
+
+ let maxLength = 0
+ this.tableData.forEach((item) => {
+ if (item.propertyVoList && item.propertyVoList.length > maxLength) {
+ maxLength = item.propertyVoList.length
+ }
+ })
+ maxLength = maxLength > 0 ? maxLength * 2 : 0
+ this.columns2 = this.columns.slice(0, this.columns.length - 18 + maxLength)
} catch (error) {
// this.$message.error('获取设备列表失败:' + (error.message || '未知错误'))
console.error(error)
@@ -1368,7 +1369,7 @@ export default {
personPhone: '',
nextCheckTime: '',
brand: '',
- propertyVoList: []
+ propertyVoList: [],
}
},
@@ -1388,7 +1389,7 @@ export default {
this.formData.propertyVoList.push({
propertyName: '',
- propertyValue: ''
+ propertyValue: '',
})
},
@@ -1401,7 +1402,7 @@ export default {
cancelButtonText: '取消',
type: 'warning',
center: true,
- showCancelButton: this.formData.propertyVoList.length > 1 // 至少保留一个特征项
+ showCancelButton: this.formData.propertyVoList.length > 1, // 至少保留一个特征项
})
.then(() => {
this.formData.propertyVoList.splice(index, 1)
@@ -1415,7 +1416,7 @@ export default {
* 提交编辑表单
*/
async submitEditForm() {
- this.$refs.editForm.validate(async(valid) => {
+ this.$refs.editForm.validate(async (valid) => {
if (valid) {
try {
const res = await updateDeviceAPI(this.formData)
@@ -1441,8 +1442,8 @@ export default {
this.$confirm('确定要删除该装备吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
- type: 'warning'
- }).then(async() => {
+ type: 'warning',
+ }).then(async () => {
try {
const res = await delDevice(row.maId)
if (res.code === 200) {
@@ -1469,7 +1470,7 @@ export default {
try {
const res = await updateDeviceUpDownAPI({
devIds: this.selectedRows.map((item) => item.maId).join(','),
- status: 1
+ status: 1,
})
this.selectedRows = []
@@ -1497,7 +1498,7 @@ export default {
try {
const res = await updateDeviceUpDownAPI({
devIds: this.selectedRows.map((item) => item.maId).join(','),
- status: 0
+ status: 0,
})
this.selectedRows = []
@@ -1568,7 +1569,7 @@ export default {
handleFile(row) {
// 打开文件预览
window.open(row.fileUrl, '_blank')
- }
+ },
},
async created() {
@@ -1581,12 +1582,10 @@ export default {
// 最后加载列表数据
await this.getDeviceList()
this.initDefaultExpandedKeys()
- }
-
+ },
}
-
-
-
diff --git a/src/views/EquipmentRetireApply/detail.vue b/src/views/EquipmentRetireApply/detail.vue
index f5306564..083875f0 100644
--- a/src/views/EquipmentRetireApply/detail.vue
+++ b/src/views/EquipmentRetireApply/detail.vue
@@ -247,6 +247,7 @@ export default {
operationType: this.isNew ? 'add' : 'edit', // ✅ 区分新增或编辑
toBeScrapList: this.detailList.map(item => ({
...item,
+ devId: item.id,
keyId: item.keyId,
devCode: item.devCode,
type: item.type,
diff --git a/src/views/index_2.vue b/src/views/index_2.vue
new file mode 100644
index 00000000..c4f57d3c
--- /dev/null
+++ b/src/views/index_2.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+