Ver código fonte

Merge branch 'master-charge' of http://git.yujin.shuziyunyao.com/yujin/digital-medicine-front into master-charge

lisy 4 meses atrás
pai
commit
38cc62de21

+ 49 - 49
src/directive/common/copyText.ts

@@ -5,63 +5,63 @@
 import { DirectiveBinding } from 'vue';
 
 export default {
-  beforeMount(el: any, { value, arg }: DirectiveBinding) {
-    if (arg === 'callback') {
-      el.$copyCallback = value;
-    } else {
-      el.$copyValue = value;
-      const handler = () => {
-        copyTextToClipboard(el.$copyValue);
-        if (el.$copyCallback) {
-          el.$copyCallback(el.$copyValue);
+    beforeMount(el: any, { value, arg }: DirectiveBinding) {
+        if (arg === 'callback') {
+            el.$copyCallback = value;
+        } else {
+            el.$copyValue = value;
+            const handler = () => {
+                copyTextToClipboard(el.$copyValue);
+                if (el.$copyCallback) {
+                    el.$copyCallback(el.$copyValue);
+                }
+            };
+            el.addEventListener('click', handler);
+            el.$destroyCopy = () => el.removeEventListener('click', handler);
         }
-      };
-      el.addEventListener('click', handler);
-      el.$destroyCopy = () => el.removeEventListener('click', handler);
     }
-  }
 };
 
-function copyTextToClipboard(input: string, { target = document.body } = {}) {
-  const element = document.createElement('textarea');
-  const previouslyFocusedElement = document.activeElement as HTMLInputElement;
-  element.value = input;
-  // Prevent keyboard from showing on mobile
-  element.setAttribute('readonly', '');
+export function copyTextToClipboard(input: string, { target = document.body } = {}) {
+    const element = document.createElement('textarea');
+    const previouslyFocusedElement = document.activeElement as HTMLInputElement;
+    element.value = input;
+    // Prevent keyboard from showing on mobile
+    element.setAttribute('readonly', '');
 
-  element.style.contain = 'strict';
-  element.style.position = 'absolute';
-  element.style.left = '-9999px';
-  element.style.fontSize = '12pt'; // Prevent zooming on iOS
+    element.style.contain = 'strict';
+    element.style.position = 'absolute';
+    element.style.left = '-9999px';
+    element.style.fontSize = '12pt'; // Prevent zooming on iOS
 
-  const selection = document.getSelection();
-  let originalRange;
-  if (selection) {
-    originalRange = selection?.rangeCount > 0 && selection.getRangeAt(0);
-  }
-  target.append(element);
-  element.select();
+    const selection = document.getSelection();
+    let originalRange;
+    if (selection) {
+        originalRange = selection?.rangeCount > 0 && selection.getRangeAt(0);
+    }
+    target.append(element);
+    element.select();
 
-  // Explicit selection workaround for iOS
-  element.selectionStart = 0;
-  element.selectionEnd = input.length;
+    // Explicit selection workaround for iOS
+    element.selectionStart = 0;
+    element.selectionEnd = input.length;
 
-  let isSuccess = false;
-  try {
-    isSuccess = document.execCommand('copy');
-  } catch (err) {
-    console.error(err);
-  }
-  element.remove();
+    let isSuccess = false;
+    try {
+        isSuccess = document.execCommand('copy');
+    } catch (err) {
+        console.error(err);
+    }
+    element.remove();
 
-  if (originalRange) {
-    selection?.removeAllRanges();
-    selection?.addRange(originalRange);
-  }
+    if (originalRange) {
+        selection?.removeAllRanges();
+        selection?.addRange(originalRange);
+    }
 
-  // Get the focus back on the previously focused element, if any
-  if (previouslyFocusedElement) {
-    previouslyFocusedElement.focus();
-  }
-  return isSuccess;
+    // Get the focus back on the previously focused element, if any
+    if (previouslyFocusedElement) {
+        previouslyFocusedElement.focus();
+    }
+    return isSuccess;
 }

+ 10 - 4
src/views/training/meeting/index.vue

@@ -83,7 +83,7 @@
                             <template #default="{ row }">
                                 <el-switch v-model="row.pageEnable" active-value="1" inactive-value="0" @change="changePageEnable(row.id,row?.pageEnable)"></el-switch>
                                 <div v-if="+row.pageEnable" @click="ckeckpageEnable(row?.trainingName,row?.pageId,row?.id)" class="c-s-p">查看</div>
-                                <div @click="router.push({ path: 'ptpl-edit', query: { meetid: row?.id } })" class="c-s-p">去设置</div>
+                                <div v-else @click="router.push({ path: 'ptpl-edit', query: { meetid: row?.id } })" class="c-s-p">去设置</div>
                             </template>
                         </vxe-column>
                         <vxe-column field="certFlag" title="签到二维码" width="90" align="center">
@@ -149,6 +149,9 @@ import { offOrNoTemp, publishTraining, queryTrainingCount, trainingDelete, train
 import { colNoData } from '@/utils/noData';
 import { searchTabs } from '@/views/models';
 import { SignInCode, TemporaryRegistration } from '../models';
+import { copyTextToClipboard } from '@/directive/common/copyText';
+
+
 
 const router = useRouter();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -315,9 +318,12 @@ const ckeckpageEnable = (trainingName,pageId,id)=>{
 // 复制文本到剪贴板
 const copyToClipboard = async (text)=>{
   try {
-    await navigator.clipboard.writeText(text);
-    console.log('文本已成功复制到剪贴板');
-    return true;
+    const sc = copyTextToClipboard(text)
+    if (sc) {
+        ElMessage.success('复制成功');
+    } else {
+        ElMessage.error('复制失败,请手动复制');
+    }
   } catch (err) {
     console.error('无法复制文本: ', err);
     return false;

+ 26 - 18
src/views/training/models/meeting-detail-attend.vue

@@ -208,27 +208,35 @@
                     </div>
                 </template>
             </vxe-column>
-            <vxe-column v-if="form?.conditions?.totalCheck == '1' || form?.meetingCharge?.hasFee == '1'" title="操作" width="200" align="center" fixed="right">
+            <vxe-column v-if="form?.conditions?.totalCheck == '1' || form?.meetingCharge?.hasFee == '1'" title="操作" width="140" align="center" fixed="right">
                 <template #default="{ row }">
-                    <el-button type="danger" size="small" v-if="row?.res !== '0' && row?.signInFlag !=='1' && form?.conditions?.totalCheck == '1'&& row?.payStatus == '1' && form?.meetingCharge?.hasFee !== '1'" @click="openDialog(row)" style="color: white">重审</el-button>
-                    <el-button size="small" color="#33aeeb" @click="openDialog(row)" style="color: white" v-if="row?.res == '0' && form?.conditions?.totalCheck == '1' &&form?.trainingStatus !== '2'">审核</el-button>
-                    <el-button v-if="row.res=='3' || row.res== '5'" size="small" color="#e99d42" style="color: white;width: 80px;" @click="openModification(row)">修改费用金额</el-button>
-                    <el-button v-if="row.res== '5' && row?.payType=='2'" size="small" color="#81b337" style="color: white;width: 80px;" @click="openTransfer(row)">确认收到转账</el-button>
-                    <div v-if="row.payStatus == '1' && (row?.res == '0'|| row?.res == '2') && form?.trainingStatus == '2' && +row?.joinFee && row.payStatus !== '10'">用户报名未成功,请至微信商户号进行退款</div>
-                    <div v-if="row.payStatus === '10'">该报名已退款</div>
-                    <el-upload v-if="form?.trainingStatus == '2' && +row.joinFee && +row?.hasInvoice && !+row?.invoiceStatus && row.payStatus == '1' &&form?.meetingCharge?.hasFee =='1' && row?.res !== '0' && row?.res !== '2'" class="upload-demo" :action="uploadFileUrl" multiple :limit="1" :on-success="handleSuccess" :headers="headers" :show-file-list="false" accept=".pdf,.PDF">
-                        <el-button size="small" color="#33aeeb" style="color: white" @click=" invoiceId = row.id">上传发票</el-button>
-                    </el-upload>
-                    <el-upload v-if="form?.trainingStatus == '2' && +row.joinFee && +row?.hasInvoice && +row?.invoiceStatus && row.payStatus == '1' &&form?.meetingCharge?.hasFee =='1'&& row?.res !== '0' && row?.res !== '2'" class="upload-demo" :action="uploadFileUrl" multiple :limit="1" :on-success="handleSuccess" :headers="headers" :show-file-list="false" accept=".pdf,.PDF">
-                        <el-button type="primary" color="#33aeeb" style="color: white" @click=" invoiceId = row.id">重新上传</el-button>
-                    </el-upload>
-                    <el-button @click="openPersonnelLabel(row?.id)">设置人员标签</el-button>
-                    <el-button @click="opencontactPerson(row?.id,row)" v-if="!+row?.extendInfo?.contactInfo?.specifyConcatTel">设置联系人</el-button>
-                    <el-button @click="opencontactPerson(row?.id,row)" v-else>查看联系人</el-button>
+                    <div class="d-flex flex-cln">
+                        <el-button class="mb-10" type="danger" size="small" v-if="row?.res !== '0' && row?.signInFlag !=='1' && form?.conditions?.totalCheck == '1'&& row?.payStatus == '1' && form?.meetingCharge?.hasFee !== '1'" @click="openDialog(row)" style="color: white">重审</el-button>
+                        <span></span>
+                        <el-button class="mb-10" size="small" color="#33aeeb" @click="openDialog(row)" style="color: white" v-if="row?.res == '0' && form?.conditions?.totalCheck == '1' &&form?.trainingStatus !== '2'">审核</el-button>
+                        <span></span>
+                        <el-button class="mb-10" v-if="row.res=='3' || row.res== '5'" size="small" color="#e99d42" style="color: white;" @click="openModification(row)">修改费用金额</el-button>
+                        <span></span>
+                        <el-button class="mb-10" v-if="row.res== '5' && row?.payType=='2'" size="small" color="#81b337" style="color: white;" @click="openTransfer(row)">确认收到款项</el-button>
+                        <span></span>
+                        <div v-if="row.payStatus == '1' && (row?.res == '0'|| row?.res == '2') && form?.trainingStatus == '2' && +row?.joinFee && row.payStatus !== '10'">用户报名未成功,请至微信商户号进行退款</div>
+                        <div v-if="row.payStatus === '10'">该报名已退款</div>
+                        <el-upload v-if="form?.trainingStatus == '2' && +row.joinFee && +row?.hasInvoice && !+row?.invoiceStatus && row.payStatus == '1' &&form?.meetingCharge?.hasFee =='1' && row?.res !== '0' && row?.res !== '2'" class="upload-demo" :action="uploadFileUrl" multiple :limit="1" :on-success="handleSuccess" :headers="headers" :show-file-list="false" accept=".pdf,.PDF">
+                            <el-button class="mb-10" size="small" color="#33aeeb" style="color: white" @click=" invoiceId = row.id">上传发票</el-button>
+                        </el-upload>
+                        <span></span>
+                        <el-upload v-if="form?.trainingStatus == '2' && +row.joinFee && +row?.hasInvoice && +row?.invoiceStatus && row.payStatus == '1' &&form?.meetingCharge?.hasFee =='1'&& row?.res !== '0' && row?.res !== '2'" class="upload-demo" :action="uploadFileUrl" multiple :limit="1" :on-success="handleSuccess" :headers="headers" :show-file-list="false" accept=".pdf,.PDF">
+                            <el-button size="small" class="mb-10" type="primary" color="#33aeeb" style="color: white" @click=" invoiceId = row.id">重新上传</el-button>
+                        </el-upload>
+                        <el-button size="small" class="mb-10" @click="openPersonnelLabel(row?.id)">设置人员标签</el-button>
+                        <span></span>
+                        <el-button size="small" class="mb-10" @click="opencontactPerson(row?.id,row)" v-if="!+row?.extendInfo?.contactInfo?.specifyConcatTel">设置联系人</el-button>
+                        <el-button size="small" class="mb-10" @click="opencontactPerson(row?.id,row)" v-else>查看联系人</el-button>
+                    </div>
                 </template>
             </vxe-column>
         </vxe-table>
-        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" :pageSizes="[50, 100, 150, 500, 1000]" v-model:limit="queryParams.pageSize" @pagination="getList" />
     </div>
 
     <el-dialog v-model="dialogVisible" title="审核信息" width="500" center>
@@ -456,7 +464,7 @@ const query = useRoute().query;
 
 const queryParams = ref<any>({
     pageNum: 1,
-    pageSize: 10,
+    pageSize: 50,
     trainingId: query?.id || '',
     payStatus:'',
     payType:'',

+ 6 - 3
src/views/training/ptpl/edit/index.vue

@@ -15,7 +15,6 @@
                     <el-button @click="setBgMusic">设置背景音乐</el-button>
                     <el-button @click="router.go(-1)">取消</el-button>
                     <el-button @click="previewTpl" type="primary">预览</el-button>
-                    <el-button @click="publishTpl" type="success">发布</el-button>
                 </div>
             </div>
             <div class="flex1 ov-hd d-flex">
@@ -69,13 +68,17 @@ const activated = (item: any) => {
 };
 const selectItem = (item: any) => {
     form.value = { ...item };
+    curEvent.value = null;
 };
-const saveEevent = (item: any) => {
+const saveEevent = async (item: any) => {
     if (!form.value?.events || !form.value?.events.length) return;
     const index = form.value.events.findIndex((it: any) => it.id === item.id);
     if (index === -1) return;
-    form.value.events[index] = item;
+    const oldItem = form.value.events[index];
+    form.value.events[index] = { ...item, x: oldItem.x, y: oldItem.y, w: oldItem.w, h: oldItem.h };
     // 保存成功
+    const res: any = await httpRequests.post(`/dgtmedicine/trainpage/edit`, form.value);
+    if (!res || res.code !== 200) return;
     proxy?.$modal.msgSuccess('保存成功');
 };
 const deleteItemEvents = (item: any) => {