tree-vue.template 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. {{$lens := .table.Columns|len}}
  3. {{$businessName := .table.BusinessName | CaseCamelLower}}
  4. {{$treeParentCode := .table.TreeParentCode}}
  5. {{$treeCode := .table.TreeCode}}
  6. {{$treeName := .table.TreeName}}
  7. <div class="app-container">
  8. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
  9. {{range $index, $column := .table.Columns}}
  10. {{if and (eq $column.IsQuery "1") (ne $column.ColumnName "created_by") (ne $column.ColumnName "updated_by") (ne $column.ColumnName "created_at") (ne $column.ColumnName "updated_at") (ne $column.ColumnName "deleted_at")}}
  11. {{if eq $column.HtmlType "input"}}
  12. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  13. <el-input
  14. v-model="queryParams.{{$column.HtmlField}}"
  15. placeholder="请输入{{$column.ColumnComment}}"
  16. clearable
  17. size="small"
  18. @keyup.enter.native="handleQuery"
  19. />
  20. </el-form-item>
  21. {{else if and (eq $column.HtmlType "select" "radio" "checkbox") (ne $column.DictType "") }}
  22. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  23. <el-select v-model="queryParams.{{$column.HtmlField}}" placeholder="请选择{{$column.ColumnComment}}" clearable size="small">
  24. <el-option
  25. v-for="dict in {{$column.HtmlField}}Options"
  26. :key="dict.key"
  27. :label="dict.value"
  28. :value="dict.key"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. {{else if eq $column.HtmlType "datetime"}}
  33. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  34. <el-date-picker
  35. clearable size="small" style="width: 200px"
  36. v-model="queryParams.{{$column.HtmlField}}"
  37. type="date"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择{{$column.ColumnComment}}">
  40. </el-date-picker>
  41. </el-form-item>
  42. {{else if and (eq $column.HtmlType "select" "radio" "checkbox") (ne $column.LinkTableName "")}}
  43. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  44. <el-select v-model="queryParams.{{$column.HtmlField}}" placeholder="请选择{{$column.ColumnComment}}" clearable size="small">
  45. <el-option
  46. v-for="item in {{$column.HtmlField}}Options"
  47. :key="item.key"
  48. :label="item.value"
  49. :value="item.key"
  50. />
  51. </el-select>
  52. </el-form-item>
  53. {{else}}
  54. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  55. <el-select v-model="queryParams.{{$column.HtmlField}}" placeholder="请选择{{$column.ColumnComment}}" clearable size="small">
  56. <el-option label="请选择字典生成" value="" />
  57. </el-select>
  58. </el-form-item>
  59. {{end}}
  60. {{end}}
  61. {{end}}
  62. <el-form-item>
  63. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  64. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  65. </el-form-item>
  66. </el-form>
  67. <el-row :gutter="10" class="mb8">
  68. <el-col :span="1.5">
  69. <el-button
  70. type="primary"
  71. icon="el-icon-plus"
  72. size="mini"
  73. @click="handleAdd"
  74. v-hasPermi="['{{.table.ModuleName}}/{{$businessName}}/add']"
  75. >新增</el-button>
  76. </el-col>
  77. <el-col :span="1.5">
  78. <el-button
  79. type="success"
  80. icon="el-icon-edit"
  81. size="mini"
  82. :disabled="single"
  83. @click="handleUpdate"
  84. v-hasPermi="['{{.table.ModuleName}}/{{$businessName}}/edit']"
  85. >修改</el-button>
  86. </el-col>
  87. <el-col :span="1.5">
  88. <el-button
  89. type="danger"
  90. icon="el-icon-delete"
  91. size="mini"
  92. :disabled="multiple"
  93. @click="handleDelete"
  94. v-hasPermi="['{{.table.ModuleName}}/{{$businessName}}/delete']"
  95. >删除</el-button>
  96. </el-col>
  97. </el-row>
  98. <el-table v-loading="loading" :data="{{$businessName}}List"
  99. @selection-change="handleSelectionChange"
  100. row-key="{{$treeCode}}"
  101. default-expand-all
  102. :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
  103. >
  104. <el-table-column type="selection" width="55" align="center" />
  105. {{range $index, $column := .table.Columns}}
  106. {{if eq $column.IsPk "1"}}
  107. <el-table-column label="{{$column.ColumnComment}}" align="center" prop="{{$column.HtmlField}}" />
  108. {{else if and (eq $column.IsList "1") (eq $column.HtmlType "datetime")}}
  109. <el-table-column label="{{$column.ColumnComment}}" align="center" prop="{{$column.HtmlField}}" width="180">
  110. <template slot-scope="scope">
  111. <span>{{VueTag "{{"}} parseTime(scope.row.{{$column.HtmlField}}, {y}-{m}-{d}) {{VueTag "}}"}}</span>
  112. </template>
  113. </el-table-column>
  114. {{else if and (eq $column.IsList "1") (HasSuffix $column.ColumnName "status")}}
  115. <el-table-column label="{{$column.ColumnComment}}" align="center">
  116. <template slot-scope="scope">
  117. <el-switch
  118. v-model="scope.row.{{$column.HtmlField}}"
  119. :active-value="1"
  120. :inactive-value="0"
  121. @change="{{$column.HtmlField}}Change(scope.row)"
  122. ></el-switch>
  123. </template>
  124. </el-table-column>
  125. {{else if ne $column.LinkTableName ""}}
  126. <el-table-column label="{{$column.ColumnComment}}" align="center" prop="{{$column.HtmlField}}" :formatter="{{$column.HtmlField}}Format" width="100">
  127. <template slot-scope="scope">
  128. {{VueTag "{{" }} {{$column.HtmlField}}Format(scope.row) {{VueTag "}}" }}
  129. </template>
  130. </el-table-column>
  131. {{else if and (eq $column.IsList "1") (ne $column.DictType "")}}
  132. <el-table-column label="{{$column.ColumnComment}}" align="center" prop="{{$column.HtmlField}}" :formatter="{{$column.HtmlField}}Format" />
  133. {{else if and (eq $column.IsList "1") (ne $column.HtmlField "")}}
  134. <el-table-column label="{{$column.ColumnComment}}" align="center" prop="{{$column.HtmlField}}" />
  135. {{end}}{{end}}
  136. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  137. <template slot-scope="scope">
  138. <el-button
  139. size="mini"
  140. type="text"
  141. icon="el-icon-edit"
  142. @click="handleUpdate(scope.row)"
  143. v-hasPermi="['{{.table.ModuleName}}/{{$businessName}}/edit']"
  144. >修改</el-button>
  145. <el-button
  146. size="mini"
  147. type="text"
  148. icon="el-icon-delete"
  149. @click="handleDelete(scope.row)"
  150. v-hasPermi="['{{.table.ModuleName}}/{{$businessName}}/delete']"
  151. >删除</el-button>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. <!-- 添加或修改{{.table.FunctionName}}对话框 -->
  156. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
  157. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  158. {{range $index, $column := .table.Columns}}
  159. {{if and (eq $column.IsInsert "1") (ne $column.IsPk "1")}}
  160. {{if and (ne $treeParentCode "") (eq $column.HtmlField $treeParentCode)}}
  161. <el-form-item label="{{$column.ColumnComment}}" prop="{{$treeParentCode}}">
  162. <treeselect v-model="form.{{$treeParentCode}}" :options="{{$businessName}}Options" :normalizer="normalizer" placeholder="请选择{{$column.ColumnComment}}" />
  163. </el-form-item>
  164. {{else if eq $column.HtmlType "input"}}
  165. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  166. <el-input v-model="form.{{$column.HtmlField}}" placeholder="请输入{{$column.ColumnComment}}" />
  167. </el-form-item>
  168. {{else if eq $column.HtmlType "select" }}
  169. {{if ne $column.LinkTableName ""}}
  170. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  171. <el-select v-model="form.{{$column.HtmlField}}" placeholder="请选择{{$column.ColumnComment}}">
  172. <el-option
  173. v-for="item in {{$column.HtmlField}}Options"
  174. :key="item.key"
  175. :label="item.value"
  176. :value="item.key"
  177. ></el-option>
  178. </el-select>
  179. </el-form-item>
  180. {{else if ne $column.DictType ""}}
  181. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  182. <el-select v-model="form.{{$column.HtmlField}}" placeholder="请选择{{$column.ColumnComment}}">
  183. <el-option
  184. v-for="dict in {{$column.HtmlField}}Options"
  185. :key="dict.key"
  186. :label="dict.value"
  187. {{if eq $column.GoType "Integer"}}
  188. :value="parseInt(dict.key)"
  189. {{else}}
  190. :value="dict.key"
  191. {{end}}
  192. ></el-option>
  193. </el-select>
  194. </el-form-item>
  195. {{else}}
  196. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  197. <el-select v-model="form.{{$column.HtmlField}}" placeholder="请选择{{$column.ColumnComment}}">
  198. <el-option label="请选择字典生成" value="" />
  199. </el-select>
  200. </el-form-item>
  201. {{end}}
  202. {{else if eq $column.HtmlType "radio" }}
  203. {{if ne $column.DictType ""}}
  204. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  205. <el-radio-group v-model="form.{{$column.HtmlField}}">
  206. <el-radio
  207. v-for="dict in {{$column.HtmlField}}Options"
  208. :key="dict.key"
  209. :label="dict.key"
  210. >{{ VueTag "{{" }}dict.value {{VueTag "}}"}}</el-radio>
  211. </el-radio-group>
  212. </el-form-item>
  213. {{else}}
  214. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  215. <el-radio-group v-model="form.{{$column.HtmlField}}">
  216. <el-radio label="1">请选择字典生成</el-radio>
  217. </el-radio-group>
  218. </el-form-item>
  219. {{end}}
  220. {{else if eq $column.HtmlType "datetime"}}
  221. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  222. <el-date-picker clearable size="small" style="width: 200px"
  223. v-model="form.{{$column.HtmlField}}"
  224. type="date"
  225. value-format="yyyy-MM-dd"
  226. placeholder="选择{{$column.ColumnComment}}">
  227. </el-date-picker>
  228. </el-form-item>
  229. {{else if eq $column.HtmlType "textarea"}}
  230. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  231. <el-input v-model="form.{{$column.HtmlField}}" type="textarea" placeholder="请输入内容" />
  232. </el-form-item>
  233. {{else if eq $column.HtmlType "checkbox" }}
  234. <el-form-item label="{{$column.ColumnComment}}" prop="{{$column.HtmlField}}">
  235. <el-checkbox-group v-model="form.{{$column.HtmlField}}">
  236. <el-checkbox
  237. v-for="dict in {{$column.HtmlField}}Options"
  238. :key="dict.key"
  239. :label="dict.key"
  240. >{{ VueTag "{{" }}dict.value {{VueTag "}}"}}</el-checkbox>
  241. </el-checkbox-group>
  242. </el-form-item>
  243. {{end}}
  244. {{end}}
  245. {{end}}
  246. </el-form>
  247. <div slot="footer" class="dialog-footer">
  248. <el-button type="primary" @click="submitForm">确 定</el-button>
  249. <el-button @click="cancel">取 消</el-button>
  250. </div>
  251. </el-dialog>
  252. </div>
  253. </template>
  254. <script>
  255. import {
  256. list{{.table.ClassName}},
  257. get{{.table.ClassName}},
  258. del{{.table.ClassName}},
  259. add{{.table.ClassName}},
  260. update{{.table.ClassName}},
  261. {{range $index,$column:= .table.Columns}}
  262. {{if and (HasSuffix $column.ColumnName "status") (eq $column.IsList "1") }}
  263. change{{$.table.ClassName}}{{$column.GoField}},
  264. {{end}}
  265. {{if ne $column.LinkTableName ""}}
  266. list{{$column.LinkTableClass}},
  267. {{end}}
  268. {{end}}
  269. } from "@/api/{{.table.ModuleName}}/{{$businessName}}";
  270. import Treeselect from "@riophae/vue-treeselect";
  271. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  272. export default {
  273. name: "{{.table.ClassName}}",
  274. components: { Treeselect },
  275. data() {
  276. return {
  277. // 遮罩层
  278. loading: true,
  279. // 选中数组
  280. ids: [],
  281. // 非单个禁用
  282. single: true,
  283. // 非多个禁用
  284. multiple: true,
  285. // 总条数
  286. total: 0,
  287. // {{.table.FunctionName}}表格数据
  288. {{$businessName}}List: [],
  289. // {{.table.FunctionName}}树选项
  290. {{$businessName}}Options: [],
  291. // 弹出层标题
  292. title: "",
  293. // 是否显示弹出层
  294. open: false,
  295. {{range $index, $column := .table.Columns}}
  296. {{if ne $column.DictType ""}}
  297. // {{$column.HtmlField}}Options字典数据
  298. {{$column.HtmlField}}Options: [],
  299. {{else if ne $column.LinkTableName ""}}
  300. // {{$column.HtmlField}}Options关联表数据
  301. {{$column.HtmlField}}Options: [],
  302. {{end}}
  303. {{end}}
  304. // 查询参数
  305. queryParams: {
  306. pageNum: 1,
  307. pageSize: 10,{{range $index, $column := .table.Columns}}{{if eq $column.IsQuery "1"}}
  308. {{$column.HtmlField}}: undefined{{if ne $lens $index}},{{end}}{{end}}{{end}}
  309. },
  310. // 表单参数
  311. form: {},
  312. // 表单校验
  313. rules: { {{range $index, $column := .table.Columns}}{{if eq $column.IsRequired "1"}}
  314. {{$column.HtmlField}} : [
  315. { required: true, message: "{{$column.ColumnComment}}不能为空", trigger: "blur" }
  316. ]{{if ne $lens $index}},{{end}}{{end}}{{end}}
  317. }
  318. };
  319. },
  320. created() {
  321. {{range $index, $column := .table.Columns}}
  322. {{if ne $column.DictType ""}}
  323. this.getDicts("{{$column.DictType}}").then(response => {
  324. this.{{$column.HtmlField}}Options = response.data.values||[];
  325. });
  326. {{else if ne $column.LinkTableName ""}}
  327. this.get{{$column.LinkTableClass}}Items()
  328. {{end}}
  329. {{end}}
  330. this.getList();
  331. },
  332. methods: {
  333. {{range $index, $column := .table.Columns}}
  334. {{if ne $column.LinkTableName ""}}
  335. //关联{{$column.LinkTableName}}表选项
  336. get{{$column.LinkTableClass}}Items() {
  337. this.getItems(list{{$column.LinkTableClass}}, {pageSize:10000}).then(res => {
  338. this.{{$column.HtmlField}}Options = this.setItems(res, '{{$column.LinkLabelId}}', '{{$column.LinkLabelName}}')
  339. })
  340. },
  341. {{else if and (HasSuffix $column.ColumnName "status") (eq $column.IsList "1")}}
  342. // {{$column.ColumnComment}}修改
  343. {{$column.HtmlField}}Change(row) {
  344. let text = row.{{$column.HtmlField}} === 1 ? "启用" : "停用";
  345. this.$confirm('确认要"' + text + '":吗?', "警告", {
  346. confirmButtonText: "确定",
  347. cancelButtonText: "取消",
  348. type: "warning"
  349. }).then(function() {
  350. return change{{$.table.ClassName}}{{$column.GoField}}(row.{{$.table.PkColumn.ColumnName}}, row.{{$column.HtmlField}});
  351. }).then(() => {
  352. this.msgSuccess(text + "成功");
  353. }).catch(function() {
  354. row.userStatus =row.userStatus === 0 ?1 : 0;
  355. });
  356. },
  357. {{end}}
  358. {{end}}
  359. /** 查询{{.table.FunctionName}}列表 */
  360. getList() {
  361. this.loading = true;
  362. list{{.table.ClassName}}(this.queryParams).then(response => {
  363. this.{{$businessName}}List = this.handleTree(response.data.list||[], "{{$treeCode}}", "{{$treeParentCode}}");
  364. this.loading = false;
  365. });
  366. },
  367. /** 转换{{.table.FunctionName}}数据结构 */
  368. normalizer(node) {
  369. if (node.children && !node.children.length) {
  370. delete node.children;
  371. }
  372. return {
  373. id: node.{{$treeCode}},
  374. label: node.{{$treeName}},
  375. children: node.children
  376. };
  377. },
  378. /** 查询{{.table.FunctionName}}下拉树结构 */
  379. getTreeselect() {
  380. list{{.table.ClassName}}(this.queryParams).then(response => {
  381. this.{{$businessName}}Options = [];
  382. const data = { {{$treeCode}}: 0, {{$treeName}}: '顶级节点', children: [] };
  383. data.children = this.handleTree(response.data.list||[], "{{$treeCode}}", "{{$treeParentCode}}");
  384. this.{{$businessName}}Options.push(data);
  385. });
  386. },
  387. {{range $index, $column := .table.Columns}}
  388. {{if ne $column.DictType ""}}
  389. {{if eq $column.HtmlType "checkbox"}}
  390. // {{$column.ColumnComment}}字典翻译
  391. {{$column.HtmlField}}Format(row, column) {
  392. let {{$column.HtmlField}} = row.{{$column.HtmlField}}.split(",")
  393. let data = [];
  394. {{$column.HtmlField}}.map(item=>{
  395. data.push(this.selectDictLabel(this.{{$column.HtmlField}}Options, item))
  396. })
  397. return data.join(",")
  398. },
  399. {{else}}
  400. // {{$column.ColumnComment}}字典翻译
  401. {{$column.HtmlField}}Format(row, column) {
  402. return this.selectDictLabel(this.{{$column.HtmlField}}Options, row.{{$column.HtmlField}});
  403. },
  404. {{end}}
  405. {{else if ne $column.LinkTableName ""}}
  406. // {{$column.ColumnComment}}关联表翻译
  407. {{$column.HtmlField}}Format(row, column) {
  408. return this.selectItemsLabel(this.{{$column.HtmlField}}Options, row.{{$column.HtmlField}});
  409. },
  410. {{end}}
  411. {{end}}
  412. // 取消按钮
  413. cancel() {
  414. this.open = false;
  415. this.reset();
  416. },
  417. // 表单重置
  418. reset() {
  419. this.form = {
  420. {{range $index, $column := .table.Columns}}
  421. {{if eq $column.HtmlType "radio"}}
  422. {{$column.HtmlField}}: "0" {{if ne $lens $index}},{{end}}
  423. {{else if eq $column.HtmlType "checkbox"}}
  424. {{$column.HtmlField}}: [] {{if ne $lens $index}},{{end}}
  425. {{else}}
  426. {{$column.HtmlField}}: undefined{{if ne $lens $index}},{{end}}{{end}}{{end}}
  427. };
  428. this.resetForm("form");
  429. },
  430. /** 搜索按钮操作 */
  431. handleQuery() {
  432. this.queryParams.pageNum = 1;
  433. this.getList();
  434. },
  435. /** 重置按钮操作 */
  436. resetQuery() {
  437. this.resetForm("queryForm");
  438. this.handleQuery();
  439. },
  440. // 多选框选中数据
  441. handleSelectionChange(selection) {
  442. this.ids = selection.map(item => item.{{.table.PkColumn.HtmlField}})
  443. this.single = selection.length!=1
  444. this.multiple = !selection.length
  445. },
  446. /** 新增按钮操作 */
  447. handleAdd() {
  448. this.reset();
  449. this.getTreeselect()
  450. this.open = true;
  451. this.title = "添加{{.table.FunctionName}}";
  452. },
  453. /** 修改按钮操作 */
  454. handleUpdate(row) {
  455. this.reset();
  456. this.getTreeselect()
  457. const {{.table.PkColumn.HtmlField}} = row.{{.table.PkColumn.HtmlField}} || this.ids
  458. get{{.table.ClassName}}({{.table.PkColumn.HtmlField}}).then(response => {
  459. let data = response.data;
  460. {{range $index, $column := .table.Columns}}
  461. {{if eq $column.HtmlType "checkbox"}}
  462. data.{{$column.HtmlField}} = data.{{$column.HtmlField}}.split(",")
  463. {{else if eq $column.HtmlType "radio" "select"}}
  464. data.{{$column.HtmlField}} = ''+data.{{$column.HtmlField}}
  465. {{end}}
  466. {{end}}
  467. this.form = data;
  468. this.open = true;
  469. this.title = "修改{{.table.FunctionName}}";
  470. });
  471. },
  472. /** 提交按钮 */
  473. submitForm: function() {
  474. this.$refs["form"].validate(valid => {
  475. if (valid) {
  476. if (this.form.{{.table.PkColumn.HtmlField}} != undefined) {
  477. update{{.table.ClassName}}(this.form).then(response => {
  478. if (response.code === 0) {
  479. this.msgSuccess("修改成功");
  480. this.open = false;
  481. this.getList();
  482. } else {
  483. this.msgError(response.msg);
  484. }
  485. });
  486. } else {
  487. add{{.table.ClassName}}(this.form).then(response => {
  488. if (response.code === 0) {
  489. this.msgSuccess("新增成功");
  490. this.open = false;
  491. this.getList();
  492. } else {
  493. this.msgError(response.msg);
  494. }
  495. });
  496. }
  497. }
  498. });
  499. },
  500. /** 删除按钮操作 */
  501. handleDelete(row) {
  502. const {{.table.PkColumn.HtmlField}}s = row.{{.table.PkColumn.HtmlField}} || this.ids;
  503. this.$confirm('是否确认删除{{.table.FunctionName}}编号为"' + {{.table.PkColumn.HtmlField}}s + '"的数据项?', "警告", {
  504. confirmButtonText: "确定",
  505. cancelButtonText: "取消",
  506. type: "warning"
  507. }).then(function() {
  508. return del{{.table.ClassName}}({{.table.PkColumn.HtmlField}}s);
  509. }).then(() => {
  510. this.getList();
  511. this.msgSuccess("删除成功");
  512. }).catch(function() {});
  513. }
  514. }
  515. };
  516. </script>