index.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  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" @tab-click="handleTabClick">
  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-tab-pane label="课程统计" name="statistics">
  402. <course-statistics
  403. :periodId="periodSettingsData.periodId"
  404. :active="activeTab === 'statistics'"
  405. />
  406. </el-tab-pane>
  407. </el-tabs>
  408. </div>
  409. </el-drawer>
  410. <batch-red-packet
  411. :visible.sync="batchRedPacketVisible"
  412. :selected-data="selectedPeriods"
  413. @success="handleBatchRedPacketSuccess"
  414. />
  415. </div>
  416. </template>
  417. <script>
  418. import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, updateListCourseData} from "@/api/course/userCoursePeriod";
  419. import {getCompanyList} from "@/api/company/company";
  420. import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
  421. import { courseList,videoList } from '@/api/course/courseRedPacketLog'
  422. import RedPacket from './redPacket.vue'
  423. import BatchRedPacket from './batchRedPacket.vue'
  424. import CourseStatistics from './statistics.vue'
  425. export default {
  426. name: "Period",
  427. components: {
  428. RedPacket,
  429. BatchRedPacket,
  430. CourseStatistics
  431. },
  432. data() {
  433. return {
  434. // 遮罩层
  435. loading: true,
  436. // 左侧遮罩层
  437. leftLoading: true,
  438. // 选中数组
  439. ids: [],
  440. // 非单个禁用
  441. single: true,
  442. // 非多个禁用
  443. multiple: true,
  444. // 显示搜索条件
  445. showSearch: true,
  446. // 总条数
  447. total: 0,
  448. // 左侧总条数
  449. leftTotal: 0,
  450. // 会员营期表格数据
  451. periodList: [],
  452. // 左侧列表数据
  453. leftList: [],
  454. videoList: [],
  455. // 弹出层标题
  456. title: "",
  457. // 是否显示弹出层
  458. open: false,
  459. // 查询参数
  460. queryParams: {
  461. pageNum: 1,
  462. pageSize: 10,
  463. periodName: null,
  464. periodStartingTime: null,
  465. periodEndTime: null,
  466. companyIdList: []
  467. },
  468. // 左侧查询参数
  469. leftQueryParams: {
  470. pageNum: 1,
  471. pageSize: 10,
  472. hasNextPage: false,
  473. scs: 'order_number(desc),training_camp_id(desc)',
  474. trainingCampName: null
  475. },
  476. // 表单参数
  477. form: {},
  478. course: {
  479. open: false,
  480. row:{},
  481. list:[],
  482. queryParams: {
  483. pageNum: 1,
  484. pageSize: 10,
  485. },
  486. loading: true,
  487. total: 0,
  488. addOpen: false,
  489. form: {},
  490. },
  491. // 表单校验
  492. rules: {
  493. },
  494. // 公司选项
  495. companyOptions: [],
  496. // 训练营列表
  497. campList: [],
  498. // 激活的训练营索引
  499. activeCampIndex: null,
  500. // 训练营对话框是否显示
  501. campDialogVisible: false,
  502. courseList: false,
  503. // 训练营表单
  504. campForm: {
  505. trainingCampId: null,
  506. trainingCampName: ''
  507. },
  508. // 训练营表单校验
  509. campRules: {
  510. trainingCampName: [
  511. { required: true, message: '训练营名称不能为空', trigger: 'blur' },
  512. { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
  513. ]
  514. },
  515. // 滚动节流标志
  516. scrollThrottle: false,
  517. // 加载更多状态
  518. loadingMore: false,
  519. // 设置红包对话框
  520. redPacketVisible: false,
  521. periodCompanyList: [],
  522. currentRedPacketData: {
  523. periodId: '',
  524. videoId: ''
  525. },
  526. // 营期相关设置抽屉
  527. periodSettingsVisible: false,
  528. activeTab: 'course',
  529. periodSettingsData: {},
  530. companyList: [],
  531. courseDialogVisible: false,
  532. redPacketList: [],
  533. currentCompany: null,
  534. // 选中的营期数据
  535. selectedPeriods: [],
  536. // 批量设置红包按钮是否禁用
  537. batchSetRedPacketDisabled: true,
  538. // 批量设置红包弹出框
  539. batchRedPacketVisible: false,
  540. };
  541. },
  542. created() {
  543. courseList().then(response => {
  544. this.courseList = response.list;
  545. });
  546. // this.getList();
  547. this.getLeftList();
  548. this.getCompanyList();
  549. },
  550. methods: {
  551. /** 查询会员营期列表 */
  552. getList() {
  553. this.loading = true;
  554. const params = { ...this.queryParams };
  555. pagePeriod(params).then(response => {
  556. this.periodList = response.rows;
  557. this.total = response.total;
  558. this.loading = false;
  559. });
  560. },
  561. /** 查询左侧列表 */
  562. getLeftList() {
  563. this.leftLoading = true;
  564. // 重置页码和加载更多状态
  565. this.leftQueryParams.pageNum = 1;
  566. this.loadingMore = false;
  567. // 训练营数据
  568. listCamp(this.leftQueryParams).then(response => {
  569. if (response && response.code === 200) {
  570. this.campList = response.data.list || [];
  571. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  572. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  573. this.selectCamp(this.activeCampIndex);
  574. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  575. this.$nextTick(() => {
  576. const scrollEl = this.$refs.campList;
  577. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  578. this.loadMoreCamps();
  579. }
  580. });
  581. } else {
  582. this.$message.error(response.msg || '获取训练营列表失败');
  583. this.campList = [];
  584. this.leftQueryParams.hasNextPage = false;
  585. }
  586. this.leftLoading = false;
  587. }).catch(error => {
  588. console.error('获取训练营列表失败:', error);
  589. this.$message.error('获取训练营列表失败');
  590. this.campList = [];
  591. this.leftQueryParams.hasNextPage = false;
  592. this.leftLoading = false;
  593. });
  594. },
  595. /** 搜索按钮操作 */
  596. handleQuery() {
  597. this.queryParams.pageNum = 1;
  598. this.getList();
  599. },
  600. /** 左侧搜索按钮操作 */
  601. handleLeftQuery() {
  602. // 重置页码和列表
  603. this.leftQueryParams.pageNum = 1;
  604. this.campList = [];
  605. this.getLeftList();
  606. },
  607. /** 重置按钮操作 */
  608. resetQuery() {
  609. this.resetForm("queryForm");
  610. this.queryParams.companyIdList = [];
  611. this.handleQuery();
  612. },
  613. /** 多选框选中数据 */
  614. handleSelectionChange(selection) {
  615. this.ids = selection.map(item => item.periodId)
  616. this.single = selection.length!==1
  617. this.multiple = !selection.length
  618. // 更新批量设置红包相关数据
  619. this.selectedPeriods = selection;
  620. this.batchSetRedPacketDisabled = selection.length === 0;
  621. },
  622. /** 新增按钮操作 */
  623. handleAdd() {
  624. this.reset();
  625. this.open = true;
  626. this.title = "添加会员营期";
  627. },
  628. /** 修改按钮操作 */
  629. handleUpdate(row) {
  630. this.reset();
  631. const periodId = row.periodId || this.ids
  632. getPeriod(periodId).then(response => {
  633. this.form = response.data;
  634. if(this.form.periodType == 1){
  635. this.form.dateRange = [this.form.periodStartingTime, this.form.periodEndTime];
  636. }
  637. if(this.form.periodType == 1){
  638. this.form.date = this.form.periodStartingTime;
  639. }
  640. this.open = true;
  641. this.title = "修改会员营期";
  642. });
  643. },
  644. /** 提交按钮 */
  645. submitForm() {
  646. this.$refs["form"].validate(valid => {
  647. if (valid) {
  648. let data = JSON.parse(JSON.stringify(this.form));
  649. data.companyId = data.companyId.join()
  650. data.trainingCampId = this.queryParams.trainingCampId
  651. if (data.periodId != null) {
  652. updatePeriod(data).then(response => {
  653. if (response.code === 200) {
  654. this.msgSuccess("修改成功");
  655. this.open = false;
  656. this.getList();
  657. }
  658. });
  659. } else {
  660. addPeriod(data).then(response => {
  661. if (response.code === 200) {
  662. this.msgSuccess("新增成功");
  663. this.open = false;
  664. this.getList();
  665. }
  666. });
  667. }
  668. }
  669. });
  670. },
  671. /** 删除按钮操作 */
  672. handleDelete(row) {
  673. const periodIds = row.periodId || this.ids;
  674. this.$confirm('是否确认删除会员营期编号为"' + periodIds + '"的数据项?', "警告", {
  675. confirmButtonText: "确定",
  676. cancelButtonText: "取消",
  677. type: "warning"
  678. }).then(function() {
  679. return delPeriod(periodIds);
  680. }).then(() => {
  681. this.getList();
  682. this.msgSuccess("删除成功");
  683. }).catch(function() {});
  684. },
  685. /** 导出按钮操作 */
  686. handleExport() {
  687. const queryParams = this.queryParams;
  688. this.$confirm('是否确认导出所有会员营期数据项?', "警告", {
  689. confirmButtonText: "确定",
  690. cancelButtonText: "取消",
  691. type: "warning"
  692. }).then(function() {
  693. return exportPeriod(queryParams);
  694. }).then(response => {
  695. this.download(response.msg);
  696. }).catch(function() {});
  697. },
  698. /** 批量设置红包 */
  699. handleBatchSetRedPacket() {
  700. if (this.selectedPeriods.length === 0) {
  701. this.$message.warning('请至少选择一个营期');
  702. return;
  703. }
  704. this.batchRedPacketVisible = true;
  705. },
  706. /** 处理批量设置红包保存 */
  707. // handleBatchRedPacketSave(data) {
  708. // // 这里等待接口提供后补充具体实现
  709. // // 示例代码:
  710. // // batchSetRedPacket(data).then(response => {
  711. // // if (response.code === 200) {
  712. // // this.$message.success('批量设置成功');
  713. // // this.getList();
  714. // // }
  715. // // });
  716. // this.batchRedPacketVisible = false;
  717. // },
  718. /** 获取公司下拉列表*/
  719. getCompanyList() {
  720. this.loading = true;
  721. getCompanyList().then(response => {
  722. this.companyOptions = response.data;
  723. this.loading = false;
  724. });
  725. },
  726. // 取消按钮
  727. cancel() {
  728. this.open = false;
  729. this.reset();
  730. },
  731. // 表单重置
  732. reset() {
  733. this.form = {
  734. periodId: null,
  735. periodName: null,
  736. companyId: null,
  737. courseId: null,
  738. videoId: null,
  739. trainingCampId: null,
  740. createTime: null,
  741. updateTime: null,
  742. courseStyle: null,
  743. liveRoomStyle: null,
  744. redPacketGrantMethod: 1,
  745. periodType: 1,
  746. periodStartingTime: null,
  747. dateRange: [],
  748. date: null,
  749. days: [],
  750. periodEndTime: null
  751. };
  752. this.resetForm("form");
  753. },
  754. // 处理训练营列表的逻辑
  755. handleDeleteCamp(item) {
  756. this.$confirm(`确定要删除训练营"${item.trainingCampName}"吗?`, '提示', {
  757. confirmButtonText: '删除',
  758. cancelButtonText: '取消',
  759. type: 'warning'
  760. }).then(() => {
  761. // 调用删除训练营API
  762. const trainingCampId = item.trainingCampId;
  763. this.leftLoading = true;
  764. delCamp(trainingCampId).then(response => {
  765. if (response.code === 200) {
  766. this.$message.success('删除成功');
  767. // 从列表中移除
  768. const index = this.campList.findIndex(camp => camp.trainingCampId === trainingCampId);
  769. if (index !== -1) {
  770. this.campList.splice(index, 1);
  771. }
  772. // 如果删除的是当前选中的训练营,则重置选中状态
  773. if (this.activeCampIndex === index) {
  774. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  775. if (this.activeCampIndex !== null) {
  776. // 更新右侧列表
  777. this.selectCamp(this.activeCampIndex);
  778. } else {
  779. // 没有训练营了,清空右侧列表
  780. this.periodList = [];
  781. }
  782. }
  783. } else {
  784. this.$message.error(response.msg || '删除失败');
  785. }
  786. this.leftLoading = false;
  787. }).catch(error => {
  788. this.$message.error('删除失败: ' + error.message);
  789. this.leftLoading = false;
  790. });
  791. }).catch(() => {
  792. this.$message.info('已取消删除');
  793. });
  794. },
  795. /** 复制训练营 */
  796. handleCopyCamp(item) {
  797. // 调用添加训练营API
  798. copyCamp(item.trainingCampId).then(response => {
  799. if (response.code === 200) {
  800. this.$message.success('复制成功');
  801. // 重新加载训练营列表
  802. this.getLeftList();
  803. } else {
  804. this.$message.error(response.msg || '复制训练营失败');
  805. }
  806. }).catch(error => {
  807. this.$message.error('复制训练营失败: ' + error.message);
  808. });
  809. },
  810. /** 修改训练营按钮操作 */
  811. handleEditCamp(item) {
  812. this.resetCampForm();
  813. this.leftLoading = true;
  814. // 获取最新的训练营数据
  815. const trainingCampId = item.trainingCampId;
  816. // 应该调用获取训练营详情的API
  817. setTimeout(() => {
  818. // 填充表单数据
  819. this.campForm = {
  820. trainingCampId: item.trainingCampId,
  821. trainingCampName: item.trainingCampName,
  822. orderNumber: item.orderNumber || 1,
  823. status: item.status !== undefined ? item.status : 1
  824. };
  825. this.campDialogVisible = true;
  826. this.leftLoading = false;
  827. }, 300);
  828. },
  829. /** 新建训练营按钮操作 */
  830. handleAddTrainingCamp() {
  831. this.resetCampForm();
  832. this.campDialogVisible = true;
  833. },
  834. /** 重置训练营表单 */
  835. resetCampForm() {
  836. this.campForm = {
  837. trainingCampId: null,
  838. trainingCampName: ''
  839. };
  840. // 如果表单已经创建,则重置校验结果
  841. if (this.$refs.campForm) {
  842. this.$refs.campForm.resetFields();
  843. }
  844. },
  845. /** 取消训练营表单 */
  846. cancelCampForm() {
  847. this.campDialogVisible = false;
  848. this.resetCampForm();
  849. },
  850. /** 提交训练营表单 */
  851. submitCampForm() {
  852. this.$refs.campForm.validate(valid => {
  853. if (valid) {
  854. // 显示加载中
  855. this.leftLoading = true;
  856. // 准备提交的数据
  857. const submitData = JSON.parse(JSON.stringify(this.campForm));
  858. // 判断是新增还是修改
  859. if (submitData.trainingCampId) {
  860. // 修改训练营
  861. editCamp(submitData).then(response => {
  862. if (response.code === 200) {
  863. this.$message.success('修改训练营成功');
  864. this.campDialogVisible = false;
  865. // 更新列表中的数据
  866. const index = this.campList.findIndex(camp => camp.trainingCampId === submitData.trainingCampId);
  867. if (index !== -1) {
  868. this.campList[index] = { ...this.campList[index], ...submitData };
  869. // 如果修改的是当前选中的训练营,更新右侧列表
  870. if (this.activeCampIndex === index) {
  871. this.selectCamp(index);
  872. }
  873. }
  874. // 重新加载训练营列表
  875. this.getLeftList();
  876. } else {
  877. this.$message.error(response.msg || '修改训练营失败');
  878. this.leftLoading = false;
  879. }
  880. }).catch(error => {
  881. this.$message.error('修改训练营失败: ' + (error.message || '未知错误'));
  882. this.leftLoading = false;
  883. });
  884. } else {
  885. // 新增训练营
  886. addCamp(submitData).then(response => {
  887. if (response.code === 200) {
  888. this.$message.success('新建训练营成功');
  889. this.campDialogVisible = false;
  890. // 重新加载训练营列表
  891. this.getLeftList();
  892. } else {
  893. this.$message.error(response.msg || '新建训练营失败');
  894. this.leftLoading = false;
  895. }
  896. }).catch(error => {
  897. this.$message.error('新建训练营失败: ' + (error.message || '未知错误'));
  898. this.leftLoading = false;
  899. });
  900. }
  901. }
  902. });
  903. },
  904. /** 排序方式改变 */
  905. handleSortChange(value) {
  906. this.leftQueryParams.scs = value;
  907. // 重置页码和列表
  908. this.leftQueryParams.pageNum = 1;
  909. this.campList = [];
  910. this.getLeftList();
  911. },
  912. /** 选中训练营 */
  913. selectCamp(index) {
  914. if(index == null || index == undefined) return;
  915. this.activeCampIndex = index;
  916. // 加载对应的训练营营期数据
  917. const selectedCamp = this.campList[index];
  918. this.queryParams.trainingCampId = selectedCamp.trainingCampId;
  919. this.getList();
  920. },
  921. /** 处理滚动事件,实现滚动到底部加载更多 */
  922. handleScroll() {
  923. // 如果正在节流中或者正在加载中,则不处理
  924. if (this.scrollThrottle || this.loadingMore) return;
  925. // 设置节流,200ms内不再处理滚动事件
  926. this.scrollThrottle = true;
  927. setTimeout(() => {
  928. this.scrollThrottle = false;
  929. }, 200);
  930. const scrollEl = this.$refs.campList;
  931. if (!scrollEl) return;
  932. // 判断是否滚动到底部:滚动高度 + 可视高度 >= 总高度 - 30(添加30px的容差,提前触发加载)
  933. const isBottom = scrollEl.scrollTop + scrollEl.clientHeight >= scrollEl.scrollHeight - 30;
  934. // 如果滚动到底部,且有下一页数据,且当前不在加载中,则加载更多
  935. if (isBottom && this.leftQueryParams.hasNextPage && !this.leftLoading && !this.loadingMore) {
  936. this.loadMoreCamps();
  937. }
  938. },
  939. /** 加载更多训练营数据 */
  940. loadMoreCamps() {
  941. // 已在加载中,防止重复加载
  942. if (this.leftLoading || this.loadingMore) return;
  943. // 设置加载状态
  944. this.loadingMore = true;
  945. // 页码加1
  946. this.leftQueryParams.pageNum += 1;
  947. // 加载下一页数据
  948. listCamp(this.leftQueryParams).then(response => {
  949. if (response && response.code === 200) {
  950. // 将新数据追加到列表中
  951. const newList = response.data.list || [];
  952. if (newList.length > 0) {
  953. this.campList = [...this.campList, ...newList];
  954. }
  955. // 更新是否有下一页的标志
  956. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  957. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  958. this.$nextTick(() => {
  959. const scrollEl = this.$refs.campList;
  960. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  961. // 延迟一点再加载下一页,避免过快加载
  962. setTimeout(() => {
  963. this.loadMoreCamps();
  964. }, 300);
  965. }
  966. });
  967. } else {
  968. this.$message.error(response.msg || '加载更多训练营失败');
  969. }
  970. this.loadingMore = false;
  971. }).catch(error => {
  972. console.error('加载更多训练营失败:', error);
  973. this.$message.error('加载更多训练营失败');
  974. this.loadingMore = false;
  975. });
  976. },
  977. timeChange(type){
  978. if(type == 1){
  979. this.form.periodStartingTime = this.form.dateRange[0];
  980. this.form.periodEndTime = this.form.dateRange[1];
  981. // 转换为天数
  982. let days = this.getDiff(this.form.periodStartingTime, this.form.periodEndTime);
  983. for (let i = 0; i < days; i++) {
  984. this.form.days.push({lesson: i + 1});
  985. }
  986. }
  987. if(type == 2){
  988. this.form.periodStartingTime = this.form.date;
  989. this.form.periodEndTime = this.form.date;
  990. }
  991. },
  992. getDiff(start, end) {
  993. if(start == null || start == undefined || start == '') return 0;
  994. if(end == null || end == undefined || end == '') return 0;
  995. if(start == end) 1;
  996. const startDate = this.getUTCDate(start);
  997. const endDate = this.getUTCDate(end);
  998. const timeDiff = endDate - startDate;
  999. return (Math.floor(timeDiff / (1000 * 3600 * 24))) + 1; // 直接取整
  1000. },
  1001. getUTCDate(dateStr) {
  1002. const [year, month, day] = dateStr.split('-').map(Number);
  1003. return new Date(Date.UTC(year, month - 1, day)); // 月份从0开始
  1004. },
  1005. handleCourse(row){
  1006. this.course = {
  1007. open: false,
  1008. row:{},
  1009. list:[],
  1010. queryParams: {
  1011. pageNum: 1,
  1012. pageSize: 9999,
  1013. },
  1014. loading: true,
  1015. total: 0,
  1016. addOpen: false,
  1017. form: {},
  1018. };
  1019. this.course.open = true;
  1020. this.course.row = row;
  1021. this.course.queryParams.periodId = row.periodId;
  1022. this.getCourseList();
  1023. },
  1024. getCourseList(){
  1025. this.course.loading = true;
  1026. getDays(this.course.queryParams).then(e => {
  1027. this.course.list = e.rows;
  1028. this.course.total = e.total;
  1029. this.course.loading = false;
  1030. });
  1031. },
  1032. handleAddCourse() {
  1033. this.course.addOpen = true;
  1034. this.course.form = {
  1035. periodId: this.course.queryParams.periodId,
  1036. courseId: null,
  1037. videoIds: []
  1038. };
  1039. // 重置表单
  1040. this.$nextTick(() => {
  1041. if (this.$refs.courseAddForm) {
  1042. this.$refs.courseAddForm.resetFields();
  1043. }
  1044. });
  1045. },
  1046. closeAddCourse() {
  1047. this.course.addOpen = false;
  1048. this.course.form = {
  1049. periodId: null,
  1050. courseId: null,
  1051. videoIds: []
  1052. };
  1053. // 重置表单
  1054. if (this.$refs.courseAddForm) {
  1055. this.$refs.courseAddForm.resetFields();
  1056. }
  1057. },
  1058. courseChange(row){
  1059. this.course.form.videoIds = [];
  1060. videoList(row).then(response => {
  1061. this.videoList=response.list
  1062. });
  1063. },
  1064. submitCourseForm(){
  1065. this.$refs.courseAddForm.validate(valid => {
  1066. if (valid) {
  1067. // 提交数据
  1068. addCourse(this.course.form).then(response => {
  1069. this.$message.success('添加成功');
  1070. this.course.addOpen = false;
  1071. // 重新加载训练营列表
  1072. this.getCourseList();
  1073. });
  1074. }
  1075. });
  1076. },
  1077. saveCourseData(){
  1078. updateListCourseData(this.course.list).then(response => {
  1079. this.$message.success('保存成功');
  1080. this.getCourseList();
  1081. });
  1082. },
  1083. setRedPacket(row) {
  1084. this.currentRedPacketData = {
  1085. periodId: row.periodId
  1086. // videoId: row.videoId
  1087. };
  1088. this.redPacketVisible = true;
  1089. },
  1090. handleRedPacketSuccess() {
  1091. this.getCourseList();
  1092. },
  1093. handlePeriodSettings(row) {
  1094. this.periodSettingsData = row;
  1095. this.periodSettingsVisible = true;
  1096. // 初始化课程列表
  1097. this.course.queryParams.periodId = row.periodId;
  1098. // 根据当前激活的tab加载对应数据
  1099. this.handleTabClick({ name: this.activeTab });
  1100. },
  1101. handleBatchRedPacketSuccess() {
  1102. this.batchRedPacketVisible = false;
  1103. this.getCourseList();
  1104. },
  1105. /** 处理tab切换 */
  1106. handleTabClick(tab) {
  1107. if (tab.name === 'course') {
  1108. this.getCourseList();
  1109. } else if (tab.name === 'company') {
  1110. this.redPacketVisible = true;
  1111. }
  1112. },
  1113. },
  1114. };
  1115. </script>
  1116. <style scoped>
  1117. .left-aside {
  1118. background-color: #fff;
  1119. border-right: 1px solid #EBEEF5;
  1120. padding: 0;
  1121. display: flex;
  1122. flex-direction: column;
  1123. height: 800px;
  1124. }
  1125. .left-header {
  1126. padding: 10px;
  1127. border-bottom: 1px solid #EBEEF5;
  1128. }
  1129. .left-header-top {
  1130. display: flex;
  1131. justify-content: space-between;
  1132. align-items: center;
  1133. margin-bottom: 10px;
  1134. }
  1135. .search-btn {
  1136. width: 50%;
  1137. height: 36px;
  1138. background-color: #409EFF;
  1139. color: white;
  1140. border: none;
  1141. }
  1142. .search-input-wrapper {
  1143. margin-bottom: 10px;
  1144. }
  1145. .sort-wrapper {
  1146. display: flex;
  1147. align-items: center;
  1148. margin-bottom: 10px;
  1149. }
  1150. .sort-label {
  1151. width: 70px;
  1152. font-size: 14px;
  1153. font-weight: 600;
  1154. color: #909399;
  1155. }
  1156. .sort-select {
  1157. margin-left: 10px;
  1158. width: 280px;
  1159. }
  1160. .color-wrapper {
  1161. display: flex;
  1162. align-items: center;
  1163. margin-bottom: 10px;
  1164. }
  1165. .color-label {
  1166. width: 70px;
  1167. color: #606266;
  1168. }
  1169. .color-hint {
  1170. margin-left: 10px;
  1171. color: #606266;
  1172. font-size: 12px;
  1173. }
  1174. .color-help {
  1175. margin-left: 5px;
  1176. color: #909399;
  1177. cursor: pointer;
  1178. }
  1179. .hint-text {
  1180. color: #606266;
  1181. font-size: 12px;
  1182. margin-top: 5px;
  1183. }
  1184. .camp-list {
  1185. flex: 1;
  1186. overflow-y: auto;
  1187. padding: 3px;
  1188. background-color: #f5f7fa;
  1189. }
  1190. .camp-item {
  1191. border-radius: 8px;
  1192. margin-bottom: 5px;
  1193. padding: 15px;
  1194. background-color: #ffffff;
  1195. position: relative;
  1196. cursor: pointer;
  1197. display: flex;
  1198. justify-content: space-between;
  1199. border: 1px solid #eaedf2;
  1200. }
  1201. .camp-item:last-child {
  1202. margin-bottom: 0;
  1203. }
  1204. .camp-item:hover {
  1205. background-color: #f5f9ff;
  1206. }
  1207. .camp-item.active {
  1208. background-color: #eaf4ff;
  1209. border-left: 2px solid #75b8fc;
  1210. }
  1211. .camp-content {
  1212. flex: 1;
  1213. padding-right: 10px;
  1214. }
  1215. .camp-title {
  1216. font-weight: bold;
  1217. font-size: 16px;
  1218. margin-bottom: 8px;
  1219. color: #333;
  1220. display: flex;
  1221. align-items: center;
  1222. }
  1223. .camp-icon {
  1224. font-size: 16px;
  1225. margin-right: 6px;
  1226. color: #409EFF;
  1227. }
  1228. .camp-info {
  1229. display: flex;
  1230. justify-content: space-between;
  1231. margin-bottom: 8px;
  1232. font-size: 12px;
  1233. color: #c4c1c1;
  1234. line-height: 1.5;
  1235. }
  1236. .camp-stats {
  1237. display: flex;
  1238. justify-content: space-between;
  1239. font-size: 12px;
  1240. color: #666;
  1241. background-color: #f5f9ff;
  1242. padding: 6px 10px;
  1243. border-radius: 4px;
  1244. line-height: 1.5;
  1245. }
  1246. .stat-item {
  1247. display: flex;
  1248. align-items: center;
  1249. }
  1250. .stat-item i {
  1251. margin-right: 4px;
  1252. font-size: 14px;
  1253. color: #409EFF;
  1254. }
  1255. .camp-actions {
  1256. display: flex;
  1257. flex-direction: column;
  1258. justify-content: center;
  1259. align-items: flex-end;
  1260. gap: 8px;
  1261. border-left: 1px dashed #eaedf2;
  1262. padding-left: 12px;
  1263. min-width: 50px;
  1264. }
  1265. .action-btn {
  1266. padding: 2px 5px;
  1267. font-size: 12px;
  1268. border-radius: 4px;
  1269. transition: all 0.2s;
  1270. }
  1271. .action-btn:hover {
  1272. background-color: rgba(255, 255, 255, 0.8);
  1273. }
  1274. .delete-btn {
  1275. color: #f56c6c;
  1276. }
  1277. .delete-btn:hover {
  1278. background-color: rgba(245, 108, 108, 0.1);
  1279. }
  1280. .copy-btn {
  1281. color: #409EFF;
  1282. }
  1283. .copy-btn:hover {
  1284. background-color: rgba(64, 158, 255, 0.1);
  1285. }
  1286. .warning-icon {
  1287. color: #E6A23C;
  1288. font-size: 16px;
  1289. margin-left: 5px;
  1290. }
  1291. .el-main {
  1292. padding: 10px;
  1293. }
  1294. /* 添加训练营表单样式 */
  1295. .drawer-footer {
  1296. position: absolute;
  1297. bottom: 0;
  1298. left: 0;
  1299. right: 0;
  1300. padding: 20px;
  1301. background: #fff;
  1302. text-align: right;
  1303. border-top: 1px solid #e8e8e8;
  1304. }
  1305. .el-input-number {
  1306. width: 100%;
  1307. }
  1308. /* 加载更多样式 */
  1309. .loading-more {
  1310. display: flex;
  1311. align-items: center;
  1312. justify-content: center;
  1313. padding: 12px 0;
  1314. color: #909399;
  1315. font-size: 14px;
  1316. }
  1317. .loading-more i {
  1318. margin-right: 5px;
  1319. font-size: 16px;
  1320. }
  1321. /* 无更多数据提示 */
  1322. .no-more-data {
  1323. display: flex;
  1324. align-items: center;
  1325. justify-content: center;
  1326. padding: 12px 0;
  1327. color: #c0c4cc;
  1328. font-size: 13px;
  1329. }
  1330. .no-more-data span {
  1331. position: relative;
  1332. display: flex;
  1333. align-items: center;
  1334. }
  1335. </style>