修改南工程反馈问题整改
This commit is contained in:
@@ -53,3 +53,50 @@ export const updateCsDictData = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 执行算法
|
||||
export const timerRun = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/run',
|
||||
method: 'GET',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 任务表达式
|
||||
export const getActionClasses = () => {
|
||||
return request({
|
||||
url: '/system-boot/timer/getActionClasses',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
// 新增任务
|
||||
export const addTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/add',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 修改任务
|
||||
export const updateTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/update',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 补招配置
|
||||
export const runTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/run',
|
||||
method: 'GET',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 删除任务
|
||||
export const deleteTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/delete',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input v-model="form.name" placeholder="请输入菜单名称" />
|
||||
<el-input v-model="form.name" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色编码">
|
||||
<el-input v-model="form.code" placeholder="请输入菜单名称" />
|
||||
<el-input v-model="form.code" placeholder="请输入角色编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色描述">
|
||||
<el-input v-model="form.remark" :rows="2" type="textarea" placeholder="请输入描述" />
|
||||
|
||||
@@ -891,6 +891,7 @@ const affiliatiedFrontArr: any = ref([])
|
||||
const comTypeStatusArr = dictData.getBasicData('Front_Type')
|
||||
const factoryArr = dictData.getBasicData('Dev_Manufacturers')
|
||||
const voltageLevelArr = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
console.log("🚀 ~ voltageLevelArr:", voltageLevelArr)
|
||||
const typeArr = dictData.getBasicData('Dev_Type')
|
||||
const industryTypeArr = dictData.getBasicData('Business_Type')
|
||||
const loadTypeArr = dictData.getBasicData('Interference_Source')
|
||||
@@ -1979,6 +1980,7 @@ const selectChanged = (value: any) => {
|
||||
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[
|
||||
busBarIndex.value
|
||||
].lineParam[0].shortCapacity = 10
|
||||
|
||||
//750kv
|
||||
} else if (value === '4cf2d844c47a15a1c16a65b4bbfd1b0e') {
|
||||
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[
|
||||
@@ -2113,7 +2115,45 @@ const selectChanged = (value: any) => {
|
||||
busBarIndex.value
|
||||
].lineParam[0].shortCapacity = 10
|
||||
}
|
||||
|
||||
|
||||
setvoltageDev(voltageLevelArr.filter(item =>item.id == value)[0].value)
|
||||
}
|
||||
const setvoltageDev=(value: any)=> {
|
||||
let voltageDev=7
|
||||
let uvoltageDev= -7
|
||||
|
||||
if (value > 110) {
|
||||
voltageDev=10
|
||||
uvoltageDev=-10
|
||||
}else if(value > 66){
|
||||
voltageDev=7
|
||||
uvoltageDev=-3
|
||||
}else if(value >= 35){
|
||||
voltageDev = 10
|
||||
uvoltageDev = -10
|
||||
}else if(value >= 2){
|
||||
voltageDev = 7.0;
|
||||
uvoltageDev = -7.0;
|
||||
}else if(value >0.22){
|
||||
voltageDev = 7.0;
|
||||
uvoltageDev = -7.0;
|
||||
}else{
|
||||
voltageDev = 7.0;
|
||||
uvoltageDev = -10.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[
|
||||
busBarIndex.value
|
||||
].lineParam[0].voltageDev =voltageDev
|
||||
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[
|
||||
busBarIndex.value
|
||||
].lineParam[0].uvoltageDev = uvoltageDev
|
||||
}
|
||||
const area = () => {
|
||||
areaTree({ id: '', type: 0 }).then((res: any) => {
|
||||
treeOptions.value = res.data
|
||||
|
||||
108
src/views/system/scheduledTasks/form.vue
Normal file
108
src/views/system/scheduledTasks/form.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<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="timerName">
|
||||
<el-input v-model.trim="form.timerName" clearable maxlength="32" show-word-limit
|
||||
placeholder="请输入任务名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务执行器" prop="actionClass">
|
||||
<el-select v-model.trim="form.actionClass" placeholder="请选择任务执行器" filterable>
|
||||
<el-option v-for="item in actionClassesOptions" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务表达式" prop="cron">
|
||||
<el-input v-model.trim="form.cron" clearable placeholder="请输入任务表达式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
|
||||
<el-input-number style="width: 100%" v-model="form.sort" :min="0" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model.trim="form.remark" clearable :rows="2" type="textarea" placeholder="请输入备注" />
|
||||
</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 { ElMessage } from 'element-plus'
|
||||
import { getActionClasses, addTimer, updateTimer } from '@/api/system-boot/csDictData'
|
||||
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
|
||||
const emit = defineEmits(['submit'])
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const formRef = ref()
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = reactive<anyObj>({
|
||||
cron: '',
|
||||
actionClass: '',
|
||||
timerName: '',
|
||||
remark: '',
|
||||
jobStatus: 1,
|
||||
sort: 100,
|
||||
id: '',
|
||||
|
||||
})
|
||||
const actionClassesOptions = ref([])
|
||||
const rules = {
|
||||
actionClass: [{ required: true, message: '请选择任务执行器', trigger: 'change' }],
|
||||
timerName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
|
||||
cron: [{ required: true, message: '任务表达式', trigger: 'blur' }],
|
||||
sort: [{ required: true, message: '排序号', trigger: 'blur' }],
|
||||
date: [{ 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] = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getActionClasses().then(res => {
|
||||
actionClassesOptions.value = res.data
|
||||
})
|
||||
})
|
||||
const submit = () => {
|
||||
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>
|
||||
181
src/views/system/scheduledTasks/index.vue
Normal file
181
src/views/system/scheduledTasks/index.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div>
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="任务名称">
|
||||
<el-input v-model="tableStore.table.params.searchValue" maxlength="32" show-word-limit clearable
|
||||
placeholder="请输入任务名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态:">
|
||||
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择任务状态">
|
||||
<el-option label="运行" :value="1"></el-option>
|
||||
<el-option label="停止" :value="2"></el-option>
|
||||
</el-select>
|
||||
</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 '@/views/system/scheduledTasks/form.vue'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
|
||||
import { timerRun, runTimer, deleteTimer } from '@/api/system-boot/csDictData'
|
||||
defineOptions({
|
||||
name: 'Distributedphotovoltaic/templateConfiguration'
|
||||
})
|
||||
const formDate = ref({
|
||||
date: '',
|
||||
id: ''
|
||||
})
|
||||
const taskFormRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const selectedTime = ref('')
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/system-boot/timer/list',
|
||||
method: 'POST',
|
||||
isWebPaging: true,
|
||||
column: [
|
||||
{ field: 'timerName', title: '任务名称', },
|
||||
{ field: 'actionClass', title: '任务执行器' },
|
||||
{ field: 'cron', title: '定时任务表达式' },
|
||||
{ field: 'remark', title: '备注' },
|
||||
{
|
||||
field: 'jobStatus', title: '状态', width: '100',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'danger',
|
||||
1: 'success',
|
||||
2: 'danger'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未启动',
|
||||
1: '运行中',
|
||||
2: '未启动',
|
||||
}
|
||||
},
|
||||
{ field: 'sort', title: '排序', width: '80' },
|
||||
{
|
||||
title: '操作',
|
||||
width: '220',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'primary',
|
||||
title: '执行',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'primary',
|
||||
title: '是否确认执行该定时任务'
|
||||
},
|
||||
click: row => {
|
||||
timerRun({ id: row.id }).then(res => {
|
||||
ElMessage.success('执行成功')
|
||||
tableStore.index()
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
|
||||
click: async row => {
|
||||
taskFormRef.value.open('编辑定时任务', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '补招',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
|
||||
click: async row => {
|
||||
formDate.value.date = formatDate(new Date(), 'YYYY-MM-DD')
|
||||
formDate.value.id = row.id
|
||||
dialogVisible.value = true
|
||||
}
|
||||
},
|
||||
{
|
||||
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('新增定时任务')
|
||||
}, 10)
|
||||
}
|
||||
const okRun = () => {
|
||||
runTimer(formDate.value).then(res => {
|
||||
ElMessage.success('操作成功')
|
||||
dialogVisible.value = false
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user