tangning 2 anni fa
parent
commit
61d54bda70
1 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  1. 12 1
      src/views/operate/caseList.vue

+ 12 - 1
src/views/operate/caseList.vue

@@ -31,6 +31,12 @@
                 onClick: handlePublish.bind(null, record),
               },
               {
+                label: '预览',
+                //icon: 'ep:edit',
+                ifShow: getCheckPerm('case-preview'),
+                onClick: handlePreview.bind(null, record),
+              },
+              {
                 label: '编辑',
                 //icon: 'ep:edit',
                 ifShow: getCheckPerm('case-edit') && record.isPublic == 0,
@@ -274,7 +280,7 @@ export default defineComponent({
         return T;
       },
       actionColumn: {
-        width: 220,
+        width: 230,
         title: '操作',
         dataIndex: 'action',
         slots: { customRender: 'action' },
@@ -296,6 +302,10 @@ export default defineComponent({
       console.log('点击了编辑', record);
       openModal(true, {...record,language});
     }
+    function handlePreview(record: Recordable) {
+      let url = window.location.host == 'www.4dkankan.com'?`https://www.4dkankan.com/#/cases/detail/${record.id}`:`https://test.4dkankan.com/#/cases/detail/${record.id}`
+      window.open(url, "_blank")
+    }
     async function handleWithdraw(record: Recordable) {
       await casePublicApi({ id: record.id, isPublic: 0 });
       createMessage.success(t('common.optSuccess'));
@@ -321,6 +331,7 @@ export default defineComponent({
       register,
       openModal,
       getCheckPerm,
+      handlePreview,
     };
   },
 });