|
|
@@ -25,6 +25,62 @@
|
|
|
</a-button>
|
|
|
</div>
|
|
|
|
|
|
+ <AppQueryFilter>
|
|
|
+ <a-row class="queryForm app-query-form query-row">
|
|
|
+ <a-col :flex="'1000px'" class="query-main">
|
|
|
+ <a-form :model="query" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }" label-align="left">
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item field="status" label="状态">
|
|
|
+ <a-select v-model="query.status" placeholder="全部" allow-clear>
|
|
|
+ <a-option value="paused">未开始</a-option>
|
|
|
+ <a-option value="pending">待分配</a-option>
|
|
|
+ <a-option value="assigned">已分配</a-option>
|
|
|
+ <a-option value="running">抢课中</a-option>
|
|
|
+ <a-option value="success">成功</a-option>
|
|
|
+ <a-option value="failed">失败</a-option>
|
|
|
+ <a-option value="cancelled">已取消</a-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item field="student_num" label="学号">
|
|
|
+ <a-input v-model="query.student_num" placeholder="学号" allow-clear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item field="name" label="备注">
|
|
|
+ <a-input v-model="query.name" placeholder="备注关键词" allow-clear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item field="batch_id" label="选课批次">
|
|
|
+ <a-select v-model="query.batch_id" placeholder="全部" allow-clear allow-search>
|
|
|
+ <a-option v-for="item in batchOptions" :key="item.id" :value="item.id">
|
|
|
+ {{ item.name }}({{ item.jx0502zbid }})
|
|
|
+ </a-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </a-col>
|
|
|
+ <a-divider class="query-divider" style="height: 42px" direction="vertical" />
|
|
|
+ <a-col :flex="1" class="app-query-actions">
|
|
|
+ <a-space class="query-actions-space" direction="vertical" :size="18">
|
|
|
+ <a-button type="primary" @click="search">
|
|
|
+ <template #icon><icon-search /></template>
|
|
|
+ 搜索
|
|
|
+ </a-button>
|
|
|
+ <a-button @click="resetQuery">
|
|
|
+ <template #icon><icon-refresh /></template>
|
|
|
+ 重置
|
|
|
+ </a-button>
|
|
|
+ </a-space>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </AppQueryFilter>
|
|
|
+
|
|
|
<a-table
|
|
|
:data="data"
|
|
|
:bordered="false"
|
|
|
@@ -162,6 +218,12 @@
|
|
|
<a-switch v-model="form.enable_ggxxk" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :xs="24" :sm="12">
|
|
|
+ <a-form-item label="登录失效后自动重新登录">
|
|
|
+ <a-switch v-model="form.auto_relogin" />
|
|
|
+ <template #extra>开启后抢课过程中会话失效将自动重新登录并继续</template>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</a-spin>
|
|
|
@@ -193,6 +255,12 @@ const visible = ref(false)
|
|
|
const isCopy = ref(false)
|
|
|
const data = ref([])
|
|
|
const batchOptions = ref([])
|
|
|
+const query = reactive({
|
|
|
+ status: '',
|
|
|
+ student_num: '',
|
|
|
+ name: '',
|
|
|
+ batch_id: ''
|
|
|
+})
|
|
|
const form = reactive({
|
|
|
id: '',
|
|
|
name: '',
|
|
|
@@ -202,6 +270,7 @@ const form = reactive({
|
|
|
coursesText: '',
|
|
|
courseGroupsText: '',
|
|
|
enable_ggxxk: true,
|
|
|
+ auto_relogin: false,
|
|
|
interval_ms: 500
|
|
|
})
|
|
|
|
|
|
@@ -271,6 +340,7 @@ const resetForm = () => {
|
|
|
coursesText: '',
|
|
|
courseGroupsText: '',
|
|
|
enable_ggxxk: true,
|
|
|
+ auto_relogin: false,
|
|
|
interval_ms: 500
|
|
|
})
|
|
|
}
|
|
|
@@ -285,6 +355,7 @@ const fillFormFromTask = (task, { copy = false } = {}) => {
|
|
|
coursesText: (task.courses || []).join('\n'),
|
|
|
courseGroupsText: (task.course_groups || []).join('\n'),
|
|
|
enable_ggxxk: task.enable_ggxxk,
|
|
|
+ auto_relogin: !!task.auto_relogin,
|
|
|
interval_ms: task.interval_ms
|
|
|
})
|
|
|
}
|
|
|
@@ -346,7 +417,12 @@ const loadBatches = async () => {
|
|
|
const getList = async (silent = false) => {
|
|
|
try {
|
|
|
if (!silent) loading.value = true
|
|
|
- const res = await getQkTask()
|
|
|
+ const params = {}
|
|
|
+ if (query.status) params.status = query.status
|
|
|
+ if (query.student_num) params.student_num = query.student_num
|
|
|
+ if (query.name) params.name = query.name
|
|
|
+ if (query.batch_id) params.batch_id = query.batch_id
|
|
|
+ const res = await getQkTask(params)
|
|
|
if (!res || res.code !== 0) {
|
|
|
if (!silent) {
|
|
|
Notification.error({ title: '获取抢课任务失败', content: res?.msg || '请稍后再试' })
|
|
|
@@ -363,6 +439,16 @@ const getList = async (silent = false) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const search = () => getList()
|
|
|
+
|
|
|
+const resetQuery = () => {
|
|
|
+ query.status = ''
|
|
|
+ query.student_num = ''
|
|
|
+ query.name = ''
|
|
|
+ query.batch_id = ''
|
|
|
+ getList()
|
|
|
+}
|
|
|
+
|
|
|
const refreshList = () => getList()
|
|
|
|
|
|
const submitTask = async () => {
|
|
|
@@ -382,6 +468,7 @@ const submitTask = async () => {
|
|
|
courses: validated.courses,
|
|
|
course_groups: validated.courseGroups,
|
|
|
enable_ggxxk: form.enable_ggxxk,
|
|
|
+ auto_relogin: form.auto_relogin,
|
|
|
interval_ms: validated.intervalMs
|
|
|
}
|
|
|
const res = await saveQkTask(payload)
|
|
|
@@ -467,6 +554,24 @@ onUnmounted(() => {
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
+.queryForm {
|
|
|
+ padding: 0;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ @media (min-width: (@app-breakpoint-md + 1px)) {
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.query-main {
|
|
|
+ min-width: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.query-actions-space {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
.table {
|
|
|
margin-top: 4px;
|
|
|
}
|
|
|
@@ -489,5 +594,23 @@ onUnmounted(() => {
|
|
|
.buttonGroup-mobile :deep(.arco-btn) {
|
|
|
flex: 1;
|
|
|
}
|
|
|
+
|
|
|
+ .query-row {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-divider {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-actions-space {
|
|
|
+ margin-top: 4px;
|
|
|
+ flex-direction: row !important;
|
|
|
+ gap: 10px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-actions-space :deep(.arco-btn) {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|