Commit 0e7ae4a8 by yzh

feat:esa前端页面

parent 808b936a
...@@ -110,6 +110,10 @@ export const spiderDataApi = { ...@@ -110,6 +110,10 @@ export const spiderDataApi = {
stDetail: '/spaceTrack/detail', stDetail: '/spaceTrack/detail',
stDataDelete: '/sspaceTrackt/delete', stDataDelete: '/sspaceTrackt/delete',
exportSpiderData: '/export/downloadFile', exportSpiderData: '/export/downloadFile',
esaList: '/esa/list',
esaMissionDetail: '/esa/missionDetail',
esaStationDetail: '/esa/stationDetail',
} as const } as const
......
...@@ -91,3 +91,31 @@ export function exportSpiderData(data: UserQueryParams) { ...@@ -91,3 +91,31 @@ export function exportSpiderData(data: UserQueryParams) {
data data
}) as unknown as Promise<ApiResponse> }) as unknown as Promise<ApiResponse>
} }
// 获取esa数据列表
export function getESAList(data: UserQueryParams) {
return request({
url: spiderDataApi.esaList,
method: POST,
data
}) as unknown as Promise<ApiResponse>
}
// 获取esa任务详情
export function getESAMissionDetail(data: UserQueryParams) {
return request({
url: spiderDataApi.esaMissionDetail,
method: POST,
data
}) as unknown as Promise<ApiResponse>
}
// 获取esa站点详情
export function getESAStationDetail(data: UserQueryParams) {
return request({
url: spiderDataApi.esaStationDetail,
method: POST,
data
}) as unknown as Promise<ApiResponse>
}
...@@ -18,6 +18,7 @@ const props = defineProps({ ...@@ -18,6 +18,7 @@ const props = defineProps({
shortcuts: { type: Array as PropType<shortcutsType[]>, default: () => [] } shortcuts: { type: Array as PropType<shortcutsType[]>, default: () => [] }
}) })
const defaultValue = ref('') const defaultValue = ref('')
const cronLabel = ref()
const dialogVisible = ref(false) const dialogVisible = ref(false)
const getYear = () => { const getYear = () => {
let v: number[] = [] let v: number[] = []
...@@ -217,7 +218,7 @@ const value_second = computed(() => { ...@@ -217,7 +218,7 @@ const value_second = computed(() => {
} else if (v.type == '1') { } else if (v.type == '1') {
return v.range.start + '-' + v.range.end return v.range.start + '-' + v.range.end
} else if (v.type == '2') { } else if (v.type == '2') {
return v.loop.start + '/' + v.loop.end return '*' + '/' + v.loop.end
} else if (v.type == '3') { } else if (v.type == '3') {
return v.appoint.length > 0 ? v.appoint.join(',') : '*' return v.appoint.length > 0 ? v.appoint.join(',') : '*'
} else { } else {
...@@ -231,7 +232,7 @@ const value_minute = computed(() => { ...@@ -231,7 +232,7 @@ const value_minute = computed(() => {
} else if (v.type == '1') { } else if (v.type == '1') {
return v.range.start + '-' + v.range.end return v.range.start + '-' + v.range.end
} else if (v.type == '2') { } else if (v.type == '2') {
return v.loop.start + '/' + v.loop.end return '*' + '/' + v.loop.end
} else if (v.type == '3') { } else if (v.type == '3') {
return v.appoint.length > 0 ? v.appoint.join(',') : '*' return v.appoint.length > 0 ? v.appoint.join(',') : '*'
} else { } else {
...@@ -245,7 +246,7 @@ const value_hour = computed(() => { ...@@ -245,7 +246,7 @@ const value_hour = computed(() => {
} else if (v.type == '1') { } else if (v.type == '1') {
return v.range.start + '-' + v.range.end return v.range.start + '-' + v.range.end
} else if (v.type == '2') { } else if (v.type == '2') {
return v.loop.start + '/' + v.loop.end return '*' + '/' + v.loop.end
} else if (v.type == '3') { } else if (v.type == '3') {
return v.appoint.length > 0 ? v.appoint.join(',') : '*' return v.appoint.length > 0 ? v.appoint.join(',') : '*'
} else { } else {
...@@ -259,7 +260,7 @@ const value_day = computed(() => { ...@@ -259,7 +260,7 @@ const value_day = computed(() => {
} else if (v.type == '1') { } else if (v.type == '1') {
return v.range.start + '-' + v.range.end return v.range.start + '-' + v.range.end
} else if (v.type == '2') { } else if (v.type == '2') {
return v.loop.start + '/' + v.loop.end return '*' + '/' + v.loop.end
} else if (v.type == '3') { } else if (v.type == '3') {
return v.appoint.length > 0 ? v.appoint.join(',') : '*' return v.appoint.length > 0 ? v.appoint.join(',') : '*'
} else if (v.type == '4') { } else if (v.type == '4') {
...@@ -275,7 +276,7 @@ const value_month = computed(() => { ...@@ -275,7 +276,7 @@ const value_month = computed(() => {
} else if (v.type == '1') { } else if (v.type == '1') {
return v.range.start + '-' + v.range.end return v.range.start + '-' + v.range.end
} else if (v.type == '2') { } else if (v.type == '2') {
return v.loop.start + '/' + v.loop.end return '*' + '/' + v.loop.end
} else if (v.type == '3') { } else if (v.type == '3') {
return v.appoint.length > 0 ? v.appoint.join(',') : '*' return v.appoint.length > 0 ? v.appoint.join(',') : '*'
} else { } else {
...@@ -334,10 +335,56 @@ watch( ...@@ -334,10 +335,56 @@ watch(
() => props.modelValue, () => props.modelValue,
() => { () => {
defaultValue.value = props.modelValue defaultValue.value = props.modelValue
cronLabel.value = parseCronExpression(props.modelValue)
} }
) )
const parseCronExpression = (cronExpression: string) => {
const res = cronExpression.split('*').length - 1
if (res >= 5) {
const aaa = cronExpression.split(' ')
for (let i = 0; i < aaa.length; i++) {
if (aaa[i] != '*') {
if (i == 0) {
if (aaa[i].length === 3) {
return `每${aaa[i][2]}秒执行一次`
} else {
return `每${aaa[i][2] + aaa[i][3]}秒执行一次`
}
} else if (i == 1) {
if (aaa[i].length === 3) {
return `每${aaa[i][2]}分钟执行一次`
} else {
return `每${aaa[i][2] + aaa[i][3]}分钟执行一次`
}
} else if (i == 2) {
if (aaa[i].length === 3) {
return `每${aaa[i][2]}小时执行一次`
} else {
return `每${aaa[i][2] + aaa[i][3]}小时执行一次`
}
} else if (i == 3) {
if (aaa[i].length === 3) {
return `每${aaa[i][2]}天执行一次`
} else {
return `每${aaa[i][2] + aaa[i][3]}天执行一次`
}
} else if (i == 4) {
if (aaa[i].length === 3) {
return `每${aaa[i][2]}月执行一次`
} else {
return `每${aaa[i][2] + aaa[i][3]}月执行一次`
}
}
}
}
} else if(cronExpression == '* * * * * *'){
return `请生成表达式`
}
}
onMounted(() => { onMounted(() => {
defaultValue.value = props.modelValue if(props.modelValue != '* * * * * *'){
cronLabel.value = parseCronExpression(props.modelValue)
}
}) })
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const select = ref() const select = ref()
...@@ -499,11 +546,48 @@ const submit = () => { ...@@ -499,11 +546,48 @@ const submit = () => {
year year
const res = defaultValue.value.split('*').length - 1 const res = defaultValue.value.split('*').length - 1
console.log(defaultValue.value) const cronRes = defaultValue.value.split(' ')
// cronLabel
for (let i = 0; i < cronRes.length; i++) {
if (cronRes[i] != '*') {
if (i == 0) {
if (cronRes[i].length === 3) {
cronLabel.value = `每${cronRes[i][2]}秒执行一次`
} else {
cronLabel.value = `每${cronRes[i][2] + cronRes[i][3]}秒执行一次`
}
} else if (i == 1) {
if (cronRes[i].length === 3) {
cronLabel.value = `每${cronRes[i][2]}分钟执行一次`
} else {
cronLabel.value = `每${cronRes[i][2] + cronRes[i][3]}分钟执行一次`
}
} else if (i == 2) {
if (cronRes[i].length === 3) {
cronLabel.value = `每${cronRes[i][2]}小时执行一次`
} else {
cronLabel.value = `每${cronRes[i][2] + cronRes[i][3]}小时执行一次`
}
} else if (i == 3) {
if (cronRes[i].length === 3) {
cronLabel.value = `每${cronRes[i][2]}天执行一次`
} else {
cronLabel.value = `每${cronRes[i][2] + cronRes[i][3]}天执行一次`
}
} else if (i == 4) {
if (cronRes[i].length === 3) {
cronLabel.value = `每${cronRes[i][2]}月执行一次`
} else {
cronLabel.value = `每${cronRes[i][2] + cronRes[i][3]}月执行一次`
}
}
}
}
if (res >= 5) { if (res >= 5) {
emit('update:modelValue', defaultValue.value) emit('update:modelValue', defaultValue.value)
dialogVisible.value = false dialogVisible.value = false
}else{ } else {
ElMessage.warning('cron表达式错误,只可设置一个间隔') ElMessage.warning('cron表达式错误,只可设置一个间隔')
emit('update:modelValue', defaultValue.value) emit('update:modelValue', defaultValue.value)
} }
...@@ -516,7 +600,7 @@ const inputChange = () => { ...@@ -516,7 +600,7 @@ const inputChange = () => {
</script> </script>
<template> <template>
<div> <div>
<el-input v-model="defaultValue" disabled class="input-with-select" v-bind="$attrs" @input="inputChange"> <el-input v-model="cronLabel" disabled class="input-with-select" v-bind="$attrs" @input="inputChange">
</el-input> </el-input>
<div class="sc-cron"> <div class="sc-cron">
<el-tabs> <el-tabs>
...@@ -528,7 +612,7 @@ const inputChange = () => { ...@@ -528,7 +612,7 @@ const inputChange = () => {
</div> </div>
</template> </template>
<el-form> <el-form>
<el-form-item label="类型" > <el-form-item label="类型">
<el-radio-group v-model="cronValue.second.type"> <el-radio-group v-model="cronValue.second.type">
<el-radio-button value="0">重置</el-radio-button> <el-radio-button value="0">重置</el-radio-button>
<!-- <el-radio-button value="1">范围</el-radio-button> --> <!-- <el-radio-button value="1">范围</el-radio-button> -->
...@@ -840,19 +924,18 @@ const inputChange = () => { ...@@ -840,19 +924,18 @@ const inputChange = () => {
background-color: var(--el-fill-color-blank); background-color: var(--el-fill-color-blank);
} }
.el-radio-button__inner{ .el-radio-button__inner {
background: #1d5484; background: #1d5484;
} }
</style> </style>
<style> <style>
.el-input.is-disabled .el-input__wrapper{ .el-input.is-disabled .el-input__wrapper {
background: #1d5484; background: #1d5484;
box-shadow: 0,0,0,0px; box-shadow: 0, 0, 0, 0px;
} }
.el-radio-button__inner{
.el-radio-button__inner {
background: #1d5484; background: #1d5484;
color: #fff; color: #fff;
border: none; border: none;
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
<el-checkbox label="DSN数据" value="dsn" id="dsn-checkbox"/> <el-checkbox label="DSN数据" value="dsn" id="dsn-checkbox"/>
<el-checkbox label="ITU数据" value="itu" id="itu-checkbox"/> <el-checkbox label="ITU数据" value="itu" id="itu-checkbox"/>
<el-checkbox label="ST数据" value="spaceTrack" id="st-checkbox"/> <el-checkbox label="ST数据" value="spaceTrack" id="st-checkbox"/>
<el-checkbox label="ESA数据" value="esa" id="st-checkbox"/>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -295,6 +297,10 @@ const saveToSelectedLocation = async (blobData: any, fileHandle: any) => { ...@@ -295,6 +297,10 @@ const saveToSelectedLocation = async (blobData: any, fileHandle: any) => {
// 关闭弹窗的方法 // 关闭弹窗的方法
const close = () => { const close = () => {
exportObject.value = {
timeValue: [],
spiderType: []
}
formRef.value?.clearValidate() formRef.value?.clearValidate()
exportDialogVisible.value = false exportDialogVisible.value = false
} }
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
jumper-text="跳转" jumper-text="跳转"
/> />
</el-config-provider> </el-config-provider>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
......
...@@ -125,6 +125,7 @@ export interface UserQueryParams { ...@@ -125,6 +125,7 @@ export interface UserQueryParams {
filters?: any filters?: any
norad_cat_id?: string norad_cat_id?: string
object_name?: string object_name?: string
name?:string
spacecraft?:string
station?:string
} }
\ No newline at end of file
...@@ -300,12 +300,19 @@ const dataTime = ref('') ...@@ -300,12 +300,19 @@ const dataTime = ref('')
const recordTime = ref('') const recordTime = ref('')
// 是否暂停使用 // 是否暂停使用
const isSuspended = ref('') const isSuspended = ref('')
interface dsnInfo {
targetName:string
targetNam:string
}
const dsnInfoDialog = ref<dsnInfo>()
// 存放定时器的id // 存放定时器的id
const timerId = ref<number | null>() const timerId = ref<number | null>()
const tableData = ref([]) const tableData = ref()
const pageObj = ref({ const pageObj = ref({
total: 10, total: 10,
pageSize: 10, pageSize: 1,
pageNo: 1 pageNo: 1
}) })
// 查看数据详情的方法 // 查看数据详情的方法
...@@ -331,7 +338,14 @@ const handleDetails = (row: any) => { ...@@ -331,7 +338,14 @@ const handleDetails = (row: any) => {
// 获取dsn数据列表的方法 // 获取dsn数据列表的方法
const getData = async () => { const getData = async () => {
const res = await getDsnList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize }) const res = await getDsnList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize })
tableData.value = res.data.list[0].dishes let dishesData = []
for(let i = 0; i < res.data.list[0].stations.length; i++){
for(let j = 0; j < res.data.list[0].stations[i].dishes.length; j++){
dishesData.push(res.data.list[0].stations[i].dishes[j])
}
}
pageObj.value.total = dishesData.length
tableData.value = dishesData
} }
const handleClose = () => { const handleClose = () => {
detailVisibleValue.value = false detailVisibleValue.value = false
...@@ -351,7 +365,7 @@ const handleRefresh = () => { ...@@ -351,7 +365,7 @@ const handleRefresh = () => {
// 保存id删除的时候用 // 保存id删除的时候用
timerId.value = setInterval(async () => { timerId.value = setInterval(async () => {
const res = await getDsnList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize }); const res = await getDsnList({ page: pageObj.value.pageNo, size: pageObj.value.pageSize });
tableData.value = res.data.list[0].dishes; tableData.value = res.data.list[0].dishes
}, 5000); }, 5000);
} else { } else {
ElMessage.success('停止刷新') ElMessage.success('停止刷新')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="formStyle"> <div class="formStyle">
<el-form inline> <el-form inline>
<el-form-item> <el-form-item>
<el-text class="mx-1" >目标名称:</el-text> <el-text class="mx-1">目标名称:</el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div> <div>
...@@ -11,12 +11,14 @@ ...@@ -11,12 +11,14 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-text class="mx-1" >获取时间:</el-text> <el-text class="mx-1">获取时间:</el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-config-provider :locale="zhCn">
<el-date-picker type="datetimerange" format="YYYY-MM-DD HH:mm:ss" v-model="searchTimeValue" <el-date-picker type="datetimerange" format="YYYY-MM-DD HH:mm:ss" v-model="searchTimeValue"
start-placeholder="开始时间" style="width: 330px" end-placeholder="结束时间" start-placeholder="开始时间" style="width: 330px" end-placeholder="结束时间"
date-format="YYYY/MM/DD ddd" time-format="A hh:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" /> date-format="YYYY/MM/DD ddd" time-format="A hh:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
</el-config-provider>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-text class="mx-1">SNS Notice ID:</el-text> <el-text class="mx-1">SNS Notice ID:</el-text>
...@@ -36,7 +38,7 @@ ...@@ -36,7 +38,7 @@
<div class="m-t-5" /> <div class="m-t-5" />
<div> <div>
<el-table :data="tableData" style="width: 100%" border :row-style="{ height: '42.5px' }" <el-table :data="tableData" style="width: 100%" border :row-style="{ height: '45px' }"
:header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" width="40" /> --> <!-- <el-table-column type="selection" width="40" /> -->
<el-table-column property="number" label="序号" width="55" type="index" /> <el-table-column property="number" label="序号" width="55" type="index" />
...@@ -269,7 +271,16 @@ import Pagination from '@/components/pagination/index.vue' ...@@ -269,7 +271,16 @@ import Pagination from '@/components/pagination/index.vue'
import exportDialog from '@/components/Export/index.vue' import exportDialog from '@/components/Export/index.vue'
import { getItuList, getItuDetail, deleteItuData } from '@/api/spiderData' import { getItuList, getItuDetail, deleteItuData } from '@/api/spiderData'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
// ElConfigProvider 组件
import { ElConfigProvider } from 'element-plus';
// 引入中文包
import zhCn from 'element-plus/es/locale/lang/zh-cn';
defineOptions({ name: 'Pagination' })
// 更改分页文字
zhCn.el.pagination.total = '共 `{total} 条`';
zhCn.el.pagination.goto = '跳至';
zhCn.el.pagination.pagesize = '条/页';
zhCn.el.pagination.pageClassifier = '页';
const searchTargetName = ref('') const searchTargetName = ref('')
const searchTimeValue = ref('') const searchTimeValue = ref('')
const searchTargetId = ref('') const searchTargetId = ref('')
...@@ -370,11 +381,11 @@ const handleClose = () => { ...@@ -370,11 +381,11 @@ const handleClose = () => {
detailVisibleValue.value = false detailVisibleValue.value = false
} }
const handleSearch = async () => { const handleSearch = async () => {
if(searchTargetName.value === '' && searchTargetId.value === '' && searchTimeValue.value === ''){ if (searchTargetName.value === '' && searchTargetId.value === '' && searchTimeValue.value === '') {
ElMessage.warning('请输入搜索内容') ElMessage.warning('请输入搜索内容')
return return
} }
const res = await getItuList({ sat_name: searchTargetName.value, ntc_id: searchTargetId.value, times: searchTimeValue.value , page: pageObj.value.pageNo, size: pageObj.value.pageSize }) const res = await getItuList({ sat_name: searchTargetName.value, ntc_id: searchTargetId.value, times: searchTimeValue.value, page: pageObj.value.pageNo, size: pageObj.value.pageSize })
pageObj.value.total = res.data.total pageObj.value.total = res.data.total
tableData.value = res.data.list tableData.value = res.data.list
} }
...@@ -386,6 +397,7 @@ onMounted(() => { ...@@ -386,6 +397,7 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
// 调整表单项间距 // 调整表单项间距
.detailForm { .detailForm {
// background-image: url("@/assets/picture/dialog1.png"); // background-image: url("@/assets/picture/dialog1.png");
// background-size: 100% 100%; // background-size: 100% 100%;
// background-repeat: no-repeat; // background-repeat: no-repeat;
...@@ -417,11 +429,9 @@ onMounted(() => { ...@@ -417,11 +429,9 @@ onMounted(() => {
.el-text { .el-text {
color: #FFFFFF; color: #FFFFFF;
} }
</style> </style>
<style> <style>
.el-input { .el-input {
--el-input-text-color: #FFFFFF; --el-input-text-color: #FFFFFF;
} }
......
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
<el-text class="mx-1">获取时间:</el-text> <el-text class="mx-1">获取时间:</el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-date-picker v-model="timeValue" type="datetimerange" format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始时间" <el-config-provider :locale="zhCn">
end-placeholder="结束时间" date-format="YYYY/MM/DD ddd" time-format="A hh:mm:ss" style="width: 330px" <el-date-picker v-model="timeValue" type="datetimerange" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" /> start-placeholder="开始时间" end-placeholder="结束时间" date-format="YYYY/MM/DD ddd"
time-format="A hh:mm:ss" style="width: 330px" value-format="YYYY-MM-DD HH:mm:ss" />
</el-config-provider>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-text class="mx-1">NORAD CAT ID:</el-text> <el-text class="mx-1">NORAD CAT ID:</el-text>
...@@ -41,7 +43,7 @@ ...@@ -41,7 +43,7 @@
<div class="m-t-5" /> <div class="m-t-5" />
<div> <div>
<el-table :data="tableData" style="width: 100%" border :row-style="{ height: '43.5px' }" <el-table :data="tableData" style="width: 100%" border :row-style="{ height: '45.5px' }"
:header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" width="40" /> --> <!-- <el-table-column type="selection" width="40" /> -->
<el-table-column property="number" label="序号" width="55" type="index" /> <el-table-column property="number" label="序号" width="55" type="index" />
...@@ -176,7 +178,16 @@ import Pagination from '@/components/pagination/index.vue' ...@@ -176,7 +178,16 @@ import Pagination from '@/components/pagination/index.vue'
import exportDialog from '@/components/Export/index.vue' import exportDialog from '@/components/Export/index.vue'
import { getStList, getStDetail, deleteStData } from '@/api/spiderData' import { getStList, getStDetail, deleteStData } from '@/api/spiderData'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
// ElConfigProvider 组件
import { ElConfigProvider } from 'element-plus';
// 引入中文包
import zhCn from 'element-plus/es/locale/lang/zh-cn';
defineOptions({ name: 'Pagination' })
// 更改分页文字
zhCn.el.pagination.total = '共 `{total} 条`';
zhCn.el.pagination.goto = '跳至';
zhCn.el.pagination.pagesize = '条/页';
zhCn.el.pagination.pageClassifier = '页';
const searchTargetName = ref('') const searchTargetName = ref('')
const noradCatId = ref('') const noradCatId = ref('')
const showDeleteDialog = ref(false) const showDeleteDialog = ref(false)
...@@ -247,11 +258,11 @@ const handleClose = () => { ...@@ -247,11 +258,11 @@ const handleClose = () => {
detailVisibleValue.value = false detailVisibleValue.value = false
} }
const handleSearch = async () => { const handleSearch = async () => {
if(searchTargetName.value === '' && noradCatId.value === '' && timeValue.value === ''){ if (searchTargetName.value === '' && noradCatId.value === '' && timeValue.value === '') {
ElMessage.warning('请输入搜索内容') ElMessage.warning('请输入搜索内容')
return return
} }
const res = await getStList({ norad_cat_id: noradCatId.value, object_name: searchTargetName.value, times:timeValue.value, page: pageObj.value.pageNo, size: pageObj.value.pageSize }) const res = await getStList({ norad_cat_id: noradCatId.value, object_name: searchTargetName.value, times: timeValue.value, page: pageObj.value.pageNo, size: pageObj.value.pageSize })
tableData.value = res.data.list tableData.value = res.data.list
pageObj.value.total = res.data.total pageObj.value.total = res.data.total
} }
......
...@@ -5,22 +5,6 @@ ...@@ -5,22 +5,6 @@
<div class="custom-style flex gap-4"> <div class="custom-style flex gap-4">
<el-segmented v-model="mode" :options="sizeOptions" style="margin-bottom: 1rem" size="default" /> <el-segmented v-model="mode" :options="sizeOptions" style="margin-bottom: 1rem" size="default" />
<el-button type="primary" @click="handleExport">导出</el-button> <el-button type="primary" @click="handleExport">导出</el-button>
<!-- <el-button type="primary" @click="handleExport">导入</el-button> -->
<!-- <el-upload ref="upload" class="upload-demo"
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :limit="1"
:on-exceed="handleExceed" :auto-upload="false">
<template #trigger>
<el-button type="primary">select file</el-button>
</template>
<el-button class="ml-3" type="success" @click="submitUpload">
upload to server
</el-button>
<template #tip>
<div class="el-upload__tip text-red">
limit 1 file, new file will cover the old file
</div>
</template>
</el-upload> -->
</div> </div>
</div> </div>
<!-- 综合数据页面组件 --> <!-- 综合数据页面组件 -->
...@@ -35,6 +19,7 @@ ...@@ -35,6 +19,7 @@
<!-- ST数据页面组件 --> <!-- ST数据页面组件 -->
<stDataTab v-if="mode === 'ST数据'"> <stDataTab v-if="mode === 'ST数据'">
</stDataTab> </stDataTab>
<!-- ESA数据页面组件 -->
<esDataTab v-if="mode === 'ESA数据'"> <esDataTab v-if="mode === 'ESA数据'">
</esDataTab> </esDataTab>
</div> </div>
...@@ -51,14 +36,13 @@ import ituDataTab from './components/ituDataTab.vue' ...@@ -51,14 +36,13 @@ import ituDataTab from './components/ituDataTab.vue'
import stDataTab from './components/stDataTab.vue' import stDataTab from './components/stDataTab.vue'
import dsnDataTab from './components/dsnData/dsnTab.vue' import dsnDataTab from './components/dsnData/dsnTab.vue'
import esDataTab from './components/esDataTab.vue' import esDataTab from './components/esDataTab.vue'
import exportDialog from '@/components/Export/index.vue' import exportDialog from '@/components/Export/index.vue'
import { genFileId } from 'element-plus' import { genFileId } from 'element-plus'
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus' import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
// const
const mode = ref('DSN数据') const mode = ref('DSN数据')
const showDeleteDialog = ref(false) const showDeleteDialog = ref(false)
const sizeOptions = ['DSN数据', 'ITU数据', 'ST数据', 'ES数据'] const sizeOptions = ['DSN数据', 'ITU数据', 'ST数据', 'ESA数据']
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const modeValue = ref<any>('数据展示') const modeValue = ref<any>('数据展示')
...@@ -90,6 +74,7 @@ onMounted(() => { ...@@ -90,6 +74,7 @@ onMounted(() => {
modeValue.value = route.query.mode modeValue.value = route.query.mode
mode.value = modeValue.value mode.value = modeValue.value
} }
console.log(mode.value)
}) })
</script> </script>
......
...@@ -78,10 +78,12 @@ const rules = ref<FormRules<RuleForm>>({ ...@@ -78,10 +78,12 @@ const rules = ref<FormRules<RuleForm>>({
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
// 计算字符串中'*'的数量 // 计算字符串中'*'的数量
const starCount = (value.match(/\*/g) || []).length; const starCount = (value.match(/\//g) || []).length;
if (starCount < 5) { if (starCount > 1) {
callback(new Error('cron表达式最多设置一个间隔')); callback(new Error('cron表达式最多设置一个间隔'));
} else { }else if(starCount == 0){
callback(new Error('请设置cron表达式'));
}else {
callback(); callback();
} }
}, },
...@@ -189,7 +191,7 @@ watch( ...@@ -189,7 +191,7 @@ watch(
} }
if (!newVisible) { if (!newVisible) {
// 清空表单 // 清空表单
cronExpression.value = '' // cronExpression.value = ''
} }
}, },
{ immediate: true } { immediate: true }
......
...@@ -140,7 +140,7 @@ const taskName = ref('') ...@@ -140,7 +140,7 @@ const taskName = ref('')
const taskValue = ref('') const taskValue = ref('')
const belongSpiderType = ref('') const belongSpiderType = ref('')
const router = useRouter() const router = useRouter()
const frequency = ref('') const frequency = ref()
const editMode = ref(AddMode.UPDATE_TASK) const editMode = ref(AddMode.UPDATE_TASK)
const deleteMode = ref(DeleteMode.SINGLE_DELETE) const deleteMode = ref(DeleteMode.SINGLE_DELETE)
const showDeleteDialog = ref(false) const showDeleteDialog = ref(false)
...@@ -188,8 +188,10 @@ const changeStatus = async (task: any, newStatus: string) => { ...@@ -188,8 +188,10 @@ const changeStatus = async (task: any, newStatus: string) => {
const handleEdit = () => { const handleEdit = () => {
} }
// 打开新建任务弹窗
const openTaskDialog = () => { const openTaskDialog = () => {
editMode.value = AddMode.ADD_TASK editMode.value = AddMode.ADD_TASK
frequency.value = '* * * * * *'
showTaskDialog.value = true showTaskDialog.value = true
} }
// 获取任务列表的方法 // 获取任务列表的方法
......
...@@ -9,20 +9,12 @@ ...@@ -9,20 +9,12 @@
<el-text class="mx-1">时间:</el-text> <el-text class="mx-1">时间:</el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-date-picker v-model="timeValue" type="datetimerange" start-placeholder="Start date" <el-config-provider :locale="zhCn">
end-placeholder="End date" format="YYYY-MM-DD HH:mm:ss" date-format="YYYY/MM/DD ddd" <el-date-picker v-model="timeValue" type="datetimerange" start-placeholder="开始时间"
time-format="A hh:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"/> end-placeholder="结束时间" format="YYYY-MM-DD HH:mm:ss" date-format="YYYY/MM/DD ddd"
time-format="A hh:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
</el-config-provider>
</el-form-item> </el-form-item>
<!-- <el-form-item>
<el-text class="mx-1">调度状态:</el-text>
</el-form-item>
<el-form-item>
<div>
<el-select v-model="taskValue" placeholder="请选择" style="width: 220px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item> -->
<el-form-item> <el-form-item>
<el-space> <el-space>
<el-button type="primary" @click="searchData">查询</el-button> <el-button type="primary" @click="searchData">查询</el-button>
...@@ -38,7 +30,6 @@ ...@@ -38,7 +30,6 @@
<el-table :data="tableData" style="width: 100%" border :header-cell-style="{ textAlign: 'center' }" <el-table :data="tableData" style="width: 100%" border :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }"> :cell-style="{ textAlign: 'center' }">
<el-table-column property="number" label="序号" width="55" type="index" /> <el-table-column property="number" label="序号" width="55" type="index" />
<!-- <el-table-column property="project" label="项目名称" show-overflow-tooltip /> -->
<el-table-column property="spider" label="所属爬虫" show-overflow-tooltip /> <el-table-column property="spider" label="所属爬虫" show-overflow-tooltip />
<el-table-column property="schedule_mode" label="调度模式" show-overflow-tooltip /> <el-table-column property="schedule_mode" label="调度模式" show-overflow-tooltip />
<el-table-column property="run_status" label="调度状态" show-overflow-tooltip> <el-table-column property="run_status" label="调度状态" show-overflow-tooltip>
...@@ -57,15 +48,7 @@ ...@@ -57,15 +48,7 @@
{{ scope.row.run_status === "unknown" ? '已结束' : scope.row.run_status }} {{ scope.row.run_status === "unknown" ? '已结束' : scope.row.run_status }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column property="duration" label="持续时间" show-overflow-tooltip /> -->
<el-table-column property="create_time" label="调度时间" width="200" show-overflow-tooltip /> <el-table-column property="create_time" label="调度时间" width="200" show-overflow-tooltip />
<!-- <el-table-column label="运行日志" width="120">
<template #default="scope">
<el-button size="small" plain type="primary" @click="handleDetails(scope.row)">
日志
</el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
</div> </div>
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4"> <div class="pagination w-full flex flex-row-reverse pr-4 m-t-4">
...@@ -82,7 +65,16 @@ import { useRoute } from 'vue-router' ...@@ -82,7 +65,16 @@ import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getSpiderTaskRecord } from '@/api/spiderTask.ts' import { getSpiderTaskRecord } from '@/api/spiderTask.ts'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
// ElConfigProvider 组件
import { ElConfigProvider } from 'element-plus';
// 引入中文包
import zhCn from 'element-plus/es/locale/lang/zh-cn';
defineOptions({ name: 'Pagination' })
// 更改分页文字
zhCn.el.pagination.total = '共 `{total} 条`';
zhCn.el.pagination.goto = '跳至';
zhCn.el.pagination.pagesize = '条/页';
zhCn.el.pagination.pageClassifier = '页';
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const taskValue = ref('') const taskValue = ref('')
...@@ -146,7 +138,7 @@ const searchData = async () => { ...@@ -146,7 +138,7 @@ const searchData = async () => {
const endTime = timeValue.value[1] const endTime = timeValue.value[1]
resTime.push(startTime) resTime.push(startTime)
resTime.push(endTime) resTime.push(endTime)
const res = await getSpiderTaskRecord({ page: pageObj.value.pageNo, size: pageObj.value.pageSize, status: 'total' ,times: resTime}) const res = await getSpiderTaskRecord({ page: pageObj.value.pageNo, size: pageObj.value.pageSize, status: 'total', times: resTime })
pageObj.value.total = res.data.total pageObj.value.total = res.data.total
tableData.value = res.data.list tableData.value = res.data.list
} }
......
...@@ -31,7 +31,7 @@ export default defineConfig({ ...@@ -31,7 +31,7 @@ export default defineConfig({
proxy: { proxy: {
// 代理API请求,使用更精确的路径匹配 // 代理API请求,使用更精确的路径匹配
'/api': { '/api': {
target: 'http://127.0.0.1:5001/', target: 'http://192.168.0.176:5001/',
changeOrigin: true, changeOrigin: true,
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment