修改测试用例1

This commit is contained in:
guanj
2026-01-12 11:06:54 +08:00
parent 08afdddc51
commit e9d7231a75
16 changed files with 923 additions and 822 deletions

View File

@@ -18,3 +18,13 @@ export function downLoadFile(filePath: any) {
params: { filePath: filePath } params: { filePath: filePath }
}) })
} }
//获取文件的一个短期url
export function getFileUrl(filePath: any) {
return createAxios({
url: '/system-boot/file/getFileUrl',
method: 'get',
// responseType: 'blob',
params: { filePath: filePath }
})
}

View File

@@ -218,11 +218,12 @@ const updateNodeCheckStatus = (currentCount: number) => {
const allNodes = treeRef.value.store._getAllNodes() const allNodes = treeRef.value.store._getAllNodes()
allNodes.forEach((node: any) => { allNodes.forEach((node: any) => {
if (node.level === 3) { // 监测点层级 if (node.level === 3) { // 监测点层级
// 如果已达到最大数量且该节点未被选中,则禁用勾选 // 如果已达到最大数量且该节点未被选中,则禁用勾选
if (isMaxSelected && !node.checked) { if (isMaxSelected && !node.data.checked) {
node.disabled = true node.data.disabled = true
} else { } else {
node.disabled = false node.data.disabled = false
} }
} }
}) })

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog class="cn-operate-dialog" width="700px" v-model.trim="dialogVisible" :title="title"> <el-dialog class="cn-operate-dialog" width="500px" v-model.trim="dialogVisible" :title="title">
<el-form :inline="false" ref="formRef" :model="form" label-width="auto" class="form-one" :rules="rules"> <el-form :inline="false" ref="formRef" :model="form" label-width="auto" class="form-one" :rules="rules">
<el-form-item label="角色名称" prop="name"> <el-form-item label="角色名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入菜单名称" /> <el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入菜单名称" />

View File

@@ -646,7 +646,8 @@
:controls="false" :controls="false"
:min="1" :min="1"
style="width: 48%" style="width: 48%"
v-model="lineItem.ptRatio" oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ptRatio"
:disabled=" :disabled="
!( !(
(nodeLevel == 4 && pageStatus == 3) || (nodeLevel == 4 && pageStatus == 3) ||
@@ -670,7 +671,8 @@
:controls="false" :controls="false"
:min="1" :min="1"
style="width: 48%" style="width: 48%"
v-model="lineItem.pt2Ratio" oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.pt2Ratio"
:disabled=" :disabled="
!( !(
(nodeLevel == 4 && pageStatus == 3) || (nodeLevel == 4 && pageStatus == 3) ||
@@ -694,7 +696,8 @@
:controls="false" :controls="false"
:min="1" :min="1"
style="width: 48%" style="width: 48%"
v-model="lineItem.ctRatio" oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ctRatio"
:disabled=" :disabled="
!( !(
(nodeLevel == 4 && pageStatus == 3) || (nodeLevel == 4 && pageStatus == 3) ||
@@ -718,7 +721,8 @@
:controls="false" :controls="false"
:min="1" :min="1"
style="width: 48%" style="width: 48%"
v-model="lineItem.ct2Ratio" oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ct2Ratio"
:disabled=" :disabled="
!( !(
(nodeLevel == 4 && pageStatus == 3) || (nodeLevel == 4 && pageStatus == 3) ||
@@ -1037,8 +1041,8 @@
<Loading /> <Loading />
</el-icon> </el-icon>
<p style="margin-top: 15px; font-size: 16px">正在推送台账信息,请稍候...</p> <p style="margin-top: 15px; font-size: 16px">正在推送台账信息,请稍候...</p>
<p style="margin-top: 10px; color: #999">预计需要30秒左右</p> <!-- <p style="margin-top: 10px; color: #999">预计需要30秒左右</p>
<p style="margin-top: 10px; color: #999">已等待: {{ countdown }}秒</p> <p style="margin-top: 10px; color: #999">已等待: {{ countdown }}秒</p> -->
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@@ -1360,7 +1364,7 @@ const onAdd = async () => {
if (timer.value) clearInterval(timer.value) if (timer.value) clearInterval(timer.value)
timer.value = window.setInterval(() => { timer.value = window.setInterval(() => {
countdown.value++ countdown.value++
if (countdown.value >= 30) { if (countdown.value >= 5) {
clearInterval(timer.value!) clearInterval(timer.value!)
timer.value = null timer.value = null
} }
@@ -1388,7 +1392,7 @@ const onAdd = async () => {
// 如果data不是"暂无需要推送的数据",则继续执行 // 如果data不是"暂无需要推送的数据",则继续执行
if (pushLogResponse.data === '成功') { if (pushLogResponse.data === '成功') {
// 等待30秒 // 等待30秒
await new Promise(resolve => setTimeout(resolve, 30000)) await new Promise(resolve => setTimeout(resolve, 5000))
// 30秒后调用查询推送结果接口 // 30秒后调用查询推送结果接口
const result = await queryPushResult() const result = await queryPushResult()

View File

@@ -73,15 +73,15 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="PT变比" prop="pt"> <el-form-item label="PT变比" prop="pt">
<el-input maxlength="32" show-word-limit style="width: 48%" v-model.trim="form1.pt" <el-input maxlength="32" show-word-limit style="width: 48%" v-model.number.trim="form1.pt"
autocomplete="off" placeholder="请输入PT变比" oninput="value=value.replace(/[^0-9.]/g,'')" /> autocomplete="off" placeholder="请输入PT变比" oninput="value=value.replace(/[^0-9.]/g,'')" />
<el-input maxlength="32" show-word-limit style="width: 48%" v-model.trim="form1.pt1" <el-input maxlength="32" show-word-limit style="width: 48%" v-model.number.trim="form1.pt1"
autocomplete="off" placeholder="请输入PT变比" oninput="value=value.replace(/[^0-9.]/g,'')" /> autocomplete="off" placeholder="请输入PT变比" oninput="value=value.replace(/[^0-9.]/g,'')" />
</el-form-item> </el-form-item>
<el-form-item label="CT变比" prop="ct"> <el-form-item label="CT变比" prop="ct">
<el-input maxlength="32" show-word-limit v-model.trim="form1.ct" style="width: 48%" <el-input maxlength="32" show-word-limit v-model.number.trim="form1.ct" style="width: 48%"
autocomplete="off" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入CT变比" /> autocomplete="off" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入CT变比" />
<el-input maxlength="32" show-word-limit v-model.trim="form1.ct1" style="width: 48%" <el-input maxlength="32" show-word-limit v-model.number.trim="form1.ct1" style="width: 48%"
autocomplete="off" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入CT变比" /> autocomplete="off" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入CT变比" />
</el-form-item> </el-form-item>
<el-form-item label="监测位置:" prop="location" style="width: 100%"> <el-form-item label="监测位置:" prop="location" style="width: 100%">

View File

@@ -51,7 +51,7 @@
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef" /> <Table ref="tableRef" />
<PopupDictionary ref="popupDictionary" v-if="show" @close="show=false"></PopupDictionary> <PopupDictionary ref="popupDictionary" v-if="show" @close="show = false"></PopupDictionary>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -90,7 +90,20 @@ const tableStore = new TableStore({
{ title: '别名', field: 'otherName', minWidth: 220 }, { title: '别名', field: 'otherName', minWidth: 220 },
{ title: '展示名称', field: 'showName', minWidth: 170 }, { title: '展示名称', field: 'showName', minWidth: 170 },
{ title: '告警码', field: 'defaultValue', minWidth: 170 }, { title: '告警码', field: 'defaultValue', minWidth: 170 },
{ title: '相别', field: 'phaseName', minWidth: 80 }, {
title: '相别',
field: 'phase',
minWidth: 80,
formatter: (row: any) => {
return row.cellValue
? row.cellValue == '/'
? '/'
: row.cellValue == 'M'
? '无相别'
: row.cellValue + '相'
: '/'
}
},
{ title: '单位', field: 'unit', minWidth: 80 }, { title: '单位', field: 'unit', minWidth: 80 },
{ title: '基础数据类型', field: 'type', minWidth: 170 }, { title: '基础数据类型', field: 'type', minWidth: 170 },
{ title: '数据谐波次数', field: 'harmStartEnd', minWidth: 170 }, { title: '数据谐波次数', field: 'harmStartEnd', minWidth: 170 },
@@ -143,7 +156,7 @@ const tableStore = new TableStore({
tableStore.table.data.forEach((item: any) => { tableStore.table.data.forEach((item: any) => {
item.classIdName = DataSelect.find((child: any) => child.id == item.classId)?.name || '/' item.classIdName = DataSelect.find((child: any) => child.id == item.classId)?.name || '/'
item.resourcesIdName = ResourcesIdSelect.find((child: any) => child.id == item.resourcesId)?.name || '/' item.resourcesIdName = ResourcesIdSelect.find((child: any) => child.id == item.resourcesId)?.name || '/'
item.phaseName = item.phase === 'M' ? '/' : item.phase || '/' // item.phaseName = item.phase === 'M' ? '无相别' : item.phase || '/'
item.harmStartEnd = item.harmEnd ? item.harmStart + '-' + item.harmEnd : '/' item.harmStartEnd = item.harmEnd ? item.harmStart + '-' + item.harmEnd : '/'
for (let key in item) { for (let key in item) {
if (typeof item[key] !== 'number') { if (typeof item[key] !== 'number') {

View File

@@ -61,7 +61,7 @@
placeholder="请输入单位" placeholder="请输入单位"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="基础数据类型:" > <el-form-item label="基础数据类型:">
<el-input <el-input
maxlength="32" maxlength="32"
show-word-limit show-word-limit
@@ -284,7 +284,23 @@ const phaseSelect = [
{ {
name: 'T相', name: 'T相',
id: 'T' id: 'T'
} },
{
name: 'AB相',
id: 'AB'
},
{
name: 'BC相',
id: 'BC'
},
{
name: 'CA相',
id: 'CA'
},
{
name: '无相别',
id: 'M'
},
] ]
const StatMethodSelect = [ const StatMethodSelect = [
{ {
@@ -372,8 +388,8 @@ const open = (text: string, data?: anyObj) => {
if (data) { if (data) {
for (let key in form) { for (let key in form) {
if (key == 'statMethod') { if (key == 'statMethod') {
form[key] = data[key].split(',') form[key] = data[key] == '/' ? [] : data[key].split(',')
} else { } else {
form[key] = data[key] === '/' ? null : data[key] form[key] = data[key] === '/' ? null : data[key]
} }
} }

View File

@@ -88,7 +88,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :model="form" label-width="100px" class="mt10 form-one" > <el-form :model="form" label-width="100px" class="mt10 form-one">
<el-form-item label="描述:" prop="description"> <el-form-item label="描述:" prop="description">
<el-input <el-input
maxlength="300" maxlength="300"
@@ -103,6 +103,7 @@
<el-form-item label="升级文件:" prop="file"> <el-form-item label="升级文件:" prop="file">
<el-upload <el-upload
:limit="1" :limit="1"
accept=".bin"
:auto-upload="false" :auto-upload="false"
:on-change="fileChange" :on-change="fileChange"
:on-exceed="fileExceed" :on-exceed="fileExceed"
@@ -212,12 +213,27 @@ const formDevModelOptionsFilter = computed(() => {
}) })
}) })
const fileChange = (e: any) => { const fileChange = (e: any) => {
if (!beforeUpload(e.raw)) return
form.file = e.raw form.file = e.raw
fileList.value = [e.raw] fileList.value = [e.raw]
} }
const fileExceed = (e: any) => { const fileExceed = (e: any) => {
ElMessage.error('只能上传一个文件') ElMessage.error('只能上传一个文件')
} }
// 处理上传前检查
const beforeUpload = (file: any) => {
const isWord = file.name.endsWith('.bin')
if (!isWord) {
ElMessage.error('请上传(.bin)格式文件!')
fileList.value = []
return false
}
// 校验通过后允许上传,交由 http-request 处理
return true
}
const fileRemove = (e: any) => { const fileRemove = (e: any) => {
form.file = null form.file = null
fileList.value = [] fileList.value = []

View File

@@ -33,7 +33,7 @@ import { useDictData } from '@/stores/dictData'
import PopupVersion from '@/views/govern/manage/basic/popupVersion.vue' import PopupVersion from '@/views/govern/manage/basic/popupVersion.vue'
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import { auditEdData } from '@/api/cs-device-boot/edData' import { auditEdData } from '@/api/cs-device-boot/edData'
import { getFileUrl, downLoadFile } from '@/api/cs-system-boot/manage'
defineOptions({ defineOptions({
name: 'govern/manage/basic/version' name: 'govern/manage/basic/version'
}) })
@@ -72,6 +72,16 @@ const tableStore = new TableStore({
width: '180', width: '180',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
{
name: 'productSetting',
title: '下载文件',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
downloadTheReport(row.filePath)
}
},
{ {
name: 'edit', name: 'edit',
title: '编辑', title: '编辑',
@@ -151,11 +161,30 @@ queryByCode('Device_Type').then(res => {
res1.data.splice(index, 1) res1.data.splice(index, 1)
} }
}) })
console.log('🚀 ~ res1.data.map ~ res1.data:', res1.data)
DevTypeOptions.value = res1.data DevTypeOptions.value = res1.data
}) })
}) })
// 下载报告
const downloadTheReport = (name: string) => {
getFileUrl(name).then((res: any) => {
downLoadFile(res.data).then(res => {
let blob = new Blob([res], {
type: 'application/octet-stream'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = name.split('/').pop() || '升级文件' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
ElMessage.success('下载成功')
})
})
}
tableStore.table.params.devType = '' tableStore.table.params.devType = ''
provide('tableStore', tableStore) provide('tableStore', tableStore)
onMounted(() => { onMounted(() => {

View File

@@ -1,21 +1,19 @@
<template> <template>
<div class="view" style="height: 100%"> <div class="view" style="height: 100%">
<TableHeader <TableHeader datePicker ref="headerRef">
datePicker
ref="headerRef"
>
<template v-slot:operation> <template v-slot:operation>
<el-button type="primary" :icon="Setting" @click="exportTab">补召</el-button> <el-button type="primary" :icon="Setting" @click="exportTab">补召</el-button>
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef" /> <Table ref="tableRef" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, provide, nextTick, defineEmits, watch } from 'vue' import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import { ElMessage, ElTree } from 'element-plus'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { Setting } from '@element-plus/icons-vue' import { Setting } from '@element-plus/icons-vue'
@@ -24,7 +22,7 @@ const props = defineProps({
type: Array, type: Array,
default: () => [] default: () => []
} }
}); })
const tableParams: any = ref({}) const tableParams: any = ref({})
const headerRef = ref() const headerRef = ref()
@@ -35,7 +33,9 @@ const tableStore: any = new TableStore({
method: 'POST', method: 'POST',
column: [ column: [
{ {
title: '序号', width: 80, formatter: (row: any) => { title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} }
}, },
@@ -49,7 +49,7 @@ const tableStore: any = new TableStore({
}, },
{ field: 'successCount', title: '成功解析数', minWidth: 150 }, { field: 'successCount', title: '成功解析数', minWidth: 150 },
{ field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true }, { field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true },
{ field: 'endTime', title: '导入结束时间', minWidth: 170 , sortable: true}, { field: 'endTime', title: '导入结束时间', minWidth: 170, sortable: true },
{ {
title: '解析状态', title: '解析状态',
field: 'status', field: 'status',
@@ -79,23 +79,20 @@ const tableStore: any = new TableStore({
type: 'primary', type: 'primary',
icon: 'el-icon-EditPen', icon: 'el-icon-EditPen',
render: 'basicButton', render: 'basicButton',
click: row => { click: row => {}
}
} }
] ]
} }
], ],
beforeSearchFun: () => { beforeSearchFun: () => {},
loadCallback: () => {}
},
loadCallback: () => {
}
}) })
provide('tableStore', tableStore) provide('tableStore', tableStore)
const exportTab = () => {
ElMessage.info('稳态补召功能暂未开发!')
}
//获取请求参数 //获取请求参数
const getTableParams = (val: any) => { const getTableParams = (val: any) => {
tableParams.value = val tableParams.value = val

View File

@@ -28,7 +28,13 @@
<span style="display: flex; align-items: center"> <span style="display: flex; align-items: center">
{{ item.name }} {{ item.name }}
<el-tooltip class="item" effect="dark" content="修改项目" placement="top" v-if="hasAdmin || item.createBy == adminInfo.id"> <el-tooltip
class="item"
effect="dark"
content="修改项目"
placement="top"
v-if="hasAdmin || item.createBy == adminInfo.id"
>
<Edit <Edit
style="margin-left: 5px; width: 16px" style="margin-left: 5px; width: 16px"
class="xiaoshou color" class="xiaoshou color"
@@ -121,7 +127,9 @@ defineOptions({
}) })
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager')|| item.includes('root')) const hasAdmin =
adminInfo.userType.some(item => item.includes('operation_manager') || item.includes('root')) ||
adminInfo.userType == 1
const tableRef = ref() const tableRef = ref()
const popupRef = ref() const popupRef = ref()
let DOMIN = window.location.origin let DOMIN = window.location.origin

View File

@@ -81,7 +81,8 @@ const route = useRouter()
const navTabs = useNavTabs() const navTabs = useNavTabs()
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const pageList: any = ref([]) const pageList: any = ref([])
const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root')) const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root'))||
adminInfo.userType == 1
const open = () => { const open = () => {
dialogVisible.value = true dialogVisible.value = true

View File

@@ -98,7 +98,8 @@ const route = useRoute()
const timeCacheStore = useTimeCacheStore() const timeCacheStore = useTimeCacheStore()
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root')) const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root'))||
adminInfo.userType == 1
defineOptions({ defineOptions({
// name: 'dashboard/index' // name: 'dashboard/index'
}) })

View File

@@ -177,7 +177,9 @@ import { id } from 'element-plus/es/locale'
// name: 'cockpit/popup' // name: 'cockpit/popup'
// }) // })
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root')) const hasAdmin =
adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root')) ||
adminInfo.userType == 1
const { go } = useRouter() const { go } = useRouter()
const navTabs = useNavTabs() const navTabs = useNavTabs()

View File

@@ -14,9 +14,9 @@
<el-form-item label="任务表达式" prop="cron"> <el-form-item label="任务表达式" prop="cron">
<el-input v-model.trim="form.cron" clearable placeholder="请输入任务表达式" /> <el-input v-model.trim="form.cron" clearable placeholder="请输入任务表达式" />
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="排序" prop="sort">
<el-input-number style="width: 100%" v-model.number="form.sort" :min="0" placeholder="请输入排序" /> <el-input style="width: 100%" v-model.number.trim="form.sort" placeholder="请输入排序" />
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model.trim="form.remark" clearable :rows="2" type="textarea" placeholder="请输入备注" /> <el-input v-model.trim="form.remark" clearable :rows="2" type="textarea" placeholder="请输入备注" />
@@ -56,12 +56,13 @@ const actionClassesOptions = ref([])
const rules = { const rules = {
actionClass: [{ required: true, message: '请选择任务执行器', trigger: 'change' }], actionClass: [{ required: true, message: '请选择任务执行器', trigger: 'change' }],
timerName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }], timerName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
cron: [{ required: true, message: '任务表达式', trigger: 'blur' }], cron: [{ required: true, message: '请输入任务表达式', trigger: 'blur' }],
sort: [{ required: true, message: '排序', trigger: 'blur' }], sort: [{ required: true, message: '请输入排序', trigger: 'blur' }],
date: [{ required: true, message: '日期不可为空', trigger: 'blur' }], date: [{ required: true, message: '请输入日期', trigger: 'blur' }],
} }
const open = (text: string, data?: anyObj) => { const open = (text: string, data?: anyObj) => {
formRef.value?.resetFields()
title.value = text title.value = text
dialogVisible.value = true dialogVisible.value = true
if (data) { if (data) {

View File

@@ -4,8 +4,13 @@
<TableHeader ref="TableHeaderRef"> <TableHeader ref="TableHeaderRef">
<template #select> <template #select>
<el-form-item label="任务名称"> <el-form-item label="任务名称">
<el-input v-model="tableStore.table.params.searchValue" maxlength="32" show-word-limit clearable <el-input
placeholder="请输入任务名称" /> v-model="tableStore.table.params.searchValue"
maxlength="32"
show-word-limit
clearable
placeholder="请输入任务名称"
/>
</el-form-item> </el-form-item>
<el-form-item label="任务状态:"> <el-form-item label="任务状态:">
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择任务状态"> <el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择任务状态">
@@ -24,20 +29,21 @@
<taskForm ref="taskFormRef" @submit="tableStore.index()" /> <taskForm ref="taskFormRef" @submit="tableStore.index()" />
<!-- 补招 --> <!-- 补招 -->
<el-dialog v-model="dialogVisible" title="选择补招时间" width="500"> <el-dialog v-model="dialogVisible" title="选择补招时间" width="500">
<el-date-picker v-model="formDate.date" type="date" value-format="YYYY-MM-DD" placeholder="选择日期"> <el-date-picker
</el-date-picker> v-model="formDate.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择日期"
></el-date-picker>
<template #footer> <template #footer>
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun"> <el-button type="primary" @click="okRun">确认</el-button>
确认
</el-button>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, provide, } from 'vue' import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
@@ -60,7 +66,7 @@ const tableStore: any = new TableStore({
method: 'POST', method: 'POST',
isWebPaging: true, isWebPaging: true,
column: [ column: [
{ field: 'timerName', title: '任务名称', }, { field: 'timerName', title: '任务名称' },
{ field: 'actionClass', title: '任务执行器' }, { field: 'actionClass', title: '任务执行器' },
{ field: 'cron', title: '定时任务表达式' }, { field: 'cron', title: '定时任务表达式' },
{ field: 'remark', title: '备注' }, { field: 'remark', title: '备注' },
@@ -93,14 +99,12 @@ const tableStore: any = new TableStore({
ElMessage.success(res.message) ElMessage.success(res.message)
tableStore.index() tableStore.index()
}) })
}else{ } else {
start({ id: row.id }).then(res => { start({ id: row.id }).then(res => {
ElMessage.success(res.message) ElMessage.success(res.message)
tableStore.index() tableStore.index()
}) })
} }
} }
}, },
{ field: 'sort', title: '排序', width: '80' }, { field: 'sort', title: '排序', width: '80' },
@@ -125,7 +129,6 @@ const tableStore: any = new TableStore({
timerRun({ id: row.id }).then(res => { timerRun({ id: row.id }).then(res => {
ElMessage.success('执行成功') ElMessage.success('执行成功')
tableStore.index() tableStore.index()
}) })
} }
}, },
@@ -171,16 +174,12 @@ const tableStore: any = new TableStore({
tableStore.index() tableStore.index()
}) })
} }
}, }
] ]
} }
], ],
loadCallback: () => { } loadCallback: () => {}
}) })
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = '' tableStore.table.params.searchState = ''
@@ -188,12 +187,15 @@ tableStore.table.params.searchState = ''
provide('tableStore', tableStore) provide('tableStore', tableStore)
const add = () => { const add = () => {
setTimeout(() => { setTimeout(() => {
taskFormRef.value.open('新增定时任务') taskFormRef.value.open('新增定时任务')
}, 10) }, 10)
} }
const okRun = () => { const okRun = () => {
if (!formDate.value?.date) {
ElMessage.warning('请选择补招时间')
return
}
runTimer(formDate.value).then(res => { runTimer(formDate.value).then(res => {
ElMessage.success('操作成功') ElMessage.success('操作成功')
dialogVisible.value = false dialogVisible.value = false