index.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table :columns="columns" search="name,phone" toolbar="refresh,add,edit,del,more" ref="yuntable"
  4. :auth="auth" :extend="extend">
  5. </yun-table>
  6. </el-card>
  7. </template>
  8. <script>
  9. import table from "@components/Table.js";
  10. export default {
  11. components: {
  12. 'YunTable': table
  13. },
  14. auth: {
  15. add: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'add'),
  16. edit: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'edit'),
  17. del: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'del'),
  18. multi: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'multi'),
  19. recyclebin: Yunqi.auth.check('app\\admin\\controller\\goods\\PackSpecs', 'recyclebin'),
  20. },
  21. data: {
  22. extend: {
  23. index_url: 'goods/pack_specs/index',
  24. add_url: 'goods/pack_specs/add',
  25. edit_url: 'goods/pack_specs/edit',
  26. del_url: 'goods/pack_specs/del',
  27. multi_url: 'goods/pack_specs/multi'
  28. },
  29. columns: [
  30. {
  31. checkbox: true, selectable: function (row, index) {
  32. //可以根据业务需求返回false让某些行不可选中
  33. return true;
  34. }
  35. },
  36. { field: "id", title: "ID", operate: false },
  37. { field: "title", title: "规格名称" },
  38. { field: "labor_cost_money", title: "工价", operate: false },
  39. // { field: "keep_warm_type", title: "保温款式", operate: { form: "radio", filter: "=" }, searchList: { 1: "单层保温", 2: "双层保温" } },
  40. // { field: "surcharge_money", title: "加收金额", operate: false },
  41. { field: "one_surcharge_money", title: "单层保温金额", operate: false },
  42. { field: "two_surcharge_money", title: "双层保温金额", operate: false },
  43. { field: "createtime", title: "创建时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  44. { field: "updatetime", title: "修改时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  45. {
  46. field: 'operate',
  47. title: __('操作'),
  48. width: 130,
  49. action: {
  50. edit: function (row) {
  51. //可以根据业务需求返回false让按钮不显示
  52. return true
  53. },
  54. del: true,
  55. }
  56. }
  57. ]
  58. },
  59. //页面加载完成时执行
  60. onLoad: function (query) {
  61. console.log(query);
  62. },
  63. //页面初始显示或在框架内显示时执行
  64. onShow: function () {
  65. },
  66. //页面在框架内隐藏时执行
  67. onHide: function () {
  68. },
  69. //页面在框架内关闭时执行
  70. onUnload: function () {
  71. },
  72. methods: {
  73. onTableRender: function (list) {
  74. //表格渲染完成后执行
  75. /**
  76. * table常用方法
  77. * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
  78. * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
  79. * this.$refs.yuntable.submit();//返回第一页,重新获取数据
  80. * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
  81. * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
  82. */
  83. }
  84. }
  85. }
  86. </script>
  87. <style>
  88. </style>