index.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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: "one_surcharge_money", title: "单层保温金额", operate: false },
  40. { field: "two_surcharge_money", title: "双层保温金额", operate: false },
  41. { field: "createtime", title: "创建时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  42. { field: "updatetime", title: "修改时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  43. {
  44. field: 'operate',
  45. title: __('操作'),
  46. width: 130,
  47. action: {
  48. edit: function (row) {
  49. //可以根据业务需求返回false让按钮不显示
  50. return true
  51. },
  52. del: true,
  53. }
  54. }
  55. ]
  56. },
  57. //页面加载完成时执行
  58. onLoad: function (query) {
  59. console.log(query);
  60. },
  61. //页面初始显示或在框架内显示时执行
  62. onShow: function () {
  63. },
  64. //页面在框架内隐藏时执行
  65. onHide: function () {
  66. },
  67. //页面在框架内关闭时执行
  68. onUnload: function () {
  69. },
  70. methods: {
  71. onTableRender: function (list) {
  72. //表格渲染完成后执行
  73. /**
  74. * table常用方法
  75. * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
  76. * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
  77. * this.$refs.yuntable.submit();//返回第一页,重新获取数据
  78. * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
  79. * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
  80. */
  81. }
  82. }
  83. }
  84. </script>
  85. <style>
  86. </style>