index.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. <template>
  2. <div class="app-container">
  3. <el-container>
  4. <!-- 左侧区域 -->
  5. <el-aside width="360px" class="left-aside">
  6. <!-- 顶部区域 -->
  7. <div class="left-header">
  8. <div class="left-header-top">
  9. <el-button type="primary" class="search-btn" @click="handleLeftQuery">搜索</el-button>
  10. <el-button type="primary" style="width: 50%" icon="el-icon-plus" @click="handleAddTrainingCamp">新建训练营</el-button>
  11. </div>
  12. <div class="search-input-wrapper">
  13. <el-input
  14. v-model="leftQueryParams.trainingCampName"
  15. placeholder="请输入训练营名称"
  16. prefix-icon="el-icon-search"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleLeftQuery"
  20. />
  21. </div>
  22. <div class="sort-wrapper">
  23. <span class="sort-label">排序方式</span>
  24. <el-select v-model="leftQueryParams.scs"
  25. placeholder="按序号倒序"
  26. size="small"
  27. class="sort-select"
  28. @change="handleSortChange"
  29. >
  30. <el-option label="按序号倒序" value="order_number(desc),training_camp_id(desc)" />
  31. <el-option label="按序号顺序" value="order_number(asc),training_camp_id(desc)" />
  32. </el-select>
  33. </div>
  34. </div>
  35. <!-- 训练营列表 -->
  36. <div class="camp-list" ref="campList" @scroll="handleScroll">
  37. <div
  38. v-for="(item, index) in campList"
  39. :key="index"
  40. class="camp-item"
  41. :class="{ 'active': activeCampIndex === index }"
  42. @click="selectCamp(index)"
  43. >
  44. <div class="camp-content">
  45. <div class="camp-title">
  46. <i class="el-icon-s-flag camp-icon"></i>
  47. {{ item.trainingCampName }}
  48. </div>
  49. <div class="camp-info">
  50. <span>序号:{{ item.orderNumber }}</span>
  51. <span>最新营期开课:{{ item.recentDate || '-' }}</span>
  52. </div>
  53. <div class="camp-stats">
  54. <span class="stat-item">
  55. <i class="el-icon-s-data"></i>
  56. 营期数:{{ item.periodCount || 0 }}
  57. </span>
  58. <span class="stat-item">
  59. <i class="el-icon-user"></i>
  60. 会员总数:{{ item.vipCount || 0 }}
  61. </span>
  62. </div>
  63. </div>
  64. <div class="camp-actions">
  65. <el-button type="text" class="action-btn delete-btn" @click.stop="handleDeleteCamp(item)">删除</el-button>
  66. <el-button type="text" class="action-btn copy-btn" @click.stop="handleCopyCamp(item)">复制</el-button>
  67. <el-button type="text" class="action-btn copy-btn" @click.stop="handleEditCamp(item)">编辑</el-button>
  68. </div>
  69. </div>
  70. <!-- 底部加载更多提示 -->
  71. <div v-if="loadingMore" class="loading-more">
  72. <i class="el-icon-loading"></i>
  73. <span>加载中...</span>
  74. </div>
  75. <!-- 所有数据加载完毕提示 -->
  76. <div v-if="campList.length > 0 && !leftQueryParams.hasNextPage && !loadingMore" class="no-more-data">
  77. <span>—— 已加载全部训练营 ——</span>
  78. </div>
  79. </div>
  80. </el-aside>
  81. <!-- 右侧区域 -->
  82. <el-main>
  83. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  84. <el-form-item label="营期名称" prop="periodName">
  85. <el-input
  86. v-model="queryParams.periodName"
  87. placeholder="请输入营期名称"
  88. clearable
  89. size="small"
  90. @keyup.enter.native="handleQuery"
  91. />
  92. </el-form-item>
  93. <el-form-item label="公司" prop="companyIdList">
  94. <el-select v-model="queryParams.companyIdList" placeholder="请选择公司" clearable size="small" multiple>
  95. <el-option
  96. v-for="item in companyOptions"
  97. :key="item.companyId"
  98. :label="item.companyName"
  99. :value="item.companyId"
  100. />
  101. </el-select>
  102. </el-form-item>
  103. <el-form-item label="开营日期开始" prop="periodStartingTime" label-width="120px">
  104. <el-date-picker clearable size="small" style="width: 200px"
  105. v-model="queryParams.periodStartingTime"
  106. type="date"
  107. value-format="yyyy-MM-dd"
  108. placeholder="请选择开营日期开始时间">
  109. </el-date-picker>
  110. </el-form-item>
  111. <el-form-item label="开营日期结束" prop="periodEndTime" label-width="120px">
  112. <el-date-picker clearable size="small" style="width: 300px"
  113. v-model="queryParams.periodEndTime"
  114. type="date"
  115. value-format="yyyy-MM-dd"
  116. placeholder="请选择开营日期结束时间">
  117. </el-date-picker>
  118. </el-form-item>
  119. <el-form-item>
  120. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  121. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  122. </el-form-item>
  123. </el-form>
  124. <el-row :gutter="10" class="mb8">
  125. <el-col :span="1.5">
  126. <el-button
  127. type="primary"
  128. plain
  129. icon="el-icon-plus"
  130. size="mini"
  131. @click="handleAdd"
  132. v-hasPermi="['course:period:add']"
  133. >新增</el-button>
  134. </el-col>
  135. <el-col :span="1.5">
  136. <el-button
  137. type="warning"
  138. plain
  139. icon="el-icon-download"
  140. size="mini"
  141. @click="handleExport"
  142. v-hasPermi="['course:period:export']"
  143. >导出</el-button>
  144. </el-col>
  145. <el-col :span="1.5">
  146. <el-button
  147. type="primary"
  148. plain
  149. icon="el-icon-edit"
  150. size="mini"
  151. @click="handleBatchSetRedPacket"
  152. v-hasPermi="['course:period:export']"
  153. :disabled="batchSetRedPacketDisabled"
  154. >批量设置红包</el-button>
  155. </el-col>
  156. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  157. </el-row>
  158. <el-table v-loading="loading" :data="periodList" @selection-change="handleSelectionChange">
  159. <el-table-column type="selection" width="55" align="center" />
  160. <el-table-column label="营期名称" align="center" prop="periodName" />
  161. <el-table-column label="公司名称" align="center" prop="companyName" />
  162. <el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180" />
  163. <el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180" />
  164. <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
  165. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  166. <template slot-scope="scope">
  167. <el-button
  168. size="mini"
  169. type="text"
  170. icon="el-icon-edit"
  171. @click="handleUpdate(scope.row)"
  172. v-hasPermi="['course:period:edit']"
  173. >修改</el-button>
  174. <!-- <el-button-->
  175. <!-- size="mini"-->
  176. <!-- type="text"-->
  177. <!-- icon="el-icon-edit"-->
  178. <!-- @click="handleCourse(scope.row)"-->
  179. <!-- v-hasPermi="['course:period:edit']"-->
  180. <!-- >课程管理</el-button>-->
  181. <!-- <el-button-->
  182. <!-- size="mini"-->
  183. <!-- type="text"-->
  184. <!-- icon="el-icon-money"-->
  185. <!-- @click="setRedPacket(scope.row)"-->
  186. <!-- >设置红包</el-button>-->
  187. <el-button
  188. size="mini"
  189. type="text"
  190. icon="el-icon-setting"
  191. @click="handlePeriodSettings(scope.row)"
  192. >营期相关设置</el-button>
  193. <el-button
  194. size="mini"
  195. type="text"
  196. icon="el-icon-delete"
  197. @click="handleDelete(scope.row)"
  198. v-hasPermi="['course:period:remove']"
  199. >删除</el-button>
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. <pagination
  204. v-show="total>0"
  205. :total="total"
  206. :page.sync="queryParams.pageNum"
  207. :limit.sync="queryParams.pageSize"
  208. @pagination="getList"
  209. />
  210. </el-main>
  211. </el-container>
  212. <!-- 添加或修改会员营期对话框-->
  213. <el-drawer :title="title" :visible.sync="open" width="700px" append-to-body>
  214. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  215. <el-form-item label="营期名称" prop="periodName">
  216. <el-input v-model="form.periodName" placeholder="请输入营期名称" />
  217. </el-form-item>
  218. <el-form-item label="公司" prop="companyId">
  219. <el-select v-model="form.companyId" placeholder="请选择公司" multiple>
  220. <el-option
  221. v-for="item in companyOptions"
  222. :key="item.companyId"
  223. :label="item.companyName"
  224. :value="item.companyId"
  225. />
  226. </el-select>
  227. </el-form-item>
  228. <el-form-item label="课程风格" prop="courseStyle">
  229. <image-upload v-model="form.courseStyle" :limit="1" />
  230. </el-form-item>
  231. <el-form-item label="直播间风格" prop="liveRoomStyle">
  232. <image-upload v-model="form.liveRoomStyle" :limit="1" />
  233. </el-form-item>
  234. <el-form-item label="红包发放方式" prop="redPacketGrantMethod">
  235. <el-radio-group v-model="form.redPacketGrantMethod">
  236. <el-radio :label="1" >按课程</el-radio>
  237. <el-radio :label="2" >按营期</el-radio>
  238. </el-radio-group>
  239. </el-form-item>
  240. <el-form-item label="营期类型" prop="periodType">
  241. <el-radio-group v-model="form.periodType">
  242. <el-radio :label="1" >多课程</el-radio>
  243. <el-radio :label="2" >单课程</el-radio>
  244. </el-radio-group>
  245. </el-form-item>
  246. <el-form-item label="开营日期" prop="periodStartingTime">
  247. <el-date-picker
  248. :style="{display: form.periodType == 1 ? '' : 'none !important'}"
  249. v-model="form.dateRange"
  250. @change="timeChange(1)"
  251. type="daterange"
  252. range-separator="至"
  253. start-placeholder="开始日期"
  254. end-placeholder="结束日期"
  255. value-format="yyyy-MM-dd">
  256. </el-date-picker>
  257. <el-date-picker
  258. :style="{display: form.periodType == 2 ? '' : 'none !important'}"
  259. @change="timeChange(2)"
  260. v-model="form.date"
  261. type="date"
  262. value-format="yyyy-MM-dd"
  263. placeholder="选择日期">
  264. </el-date-picker>
  265. </el-form-item>
  266. <!-- <div v-if="form.periodType == 1">-->
  267. <!-- <el-form-item label="开课时间" prop="periodType">-->
  268. <!-- <el-radio-group v-model="form.periodType">-->
  269. <!-- <el-radio :label="1" >多课程</el-radio>-->
  270. <!-- <el-radio :label="2" >单课程</el-radio>-->
  271. <!-- </el-radio-group>-->
  272. <!-- </el-form-item>-->
  273. <!-- <el-form-item :label="'第' + item.lesson + '节'" prop="periodStartingTime" v-for="item in form.days">-->
  274. <!-- <el-date-picker-->
  275. <!-- v-model="item.dateRange"-->
  276. <!-- type="datetimerange"-->
  277. <!-- range-separator="至"-->
  278. <!-- start-placeholder="开始日期"-->
  279. <!-- end-placeholder="结束日期"-->
  280. <!-- value-format="yyyy-MM-dd HH:mm:ss">-->
  281. <!-- </el-date-picker>-->
  282. <!-- </el-form-item>-->
  283. <!-- </div>-->
  284. </el-form>
  285. <div class="drawer-footer">
  286. <el-button type="primary" @click="submitForm">确 定</el-button>
  287. <el-button @click="cancel">取 消</el-button>
  288. </div>
  289. </el-drawer>
  290. <!-- 添加训练营对话框 -->
  291. <el-dialog :title="campForm.trainingCampId ? '修改训练营' : '新建训练营'" :visible.sync="campDialogVisible" width="500px" append-to-body>
  292. <el-form ref="campForm" :model="campForm" :rules="campRules" label-width="100px">
  293. <el-form-item label="训练营名称" prop="trainingCampName">
  294. <el-input v-model="campForm.trainingCampName" placeholder="请输入训练营名称" />
  295. </el-form-item>
  296. </el-form>
  297. <div slot="footer" class="dialog-footer">
  298. <el-button type="primary" @click="submitCampForm">确 定</el-button>
  299. <el-button @click="cancelCampForm">取 消</el-button>
  300. </div>
  301. </el-dialog>
  302. <!-- &lt;!&ndash; 添加或修改会员营期对话框&ndash;&gt;-->
  303. <!-- <el-dialog title="课程管理" :visible.sync="course.open" width="75%" top="10px" append-to-body style="padding-bottom: 10px">-->
  304. <!-- <el-row :gutter="10" class="mb8">-->
  305. <!-- <el-col :span="1.5">-->
  306. <!-- <el-button-->
  307. <!-- v-if="(getDiff(course.row.periodStartingTime, course.row.periodEndTime) - course.total) > 0"-->
  308. <!-- type="primary"-->
  309. <!-- icon="el-icon-plus"-->
  310. <!-- size="mini"-->
  311. <!-- @click="handleAddCourse"-->
  312. <!-- v-hasPermi="['course:period:add']"-->
  313. <!-- >添加课程</el-button>-->
  314. <!-- </el-col>-->
  315. <!-- </el-row>-->
  316. <!-- <el-table v-loading="course.loading" :data="course.list">-->
  317. <!-- <el-table-column label="课程" align="center" prop="courseName" width="180" />-->
  318. <!-- <el-table-column label="小节" align="center" prop="videoName" />-->
  319. <!-- <el-table-column label="营期时间" align="center" prop="dayDate" width="150" />-->
  320. <!-- <el-table-column label="创建时间" align="center" prop="createTime" width="150" />-->
  321. <!-- </el-table>-->
  322. <!-- <div slot="footer" class="dialog-footer">-->
  323. <!--&lt;!&ndash; <el-button type="primary" @click="saveCourseData">保存</el-button>&ndash;&gt;-->
  324. <!-- </div>-->
  325. <!-- </el-dialog>-->
  326. <!-- 添加或修改会员营期对话框-->
  327. <el-dialog title="添加课程" :visible.sync="course.addOpen" width="500px" append-to-body>
  328. <el-form ref="courseAddForm" :model="course.form" label-width="100px">
  329. <el-form-item label="课程" prop="courseId">
  330. <el-select filterable v-model="course.form.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(course.form.courseId)" style="width: 100%" :value-key="'dictValue'">
  331. <el-option
  332. v-for="dict in courseList"
  333. :key="dict.dictValue"
  334. :label="dict.dictLabel"
  335. :value="parseInt(dict.dictValue)"
  336. />
  337. </el-select>
  338. </el-form-item>
  339. <el-form-item label="小节" prop="videoId">
  340. <el-select filterable v-model="course.form.videoIds" placeholder="请选择小节" :multiple-limit="getDiff(course.row.periodStartingTime, course.row.periodEndTime) - course.total" multiple clearable size="small" style="width: 100%" :value-key="'dictValue'">
  341. <el-option
  342. v-for="dict in videoList"
  343. :key="dict.dictValue"
  344. :label="dict.dictLabel"
  345. :value="parseInt(dict.dictValue)"
  346. />
  347. </el-select>
  348. </el-form-item>
  349. </el-form>
  350. <div slot="footer" class="dialog-footer">
  351. <el-button type="primary" @click="submitCourseForm">确 定</el-button>
  352. <el-button @click="closeAddCourse">取 消</el-button>
  353. </div>
  354. </el-dialog>
  355. <!-- <red-packet-->
  356. <!-- :visible.sync="redPacketVisible"-->
  357. <!-- :periodId="currentRedPacketData.periodId"-->
  358. <!-- :videoId="currentRedPacketData.videoId"-->
  359. <!-- @success="handleRedPacketSuccess"-->
  360. <!-- />-->
  361. <!-- 营期相关设置抽屉 -->
  362. <el-drawer
  363. title="营期相关设置"
  364. :visible.sync="periodSettingsVisible"
  365. direction="rtl"
  366. size="70%"
  367. :destroy-on-close="true"
  368. append-to-body
  369. custom-class="period-settings-drawer"
  370. >
  371. <div class="drawer-content" style="margin-left: 25px">
  372. <el-tabs v-model="activeTab">
  373. <el-tab-pane label="课程管理" name="course">
  374. <el-row :gutter="10" class="mb8">
  375. <el-col :span="1.5">
  376. <el-button
  377. v-if="(getDiff(periodSettingsData.periodStartingTime, periodSettingsData.periodEndTime) - course.total) > 0"
  378. type="primary"
  379. icon="el-icon-plus"
  380. size="mini"
  381. @click="handleAddCourse"
  382. v-hasPermi="['course:period:add']"
  383. >添加课程</el-button>
  384. </el-col>
  385. </el-row>
  386. <el-table v-loading="course.loading" :data="course.list">
  387. <el-table-column label="课程" align="center" prop="courseName" width="180" />
  388. <el-table-column label="小节" align="center" prop="videoName" />
  389. <el-table-column label="营期时间" align="center" prop="dayDate" width="150" />
  390. <el-table-column label="创建时间" align="center" prop="createTime" width="150" />
  391. </el-table>
  392. </el-tab-pane>
  393. <el-tab-pane label="公司列表" name="company">
  394. <red-packet
  395. :visible.sync="redPacketVisible"
  396. :activeTab="activeTab"
  397. :periodId="periodSettingsData.periodId"
  398. @success="handleRedPacketSuccess"
  399. />
  400. </el-tab-pane>
  401. </el-tabs>
  402. </div>
  403. </el-drawer>
  404. <batch-red-packet
  405. :visible.sync="batchRedPacketVisible"
  406. :selected-data="selectedPeriods"
  407. @save="handleBatchRedPacketSave"
  408. @success="handleBatchRedPacketSuccess"
  409. />
  410. </div>
  411. </template>
  412. <script>
  413. import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, updateListCourseData} from "@/api/course/userCoursePeriod";
  414. import {getCompanyList} from "@/api/company/company";
  415. import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
  416. import { courseList,videoList } from '@/api/course/courseRedPacketLog'
  417. import RedPacket from './redPacket.vue'
  418. import BatchRedPacket from './batchRedPacket.vue'
  419. export default {
  420. name: "Period",
  421. components: {
  422. RedPacket,
  423. BatchRedPacket
  424. },
  425. data() {
  426. return {
  427. // 遮罩层
  428. loading: true,
  429. // 左侧遮罩层
  430. leftLoading: true,
  431. // 选中数组
  432. ids: [],
  433. // 非单个禁用
  434. single: true,
  435. // 非多个禁用
  436. multiple: true,
  437. // 显示搜索条件
  438. showSearch: true,
  439. // 总条数
  440. total: 0,
  441. // 左侧总条数
  442. leftTotal: 0,
  443. // 会员营期表格数据
  444. periodList: [],
  445. // 左侧列表数据
  446. leftList: [],
  447. videoList: [],
  448. // 弹出层标题
  449. title: "",
  450. // 是否显示弹出层
  451. open: false,
  452. // 查询参数
  453. queryParams: {
  454. pageNum: 1,
  455. pageSize: 10,
  456. periodName: null,
  457. periodStartingTime: null,
  458. periodEndTime: null,
  459. companyIdList: []
  460. },
  461. // 左侧查询参数
  462. leftQueryParams: {
  463. pageNum: 1,
  464. pageSize: 10,
  465. hasNextPage: false,
  466. scs: 'order_number(desc),training_camp_id(desc)',
  467. trainingCampName: null
  468. },
  469. // 表单参数
  470. form: {},
  471. course: {
  472. open: false,
  473. row:{},
  474. list:[],
  475. queryParams: {
  476. pageNum: 1,
  477. pageSize: 10,
  478. },
  479. loading: true,
  480. total: 0,
  481. addOpen: false,
  482. form: {},
  483. },
  484. // 表单校验
  485. rules: {
  486. },
  487. // 公司选项
  488. companyOptions: [],
  489. // 训练营列表
  490. campList: [],
  491. // 激活的训练营索引
  492. activeCampIndex: null,
  493. // 训练营对话框是否显示
  494. campDialogVisible: false,
  495. courseList: false,
  496. // 训练营表单
  497. campForm: {
  498. trainingCampId: null,
  499. trainingCampName: ''
  500. },
  501. // 训练营表单校验
  502. campRules: {
  503. trainingCampName: [
  504. { required: true, message: '训练营名称不能为空', trigger: 'blur' },
  505. { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
  506. ]
  507. },
  508. // 滚动节流标志
  509. scrollThrottle: false,
  510. // 加载更多状态
  511. loadingMore: false,
  512. // 设置红包对话框
  513. redPacketVisible: false,
  514. periodCompanyList: [],
  515. currentRedPacketData: {
  516. periodId: '',
  517. videoId: ''
  518. },
  519. // 营期相关设置抽屉
  520. periodSettingsVisible: false,
  521. activeTab: 'course',
  522. periodSettingsData: {},
  523. companyList: [],
  524. courseDialogVisible: false,
  525. redPacketList: [],
  526. currentCompany: null,
  527. // 选中的营期数据
  528. selectedPeriods: [],
  529. // 批量设置红包按钮是否禁用
  530. batchSetRedPacketDisabled: true,
  531. // 批量设置红包弹出框
  532. batchRedPacketVisible: false,
  533. };
  534. },
  535. created() {
  536. courseList().then(response => {
  537. this.courseList = response.list;
  538. });
  539. // this.getList();
  540. this.getLeftList();
  541. this.getCompanyList();
  542. },
  543. methods: {
  544. /** 查询会员营期列表 */
  545. getList() {
  546. this.loading = true;
  547. const params = { ...this.queryParams };
  548. pagePeriod(params).then(response => {
  549. this.periodList = response.rows;
  550. this.total = response.total;
  551. this.loading = false;
  552. });
  553. },
  554. /** 查询左侧列表 */
  555. getLeftList() {
  556. this.leftLoading = true;
  557. // 重置页码和加载更多状态
  558. this.leftQueryParams.pageNum = 1;
  559. this.loadingMore = false;
  560. // 训练营数据
  561. listCamp(this.leftQueryParams).then(response => {
  562. if (response && response.code === 200) {
  563. this.campList = response.data.list || [];
  564. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  565. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  566. this.selectCamp(this.activeCampIndex);
  567. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  568. this.$nextTick(() => {
  569. const scrollEl = this.$refs.campList;
  570. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  571. this.loadMoreCamps();
  572. }
  573. });
  574. } else {
  575. this.$message.error(response.msg || '获取训练营列表失败');
  576. this.campList = [];
  577. this.leftQueryParams.hasNextPage = false;
  578. }
  579. this.leftLoading = false;
  580. }).catch(error => {
  581. console.error('获取训练营列表失败:', error);
  582. this.$message.error('获取训练营列表失败');
  583. this.campList = [];
  584. this.leftQueryParams.hasNextPage = false;
  585. this.leftLoading = false;
  586. });
  587. },
  588. /** 搜索按钮操作 */
  589. handleQuery() {
  590. this.queryParams.pageNum = 1;
  591. this.getList();
  592. },
  593. /** 左侧搜索按钮操作 */
  594. handleLeftQuery() {
  595. // 重置页码和列表
  596. this.leftQueryParams.pageNum = 1;
  597. this.campList = [];
  598. this.getLeftList();
  599. },
  600. /** 重置按钮操作 */
  601. resetQuery() {
  602. this.resetForm("queryForm");
  603. this.queryParams.companyIdList = [];
  604. this.handleQuery();
  605. },
  606. /** 多选框选中数据 */
  607. handleSelectionChange(selection) {
  608. this.ids = selection.map(item => item.periodId)
  609. this.single = selection.length!==1
  610. this.multiple = !selection.length
  611. // 更新批量设置红包相关数据
  612. this.selectedPeriods = selection;
  613. this.batchSetRedPacketDisabled = selection.length === 0;
  614. },
  615. /** 新增按钮操作 */
  616. handleAdd() {
  617. this.reset();
  618. this.open = true;
  619. this.title = "添加会员营期";
  620. },
  621. /** 修改按钮操作 */
  622. handleUpdate(row) {
  623. this.reset();
  624. const periodId = row.periodId || this.ids
  625. getPeriod(periodId).then(response => {
  626. this.form = response.data;
  627. if(this.form.periodType == 1){
  628. this.form.dateRange = [this.form.periodStartingTime, this.form.periodEndTime];
  629. }
  630. if(this.form.periodType == 1){
  631. this.form.date = this.form.periodStartingTime;
  632. }
  633. this.open = true;
  634. this.title = "修改会员营期";
  635. });
  636. },
  637. /** 提交按钮 */
  638. submitForm() {
  639. this.$refs["form"].validate(valid => {
  640. if (valid) {
  641. let data = JSON.parse(JSON.stringify(this.form));
  642. data.companyId = data.companyId.join()
  643. data.trainingCampId = this.queryParams.trainingCampId
  644. if (data.periodId != null) {
  645. updatePeriod(data).then(response => {
  646. if (response.code === 200) {
  647. this.msgSuccess("修改成功");
  648. this.open = false;
  649. this.getList();
  650. }
  651. });
  652. } else {
  653. addPeriod(data).then(response => {
  654. if (response.code === 200) {
  655. this.msgSuccess("新增成功");
  656. this.open = false;
  657. this.getList();
  658. }
  659. });
  660. }
  661. }
  662. });
  663. },
  664. /** 删除按钮操作 */
  665. handleDelete(row) {
  666. const periodIds = row.periodId || this.ids;
  667. this.$confirm('是否确认删除会员营期编号为"' + periodIds + '"的数据项?', "警告", {
  668. confirmButtonText: "确定",
  669. cancelButtonText: "取消",
  670. type: "warning"
  671. }).then(function() {
  672. return delPeriod(periodIds);
  673. }).then(() => {
  674. this.getList();
  675. this.msgSuccess("删除成功");
  676. }).catch(function() {});
  677. },
  678. /** 导出按钮操作 */
  679. handleExport() {
  680. const queryParams = this.queryParams;
  681. this.$confirm('是否确认导出所有会员营期数据项?', "警告", {
  682. confirmButtonText: "确定",
  683. cancelButtonText: "取消",
  684. type: "warning"
  685. }).then(function() {
  686. return exportPeriod(queryParams);
  687. }).then(response => {
  688. this.download(response.msg);
  689. }).catch(function() {});
  690. },
  691. /** 批量设置红包 */
  692. handleBatchSetRedPacket() {
  693. if (this.selectedPeriods.length === 0) {
  694. this.$message.warning('请至少选择一个营期');
  695. return;
  696. }
  697. this.batchRedPacketVisible = true;
  698. },
  699. /** 处理批量设置红包保存 */
  700. // handleBatchRedPacketSave(data) {
  701. // // 这里等待接口提供后补充具体实现
  702. // // 示例代码:
  703. // // batchSetRedPacket(data).then(response => {
  704. // // if (response.code === 200) {
  705. // // this.$message.success('批量设置成功');
  706. // // this.getList();
  707. // // }
  708. // // });
  709. // this.batchRedPacketVisible = false;
  710. // },
  711. /** 获取公司下拉列表*/
  712. getCompanyList() {
  713. this.loading = true;
  714. getCompanyList().then(response => {
  715. this.companyOptions = response.data;
  716. this.loading = false;
  717. });
  718. },
  719. // 取消按钮
  720. cancel() {
  721. this.open = false;
  722. this.reset();
  723. },
  724. // 表单重置
  725. reset() {
  726. this.form = {
  727. periodId: null,
  728. periodName: null,
  729. companyId: null,
  730. courseId: null,
  731. videoId: null,
  732. trainingCampId: null,
  733. createTime: null,
  734. updateTime: null,
  735. courseStyle: null,
  736. liveRoomStyle: null,
  737. redPacketGrantMethod: 1,
  738. periodType: 1,
  739. periodStartingTime: null,
  740. dateRange: [],
  741. date: null,
  742. days: [],
  743. periodEndTime: null
  744. };
  745. this.resetForm("form");
  746. },
  747. // 处理训练营列表的逻辑
  748. handleDeleteCamp(item) {
  749. this.$confirm(`确定要删除训练营"${item.trainingCampName}"吗?`, '提示', {
  750. confirmButtonText: '删除',
  751. cancelButtonText: '取消',
  752. type: 'warning'
  753. }).then(() => {
  754. // 调用删除训练营API
  755. const trainingCampId = item.trainingCampId;
  756. this.leftLoading = true;
  757. delCamp(trainingCampId).then(response => {
  758. if (response.code === 200) {
  759. this.$message.success('删除成功');
  760. // 从列表中移除
  761. const index = this.campList.findIndex(camp => camp.trainingCampId === trainingCampId);
  762. if (index !== -1) {
  763. this.campList.splice(index, 1);
  764. }
  765. // 如果删除的是当前选中的训练营,则重置选中状态
  766. if (this.activeCampIndex === index) {
  767. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  768. if (this.activeCampIndex !== null) {
  769. // 更新右侧列表
  770. this.selectCamp(this.activeCampIndex);
  771. } else {
  772. // 没有训练营了,清空右侧列表
  773. this.periodList = [];
  774. }
  775. }
  776. } else {
  777. this.$message.error(response.msg || '删除失败');
  778. }
  779. this.leftLoading = false;
  780. }).catch(error => {
  781. this.$message.error('删除失败: ' + error.message);
  782. this.leftLoading = false;
  783. });
  784. }).catch(() => {
  785. this.$message.info('已取消删除');
  786. });
  787. },
  788. /** 复制训练营 */
  789. handleCopyCamp(item) {
  790. // 调用添加训练营API
  791. copyCamp(item.trainingCampId).then(response => {
  792. if (response.code === 200) {
  793. this.$message.success('复制成功');
  794. // 重新加载训练营列表
  795. this.getLeftList();
  796. } else {
  797. this.$message.error(response.msg || '复制训练营失败');
  798. }
  799. }).catch(error => {
  800. this.$message.error('复制训练营失败: ' + error.message);
  801. });
  802. },
  803. /** 修改训练营按钮操作 */
  804. handleEditCamp(item) {
  805. this.resetCampForm();
  806. this.leftLoading = true;
  807. // 获取最新的训练营数据
  808. const trainingCampId = item.trainingCampId;
  809. // 应该调用获取训练营详情的API
  810. setTimeout(() => {
  811. // 填充表单数据
  812. this.campForm = {
  813. trainingCampId: item.trainingCampId,
  814. trainingCampName: item.trainingCampName,
  815. orderNumber: item.orderNumber || 1,
  816. status: item.status !== undefined ? item.status : 1
  817. };
  818. this.campDialogVisible = true;
  819. this.leftLoading = false;
  820. }, 300);
  821. },
  822. /** 新建训练营按钮操作 */
  823. handleAddTrainingCamp() {
  824. this.resetCampForm();
  825. this.campDialogVisible = true;
  826. },
  827. /** 重置训练营表单 */
  828. resetCampForm() {
  829. this.campForm = {
  830. trainingCampId: null,
  831. trainingCampName: ''
  832. };
  833. // 如果表单已经创建,则重置校验结果
  834. if (this.$refs.campForm) {
  835. this.$refs.campForm.resetFields();
  836. }
  837. },
  838. /** 取消训练营表单 */
  839. cancelCampForm() {
  840. this.campDialogVisible = false;
  841. this.resetCampForm();
  842. },
  843. /** 提交训练营表单 */
  844. submitCampForm() {
  845. this.$refs.campForm.validate(valid => {
  846. if (valid) {
  847. // 显示加载中
  848. this.leftLoading = true;
  849. // 准备提交的数据
  850. const submitData = JSON.parse(JSON.stringify(this.campForm));
  851. // 判断是新增还是修改
  852. if (submitData.trainingCampId) {
  853. // 修改训练营
  854. editCamp(submitData).then(response => {
  855. if (response.code === 200) {
  856. this.$message.success('修改训练营成功');
  857. this.campDialogVisible = false;
  858. // 更新列表中的数据
  859. const index = this.campList.findIndex(camp => camp.trainingCampId === submitData.trainingCampId);
  860. if (index !== -1) {
  861. this.campList[index] = { ...this.campList[index], ...submitData };
  862. // 如果修改的是当前选中的训练营,更新右侧列表
  863. if (this.activeCampIndex === index) {
  864. this.selectCamp(index);
  865. }
  866. }
  867. // 重新加载训练营列表
  868. this.getLeftList();
  869. } else {
  870. this.$message.error(response.msg || '修改训练营失败');
  871. this.leftLoading = false;
  872. }
  873. }).catch(error => {
  874. this.$message.error('修改训练营失败: ' + (error.message || '未知错误'));
  875. this.leftLoading = false;
  876. });
  877. } else {
  878. // 新增训练营
  879. addCamp(submitData).then(response => {
  880. if (response.code === 200) {
  881. this.$message.success('新建训练营成功');
  882. this.campDialogVisible = false;
  883. // 重新加载训练营列表
  884. this.getLeftList();
  885. } else {
  886. this.$message.error(response.msg || '新建训练营失败');
  887. this.leftLoading = false;
  888. }
  889. }).catch(error => {
  890. this.$message.error('新建训练营失败: ' + (error.message || '未知错误'));
  891. this.leftLoading = false;
  892. });
  893. }
  894. }
  895. });
  896. },
  897. /** 排序方式改变 */
  898. handleSortChange(value) {
  899. this.leftQueryParams.scs = value;
  900. // 重置页码和列表
  901. this.leftQueryParams.pageNum = 1;
  902. this.campList = [];
  903. this.getLeftList();
  904. },
  905. /** 选中训练营 */
  906. selectCamp(index) {
  907. if(index == null || index == undefined) return;
  908. this.activeCampIndex = index;
  909. // 加载对应的训练营营期数据
  910. const selectedCamp = this.campList[index];
  911. this.queryParams.trainingCampId = selectedCamp.trainingCampId;
  912. this.getList();
  913. },
  914. /** 处理滚动事件,实现滚动到底部加载更多 */
  915. handleScroll() {
  916. // 如果正在节流中或者正在加载中,则不处理
  917. if (this.scrollThrottle || this.loadingMore) return;
  918. // 设置节流,200ms内不再处理滚动事件
  919. this.scrollThrottle = true;
  920. setTimeout(() => {
  921. this.scrollThrottle = false;
  922. }, 200);
  923. const scrollEl = this.$refs.campList;
  924. if (!scrollEl) return;
  925. // 判断是否滚动到底部:滚动高度 + 可视高度 >= 总高度 - 30(添加30px的容差,提前触发加载)
  926. const isBottom = scrollEl.scrollTop + scrollEl.clientHeight >= scrollEl.scrollHeight - 30;
  927. // 如果滚动到底部,且有下一页数据,且当前不在加载中,则加载更多
  928. if (isBottom && this.leftQueryParams.hasNextPage && !this.leftLoading && !this.loadingMore) {
  929. this.loadMoreCamps();
  930. }
  931. },
  932. /** 加载更多训练营数据 */
  933. loadMoreCamps() {
  934. // 已在加载中,防止重复加载
  935. if (this.leftLoading || this.loadingMore) return;
  936. // 设置加载状态
  937. this.loadingMore = true;
  938. // 页码加1
  939. this.leftQueryParams.pageNum += 1;
  940. // 加载下一页数据
  941. listCamp(this.leftQueryParams).then(response => {
  942. if (response && response.code === 200) {
  943. // 将新数据追加到列表中
  944. const newList = response.data.list || [];
  945. if (newList.length > 0) {
  946. this.campList = [...this.campList, ...newList];
  947. }
  948. // 更新是否有下一页的标志
  949. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  950. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  951. this.$nextTick(() => {
  952. const scrollEl = this.$refs.campList;
  953. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  954. // 延迟一点再加载下一页,避免过快加载
  955. setTimeout(() => {
  956. this.loadMoreCamps();
  957. }, 300);
  958. }
  959. });
  960. } else {
  961. this.$message.error(response.msg || '加载更多训练营失败');
  962. }
  963. this.loadingMore = false;
  964. }).catch(error => {
  965. console.error('加载更多训练营失败:', error);
  966. this.$message.error('加载更多训练营失败');
  967. this.loadingMore = false;
  968. });
  969. },
  970. timeChange(type){
  971. if(type == 1){
  972. this.form.periodStartingTime = this.form.dateRange[0];
  973. this.form.periodEndTime = this.form.dateRange[1];
  974. // 转换为天数
  975. let days = this.getDiff(this.form.periodStartingTime, this.form.periodEndTime);
  976. for (let i = 0; i < days; i++) {
  977. this.form.days.push({lesson: i + 1});
  978. }
  979. }
  980. if(type == 2){
  981. this.form.periodStartingTime = this.form.date;
  982. this.form.periodEndTime = this.form.date;
  983. }
  984. },
  985. getDiff(start, end) {
  986. if(start == null || start == undefined || start == '') return 0;
  987. if(end == null || end == undefined || end == '') return 0;
  988. if(start == end) 1;
  989. const startDate = this.getUTCDate(start);
  990. const endDate = this.getUTCDate(end);
  991. const timeDiff = endDate - startDate;
  992. return (Math.floor(timeDiff / (1000 * 3600 * 24))) + 1; // 直接取整
  993. },
  994. getUTCDate(dateStr) {
  995. const [year, month, day] = dateStr.split('-').map(Number);
  996. return new Date(Date.UTC(year, month - 1, day)); // 月份从0开始
  997. },
  998. handleCourse(row){
  999. this.course = {
  1000. open: false,
  1001. row:{},
  1002. list:[],
  1003. queryParams: {
  1004. pageNum: 1,
  1005. pageSize: 9999,
  1006. },
  1007. loading: true,
  1008. total: 0,
  1009. addOpen: false,
  1010. form: {},
  1011. };
  1012. this.course.open = true;
  1013. this.course.row = row;
  1014. this.course.queryParams.periodId = row.periodId;
  1015. this.getCourseList();
  1016. },
  1017. getCourseList(){
  1018. this.course.loading = true;
  1019. getDays(this.course.queryParams).then(e => {
  1020. this.course.list = e.rows;
  1021. this.course.total = e.total;
  1022. this.course.loading = false;
  1023. });
  1024. },
  1025. handleAddCourse() {
  1026. this.course.addOpen = true;
  1027. this.course.form = {
  1028. periodId: this.course.queryParams.periodId,
  1029. courseId: null,
  1030. videoIds: []
  1031. };
  1032. // 重置表单
  1033. this.$nextTick(() => {
  1034. if (this.$refs.courseAddForm) {
  1035. this.$refs.courseAddForm.resetFields();
  1036. }
  1037. });
  1038. },
  1039. closeAddCourse() {
  1040. this.course.addOpen = false;
  1041. this.course.form = {
  1042. periodId: null,
  1043. courseId: null,
  1044. videoIds: []
  1045. };
  1046. // 重置表单
  1047. if (this.$refs.courseAddForm) {
  1048. this.$refs.courseAddForm.resetFields();
  1049. }
  1050. },
  1051. courseChange(row){
  1052. this.course.form.videoIds = [];
  1053. videoList(row).then(response => {
  1054. this.videoList=response.list
  1055. });
  1056. },
  1057. submitCourseForm(){
  1058. this.$refs.courseAddForm.validate(valid => {
  1059. if (valid) {
  1060. // 提交数据
  1061. addCourse(this.course.form).then(response => {
  1062. this.$message.success('添加成功');
  1063. this.course.addOpen = false;
  1064. // 重新加载训练营列表
  1065. this.getCourseList();
  1066. });
  1067. }
  1068. });
  1069. },
  1070. saveCourseData(){
  1071. updateListCourseData(this.course.list).then(response => {
  1072. this.$message.success('保存成功');
  1073. this.getCourseList();
  1074. });
  1075. },
  1076. setRedPacket(row) {
  1077. this.currentRedPacketData = {
  1078. periodId: row.periodId
  1079. // videoId: row.videoId
  1080. };
  1081. this.redPacketVisible = true;
  1082. },
  1083. handleRedPacketSuccess() {
  1084. this.getCourseList();
  1085. },
  1086. handlePeriodSettings(row) {
  1087. this.periodSettingsData = row;
  1088. this.periodSettingsVisible = true;
  1089. // 初始化课程列表
  1090. this.course.queryParams.periodId = row.periodId;
  1091. this.getCourseList();
  1092. // 如果是公司列表tab,显示红包设置
  1093. if (this.activeTab === 'company') {
  1094. this.redPacketVisible = true;
  1095. }
  1096. },
  1097. handleBatchRedPacketSuccess() {
  1098. this.batchRedPacketVisible = false;
  1099. this.getCourseList();
  1100. },
  1101. },
  1102. };
  1103. </script>
  1104. <style scoped>
  1105. .left-aside {
  1106. background-color: #fff;
  1107. border-right: 1px solid #EBEEF5;
  1108. padding: 0;
  1109. display: flex;
  1110. flex-direction: column;
  1111. height: 800px;
  1112. }
  1113. .left-header {
  1114. padding: 10px;
  1115. border-bottom: 1px solid #EBEEF5;
  1116. }
  1117. .left-header-top {
  1118. display: flex;
  1119. justify-content: space-between;
  1120. align-items: center;
  1121. margin-bottom: 10px;
  1122. }
  1123. .search-btn {
  1124. width: 50%;
  1125. height: 36px;
  1126. background-color: #409EFF;
  1127. color: white;
  1128. border: none;
  1129. }
  1130. .search-input-wrapper {
  1131. margin-bottom: 10px;
  1132. }
  1133. .sort-wrapper {
  1134. display: flex;
  1135. align-items: center;
  1136. margin-bottom: 10px;
  1137. }
  1138. .sort-label {
  1139. width: 70px;
  1140. font-size: 14px;
  1141. font-weight: 600;
  1142. color: #909399;
  1143. }
  1144. .sort-select {
  1145. margin-left: 10px;
  1146. width: 280px;
  1147. }
  1148. .color-wrapper {
  1149. display: flex;
  1150. align-items: center;
  1151. margin-bottom: 10px;
  1152. }
  1153. .color-label {
  1154. width: 70px;
  1155. color: #606266;
  1156. }
  1157. .color-hint {
  1158. margin-left: 10px;
  1159. color: #606266;
  1160. font-size: 12px;
  1161. }
  1162. .color-help {
  1163. margin-left: 5px;
  1164. color: #909399;
  1165. cursor: pointer;
  1166. }
  1167. .hint-text {
  1168. color: #606266;
  1169. font-size: 12px;
  1170. margin-top: 5px;
  1171. }
  1172. .camp-list {
  1173. flex: 1;
  1174. overflow-y: auto;
  1175. padding: 3px;
  1176. background-color: #f5f7fa;
  1177. }
  1178. .camp-item {
  1179. border-radius: 8px;
  1180. margin-bottom: 5px;
  1181. padding: 15px;
  1182. background-color: #ffffff;
  1183. position: relative;
  1184. cursor: pointer;
  1185. display: flex;
  1186. justify-content: space-between;
  1187. border: 1px solid #eaedf2;
  1188. }
  1189. .camp-item:last-child {
  1190. margin-bottom: 0;
  1191. }
  1192. .camp-item:hover {
  1193. background-color: #f5f9ff;
  1194. }
  1195. .camp-item.active {
  1196. background-color: #eaf4ff;
  1197. border-left: 2px solid #75b8fc;
  1198. }
  1199. .camp-content {
  1200. flex: 1;
  1201. padding-right: 10px;
  1202. }
  1203. .camp-title {
  1204. font-weight: bold;
  1205. font-size: 16px;
  1206. margin-bottom: 8px;
  1207. color: #333;
  1208. display: flex;
  1209. align-items: center;
  1210. }
  1211. .camp-icon {
  1212. font-size: 16px;
  1213. margin-right: 6px;
  1214. color: #409EFF;
  1215. }
  1216. .camp-info {
  1217. display: flex;
  1218. justify-content: space-between;
  1219. margin-bottom: 8px;
  1220. font-size: 12px;
  1221. color: #c4c1c1;
  1222. line-height: 1.5;
  1223. }
  1224. .camp-stats {
  1225. display: flex;
  1226. justify-content: space-between;
  1227. font-size: 12px;
  1228. color: #666;
  1229. background-color: #f5f9ff;
  1230. padding: 6px 10px;
  1231. border-radius: 4px;
  1232. line-height: 1.5;
  1233. }
  1234. .stat-item {
  1235. display: flex;
  1236. align-items: center;
  1237. }
  1238. .stat-item i {
  1239. margin-right: 4px;
  1240. font-size: 14px;
  1241. color: #409EFF;
  1242. }
  1243. .camp-actions {
  1244. display: flex;
  1245. flex-direction: column;
  1246. justify-content: center;
  1247. align-items: flex-end;
  1248. gap: 8px;
  1249. border-left: 1px dashed #eaedf2;
  1250. padding-left: 12px;
  1251. min-width: 50px;
  1252. }
  1253. .action-btn {
  1254. padding: 2px 5px;
  1255. font-size: 12px;
  1256. border-radius: 4px;
  1257. transition: all 0.2s;
  1258. }
  1259. .action-btn:hover {
  1260. background-color: rgba(255, 255, 255, 0.8);
  1261. }
  1262. .delete-btn {
  1263. color: #f56c6c;
  1264. }
  1265. .delete-btn:hover {
  1266. background-color: rgba(245, 108, 108, 0.1);
  1267. }
  1268. .copy-btn {
  1269. color: #409EFF;
  1270. }
  1271. .copy-btn:hover {
  1272. background-color: rgba(64, 158, 255, 0.1);
  1273. }
  1274. .warning-icon {
  1275. color: #E6A23C;
  1276. font-size: 16px;
  1277. margin-left: 5px;
  1278. }
  1279. .el-main {
  1280. padding: 10px;
  1281. }
  1282. /* 添加训练营表单样式 */
  1283. .drawer-footer {
  1284. position: absolute;
  1285. bottom: 0;
  1286. left: 0;
  1287. right: 0;
  1288. padding: 20px;
  1289. background: #fff;
  1290. text-align: right;
  1291. border-top: 1px solid #e8e8e8;
  1292. }
  1293. .el-input-number {
  1294. width: 100%;
  1295. }
  1296. /* 加载更多样式 */
  1297. .loading-more {
  1298. display: flex;
  1299. align-items: center;
  1300. justify-content: center;
  1301. padding: 12px 0;
  1302. color: #909399;
  1303. font-size: 14px;
  1304. }
  1305. .loading-more i {
  1306. margin-right: 5px;
  1307. font-size: 16px;
  1308. }
  1309. /* 无更多数据提示 */
  1310. .no-more-data {
  1311. display: flex;
  1312. align-items: center;
  1313. justify-content: center;
  1314. padding: 12px 0;
  1315. color: #c0c4cc;
  1316. font-size: 13px;
  1317. }
  1318. .no-more-data span {
  1319. position: relative;
  1320. display: flex;
  1321. align-items: center;
  1322. }
  1323. </style>