luzhenxing 3 달 전
부모
커밋
9582a817c4

+ 10 - 3
README.En.md

@@ -1,3 +1,10 @@
-<div align="center">
-<h1>Gooki wechat admin</h1>
-</div>
+# Gooki wechat admin
+
+## install
+> pnpm install
+
+## dev
+> pnpm dev
+
+## build
+> pnpm build

+ 10 - 3
README.md

@@ -1,3 +1,10 @@
-<div align="center">
-<h1>冠客微信管理后台</h1>
-</div>
+# 冠客微信管理后台
+
+## 安装
+> pnpm install
+
+## 开发
+> pnpm dev
+
+## 编译
+> pnpm build

+ 1 - 1
internal/vite-config/dist/index.d.ts

@@ -1 +1 @@
-export * from "/Users/songbowen/Development/Project/gooki/scrm/wechat-ui/internal/vite-config/src/index";
+export * from "/Users/qyer/code/wechat-ui/internal/vite-config/src/index.js";

+ 4 - 4
internal/vite-config/dist/index.mjs

@@ -1,13 +1,13 @@
-import jiti from "file:///Users/songbowen/Development/Project/gooki/scrm/wechat-ui/node_modules/.pnpm/jiti@1.21.6/node_modules/jiti/lib/index.js";
+import jiti from "../../../node_modules/.pnpm/jiti@1.21.6/node_modules/jiti/lib/index.js";
 
 /** @type {import("/Users/songbowen/Development/Project/gooki/scrm/wechat-ui/internal/vite-config/src/index")} */
 const _module = jiti(null, {
   "esmResolve": true,
   "interopDefault": true,
   "alias": {
-    "@vben/vite-config": "/Users/songbowen/Development/Project/gooki/scrm/wechat-ui/internal/vite-config"
+    "@vben/vite-config": "/Users/qyer/code/wechat-ui/internal/vite-config"
   }
-})("/Users/songbowen/Development/Project/gooki/scrm/wechat-ui/internal/vite-config/src/index.ts");
+})("/Users/qyer/code/wechat-ui/internal/vite-config/src/index.ts");
 
 export const defineApplicationConfig = _module.defineApplicationConfig;
-export const definePackageConfig = _module.definePackageConfig;
+export const definePackageConfig = _module.definePackageConfig;

+ 2 - 2
src/api/wechat/wx.ts

@@ -6,7 +6,7 @@ import { WxInfo, WxListResp } from './model/wxModel';
 enum Api {
   CreateWx = '/wechat-api/wx/create',
   CheckWx = '/wechat-api/wx/check',
-  UpdateWx = '/wechat-api/wx/update',  
+  UpdateWx = '/wechat-api/wx/update',
   GetWxList = '/wechat-api/wx/list',
   DeleteWx = '/wechat-api/wx/delete',
   GetWxById = '/wechat-api/wx',
@@ -120,4 +120,4 @@ export const updataBlackWhiteList = (params: BaseIDReq, mode: ErrorMessageMode =
       errorMessageMode: mode,
     },
   );
-};
+};

+ 3 - 0
src/locales/lang/en/common.ts

@@ -46,9 +46,12 @@ export default {
   value: 'Value',
   source: 'Source',
   expiredAt: 'Expired Time',
+
+  qrcode: 'QR code',
   // action
   start: 'Start',
   stop: 'Stop',
+  edit: 'Edit',
   delete: 'Delete',
   submit: 'Submit',
   // notification

+ 3 - 0
src/locales/lang/zh-CN/common.ts

@@ -46,9 +46,12 @@ export default {
   value: '值',
   source: '来源',
   expiredAt: '过期时间',
+
+  qrcode: '二维码',
   // action
   start: '开始',
   stop: '停止',
+  edit: '编辑',
   delete: '删除',
   submit: '提交',
   // notification

+ 12 - 0
src/views/wechat/agent/agent.data.ts

@@ -111,6 +111,10 @@ export const formSchema: FormSchema[] = [
     required: true,
     componentProps: {
       showCount: false,
+      autosize: {
+        minRows: 2,
+        maxRows: 10
+      }
     },
     rules: [],
   },
@@ -121,6 +125,10 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       maxlength: 1000,
       showCount: true,
+      autosize: {
+        minRows: 2,
+        maxRows: 10
+      }
     },
     rules: [{ max: 1000 }],
   },
@@ -131,6 +139,10 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       maxlength: 5000,
       showCount: true,
+      autosize: {
+        minRows: 2,
+        maxRows: 10
+      }
     },
     rules: [{ max: 5000 }],
   },

+ 1 - 1
src/views/wechat/employee/EmployeeDrawer.vue

@@ -569,4 +569,4 @@
     pointer-events: none;
     opacity: 0.5;
   }
-</style>
+</style>

+ 50 - 41
src/views/wechat/sop_task/add_sop/components/sopTaskName.vue

@@ -67,7 +67,12 @@
                 @change="handleTableChange"
               >
                 <template #bodyCell="{ column, record }">
-                  <template v-if="column.key === 'actions'">
+                  <Flex v-if="column.key === 'nickname'" gap="small">
+                    <WechatOutlined :style="{ fontSize: '20px', color: '#00BB29' }" />
+                    <span>{{ record.nickname }}</span>
+                    <Tag :color="record.status === 1 ? 'green' : 'red'">{{ record.status === 1 ? '在线' : '离线' }}</Tag>
+                  </Flex>
+                  <!-- <template v-else-if="column.key === 'actions'">
                     <Popconfirm
                       title="确定要设定发送人吗?"
                       @confirm="() => confirmSend(record.id)"
@@ -86,7 +91,7 @@
                         取消设置
                       </Button>
                     </Popconfirm>
-                  </template>
+                  </template> -->
                 </template>
               </Table>
             </div>
@@ -114,7 +119,7 @@
   import { useGo } from '/@/hooks/web/usePage';
   import { PageEnum } from '@/enums/pageEnum';
   import dayjs from 'dayjs';
-  import { Form, Input, FormItem, Radio, Button, DatePicker, Modal, Alert, Table, Popconfirm, Spin,} from 'ant-design-vue';
+  import { Form, Input, FormItem, Radio, Button, DatePicker, Modal, Alert, Table, Popconfirm, Spin, Tag, Flex } from 'ant-design-vue';
   import { useStore } from '../stores/index';
 
   let stageList = ref([]);
@@ -149,30 +154,34 @@
     current: 1,
   });
 
-  function handleSaveDraft() {
-    console.log('点击草稿状态');
-    go(PageEnum.SOP_LIST);
-  }
-  async function confirmSend(id) {
-    if (!selectedRowKeys.value.includes(id)) {
-      selectedRowKeys.value.push(id);
-    }
-    console.log('发送按钮', rowSelection, selectedRowKeys.value);
-  }
+  // function handleSaveDraft() {
+  //   console.log('点击草稿状态');
+  //   go(PageEnum.SOP_LIST);
+  // }
+  // async function confirmSend(id) {
+  //   if (!selectedRowKeys.value.includes(id)) {
+  //     selectedRowKeys.value.push(id);
+  //   }
+  //   console.log('发送按钮', rowSelection, selectedRowKeys.value);
+  // }
 
-  async function confirmCancel(id) {
-    const index = selectedRowKeys.value.indexOf(id);
-    if (index > -1) {
-      selectedRowKeys.value.splice(index, 1);
-    }
-    console.log('取消按钮', rowSelection, selectedRowKeys.value);
-  }
+  // async function confirmCancel(id) {
+  //   const index = selectedRowKeys.value.indexOf(id);
+  //   if (index > -1) {
+  //     selectedRowKeys.value.splice(index, 1);
+  //   }
+  //   console.log('取消按钮', rowSelection, selectedRowKeys.value);
+  // }
 
   let rowSelection = reactive({
     selectedRowKeys: selectedRowKeys.value,
     onChange: (newSelectedRowKeys) => {
       selectedRowKeys.value = newSelectedRowKeys;
     },
+    getCheckboxProps: (record) => ({
+      disabled: record.status === 0, // Column configuration not to be checked
+      // name: record.name,
+    })
   });
 
   watch(selectedRowKeys, (newVal) => {
@@ -223,32 +232,32 @@
       title: '社交昵称',
       dataIndex: 'nickname',
       key: 'nickname',
-      customRender: ({ record }) => {
-        return h('span', [
-          h(WechatOutlined, {
-            style: { marginRight: '8px', fontSize: '20px', color: '#00BB29' },
-          }), // 使用微信图标
-          record.nickname,
-          h(
-            'span',
-            {
-              style:
-                'margin-left: 8px; color: #13ce66;background-color: #e7faf0;display:inline-block;border:1px solid #d0f5e0;line-height:22px;padding: 0px 8px;border-radius: 4px;font-size: 12px;',
-            },
-            '在线',
-          ),
-        ]);
-      },
+      // customRender: ({ record }) => {
+      //   return h('span', [
+      //     h(WechatOutlined, {
+      //       style: { marginRight: '8px', fontSize: '20px', color: '#00BB29' },
+      //     }), // 使用微信图标
+      //     record.nickname,
+      //     h(
+      //       'span',
+      //       {
+      //         style:
+      //           'margin-left: 8px; color: #13ce66;background-color: #e7faf0;display:inline-block;border:1px solid #d0f5e0;line-height:22px;padding: 0px 8px;border-radius: 4px;font-size: 12px;',
+      //       },
+      //       '在线',
+      //     ),
+      //   ]);
+      // },
     },
     {
       title: '社交账号',
       dataIndex: 'account',
       key: 'account',
     },
-    {
-      title: '操作',
-      key: 'actions',
-    },
+    // {
+    //   title: '操作',
+    //   key: 'actions',
+    // },
   ];
 
   async function handlePublish() {
@@ -533,4 +542,4 @@
     position: absolute;
     left: 0;
   }
-</style>
+</style>

+ 49 - 21
src/views/wechat/wx_card/index.vue

@@ -20,32 +20,49 @@
       <template #bodyCell="{ column, record }">
         <template v-if="column.key === 'action'">
           <TableAction
-            :actions="[
-              {
-                icon: 'clarity:note-edit-line',
-                onClick: handleEdit.bind(null, record),
+            :actions="[{
+              label: t('common.qrcode'),
+              onClick: handelPreviewVcode.bind(null, record)
+            }, {
+              // icon: 'clarity:note-edit-line',
+              label: t('common.edit'),
+              onClick: handleEdit.bind(null, record),
+            }, {
+              // icon: 'ant-design:delete-outlined',
+              // color: 'error',
+              label: t('common.delete'),
+              popConfirm: {
+                title: t('common.deleteConfirm'),
+                placement: 'left',
+                confirm: handleDelete.bind(null, record),
               },
-              {
-                icon: 'ant-design:delete-outlined',
-                color: 'error',
-                popConfirm: {
-                  title: t('common.deleteConfirm'),
-                  placement: 'left',
-                  confirm: handleDelete.bind(null, record),
-                },
-              },
-            ]"
+            }]"
           />
         </template>
       </template>
     </BasicTable>
     <WxCardDrawer @register="registerDrawer" @success="handleSuccess" />
+    <Modal
+      v-model:open="modalVisible"
+      title="二维码"
+      class="custom-modal"
+    >
+      <Flex justify="center">
+        <Image :src="qrcodeSrc" width="280px" height="280px" :preview="false">
+          <template #placeholder>
+            <Flex align="center" justify="center">
+              <LoadingOutlined />
+            </Flex>
+          </template>
+        </Image>
+      </Flex>
+    </Modal>
   </div>
 </template>
 <script lang="ts">
-  import { createVNode, defineComponent, ref } from 'vue';
-  import { Modal } from 'ant-design-vue';
-  import { ExclamationCircleOutlined } from '@ant-design/icons-vue/lib/icons';
+  import { createVNode, defineComponent, ref, h } from 'vue';
+  import { Modal, Image, Flex } from 'ant-design-vue';
+  import { ExclamationCircleOutlined, LoadingOutlined } from '@ant-design/icons-vue/lib/icons';
   import { BasicTable, useTable, TableAction } from '@/components/Table';
   import { Button } from '@/components/Button';
 
@@ -58,11 +75,13 @@
 
   export default defineComponent({
     name: 'WxCardManagement',
-    components: { BasicTable, WxCardDrawer, TableAction, Button },
+    components: { BasicTable, WxCardDrawer, TableAction, Button, Modal, Image, Flex, LoadingOutlined },
     setup() {
       const { t } = useI18n();
       const selectedIds = ref<number[] | string[]>();
       const showDeleteButton = ref<boolean>(false);
+      const modalVisible = ref<boolean>(false)
+      const qrcodeSrc = ref('')
 
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerTable, { reload }] = useTable({
@@ -79,15 +98,15 @@
         showIndexColumn: false,
         clickToRowSelect: false,
         actionColumn: {
-          width: 30,
+          width: 200,
           title: t('common.action'),
           dataIndex: 'action',
-          fixed: undefined,
+          fixed: 'right',
         },
         rowKey: 'id',
         rowSelection: {
           type: 'checkbox',
-          columnWidth: 20,
+          columnWidth: 30,
           onChange: (selectedRowKeys, _selectedRows) => {
             selectedIds.value = selectedRowKeys as number[];
             showDeleteButton.value = selectedRowKeys.length > 0;
@@ -101,6 +120,12 @@
         });
       }
 
+      async function handelPreviewVcode(record: Recordable) {
+        const src = `https://wxadminapi.gkscrm.com/wechat-api/api/card/qrcode?path=pages/chatInfo/index?card_id=${record.id}&width=50&envVersion=release`;
+        qrcodeSrc.value = src
+        modalVisible.value = true
+      }
+
       function handleEdit(record: Recordable) {
         openDrawer(true, {
           record,
@@ -138,9 +163,12 @@
 
       return {
         t,
+        modalVisible,
+        qrcodeSrc,
         registerTable,
         registerDrawer,
         handleCreate,
+        handelPreviewVcode,
         handleEdit,
         handleDelete,
         handleSuccess,

+ 1 - 1
src/views/wechat/wx_card/wxCard.data.ts

@@ -83,7 +83,7 @@ export const columns: BasicColumn[] = [
   {
     title: t('common.createTime'),
     dataIndex: 'createdAt',
-    width: 70,
+    width: 120,
     customRender: ({ record }) => {
       return formatToDateTime(record.createdAt);
     },