index.vue 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962
  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" v-hasPermi="['course:trainingCamp:list']">搜索</el-button>
  10. <el-button type="primary" style="width: 50%" icon="el-icon-plus" @click="handleAddTrainingCamp" v-hasPermi="['course:trainingCamp:add']">新建训练营</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" v-loading="leftLoading">
  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)" v-hasPermi="['course:trainingCamp:remove']">删除</el-button>
  66. <!-- <el-button type="text" class="action-btn copy-btn" @click.stop="handleCopyCamp(item)" v-hasPermi="['course:trainingCamp:copy']">复制</el-button>-->
  67. <el-button type="text" class="action-btn copy-btn" @click.stop="handleEditCamp(item)" v-hasPermi="['course:trainingCamp:edit']">编辑</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" v-hasPermi="['course:period:list']">搜索</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:setRedPacket']"
  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" border>
  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="periodStatus" width="100" :formatter="periodStatusFormatter" />
  163. <el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180" />
  164. <el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180" />
  165. <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
  166. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  167. <template slot-scope="scope">
  168. <el-button
  169. size="mini"
  170. type="text"
  171. icon="el-icon-edit"
  172. @click="handleUpdate(scope.row)"
  173. v-hasPermi="['course:period:query']"
  174. >修改</el-button>
  175. <!-- <el-button-->
  176. <!-- size="mini"-->
  177. <!-- type="text"-->
  178. <!-- icon="el-icon-edit"-->
  179. <!-- @click="handleCourse(scope.row)"-->
  180. <!-- v-hasPermi="['course:period:edit']"-->
  181. <!-- >课程管理</el-button>-->
  182. <!-- <el-button-->
  183. <!-- size="mini"-->
  184. <!-- type="text"-->
  185. <!-- icon="el-icon-money"-->
  186. <!-- @click="setRedPacket(scope.row)"-->
  187. <!-- >设置红包</el-button>-->
  188. <el-button
  189. size="mini"
  190. type="text"
  191. icon="el-icon-setting"
  192. @click="handlePeriodSettings(scope.row)"
  193. >营期相关设置</el-button>
  194. <el-button
  195. size="mini"
  196. type="text"
  197. icon="el-icon-circle-close"
  198. @click="handleClosePeriod(scope.row)"
  199. v-hasPermi="['course:period:close']"
  200. >结束营期</el-button>
  201. <el-button
  202. size="mini"
  203. type="text"
  204. icon="el-icon-delete"
  205. @click="handleDelete(scope.row)"
  206. v-hasPermi="['course:period:remove']"
  207. >删除</el-button>
  208. </template>
  209. </el-table-column>
  210. </el-table>
  211. <pagination
  212. v-show="total>0"
  213. :total="total"
  214. :page.sync="queryParams.pageNum"
  215. :limit.sync="queryParams.pageSize"
  216. @pagination="getList"
  217. />
  218. </el-main>
  219. </el-container>
  220. <!-- 添加或修改会员营期对话框-->
  221. <el-drawer :title="title" :visible.sync="open" size="700px" append-to-body>
  222. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  223. <el-form-item label="营期名称" prop="periodName">
  224. <el-input v-model="form.periodName" placeholder="请输入营期名称" />
  225. </el-form-item>
  226. <el-form-item label="公司" prop="companyId">
  227. <el-select v-model="form.companyId" placeholder="请选择公司" multiple>
  228. <el-option
  229. v-for="item in companyOptions"
  230. :key="item.companyId"
  231. :label="item.companyName"
  232. :value="item.companyId"
  233. />
  234. </el-select>
  235. </el-form-item>
  236. <el-form-item label="课程风格" prop="courseStyle">
  237. <image-upload v-model="form.courseStyle" :limit="1" />
  238. </el-form-item>
  239. <el-form-item label="直播间风格" prop="liveRoomStyle">
  240. <image-upload v-model="form.liveRoomStyle" :limit="1" />
  241. </el-form-item>
  242. <el-form-item label="课程LOGO" prop="courseLogo">
  243. <image-upload v-model="form.courseLogo" :limit="1" />
  244. </el-form-item>
  245. <!-- <el-form-item label="红包发放方式" prop="redPacketGrantMethod">-->
  246. <!-- <el-radio-group v-model="form.redPacketGrantMethod">-->
  247. <!-- <el-radio :label="1" >按课程</el-radio>-->
  248. <!-- <el-radio :label="2" >按营期</el-radio>-->
  249. <!-- </el-radio-group>-->
  250. <!-- </el-form-item>-->
  251. <el-form-item label="营期类型" prop="periodType">
  252. <el-radio-group v-model="form.periodType">
  253. <el-radio :label="1" >多课程</el-radio>
  254. <el-radio :label="2" >单课程</el-radio>
  255. </el-radio-group>
  256. </el-form-item>
  257. <el-form-item label="销售提前查看天数" prop="maxViewNum">
  258. <el-input-number :min="0" v-model="form.maxViewNum" style="width: 200px" />
  259. </el-form-item>
  260. <el-form-item label="开营日期" prop="periodStartingTime">
  261. <el-date-picker
  262. :style="{display: form.periodType == 1 ? '' : 'none !important'}"
  263. v-model="form.dateRange"
  264. @change="timeChange(1)"
  265. type="daterange"
  266. range-separator="至"
  267. start-placeholder="开始日期"
  268. end-placeholder="结束日期"
  269. value-format="yyyy-MM-dd"
  270. :picker-options="{disabledDate}"
  271. :clearable="false"
  272. >
  273. </el-date-picker>
  274. <el-date-picker
  275. :disabled = "isDisabledDateRange"
  276. :style="{display: form.periodType == 2 ? '' : 'none !important'}"
  277. @change="timeChange(2)"
  278. v-model="form.date"
  279. type="date"
  280. value-format="yyyy-MM-dd"
  281. placeholder="选择日期"
  282. :picker-options="{disabledDate}"
  283. :clearable="false"
  284. >
  285. </el-date-picker>
  286. </el-form-item>
  287. </el-form>
  288. <div class="drawer-footer">
  289. <el-button type="primary" @click="submitForm">确 定</el-button>
  290. <el-button @click="cancel">取 消</el-button>
  291. </div>
  292. </el-drawer>
  293. <!-- 添加训练营对话框 -->
  294. <el-dialog :title="campForm.trainingCampId ? '修改训练营' : '新建训练营'" :visible.sync="campDialogVisible" width="500px" append-to-body>
  295. <el-form ref="campForm" :model="campForm" :rules="campRules" label-width="100px">
  296. <el-form-item label="训练营名称" prop="trainingCampName">
  297. <el-input v-model="campForm.trainingCampName" placeholder="请输入训练营名称" />
  298. </el-form-item>
  299. </el-form>
  300. <div slot="footer" class="dialog-footer">
  301. <el-button type="primary" @click="submitCampForm">确 定</el-button>
  302. <el-button @click="cancelCampForm">取 消</el-button>
  303. </div>
  304. </el-dialog>
  305. <!-- &lt;!&ndash; 添加或修改会员营期对话框&ndash;&gt;-->
  306. <!-- <el-dialog title="课程管理" :visible.sync="course.open" width="75%" top="10px" append-to-body style="padding-bottom: 10px">-->
  307. <!-- <el-row :gutter="10" class="mb8">-->
  308. <!-- <el-col :span="1.5">-->
  309. <!-- <el-button-->
  310. <!-- v-if="(getDiff(course.row.periodStartingTime, course.row.periodEndTime) - course.total) > 0"-->
  311. <!-- type="primary"-->
  312. <!-- icon="el-icon-plus"-->
  313. <!-- size="mini"-->
  314. <!-- @click="handleAddCourse"-->
  315. <!-- v-hasPermi="['course:period:add']"-->
  316. <!-- >添加课程</el-button>-->
  317. <!-- </el-col>-->
  318. <!-- </el-row>-->
  319. <!-- <el-table v-loading="course.loading" :data="course.list">-->
  320. <!-- <el-table-column label="课程" align="center" prop="courseName" width="180" />-->
  321. <!-- <el-table-column label="小节" align="center" prop="videoName" />-->
  322. <!-- <el-table-column label="营期时间" align="center" prop="dayDate" width="150" />-->
  323. <!-- <el-table-column label="创建时间" align="center" prop="createTime" width="150" />-->
  324. <!-- </el-table>-->
  325. <!-- <div slot="footer" class="dialog-footer">-->
  326. <!--&lt;!&ndash; <el-button type="primary" @click="saveCourseData">保存</el-button>&ndash;&gt;-->
  327. <!-- </div>-->
  328. <!-- </el-dialog>-->
  329. <!-- 添加课程对话框-->
  330. <el-dialog title="添加课程" :visible.sync="course.addOpen" width="500px" append-to-body>
  331. <el-form ref="courseAddForm" :model="course.form" :rules="courseAddRules" label-width="100px">
  332. <el-form-item label="课程" prop="courseId">
  333. <el-select filterable v-model="course.form.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(course.form.courseId)" style="width: 100%" :value-key="'dictValue'">
  334. <el-option
  335. v-for="dict in courseList"
  336. :key="dict.dictValue"
  337. :label="dict.dictLabel"
  338. :value="parseInt(dict.dictValue)"
  339. />
  340. </el-select>
  341. </el-form-item>
  342. <el-form-item label="小节" prop="videoIds">
  343. <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'">
  344. <el-option
  345. v-for="dict in videoList"
  346. :key="dict.dictValue"
  347. :label="dict.dictLabel"
  348. :value="parseInt(dict.dictValue)"
  349. />
  350. </el-select>
  351. </el-form-item>
  352. <el-form-item label="看课时间" prop="timeRange">
  353. <el-time-picker
  354. is-range
  355. v-model="course.form.timeRange"
  356. :picker-options="{
  357. selectableRange: '00:00:00 - 23:59:59'
  358. }"
  359. range-separator="至"
  360. start-placeholder="开始时间"
  361. value-format="HH:mm:ss"
  362. end-placeholder="结束时间">
  363. </el-time-picker>
  364. </el-form-item>
  365. <el-form-item label="领取红包时间" prop="lastJoinTime">
  366. <el-time-picker
  367. v-model="course.form.joinTime"
  368. value-format="HH:mm:ss"
  369. placeholder="选择时间范围">
  370. </el-time-picker>
  371. <p style="color: red;margin: 0;font-size: 12px">超过领取红包时间,只允许看课,不允许领取红包</p>
  372. </el-form-item>
  373. </el-form>
  374. <div slot="footer" class="dialog-footer">
  375. <el-button type="primary" @click="submitCourseForm">确 定</el-button>
  376. <el-button @click="closeAddCourse">取 消</el-button>
  377. </div>
  378. </el-dialog>
  379. <el-dialog title="修改看课时间" :visible.sync="updateCourse.open" width="600px" append-to-body>
  380. <el-form ref="courseUpdateForm" :model="updateCourse.form" :rules="courseUpdateRules" label-width="100px">
  381. <el-form-item label="看课时间" prop="timeRange" label-width="110px">
  382. <el-date-picker
  383. v-model="updateCourse.form.timeRange"
  384. type="datetimerange"
  385. range-separator="至"
  386. start-placeholder="开始时间"
  387. end-placeholder="结束时间"
  388. value-format="yyyy-MM-dd HH:mm:ss"
  389. :default-time="['00:00:00', '23:59:59']"
  390. :picker-options="{
  391. shortcuts: [{
  392. text: '今天',
  393. onClick(picker) {
  394. const end = new Date();
  395. const start = new Date();
  396. picker.$emit('pick', [start, end]);
  397. }
  398. }]
  399. }"
  400. >
  401. </el-date-picker>
  402. </el-form-item>
  403. <el-form-item label="领取红包时间" prop="joinTime" label-width="110px">
  404. <el-date-picker
  405. v-model="updateCourse.form.joinTime"
  406. type="datetime"
  407. placeholder="选择时间"
  408. value-format="yyyy-MM-dd HH:mm:ss"
  409. :default-time="'23:59:59'"
  410. >
  411. </el-date-picker>
  412. <p style="color: red;margin: 0;font-size: 12px">超过领取红包时间,只允许看课,不允许领取红包</p>
  413. </el-form-item>
  414. </el-form>
  415. <div slot="footer" class="dialog-footer">
  416. <el-button type="primary" @click="submitUpdateCourseForm">确 定</el-button>
  417. <el-button @click="closeUpdateCourse">取 消</el-button>
  418. </div>
  419. </el-dialog>
  420. <el-dialog title="修改营期时间" :visible.sync="updatePeriodDate.open" width="500px" append-to-body>
  421. <el-form ref="courseUpdateForm" :model="updatePeriodDate.form" label-width="100px">
  422. <el-form-item label="营期时间" prop="dayDate">
  423. <el-date-picker
  424. v-model="updatePeriodDate.form.dayDate"
  425. :selectableRange="updatePeriodDate.form.dayDate"
  426. value-format="yyyy-MM-dd"
  427. type="date"
  428. placeholder="选择日期">
  429. </el-date-picker>
  430. </el-form-item>
  431. </el-form>
  432. <div slot="footer" class="dialog-footer">
  433. <el-button type="primary" @click="updatePeriodDateSubmit">确 定</el-button>
  434. <el-button @click="updatePeriodDate.open = false">取 消</el-button>
  435. </div>
  436. </el-dialog>
  437. <!-- <red-packet-->
  438. <!-- :visible.sync="redPacketVisible"-->
  439. <!-- :periodId="currentRedPacketData.periodId"-->
  440. <!-- :videoId="currentRedPacketData.videoId"-->
  441. <!-- @success="handleRedPacketSuccess"-->
  442. <!-- />-->
  443. <!-- 营期相关设置抽屉 -->
  444. <el-drawer
  445. title="营期相关设置"
  446. :visible.sync="periodSettingsVisible"
  447. direction="rtl"
  448. size="74%"
  449. :destroy-on-close="true"
  450. append-to-body
  451. custom-class="period-settings-drawer"
  452. >
  453. <div class="drawer-content" style="margin-left: 25px">
  454. <el-tabs v-model="activeTab" @tab-click="handleTabClick">
  455. <el-tab-pane label="课程管理" name="course">
  456. <el-row :gutter="10" class="mb8">
  457. <el-col :span="1.5">
  458. <el-button
  459. v-if="(getDiff(periodSettingsData.periodStartingTime, periodSettingsData.periodEndTime) - course.total) > 0"
  460. type="primary"
  461. icon="el-icon-plus"
  462. size="mini"
  463. @click="handleAddCourse"
  464. v-hasPermi="['course:period:addCourse']"
  465. >添加课程</el-button>
  466. </el-col>
  467. <!-- <el-col :span="1.5">-->
  468. <!-- <el-button-->
  469. <!-- type="primary"-->
  470. <!-- size="mini"-->
  471. <!-- :disabled="updateCourse.ids.length <= 0"-->
  472. <!-- @click="handleUpdatePeriodDate"-->
  473. <!-- >修改营期时间</el-button>-->
  474. <!-- </el-col>-->
  475. <el-col :span="1.5">
  476. <el-button
  477. type="primary"
  478. size="mini"
  479. :disabled="updateCourse.ids.length <= 0"
  480. @click="handleUpdateCourse"
  481. v-hasPermi="['course:period:updateCourseTime']"
  482. >修改看课时间</el-button>
  483. </el-col>
  484. <el-col :span="1.5">
  485. <el-button
  486. type="warning"
  487. size="mini"
  488. icon="el-icon-delete"
  489. :disabled="updateCourse.ids.length <= 0"
  490. @click="handleDeleteCourse"
  491. v-hasPermi="['course:period:dayRemove']"
  492. >删除课程</el-button>
  493. </el-col>
  494. </el-row>
  495. <el-table ref="courseTable" v-loading="course.loading" :data="course.list" @selection-change="handleSelectionCourseChange" border>
  496. <el-table-column type="selection" width="55" align="center" />
  497. <el-table-column label="课程" align="center" prop="courseName" width="180" />
  498. <el-table-column label="小节" align="center" prop="videoName" />
  499. <el-table-column label="开课状态" align="center" prop="status" width="100" :formatter="courseStatusFormatter" />
  500. <el-table-column label="营期时间" align="center" prop="dayDate" width="100"/>
  501. <el-table-column label="开始时间" align="center" prop="startDateTime" width="100">
  502. <!-- <template slot-scope="scope">-->
  503. <!-- <el-tag>{{scope.row.startDateTime}}</el-tag>-->
  504. <!-- </template>-->
  505. </el-table-column>
  506. <el-table-column label="结束时间" align="center" prop="endDateTime" width="100">
  507. <!-- <template slot-scope="scope">-->
  508. <!-- <el-tag type="success">{{parseTime(scope.row.endDateTime, '{h}:{i}:{s}')}}</el-tag>-->
  509. <!-- </template>-->
  510. </el-table-column>
  511. <el-table-column label="领取红包时间" align="center" prop="lastJoinTime" width="160">
  512. <template slot-scope="scope">
  513. <el-tag type="danger">{{scope.row.lastJoinTime}}</el-tag>
  514. </template>
  515. </el-table-column>
  516. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  517. <template slot-scope="scope">
  518. <el-button
  519. size="mini"
  520. type="text"
  521. icon="el-icon-top"
  522. @click="handleTop(scope.row)"
  523. v-hasPermi="['course:period:courseMove']"
  524. >上移</el-button>
  525. <el-button
  526. size="mini"
  527. type="text"
  528. icon="el-icon-bottom"
  529. @click="handleBottom(scope.row)"
  530. v-hasPermi="['course:period:courseMove']"
  531. >下移</el-button>
  532. <el-button
  533. size="mini"
  534. type="text"
  535. icon="el-icon-edit"
  536. @click="handleUpdateDate(scope.row)"
  537. >修改营期时间</el-button>
  538. <el-button
  539. size="mini"
  540. type="text"
  541. icon="el-icon-delete"
  542. @click="handleDeleteCourse(scope.row)"
  543. v-hasPermi="['course:period:dayRemove']"
  544. >删除课程</el-button>
  545. </template>
  546. </el-table-column>
  547. </el-table>
  548. <pagination
  549. v-show="course.total > 0"
  550. :total="course.total"
  551. :page.sync="course.queryParams.pageNum"
  552. :limit.sync="course.queryParams.pageSize"
  553. @pagination="getCourseList"
  554. style="height: 40px"
  555. />
  556. </el-tab-pane>
  557. <el-tab-pane label="公司列表" name="company">
  558. <red-packet
  559. :visible.sync="redPacketVisible"
  560. :activeTab="activeTab"
  561. :periodId="periodSettingsData.periodId"
  562. @success="handleRedPacketSuccess"
  563. />
  564. </el-tab-pane>
  565. <el-tab-pane label="课程统计" name="statistics">
  566. <course-statistics
  567. :periodId="periodSettingsData.periodId"
  568. :active="activeTab === 'statistics'"
  569. />
  570. </el-tab-pane>
  571. </el-tabs>
  572. </div>
  573. </el-drawer>
  574. <batch-red-packet
  575. :visible.sync="batchRedPacketVisible"
  576. :selected-data="selectedPeriods"
  577. @success="handleBatchRedPacketSuccess"
  578. />
  579. </div>
  580. </template>
  581. <script>
  582. import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod,delPeriodDay, getDays, addCourse, updateCourseTime, updateCourseDate, updateListCourseData, periodCourseMove, closePeriod} from "@/api/course/userCoursePeriod";
  583. import {getCompanyList} from "@/api/company/company";
  584. import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
  585. import { courseList,videoList } from '@/api/course/courseRedPacketLog'
  586. import RedPacket from './redPacket.vue'
  587. import BatchRedPacket from './batchRedPacket.vue'
  588. import CourseStatistics from './statistics.vue'
  589. import Da from "element-ui/src/locale/lang/da";
  590. export default {
  591. name: "Period",
  592. components: {
  593. RedPacket,
  594. BatchRedPacket,
  595. CourseStatistics
  596. },
  597. data() {
  598. return {
  599. // 遮罩层
  600. loading: true,
  601. updateDateOpen: false,
  602. // 左侧遮罩层
  603. leftLoading: true,
  604. // 选中数组
  605. ids: [],
  606. // 非单个禁用
  607. single: true,
  608. // 非多个禁用
  609. multiple: true,
  610. // 显示搜索条件
  611. showSearch: true,
  612. // 总条数
  613. total: 0,
  614. // 左侧总条数
  615. leftTotal: 0,
  616. // 会员营期表格数据
  617. periodList: [],
  618. // 左侧列表数据
  619. leftList: [],
  620. videoList: [],
  621. // 弹出层标题
  622. title: "",
  623. isDisabledDateRange: false, //是否禁用开营日期
  624. // 是否显示弹出层
  625. open: false,
  626. // 查询参数
  627. queryParams: {
  628. pageNum: 1,
  629. pageSize: 10,
  630. periodName: null,
  631. periodStartingTime: null,
  632. periodEndTime: null,
  633. companyIdList: []
  634. },
  635. // 左侧查询参数
  636. leftQueryParams: {
  637. pageNum: 1,
  638. pageSize: 10,
  639. hasNextPage: false,
  640. scs: 'order_number(desc),training_camp_id(desc)',
  641. trainingCampName: null
  642. },
  643. // 表单参数
  644. form: {},
  645. // 课程相关数据
  646. course: {
  647. open: false,
  648. row:{},
  649. list:[],
  650. queryParams: {
  651. pageNum: 1,
  652. pageSize: 10,
  653. },
  654. loading: true,
  655. total: 0,
  656. addOpen: false,
  657. form: {},
  658. },
  659. //修改营期时间参数
  660. updatePeriodDate: {
  661. open: false,
  662. loading: true,
  663. ids: [],
  664. form: {},
  665. },
  666. updateCourse: {
  667. open: false,
  668. loading: true,
  669. ids: [],
  670. form: {
  671. timeRange: null,
  672. joinTime: null
  673. },
  674. },
  675. // 表单校验
  676. rules: {
  677. periodName: [
  678. { required: true, message: '营期名称不能为空', trigger: 'blur' }
  679. ],
  680. companyId: [
  681. { required: true, message: '公司不能为空', trigger: 'change' }
  682. ],
  683. courseStyle: [
  684. { required: true, message: '课程风格不能为空', trigger: 'change' }
  685. ],
  686. // redPacketGrantMethod: [
  687. // { required: true, message: '红包发放方式不能为空', trigger: 'change' }
  688. // ],
  689. periodType: [
  690. { required: true, message: '营期类型不能为空', trigger: 'change' }
  691. ],
  692. maxViewNum: [
  693. { required: true, message: '销售可查看天数不能为空', trigger: 'blur' }
  694. ],
  695. periodStartingTime: [
  696. { required: true, message: '开营日期不能为空', trigger: 'change' }
  697. ]
  698. },
  699. // 公司选项
  700. companyOptions: [],
  701. // 训练营列表
  702. campList: [],
  703. // 激活的训练营索引
  704. activeCampIndex: null,
  705. // 训练营对话框是否显示
  706. campDialogVisible: false,
  707. courseList: false,
  708. // 训练营表单
  709. campForm: {
  710. trainingCampId: null,
  711. trainingCampName: ''
  712. },
  713. // 训练营表单校验
  714. campRules: {
  715. trainingCampName: [
  716. { required: true, message: '训练营名称不能为空', trigger: 'blur' },
  717. { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
  718. ]
  719. },
  720. // 添加课程表单校验
  721. courseAddRules: {
  722. courseId: [
  723. { required: true, message: '请选择课程', trigger: 'change' }
  724. ],
  725. videoIds: [
  726. { required: true, message: '请选择小节', trigger: 'change' },
  727. { type: 'array', min: 1, message: '请至少选择一个小节', trigger: 'change' }
  728. ]
  729. },
  730. // 修改看课时间表单校验
  731. courseUpdateRules: {
  732. timeRange: [
  733. {
  734. required: true,
  735. validator: (rule, value, callback) => {
  736. if (!value || !Array.isArray(value) || value.length !== 2) {
  737. callback(new Error('请选择完整的看课时间范围'));
  738. } else {
  739. // 检查时间格式是否正确(yyyy-MM-dd HH:mm:ss)
  740. const timeRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
  741. if (!timeRegex.test(value[0]) || !timeRegex.test(value[1])) {
  742. callback(new Error('时间格式不正确'));
  743. } else if (value[0] >= value[1]) {
  744. callback(new Error('结束时间必须大于开始时间'));
  745. } else {
  746. callback();
  747. }
  748. }
  749. },
  750. trigger: 'change'
  751. }
  752. ],
  753. joinTime: [
  754. {
  755. required: true,
  756. validator: (rule, value, callback) => {
  757. if (!value) {
  758. callback(new Error('请选择领取红包时间'));
  759. } else {
  760. // 检查时间格式是否正确(yyyy-MM-dd HH:mm:ss)
  761. const timeRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
  762. if (!timeRegex.test(value)) {
  763. callback(new Error('时间格式不正确'));
  764. } else {
  765. // 检查领取红包时间是否在看课时间范围内
  766. const timeRange = this.updateCourse.form.timeRange;
  767. if (timeRange && Array.isArray(timeRange) && timeRange.length === 2) {
  768. if (value < timeRange[0] || value > timeRange[1]) {
  769. callback(new Error('领取红包时间必须在看课时间范围内'));
  770. } else {
  771. callback();
  772. }
  773. } else {
  774. callback();
  775. }
  776. }
  777. }
  778. },
  779. trigger: 'change'
  780. }
  781. ]
  782. },
  783. // 滚动节流标志
  784. scrollThrottle: false,
  785. // 加载更多状态
  786. loadingMore: false,
  787. // 设置红包对话框
  788. redPacketVisible: false,
  789. periodCompanyList: [],
  790. currentRedPacketData: {
  791. periodId: '',
  792. videoId: ''
  793. },
  794. // 营期相关设置抽屉
  795. periodSettingsVisible: false,
  796. activeTab: 'course',
  797. periodSettingsData: {},
  798. companyList: [],
  799. courseDialogVisible: false,
  800. redPacketList: [],
  801. currentCompany: null,
  802. // 选中的营期数据
  803. selectedPeriods: [],
  804. // 批量设置红包按钮是否禁用
  805. batchSetRedPacketDisabled: true,
  806. // 批量设置红包弹出框
  807. batchRedPacketVisible: false,
  808. };
  809. },
  810. created() {
  811. courseList().then(response => {
  812. this.courseList = response.list;
  813. });
  814. // this.getList();
  815. this.getLeftList();
  816. this.getCompanyList();
  817. },
  818. methods: {
  819. /** 查询会员营期列表 */
  820. getList() {
  821. this.loading = true;
  822. const params = { ...this.queryParams };
  823. pagePeriod(params).then(response => {
  824. this.periodList = response.rows;
  825. this.total = response.total;
  826. this.loading = false;
  827. });
  828. },
  829. /** 查询左侧列表 */
  830. getLeftList() {
  831. this.leftLoading = true;
  832. // 重置页码和加载更多状态
  833. this.leftQueryParams.pageNum = 1;
  834. this.loadingMore = false;
  835. // 训练营数据
  836. listCamp(this.leftQueryParams).then(response => {
  837. if (response && response.code === 200) {
  838. this.campList = response.data.list || [];
  839. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  840. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  841. this.selectCamp(this.activeCampIndex);
  842. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  843. this.$nextTick(() => {
  844. const scrollEl = this.$refs.campList;
  845. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  846. this.loadMoreCamps();
  847. }
  848. });
  849. } else {
  850. this.$message.error(response.msg || '获取训练营列表失败');
  851. this.campList = [];
  852. this.leftQueryParams.hasNextPage = false;
  853. }
  854. this.leftLoading = false;
  855. }).catch(error => {
  856. console.error('获取训练营列表失败:', error);
  857. this.$message.error('获取训练营列表失败');
  858. this.campList = [];
  859. this.leftQueryParams.hasNextPage = false;
  860. this.leftLoading = false;
  861. });
  862. },
  863. /** 搜索按钮操作 */
  864. handleQuery() {
  865. this.queryParams.pageNum = 1;
  866. this.getList();
  867. },
  868. /** 左侧搜索按钮操作 */
  869. handleLeftQuery() {
  870. // 重置页码和列表
  871. this.leftQueryParams.pageNum = 1;
  872. this.campList = [];
  873. this.getLeftList();
  874. },
  875. /** 重置按钮操作 */
  876. resetQuery() {
  877. this.resetForm("queryForm");
  878. this.queryParams.companyIdList = [];
  879. this.handleQuery();
  880. },
  881. /** 多选框选中数据 */
  882. handleSelectionChange(selection) {
  883. this.ids = selection.map(item => item.periodId)
  884. this.single = selection.length!==1
  885. this.multiple = !selection.length
  886. // 更新批量设置红包相关数据
  887. this.selectedPeriods = selection;
  888. this.batchSetRedPacketDisabled = selection.length === 0;
  889. },
  890. handleSelectionCourseChange(selection) {
  891. this.updateCourse.ids = selection.map(item => item.id)
  892. },
  893. /** 新增按钮操作 */
  894. handleAdd() {
  895. this.reset();
  896. this.open = true;
  897. this.title = "添加会员营期";
  898. this.isDisabledDateRange = false;
  899. },
  900. /** 修改按钮操作 */
  901. handleUpdate(row) {
  902. this.reset();
  903. const periodId = row.periodId || this.ids
  904. getPeriod(periodId).then(response => {
  905. this.form = response.data;
  906. if (this.form.companyId) {
  907. this.form.companyId = this.form.companyId.split(',').map(id => Number(id));
  908. }
  909. // 设置看课时间范围(回显)
  910. if (this.form.viewStartTime && this.form.viewEndTime) {
  911. this.form.timeRange = [this.form.viewStartTime, this.form.viewEndTime];
  912. }
  913. if(this.form.periodType == 1){
  914. // this.form.dateRange = [this.form.periodStartingTime, this.form.periodEndTime];
  915. this.$set(this.form,'dateRange',[this.form.periodStartingTime, this.form.periodEndTime])
  916. // console.log('this.form.dateRange',this.form.dateRange)
  917. }
  918. if(this.form.periodType == 2){
  919. this.$set(this.form,'date',this.form.periodStartingTime)
  920. // this.form.date = this.form.periodStartingTime;
  921. }
  922. this.open = true;
  923. this.title = "修改会员营期";
  924. this.isDisabledDateRange = true;
  925. });
  926. },
  927. /** 提交按钮 */
  928. submitForm() {
  929. this.$refs["form"].validate(valid => {
  930. if (valid) {
  931. let data = JSON.parse(JSON.stringify(this.form));
  932. // 处理看课时间范围
  933. if (data.timeRange && data.timeRange.length === 2) {
  934. data.viewStartTime = data.timeRange[0];
  935. data.viewEndTime = data.timeRange[1];
  936. }
  937. data.companyId = data.companyId.join()
  938. data.trainingCampId = this.queryParams.trainingCampId
  939. if (data.periodId != null) {
  940. updatePeriod(data).then(response => {
  941. if (response.code === 200) {
  942. this.msgSuccess("修改成功");
  943. this.open = false;
  944. this.getList();
  945. }
  946. });
  947. } else {
  948. addPeriod(data).then(response => {
  949. if (response.code === 200) {
  950. this.msgSuccess("新增成功");
  951. this.open = false;
  952. this.getList();
  953. }
  954. });
  955. }
  956. }
  957. });
  958. },
  959. /** 删除按钮操作 */
  960. async handleDelete(row) {
  961. const periodIds = row.periodId || this.ids;
  962. try {
  963. await this.$confirm('是否确认删除该营期?', "提示", {
  964. confirmButtonText: "确定",
  965. cancelButtonText: "取消",
  966. type: "warning"
  967. });
  968. const res = await delPeriod(periodIds);
  969. if (res && res.code === 200) {
  970. this.getList(); // 刷新列表
  971. this.$message.success('删除成功');
  972. } else {
  973. this.$message.error(res.msg);
  974. }
  975. } catch (error) {
  976. }
  977. },
  978. /** 删除按钮操作 */
  979. async handleDeleteCourse(row) {
  980. const periodDayIds = row.id || this.updateCourse.ids;
  981. try {
  982. await this.$confirm('是否确认删除该课程?', "提示", {
  983. confirmButtonText: "确定",
  984. cancelButtonText: "取消",
  985. type: "warning"
  986. });
  987. const res = await delPeriodDay(periodDayIds);
  988. if (res && res.code === 200) {
  989. this.getCourseList();// 刷新列表
  990. this.$message.success('删除成功');
  991. } else {
  992. this.$message.error(res.msg);
  993. }
  994. } catch (error) {
  995. }
  996. },
  997. /** 导出按钮操作 */
  998. handleExport() {
  999. const queryParams = this.queryParams;
  1000. this.$confirm('是否确认导出所有会员营期数据项?', "警告", {
  1001. confirmButtonText: "确定",
  1002. cancelButtonText: "取消",
  1003. type: "warning"
  1004. }).then(function() {
  1005. return exportPeriod(queryParams);
  1006. }).then(response => {
  1007. this.download(response.msg);
  1008. }).catch(function() {});
  1009. },
  1010. /** 批量设置红包 */
  1011. handleBatchSetRedPacket() {
  1012. if (this.selectedPeriods.length === 0) {
  1013. this.$message.warning('请至少选择一个营期');
  1014. return;
  1015. }
  1016. this.batchRedPacketVisible = true;
  1017. },
  1018. /** 处理批量设置红包保存 */
  1019. // handleBatchRedPacketSave(data) {
  1020. // // 这里等待接口提供后补充具体实现
  1021. // // 示例代码:
  1022. // // batchSetRedPacket(data).then(response => {
  1023. // // if (response.code === 200) {
  1024. // // this.$message.success('批量设置成功');
  1025. // // this.getList();
  1026. // // }
  1027. // // });
  1028. // this.batchRedPacketVisible = false;
  1029. // },
  1030. /** 获取公司下拉列表*/
  1031. getCompanyList() {
  1032. this.loading = true;
  1033. getCompanyList().then(response => {
  1034. this.companyOptions = response.data;
  1035. this.loading = false;
  1036. });
  1037. },
  1038. // 取消按钮
  1039. cancel() {
  1040. this.open = false;
  1041. this.reset();
  1042. },
  1043. // 表单重置
  1044. reset() {
  1045. this.form = {
  1046. periodId: null,
  1047. periodName: null,
  1048. companyId: null,
  1049. courseId: null,
  1050. videoId: null,
  1051. trainingCampId: null,
  1052. createTime: null,
  1053. updateTime: null,
  1054. courseStyle: null,
  1055. liveRoomStyle: null,
  1056. redPacketGrantMethod: 1,
  1057. periodType: 1,
  1058. periodStartingTime: null,
  1059. dateRange: [],
  1060. date: null,
  1061. days: [],
  1062. maxViewNum: 0,
  1063. periodEndTime: null,
  1064. timeRange: [], // 看课时间范围
  1065. viewStartTime: null, // 看课开始时间
  1066. viewEndTime: null, // 看课结束时间
  1067. lastJoinTime: null // 领取红包时间
  1068. };
  1069. this.resetForm("form");
  1070. },
  1071. // 处理训练营列表的逻辑
  1072. handleDeleteCamp(item) {
  1073. this.$confirm(`确定要删除训练营"${item.trainingCampName}"吗?`, '提示', {
  1074. confirmButtonText: '删除',
  1075. cancelButtonText: '取消',
  1076. type: 'warning'
  1077. }).then(() => {
  1078. // 调用删除训练营API
  1079. const trainingCampId = item.trainingCampId;
  1080. this.leftLoading = true;
  1081. delCamp(trainingCampId).then(response => {
  1082. if (response.code === 200) {
  1083. this.$message.success('删除成功');
  1084. // 从列表中移除
  1085. const index = this.campList.findIndex(camp => camp.trainingCampId === trainingCampId);
  1086. if (index !== -1) {
  1087. this.campList.splice(index, 1);
  1088. }
  1089. // 如果删除的是当前选中的训练营,则重置选中状态
  1090. if (this.activeCampIndex === index) {
  1091. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  1092. if (this.activeCampIndex !== null) {
  1093. // 更新右侧列表
  1094. this.selectCamp(this.activeCampIndex);
  1095. } else {
  1096. // 没有训练营了,清空右侧列表
  1097. this.periodList = [];
  1098. }
  1099. }
  1100. } else {
  1101. this.$message.error(response.msg || '删除失败');
  1102. }
  1103. this.leftLoading = false;
  1104. }).catch(error => {
  1105. this.$message.error('删除失败: ' + error.message);
  1106. this.leftLoading = false;
  1107. });
  1108. }).catch(() => {
  1109. this.$message.info('已取消删除');
  1110. });
  1111. },
  1112. /** 复制训练营 */
  1113. handleCopyCamp(item) {
  1114. // 调用添加训练营API
  1115. copyCamp(item.trainingCampId).then(response => {
  1116. if (response.code === 200) {
  1117. this.$message.success('复制成功');
  1118. // 重新加载训练营列表
  1119. this.getLeftList();
  1120. } else {
  1121. this.$message.error(response.msg || '复制训练营失败');
  1122. }
  1123. }).catch(error => {
  1124. this.$message.error('复制训练营失败: ' + error.message);
  1125. });
  1126. },
  1127. /** 修改训练营按钮操作 */
  1128. handleEditCamp(item) {
  1129. this.resetCampForm();
  1130. this.leftLoading = true;
  1131. // 获取最新的训练营数据
  1132. const trainingCampId = item.trainingCampId;
  1133. // 应该调用获取训练营详情的API
  1134. setTimeout(() => {
  1135. // 填充表单数据
  1136. this.campForm = {
  1137. trainingCampId: item.trainingCampId,
  1138. trainingCampName: item.trainingCampName,
  1139. orderNumber: item.orderNumber || 1,
  1140. status: item.status !== undefined ? item.status : 1
  1141. };
  1142. this.campDialogVisible = true;
  1143. this.leftLoading = false;
  1144. }, 300);
  1145. },
  1146. /** 新建训练营按钮操作 */
  1147. handleAddTrainingCamp() {
  1148. this.resetCampForm();
  1149. this.campDialogVisible = true;
  1150. },
  1151. /** 重置训练营表单 */
  1152. resetCampForm() {
  1153. this.campForm = {
  1154. trainingCampId: null,
  1155. trainingCampName: ''
  1156. };
  1157. // 如果表单已经创建,则重置校验结果
  1158. if (this.$refs.campForm) {
  1159. this.$refs.campForm.resetFields();
  1160. }
  1161. },
  1162. /** 取消训练营表单 */
  1163. cancelCampForm() {
  1164. this.campDialogVisible = false;
  1165. this.resetCampForm();
  1166. },
  1167. /** 提交训练营表单 */
  1168. submitCampForm() {
  1169. this.$refs.campForm.validate(valid => {
  1170. if (valid) {
  1171. // 显示加载中
  1172. this.leftLoading = true;
  1173. // 准备提交的数据
  1174. const submitData = JSON.parse(JSON.stringify(this.campForm));
  1175. // 判断是新增还是修改
  1176. if (submitData.trainingCampId) {
  1177. // 修改训练营
  1178. editCamp(submitData).then(response => {
  1179. if (response.code === 200) {
  1180. this.$message.success('修改训练营成功');
  1181. this.campDialogVisible = false;
  1182. // 更新列表中的数据
  1183. const index = this.campList.findIndex(camp => camp.trainingCampId === submitData.trainingCampId);
  1184. if (index !== -1) {
  1185. this.campList[index] = { ...this.campList[index], ...submitData };
  1186. // 如果修改的是当前选中的训练营,更新右侧列表
  1187. if (this.activeCampIndex === index) {
  1188. this.selectCamp(index);
  1189. }
  1190. }
  1191. // 重新加载训练营列表
  1192. this.getLeftList();
  1193. } else {
  1194. this.$message.error(response.msg || '修改训练营失败');
  1195. this.leftLoading = false;
  1196. }
  1197. }).catch(error => {
  1198. this.$message.error('修改训练营失败: ' + (error.message || '未知错误'));
  1199. this.leftLoading = false;
  1200. });
  1201. } else {
  1202. // 新增训练营
  1203. addCamp(submitData).then(response => {
  1204. if (response.code === 200) {
  1205. this.$message.success('新建训练营成功');
  1206. this.campDialogVisible = false;
  1207. // 重新加载训练营列表
  1208. this.getLeftList();
  1209. } else {
  1210. this.$message.error(response.msg || '新建训练营失败');
  1211. this.leftLoading = false;
  1212. }
  1213. }).catch(error => {
  1214. this.$message.error('新建训练营失败: ' + (error.message || '未知错误'));
  1215. this.leftLoading = false;
  1216. });
  1217. }
  1218. }
  1219. });
  1220. },
  1221. /** 排序方式改变 */
  1222. handleSortChange(value) {
  1223. this.leftQueryParams.scs = value;
  1224. // 重置页码和列表
  1225. this.leftQueryParams.pageNum = 1;
  1226. this.campList = [];
  1227. this.getLeftList();
  1228. },
  1229. /** 选中训练营 */
  1230. selectCamp(index) {
  1231. if(index == null || index == undefined) return;
  1232. this.activeCampIndex = index;
  1233. // 加载对应的训练营营期数据
  1234. const selectedCamp = this.campList[index];
  1235. this.queryParams.trainingCampId = selectedCamp.trainingCampId;
  1236. this.getList();
  1237. },
  1238. /** 处理滚动事件,实现滚动到底部加载更多 */
  1239. handleScroll() {
  1240. // 如果正在节流中或者正在加载中,则不处理
  1241. if (this.scrollThrottle || this.loadingMore) return;
  1242. // 设置节流,200ms内不再处理滚动事件
  1243. this.scrollThrottle = true;
  1244. setTimeout(() => {
  1245. this.scrollThrottle = false;
  1246. }, 200);
  1247. const scrollEl = this.$refs.campList;
  1248. if (!scrollEl) return;
  1249. // 判断是否滚动到底部:滚动高度 + 可视高度 >= 总高度 - 30(添加30px的容差,提前触发加载)
  1250. const isBottom = scrollEl.scrollTop + scrollEl.clientHeight >= scrollEl.scrollHeight - 30;
  1251. // 如果滚动到底部,且有下一页数据,且当前不在加载中,则加载更多
  1252. if (isBottom && this.leftQueryParams.hasNextPage && !this.leftLoading && !this.loadingMore) {
  1253. this.loadMoreCamps();
  1254. }
  1255. },
  1256. /** 加载更多训练营数据 */
  1257. loadMoreCamps() {
  1258. // 已在加载中,防止重复加载
  1259. if (this.leftLoading || this.loadingMore) return;
  1260. // 设置加载状态
  1261. this.loadingMore = true;
  1262. // 页码加1
  1263. this.leftQueryParams.pageNum += 1;
  1264. // 加载下一页数据
  1265. listCamp(this.leftQueryParams).then(response => {
  1266. if (response && response.code === 200) {
  1267. // 将新数据追加到列表中
  1268. const newList = response.data.list || [];
  1269. if (newList.length > 0) {
  1270. this.campList = [...this.campList, ...newList];
  1271. }
  1272. // 更新是否有下一页的标志
  1273. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  1274. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  1275. this.$nextTick(() => {
  1276. const scrollEl = this.$refs.campList;
  1277. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  1278. // 延迟一点再加载下一页,避免过快加载
  1279. setTimeout(() => {
  1280. this.loadMoreCamps();
  1281. }, 300);
  1282. }
  1283. });
  1284. } else {
  1285. this.$message.error(response.msg || '加载更多训练营失败');
  1286. }
  1287. this.loadingMore = false;
  1288. }).catch(error => {
  1289. console.error('加载更多训练营失败:', error);
  1290. this.$message.error('加载更多训练营失败');
  1291. this.loadingMore = false;
  1292. });
  1293. },
  1294. timeChange(type) {
  1295. if (type == 1) {
  1296. this.form.periodStartingTime = this.form.dateRange[0];
  1297. this.form.periodEndTime = this.form.dateRange[1];
  1298. if (!Array.isArray(this.form.days)) {
  1299. this.form.days = [];
  1300. }
  1301. this.form.days = [];
  1302. let days = this.getDiff(this.form.periodStartingTime, this.form.periodEndTime);
  1303. for (let i = 0; i < days; i++) {
  1304. this.form.days.push({ lesson: i + 1 });
  1305. }
  1306. }
  1307. if (type == 2) {
  1308. this.form.periodStartingTime = this.form.date;
  1309. this.form.periodEndTime = this.form.date;
  1310. this.form.days = [];
  1311. }
  1312. },
  1313. getDiff(start, end) {
  1314. if(start == null || start == undefined || start == '') return 0;
  1315. if(end == null || end == undefined || end == '') return 0;
  1316. if(start == end) 1;
  1317. const startDate = this.getUTCDate(start);
  1318. const endDate = this.getUTCDate(end);
  1319. const timeDiff = endDate - startDate;
  1320. return (Math.floor(timeDiff / (1000 * 3600 * 24))) + 1; // 直接取整
  1321. },
  1322. getUTCDate(dateStr) {
  1323. const [year, month, day] = dateStr.split('-').map(Number);
  1324. return new Date(Date.UTC(year, month - 1, day)); // 月份从0开始
  1325. },
  1326. // handleCourse(row){
  1327. // this.course = {
  1328. // open: false,
  1329. // row:{},
  1330. // list:[],
  1331. // queryParams: {
  1332. // pageNum: 1,
  1333. // pageSize: 3, // 修改为每页显示3条
  1334. // },
  1335. // loading: true,
  1336. // total: 0,
  1337. // addOpen: false,
  1338. // form: {},
  1339. // };
  1340. // this.course.open = true;
  1341. // this.course.row = row;
  1342. // this.course.queryParams.periodId = row.periodId;
  1343. // this.getCourseList();
  1344. // },
  1345. getCourseList(){
  1346. this.course.loading = true;
  1347. getDays(this.course.queryParams).then(e => {
  1348. this.course.list = e.rows;
  1349. this.course.total = e.total;
  1350. this.course.loading = false;
  1351. });
  1352. },
  1353. handleAddCourse() {
  1354. this.course.addOpen = true;
  1355. this.course.form = {
  1356. periodId: this.course.queryParams.periodId,
  1357. courseId: null,
  1358. timeRange: ['00:00:00', '23:59:59'],
  1359. joinTime: '23:59:59',
  1360. videoIds: []
  1361. };
  1362. // 重置表单
  1363. this.$nextTick(() => {
  1364. if (this.$refs.courseAddForm) {
  1365. this.$refs.courseAddForm.resetFields();
  1366. }
  1367. });
  1368. },
  1369. handleUpdateCourse() {
  1370. this.updateCourse.open = true;
  1371. this.updateCourse.form = {
  1372. ids: this.updateCourse.ids,
  1373. timeRange: null,
  1374. joinTime: null
  1375. };
  1376. // 重置表单校验状态(但不清空选中状态)
  1377. this.$nextTick(() => {
  1378. if (this.$refs.courseUpdateForm) {
  1379. this.$refs.courseUpdateForm.resetFields();
  1380. }
  1381. });
  1382. },
  1383. closeAddCourse() {
  1384. this.course.addOpen = false;
  1385. this.course.form = {
  1386. periodId: null,
  1387. courseId: null,
  1388. timeRange: null,
  1389. joinTime: null,
  1390. videoIds: []
  1391. };
  1392. // 重置表单
  1393. if (this.$refs.courseAddForm) {
  1394. this.$refs.courseAddForm.resetFields();
  1395. }
  1396. },
  1397. closeUpdateCourse() {
  1398. this.updateCourse.open = false;
  1399. // 清空选中的课程id,使【修改看课时间】按钮变为禁用状态
  1400. this.updateCourse.ids = [];
  1401. // 清空课程列表的选中状态
  1402. this.$nextTick(() => {
  1403. if (this.$refs.courseTable) {
  1404. this.$refs.courseTable.clearSelection();
  1405. }
  1406. });
  1407. // 重置表单数据
  1408. this.updateCourse.form = {
  1409. ids: [],
  1410. timeRange: null,
  1411. joinTime: null
  1412. };
  1413. // 重置表单校验
  1414. this.$nextTick(() => {
  1415. if (this.$refs.courseUpdateForm) {
  1416. this.$refs.courseUpdateForm.resetFields();
  1417. }
  1418. });
  1419. },
  1420. courseChange(row){
  1421. this.course.form.videoIds = [];
  1422. videoList(row).then(response => {
  1423. this.videoList=response.list
  1424. });
  1425. },
  1426. submitCourseForm(){
  1427. this.$refs.courseAddForm.validate(valid => {
  1428. if (valid) {
  1429. if(this.course.form.timeRange != null && this.course.form.timeRange.length === 2){
  1430. this.course.form.startTime = this.course.form.timeRange[0];
  1431. this.course.form.endTime1 = this.course.form.timeRange[1];
  1432. }
  1433. // 提交数据
  1434. addCourse(this.course.form).then(response => {
  1435. this.$message.success('添加成功');
  1436. this.course.addOpen = false;
  1437. // 重新加载训练营列表
  1438. this.getCourseList();
  1439. });
  1440. }
  1441. });
  1442. },
  1443. submitUpdateCourseForm(){
  1444. this.$refs.courseUpdateForm.validate(valid => {
  1445. if (valid) {
  1446. // 检查时间范围是否正确
  1447. if (this.updateCourse.form.timeRange &&
  1448. Array.isArray(this.updateCourse.form.timeRange) &&
  1449. this.updateCourse.form.timeRange.length === 2) {
  1450. this.updateCourse.form.startTime = this.updateCourse.form.timeRange[0];
  1451. this.updateCourse.form.endTime1 = this.updateCourse.form.timeRange[1];
  1452. } else {
  1453. this.$message.error('请先选择正确的看课时间范围');
  1454. return;
  1455. }
  1456. // 检查领取红包时间是否正确
  1457. if (!this.updateCourse.form.joinTime) {
  1458. this.$message.error('请选择领取红包时间');
  1459. return;
  1460. }
  1461. // 提交数据
  1462. updateCourseTime(this.updateCourse.form).then(response => {
  1463. this.$message.success('修改成功');
  1464. this.updateCourse.open = false;
  1465. // 清空选中的课程ID,使【修改看课时间】按钮变为禁用状态
  1466. this.updateCourse.ids = [];
  1467. // 清空课程列表的选中状态
  1468. this.$nextTick(() => {
  1469. if (this.$refs.courseTable) {
  1470. this.$refs.courseTable.clearSelection();
  1471. }
  1472. });
  1473. // 重新加载训练营列表
  1474. this.getCourseList();
  1475. }).catch(error => {
  1476. this.$message.error('修改失败:' + (error.message || '未知错误'));
  1477. });
  1478. }
  1479. });
  1480. },
  1481. updatePeriodDateSubmit(){
  1482. updateCourseDate(this.updatePeriodDate.form).then(response => {
  1483. this.$message.success('修改成功');
  1484. this.updatePeriodDate.open = false;
  1485. // 重新加载课程列表
  1486. this.getCourseList();
  1487. });
  1488. },
  1489. // saveCourseData(){
  1490. // updateListCourseData(this.course.list).then(response => {
  1491. // this.$message.success('保存成功');
  1492. // this.getCourseList();
  1493. // });
  1494. // },
  1495. // setRedPacket(row) {
  1496. // this.currentRedPacketData = {
  1497. // periodId: row.periodId
  1498. // // videoId: row.videoId
  1499. // };
  1500. // this.redPacketVisible = true;
  1501. // },
  1502. handleRedPacketSuccess() {
  1503. this.getCourseList();
  1504. },
  1505. handlePeriodSettings(row) {
  1506. this.periodSettingsData = row;
  1507. this.periodSettingsVisible = true;
  1508. // 初始化课程列表
  1509. this.course.queryParams.periodId = row.periodId;
  1510. // 根据当前激活的tab加载对应数据
  1511. this.handleTabClick({ name: this.activeTab });
  1512. },
  1513. // 结束营期
  1514. handleClosePeriod(row) {
  1515. const msg = `注: 1.确认结束营期,该营期的开营结束时间改为当天24点。2.当天正在播放中的课程不变。3.第二天如有未开始的课程,统一改为已结束。是否确认结束 ${row.periodName} 营期吗?`
  1516. this.$confirm(msg, "警告", {
  1517. confirmButtonText: "确定",
  1518. cancelButtonText: "取消",
  1519. type: "warning"
  1520. }).then(() => {
  1521. closePeriod({id: row.periodId}).then(response => {
  1522. if (response.code === 200) {
  1523. this.getList()
  1524. } else {
  1525. this.$message.error(response.msg)
  1526. }
  1527. })
  1528. }).catch(() => {})
  1529. },
  1530. handleBatchRedPacketSuccess() {
  1531. this.batchRedPacketVisible = false;
  1532. this.getCourseList();
  1533. },
  1534. /** 处理tab切换 */
  1535. handleTabClick(tab) {
  1536. if (tab.name === 'course') {
  1537. this.getCourseList();
  1538. } else if (tab.name === 'company') {
  1539. this.redPacketVisible = true;
  1540. }
  1541. },
  1542. /** 上移课程 */
  1543. handleTop(row) {
  1544. const currentIndex = this.course.list.findIndex(item => item.id === row.id);
  1545. if (currentIndex <= 0) {
  1546. this.$message.warning('已经是第一条数据');
  1547. return;
  1548. }
  1549. // 获取上一条数据
  1550. const prevRow = this.course.list[currentIndex - 1];
  1551. console.log({
  1552. id: row.id,
  1553. targetId: prevRow.id,
  1554. type: 1 //上移
  1555. })
  1556. periodCourseMove({
  1557. id: row.id,
  1558. targetId: prevRow.id,
  1559. type: 1 //上移
  1560. }).then(response => {
  1561. if (response.code === 200) {
  1562. this.$message.success('上移成功');
  1563. this.getCourseList();
  1564. } else {
  1565. this.$message.error(response.msg || '上移失败');
  1566. }
  1567. }).catch(() => {
  1568. this.$message.error('上移失败');
  1569. });
  1570. },
  1571. /** 下移课程 */
  1572. handleBottom(row) {
  1573. const currentIndex = this.course.list.findIndex(item => item.id === row.id);
  1574. if (currentIndex === -1 || currentIndex >= this.course.list.length - 1) {
  1575. this.$message.warning('已经是最后一条数据');
  1576. return;
  1577. }
  1578. // 获取下一条数据
  1579. const nextRow = this.course.list[currentIndex + 1];
  1580. periodCourseMove({
  1581. id: row.id,
  1582. targetId: nextRow.id,
  1583. type: 2 //下移
  1584. }).then(response => {
  1585. if (response.code === 200) {
  1586. this.$message.success('下移成功');
  1587. this.getCourseList(); // 重新加载列表
  1588. } else {
  1589. this.$message.error(response.msg || '下移失败');
  1590. }
  1591. }).catch(() => {
  1592. this.$message.error('下移失败');
  1593. });
  1594. },
  1595. /** 营期状态格式化 */
  1596. periodStatusFormatter(row) {
  1597. const statusMap = {
  1598. 1: '未开始',
  1599. 2: '进行中',
  1600. 3: '已结束'
  1601. };
  1602. return statusMap[row.periodStatus] || '未知状态';
  1603. },
  1604. /** 开课状态格式化 */
  1605. courseStatusFormatter(row) {
  1606. const statusMap = {
  1607. 0: '未开始',
  1608. 1: '进行中',
  1609. 2: '已结束'
  1610. };
  1611. return statusMap[row.status] || '未知状态';
  1612. },
  1613. /** 营期状态格式化 */
  1614. handleUpdateDate(row) {
  1615. this.updatePeriodDate.form = {id: row.id, dayDate: row.dayDate};
  1616. this.updatePeriodDate.open = true;
  1617. },
  1618. disabledDate(time) {
  1619. return time.getTime() < new Date(new Date().setHours(0,0,0,0));
  1620. },
  1621. getPickerOptions() {
  1622. // 如果已选择看课时间范围,则领取红包时间应在看课时间范围内
  1623. if (this.updateCourse.form.timeRange &&
  1624. Array.isArray(this.updateCourse.form.timeRange) &&
  1625. this.updateCourse.form.timeRange.length === 2) {
  1626. return {
  1627. selectableRange: `${this.updateCourse.form.timeRange[0]} - ${this.updateCourse.form.timeRange[1]}`
  1628. };
  1629. }
  1630. // 默认全天可选
  1631. return {
  1632. selectableRange: '00:00:00 - 23:59:59'
  1633. };
  1634. },
  1635. onTimeRangeChange() {
  1636. // 当看课时间范围改变时,清空领取红包时间
  1637. this.updateCourse.form.joinTime = null;
  1638. // 强制更新组件以刷新领取红包时间的可选范围
  1639. this.$forceUpdate();
  1640. },
  1641. },
  1642. };
  1643. </script>
  1644. <style scoped>
  1645. .left-aside {
  1646. background-color: #fff;
  1647. border-right: 1px solid #EBEEF5;
  1648. padding: 0;
  1649. display: flex;
  1650. flex-direction: column;
  1651. height: 800px;
  1652. }
  1653. .left-header {
  1654. padding: 10px;
  1655. border-bottom: 1px solid #EBEEF5;
  1656. }
  1657. .left-header-top {
  1658. display: flex;
  1659. justify-content: space-between;
  1660. align-items: center;
  1661. margin-bottom: 10px;
  1662. }
  1663. .search-btn {
  1664. width: 50%;
  1665. height: 36px;
  1666. background-color: #409EFF;
  1667. color: white;
  1668. border: none;
  1669. }
  1670. .search-input-wrapper {
  1671. margin-bottom: 10px;
  1672. }
  1673. .sort-wrapper {
  1674. display: flex;
  1675. align-items: center;
  1676. margin-bottom: 10px;
  1677. }
  1678. .sort-label {
  1679. width: 70px;
  1680. font-size: 14px;
  1681. font-weight: 600;
  1682. color: #909399;
  1683. }
  1684. .sort-select {
  1685. margin-left: 10px;
  1686. width: 280px;
  1687. }
  1688. .color-wrapper {
  1689. display: flex;
  1690. align-items: center;
  1691. margin-bottom: 10px;
  1692. }
  1693. .color-label {
  1694. width: 70px;
  1695. color: #606266;
  1696. }
  1697. .color-hint {
  1698. margin-left: 10px;
  1699. color: #606266;
  1700. font-size: 12px;
  1701. }
  1702. .color-help {
  1703. margin-left: 5px;
  1704. color: #909399;
  1705. cursor: pointer;
  1706. }
  1707. .hint-text {
  1708. color: #606266;
  1709. font-size: 12px;
  1710. margin-top: 5px;
  1711. }
  1712. .camp-list {
  1713. flex: 1;
  1714. overflow-y: auto;
  1715. padding: 3px;
  1716. }
  1717. .camp-item {
  1718. margin-bottom: 5px;
  1719. padding: 15px;
  1720. background-color: #ffffff;
  1721. position: relative;
  1722. cursor: pointer;
  1723. display: flex;
  1724. justify-content: space-between;
  1725. border: 1px solid #eaedf2;
  1726. }
  1727. .camp-item:last-child {
  1728. margin-bottom: 0;
  1729. }
  1730. .camp-item:hover {
  1731. background-color: #f5f9ff;
  1732. }
  1733. .camp-item.active {
  1734. background-color: #eaf4ff;
  1735. border-left: 1px solid #75b8fc;
  1736. }
  1737. .camp-content {
  1738. flex: 1;
  1739. padding-right: 10px;
  1740. }
  1741. .camp-title {
  1742. font-weight: bold;
  1743. font-size: 16px;
  1744. margin-bottom: 8px;
  1745. color: #333;
  1746. display: flex;
  1747. align-items: center;
  1748. }
  1749. .camp-icon {
  1750. font-size: 16px;
  1751. margin-right: 6px;
  1752. color: #409EFF;
  1753. }
  1754. .camp-info {
  1755. display: flex;
  1756. justify-content: space-between;
  1757. margin-bottom: 8px;
  1758. font-size: 12px;
  1759. color: #c4c1c1;
  1760. line-height: 1.5;
  1761. }
  1762. .camp-stats {
  1763. display: flex;
  1764. justify-content: space-between;
  1765. font-size: 12px;
  1766. color: #666;
  1767. background-color: #f5f9ff;
  1768. padding: 6px 10px;
  1769. border-radius: 4px;
  1770. line-height: 1.5;
  1771. }
  1772. .stat-item {
  1773. display: flex;
  1774. align-items: center;
  1775. }
  1776. .stat-item i {
  1777. margin-right: 4px;
  1778. font-size: 14px;
  1779. color: #409EFF;
  1780. }
  1781. .camp-actions {
  1782. display: flex;
  1783. flex-direction: column;
  1784. justify-content: center;
  1785. align-items: flex-end;
  1786. gap: 8px;
  1787. border-left: 1px dashed #eaedf2;
  1788. padding-left: 12px;
  1789. min-width: 50px;
  1790. }
  1791. .action-btn {
  1792. padding: 2px 5px;
  1793. font-size: 12px;
  1794. border-radius: 4px;
  1795. transition: all 0.2s;
  1796. }
  1797. .action-btn:hover {
  1798. background-color: rgba(255, 255, 255, 0.8);
  1799. }
  1800. .delete-btn {
  1801. color: #f56c6c;
  1802. }
  1803. .delete-btn:hover {
  1804. background-color: rgba(245, 108, 108, 0.1);
  1805. }
  1806. .copy-btn {
  1807. color: #409EFF;
  1808. }
  1809. .copy-btn:hover {
  1810. background-color: rgba(64, 158, 255, 0.1);
  1811. }
  1812. .warning-icon {
  1813. color: #E6A23C;
  1814. font-size: 16px;
  1815. margin-left: 5px;
  1816. }
  1817. .el-main {
  1818. padding: 10px;
  1819. }
  1820. /* 添加训练营表单样式 */
  1821. .drawer-footer {
  1822. /* position: absolute; */
  1823. bottom: 0;
  1824. left: 0;
  1825. right: 0;
  1826. padding: 20px;
  1827. background: #fff;
  1828. text-align: right;
  1829. border-top: 1px solid #e8e8e8;
  1830. }
  1831. .el-input-number {
  1832. width: 100%;
  1833. }
  1834. /* 加载更多样式 */
  1835. .loading-more {
  1836. display: flex;
  1837. align-items: center;
  1838. justify-content: center;
  1839. padding: 12px 0;
  1840. color: #909399;
  1841. font-size: 14px;
  1842. }
  1843. .loading-more i {
  1844. margin-right: 5px;
  1845. font-size: 16px;
  1846. }
  1847. /* 无更多数据提示 */
  1848. .no-more-data {
  1849. display: flex;
  1850. align-items: center;
  1851. justify-content: center;
  1852. padding: 12px 0;
  1853. color: #c0c4cc;
  1854. font-size: 13px;
  1855. }
  1856. .no-more-data span {
  1857. position: relative;
  1858. display: flex;
  1859. align-items: center;
  1860. }
  1861. </style>