Browse Source

✨ feat: 账号信息展示乐跑星期

Pchen. 4 months ago
parent
commit
8ad7271ab8

+ 14 - 1
src/pages/admin/lepaoAccount/accountList.vue

@@ -109,6 +109,15 @@
                     <a-tag color="green" v-if="record.auto_run">开启</a-tag>
                     <a-tag color="green" v-if="record.auto_run">开启</a-tag>
                     <a-tag color="red" v-else>关闭</a-tag>
                     <a-tag color="red" v-else>关闭</a-tag>
                 </template>
                 </template>
+                <template #auto_day="{ record }">
+                    <span v-if="record.auto_run && record.auto_day && record.auto_day.length > 0">
+                        {{record.auto_day.slice().sort((a, b) => {
+                            if (a === 0) return 1; if (b === 0) return -1; return a - b;
+                        }).map(day => auto_day.find(item => item.value === day)?.label).join(',').replace(/周/g, '')
+                        }}
+                    </span>
+                    <span v-else>-</span>
+                </template>
                 <template #num="{ record }">
                 <template #num="{ record }">
                     {{ record.target_count != record.total_num ? `${record.total_num} / ${(record.target_count === 0 ||
                     {{ record.target_count != record.total_num ? `${record.total_num} / ${(record.target_count === 0 ||
                         record.target_count < record.total_num) ? '∞' : record.target_count}` : '已完成' }} </template>
                         record.target_count < record.total_num) ? '∞' : record.target_count}` : '已完成' }} </template>
@@ -258,7 +267,7 @@ const columns = [
     }, {
     }, {
         title: '创建用户',
         title: '创建用户',
         slotName: 'create_user',
         slotName: 'create_user',
-        width: 170
+        width: 150
     }, {
     }, {
         title: '账号名称',
         title: '账号名称',
         slotName: 'name',
         slotName: 'name',
@@ -288,6 +297,10 @@ const columns = [
         title: '自动乐跑',
         title: '自动乐跑',
         slotName: 'auto_run',
         slotName: 'auto_run',
         width: 90
         width: 90
+    }, {
+        title: '自动乐跑星期',
+        slotName: 'auto_day',
+        width: 155
     }, {
     }, {
         title: '自动乐跑时段',
         title: '自动乐跑时段',
         slotName: 'auto_time',
         slotName: 'auto_time',

+ 14 - 4
src/pages/lepao/accountList/index.vue

@@ -116,13 +116,13 @@
               </a-avatar>
               </a-avatar>
             </template>
             </template>
           </a-table-column>
           </a-table-column>
-          <a-table-column title="学号" :width="100" data-index="student_num" ellipsis tooltip></a-table-column>
+          <a-table-column title="学号" :width="105" data-index="student_num" ellipsis tooltip></a-table-column>
           <a-table-column title="姓名" :width="100">
           <a-table-column title="姓名" :width="100">
             <template #cell="{ record }">
             <template #cell="{ record }">
               {{ record.name ?? '请使用乐跑登录器更新账号信息' }}
               {{ record.name ?? '请使用乐跑登录器更新账号信息' }}
             </template>
             </template>
           </a-table-column>
           </a-table-column>
-          <a-table-column title="性别" :width="80" ellipsis tooltip :filterable="{
+          <a-table-column title="性别" :width="70" ellipsis tooltip :filterable="{
             filters: [
             filters: [
               { text: '男', value: 0 },
               { text: '男', value: 0 },
               { text: '女', value: 1 }
               { text: '女', value: 1 }
@@ -136,7 +136,7 @@
             </template>
             </template>
           </a-table-column>
           </a-table-column>
           <a-table-column title="年级" :width="80" data-index="grade_id" tooltip></a-table-column>
           <a-table-column title="年级" :width="80" data-index="grade_id" tooltip></a-table-column>
-          <a-table-column title="跑区" :width="170">
+          <a-table-column title="跑区" :width="180">
             <template #cell="{ record }">
             <template #cell="{ record }">
               {{ record.area || '随机分配' }}
               {{ record.area || '随机分配' }}
             </template>
             </template>
@@ -155,7 +155,7 @@
               </div>
               </div>
             </template>
             </template>
           </a-table-column> -->
           </a-table-column> -->
-          <a-table-column title="自动乐跑" :width="105" ellipsis tooltip :filterable="{
+          <a-table-column title="自动乐跑" :width="90" ellipsis tooltip :filterable="{
             filters: [
             filters: [
               { text: '开启', value: 1 },
               { text: '开启', value: 1 },
               { text: '关闭', value: 0 }
               { text: '关闭', value: 0 }
@@ -167,6 +167,16 @@
               <a-tag color="red" v-else>关闭</a-tag>
               <a-tag color="red" v-else>关闭</a-tag>
             </template>
             </template>
           </a-table-column>
           </a-table-column>
+          <a-table-column title="自动乐跑星期" :width="155" ellipsis tooltip>
+            <template #cell="{ record }">
+              <span v-if="record.auto_run && record.auto_day && record.auto_day.length > 0">
+                {{record.auto_day.slice().sort((a, b) => {
+                  if (a === 0) return 1; if (b === 0) return -1; return a - b;
+                }).map(day => auto_day.find(item => item.value === day)?.label).join(',').replace(/周/g, '') }}
+              </span>
+              <span v-else>-</span>
+            </template>
+          </a-table-column>
           <a-table-column title="自动乐跑时段" :width="130" ellipsis tooltip>
           <a-table-column title="自动乐跑时段" :width="130" ellipsis tooltip>
             <template #cell="{ record }">
             <template #cell="{ record }">
               {{ autoTimeLabel(record) }}
               {{ autoTimeLabel(record) }}