index.vue 24 KB

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