index.vue.vm 22 KB

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