index.vue 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959
  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, getDays, addCourse,delPeriodDay, 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. async handleDeleteCourse(row) {
  821. const periodDayIds = row.id || this.updateCourse.ids;
  822. try {
  823. await this.$confirm('是否确认删除该课程?', "提示", {
  824. confirmButtonText: "确定",
  825. cancelButtonText: "取消",
  826. type: "warning"
  827. });
  828. const res = await delPeriodDay(periodDayIds);
  829. if (res && res.code === 200) {
  830. this.getCourseList();// 刷新列表
  831. this.$message.success('删除成功');
  832. } else {
  833. this.$message.error(res.msg);
  834. }
  835. } catch (error) {
  836. }
  837. },
  838. /** 查询会员营期列表 */
  839. getList() {
  840. this.loading = true;
  841. const params = { ...this.queryParams };
  842. pagePeriod(params).then(response => {
  843. this.periodList = response.rows;
  844. this.total = response.total;
  845. this.loading = false;
  846. });
  847. },
  848. /** 查询左侧列表 */
  849. getLeftList() {
  850. this.leftLoading = true;
  851. // 重置页码和加载更多状态
  852. this.leftQueryParams.pageNum = 1;
  853. this.loadingMore = false;
  854. // 训练营数据
  855. listCamp(this.leftQueryParams).then(response => {
  856. if (response && response.code === 200) {
  857. this.campList = response.data.list || [];
  858. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  859. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  860. this.selectCamp(this.activeCampIndex);
  861. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  862. this.$nextTick(() => {
  863. const scrollEl = this.$refs.campList;
  864. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  865. this.loadMoreCamps();
  866. }
  867. });
  868. } else {
  869. this.$message.error(response.msg || '获取训练营列表失败');
  870. this.campList = [];
  871. this.leftQueryParams.hasNextPage = false;
  872. }
  873. this.leftLoading = false;
  874. }).catch(error => {
  875. console.error('获取训练营列表失败:', error);
  876. this.$message.error('获取训练营列表失败');
  877. this.campList = [];
  878. this.leftQueryParams.hasNextPage = false;
  879. this.leftLoading = false;
  880. });
  881. },
  882. /** 搜索按钮操作 */
  883. handleQuery() {
  884. this.queryParams.pageNum = 1;
  885. this.getList();
  886. },
  887. /** 左侧搜索按钮操作 */
  888. handleLeftQuery() {
  889. // 重置页码和列表
  890. this.leftQueryParams.pageNum = 1;
  891. this.campList = [];
  892. this.getLeftList();
  893. },
  894. /** 重置按钮操作 */
  895. resetQuery() {
  896. this.resetForm("queryForm");
  897. this.queryParams.companyIdList = [];
  898. this.handleQuery();
  899. },
  900. /** 多选框选中数据 */
  901. handleSelectionChange(selection) {
  902. this.ids = selection.map(item => item.periodId)
  903. this.single = selection.length!==1
  904. this.multiple = !selection.length
  905. // 更新批量设置红包相关数据
  906. this.selectedPeriods = selection;
  907. this.batchSetRedPacketDisabled = selection.length === 0;
  908. },
  909. handleSelectionCourseChange(selection) {
  910. this.updateCourse.ids = selection.map(item => item.id)
  911. },
  912. /** 新增按钮操作 */
  913. handleAdd() {
  914. this.reset();
  915. this.open = true;
  916. this.title = "添加会员营期";
  917. this.isDisabledDateRange = false;
  918. },
  919. /** 修改按钮操作 */
  920. handleUpdate(row) {
  921. this.reset();
  922. const periodId = row.periodId || this.ids
  923. getPeriod(periodId).then(response => {
  924. this.form = response.data;
  925. if (this.form.companyId) {
  926. this.form.companyId = this.form.companyId.split(',').map(id => Number(id));
  927. }
  928. // 设置看课时间范围(回显)
  929. if (this.form.viewStartTime && this.form.viewEndTime) {
  930. this.form.timeRange = [this.form.viewStartTime, this.form.viewEndTime];
  931. }
  932. if(this.form.periodType == 1){
  933. this.$set(this.form,'dateRange',[this.form.periodStartingTime, this.form.periodEndTime])
  934. }
  935. if(this.form.periodType == 2){
  936. this.$set(this.form,'date',this.form.periodStartingTime)
  937. }
  938. this.open = true;
  939. this.title = "修改会员营期";
  940. this.isDisabledDateRange = true;
  941. });
  942. },
  943. /** 提交按钮 */
  944. submitForm() {
  945. this.$refs["form"].validate(valid => {
  946. if (valid) {
  947. let data = JSON.parse(JSON.stringify(this.form));
  948. // 处理看课时间范围
  949. if (data.timeRange && data.timeRange.length === 2) {
  950. data.viewStartTime = data.timeRange[0];
  951. data.viewEndTime = data.timeRange[1];
  952. }
  953. data.companyId = data.companyId.join()
  954. data.trainingCampId = this.queryParams.trainingCampId
  955. if (data.periodId != null) {
  956. updatePeriod(data).then(response => {
  957. if (response.code === 200) {
  958. this.msgSuccess("修改成功");
  959. this.open = false;
  960. this.getList();
  961. }
  962. });
  963. } else {
  964. addPeriod(data).then(response => {
  965. if (response.code === 200) {
  966. this.msgSuccess("新增成功");
  967. this.open = false;
  968. this.getList();
  969. }
  970. });
  971. }
  972. }
  973. });
  974. },
  975. /** 删除按钮操作 */
  976. async handleDelete(row) {
  977. const periodIds = row.periodId || this.ids;
  978. try {
  979. await this.$confirm('是否确认删除该营期?', "提示", {
  980. confirmButtonText: "确定",
  981. cancelButtonText: "取消",
  982. type: "warning"
  983. });
  984. const res = await delPeriod(periodIds);
  985. if (res && res.code === 200) {
  986. this.getList(); // 刷新列表
  987. this.$message.success('删除成功');
  988. } else {
  989. this.$message.error(res.msg);
  990. }
  991. } catch (error) {
  992. }
  993. },
  994. /** 导出按钮操作 */
  995. handleExport() {
  996. const queryParams = this.queryParams;
  997. this.$confirm('是否确认导出所有会员营期数据项?', "警告", {
  998. confirmButtonText: "确定",
  999. cancelButtonText: "取消",
  1000. type: "warning"
  1001. }).then(function() {
  1002. return exportPeriod(queryParams);
  1003. }).then(response => {
  1004. this.download(response.msg);
  1005. }).catch(function() {});
  1006. },
  1007. /** 批量设置红包 */
  1008. handleBatchSetRedPacket() {
  1009. if (this.selectedPeriods.length === 0) {
  1010. this.$message.warning('请至少选择一个营期');
  1011. return;
  1012. }
  1013. this.batchRedPacketVisible = true;
  1014. },
  1015. /** 处理批量设置红包保存 */
  1016. // handleBatchRedPacketSave(data) {
  1017. // // 这里等待接口提供后补充具体实现
  1018. // // 示例代码:
  1019. // // batchSetRedPacket(data).then(response => {
  1020. // // if (response.code === 200) {
  1021. // // this.$message.success('批量设置成功');
  1022. // // this.getList();
  1023. // // }
  1024. // // });
  1025. // this.batchRedPacketVisible = false;
  1026. // },
  1027. /** 获取公司下拉列表*/
  1028. getCompanyList() {
  1029. this.loading = true;
  1030. getCompanyList().then(response => {
  1031. this.companyOptions = response.data;
  1032. this.loading = false;
  1033. });
  1034. },
  1035. // 取消按钮
  1036. cancel() {
  1037. this.open = false;
  1038. this.reset();
  1039. },
  1040. // 表单重置
  1041. reset() {
  1042. this.form = {
  1043. periodId: null,
  1044. periodName: null,
  1045. companyId: null,
  1046. courseId: null,
  1047. videoId: null,
  1048. trainingCampId: null,
  1049. createTime: null,
  1050. updateTime: null,
  1051. courseStyle: null,
  1052. liveRoomStyle: null,
  1053. redPacketGrantMethod: 1,
  1054. periodType: 1,
  1055. periodStartingTime: null,
  1056. dateRange: [],
  1057. date: null,
  1058. days: [],
  1059. maxViewNum: 0,
  1060. periodEndTime: null,
  1061. timeRange: [], // 看课时间范围
  1062. viewStartTime: null, // 看课开始时间
  1063. viewEndTime: null, // 看课结束时间
  1064. lastJoinTime: null // 领取红包时间
  1065. };
  1066. this.resetForm("form");
  1067. },
  1068. // 处理训练营列表的逻辑
  1069. handleDeleteCamp(item) {
  1070. this.$confirm(`确定要删除训练营"${item.trainingCampName}"吗?`, '提示', {
  1071. confirmButtonText: '删除',
  1072. cancelButtonText: '取消',
  1073. type: 'warning'
  1074. }).then(() => {
  1075. // 调用删除训练营API
  1076. const trainingCampId = item.trainingCampId;
  1077. this.leftLoading = true;
  1078. delCamp(trainingCampId).then(response => {
  1079. if (response.code === 200) {
  1080. this.$message.success('删除成功');
  1081. // 从列表中移除
  1082. const index = this.campList.findIndex(camp => camp.trainingCampId === trainingCampId);
  1083. if (index !== -1) {
  1084. this.campList.splice(index, 1);
  1085. }
  1086. // 如果删除的是当前选中的训练营,则重置选中状态
  1087. if (this.activeCampIndex === index) {
  1088. this.activeCampIndex = this.campList.length > 0 ? 0 : null;
  1089. if (this.activeCampIndex !== null) {
  1090. // 更新右侧列表
  1091. this.selectCamp(this.activeCampIndex);
  1092. } else {
  1093. // 没有训练营了,清空右侧列表
  1094. this.periodList = [];
  1095. }
  1096. }
  1097. } else {
  1098. this.$message.error(response.msg || '删除失败');
  1099. }
  1100. this.leftLoading = false;
  1101. }).catch(error => {
  1102. // this.$message.error('删除失败: ' + error.message);
  1103. this.leftLoading = false;
  1104. });
  1105. }).catch(() => {
  1106. this.$message.info('已取消删除');
  1107. });
  1108. },
  1109. /** 复制训练营 */
  1110. handleCopyCamp(item) {
  1111. // 调用添加训练营API
  1112. copyCamp(item.trainingCampId).then(response => {
  1113. if (response.code === 200) {
  1114. this.$message.success('复制成功');
  1115. // 重新加载训练营列表
  1116. this.getLeftList();
  1117. } else {
  1118. this.$message.error(response.msg || '复制训练营失败');
  1119. }
  1120. }).catch(error => {
  1121. this.$message.error('复制训练营失败: ' + error.message);
  1122. });
  1123. },
  1124. /** 修改训练营按钮操作 */
  1125. handleEditCamp(item) {
  1126. this.resetCampForm();
  1127. this.leftLoading = true;
  1128. // 获取最新的训练营数据
  1129. const trainingCampId = item.trainingCampId;
  1130. // 应该调用获取训练营详情的API
  1131. setTimeout(() => {
  1132. // 填充表单数据
  1133. this.campForm = {
  1134. trainingCampId: item.trainingCampId,
  1135. trainingCampName: item.trainingCampName,
  1136. orderNumber: item.orderNumber || 1,
  1137. status: item.status !== undefined ? item.status : 1
  1138. };
  1139. this.campDialogVisible = true;
  1140. this.leftLoading = false;
  1141. }, 300);
  1142. },
  1143. /** 新建训练营按钮操作 */
  1144. handleAddTrainingCamp() {
  1145. this.resetCampForm();
  1146. this.campDialogVisible = true;
  1147. },
  1148. /** 重置训练营表单 */
  1149. resetCampForm() {
  1150. this.campForm = {
  1151. trainingCampId: null,
  1152. trainingCampName: ''
  1153. };
  1154. // 如果表单已经创建,则重置校验结果
  1155. if (this.$refs.campForm) {
  1156. this.$refs.campForm.resetFields();
  1157. }
  1158. },
  1159. /** 取消训练营表单 */
  1160. cancelCampForm() {
  1161. this.campDialogVisible = false;
  1162. this.resetCampForm();
  1163. },
  1164. /** 提交训练营表单 */
  1165. submitCampForm() {
  1166. this.$refs.campForm.validate(valid => {
  1167. if (valid) {
  1168. // 显示加载中
  1169. this.leftLoading = true;
  1170. // 准备提交的数据
  1171. const submitData = JSON.parse(JSON.stringify(this.campForm));
  1172. // 判断是新增还是修改
  1173. if (submitData.trainingCampId) {
  1174. // 修改训练营
  1175. editCamp(submitData).then(response => {
  1176. if (response.code === 200) {
  1177. this.$message.success('修改训练营成功');
  1178. this.campDialogVisible = false;
  1179. // 更新列表中的数据
  1180. const index = this.campList.findIndex(camp => camp.trainingCampId === submitData.trainingCampId);
  1181. if (index !== -1) {
  1182. this.campList[index] = { ...this.campList[index], ...submitData };
  1183. // 如果修改的是当前选中的训练营,更新右侧列表
  1184. if (this.activeCampIndex === index) {
  1185. this.selectCamp(index);
  1186. }
  1187. }
  1188. // 重新加载训练营列表
  1189. this.getLeftList();
  1190. } else {
  1191. this.$message.error(response.msg || '修改训练营失败');
  1192. this.leftLoading = false;
  1193. }
  1194. }).catch(error => {
  1195. this.$message.error('修改训练营失败: ' + (error.message || '未知错误'));
  1196. this.leftLoading = false;
  1197. });
  1198. } else {
  1199. // 新增训练营
  1200. addCamp(submitData).then(response => {
  1201. if (response.code === 200) {
  1202. this.$message.success('新建训练营成功');
  1203. this.campDialogVisible = false;
  1204. // 重新加载训练营列表
  1205. this.getLeftList();
  1206. } else {
  1207. this.$message.error(response.msg || '新建训练营失败');
  1208. this.leftLoading = false;
  1209. }
  1210. }).catch(error => {
  1211. this.$message.error('新建训练营失败: ' + (error.message || '未知错误'));
  1212. this.leftLoading = false;
  1213. });
  1214. }
  1215. }
  1216. });
  1217. },
  1218. /** 排序方式改变 */
  1219. handleSortChange(value) {
  1220. this.leftQueryParams.scs = value;
  1221. // 重置页码和列表
  1222. this.leftQueryParams.pageNum = 1;
  1223. this.campList = [];
  1224. this.getLeftList();
  1225. },
  1226. /** 选中训练营 */
  1227. selectCamp(index) {
  1228. if(index == null || index == undefined) return;
  1229. this.activeCampIndex = index;
  1230. // 加载对应的训练营营期数据
  1231. const selectedCamp = this.campList[index];
  1232. this.queryParams.trainingCampId = selectedCamp.trainingCampId;
  1233. this.getList();
  1234. },
  1235. /** 处理滚动事件,实现滚动到底部加载更多 */
  1236. handleScroll() {
  1237. // 如果正在节流中或者正在加载中,则不处理
  1238. if (this.scrollThrottle || this.loadingMore) return;
  1239. // 设置节流,200ms内不再处理滚动事件
  1240. this.scrollThrottle = true;
  1241. setTimeout(() => {
  1242. this.scrollThrottle = false;
  1243. }, 200);
  1244. const scrollEl = this.$refs.campList;
  1245. if (!scrollEl) return;
  1246. // 判断是否滚动到底部:滚动高度 + 可视高度 >= 总高度 - 30(添加30px的容差,提前触发加载)
  1247. const isBottom = scrollEl.scrollTop + scrollEl.clientHeight >= scrollEl.scrollHeight - 30;
  1248. // 如果滚动到底部,且有下一页数据,且当前不在加载中,则加载更多
  1249. if (isBottom && this.leftQueryParams.hasNextPage && !this.leftLoading && !this.loadingMore) {
  1250. this.loadMoreCamps();
  1251. }
  1252. },
  1253. /** 加载更多训练营数据 */
  1254. loadMoreCamps() {
  1255. // 已在加载中,防止重复加载
  1256. if (this.leftLoading || this.loadingMore) return;
  1257. // 设置加载状态
  1258. this.loadingMore = true;
  1259. // 页码加1
  1260. this.leftQueryParams.pageNum += 1;
  1261. // 加载下一页数据
  1262. listCamp(this.leftQueryParams).then(response => {
  1263. if (response && response.code === 200) {
  1264. // 将新数据追加到列表中
  1265. const newList = response.data.list || [];
  1266. if (newList.length > 0) {
  1267. this.campList = [...this.campList, ...newList];
  1268. }
  1269. // 更新是否有下一页的标志
  1270. this.leftQueryParams.hasNextPage = response.data.hasNextPage;
  1271. // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
  1272. this.$nextTick(() => {
  1273. const scrollEl = this.$refs.campList;
  1274. if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
  1275. // 延迟一点再加载下一页,避免过快加载
  1276. setTimeout(() => {
  1277. this.loadMoreCamps();
  1278. }, 300);
  1279. }
  1280. });
  1281. } else {
  1282. this.$message.error(response.msg || '加载更多训练营失败');
  1283. }
  1284. this.loadingMore = false;
  1285. }).catch(error => {
  1286. console.error('加载更多训练营失败:', error);
  1287. this.$message.error('加载更多训练营失败');
  1288. this.loadingMore = false;
  1289. });
  1290. },
  1291. timeChange(type) {
  1292. if (type == 1) {
  1293. this.form.periodStartingTime = this.form.dateRange[0];
  1294. this.form.periodEndTime = this.form.dateRange[1];
  1295. if (!Array.isArray(this.form.days)) {
  1296. this.form.days = [];
  1297. }
  1298. this.form.days = [];
  1299. let days = this.getDiff(this.form.periodStartingTime, this.form.periodEndTime);
  1300. for (let i = 0; i < days; i++) {
  1301. this.form.days.push({ lesson: i + 1 });
  1302. }
  1303. }
  1304. if (type == 2) {
  1305. this.form.periodStartingTime = this.form.date;
  1306. this.form.periodEndTime = this.form.date;
  1307. this.form.days = [];
  1308. }
  1309. },
  1310. getDiff(start, end) {
  1311. if(start == null || start == undefined || start == '') return 0;
  1312. if(end == null || end == undefined || end == '') return 0;
  1313. if(start == end) 1;
  1314. const startDate = this.getUTCDate(start);
  1315. const endDate = this.getUTCDate(end);
  1316. const timeDiff = endDate - startDate;
  1317. return (Math.floor(timeDiff / (1000 * 3600 * 24))) + 1; // 直接取整
  1318. },
  1319. getUTCDate(dateStr) {
  1320. const [year, month, day] = dateStr.split('-').map(Number);
  1321. return new Date(Date.UTC(year, month - 1, day)); // 月份从0开始
  1322. },
  1323. // handleCourse(row){
  1324. // this.course = {
  1325. // open: false,
  1326. // row:{},
  1327. // list:[],
  1328. // queryParams: {
  1329. // pageNum: 1,
  1330. // pageSize: 3, // 修改为每页显示3条
  1331. // },
  1332. // loading: true,
  1333. // total: 0,
  1334. // addOpen: false,
  1335. // form: {},
  1336. // };
  1337. // this.course.open = true;
  1338. // this.course.row = row;
  1339. // this.course.queryParams.periodId = row.periodId;
  1340. // this.getCourseList();
  1341. // },
  1342. getCourseList(){
  1343. this.course.loading = true;
  1344. getDays(this.course.queryParams).then(e => {
  1345. this.course.list = e.rows;
  1346. this.course.total = e.total;
  1347. this.course.loading = false;
  1348. });
  1349. },
  1350. handleAddCourse() {
  1351. this.course.addOpen = true;
  1352. this.course.form = {
  1353. periodId: this.course.queryParams.periodId,
  1354. courseId: null,
  1355. timeRange: null,
  1356. joinTime: null,
  1357. videoIds: []
  1358. };
  1359. // 重置表单
  1360. this.$nextTick(() => {
  1361. if (this.$refs.courseAddForm) {
  1362. this.$refs.courseAddForm.resetFields();
  1363. }
  1364. });
  1365. },
  1366. handleUpdateCourse() {
  1367. this.updateCourse.open = true;
  1368. this.updateCourse.form = {
  1369. ids: this.updateCourse.ids,
  1370. timeRange: null,
  1371. joinTime: null
  1372. };
  1373. // 重置表单校验状态(但不清空选中状态)
  1374. this.$nextTick(() => {
  1375. if (this.$refs.courseUpdateForm) {
  1376. this.$refs.courseUpdateForm.resetFields();
  1377. }
  1378. });
  1379. },
  1380. closeAddCourse() {
  1381. this.course.addOpen = false;
  1382. this.course.form = {
  1383. periodId: null,
  1384. courseId: null,
  1385. timeRange: null,
  1386. joinTime: null,
  1387. videoIds: []
  1388. };
  1389. // 重置表单
  1390. if (this.$refs.courseAddForm) {
  1391. this.$refs.courseAddForm.resetFields();
  1392. }
  1393. },
  1394. closeUpdateCourse() {
  1395. this.updateCourse.open = false;
  1396. // 清空选中的课程id,使【修改看课时间】按钮变为禁用状态
  1397. this.updateCourse.ids = [];
  1398. // 清空课程列表的选中状态
  1399. this.$nextTick(() => {
  1400. if (this.$refs.courseTable) {
  1401. this.$refs.courseTable.clearSelection();
  1402. }
  1403. });
  1404. // 重置表单数据
  1405. this.updateCourse.form = {
  1406. ids: [],
  1407. timeRange: null,
  1408. joinTime: null
  1409. };
  1410. // 重置表单校验
  1411. this.$nextTick(() => {
  1412. if (this.$refs.courseUpdateForm) {
  1413. this.$refs.courseUpdateForm.resetFields();
  1414. }
  1415. });
  1416. },
  1417. courseChange(row){
  1418. this.course.form.videoIds = [];
  1419. videoList(row).then(response => {
  1420. this.videoList=response.list
  1421. });
  1422. },
  1423. submitCourseForm(){
  1424. this.$refs.courseAddForm.validate(valid => {
  1425. if (valid) {
  1426. if(this.course.form.timeRange != null && this.course.form.timeRange.length === 2){
  1427. this.course.form.startTime = this.course.form.timeRange[0];
  1428. this.course.form.endTime1 = this.course.form.timeRange[1];
  1429. }
  1430. // 提交数据
  1431. addCourse(this.course.form).then(response => {
  1432. this.$message.success('添加成功');
  1433. this.course.addOpen = false;
  1434. // 重新加载训练营列表
  1435. this.getCourseList();
  1436. });
  1437. }
  1438. });
  1439. },
  1440. submitUpdateCourseForm(){
  1441. this.$refs.courseUpdateForm.validate(valid => {
  1442. if (valid) {
  1443. // 检查时间范围是否正确
  1444. if (this.updateCourse.form.timeRange &&
  1445. Array.isArray(this.updateCourse.form.timeRange) &&
  1446. this.updateCourse.form.timeRange.length === 2) {
  1447. this.updateCourse.form.startTime = this.updateCourse.form.timeRange[0];
  1448. this.updateCourse.form.endTime1 = this.updateCourse.form.timeRange[1];
  1449. } else {
  1450. this.$message.error('请先选择正确的看课时间范围');
  1451. return;
  1452. }
  1453. // 检查领取红包时间是否正确
  1454. if (!this.updateCourse.form.joinTime) {
  1455. this.$message.error('请选择领取红包时间');
  1456. return;
  1457. }
  1458. // 提交数据
  1459. updateCourseTime(this.updateCourse.form).then(response => {
  1460. this.$message.success('修改成功');
  1461. this.updateCourse.open = false;
  1462. // 清空选中的课程ID,使【修改看课时间】按钮变为禁用状态
  1463. this.updateCourse.ids = [];
  1464. // 清空课程列表的选中状态
  1465. this.$nextTick(() => {
  1466. if (this.$refs.courseTable) {
  1467. this.$refs.courseTable.clearSelection();
  1468. }
  1469. });
  1470. // 重新加载训练营列表
  1471. this.getCourseList();
  1472. }).catch(error => {
  1473. this.$message.error('修改失败:' + (error.message || '未知错误'));
  1474. });
  1475. }
  1476. });
  1477. },
  1478. updatePeriodDateSubmit(){
  1479. updateCourseDate(this.updatePeriodDate.form).then(response => {
  1480. this.$message.success('修改成功');
  1481. this.updatePeriodDate.open = false;
  1482. // 重新加载课程列表
  1483. this.getCourseList();
  1484. });
  1485. },
  1486. // saveCourseData(){
  1487. // updateListCourseData(this.course.list).then(response => {
  1488. // this.$message.success('保存成功');
  1489. // this.getCourseList();
  1490. // });
  1491. // },
  1492. // setRedPacket(row) {
  1493. // this.currentRedPacketData = {
  1494. // periodId: row.periodId
  1495. // // videoId: row.videoId
  1496. // };
  1497. // this.redPacketVisible = true;
  1498. // },
  1499. handleRedPacketSuccess() {
  1500. this.getCourseList();
  1501. },
  1502. handlePeriodSettings(row) {
  1503. this.periodSettingsData = row;
  1504. this.periodSettingsVisible = true;
  1505. // 初始化课程列表
  1506. this.course.queryParams.periodId = row.periodId;
  1507. // 根据当前激活的tab加载对应数据
  1508. this.handleTabClick({ name: this.activeTab });
  1509. },
  1510. // 结束营期
  1511. handleClosePeriod(row) {
  1512. const msg = `注: 1.确认结束营期,该营期的开营结束时间改为当天24点。2.当天正在播放中的课程不变。3.第二天如有未开始的课程,统一改为已结束。是否确认结束 ${row.periodName} 营期吗?`
  1513. this.$confirm(msg, "警告", {
  1514. confirmButtonText: "确定",
  1515. cancelButtonText: "取消",
  1516. type: "warning"
  1517. }).then(() => {
  1518. closePeriod({id: row.periodId}).then(response => {
  1519. if (response.code === 200) {
  1520. this.getList()
  1521. } else {
  1522. this.$message.error(response.msg)
  1523. }
  1524. })
  1525. }).catch(() => {})
  1526. },
  1527. handleBatchRedPacketSuccess() {
  1528. this.batchRedPacketVisible = false;
  1529. this.getCourseList();
  1530. },
  1531. /** 处理tab切换 */
  1532. handleTabClick(tab) {
  1533. if (tab.name === 'course') {
  1534. this.getCourseList();
  1535. } else if (tab.name === 'company') {
  1536. this.redPacketVisible = true;
  1537. }
  1538. },
  1539. /** 上移课程 */
  1540. handleTop(row) {
  1541. const currentIndex = this.course.list.findIndex(item => item.id === row.id);
  1542. if (currentIndex <= 0) {
  1543. this.$message.warning('已经是第一条数据');
  1544. return;
  1545. }
  1546. // 获取上一条数据
  1547. const prevRow = this.course.list[currentIndex - 1];
  1548. console.log({
  1549. id: row.id,
  1550. targetId: prevRow.id,
  1551. type: 1 //上移
  1552. })
  1553. periodCourseMove({
  1554. id: row.id,
  1555. targetId: prevRow.id,
  1556. type: 1 //上移
  1557. }).then(response => {
  1558. if (response.code === 200) {
  1559. this.$message.success('上移成功');
  1560. this.getCourseList();
  1561. } else {
  1562. this.$message.error(response.msg || '上移失败');
  1563. }
  1564. }).catch(() => {
  1565. this.$message.error('上移失败');
  1566. });
  1567. },
  1568. /** 下移课程 */
  1569. handleBottom(row) {
  1570. const currentIndex = this.course.list.findIndex(item => item.id === row.id);
  1571. if (currentIndex === -1 || currentIndex >= this.course.list.length - 1) {
  1572. this.$message.warning('已经是最后一条数据');
  1573. return;
  1574. }
  1575. // 获取下一条数据
  1576. const nextRow = this.course.list[currentIndex + 1];
  1577. periodCourseMove({
  1578. id: row.id,
  1579. targetId: nextRow.id,
  1580. type: 2 //下移
  1581. }).then(response => {
  1582. if (response.code === 200) {
  1583. this.$message.success('下移成功');
  1584. this.getCourseList(); // 重新加载列表
  1585. } else {
  1586. this.$message.error(response.msg || '下移失败');
  1587. }
  1588. }).catch(() => {
  1589. this.$message.error('下移失败');
  1590. });
  1591. },
  1592. /** 营期状态格式化 */
  1593. periodStatusFormatter(row) {
  1594. const statusMap = {
  1595. 1: '未开始',
  1596. 2: '进行中',
  1597. 3: '已结束'
  1598. };
  1599. return statusMap[row.periodStatus] || '未知状态';
  1600. },
  1601. /** 开课状态格式化 */
  1602. courseStatusFormatter(row) {
  1603. const statusMap = {
  1604. 0: '未开始',
  1605. 1: '进行中',
  1606. 2: '已结束'
  1607. };
  1608. return statusMap[row.status] || '未知状态';
  1609. },
  1610. /** 营期状态格式化 */
  1611. handleUpdateDate(row) {
  1612. this.updatePeriodDate.form = {id: row.id, dayDate: row.dayDate};
  1613. this.updatePeriodDate.open = true;
  1614. },
  1615. disabledDate(time) {
  1616. return time.getTime() < new Date(new Date().setHours(0,0,0,0));
  1617. },
  1618. getPickerOptions() {
  1619. // 如果已选择看课时间范围,则领取红包时间应在看课时间范围内
  1620. if (this.updateCourse.form.timeRange &&
  1621. Array.isArray(this.updateCourse.form.timeRange) &&
  1622. this.updateCourse.form.timeRange.length === 2) {
  1623. return {
  1624. selectableRange: `${this.updateCourse.form.timeRange[0]} - ${this.updateCourse.form.timeRange[1]}`
  1625. };
  1626. }
  1627. // 默认全天可选
  1628. return {
  1629. selectableRange: '00:00:00 - 23:59:59'
  1630. };
  1631. },
  1632. onTimeRangeChange() {
  1633. // 当看课时间范围改变时,清空领取红包时间
  1634. this.updateCourse.form.joinTime = null;
  1635. // 强制更新组件以刷新领取红包时间的可选范围
  1636. this.$forceUpdate();
  1637. },
  1638. },
  1639. };
  1640. </script>
  1641. <style scoped>
  1642. .left-aside {
  1643. background-color: #fff;
  1644. border-right: 1px solid #EBEEF5;
  1645. padding: 0;
  1646. display: flex;
  1647. flex-direction: column;
  1648. height: 800px;
  1649. }
  1650. .left-header {
  1651. padding: 10px;
  1652. border-bottom: 1px solid #EBEEF5;
  1653. }
  1654. .left-header-top {
  1655. display: flex;
  1656. justify-content: space-between;
  1657. align-items: center;
  1658. margin-bottom: 10px;
  1659. }
  1660. .search-btn {
  1661. width: 50%;
  1662. height: 36px;
  1663. background-color: #409EFF;
  1664. color: white;
  1665. border: none;
  1666. }
  1667. .search-input-wrapper {
  1668. margin-bottom: 10px;
  1669. }
  1670. .sort-wrapper {
  1671. display: flex;
  1672. align-items: center;
  1673. margin-bottom: 10px;
  1674. }
  1675. .sort-label {
  1676. width: 70px;
  1677. font-size: 14px;
  1678. font-weight: 600;
  1679. color: #909399;
  1680. }
  1681. .sort-select {
  1682. margin-left: 10px;
  1683. width: 280px;
  1684. }
  1685. .color-wrapper {
  1686. display: flex;
  1687. align-items: center;
  1688. margin-bottom: 10px;
  1689. }
  1690. .color-label {
  1691. width: 70px;
  1692. color: #606266;
  1693. }
  1694. .color-hint {
  1695. margin-left: 10px;
  1696. color: #606266;
  1697. font-size: 12px;
  1698. }
  1699. .color-help {
  1700. margin-left: 5px;
  1701. color: #909399;
  1702. cursor: pointer;
  1703. }
  1704. .hint-text {
  1705. color: #606266;
  1706. font-size: 12px;
  1707. margin-top: 5px;
  1708. }
  1709. .camp-list {
  1710. flex: 1;
  1711. overflow-y: auto;
  1712. padding: 3px;
  1713. }
  1714. .camp-item {
  1715. margin-bottom: 5px;
  1716. padding: 15px;
  1717. background-color: #ffffff;
  1718. position: relative;
  1719. cursor: pointer;
  1720. display: flex;
  1721. justify-content: space-between;
  1722. border: 1px solid #eaedf2;
  1723. }
  1724. .camp-item:last-child {
  1725. margin-bottom: 0;
  1726. }
  1727. .camp-item:hover {
  1728. background-color: #f5f9ff;
  1729. }
  1730. .camp-item.active {
  1731. background-color: #eaf4ff;
  1732. border-left: 1px solid #75b8fc;
  1733. }
  1734. .camp-content {
  1735. flex: 1;
  1736. padding-right: 10px;
  1737. }
  1738. .camp-title {
  1739. font-weight: bold;
  1740. font-size: 16px;
  1741. margin-bottom: 8px;
  1742. color: #333;
  1743. display: flex;
  1744. align-items: center;
  1745. }
  1746. .camp-icon {
  1747. font-size: 16px;
  1748. margin-right: 6px;
  1749. color: #409EFF;
  1750. }
  1751. .camp-info {
  1752. display: flex;
  1753. justify-content: space-between;
  1754. margin-bottom: 8px;
  1755. font-size: 12px;
  1756. color: #c4c1c1;
  1757. line-height: 1.5;
  1758. }
  1759. .camp-stats {
  1760. display: flex;
  1761. justify-content: space-between;
  1762. font-size: 12px;
  1763. color: #666;
  1764. background-color: #f5f9ff;
  1765. padding: 6px 10px;
  1766. border-radius: 4px;
  1767. line-height: 1.5;
  1768. }
  1769. .stat-item {
  1770. display: flex;
  1771. align-items: center;
  1772. }
  1773. .stat-item i {
  1774. margin-right: 4px;
  1775. font-size: 14px;
  1776. color: #409EFF;
  1777. }
  1778. .camp-actions {
  1779. display: flex;
  1780. flex-direction: column;
  1781. justify-content: center;
  1782. align-items: flex-end;
  1783. gap: 8px;
  1784. border-left: 1px dashed #eaedf2;
  1785. padding-left: 12px;
  1786. min-width: 50px;
  1787. }
  1788. .action-btn {
  1789. padding: 2px 5px;
  1790. font-size: 12px;
  1791. border-radius: 4px;
  1792. transition: all 0.2s;
  1793. }
  1794. .action-btn:hover {
  1795. background-color: rgba(255, 255, 255, 0.8);
  1796. }
  1797. .delete-btn {
  1798. color: #f56c6c;
  1799. }
  1800. .delete-btn:hover {
  1801. background-color: rgba(245, 108, 108, 0.1);
  1802. }
  1803. .copy-btn {
  1804. color: #409EFF;
  1805. }
  1806. .copy-btn:hover {
  1807. background-color: rgba(64, 158, 255, 0.1);
  1808. }
  1809. .warning-icon {
  1810. color: #E6A23C;
  1811. font-size: 16px;
  1812. margin-left: 5px;
  1813. }
  1814. .el-main {
  1815. padding: 10px;
  1816. }
  1817. /* 添加训练营表单样式 */
  1818. .drawer-footer {
  1819. /* position: absolute; */
  1820. bottom: 0;
  1821. left: 0;
  1822. right: 0;
  1823. padding: 20px;
  1824. background: #fff;
  1825. text-align: right;
  1826. border-top: 1px solid #e8e8e8;
  1827. }
  1828. .el-input-number {
  1829. width: 100%;
  1830. }
  1831. /* 加载更多样式 */
  1832. .loading-more {
  1833. display: flex;
  1834. align-items: center;
  1835. justify-content: center;
  1836. padding: 12px 0;
  1837. color: #909399;
  1838. font-size: 14px;
  1839. }
  1840. .loading-more i {
  1841. margin-right: 5px;
  1842. font-size: 16px;
  1843. }
  1844. /* 无更多数据提示 */
  1845. .no-more-data {
  1846. display: flex;
  1847. align-items: center;
  1848. justify-content: center;
  1849. padding: 12px 0;
  1850. color: #c0c4cc;
  1851. font-size: 13px;
  1852. }
  1853. .no-more-data span {
  1854. position: relative;
  1855. display: flex;
  1856. align-items: center;
  1857. }
  1858. </style>