index.vue.vm 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. #foreach($column in $columns)
  5. #if($column.query)
  6. #set($dictType=$column.dictType)
  7. #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  8. #set($parentheseIndex=$column.columnComment.indexOf("("))
  9. #if($parentheseIndex != -1)
  10. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  11. #else
  12. #set($comment=$column.columnComment)
  13. #end
  14. #if($column.htmlType == "input")
  15. <el-form-item label="${comment}" prop="${column.javaField}">
  16. <el-input
  17. v-model="queryParams.${column.javaField}"
  18. placeholder="请输入${comment}"
  19. clearable
  20. size="small"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
  25. <el-form-item label="${comment}" prop="${column.javaField}">
  26. <el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable size="small">
  27. <el-option
  28. v-for="dict in ${column.javaField}Options"
  29. :key="dict.dictValue"
  30. :label="dict.dictLabel"
  31. :value="dict.dictValue"
  32. />
  33. </el-select>
  34. </el-form-item>
  35. #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
  36. <el-form-item label="${comment}" prop="${column.javaField}">
  37. <el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable size="small">
  38. <el-option label="请选择字典生成" value="" />
  39. </el-select>
  40. </el-form-item>
  41. #elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN")
  42. <el-form-item label="${comment}" prop="${column.javaField}">
  43. <el-date-picker clearable size="small"
  44. v-model="queryParams.${column.javaField}"
  45. type="date"
  46. value-format="yyyy-MM-dd"
  47. placeholder="选择${comment}">
  48. </el-date-picker>
  49. </el-form-item>
  50. #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
  51. <el-form-item label="${comment}">
  52. <el-date-picker
  53. v-model="daterange${AttrName}"
  54. size="small"
  55. style="width: 240px"
  56. value-format="yyyy-MM-dd"
  57. type="daterange"
  58. range-separator="-"
  59. start-placeholder="开始日期"
  60. end-placeholder="结束日期"
  61. ></el-date-picker>
  62. </el-form-item>
  63. #end
  64. #end
  65. #end
  66. <el-form-item>
  67. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  68. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  69. </el-form-item>
  70. </el-form>
  71. <el-row :gutter="10" class="mb8">
  72. <el-col :span="1.5">
  73. <el-button
  74. type="primary"
  75. plain
  76. icon="el-icon-plus"
  77. size="mini"
  78. @click="handleAdd"
  79. v-hasPermi="['${moduleName}:${businessName}:add']"
  80. >新增</el-button>
  81. </el-col>
  82. <el-col :span="1.5">
  83. <el-button
  84. type="success"
  85. plain
  86. icon="el-icon-edit"
  87. size="mini"
  88. :disabled="single"
  89. @click="handleUpdate"
  90. v-hasPermi="['${moduleName}:${businessName}:edit']"
  91. >修改</el-button>
  92. </el-col>
  93. <el-col :span="1.5">
  94. <el-button
  95. type="danger"
  96. plain
  97. icon="el-icon-delete"
  98. size="mini"
  99. :disabled="multiple"
  100. @click="handleDelete"
  101. v-hasPermi="['${moduleName}:${businessName}:remove']"
  102. >删除</el-button>
  103. </el-col>
  104. <el-col :span="1.5">
  105. <el-button
  106. type="warning"
  107. plain
  108. icon="el-icon-download"
  109. size="mini"
  110. :loading="exportLoading"
  111. @click="handleExport"
  112. v-hasPermi="['${moduleName}:${businessName}:export']"
  113. >导出</el-button>
  114. </el-col>
  115. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  116. </el-row>
  117. <el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
  118. <el-table-column type="selection" width="55" align="center" />
  119. #foreach($column in $columns)
  120. #set($javaField=$column.javaField)
  121. #set($parentheseIndex=$column.columnComment.indexOf("("))
  122. #if($parentheseIndex != -1)
  123. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  124. #else
  125. #set($comment=$column.columnComment)
  126. #end
  127. #if($column.pk)
  128. <el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}"/>
  129. #elseif($column.list && $column.htmlType == "datetime")
  130. <el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
  131. <template slot-scope="scope">
  132. <span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
  133. </template>
  134. </el-table-column>
  135. #elseif($column.list && $column.dictType && "" != $column.dictType)
  136. <el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" />
  137. #elseif($column.list && "" != $javaField)
  138. <el-table-column label="${comment}" align="center" prop="${javaField}" />
  139. #end
  140. #end
  141. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  142. <template slot-scope="scope">
  143. <el-button
  144. size="mini"
  145. type="text"
  146. icon="el-icon-edit"
  147. @click="handleUpdate(scope.row)"
  148. v-hasPermi="['${moduleName}:${businessName}:edit']"
  149. >修改</el-button>
  150. <el-button
  151. size="mini"
  152. type="text"
  153. icon="el-icon-delete"
  154. @click="handleDelete(scope.row)"
  155. v-hasPermi="['${moduleName}:${businessName}:remove']"
  156. >删除</el-button>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. <pagination
  161. v-show="total>0"
  162. :total="total"
  163. :page.sync="queryParams.pageNum"
  164. :limit.sync="queryParams.pageSize"
  165. @pagination="getList"
  166. />
  167. <!-- 添加或修改${functionName}对话框 -->
  168. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  169. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  170. #foreach($column in $columns)
  171. #set($field=$column.javaField)
  172. #if($column.insert && !$column.pk)
  173. #set($parentheseIndex=$column.columnComment.indexOf("("))
  174. #if($parentheseIndex != -1)
  175. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  176. #else
  177. #set($comment=$column.columnComment)
  178. #end
  179. #set($dictType=$column.dictType)
  180. #if($column.htmlType == "input")
  181. <el-form-item label="${comment}" prop="${field}">
  182. <el-input v-model="form.${field}" placeholder="请输入${comment}" />
  183. </el-form-item>
  184. #elseif($column.htmlType == "imageUpload")
  185. <el-form-item label="${comment}">
  186. <imageUpload v-model="form.${field}"/>
  187. </el-form-item>
  188. #elseif($column.htmlType == "fileUpload")
  189. <el-form-item label="${comment}">
  190. <fileUpload v-model="form.${field}"/>
  191. </el-form-item>
  192. #elseif($column.htmlType == "editor")
  193. <el-form-item label="${comment}">
  194. <editor v-model="form.${field}" :min-height="192"/>
  195. </el-form-item>
  196. #elseif($column.htmlType == "select" && "" != $dictType)
  197. <el-form-item label="${comment}" prop="${field}">
  198. <el-select v-model="form.${field}" placeholder="请选择${comment}">
  199. <el-option
  200. v-for="dict in ${field}Options"
  201. :key="dict.dictValue"
  202. :label="dict.dictLabel"
  203. #if($column.javaType == "Integer" || $column.javaType == "Long"):value="parseInt(dict.dictValue)"#else:value="dict.dictValue"#end
  204. ></el-option>
  205. </el-select>
  206. </el-form-item>
  207. #elseif($column.htmlType == "select" && $dictType)
  208. <el-form-item label="${comment}" prop="${field}">
  209. <el-select v-model="form.${field}" placeholder="请选择${comment}">
  210. <el-option label="请选择字典生成" value="" />
  211. </el-select>
  212. </el-form-item>
  213. #elseif($column.htmlType == "checkbox" && "" != $dictType)
  214. <el-form-item label="${comment}">
  215. <el-checkbox-group v-model="form.${field}">
  216. <el-checkbox
  217. v-for="dict in ${field}Options"
  218. :key="dict.dictValue"
  219. :label="dict.dictValue">
  220. {{dict.dictLabel}}
  221. </el-checkbox>
  222. </el-checkbox-group>
  223. </el-form-item>
  224. #elseif($column.htmlType == "checkbox" && $dictType)
  225. <el-form-item label="${comment}">
  226. <el-checkbox-group v-model="form.${field}">
  227. <el-checkbox>请选择字典生成</el-checkbox>
  228. </el-checkbox-group>
  229. </el-form-item>
  230. #elseif($column.htmlType == "radio" && "" != $dictType)
  231. <el-form-item label="${comment}">
  232. <el-radio-group v-model="form.${field}">
  233. <el-radio
  234. v-for="dict in ${field}Options"
  235. :key="dict.dictValue"
  236. #if($column.javaType == "Integer" || $column.javaType == "Long"):label="parseInt(dict.dictValue)"#else:label="dict.dictValue"#end
  237. >{{dict.dictLabel}}</el-radio>
  238. </el-radio-group>
  239. </el-form-item>
  240. #elseif($column.htmlType == "radio" && $dictType)
  241. <el-form-item label="${comment}">
  242. <el-radio-group v-model="form.${field}">
  243. <el-radio label="1">请选择字典生成</el-radio>
  244. </el-radio-group>
  245. </el-form-item>
  246. #elseif($column.htmlType == "datetime")
  247. <el-form-item label="${comment}" prop="${field}">
  248. <el-date-picker clearable size="small"
  249. v-model="form.${field}"
  250. type="datetime"
  251. value-format="yyyy-MM-dd HH:mm:ss"
  252. placeholder="选择${comment}">
  253. </el-date-picker>
  254. </el-form-item>
  255. #elseif($column.htmlType == "textarea")
  256. <el-form-item label="${comment}" prop="${field}">
  257. <el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
  258. </el-form-item>
  259. #end
  260. #end
  261. #end
  262. #if($table.sub)
  263. <el-divider content-position="center">${subTable.functionName}信息</el-divider>
  264. <el-row :gutter="10" class="mb8">
  265. <el-col :span="1.5">
  266. <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd${subClassName}">添加</el-button>
  267. </el-col>
  268. <el-col :span="1.5">
  269. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete${subClassName}">删除</el-button>
  270. </el-col>
  271. </el-row>
  272. <el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
  273. <el-table-column type="selection" width="50" align="center" />
  274. <el-table-column label="序号" align="center" prop="index" width="50"/>
  275. #foreach($column in $subTable.columns)
  276. #set($javaField=$column.javaField)
  277. #set($parentheseIndex=$column.columnComment.indexOf("("))
  278. #if($parentheseIndex != -1)
  279. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  280. #else
  281. #set($comment=$column.columnComment)
  282. #end
  283. #if($column.pk || $javaField == ${subTableFkclassName})
  284. #elseif($column.list && "" != $javaField)
  285. <el-table-column label="$comment" prop="${javaField}">
  286. <template slot-scope="scope">
  287. <el-input v-model="scope.row.$javaField" placeholder="请输入$comment" />
  288. </template>
  289. </el-table-column>
  290. #end
  291. #end
  292. </el-table>
  293. #end
  294. </el-form>
  295. <div slot="footer" class="dialog-footer">
  296. <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
  297. <el-button @click="cancel">取 消</el-button>
  298. </div>
  299. </el-dialog>
  300. </div>
  301. </template>
  302. <script>
  303. import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
  304. export default {
  305. name: "${BusinessName}",
  306. data() {
  307. return {
  308. // 按钮loading
  309. buttonLoading: false,
  310. // 遮罩层
  311. loading: true,
  312. // 导出遮罩层
  313. exportLoading: false,
  314. // 选中数组
  315. ids: [],
  316. #if($table.sub)
  317. // 子表选中数据
  318. checked${subClassName}: [],
  319. #end
  320. // 非单个禁用
  321. single: true,
  322. // 非多个禁用
  323. multiple: true,
  324. // 显示搜索条件
  325. showSearch: true,
  326. // 总条数
  327. total: 0,
  328. // ${functionName}表格数据
  329. ${businessName}List: [],
  330. #if($table.sub)
  331. // ${subTable.functionName}表格数据
  332. ${subclassName}List: [],
  333. #end
  334. // 弹出层标题
  335. title: "",
  336. // 是否显示弹出层
  337. open: false,
  338. #foreach ($column in $columns)
  339. #set($parentheseIndex=$column.columnComment.indexOf("("))
  340. #if($parentheseIndex != -1)
  341. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  342. #else
  343. #set($comment=$column.columnComment)
  344. #end
  345. #if(${column.dictType} && ${column.dictType} != '')
  346. // $comment字典
  347. ${column.javaField}Options: [],
  348. #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
  349. #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  350. // $comment时间范围
  351. daterange${AttrName}: [],
  352. #end
  353. #end
  354. // 查询参数
  355. queryParams: {
  356. pageNum: 1,
  357. pageSize: 10,
  358. #foreach ($column in $columns)
  359. #if($column.query)
  360. $column.javaField: undefined#if($velocityCount != $columns.size()),#end
  361. #end
  362. #end
  363. },
  364. // 表单参数
  365. form: {},
  366. // 表单校验
  367. rules: {
  368. #foreach ($column in $columns)
  369. #if($column.required)
  370. #set($parentheseIndex=$column.columnComment.indexOf("("))
  371. #if($parentheseIndex != -1)
  372. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  373. #else
  374. #set($comment=$column.columnComment)
  375. #end
  376. $column.javaField: [
  377. { required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }
  378. ]#if($velocityCount != $columns.size()),#end
  379. #end
  380. #end
  381. }
  382. };
  383. },
  384. created() {
  385. this.getList();
  386. #foreach ($column in $columns)
  387. #if(${column.dictType} && ${column.dictType} != '')
  388. this.getDicts("${column.dictType}").then(response => {
  389. this.${column.javaField}Options = response.data;
  390. });
  391. #end
  392. #end
  393. },
  394. methods: {
  395. /** 查询${functionName}列表 */
  396. getList() {
  397. this.loading = true;
  398. #foreach ($column in $columns)
  399. #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
  400. this.queryParams.params = {};
  401. #break
  402. #end
  403. #end
  404. #foreach ($column in $columns)
  405. #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
  406. #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  407. if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
  408. this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
  409. this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
  410. }
  411. #end
  412. #end
  413. list${BusinessName}(this.queryParams).then(response => {
  414. this.${businessName}List = response.rows;
  415. this.total = response.total;
  416. this.loading = false;
  417. });
  418. },
  419. #foreach ($column in $columns)
  420. #if(${column.dictType} && ${column.dictType} != '')
  421. #set($parentheseIndex=$column.columnComment.indexOf("("))
  422. #if($parentheseIndex != -1)
  423. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  424. #else
  425. #set($comment=$column.columnComment)
  426. #end
  427. // $comment字典翻译
  428. ${column.javaField}Format(row, column) {
  429. return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField});
  430. },
  431. #end
  432. #end
  433. // 取消按钮
  434. cancel() {
  435. this.open = false;
  436. this.reset();
  437. },
  438. // 表单重置
  439. reset() {
  440. this.form = {
  441. #foreach ($column in $columns)
  442. #if($column.htmlType == "radio")
  443. $column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else"0"#end#if($velocityCount != $columns.size()),#end
  444. #elseif($column.htmlType == "checkbox")
  445. $column.javaField: []#if($velocityCount != $columns.size()),#end
  446. #else
  447. $column.javaField: undefined#if($velocityCount != $columns.size()),#end
  448. #end
  449. #end
  450. };
  451. #if($table.sub)
  452. this.${subclassName}List = [];
  453. #end
  454. this.resetForm("form");
  455. },
  456. /** 搜索按钮操作 */
  457. handleQuery() {
  458. this.queryParams.pageNum = 1;
  459. this.getList();
  460. },
  461. /** 重置按钮操作 */
  462. resetQuery() {
  463. #foreach ($column in $columns)
  464. #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
  465. #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  466. this.daterange${AttrName} = [];
  467. #end
  468. #end
  469. this.resetForm("queryForm");
  470. this.handleQuery();
  471. },
  472. // 多选框选中数据
  473. handleSelectionChange(selection) {
  474. this.ids = selection.map(item => item.${pkColumn.javaField})
  475. this.single = selection.length!==1
  476. this.multiple = !selection.length
  477. },
  478. /** 新增按钮操作 */
  479. handleAdd() {
  480. this.reset();
  481. this.open = true;
  482. this.title = "添加${functionName}";
  483. },
  484. /** 修改按钮操作 */
  485. handleUpdate(row) {
  486. this.loading = true;
  487. this.reset();
  488. const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
  489. get${BusinessName}(${pkColumn.javaField}).then(response => {
  490. this.loading = false;
  491. this.form = response.data;
  492. #foreach ($column in $columns)
  493. #if($column.htmlType == "checkbox")
  494. this.form.$column.javaField = this.form.${column.javaField}.split(",");
  495. #end
  496. #end
  497. #if($table.sub)
  498. this.${subclassName}List = response.data.${subclassName}List;
  499. #end
  500. this.open = true;
  501. this.title = "修改${functionName}";
  502. });
  503. },
  504. /** 提交按钮 */
  505. submitForm() {
  506. this.#[[$]]#refs["form"].validate(valid => {
  507. if (valid) {
  508. this.buttonLoading = true;
  509. #foreach ($column in $columns)
  510. #if($column.htmlType == "checkbox")
  511. this.form.$column.javaField = this.form.${column.javaField}.join(",");
  512. #end
  513. #end
  514. #if($table.sub)
  515. this.form.${subclassName}List = this.${subclassName}List;
  516. #end
  517. if (this.form.${pkColumn.javaField} != null) {
  518. update${BusinessName}(this.form).then(response => {
  519. this.msgSuccess("修改成功");
  520. this.open = false;
  521. this.getList();
  522. }).finally(() => {
  523. this.buttonLoading = false;
  524. });
  525. } else {
  526. add${BusinessName}(this.form).then(response => {
  527. this.msgSuccess("新增成功");
  528. this.open = false;
  529. this.getList();
  530. }).finally(() => {
  531. this.buttonLoading = false;
  532. });
  533. }
  534. }
  535. });
  536. },
  537. /** 删除按钮操作 */
  538. handleDelete(row) {
  539. const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
  540. this.$confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?', "警告", {
  541. confirmButtonText: "确定",
  542. cancelButtonText: "取消",
  543. type: "warning"
  544. }).then(() => {
  545. this.loading = true;
  546. return del${BusinessName}(${pkColumn.javaField}s);
  547. }).then(() => {
  548. this.loading = false;
  549. this.getList();
  550. this.msgSuccess("删除成功");
  551. }).catch(() => {});
  552. },
  553. #if($table.sub)
  554. /** ${subTable.functionName}序号 */
  555. row${subClassName}Index({ row, rowIndex }) {
  556. row.index = rowIndex + 1;
  557. },
  558. /** ${subTable.functionName}添加按钮操作 */
  559. handleAdd${subClassName}() {
  560. let obj = {};
  561. #foreach($column in $subTable.columns)
  562. #if($column.pk || $column.javaField == ${subTableFkclassName})
  563. #elseif($column.list && "" != $javaField)
  564. obj.$column.javaField = "";
  565. #end
  566. #end
  567. this.${subclassName}List.push(obj);
  568. },
  569. /** ${subTable.functionName}删除按钮操作 */
  570. handleDelete${subClassName}() {
  571. if (this.checked${subClassName}.length == 0) {
  572. this.$alert("请先选择要删除的${subTable.functionName}数据", "提示", { confirmButtonText: "确定", });
  573. } else {
  574. this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1);
  575. }
  576. },
  577. /** 单选框选中数据 */
  578. handle${subClassName}SelectionChange(selection) {
  579. if (selection.length > 1) {
  580. this.$refs.${subclassName}.clearSelection();
  581. this.$refs.${subclassName}.toggleRowSelection(selection.pop());
  582. } else {
  583. this.checked${subClassName} = selection;
  584. }
  585. },
  586. #end
  587. /** 导出按钮操作 */
  588. handleExport() {
  589. const queryParams = this.queryParams;
  590. this.$confirm('是否确认导出所有${functionName}数据项?', "警告", {
  591. confirmButtonText: "确定",
  592. cancelButtonText: "取消",
  593. type: "warning"
  594. }).then(() => {
  595. this.exportLoading = true;
  596. return export${BusinessName}(queryParams);
  597. }).then(response => {
  598. this.download(response.msg);
  599. this.exportLoading = false;
  600. }).catch(() => {});
  601. }
  602. }
  603. };
  604. </script>