Browse Source

Merge branch 'master' of http://192.168.1.222:3000/jiayi/base-callcenter-web

miaofuhao 5 months ago
parent
commit
b2982f31d8
2 changed files with 172 additions and 0 deletions
  1. 20 0
      src/assets/style.css
  2. 152 0
      src/views/main/system/config/index.vue

+ 20 - 0
src/assets/style.css

@@ -710,6 +710,11 @@ video {
710 710
   margin-bottom: 0.5rem;
711 711
 }
712 712
 
713
+.my-4 {
714
+  margin-top: 1rem;
715
+  margin-bottom: 1rem;
716
+}
717
+
713 718
 .mb-1 {
714 719
   margin-bottom: 0.25rem;
715 720
 }
@@ -1242,6 +1247,11 @@ video {
1242 1247
   border-color: rgb(234 179 8 / var(--tw-border-opacity, 1));
1243 1248
 }
1244 1249
 
1250
+.border-blue-100 {
1251
+  --tw-border-opacity: 1;
1252
+  border-color: rgb(219 234 254 / var(--tw-border-opacity, 1));
1253
+}
1254
+
1245 1255
 .bg-blue-100 {
1246 1256
   --tw-bg-opacity: 1;
1247 1257
   background-color: rgb(219 234 254 / var(--tw-bg-opacity, 1));
@@ -1538,6 +1548,16 @@ video {
1538 1548
   line-height: 1rem;
1539 1549
 }
1540 1550
 
1551
+.text-lg\/7 {
1552
+  font-size: 1.125rem;
1553
+  line-height: 1.75rem;
1554
+}
1555
+
1556
+.text-sm\/6 {
1557
+  font-size: 0.875rem;
1558
+  line-height: 1.5rem;
1559
+}
1560
+
1541 1561
 .font-bold {
1542 1562
   font-weight: 700;
1543 1563
 }

+ 152 - 0
src/views/main/system/config/index.vue

@@ -0,0 +1,152 @@
1
+<template>
2
+    <div class="min-h-screen bg-gray-50 p-8">
3
+      <div class="mx-auto max-w-7xl">
4
+        <!-- 标题区域 -->
5
+        <div class="mb-8 bg-white rounded-lg p-6 shadow-sm">
6
+          <h1 class="text-3xl font-bold text-gray-900">业务设置</h1>
7
+          <p class="mt-2 text-gray-600">在此配置系统的业务规则和相关参数</p>
8
+        </div>
9
+        <!-- 配置卡片区域 -->
10
+        <div class="grid gap-6">
11
+          <!-- 多次来电配置 -->
12
+          <div class="rounded-lg bg-white p-6 shadow-sm">
13
+            <div class="mb-6 flex items-center justify-between">
14
+              <div>
15
+                <h2 class="text-xl font-semibold text-gray-900">重复来电配置</h2>
16
+                <p class="mt-1 text-sm text-gray-500">设置多次来电的触发条件</p>
17
+              </div>
18
+              <el-button
19
+                type="primary"
20
+                class="!rounded-button whitespace-nowrap"
21
+                @click="saveSettings"
22
+                :loading="saving"
23
+              >
24
+                保存配置
25
+              </el-button>
26
+            </div>
27
+            <div class="flex items-center space-x-4">
28
+              <div class="flex items-center">
29
+                <el-input
30
+                  v-model="dayCount"
31
+                  type="number"
32
+                  :min="1"
33
+                  :max="365"
34
+                  class="w-24"
35
+                  @change="validateDayCount"
36
+                >
37
+                  <template #append>天</template>
38
+                </el-input>
39
+              </div>
40
+              <span class="text-gray-600">内超过</span>
41
+              <div class="flex items-center">
42
+                <el-input
43
+                  v-model="callCount"
44
+                  type="number"
45
+                  :min="1"
46
+                  :max="100"
47
+                  class="w-24"
48
+                  @change="validateCallCount"
49
+                >
50
+                  <template #append>次</template>
51
+                </el-input>
52
+              </div>
53
+              <span class="text-gray-600">来电</span>
54
+            </div>
55
+            <div class="mt-4 text-sm text-gray-500">
56
+              注:当客户在设定天数内的来电次数超过设定值时,系统将自动标记为重复来电客户。
57
+            </div>
58
+          </div>
59
+          <!-- 保存成功提示 -->
60
+          <el-dialog
61
+            v-model="showSuccessDialog"
62
+            title="保存成功"
63
+            width="30%"
64
+            :show-close="false"
65
+            center
66
+          >
67
+            <div class="flex items-center justify-center py-4">
68
+              <el-icon class="mr-2 text-green-500"><CircleCheckFilled /></el-icon>
69
+              <span>配置已成功保存</span>
70
+            </div>
71
+            <template #footer>
72
+              <div class="flex justify-center">
73
+                <el-button
74
+                  type="primary"
75
+                  class="!rounded-button whitespace-nowrap"
76
+                  @click="showSuccessDialog = false"
77
+                >
78
+                  确定
79
+                </el-button>
80
+              </div>
81
+            </template>
82
+          </el-dialog>
83
+        </div>
84
+      </div>
85
+    </div>
86
+</template>
87
+  
88
+<script lang="ts" setup>
89
+import { ref } from "vue";
90
+import { ElMessage } from "element-plus";
91
+import { CircleCheckFilled } from "@element-plus/icons-vue";
92
+const dayCount = ref<number | null>(7);
93
+const callCount = ref<number | null>(3);
94
+const saving = ref(false);
95
+const showSuccessDialog = ref(false);
96
+const validateDayCount = (value: number) => {
97
+  if (value < 1) {
98
+    dayCount.value = 1;
99
+    ElMessage.warning("天数不能小于1天");
100
+  } else if (value > 365) {
101
+    dayCount.value = 365;
102
+    ElMessage.warning("天数不能超过365天");
103
+  }
104
+};
105
+const validateCallCount = (value: number) => {
106
+  if (value < 1) {
107
+    callCount.value = 1;
108
+    ElMessage.warning("次数不能小于1次");
109
+  } else if (value > 100) {
110
+    callCount.value = 100;
111
+    ElMessage.warning("次数不能超过100次");
112
+  }
113
+};
114
+const saveSettings = async () => {
115
+  if (!dayCount.value || !callCount.value) {
116
+    ElMessage.error("请填写完整的配置信息");
117
+    return;
118
+  }
119
+  saving.value = true;
120
+  try {
121
+    // 模拟保存操作
122
+    await new Promise((resolve) => setTimeout(resolve, 1000));
123
+    showSuccessDialog.value = true;
124
+  } catch (error) {
125
+    ElMessage.error("保存失败,请重试");
126
+  } finally {
127
+    saving.value = false;
128
+  }
129
+};
130
+</script>
131
+
132
+<style scoped>
133
+.el-input-number :deep(.el-input__wrapper) {
134
+  padding-right: 0;
135
+}
136
+.el-input :deep(.el-input__wrapper) {
137
+  box-shadow: 0 0 0 1px #e5e7eb inset;
138
+}
139
+.el-input :deep(.el-input__wrapper):hover {
140
+  box-shadow: 0 0 0 1px #d1d5db inset;
141
+}
142
+.el-input :deep(.el-input__wrapper.is-focus) {
143
+  box-shadow: 0 0 0 1px #409eff inset;
144
+}
145
+.el-input :deep(.el-input-group__append) {
146
+  background-color: #f3f4f6;
147
+  border-left: 1px solid #e5e7eb;
148
+  color: #374151;
149
+  padding: 0 12px;
150
+}
151
+</style>
152
+