浏览代码

Merge commit 'refs/pull/388/head' of https://gitee.com/zuohuaijun/Admin.NET into next

zuohuaijun 3 年之前
父节点
当前提交
77d0644850
共有 1 个文件被更改,包括 25 次插入24 次删除
  1. 25 24
      Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm

+ 25 - 24
Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm

@@ -17,28 +17,30 @@ if(@column.EffectType == "Upload"){
       </template>
 }
 }
-      <template #action="{ record }">
-        <TableAction
-          :actions="[
-            {
-              icon: 'clarity:note-edit-line',
-              label: '编辑',
-              onClick: handleEdit.bind(null, record),
-              disabled: !hasPermission('@(@Model.ClassName):edit'),
-            },
-            {
-              icon: 'ant-design:delete-outlined',
-              color: 'error',
-              label: '删除',
-              ifShow: hasPermission('@(@Model.ClassName):delete'),
-              popConfirm: {
-                title: '是否确认删除',
-                placement: 'left',
-                confirm: handleDelete.bind(null, record),
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.key === 'action'">
+          <TableAction
+            :actions="[
+              {
+                icon: 'clarity:note-edit-line',
+                label: '编辑',
+                onClick: handleEdit.bind(null, record),
+                disabled: !hasPermission('@(@Model.ClassName):edit'),
               },
-            },
-          ]"
-        />
+              {
+                icon: 'ant-design:delete-outlined',
+                color: 'error',
+                label: '删除',
+                ifShow: hasPermission('@(@Model.ClassName):delete'),
+                popConfirm: {
+                  title: '是否确认删除',
+                  placement: 'left',
+                  confirm: handleDelete.bind(null, record),
+                },
+              },
+            ]"
+          />
+        </template>
       </template>
     </BasicTable>
     <@(@Model.ClassName)Modal @@register="registerModal" @@success="handleSuccess" />
@@ -68,8 +70,7 @@ if(@column.EffectType == "Upload"){
       const { hasPermission } = usePermission();
       const { createMessage } = useMessage();
       const [registerModal, { openModal }] = useModal();
-	  
-      const hasPage = hasPermission('@(@Model.ClassName):page');
+	  const hasPage = hasPermission('@(@Model.ClassName):page');
       const [registerTable, { reload }] = useTable({
         title: '@(@Model.BusName)列表',
         api: get@(@Model.ClassName)PageList,
@@ -90,7 +91,7 @@ if(@column.EffectType == "Upload"){
           width: 160,
           title: '操作',
           dataIndex: 'action',
-          slots: { customRender: 'action' },
+          //slots: { customRender: 'action' },
         },
       });