绘制icd文件管理页面

This commit is contained in:
GGJ
2025-04-16 13:55:57 +08:00
parent 0063c53ec6
commit 021a1ae89b
5 changed files with 256 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<div ref="tableHeader" class="cn-table-header"> <div ref="tableHeader" class="cn-table-header">
<div class="table-header ba-scroll-style"> <div class="table-header ba-scroll-style">
<el-form style="flex: 1; height: 34px; margin-right: 20px; display: flex; flex-wrap: wrap" ref="headerForm" <el-form style="flex: 1; height: 28px; display: flex; flex-wrap: wrap" ref="headerForm"
@submit.prevent="" @keyup.enter="onComSearch" label-position="left" :inline="true"> @submit.prevent="" @keyup.enter="onComSearch" label-position="left" :inline="true">
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 590px"> <el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 590px">
@@ -131,7 +131,7 @@ onMounted(() => {
} }
nextTick(() => { nextTick(() => {
resizeObserver.observe(tableHeader.value) resizeObserver.observe(tableHeader.value)
setTimeout(() => { setTimeout(() => {
computedSearchRow() computedSearchRow()
},500) },500)
}) })
@@ -179,6 +179,7 @@ const showSelectChange = () => {
emit('selectChange', showSelect.value) emit('selectChange', showSelect.value)
} }
const onComSearch = async () => { const onComSearch = async () => {
if (props.datePicker && timeAll.value) { if (props.datePicker && timeAll.value) {
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0] tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1] tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
@@ -226,7 +227,7 @@ defineExpose({ onComSearch, areaRef, setDatePicker, setTheDate, datePickerRef, s
border-bottom: none; border-bottom: none;
padding: 13px 15px; padding: 13px 15px;
font-size: 14px; font-size: 14px;
overflow: hidden;
.table-header-operate-text { .table-header-operate-text {
margin-left: 6px; margin-left: 6px;
} }

View File

@@ -28,10 +28,10 @@
<template #operation> <template #operation>
<!-- <el-button icon="el-icon-Download" type="primary" @click="add">导出</el-button> <!-- <el-button icon="el-icon-Download" type="primary" @click="add">导出</el-button>
<el-button icon="el-icon-Check" type="primary" @click="add">批量升级</el-button> --> <el-button icon="el-icon-Check" type="primary" @click="add">批量升级</el-button> -->
<el-button type="primary" icon="el-icon-Success" @click="deviceData">终端状态管理</el-button> <el-button type="primary" icon="el-icon-DataLine" @click="deviceData">终端状态管理</el-button>
<el-button type="primary" icon="el-icon-s-order" @click="liuniangconfig">流量套餐配置</el-button> <el-button type="primary" icon="el-icon-Operation" @click="liuniangconfig">流量套餐配置</el-button>
<el-button type="primary" icon="el-icon-Menu" @click="configliul">流量策略配置</el-button> <el-button type="primary" icon="el-icon-Menu" @click="configliul">流量策略配置</el-button>
<el-button type="primary" icon="el-icon-s-data" @click="liultjData">流量统计</el-button> <el-button type="primary" icon="el-icon-Histogram" @click="liultjData">流量统计</el-button>
<el-button type="primary" icon="el-icon-Setting" @click="resect">重启前置程序</el-button> <el-button type="primary" icon="el-icon-Setting" @click="resect">重启前置程序</el-button>
</template> </template>
</TableHeader> </TableHeader>

View File

@@ -0,0 +1,120 @@
<template>
<el-dialog draggable width="600px" v-model="dialogVisible" :title="title">
<el-form :inline="false" :model="form" label-width="auto" class="form-one" :rules="rules" ref="formRef">
<el-form-item label="文件名称" prop="name">
<el-input
v-model.trim="form.name"
clearable
maxlength="32"
show-word-limit
placeholder="请输入icd文件名称"
/>
</el-form-item>
<el-form-item label="存储的地址" prop="path">
<el-input
v-model.trim="form.path"
clearable
maxlength="32"
show-word-limit
placeholder="请输入icd文件名称"
/>
</el-form-item>
<el-form-item label="文件" prop="path">
<el-upload
v-model:file-list="form.reportPath"
ref="uploadRef"
action=""
accept=""
:limit="1"
:on-exceed="handleExceed"
:auto-upload="false"
:on-remove="removeFile"
>
<template #trigger>
<el-button type="primary">上传文件</el-button>
</template>
</el-upload>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref, inject, onMounted } from 'vue'
import { reactive } from 'vue'
import { getActionClasses, addTimer, updateTimer } from '@/api/system-boot/csDictData'
import { UploadInstance, UploadProps, UploadRawFile, ElMessage, genFileId } from 'element-plus'
const emit = defineEmits(['submit'])
const dialogVisible = ref(false)
const title = ref('')
// 注意不要和表单ref的命名冲突
const form = reactive<anyObj>({
cron: '',
path: '',
reportPath: []
})
const formRef = ref()
const rules = {
path: [{ required: true, message: '请选择任务执行器', trigger: 'change' }],
name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }]
}
const open = (text: string, data?: anyObj) => {
title.value = text
dialogVisible.value = true
if (data) {
// 表单赋值
for (let key in form) {
form[key] = data[key]
}
} else {
// 在此处恢复默认表单
for (let key in form) {
key == 'sort' ? (form[key] = 100) : (form[key] = '')
}
}
}
// 上传报告
const uploadRef = ref()
const handleExceed: UploadProps['onExceed'] = files => {
uploadRef.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadRef.value!.handleStart(file)
}
//移除文件上传
const removeFile = (file: any, uploadFiles: any) => {
console.log(file, uploadFiles)
}
onMounted(() => {})
const submit = () => {
console.log('🚀 ~ form:', form)
formRef.value.validate(async (valid: boolean) => {
if (valid) {
if (title.value == '新增定时任务') {
// addTimer(form).then(res => {
// ElMessage.success('新增成功')
// dialogVisible.value = false
// emit('submit')
// })
} else {
// updateTimer(form).then(res => {
// ElMessage.success('新增成功')
// dialogVisible.value = false
// emit('submit')
// })
}
}
})
}
defineExpose({ open })
</script>

View File

@@ -0,0 +1,128 @@
<template>
<div class="default-main">
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="icd名称">
<el-input
v-model="tableStore.table.params.searchValue"
maxlength="32"
show-word-limit
clearable
placeholder="请输入任务名称"
/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<!-- 新增 -->
<taskForm ref="taskFormRef" @submit="tableStore.index()" />
<!-- 补招 -->
<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>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="okRun">确认</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import taskForm from './form.vue'
import { formatDate } from '@/utils/formatTime'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
defineOptions({
name: 'icd'
})
const formDate = ref({
date: '',
id: ''
})
const taskFormRef = ref()
const dialogVisible = ref(false)
const tableStore: any = new TableStore({
url: '/system-boot/timer/list',
method: 'POST',
isWebPaging: true,
column: [
{ field: 'timerName', title: '文件名' },
{ field: 'actionClass', title: '存储地址' },
{ field: 'cron', title: '更新时间' },
{
title: '操作',
width: '220',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: async row => {
taskFormRef.value.open('编辑icd文件', row)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
deleteTimer([row.id]).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = ''
provide('tableStore', tableStore)
const add = () => {
setTimeout(() => {
taskFormRef.value.open('新增icd文件')
}, 10)
}
const okRun = () => {
runTimer(formDate.value).then(res => {
ElMessage.success('操作成功')
dialogVisible.value = false
tableStore.index()
})
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -46,7 +46,7 @@ import { formatDate } from '@/utils/formatTime'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus' import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData' import { timerRun, runTimer, deleteTimer, stop, start } from '@/api/system-boot/csDictData'
defineOptions({ defineOptions({
name: 'Distributedphotovoltaic/templateConfiguration' name: 'system-boot/sysConfig/timer'
}) })
const formDate = ref({ const formDate = ref({
date: '', date: '',