index.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table
  4. :columns="columns"
  5. :common-search="false"
  6. :pagination="false"
  7. order="asc"
  8. ref="yuntable"
  9. :is-tree="true"
  10. :tree-expand-all="true"
  11. toolbar="refresh,add,del"
  12. :auth="auth"
  13. :extend="extend">
  14. </yun-table>
  15. </el-card>
  16. </template>
  17. <script>
  18. import table from "@components/Table.js";
  19. import auth from "@components/Auth.js";
  20. const doCheck=function (tree,checkKey){
  21. tree.forEach(res=>{
  22. checkKey.push(res.id);
  23. if(res.children && res.children.length>0){
  24. doCheck(res.children,checkKey);
  25. }
  26. });
  27. }
  28. export default{
  29. components:{'YunTable':table,'Auth':auth},
  30. data:{
  31. auth:{
  32. add:Yunqi.auth.check('app\\admin\\controller\\auth\\Depart','add'),
  33. edit:Yunqi.auth.check('app\\admin\\controller\\auth\\Depart','edit'),
  34. del:Yunqi.auth.check('app\\admin\\controller\\auth\\Depart','del'),
  35. multi:Yunqi.auth.check('app\\admin\\controller\\auth\\Depart','multi'),
  36. download:Yunqi.auth.check('app\\admin\\controller\\auth\\Depart','download'),
  37. },
  38. extend:{
  39. index_url: 'auth/depart/index',
  40. add_url: 'auth/depart/add',
  41. edit_url: 'auth/depart/edit',
  42. del_url: 'auth/depart/del',
  43. multi_url: 'auth/depart/multi',
  44. download_url: 'auth/depart/download',
  45. },
  46. columns:[
  47. {checkbox: true},
  48. {field: 'id',title: __('ID'),width:80},
  49. {field: 'name', title: __('名称'),align:'left'},
  50. {field: 'description', title: __('描述')},
  51. {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch},
  52. {treeExpand: true},
  53. {
  54. field: 'operate',
  55. title: __('操作'),
  56. width:150,
  57. action:{
  58. edit:true,
  59. del:true
  60. }
  61. }
  62. ]
  63. },
  64. methods: {
  65. }
  66. }
  67. </script>
  68. <style>
  69. </style>