需求变更整改
This commit is contained in:
@@ -61,6 +61,7 @@ const tableStore = new TableStore({
|
||||
{ title: '数据名称', field: 'name', minWidth: 220 },
|
||||
{ title: '别名', field: 'otherName', minWidth: 220 },
|
||||
{ title: '展示名称', field: 'showName', minWidth: 170 },
|
||||
{ title: '告警码', field: 'defaultValue', minWidth: 170 },
|
||||
{ title: '相别', field: 'phaseName', minWidth: 80 },
|
||||
{ title: '单位', field: 'unit', minWidth: 80 },
|
||||
{ title: '基础数据类型', field: 'type', minWidth: 170 },
|
||||
|
||||
@@ -82,52 +82,52 @@
|
||||
<el-divider content-position="center">拓展数据</el-divider>
|
||||
</div>
|
||||
<el-form class="form-two" :model="form" label-width="140px" ref="formRef2" :rules="rules">
|
||||
<el-form-item label="参数缺省值:" prop="defaultValue">
|
||||
<el-form-item label="告警码(缺省值):" >
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.defaultValue" autocomplete="off"
|
||||
placeholder="请输入参数缺省值"></el-input>
|
||||
placeholder="请输入告警码(缺省值)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件类别:" prop="eventType">
|
||||
<el-form-item label="事件类别:" >
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.eventType" autocomplete="off"
|
||||
placeholder="请输入事件类别"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设置最大值:" prop="maxNum">
|
||||
<el-form-item label="设置最大值:" >
|
||||
<el-input maxlength="32" show-word-limit type="number" v-model.trim="form.maxNum" autocomplete="off"
|
||||
placeholder="请输入设置最大值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设置最小值:" prop="minNum">
|
||||
<el-form-item label="设置最小值:" >
|
||||
<el-input maxlength="32" show-word-limit type="number" v-model.trim="form.minNum" autocomplete="off"
|
||||
placeholder="请输入设置最小值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="枚举序列:" prop="setValue">
|
||||
<el-form-item label="枚举序列:">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.setValue" autocomplete="off"
|
||||
placeholder="请输入枚举序列"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="字符串长度上限:" prop="strlen">
|
||||
<el-form-item label="字符串长度上限:" >
|
||||
<el-input maxlength="32" show-word-limit type="number" v-model.trim="form.strlen" autocomplete="off"
|
||||
placeholder="请输入字符串长度上限"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上送规则:" prop="tranRule">
|
||||
<el-form-item label="上送规则:" >
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.tranRule" autocomplete="off"
|
||||
placeholder="请输入上送规则"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可远程控制:" prop="ctlSts">
|
||||
<el-form-item label="是否可远程控制:" >
|
||||
<el-radio v-model.trim="form.ctlSts" :label="1">是</el-radio>
|
||||
<el-radio v-model.trim="form.ctlSts" :label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否需遥控校验:" prop="curSts">
|
||||
<el-form-item label="是否需遥控校验:" >
|
||||
<el-radio v-model.trim="form.curSts" :label="1">是</el-radio>
|
||||
<el-radio v-model.trim="form.curSts" :label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否存储:" prop="storeFlag">
|
||||
<el-form-item label="是否存储:" >
|
||||
<el-radio v-model.trim="form.storeFlag" :label="1">是</el-radio>
|
||||
<el-radio v-model.trim="form.storeFlag" :label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否加密:" prop="storeFlag">
|
||||
<el-form-item label="是否加密:" >
|
||||
<el-radio v-model.trim="form.storeFlag" :label="1">是</el-radio>
|
||||
<el-radio v-model.trim="form.storeFlag" :label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据是否上送:" prop="tranFlag">
|
||||
<el-form-item label="数据是否上送:" >
|
||||
<el-radio v-model.trim="form.tranFlag" :label="1">是</el-radio>
|
||||
<el-radio v-model.trim="form.tranFlag" :label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
@@ -51,7 +51,7 @@ const tableStore = new TableStore({
|
||||
{ title: '装置型号', field: 'devTypeName' },
|
||||
{ title: '模板名称', field: 'name' },
|
||||
{ title: '版本号', field: 'versionNo' },
|
||||
{ title: '版本时间', field: 'versionDate' },
|
||||
{ title: '版本时间', field: 'versionDate', sortable: true },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
<template>
|
||||
<div class="default-main" :style="{ height: pageHeight.height }">
|
||||
<vxe-table v-loading="tableStore.table.loading" height="auto" auto-resize ref="tableRef"
|
||||
v-bind="defaultAttribute" :data="tableStore.table.data" :column-config="{ resizable: true }"
|
||||
:tree-config="{ expandAll: true }">
|
||||
<vxe-table
|
||||
v-loading="tableStore.table.loading"
|
||||
height="auto"
|
||||
auto-resize
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="tableStore.table.data"
|
||||
:column-config="{ resizable: true }"
|
||||
:tree-config="{ expandAll: true }"
|
||||
>
|
||||
<vxe-column field="name" align="left" title="名称" tree-node></vxe-column>
|
||||
<vxe-column field="area" title="区域">
|
||||
<template #default="{ row }">
|
||||
@@ -14,9 +21,16 @@
|
||||
{{ row.remark || '/' }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="remark" title="操作" width="100px">
|
||||
<vxe-column field="remark" title="操作" width="150px">
|
||||
<template #default="{ row }">
|
||||
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="deletes(row)" v-if="!row.path">
|
||||
<el-button type="primary" link @click="edit(row)" v-if="!row.path">编辑</el-button>
|
||||
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
confirm-button-type="danger"
|
||||
@confirm="deletes(row)"
|
||||
v-if="!row.path"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger" link>删除</el-button>
|
||||
</template>
|
||||
@@ -24,21 +38,54 @@
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
|
||||
<el-dialog v-model="dialogVisible" title="编辑" width="500">
|
||||
<el-form :model="form" ref="ruleFormRef" label-width="80px" :rules="rules">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" clearable placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域" :prop="form.pid == '0' ? 'city' : 'area'">
|
||||
<!-- <el-input v-model="form.city" clearable placeholder="请输入区域" /> -->
|
||||
<el-cascader
|
||||
v-model="form.city"
|
||||
v-if="form.pid == '0'"
|
||||
style="width: 100%"
|
||||
:options="areaTree"
|
||||
:props="props"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请输入区域"
|
||||
/>
|
||||
<el-input v-else v-model="form.area" clearable placeholder="请输入区域" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-input v-model="form.description" :rows="2" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { auditEngineering } from '@/api/cs-device-boot/edData';
|
||||
import { auditEngineering, updateProject } from '@/api/cs-device-boot/edData'
|
||||
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
|
||||
defineOptions({
|
||||
name: 'govern/manage/engineering'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
const tableRef = ref()
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const pageHeight = mainHeight(20)
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-device-boot/csLedger/getProjectTree',
|
||||
@@ -51,7 +98,28 @@ const tableStore = new TableStore({
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
|
||||
const ruleFormRef = ref()
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
city: [{ required: true, message: '请输入区域', trigger: 'blur' }],
|
||||
area: [{ required: true, message: '请输入区域', trigger: 'blur' }],
|
||||
description: [{ required: true, message: '请输入描述', trigger: 'blur' }]
|
||||
})
|
||||
const areaTree: any = filterFirstTwoLevels(dictData.state.areaTree)
|
||||
const props = {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
checkStrictly: true
|
||||
}
|
||||
const form = ref({
|
||||
id: '',
|
||||
pid: '',
|
||||
area: '',
|
||||
name: '',
|
||||
city: '',
|
||||
description: ''
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
@@ -67,18 +135,16 @@ const deletes = (row: any) => {
|
||||
customClass: 'customInput',
|
||||
inputType: 'text',
|
||||
beforeClose: (action, instance, done) => {
|
||||
|
||||
if (action === 'confirm') {
|
||||
if (instance.inputValue == null) {
|
||||
return ElMessage.warning('请输入密码')
|
||||
} else if (instance.inputValue?.length > 32) {
|
||||
return ElMessage.warning('密码长度不能超过32位,当前密码长度为' + instance.inputValue.length)
|
||||
} else {
|
||||
done();
|
||||
done()
|
||||
}
|
||||
|
||||
} else {
|
||||
done();
|
||||
done()
|
||||
}
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
@@ -92,11 +158,75 @@ const deletes = (row: any) => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
const addMenu = () => { }
|
||||
// 编辑
|
||||
const edit = (row: any) => {
|
||||
form.value = {
|
||||
id: row.id,
|
||||
pid: row.pid,
|
||||
name: row.name,
|
||||
city: row.cityId,
|
||||
area: row.area,
|
||||
description: row.remark
|
||||
}
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const save = () => {
|
||||
ruleFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
if (form.value.pid == '0') {
|
||||
auditEngineering({ ...form.value, city: form.value.city[form.value.city.length - 1] }).then(
|
||||
(res: any) => {
|
||||
ElMessage.success('保存成功')
|
||||
dialogVisible.value = false
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
} else {
|
||||
let params = new FormData()
|
||||
params.append('id', form.value.id)
|
||||
params.append('area', form.value.area)
|
||||
params.append('description', form.value.description)
|
||||
params.append('name', form.value.name)
|
||||
|
||||
updateProject(form.value).then((res: any) => {
|
||||
ElMessage.success('保存成功')
|
||||
dialogVisible.value = false
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 过滤树结构,只保留前2层级
|
||||
*/
|
||||
function filterFirstTwoLevels(tree) {
|
||||
// 处理根节点为数组的情况(如多棵树)
|
||||
if (Array.isArray(tree)) {
|
||||
return tree.map(node => filterNode(node, 1)) // 根节点为第1层
|
||||
} else {
|
||||
// 处理单个根节点的情况
|
||||
return filterNode(tree, 1)
|
||||
}
|
||||
|
||||
function filterNode(node, level) {
|
||||
// 复制当前节点的所有属性(避免修改原始对象)
|
||||
const filteredNode = { ...node }
|
||||
|
||||
// 如果是第1层,需要保留其children(即第2层),但需过滤第2层的children
|
||||
if (level === 1 && node.children && Array.isArray(node.children)) {
|
||||
filteredNode.children = node.children.map(child => filterNode(child, 2))
|
||||
}
|
||||
// 如果是第2层或更深,直接删除children(截断层级)
|
||||
else {
|
||||
delete filteredNode.children
|
||||
}
|
||||
|
||||
return filteredNode
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.customInput {
|
||||
|
||||
@@ -312,15 +312,16 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'name' },
|
||||
{ title: '网络设备ID', field: 'ndid' },
|
||||
{ title: '设备名称', field: 'name', minWidth: 120 },
|
||||
{ title: '网络设备ID', field: 'ndid', minWidth: 120 },
|
||||
|
||||
{
|
||||
title: '设备类型',
|
||||
field: 'devType',
|
||||
formatter: row => {
|
||||
return devTypeOptions.value.find((item: any) => item.value == row.cellValue).label
|
||||
}
|
||||
},
|
||||
minWidth: 120
|
||||
},
|
||||
|
||||
{
|
||||
@@ -328,16 +329,18 @@ const tableStore = new TableStore({
|
||||
field: 'devModel',
|
||||
formatter: row => {
|
||||
return devModelOptions.value.find((item: any) => item.value == row.cellValue).label
|
||||
}
|
||||
},
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: '通讯协议',
|
||||
field: 'devAccessMethod',
|
||||
formatter: row => {
|
||||
return row.cellValue === 'MQTT' ? 'MQTT' : row.cellValue === 'CLD' ? 'CLD' : row.cellValue
|
||||
}
|
||||
},
|
||||
minWidth: 120
|
||||
},
|
||||
{ title: '录入时间', field: 'createTime', sortable: true },
|
||||
{ title: '录入时间', field: 'createTime', sortable: true, minWidth: 150 },
|
||||
|
||||
{
|
||||
title: '使用状态',
|
||||
@@ -397,7 +400,8 @@ const tableStore = new TableStore({
|
||||
replaceValue: {
|
||||
未连接: '未连接',
|
||||
已连接: '已连接'
|
||||
}
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
|
||||
{
|
||||
@@ -412,7 +416,8 @@ const tableStore = new TableStore({
|
||||
replaceValue: {
|
||||
1: '离线',
|
||||
2: '在线'
|
||||
}
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '流程阶段',
|
||||
@@ -428,18 +433,9 @@ const tableStore = new TableStore({
|
||||
2: '功能调试',
|
||||
3: '出厂调试',
|
||||
4: '正式投运'
|
||||
}
|
||||
// formatter: row => {
|
||||
// return row.cellValue == '1'
|
||||
// ? '设备登记'
|
||||
// : row.cellValue == '2'
|
||||
// ? '功能调试'
|
||||
// : row.cellValue == '3'
|
||||
// ? '出厂调试'
|
||||
// : row.cellValue == '4'
|
||||
// ? '设备投运'
|
||||
// : row.cellValue
|
||||
// }
|
||||
},
|
||||
minWidth: 80
|
||||
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -28,7 +28,7 @@ const tableStore = new TableStore({
|
||||
column: [
|
||||
{ title: '标题', field: 'title', align: 'center' },
|
||||
{ title: '描述', field: 'description', align: 'center' },
|
||||
{ title: '发布时间', field: 'createTime', align: 'center' },
|
||||
{ title: '发布时间', field: 'createTime', align: 'center' , sortable: true},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'status',
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker ref="refheader" showExport>
|
||||
<template v-slot:select></template>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="流程阶段">
|
||||
<el-select v-model.trim="tableStore.table.params.process" clearable placeholder="请选择状态">
|
||||
<el-option label="功能调试" :value="2"></el-option>
|
||||
<el-option label="出厂调试" :value="3"></el-option>
|
||||
<el-option label="正式投运" :value="4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
@@ -12,6 +20,9 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
defineOptions({
|
||||
name: 'manage/monthly'
|
||||
})
|
||||
const refheader = ref()
|
||||
const devModelOptions: any = ref([])
|
||||
queryByCode('Device_Type').then(res => {
|
||||
@@ -39,22 +50,57 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '工程名称', field: 'engineeringName' },
|
||||
{ title: '项目名称', field: 'projectName' },
|
||||
{ title: '设备名称', field: 'devName' },
|
||||
{ title: '工程名称', field: 'engineeringName', minWidth: 150 },
|
||||
{ title: '项目名称', field: 'projectName', minWidth: 130 },
|
||||
{ title: '设备名称', field: 'devName', minWidth: 130 },
|
||||
{ title: '监测点名称', field: 'lineName', minWidth: 130 },
|
||||
{
|
||||
title: '投运时间',
|
||||
field: 'operationalTime',
|
||||
width: 180,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '数据更新时间',
|
||||
field: 'latestTime',
|
||||
width: 180,
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '设备型号',
|
||||
field: 'devType',
|
||||
width: 130,
|
||||
formatter: row => {
|
||||
return devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
|
||||
}
|
||||
},
|
||||
{ title: 'Mac地址', field: 'mac' },
|
||||
{ title: '监测点名称', field: 'lineName' },
|
||||
{ title: 'Mac地址', field: 'mac', width: 140 },
|
||||
{
|
||||
title: '流程阶段',
|
||||
field: 'process',
|
||||
width: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
2: 'warning',
|
||||
3: 'warning',
|
||||
4: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
2: '功能调试',
|
||||
3: '出厂调试',
|
||||
4: '正式投运'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '运行状态',
|
||||
field: 'operationalStatus',
|
||||
render: 'tag',
|
||||
width: 100,
|
||||
custom: {
|
||||
停运: 'danger',
|
||||
在运: 'success'
|
||||
@@ -78,26 +124,15 @@ const tableStore = new TableStore({
|
||||
在线: '在线'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '投运时间',
|
||||
field: 'operationalTime',
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
title: '数据更新时间',
|
||||
field: 'latestTime',
|
||||
width: 160,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
},
|
||||
{ title: '在线率(%)', field: 'onlineRate' },
|
||||
{ title: '完整性(%)', field: 'integrity' }
|
||||
|
||||
{ title: '在线率(%)', width: 100, field: 'onlineRate', sortable: true },
|
||||
{ title: '完整性(%)', width: 100, field: 'integrity', sortable: true }
|
||||
],
|
||||
beforeSearchFun: () => {}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.process = 4
|
||||
// "target": [],
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
|
||||
Reference in New Issue
Block a user