|
|
@@ -64,7 +64,7 @@
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="设备id" align="center" prop="equipmentId" />
|
|
|
<el-table-column label="设备名" align="center" prop="equipmentName" />
|
|
|
- <el-table-column label="流程归属" align="center" prop="flowName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="流程归属" align="center" prop="flowName" :show-overflow-tooltip="true" />
|
|
|
<el-table-column label="标识码" align="center" prop="code" />
|
|
|
<el-table-column label="设备种类" align="center" prop="equipmentType">
|
|
|
<template #default="scope">
|
|
|
@@ -85,6 +85,10 @@
|
|
|
v-hasPermi="['hnyz:equipment:edit']">修改</el-button>
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['hnyz:equipment:remove']">删除</el-button>
|
|
|
+ <el-button link type="primary" icon="View" @click="toDetail(scope.row.code)">
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
+
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -147,11 +151,14 @@
|
|
|
|
|
|
<script setup name="Equipment">
|
|
|
import { changeStatus, listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment } from "@/api/hnyz/equipment";
|
|
|
-import { getFlowList,listFlow } from "@/api/hnyz/flow";
|
|
|
+import { getFlowList, listFlow } from "@/api/hnyz/flow";
|
|
|
import { getPlcList } from "@/api/hnyz/plcInfo";
|
|
|
import { getCommProtocolList } from "@/api/hnyz/commProtocol";
|
|
|
import { onMounted } from "vue";
|
|
|
+import { cleanPayload } from "@/utils/dcs/requestCleaner";
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
|
+const router = useRouter()
|
|
|
onMounted(() => {
|
|
|
getOptions();
|
|
|
});
|
|
|
@@ -272,7 +279,7 @@ function reset() {
|
|
|
flowName: null,
|
|
|
protocolId: null,
|
|
|
status: "0",
|
|
|
- remark: null
|
|
|
+ remark: null,
|
|
|
};
|
|
|
proxy.resetForm("equipmentRef");
|
|
|
}
|
|
|
@@ -334,12 +341,13 @@ function handleUpdate(row) {
|
|
|
function submitForm() {
|
|
|
proxy.$refs["equipmentRef"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (form.value.flowIds) {
|
|
|
- //数组转字符串
|
|
|
- form.value.flowIds = form.value.flowIds.join(',');
|
|
|
+ const payload = cleanPayload(form.value);
|
|
|
+ // 处理 flowIds:数组转字符串
|
|
|
+ if (payload.flowIds) {
|
|
|
+ payload.flowIds = payload.flowIds.join(',');
|
|
|
}
|
|
|
if (form.value.equipmentId != null) {
|
|
|
- updateEquipment(form.value).then(response => {
|
|
|
+ updateEquipment(payload).then(response => {
|
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
|
open.value = false;
|
|
|
getList();
|
|
|
@@ -347,7 +355,7 @@ function submitForm() {
|
|
|
form.value.flowIds = form.value.flowIds.split(',').map(Number);
|
|
|
});
|
|
|
} else {
|
|
|
- addEquipment(form.value).then(response => {
|
|
|
+ addEquipment(payload).then(response => {
|
|
|
proxy.$modal.msgSuccess("新增成功");
|
|
|
open.value = false;
|
|
|
getList();
|
|
|
@@ -378,5 +386,14 @@ function handleExport() {
|
|
|
}, `equipment_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
|
|
|
+// 详情按钮操作
|
|
|
+function toDetail(code) {
|
|
|
+ console.log(code)
|
|
|
+ router.push({
|
|
|
+ path: '/index',
|
|
|
+ query: { code }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
getList();
|
|
|
</script>
|