联调程序升级
This commit is contained in:
@@ -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