测试项添加修改
This commit is contained in:
@@ -118,3 +118,11 @@ export function getById(data?: any) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//测试项日志修改
|
||||
export function updateRecordData(data?: any) {
|
||||
return createAxios({
|
||||
url: 'cs-device-boot/wlRecord/updateRecordData',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -463,6 +463,7 @@ const formInline = reactive({
|
||||
dataSource: '',
|
||||
dataLevel: 'Secondary'
|
||||
})
|
||||
|
||||
const dataSourceList = [{
|
||||
id: '0',
|
||||
name: '补召'
|
||||
|
||||
@@ -4,23 +4,46 @@
|
||||
<vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key">
|
||||
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
|
||||
:min-width="item.width" :sortable="item.sortable"></vxe-column>
|
||||
<vxe-column title="操作" fixed="right" width="100">
|
||||
<vxe-column title="操作" fixed="right" width="120" v-if="showButtom">
|
||||
<template v-slot:default="scoped">
|
||||
<el-button link type="primary" @click="revise(scoped.row)">修改</el-button>
|
||||
<el-button link type="danger" @click="remove(scoped.row)">删除</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
</vxe-table>
|
||||
<el-dialog draggable v-model="dialogVisible" title="修改" width="400" :before-close="handleClose">
|
||||
<el-form :model="form" ref="ruleFormRef" label-width="auto" class="form-one" :rules="rules">
|
||||
<el-form-item label="数据起始时间" prop="proStartTime">
|
||||
<el-date-picker v-model="form.proStartTime" type="datetime" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择数据起始时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据结束时间" prop="proEndTime">
|
||||
<el-date-picker v-model="form.proEndTime" type="datetime" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择数据结束时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { betweenDay } from '@/utils/formatTime'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { updateRecordData } from '@/api/cs-device-boot/EquipmentDelivery'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
const dictData = useDictData()
|
||||
const voltageLevelList: any = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
import { deleteItem } from '@/api/cs-device-boot/csGroup'
|
||||
@@ -29,6 +52,10 @@ const emit = defineEmits(['onSubmit'])
|
||||
const height = mainHeight(295).height
|
||||
const dataList = ref([])
|
||||
const key: any = ref(0)
|
||||
const ruleFormRef = ref()
|
||||
const adminInfo = useAdminInfo()
|
||||
const showButtom = ref(adminInfo.roleCode.includes('operation_manager') || adminInfo.roleCode.includes('root'))
|
||||
const dialogVisible = ref(false)
|
||||
const column: any = ref([
|
||||
{ field: 'startTime', title: '数据起始时间', width: '140px', sortable: true },
|
||||
{ field: 'endTime', title: '数据结束时间', width: '140px', sortable: true },
|
||||
@@ -51,6 +78,15 @@ const column: any = ref([
|
||||
|
||||
|
||||
])
|
||||
const form = reactive({
|
||||
proStartTime: '',
|
||||
proEndTime: '',
|
||||
id: ''
|
||||
})
|
||||
const rules = {
|
||||
proStartTime: [{ required: true, message: '请输入数据起始时间', trigger: 'blur' }],
|
||||
proEndTime: [{ required: true, message: '请输入数据结束时间', trigger: 'blur' }],
|
||||
}
|
||||
const setData = (data: any) => {
|
||||
dataList.value = JSON.parse(JSON.stringify(data))
|
||||
key.value += 1
|
||||
@@ -66,6 +102,29 @@ const formatter = (row: any) => {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 取消
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
// 确定
|
||||
const handleConfirm = () => {
|
||||
ruleFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
let data = betweenDay(new Date(form.proStartTime), new Date(form.proEndTime))
|
||||
if (data < 0) {
|
||||
ElMessage.warning('数据结束时间不能小于数据起始时间')
|
||||
} else {
|
||||
updateRecordData(form).then((res) => {
|
||||
ElMessage.success(res.message)
|
||||
dialogVisible.value = false
|
||||
emit('onSubmit')
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// dialogVisible.value = false
|
||||
}
|
||||
// 删除
|
||||
const remove = (row: any) => {
|
||||
@@ -102,6 +161,43 @@ const remove = (row: any) => {
|
||||
|
||||
|
||||
|
||||
}
|
||||
// 修改
|
||||
const revise = (row: any) => {
|
||||
|
||||
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 => {
|
||||
|
||||
dialogVisible.value = true
|
||||
form.proStartTime = row.startTime
|
||||
form.proEndTime = row.endTime
|
||||
form.id = row.id
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
defineExpose({ setData })
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
>
|
||||
模版数据分组
|
||||
</el-button> -->
|
||||
<el-button icon="el-icon-Refresh" @click="handleRestartDevice" type="primary"
|
||||
<el-button icon="el-icon-Refresh" v-if="showButtom" @click="handleRestartDevice" type="primary"
|
||||
:loading="deviceRestartLoading">
|
||||
装置重启
|
||||
</el-button>
|
||||
@@ -94,12 +94,13 @@ import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { passwordConfirm } from '@/api/user-boot/user'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
|
||||
reStartDevice,
|
||||
|
||||
} from '@/api/cs-device-boot/fileService'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
const pageHeight = mainHeight(20)
|
||||
const adminInfo = useAdminInfo()
|
||||
const showButtom = ref(adminInfo.roleCode.includes('operation_manager') || adminInfo.roleCode.includes('root'))
|
||||
|
||||
const loading = ref(true)
|
||||
const nDid = ref<string>('')
|
||||
const tableLoading = ref(false)
|
||||
@@ -261,8 +262,8 @@ const handleRestartDevice = () => {
|
||||
})
|
||||
}
|
||||
const exportData = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
xTableRef.value.exportData({
|
||||
filename: deviceData.value.dataSetList.filter((item: any) => item.id == dataSet.value)[0]?.name, // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
|
||||
@@ -83,19 +83,19 @@ const tableStore: any = new TableStore({
|
||||
render: 'switch',
|
||||
width: 100,
|
||||
field: 'jobStatus',
|
||||
activeText: '启用',
|
||||
activeText: '运行中',
|
||||
activeValue: '1',
|
||||
inactiveText: '停用',
|
||||
inactiveText: '未启动',
|
||||
inactiveValue: '2',
|
||||
onChangeField: (row: any, value: any) => {
|
||||
if (row.jobStatus == 1) {
|
||||
stop({ id: row.id }).then(res => {
|
||||
ElMessage.success('停止成功')
|
||||
ElMessage.success(res.message)
|
||||
tableStore.index()
|
||||
})
|
||||
}else{
|
||||
start({ id: row.id }).then(res => {
|
||||
ElMessage.success('启动成功')
|
||||
ElMessage.success(res.message)
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user