Digital Office Automation System Backend
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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