index.vue 24 KB

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