解决打不了包的问题
parent
738010ef96
commit
783a8b2425
|
@ -1,9 +1,9 @@
|
|||
VITE_BASE=/
|
||||
# VITE_BASE_URL=http://192.168.0.25:8095/
|
||||
VITE_BASE_URL=http://192.168.0.37:8095/
|
||||
VITE_BASE_URL=http://192.168.4.226:8095/
|
||||
|
||||
#websocket t掉线
|
||||
VITE_ON_LINE_WEB_SOCKET_URL=ws://192.168.0.37:8869
|
||||
VITE_ON_LINE_WEB_SOCKET_URL=ws://192.168.4.226:8869
|
||||
|
||||
#websocket 在线学习
|
||||
VITE_LEARNING_WEB_SOCKET_URL=ws://192.168.0.37:8899
|
||||
VITE_LEARNING_WEB_SOCKET_URL=ws://192.168.4.226:8899
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
VITE_BASE=/dist
|
||||
#VITE_BASE_URL=http://10.199.64.27:8520/integrated_yjb/
|
||||
VITE_BASE_URL=http://192.168.20.240:8542/integrated_yjb/
|
||||
VITE_BASE_URL=http://172.16.112.251:80/api/
|
||||
#VITE_BASE_URL=https://qaaqwh.qhdsafety.com/integrated_whb/
|
||||
|
||||
#websocket t掉线
|
||||
|
|
|
@ -23,7 +23,7 @@ module.exports = {
|
|||
"camelcase": "off",
|
||||
"eqeqeq": "error",
|
||||
"vue/no-template-shadow": "error",
|
||||
"vue/attribute-hyphenation": "error",
|
||||
"vue/attribute-hyphenation": "off",
|
||||
"vue/html-end-tags": "error",
|
||||
"vue/eqeqeq": "error",
|
||||
"vue/component-name-in-template-casing": ["error", "kebab-case"],
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"@icon-park/vue-next": "^1.4.2",
|
||||
"@vueuse/core": "^9.13.0",
|
||||
"@vueuse/integrations": "^10.7.1",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"animate.css": "^4.1.1",
|
||||
"autofit.js": "^3.0.7",
|
||||
|
@ -21,11 +22,11 @@
|
|||
"dayjs": "^1.11.10",
|
||||
"echarts": "^5.4.3",
|
||||
"element-plus": "^2.6.1",
|
||||
"mp4box": "^0.5.2",
|
||||
"html2canvas": "^1.4.1",
|
||||
"jspdf": "^2.5.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
"mitt": "^3.0.1",
|
||||
"mp4box": "^0.5.2",
|
||||
"nanoid": "^5.0.4",
|
||||
"normalize.css": "^8.0.1",
|
||||
"pako": "^2.1.0",
|
||||
|
|
|
@ -12,10 +12,12 @@
|
|||
:show-pagination="false"
|
||||
:data="data.realTimeMonitoringDataList"
|
||||
>
|
||||
<el-table-column prop="PLC_NAME" label="监测节点名称" />
|
||||
<!-- <el-table-column prop="PLC_NAME" label="监测节点名称" />-->
|
||||
<el-table-column prop="TARGET_NAME" label="监测节点名称" />
|
||||
<el-table-column prop="CURRENT_VALUE" label="当前值">
|
||||
<template #default="{ row }">
|
||||
{{ formatValue(row.SIGNAL_TYPE, row.CURRENT_VALUE) }}
|
||||
<!-- {{ formatValue(row.SIGNAL_TYPE, row.CURRENT_VALUE) }}-->
|
||||
{{ row.CURRENT_VALUE }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="TARGET_UNIT" label="单位"/>
|
||||
|
@ -75,12 +77,12 @@ const { pause } = useIntervalFn(
|
|||
{ immediate: true, immediateCallback: true }
|
||||
);
|
||||
/* ----------------- 工具:把原始值转换成最终显示文本 ----------------- */
|
||||
function formatValue(type, val) {
|
||||
// 需要原样返回的 ID
|
||||
if (type==='1') return val
|
||||
// 其余设备:0.0 -> 关,其余 -> 开
|
||||
return val === '0.0' ? '关' : '开'
|
||||
}
|
||||
// function formatValue(type, val) {
|
||||
// // 需要原样返回的 ID
|
||||
// if (type==='1') return val
|
||||
// // 其余设备:0.0 -> 关,其余 -> 开
|
||||
// return val === '0.0' ? '关' : '开'
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
@ -50,6 +50,8 @@ export const setIronIronPlcSensorRemove = (params) =>
|
|||
post("/tbIronIronPlc/removeSensor", params);
|
||||
export const setIronIronPlcSensorEdit = (params) =>
|
||||
post("/tbIronIronPlc/editSensor", params);
|
||||
export const setIronIronPlcSensorAdd = (params) =>
|
||||
post("/tbIronIronPlc/addSensor", params);
|
||||
|
||||
export const setIronPlcImport = (params) =>
|
||||
upload("/tbIronIronPlc/readExcel", params);
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -246,7 +246,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -230,7 +230,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<show-points
|
||||
:id="data.showPointsDialog.id"
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -231,7 +231,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="完善" :before-close="fnClose">
|
||||
<el-dialog v-model="visible" :title="type === 'add' ? '新增' : '完善'" :before-close="fnClose">
|
||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
|
||||
<el-form-item label="指标名称" prop="TARGET_NAME">
|
||||
<el-input v-model="form.TARGET_NAME" disabled />
|
||||
<el-input v-model="form.TARGET_NAME" />
|
||||
</el-form-item>
|
||||
<el-form-item label="指标采集点位置" prop="TARGET_PLACE">
|
||||
<el-input v-model="form.TARGET_PLACE" disabled />
|
||||
<el-input v-model="form.TARGET_PLACE" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="TARGET_DESCRIPTION">
|
||||
<el-input v-model="form.TARGET_DESCRIPTION" />
|
||||
|
@ -188,7 +188,7 @@ import { useVModels } from "@vueuse/core";
|
|||
import { debounce } from "throttle-debounce";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { setIronIronPlcSensorEdit } from "@/request/tb_iron.js";
|
||||
import {setIronIronPlcSensorAdd, setIronIronPlcSensorEdit} from "@/request/tb_iron.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
|
@ -201,9 +201,13 @@ const props = defineProps({
|
|||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "操作",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||
const { visible, form } = useVModels(props, emits);
|
||||
const emits = defineEmits(["update:visible", "update:form", "update:type", "get-data"]);
|
||||
const { visible, form, type } = useVModels(props, emits);
|
||||
const rules = {
|
||||
BIT_NO: [{ required: true, message: "位号不能为空", trigger: "blur" }],
|
||||
TARGET_UNIT: [
|
||||
|
@ -235,15 +239,19 @@ const fnClose = () => {
|
|||
visible.value = false;
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
await setIronIronPlcSensorEdit({ ...form.value });
|
||||
ElMessage.success("操作成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
},
|
||||
{ atBegin: true }
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
if (type.value === 'add') {
|
||||
await setIronIronPlcSensorAdd({ ...form.value });
|
||||
} else {
|
||||
await setIronIronPlcSensorEdit({ ...form.value });
|
||||
}
|
||||
ElMessage.success("操作成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ const data = reactive({
|
|||
addOrEditDialog: {
|
||||
visible: false,
|
||||
form: {},
|
||||
type: "",
|
||||
},
|
||||
qrCodeDialog: {
|
||||
visible: false,
|
||||
|
@ -35,9 +36,14 @@ const data = reactive({
|
|||
});
|
||||
|
||||
const emits = defineEmits(["update:visible", "get-data"]);
|
||||
const fnEdit = (form) => {
|
||||
const fnEdit = (form, edit) => {
|
||||
data.addOrEditDialog.visible = true;
|
||||
data.addOrEditDialog.form = form;
|
||||
if (edit === 'add') {
|
||||
data.addOrEditDialog.form = { PLC_ID: props.plcId, SIGNAL_TYPE: '', TARGET_STATUS: '' };
|
||||
} else {
|
||||
data.addOrEditDialog.form = form;
|
||||
}
|
||||
data.addOrEditDialog.type = edit;
|
||||
};
|
||||
const { visible } = useVModels(props, emits);
|
||||
const fnClose = () => {
|
||||
|
@ -118,11 +124,17 @@ const fnClose = () => {
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text link @click="fnEdit(row)">
|
||||
<el-button type="primary" text link @click="fnEdit(row, 'edit')">
|
||||
{{ row.TARGET_STATUS === 2 ? "完善" : "修改" }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #button>
|
||||
<el-button type="primary" @click="fnEdit('', 'add')">
|
||||
新增
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="fnDeleteAll"> 批量删除</el-button>-->
|
||||
</template>
|
||||
</layout-table>
|
||||
</layout-card>
|
||||
|
||||
|
@ -131,9 +143,10 @@ const fnClose = () => {
|
|||
</template>
|
||||
</el-dialog>
|
||||
<edit-sensor
|
||||
v-model:visible="data.addOrEditDialog.visible"
|
||||
v-model:form="data.addOrEditDialog.form"
|
||||
@get-data="fnResetPagination"
|
||||
v-model:visible="data.addOrEditDialog.visible"
|
||||
v-model:form="data.addOrEditDialog.form"
|
||||
v-model:type="data.addOrEditDialog.type"
|
||||
@get-data="fnResetPagination"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="完善" :before-close="fnClose">
|
||||
<el-dialog v-model="visible" :title="type === 'add' ? '新增' : '完善'" :before-close="fnClose">
|
||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
|
||||
<el-form-item label="指标名称" prop="TARGET_NAME">
|
||||
<el-input v-model="form.TARGET_NAME" disabled />
|
||||
<el-input v-model="form.TARGET_NAME" />
|
||||
</el-form-item>
|
||||
<el-form-item label="指标采集点位置" prop="TARGET_PLACE">
|
||||
<el-input v-model="form.TARGET_PLACE" disabled />
|
||||
<el-input v-model="form.TARGET_PLACE" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="TARGET_DESCRIPTION">
|
||||
<el-input v-model="form.TARGET_DESCRIPTION" />
|
||||
|
@ -188,7 +188,7 @@ import { useVModels } from "@vueuse/core";
|
|||
import { debounce } from "throttle-debounce";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { setIronIronPlcSensorEdit } from "@/request/tb_iron.js";
|
||||
import {setIronIronPlcSensorAdd, setIronIronPlcSensorEdit} from "@/request/tb_iron.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
|
@ -201,9 +201,13 @@ const props = defineProps({
|
|||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "操作",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||
const { visible, form } = useVModels(props, emits);
|
||||
const emits = defineEmits(["update:visible", "update:form", "update:type", "get-data"]);
|
||||
const { visible, form, type } = useVModels(props, emits);
|
||||
const rules = {
|
||||
BIT_NO: [{ required: true, message: "位号不能为空", trigger: "blur" }],
|
||||
TARGET_UNIT: [
|
||||
|
@ -235,15 +239,19 @@ const fnClose = () => {
|
|||
visible.value = false;
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
await setIronIronPlcSensorEdit({ ...form.value });
|
||||
ElMessage.success("操作成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
},
|
||||
{ atBegin: true }
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
if (type.value === 'add') {
|
||||
await setIronIronPlcSensorAdd({ ...form.value });
|
||||
} else {
|
||||
await setIronIronPlcSensorEdit({ ...form.value });
|
||||
}
|
||||
ElMessage.success("操作成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ const data = reactive({
|
|||
addOrEditDialog: {
|
||||
visible: false,
|
||||
form: {},
|
||||
type: "",
|
||||
},
|
||||
qrCodeDialog: {
|
||||
visible: false,
|
||||
|
@ -35,9 +36,14 @@ const data = reactive({
|
|||
});
|
||||
|
||||
const emits = defineEmits(["update:visible", "get-data"]);
|
||||
const fnEdit = (form) => {
|
||||
const fnEdit = (form, edit) => {
|
||||
data.addOrEditDialog.visible = true;
|
||||
data.addOrEditDialog.form = form;
|
||||
if (edit === 'add') {
|
||||
data.addOrEditDialog.form = { PLC_ID: props.plcId, SIGNAL_TYPE: '', TARGET_STATUS: '' };
|
||||
} else {
|
||||
data.addOrEditDialog.form = form;
|
||||
}
|
||||
data.addOrEditDialog.type = edit;
|
||||
};
|
||||
const { visible } = useVModels(props, emits);
|
||||
const fnClose = () => {
|
||||
|
@ -118,11 +124,17 @@ const fnClose = () => {
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text link @click="fnEdit(row)">
|
||||
<el-button type="primary" text link @click="fnEdit(row, 'edit')">
|
||||
{{ row.TARGET_STATUS === 2 ? "完善" : "修改" }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #button>
|
||||
<el-button type="primary" @click="fnEdit('', 'add')">
|
||||
新增
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="fnDeleteAll"> 批量删除</el-button>-->
|
||||
</template>
|
||||
</layout-table>
|
||||
</layout-card>
|
||||
|
||||
|
@ -131,9 +143,10 @@ const fnClose = () => {
|
|||
</template>
|
||||
</el-dialog>
|
||||
<edit-sensor
|
||||
v-model:visible="data.addOrEditDialog.visible"
|
||||
v-model:form="data.addOrEditDialog.form"
|
||||
@get-data="fnResetPagination"
|
||||
v-model:visible="data.addOrEditDialog.visible"
|
||||
v-model:form="data.addOrEditDialog.form"
|
||||
v-model:type="data.addOrEditDialog.type"
|
||||
@get-data="fnResetPagination"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="完善" :before-close="fnClose">
|
||||
<el-dialog v-model="visible" :title="type === 'add' ? '新增' : '完善'" :before-close="fnClose">
|
||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
|
||||
<el-form-item label="指标名称" prop="TARGET_NAME">
|
||||
<el-input v-model="form.TARGET_NAME" disabled />
|
||||
<el-input v-model="form.TARGET_NAME" />
|
||||
</el-form-item>
|
||||
<el-form-item label="指标采集点位置" prop="TARGET_PLACE">
|
||||
<el-input v-model="form.TARGET_PLACE" disabled />
|
||||
<el-input v-model="form.TARGET_PLACE" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="TARGET_DESCRIPTION">
|
||||
<el-input v-model="form.TARGET_DESCRIPTION" />
|
||||
|
@ -188,7 +188,7 @@ import { useVModels } from "@vueuse/core";
|
|||
import { debounce } from "throttle-debounce";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { setIronIronPlcSensorEdit } from "@/request/tb_iron.js";
|
||||
import {setIronIronPlcSensorAdd, setIronIronPlcSensorEdit} from "@/request/tb_iron.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
|
@ -201,9 +201,13 @@ const props = defineProps({
|
|||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "操作",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||
const { visible, form } = useVModels(props, emits);
|
||||
const emits = defineEmits(["update:visible", "update:form", "update:type", "get-data"]);
|
||||
const { visible, form, type } = useVModels(props, emits);
|
||||
const rules = {
|
||||
BIT_NO: [{ required: true, message: "位号不能为空", trigger: "blur" }],
|
||||
TARGET_UNIT: [
|
||||
|
@ -238,7 +242,11 @@ const fnSubmit = debounce(
|
|||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
await setIronIronPlcSensorEdit({ ...form.value });
|
||||
if (type.value === 'add') {
|
||||
await setIronIronPlcSensorAdd({ ...form.value });
|
||||
} else {
|
||||
await setIronIronPlcSensorEdit({ ...form.value });
|
||||
}
|
||||
ElMessage.success("操作成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
|
|
|
@ -27,6 +27,7 @@ const data = reactive({
|
|||
addOrEditDialog: {
|
||||
visible: false,
|
||||
form: {},
|
||||
type: "",
|
||||
},
|
||||
qrCodeDialog: {
|
||||
visible: false,
|
||||
|
@ -35,9 +36,14 @@ const data = reactive({
|
|||
});
|
||||
|
||||
const emits = defineEmits(["update:visible", "get-data"]);
|
||||
const fnEdit = (form) => {
|
||||
const fnEdit = (form, edit) => {
|
||||
data.addOrEditDialog.visible = true;
|
||||
data.addOrEditDialog.form = form;
|
||||
if (edit === 'add') {
|
||||
data.addOrEditDialog.form = { PLC_ID: props.plcId, SIGNAL_TYPE: '', TARGET_STATUS: '' };
|
||||
} else {
|
||||
data.addOrEditDialog.form = form;
|
||||
}
|
||||
data.addOrEditDialog.type = edit;
|
||||
};
|
||||
const { visible } = useVModels(props, emits);
|
||||
const fnClose = () => {
|
||||
|
@ -118,11 +124,17 @@ const fnClose = () => {
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text link @click="fnEdit(row)">
|
||||
<el-button type="primary" text link @click="fnEdit(row, 'edit')">
|
||||
{{ row.TARGET_STATUS === 2 ? "完善" : "修改" }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #button>
|
||||
<el-button type="primary" @click="fnEdit('', 'add')">
|
||||
新增
|
||||
</el-button>
|
||||
<!-- <el-button type="danger" @click="fnDeleteAll"> 批量删除</el-button>-->
|
||||
</template>
|
||||
</layout-table>
|
||||
</layout-card>
|
||||
|
||||
|
@ -133,6 +145,7 @@ const fnClose = () => {
|
|||
<edit-sensor
|
||||
v-model:visible="data.addOrEditDialog.visible"
|
||||
v-model:form="data.addOrEditDialog.form"
|
||||
v-model:type="data.addOrEditDialog.type"
|
||||
@get-data="fnResetPagination"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -212,7 +212,7 @@
|
|||
<check-list
|
||||
v-if="data.checkListDialog.visible"
|
||||
v-model:visible="data.checkListDialog.visible"
|
||||
v-model:foreignKey="data.checkListDialog.FOREIGN_KEY"
|
||||
v-model:foreign-key="data.checkListDialog.FOREIGN_KEY"
|
||||
/>
|
||||
<layout-video
|
||||
v-model:visible="data.videoDialog.visible"
|
||||
|
|
Loading…
Reference in New Issue