联调程序升级
This commit is contained in:
@@ -1,24 +1,12 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="cn-operate-dialog"
|
||||
width="800px"
|
||||
v-model.trim="dialogVisible"
|
||||
:title="title"
|
||||
@close="emit('closePopup')"
|
||||
>
|
||||
<el-dialog draggable class="cn-operate-dialog" width="800px" v-model.trim="dialogVisible" :title="title"
|
||||
@close="emit('closePopup')">
|
||||
<el-form class="form-two" :model="form" label-width="100px" ref="formRef" :rules="rules">
|
||||
<el-form-item label="设备类型:" prop="type">
|
||||
<!-- <el-select v-model.trim="form.type" filterable placeholder="请选择" @change="typeChange">
|
||||
<el-option v-for="item in TypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select> -->
|
||||
|
||||
<el-select v-model.trim="form.type" placeholder="请选择设备类型" @change="formDevTypeChange" clearable>
|
||||
<el-option
|
||||
v-for="item in devTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-option v-for="item in devTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备型号:" prop="devType">
|
||||
@@ -26,90 +14,42 @@
|
||||
<el-option v-for="item in DevTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select> -->
|
||||
<el-select
|
||||
v-model.trim="form.devType"
|
||||
filterable
|
||||
placeholder="请选择设备型号"
|
||||
clearable
|
||||
@change="devTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in formDevModelOptionsFilter"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-select v-model.trim="form.devType" filterable placeholder="请选择设备型号" clearable
|
||||
@change="devTypeChange">
|
||||
<el-option v-for="item in formDevModelOptionsFilter" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号:" prop="versionNo">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="form.versionNo"
|
||||
autocomplete="off"
|
||||
placeholder="请输入版本号"
|
||||
></el-input>
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionNo" autocomplete="off"
|
||||
placeholder="请输入版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本类型:" prop="versionType">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="form.versionType"
|
||||
autocomplete="off"
|
||||
placeholder="填写特殊类型(不填默认通用类型)"
|
||||
></el-input>
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionType" autocomplete="off"
|
||||
placeholder="填写特殊类型(不填默认通用类型)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="协议版本:" prop="versionAgreement">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="form.versionAgreement"
|
||||
autocomplete="off"
|
||||
placeholder="请输入协议版本"
|
||||
></el-input>
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionAgreement" autocomplete="off"
|
||||
placeholder="请输入协议版本"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本日期:" prop="versionDate">
|
||||
<el-date-picker
|
||||
v-model.trim="form.versionDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
<el-date-picker v-model.trim="form.versionDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间" style="width: 100%"></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="CRC校验:" prop="crcInfo">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="form.crcInfo"
|
||||
autocomplete="off"
|
||||
placeholder="请输入CRC校验"
|
||||
></el-input>
|
||||
<el-form-item label="CRC校验:" prop="crc">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.crc" autocomplete="off"
|
||||
placeholder="请输入CRC校验"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form :model="form" label-width="100px" class="mt10 form-one">
|
||||
<el-form-item label="描述:" prop="description">
|
||||
<el-input
|
||||
maxlength="300"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
type="textarea"
|
||||
show-word-limit
|
||||
v-model.trim="form.description"
|
||||
autocomplete="off"
|
||||
placeholder="请输入描述"
|
||||
></el-input>
|
||||
<el-input maxlength="300" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" show-word-limit
|
||||
v-model.trim="form.description" autocomplete="off" placeholder="请输入描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="升级文件:" prop="file">
|
||||
<el-upload
|
||||
:limit="1"
|
||||
accept=".bin"
|
||||
:auto-upload="false"
|
||||
:on-change="fileChange"
|
||||
:on-exceed="fileExceed"
|
||||
:on-remove="fileRemove"
|
||||
:file-list="fileList"
|
||||
>
|
||||
<el-upload :limit="1" accept=".bin" :auto-upload="false" :on-change="fileChange" :on-exceed="fileExceed"
|
||||
:on-remove="fileRemove" :file-list="fileList">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
@@ -146,7 +86,7 @@ const form = reactive<any>({
|
||||
versionAgreement: null,
|
||||
versionNo: null,
|
||||
versionType: null,
|
||||
crcInfo: null,
|
||||
crc: null,
|
||||
description: null,
|
||||
versionDate: null,
|
||||
type: null,
|
||||
@@ -161,7 +101,7 @@ const rules = {
|
||||
versionAgreement: [{ required: true, message: '请输入协议版本', trigger: 'blur' }],
|
||||
versionDate: [{ required: true, message: '请输入版本日期', trigger: 'blur' }],
|
||||
description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
|
||||
crcInfo: [{ required: true, message: '请输入CRC校验', trigger: 'blur' }],
|
||||
crc: [{ required: true, message: '请输入CRC校验', trigger: 'blur' }],
|
||||
file: [{ required: true, message: '请输入升级文件', trigger: 'blur' }]
|
||||
}
|
||||
const typeChange = () => {
|
||||
@@ -176,7 +116,7 @@ const devTypeChange = (e: any) => {
|
||||
// console.log(e)
|
||||
form.devTypeName = formDevModelOptionsFilter.value.filter((item: any) => item.value == e)[0].label
|
||||
}
|
||||
queryByCode('Device_Type').then(res => {
|
||||
queryByCode('Device_Type').then(async res => {
|
||||
const id = res.data.id
|
||||
queryCsDictTree(id).then(res => {
|
||||
devTypeOptions.value = res.data.map((item: any) => {
|
||||
@@ -203,6 +143,14 @@ queryByCode('Device_Type').then(res => {
|
||||
})
|
||||
// tableStore.index()
|
||||
})
|
||||
queryByCode('Direct_Connected_Device').then(res => {
|
||||
queryCsDictTree(res.data.id).then(res => {
|
||||
TypeOptions.value = res.data
|
||||
})
|
||||
queryByid(res.data.id).then(res => {
|
||||
DevTypeAllOptions.value = res.data
|
||||
})
|
||||
})
|
||||
const formDevModelOptionsFilter = computed(() => {
|
||||
return devModelOptions.value.filter((item: any) => {
|
||||
if (form.type) {
|
||||
@@ -246,7 +194,7 @@ const formDevTypeChange = (e: any) => {
|
||||
}
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('新增版本')
|
||||
const open = (text: string, data?: anyObj) => {
|
||||
const open = async (text: string, data?: anyObj) => {
|
||||
title.value = text
|
||||
dialogVisible.value = true
|
||||
if (data) {
|
||||
@@ -264,14 +212,7 @@ const open = (text: string, data?: anyObj) => {
|
||||
form[key] = null
|
||||
}
|
||||
}
|
||||
queryByCode('Direct_Connected_Device').then(res => {
|
||||
queryCsDictTree(res.data.id).then(res => {
|
||||
TypeOptions.value = res.data
|
||||
})
|
||||
queryByid(res.data.id).then(res => {
|
||||
DevTypeAllOptions.value = res.data
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
const submit = () => {
|
||||
// console.log(formRef)
|
||||
|
||||
@@ -3,18 +3,16 @@
|
||||
<TableHeader ref="tableHeaderRef" :showReset="false" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="设备型号:">
|
||||
<el-select v-model.trim="tableStore.table.params.devType" filterable placeholder="请选择设备型号" clearable>
|
||||
<el-option
|
||||
v-for="item in DevTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-model.trim="tableStore.table.params.devType" filterable placeholder="请选择设备型号"
|
||||
clearable>
|
||||
<el-option v-for="item in DevTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button :icon="Plus" type="primary" @click="addMenu" class="ml10">新增版本</el-button>
|
||||
<el-button :icon="Back" @click="go(-1)">返回</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
@@ -27,13 +25,15 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { delCsDictData } from '@/api/system-boot/csDictData'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import PopupVersion from '@/views/govern/manage/basic/popupVersion.vue'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { Plus, Back } from '@element-plus/icons-vue'
|
||||
import { auditEdData } from '@/api/cs-device-boot/edData'
|
||||
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
|
||||
import { getFileUrl, downLoadFile } from '@/api/cs-system-boot/manage'
|
||||
import { useRouter } from 'vue-router'
|
||||
defineOptions({
|
||||
name: 'govern/manage/basic/version'
|
||||
})
|
||||
@@ -42,12 +42,12 @@ const dictData = useDictData()
|
||||
const showPopup = ref(false)
|
||||
const DevTypeOptions = ref()
|
||||
const tableHeaderRef = ref()
|
||||
|
||||
const { push, go } = useRouter()
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-device-boot/edData/queryEdDataPage',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
@@ -55,28 +55,74 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '设备型号', field: 'devTypeName' ,minWidth: '100'},
|
||||
{ title: '版本号', field: 'versionNo' ,minWidth: '100'},
|
||||
{ title: '协议版本', field: 'versionAgreement' ,minWidth: '100'},
|
||||
{ title: '版本日期', field: 'versionDate' ,minWidth: '100'},
|
||||
{ title: '归档日期', field: 'updateTime',minWidth: '150' },
|
||||
{ title: '描述', field: 'description',minWidth: '200' },
|
||||
{ title: '设备型号', field: 'devTypeName', minWidth: '100' },
|
||||
{ title: '版本号', field: 'versionNo', minWidth: '100' },
|
||||
{ title: '协议版本', field: 'versionAgreement', minWidth: '100' },
|
||||
{ title: '版本日期', field: 'versionDate', minWidth: '100' },
|
||||
{ title: '归档日期', field: 'updateTime', minWidth: '150' },
|
||||
{ title: '描述', field: 'description', minWidth: '200' },
|
||||
// {
|
||||
// title: '状态',
|
||||
// field: 'status',
|
||||
// render: 'tag',
|
||||
// minWidth: '80',
|
||||
// custom: {
|
||||
// 0: 'danger',
|
||||
// 1: 'success'
|
||||
// },
|
||||
// replaceValue: {
|
||||
// 0: '禁用',
|
||||
// 1: '启用'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
title: '状态',
|
||||
title: '使用状态',
|
||||
render: 'switch',
|
||||
width: 100,
|
||||
field: 'status',
|
||||
render: 'tag',
|
||||
minWidth: '80',
|
||||
custom: {
|
||||
0: 'error',
|
||||
1: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '禁用',
|
||||
1: '启用'
|
||||
activeText: '启用',
|
||||
inactiveText: '禁用',
|
||||
inactiveValue: '0',
|
||||
activeValue: '1',
|
||||
onChangeField: (row: any, value: any) => {
|
||||
// console.log("🚀 ~ row:", row)
|
||||
ElMessageBox.prompt('二次校验密码确认', '', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
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()
|
||||
}
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
passwordConfirm(value).then(res => {
|
||||
auditEdData({
|
||||
id: row.id,
|
||||
status: row.status == 0 ? 1 : 0
|
||||
}).then((res: any) => {
|
||||
ElMessage.success(row.status == 0 ? '启用成功!' : '禁用成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作', fixed: 'right',
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
@@ -104,50 +150,7 @@ const tableStore = new TableStore({
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '启用',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.status == 1
|
||||
},
|
||||
click: row => {
|
||||
auditEdData({
|
||||
id: row.id,
|
||||
status: 1
|
||||
}).then((res: any) => {
|
||||
ElMessage.success('启用成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
title: '禁用',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-SwitchButton',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定禁用吗?'
|
||||
},
|
||||
disabled: row => {
|
||||
return row.status == 0
|
||||
},
|
||||
click: row => {
|
||||
auditEdData({
|
||||
id: row.id,
|
||||
status: 0
|
||||
}).then((res: any) => {
|
||||
ElMessage.success('禁用成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -177,7 +180,6 @@ queryByCode('Device_Type').then(res => {
|
||||
// 下载报告
|
||||
const downloadTheReport = (name: string) => {
|
||||
getFileUrl(name).then((res: any) => {
|
||||
|
||||
downLoadFile(res.data).then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/octet-stream'
|
||||
@@ -209,3 +211,10 @@ const closePopup = () => {
|
||||
showPopup.value = false
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.customInput {
|
||||
.el-input__inner {
|
||||
-webkit-text-security: disc !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user