index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="时间" prop="studyTime">
  5. <el-date-picker clearable
  6. v-model="queryParams.studyTime"
  7. type="date"
  8. value-format="yyyy-MM-dd"
  9. placeholder="请选择时间">
  10. </el-date-picker>
  11. </el-form-item>
  12. <el-form-item label="地点" prop="studyVenue">
  13. <el-input v-model="queryParams.studyVenue" placeholder="请输入地点"/>
  14. </el-form-item>
  15. <el-form-item label="内容" prop="contents">
  16. <el-input v-model="queryParams.contents" placeholder="请输入内容"/>
  17. </el-form-item>
  18. <el-form-item label="备注" prop="remarks">
  19. <el-input v-model="queryParams.remarks" placeholder="请输入备注"/>
  20. </el-form-item>
  21. <el-form-item label="归属部门" prop="deptId" style="width: 268px;">
  22. <treeselect style="width: 200px;" v-model="queryParams.deptId" :options="deptOptions" :show-count="true"
  23. placeholder="请选择归属部门"/>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  27. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  28. </el-form-item>
  29. </el-form>
  30. <el-row :gutter="10" class="mb8">
  31. <el-col :span="1.5">
  32. <el-button
  33. type="primary"
  34. plain
  35. icon="el-icon-plus"
  36. size="mini"
  37. @click="handleAdd"
  38. v-hasPermi="['branch:study:add']"
  39. >新增
  40. </el-button>
  41. </el-col>
  42. <el-col :span="1.5">
  43. <el-button
  44. type="success"
  45. plain
  46. icon="el-icon-edit"
  47. size="mini"
  48. :disabled="single"
  49. @click="handleUpdate"
  50. v-hasPermi="['branch:study:edit']"
  51. >修改
  52. </el-button>
  53. </el-col>
  54. <el-col :span="1.5">
  55. <el-button
  56. type="danger"
  57. plain
  58. icon="el-icon-delete"
  59. size="mini"
  60. :disabled="multiple"
  61. @click="handleDelete"
  62. v-hasPermi="['branch:study:remove']"
  63. >删除
  64. </el-button>
  65. </el-col>
  66. <!--<el-col :span="1.5">-->
  67. <!--<el-button-->
  68. <!--type="info"-->
  69. <!--plain-->
  70. <!--icon="el-icon-upload2"-->
  71. <!--size="mini"-->
  72. <!--@click="handleImport"-->
  73. <!--v-hasPermi="['branch:study:edit']"-->
  74. <!--&gt;导入-->
  75. <!--</el-button>-->
  76. <!--</el-col>-->
  77. <!--<el-col :span="1.5">-->
  78. <!--<el-button-->
  79. <!--type="warning"-->
  80. <!--plain-->
  81. <!--icon="el-icon-download"-->
  82. <!--size="mini"-->
  83. <!--@click="handleExport"-->
  84. <!--v-hasPermi="['branch:study:export']"-->
  85. <!--&gt;导出-->
  86. <!--</el-button>-->
  87. <!--</el-col>-->
  88. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  89. </el-row>
  90. <el-table v-loading="loading" :data="studyList" @selection-change="handleSelectionChange" :height="clientHeight"
  91. border>
  92. <el-table-column type="selection" width="55" align="center"/>
  93. <el-table-column label="时间" align="center" prop="studyTime" width="100">
  94. <template slot-scope="scope">
  95. <span>{{ parseTime(scope.row.studyTime, '{y}-{m}-{d}') }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="地点" align="center" prop="studyVenue"/>
  99. <el-table-column label="授课人" align="center" prop="lecturerString" width="120"/>
  100. <el-table-column label="记录人" align="center" prop="recorderString" width="120"/>
  101. <el-table-column label="参加人员" align="center" prop="participantsString" width="120"/>
  102. <el-table-column label="缺席人员" align="center" prop="absenteesString" width="120"/>
  103. <el-table-column label="内容" align="left" prop="contents" width="350"/>
  104. <el-table-column label="附件" align="center" prop="filesId" width="100">
  105. <template slot-scope="scope">
  106. <el-button
  107. size="mini"
  108. type="text"
  109. icon="el-icon-folder"
  110. @click="openFileDialog(scope.row)"
  111. >查看附件
  112. </el-button>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="备注" align="center" prop="remarks"/>
  116. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  117. <template slot-scope="scope">
  118. <el-button
  119. size="mini"
  120. type="text"
  121. icon="el-icon-edit"
  122. @click="handleUpdate(scope.row)"
  123. v-hasPermi="['branch:study:edit']"
  124. >修改
  125. </el-button>
  126. <el-button
  127. size="mini"
  128. type="text"
  129. icon="el-icon-delete"
  130. @click="handleDelete(scope.row)"
  131. v-hasPermi="['branch:study:remove']"
  132. >删除
  133. </el-button>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. <pagination
  138. v-show="total>0"
  139. :total="total"
  140. :page.sync="queryParams.pageNum"
  141. :limit.sync="queryParams.pageSize"
  142. @pagination="getList"
  143. />
  144. <!-- 添加或修改支部党课学习对话框 -->
  145. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  146. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  147. <el-form-item label="时间" prop="studyTime">
  148. <el-date-picker clearable size="small" style="width: 200px"
  149. v-model="form.studyTime"
  150. type="date"
  151. value-format="yyyy-MM-dd"
  152. placeholder="选择时间">
  153. </el-date-picker>
  154. </el-form-item>
  155. <el-form-item label="地点" prop="studyVenue">
  156. <el-input v-model="form.studyVenue" placeholder="请输入地点"/>
  157. </el-form-item>
  158. <el-form-item label="授课人" prop="lecturer">
  159. <el-select v-model="form.lecturer" multiple placeholder="请选择授课人">
  160. <el-option
  161. v-for="dict in userList"
  162. :key="dict.dictValue"
  163. :label="dict.dictLabel"
  164. :value="dict.dictValue"
  165. ></el-option>
  166. </el-select>
  167. </el-form-item>
  168. <el-form-item label="记录人" prop="recorder">
  169. <el-select v-model="form.recorder" multiple placeholder="请选择记录人">
  170. <el-option
  171. v-for="dict in userList"
  172. :key="dict.dictValue"
  173. :label="dict.dictLabel"
  174. :value="dict.dictValue"
  175. ></el-option>
  176. </el-select>
  177. </el-form-item>
  178. <el-form-item label="参加人员" prop="participants">
  179. <el-select v-model="form.participants" multiple placeholder="请选择参加人员">
  180. <el-option
  181. v-for="dict in userList"
  182. :key="dict.dictValue"
  183. :label="dict.dictLabel"
  184. :value="dict.dictValue"
  185. ></el-option>
  186. </el-select>
  187. </el-form-item>
  188. <el-form-item label="缺席人员" prop="absentees">
  189. <el-select v-model="form.absentees" multiple placeholder="请选择缺席人员">
  190. <el-option
  191. v-for="dict in userList"
  192. :key="dict.dictValue"
  193. :label="dict.dictLabel"
  194. :value="dict.dictValue"
  195. ></el-option>
  196. </el-select>
  197. </el-form-item>
  198. <el-form-item label="内容" prop="contents">
  199. <el-input v-model="form.contents" placeholder="请输入内容" type="textarea" rows="4"/>
  200. </el-form-item>
  201. <el-form-item label="备注" prop="remarks">
  202. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  203. </el-form-item>
  204. <el-form-item label="归属部门" prop="deptId">
  205. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
  206. </el-form-item>
  207. </el-form>
  208. <div slot="footer" class="dialog-footer">
  209. <el-button type="primary" @click="submitForm">确 定</el-button>
  210. <el-button @click="cancel">取 消</el-button>
  211. </div>
  212. </el-dialog>
  213. <!-- 用户导入对话框 -->
  214. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  215. <el-upload
  216. ref="upload"
  217. :limit="1"
  218. accept=".xlsx, .xls"
  219. :headers="upload.headers"
  220. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  221. :disabled="upload.isUploading"
  222. :on-progress="handleFileUploadProgress"
  223. :on-success="handleFileSuccess"
  224. :auto-upload="false"
  225. drag
  226. >
  227. <i class="el-icon-upload"></i>
  228. <div class="el-upload__text">
  229. 将文件拖到此处,或
  230. <em>点击上传</em>
  231. </div>
  232. <div class="el-upload__tip" slot="tip">
  233. <el-checkbox v-model="upload.updateSupport"/>
  234. 是否更新已经存在的用户数据
  235. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  236. </div>
  237. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  238. </el-upload>
  239. <div slot="footer" class="dialog-footer">
  240. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  241. <el-button @click="upload.open = false">取 消</el-button>
  242. </div>
  243. </el-dialog>
  244. <el-dialog title="附件详情" :visible.sync="file.open" width="60%" append-to-body>
  245. <el-row :gutter="10" class="mb8">
  246. <el-col :span="1.5">
  247. <el-upload
  248. ref="doc"
  249. :headers="doc.headers"
  250. :action="doc.url+'?tableName=branchStudy&tableId=' + doc.tableId"
  251. :disabled="doc.isUploading"
  252. :on-progress="handleFileDocProgress"
  253. :on-success="handleFileDocSuccess"
  254. :auto-upload="true"
  255. :file-list="file.fileList"
  256. >
  257. <el-button type="primary"><i class="el-icon-upload"></i> 点击上传</el-button>
  258. </el-upload>
  259. </el-col>
  260. </el-row>
  261. <el-table :data="file.dataList">
  262. <el-table-column label="附件名称" align="center">
  263. <template slot-scope="scope">
  264. <el-button
  265. size="mini"
  266. type="text"
  267. icon="el-icon-document"
  268. @click="handleSee(scope.row.url)">
  269. {{ scope.row.name }}
  270. </el-button>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="上传人" align="center" prop="creater"/>
  274. <el-table-column label="上传时间" align="center" prop="createdate">
  275. <template slot-scope="scope">
  276. <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="操作" align="center">
  280. <template slot-scope="scope">
  281. <el-button
  282. size="mini"
  283. type="text"
  284. icon="el-icon-delete"
  285. @click="handleDeleteFile(scope.row.id)"
  286. >删除
  287. </el-button>
  288. </template>
  289. </el-table-column>
  290. </el-table>
  291. </el-dialog>
  292. </div>
  293. </template>
  294. <script>
  295. import {listStudy, getStudy, delStudy, addStudy, updateStudy, exportStudy, importTemplate} from "@/api/branch/study";
  296. import {treeselect} from "@/api/system/dept";
  297. import {getToken} from "@/utils/auth";
  298. import Treeselect from "@riophae/vue-treeselect";
  299. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  300. import {listUserNoPage} from "@/api/system/user";
  301. import {delFile, listFile} from "../../../../api/branch/file";
  302. export default {
  303. name: "Study",
  304. components: {Treeselect},
  305. data() {
  306. return {
  307. file: {
  308. id: null,
  309. open: false,
  310. fileList: [],
  311. dataList: [],
  312. },
  313. doc: {
  314. file: "",
  315. // 是否显示弹出层(报告附件)
  316. open: false,
  317. // 弹出层标题(报告附件)
  318. title: "",
  319. // 是否禁用上传
  320. isUploading: false,
  321. // 设置上传的请求头部
  322. headers: {Authorization: "Bearer " + getToken()},
  323. tableId: 0,
  324. // 上传的地址
  325. url: process.env.VUE_APP_BASE_API + "/branch/file/uploadFile",
  326. },
  327. // 遮罩层
  328. loading: true,
  329. // 选中数组
  330. ids: [],
  331. // 非单个禁用
  332. single: true,
  333. // 非多个禁用
  334. multiple: true,
  335. // 显示搜索条件
  336. showSearch: false,
  337. // 总条数
  338. total: 0,
  339. // 支部党课学习表格数据
  340. studyList: [],
  341. // 弹出层标题
  342. title: "",
  343. // 部门树选项
  344. deptOptions: [],
  345. clientHeight: 300,
  346. // 是否显示弹出层
  347. open: false,
  348. // 用户导入参数
  349. upload: {
  350. // 是否显示弹出层(用户导入)
  351. open: false,
  352. // 弹出层标题(用户导入)
  353. title: "",
  354. // 是否禁用上传
  355. isUploading: false,
  356. // 是否更新已经存在的用户数据
  357. updateSupport: 0,
  358. // 设置上传的请求头部
  359. headers: {Authorization: "Bearer " + getToken()},
  360. // 上传的地址
  361. url: process.env.VUE_APP_BASE_API + "/branch/study/importData"
  362. },
  363. // 查询参数
  364. queryParams: {
  365. pageNum: 1,
  366. pageSize: 20,
  367. studyId: null,
  368. studyTime: null,
  369. studyVenue: null,
  370. lecturer: null,
  371. recorder: null,
  372. participants: null,
  373. absentees: null,
  374. contents: null,
  375. remarks: null,
  376. },
  377. // 表单参数
  378. form: {},
  379. // 表单校验
  380. rules: {
  381. studyTime: [
  382. {required: true, message: "时间不能为空", trigger: "blur"}
  383. ],
  384. studyVenue: [
  385. {required: true, message: "地点不能为空", trigger: "blur"}
  386. ],
  387. deptId: [
  388. {required: true, message: "归属部门不能为空", trigger: "blur"}
  389. ],
  390. },
  391. // 用户列表
  392. userList: [],
  393. };
  394. },
  395. watch: {
  396. // 根据名称筛选部门树
  397. deptName(val) {
  398. this.$refs.tree.filter(val);
  399. }
  400. },
  401. created() {
  402. //设置表格高度对应屏幕高度
  403. this.$nextTick(() => {
  404. this.clientHeight = document.body.clientHeight - 250
  405. })
  406. this.getList();
  407. this.getTreeselect();
  408. },
  409. methods: {
  410. //附件上传中处理
  411. handleFileDocProgress(event, file, fileList) {
  412. this.doc.file = file;
  413. },
  414. //附件上传成功处理
  415. handleFileDocSuccess(response, file, fileList) {
  416. console.log(response.data, '-----', this.file.id);
  417. this.$modal.msgSuccess("上传成功");
  418. this.getFileList();
  419. },
  420. /** 查询用户列表 */
  421. getUserList() {
  422. listUserNoPage().then(response => {
  423. let rows = response.data;
  424. let userList = [];
  425. for (let i = 0; i < rows.length; i++) {
  426. if (rows[i].userName != "admin") {
  427. let user = {"dictValue": rows[i].userId, "dictLabel": rows[i].nickName};
  428. userList.push(user);
  429. }
  430. }
  431. this.userList = userList;
  432. });
  433. },
  434. handleSee(url) {
  435. window.open(process.env.VUE_APP_BASE_API + url);
  436. },
  437. openFileDialog(row) {
  438. console.log(row)
  439. this.file.open = true;
  440. this.doc.tableId = row.studyId;
  441. this.getFileList();
  442. },
  443. getFileList() {
  444. listFile({tableId: this.doc.tableId, tableName: 'branchStudy'}).then(res => {
  445. this.file.dataList = res.data
  446. })
  447. },
  448. handleDeleteFile(id) {
  449. this.$confirm('是否确认删除?', "警告", {
  450. confirmButtonText: "确定",
  451. cancelButtonText: "取消",
  452. type: "warning"
  453. }).then(function () {
  454. return delFile(id);
  455. }).then(() => {
  456. this.getFileList();
  457. this.msgSuccess("删除成功");
  458. })
  459. },
  460. /** 查询支部党课学习列表 */
  461. getList() {
  462. this.loading = true;
  463. listUserNoPage().then(response => {
  464. let rows = response.data;
  465. let userList = [];
  466. for (let i = 0; i < rows.length; i++) {
  467. if (rows[i].userName != "admin") {
  468. let user = {"dictValue": rows[i].userId, "dictLabel": rows[i].nickName};
  469. userList.push(user);
  470. }
  471. }
  472. this.userList = userList;
  473. listStudy(this.queryParams).then(response => {
  474. this.studyList = response.rows;
  475. for (let i = 0; i < this.studyList.length; i++) {
  476. if (this.studyList[i].lecturer != null) {
  477. let lecturer = this.studyList[i].lecturer.split(",");
  478. let lecturerString = "";
  479. for (let j = 0; j < lecturer.length; j++) {
  480. if (j > 0) {
  481. lecturerString += "、" + this.selectDictLabel(this.userList, lecturer[j]);
  482. } else {
  483. lecturerString += this.selectDictLabel(this.userList, lecturer[j]);
  484. }
  485. }
  486. this.studyList[i].lecturerString = lecturerString;
  487. }
  488. if (this.studyList[i].recorder != null) {
  489. let recorder = this.studyList[i].recorder.split(",");
  490. let recorderString = "";
  491. for (let j = 0; j < recorder.length; j++) {
  492. if (j > 0) {
  493. recorderString += "、" + this.selectDictLabel(this.userList, recorder[j]);
  494. } else {
  495. recorderString += this.selectDictLabel(this.userList, recorder[i]);
  496. }
  497. }
  498. this.studyList[i].recorderString = recorderString;
  499. }
  500. if (this.studyList[i].participants != null) {
  501. let participants = this.studyList[i].participants.split(",");
  502. let participantsString = "";
  503. for (let j = 0; j < participants.length; j++) {
  504. if (j > 0) {
  505. participantsString += "、" + this.selectDictLabel(this.userList, participants[j]);
  506. } else {
  507. participantsString += this.selectDictLabel(this.userList, participants[j]);
  508. }
  509. }
  510. this.studyList[i].participantsString = participantsString;
  511. }
  512. if (this.studyList[i].absentees != null) {
  513. let absentees = this.studyList[i].absentees.split(",");
  514. let absenteesString = "";
  515. for (let j = 0; j < absentees.length; j++) {
  516. if (j > 0) {
  517. absenteesString += "、" + this.selectDictLabel(this.userList, absentees[j]);
  518. } else {
  519. absenteesString += this.selectDictLabel(this.userList, absentees[j]);
  520. }
  521. }
  522. this.studyList[i].absenteesString = absenteesString;
  523. }
  524. }
  525. this.total = response.total;
  526. this.loading = false;
  527. });
  528. });
  529. },
  530. /** 查询部门下拉树结构 */
  531. getTreeselect() {
  532. treeselect().then(response => {
  533. this.deptOptions = response.data;
  534. });
  535. },
  536. // 取消按钮
  537. cancel() {
  538. this.open = false;
  539. this.reset();
  540. },
  541. // 表单重置
  542. reset() {
  543. this.form = {
  544. studyId: null,
  545. studyTime: null,
  546. studyVenue: null,
  547. lecturer: null,
  548. recorder: null,
  549. participants: null,
  550. absentees: null,
  551. contents: null,
  552. remarks: null,
  553. delFlag: null,
  554. createBy: null,
  555. createTime: null,
  556. updateBy: null,
  557. updateTime: null,
  558. };
  559. this.resetForm("form");
  560. },
  561. /** 搜索按钮操作 */
  562. handleQuery() {
  563. this.queryParams.pageNum = 1;
  564. this.getList();
  565. },
  566. /** 重置按钮操作 */
  567. resetQuery() {
  568. this.resetForm("queryForm");
  569. this.handleQuery();
  570. },
  571. // 多选框选中数据
  572. handleSelectionChange(selection) {
  573. this.ids = selection.map(item => item.studyId)
  574. this.single = selection.length !== 1
  575. this.multiple = !selection.length
  576. },
  577. /** 新增按钮操作 */
  578. handleAdd() {
  579. this.reset();
  580. this.open = true;
  581. this.title = "添加支部党课学习";
  582. },
  583. /** 修改按钮操作 */
  584. handleUpdate(row) {
  585. this.reset();
  586. const studyId = row.studyId || this.ids
  587. getStudy(studyId).then(response => {
  588. this.form = response.data;
  589. if (this.form.lecturer != null) {
  590. this.form.lecturer = this.form.lecturer.split(",").map(Number);
  591. }
  592. if (this.form.recorder != null) {
  593. this.form.recorder = this.form.recorder.split(",").map(Number);
  594. }
  595. if (this.form.participants != null) {
  596. this.form.participants = this.form.participants.split(",").map(Number);
  597. }
  598. if (this.form.absentees != null) {
  599. this.form.absentees = this.form.absentees.split(",").map(Number);
  600. }
  601. this.open = true;
  602. this.title = "修改支部党课学习";
  603. });
  604. },
  605. /** 提交按钮 */
  606. submitForm() {
  607. if (this.form.lecturer != null) {
  608. this.form.lecturer = this.form.lecturer.join();
  609. }
  610. if (this.form.recorder != null) {
  611. this.form.recorder = this.form.recorder.join();
  612. }
  613. if (this.form.participants != null) {
  614. this.form.participants = this.form.participants.join();
  615. }
  616. if (this.form.absentees != null) {
  617. this.form.absentees = this.form.absentees.join();
  618. }
  619. this.$refs["form"].validate(valid => {
  620. if (valid) {
  621. if (this.form.studyId != null) {
  622. updateStudy(this.form).then(response => {
  623. this.$modal.msgSuccess("修改成功");
  624. this.open = false;
  625. this.getList();
  626. });
  627. } else {
  628. addStudy(this.form).then(response => {
  629. this.$modal.msgSuccess("新增成功");
  630. this.open = false;
  631. this.getList();
  632. });
  633. }
  634. }
  635. });
  636. },
  637. /** 删除按钮操作 */
  638. handleDelete(row) {
  639. const studyIds = row.studyId || this.ids;
  640. this.$confirm('是否确认删除?', "警告", {
  641. confirmButtonText: "确定",
  642. cancelButtonText: "取消",
  643. type: "warning"
  644. }).then(function () {
  645. return delStudy(studyIds);
  646. }).then(() => {
  647. this.getList();
  648. this.msgSuccess("删除成功");
  649. })
  650. },
  651. /** 导出按钮操作 */
  652. handleExport() {
  653. const queryParams = this.queryParams;
  654. this.$confirm('是否确认导出所有支部党课学习数据项?', "警告", {
  655. confirmButtonText: "确定",
  656. cancelButtonText: "取消",
  657. type: "warning"
  658. }).then(function () {
  659. return exportStudy(queryParams);
  660. }).then(response => {
  661. this.download(response.msg);
  662. })
  663. },
  664. /** 导入按钮操作 */
  665. handleImport() {
  666. this.upload.title = "用户导入";
  667. this.upload.open = true;
  668. },
  669. /** 下载模板操作 */
  670. importTemplate() {
  671. importTemplate().then(response => {
  672. this.download(response.msg);
  673. });
  674. },
  675. // 文件上传中处理
  676. handleFileUploadProgress(event, file, fileList) {
  677. this.upload.isUploading = true;
  678. },
  679. // 文件上传成功处理
  680. handleFileSuccess(response, file, fileList) {
  681. this.upload.open = false;
  682. this.upload.isUploading = false;
  683. this.$refs.upload.clearFiles();
  684. this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  685. this.getList();
  686. },
  687. // 提交上传文件
  688. submitFileForm() {
  689. this.$refs.upload.submit();
  690. }
  691. }
  692. };
  693. </script>
  694. <style>
  695. /** 文本换行符处理 */
  696. .el-table .cell {
  697. white-space: pre-wrap;
  698. }
  699. /** textarea字体 */
  700. textarea {
  701. font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  702. }
  703. </style>