|
|
@@ -104,7 +104,8 @@
|
|
|
{{ record.sex === 1 ? '男' : (record.sex === 2 ? '女' : '') }}
|
|
|
</template>
|
|
|
<template #auto_run="{ record }">
|
|
|
- <a-tag color="green" v-if="record.auto_run">开启</a-tag>
|
|
|
+ <a-tag color="green" v-if="record.auto_run">{{ record.target_count === 0 ? '开启-不限' :
|
|
|
+ `开启-${record.target_count}次` }}</a-tag>
|
|
|
<a-tag color="red" v-else>关闭</a-tag>
|
|
|
</template>
|
|
|
<template #num="{ record }">
|
|
|
@@ -182,7 +183,13 @@
|
|
|
<a-form-item field="auto_run" label="自动乐跑开关">
|
|
|
<a-switch v-model="form.auto_run" :checked-value="1" :unchecked-value="0" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item field="auto_time" label="自动乐跑时段">
|
|
|
+ <a-form-item field="target_count" label="乐跑目标次数" v-if="form.auto_run">
|
|
|
+ <a-input-number v-model="form.target_count" placeholder="请输入乐跑目标次数" mode="button" />
|
|
|
+ <template #extra>
|
|
|
+ <div>当学期有效次数达到目标次数时自动乐跑将关闭,0为不限次</div>
|
|
|
+ </template>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item field="auto_time" label="自动乐跑时段" v-if="form.auto_run">
|
|
|
<a-select v-model="form.auto_time" placeholder="请选择每天自动乐跑的时段" :options="auto_time" />
|
|
|
</a-form-item>
|
|
|
<a-form-item field="notes" label="备注">
|
|
|
@@ -228,6 +235,7 @@ const form = reactive({
|
|
|
area: '',
|
|
|
auto_run: 1,
|
|
|
auto_time: -1,
|
|
|
+ target_count: 30,
|
|
|
notes: ''
|
|
|
})
|
|
|
|
|
|
@@ -244,7 +252,7 @@ const columns = [
|
|
|
title: 'ID',
|
|
|
dataIndex: 'id',
|
|
|
fixed: 'left',
|
|
|
- width: 60
|
|
|
+ width: 65
|
|
|
}, {
|
|
|
title: '创建用户',
|
|
|
slotName: 'create_user',
|
|
|
@@ -278,10 +286,6 @@ const columns = [
|
|
|
title: '乐跑跑区',
|
|
|
dataIndex: 'area',
|
|
|
width: 150
|
|
|
- }, {
|
|
|
- title: '累计次数',
|
|
|
- slotName: 'num',
|
|
|
- width: 90
|
|
|
}, {
|
|
|
title: '自动乐跑',
|
|
|
slotName: 'auto_run',
|
|
|
@@ -290,6 +294,10 @@ const columns = [
|
|
|
title: '自动乐跑时段',
|
|
|
slotName: 'auto_time',
|
|
|
width: 130
|
|
|
+ }, {
|
|
|
+ title: '学期目标',
|
|
|
+ slotName: 'num',
|
|
|
+ width: 90
|
|
|
}, {
|
|
|
title: '帐号状态',
|
|
|
slotName: 'state',
|
|
|
@@ -344,7 +352,7 @@ const getAccounts = async () => {
|
|
|
const res = await adminAccountList(reqData)
|
|
|
if (!res || res.code !== 0)
|
|
|
return Notification.error({
|
|
|
- title: '获取路径数据失败!',
|
|
|
+ title: '获取账号数据失败!',
|
|
|
content: res?.msg ?? '请稍后再试'
|
|
|
})
|
|
|
|
|
|
@@ -352,7 +360,7 @@ const getAccounts = async () => {
|
|
|
pagination.total = res.pagination.total
|
|
|
} catch (error) {
|
|
|
Notification.error({
|
|
|
- title: '获取路径数据失败!',
|
|
|
+ title: '获取账号数据失败!',
|
|
|
content: error.message || '请稍后再试'
|
|
|
})
|
|
|
} finally {
|
|
|
@@ -368,12 +376,14 @@ const editAccount = (item) => {
|
|
|
form.area = item.area
|
|
|
form.auto_run = item.auto_run
|
|
|
form.auto_time = item.auto_time
|
|
|
+ form.target_count = item.target_count
|
|
|
form.notes = item.notes
|
|
|
} else {
|
|
|
form.id = null
|
|
|
form.student_num = ''
|
|
|
form.auto_run = 1
|
|
|
form.auto_time = 7
|
|
|
+ form.target_count = 30
|
|
|
form.email = email.value
|
|
|
form.notes = ''
|
|
|
}
|
|
|
@@ -517,7 +527,7 @@ const stramptoTime = (time) => {
|
|
|
}
|
|
|
|
|
|
const auto_time = [
|
|
|
- { label: '随机时段', value: -1 },
|
|
|
+ { label: '随机', value: -1 },
|
|
|
...Array.from({ length: 17 }, (_, i) => {
|
|
|
const hour = i + 7
|
|
|
return { label: `${hour} ~ ${hour + 1}时`, value: hour }
|