x1ongzhu před 1 rokem
rodič
revize
2a7a562a20
4 změnil soubory, kde provedl 533 přidání a 332 odebrání
  1. 22 22
      package.json
  2. 12 2
      src/components/PagingTable.vue
  3. 22 15
      src/views/TaskView.vue
  4. 477 293
      yarn.lock

+ 22 - 22
package.json

@@ -11,35 +11,35 @@
   },
   "dependencies": {
     "@vicons/tabler": "^0.12.0",
-    "@vueuse/core": "^10.1.0",
-    "axios": "^1.3.6",
-    "date-fns": "^2.29.3",
-    "element-plus": "^2.3.3",
+    "@vueuse/core": "^10.11.0",
+    "axios": "^1.7.2",
+    "date-fns": "^3.6.0",
+    "element-plus": "^2.7.7",
     "file-saver": "^2.0.5",
     "moment": "^2.30.1",
     "moment-timezone": "^0.5.45",
-    "pinia": "^2.0.32",
-    "qs": "^6.11.1",
+    "pinia": "^2.1.7",
+    "qs": "^6.12.3",
     "resolve-url": "^0.2.1",
-    "socket.io-client": "^4.7.2",
-    "vue": "^3.3.0",
+    "socket.io-client": "^4.7.5",
+    "vue": "^3.4.33",
     "vue-json-viewer": "3",
-    "vue-router": "^4.1.6"
+    "vue-router": "^4.4.0"
   },
   "devDependencies": {
-    "@rushstack/eslint-patch": "^1.2.0",
-    "@vitejs/plugin-vue": "^4.0.0",
+    "@rushstack/eslint-patch": "^1.10.3",
+    "@vitejs/plugin-vue": "^5.0.5",
     "@volar-plugins/prettier": "^2.0.0",
-    "@vue/eslint-config-prettier": "^7.1.0",
-    "autoprefixer": "^10.4.14",
-    "eslint": "^8.34.0",
-    "eslint-plugin-vue": "^9.9.0",
-    "less": "^4.1.3",
-    "postcss": "^8.4.23",
-    "prettier": "^2.8.4",
-    "tailwindcss": "^3.3.1",
-    "unplugin-auto-import": "^0.15.3",
-    "unplugin-vue-components": "^0.24.1",
-    "vite": "^4.1.4"
+    "@vue/eslint-config-prettier": "^9.0.0",
+    "autoprefixer": "^10.4.19",
+    "eslint": "^9.7.0",
+    "eslint-plugin-vue": "^9.27.0",
+    "less": "^4.2.0",
+    "postcss": "^8.4.39",
+    "prettier": "^3.3.3",
+    "tailwindcss": "^3.4.6",
+    "unplugin-auto-import": "^0.18.0",
+    "unplugin-vue-components": "^0.27.3",
+    "vite": "^5.3.4"
   }
 }

+ 12 - 2
src/components/PagingTable.vue

@@ -3,7 +3,14 @@
         <slot name="filter"></slot>
     </div>
     <ElConfigProvider :size="isMobile ? '' : 'small'">
-        <ElTable :data="tableData" :height="height || tableHeight" stripe v-loading="loading" v-bind="$attrs" ref="tableEl">
+        <ElTable
+            :data="tableData"
+            :height="height || tableHeight"
+            stripe
+            v-loading="loading"
+            v-bind="$attrs"
+            ref="tableEl"
+        >
             <slot></slot>
         </ElTable>
     </ElConfigProvider>
@@ -14,7 +21,7 @@
             v-model:page-size="pageConfig.pageSize"
             v-model:current-page="page"
             :total="total"
-            :small="!isMobile"
+            :size="isMobile ? 'default' : 'small'"
         />
     </div>
 </template>
@@ -117,5 +124,8 @@ defineExpose({
         margin-bottom: 15px;
         margin-right: 15px;
     }
+    :deep(.el-select) {
+        width: 200px !important;
+    }
 }
 </style>

+ 22 - 15
src/views/TaskView.vue

@@ -2,7 +2,9 @@
     <PagingTable url="/task" :where="where" ref="table" @row-click="rowClick" :stripe="false">
         <template #filter>
             <ElButton :icon="Refresh" @click="table.refresh()"></ElButton>
-            <ElButton :icon="Plus" @click="onEdit({ checkConnection: true }), getPhoneList()"> 添加</ElButton>
+            <ElButton :icon="Plus" @click="onEdit({ checkConnection: true, useBackup: true }), getPhoneList()">
+                添加
+            </ElButton>
         </template>
         <ElTableColumn type="expand">
             <template #default="{ row }">
@@ -204,6 +206,9 @@
         <ElFormItem v-if="isAdmin" prop="checkConnection" label="检查连接">
             <ElSwitch v-model="model.checkConnection" />
         </ElFormItem>
+        <ElFormItem v-if="isAdmin" prop="useBackup" label="使用备份">
+            <ElSwitch v-model="model.useBackup" />
+        </ElFormItem>
     </EditDialog>
 
     <ElDialog v-model="showDetailDialog" title="详情" width="800px">
@@ -269,7 +274,8 @@ const isAdminOrApi = inject('isAdminOrApi')
 const timeFormatter = useTimeFormatter()
 const table = ref(null)
 const model = ref({
-    checkConnection: true
+    checkConnection: true,
+    useBackup: true
 })
 const rules = {
     name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
@@ -280,7 +286,8 @@ const rules = {
     rcsInterval: [{ required: false, message: '请输入RCS发送间隔', trigger: 'blur' }],
     cleanCount: [{ required: false, message: '请输入清理数量', trigger: 'blur' }],
     requestNumberInterval: [{ required: false, message: '请输入请求号码间隔', trigger: 'blur' }],
-    checkConnection: [{ required: false, message: '请选择是否检查连接', trigger: 'blur' }]
+    checkConnection: [{ required: false, message: '请选择是否检查连接', trigger: 'blur' }],
+    useBackup: [{ required: false, message: '请选择是否使用备份', trigger: 'blur' }]
 }
 const { showEditDialog, onEdit } = setupEditDialog(model)
 
@@ -293,17 +300,17 @@ onMounted(() => {
 
 const startedTimeFormatter = (row, column, value, index) => {
     if (row.status !== 'idle') {
-        return timeFormatter(row, column, value, index);
+        return timeFormatter(row, column, value, index)
     }
-    return '';
-};
+    return ''
+}
 
 const updatedTimeFormatter = (row, column, value, index) => {
     if (row.status === 'completed') {
-        return timeFormatter(row, column, value, index);
+        return timeFormatter(row, column, value, index)
     }
-    return '';
-};
+    return ''
+}
 
 function rowClick(row, column) {
     table.value.tableEl.toggleRowExpansion(row)
@@ -315,12 +322,12 @@ async function submit() {
         dynamicMessage: model.value.id
             ? model.value.dynamicMessage
             : model.value.dynamicMessage?.map((item) => ({
-            key: item.key,
-            values: item.values
-                .split('\n')
-                .map((v) => v.trim())
-                .filter((v) => !!v)
-        })) || [],
+                  key: item.key,
+                  values: item.values
+                      .split('\n')
+                      .map((v) => v.trim())
+                      .filter((v) => !!v)
+              })) || [],
         userId: user.value.id
     })
     if (result) {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 477 - 293
yarn.lock


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů