cnhis-design-vue 2.1.17 → 2.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +2219 -2219
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +164 -164
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +32 -32
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +1 -1
  32. package/es/empty/index.js +8 -8
  33. package/es/fabric-chart/index.js +34 -34
  34. package/es/form/index.js +8 -8
  35. package/es/form-model/index.js +8 -8
  36. package/es/form-table/index.js +62 -62
  37. package/es/index/index.js +672 -657
  38. package/es/index/style.css +1 -1
  39. package/es/input/index.js +9 -9
  40. package/es/input-number/index.js +8 -8
  41. package/es/layout/index.js +8 -8
  42. package/es/list/index.js +8 -8
  43. package/es/locale-provider/index.js +8 -8
  44. package/es/map/index.js +9 -9
  45. package/es/mentions/index.js +8 -8
  46. package/es/menu/index.js +8 -8
  47. package/es/message/index.js +8 -8
  48. package/es/multi-chat/index.js +92 -92
  49. package/es/multi-chat-client/index.js +86 -86
  50. package/es/multi-chat-history/index.js +4 -4
  51. package/es/multi-chat-record/index.js +14 -14
  52. package/es/multi-chat-setting/index.js +81 -66
  53. package/es/multi-chat-setting/style.css +1 -1
  54. package/es/multi-chat-sip/index.js +1 -1
  55. package/es/notification/index.js +8 -8
  56. package/es/page-header/index.js +8 -8
  57. package/es/pagination/index.js +8 -8
  58. package/es/popconfirm/index.js +8 -8
  59. package/es/popover/index.js +8 -8
  60. package/es/progress/index.js +8 -8
  61. package/es/radio/index.js +9 -9
  62. package/es/rate/index.js +8 -8
  63. package/es/result/index.js +8 -8
  64. package/es/row/index.js +8 -8
  65. package/es/scale-view/index.js +33 -33
  66. package/es/select/index.js +11 -11
  67. package/es/select-label/index.js +11 -11
  68. package/es/select-person/index.js +20 -20
  69. package/es/skeleton/index.js +8 -8
  70. package/es/slider/index.js +8 -8
  71. package/es/space/index.js +8 -8
  72. package/es/spin/index.js +8 -8
  73. package/es/statistic/index.js +8 -8
  74. package/es/steps/index.js +8 -8
  75. package/es/switch/index.js +8 -8
  76. package/es/table-filter/index.js +118 -118
  77. package/es/tabs/index.js +8 -8
  78. package/es/tag/index.js +9 -9
  79. package/es/time-picker/index.js +8 -8
  80. package/es/timeline/index.js +8 -8
  81. package/es/tooltip/index.js +8 -8
  82. package/es/transfer/index.js +8 -8
  83. package/es/tree/index.js +8 -8
  84. package/es/tree-select/index.js +8 -8
  85. package/es/upload/index.js +8 -8
  86. package/es/verification-code/index.js +2 -2
  87. package/lib/cui.common.js +620 -605
  88. package/lib/cui.umd.js +620 -605
  89. package/lib/cui.umd.min.js +71 -71
  90. package/package.json +106 -106
  91. package/packages/big-table/src/BigTable.vue +3038 -3038
  92. package/packages/big-table/src/assets/style/table-base.less +370 -370
  93. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  94. package/packages/big-table/src/utils/batchEditing.js +610 -610
  95. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  96. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  97. package/packages/button/src/ButtonPrint/index.vue +728 -728
  98. package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -1
  99. package/packages/fabric-chart/src/components/TimeScaleValue.vue +117 -117
  100. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  101. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +960 -960
  102. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  103. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  104. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  105. package/packages/multi-chat/chat/chatFooter.vue +1598 -1598
  106. package/packages/multi-chat/chat/chatMain.vue +1442 -1442
  107. package/packages/multi-chat/chat/quickReply.vue +439 -439
  108. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  109. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1302
  110. package/packages/multi-chat/store/actions.js +448 -448
  111. package/packages/multi-chat/store/state.js +112 -112
  112. package/packages/scale-view/formitem/r-choice.vue +714 -714
  113. package/packages/scale-view/scaleView.vue +2010 -2010
  114. package/packages/select-person/select-person.vue +1658 -1658
  115. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  116. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  117. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  118. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  119. package/packages/table-filter/src/const/dataOptions.js +43 -43
  120. package/packages/table-filter/src/mixins/mixins.js +695 -695
  121. package/packages/table-filter/src/quick-search/QuickSearch.vue +2083 -2083
  122. package/src/directive/preventReClick.js +12 -12
@@ -1,1302 +1,1316 @@
1
- <template>
2
- <div class="chat-base-info">
3
- <h3 class="page-title">{{ i18nText('2.4.3.1') }}</h3>
4
- <div class="main-form">
5
- <a-form :form="form">
6
- <div class="functional-module" v-if="!isStaff">
7
- <span class="title">{{ i18nText('1.9.401') }}</span>
8
- <a-form-item>
9
- <a-checkbox @change="handleTimeSettingShow" :checked="showTimeSetting">{{ i18nText('1.9.402') }}</a-checkbox>
10
- <a-checkbox v-model="readStatus">已读回执</a-checkbox>
11
- <a-checkbox v-model="lineUpNotice">排队提醒</a-checkbox>
12
- </a-form-item>
13
- <template v-if="showTimeSetting">
14
- <a-row class="time-setting">
15
- <a-col :span="12">
16
- <a-form-item :label="i18nText('1.9.403')">
17
- <a-select v-decorator="['timeLength']" :placeholder="i18nText('1.9.404')" style="width: 200px;" showSearch>
18
- <a-select-option v-for="time in timeLengths" :key="time" :value="time">{{ time }}</a-select-option>
19
- </a-select>
20
- {{ i18nText('2.2.6.6') }}
21
- </a-form-item>
22
- </a-col>
23
- <a-col :span="8">
24
- <a-form-item :label="i18nText('1.9.405')" class="ASC_DESC">
25
- <a-radio-group v-decorator="['showMode']">
26
- <a-radio value="ASC">{{ i18nText('1.9.406') }}</a-radio>
27
- <a-radio value="DESC">{{ i18nText('1.9.407') }}</a-radio>
28
- </a-radio-group>
29
- </a-form-item>
30
- </a-col>
31
- </a-row>
32
- <a-form-item style="margin-left: 20px;">
33
- <a-checkbox @change="handleTimeDelayShow" :checked="showTimeDelay">{{ i18nText('1.9.408') }}</a-checkbox>
34
- </a-form-item>
35
- <template v-if="showTimeDelay">
36
- <a-row class="delayed-setting">
37
- <a-col :span="12">
38
- <a-form-item :label="i18nText('1.9.409')">
39
- <a-input-number :precision="0" :min="1" v-decorator="['delayed-timeLength']" style="width: 80px;"></a-input-number>
40
- <span class="unit">{{ i18nText('2.2.6.6') }}</span>
41
- </a-form-item>
42
- </a-col>
43
- <a-col :span="10">
44
- <a-form-item :label="i18nText('1.9.410')">
45
- <a-input-number :precision="0" :min="1" v-decorator="['rightOffRemindTime']" style="width: 80px;" @blur="handleRightOffRemindTimeBlur"></a-input-number>
46
- <span class="unit">{{ i18nText('1.9.411') }}</span>
47
- </a-form-item>
48
- </a-col>
49
- </a-row>
50
- </template>
51
- </template>
52
- </div>
53
- <div class="functional-module">
54
- <span class="title">{{ i18nText('1.9.412') }}</span>
55
- <a-form-item :label="i18nText('1.9.413')" class="server-form-item" v-if="!isStaff">
56
- <template v-for="item in serverInfo">
57
- <div :key="item.key" v-if="item.type === 'TEXT'" class="serverinfo-wrapper">
58
- <a-tooltip placement="top">
59
- <template slot="title">{{ item.title }}</template>
60
- <span class="serverinfo-label">{{ item.title }}:</span>
61
- </a-tooltip>
62
- <a-input v-decorator="[item.key]" class="title-input" allowClear></a-input>
63
- </div>
64
- </template>
65
- </a-form-item>
66
- <a-form-item :label="i18nText('1.9.414')" v-if="!isStaff">
67
- <template v-for="item in serverInfo">
68
- <div :key="item.key" v-if="item.type === 'BUTTON'" class="serverinfo-wrapper">
69
- <a-tooltip placement="top">
70
- <template slot="title">{{ item.title }}</template>
71
- <span class="serverinfo-label">{{ item.title }}:</span>
72
- </a-tooltip>
73
- <a-input v-decorator="[item.key]" class="title-input" allowClear></a-input>
74
- </div>
75
- </template>
76
- </a-form-item>
77
- <a-form-item :label="i18nText('1.9.415')" v-if="queryTimeSettingList.length > 0">
78
- <!-- <a-checkbox-group
79
- :options="queryTimeSettingList"
80
- v-decorator="[`queryTimeSetting`]"
81
- />-->
82
- <a-radio-group :options="queryTimeSettingList" v-decorator="[`queryTimeSetting`]"></a-radio-group>
83
- </a-form-item>
84
- <a-form-item :label="i18nText('1.9.416')">
85
- <a-checkbox-group v-if="isListClassify !== 'Y'" :options="functionList" v-decorator="[`functionSetting`]" />
86
- </a-form-item>
87
- <template v-if="isListClassify === 'Y'">
88
- <div v-for="(item, index) in listClassify" :key="index" class="classify-wrapper">
89
- <!-- <a-checkbox
90
- @change="e => handleClassifyToggle(item, e)"
91
- :checked="item.isChecked === 'Y'"
92
- ></a-checkbox>-->
93
- <div class="classify-item">
94
- <div class="statistic">
95
- <div>
96
- <span class="name">{{ i18nText('1.9.417') }}:</span>
97
- <svg-icon :icon-class="item.icon" style="font-size: 20px;margin-right: 8px;"></svg-icon>
98
- <a-input v-model="item.name" allowClear style="width: 150px;"></a-input>
99
- <a-checkbox v-if="item.isStatistic !== 'NOT'" style="width: 100px;margin-left: 10px;" @change="e => handleStatisticToggle(item, e)" :checked="item.isStatistic === 'Y'">{{
100
- i18nText('1.9.418')
101
- }}</a-checkbox>
102
- <a-checkbox style="width: 100px;margin-left: 10px;" v-model="item.enable">启用</a-checkbox>
103
- </div>
104
- <a-tooltip placement="top">
105
- <template slot="title">上移</template>
106
- <a-icon v-if="listClassify.length > 1" @click="handleGroupUp(index)" type="up" style="margin-right: 10px;" />
107
- </a-tooltip>
108
- </div>
109
- <div class="server">
110
- <span class="name">{{ i18nText('1.9.419') }}</span>
111
- <a-checkbox-group :options="item.serverfunctionList" v-model="item.serverfunctions" />
112
- </div>
113
- <div class="client">
114
- <span class="name">{{ i18nText('1.9.420') }}</span>
115
- <a-checkbox-group :options="item.clientfunctionList" v-model="item.clientfunctions" />
116
- </div>
117
- </div>
118
- </div>
119
- </template>
120
- <!-- 问诊TAB栏 -->
121
- <a-form-item :label="i18nText('1.1.8.1.8') + '-' + i18nText('1.10.232')" v-if="!isStaff">
122
- <template v-if="tabBarSetting.mobileSetting && tabBarSetting.mobileSetting.list">
123
- <a-checkbox
124
- v-for="(item, index) in tabBarSetting.mobileSetting.list"
125
- :key="index"
126
- :disabled="!tabBarMobileEnable || item.isMsgBar == 'Y'"
127
- :checked="item.isChecked == 'Y'"
128
- @input="v => handleCheckInput(v, item)"
129
- >
130
- {{ item.content }}
131
- </a-checkbox>
132
- </template>
133
- </a-form-item>
134
- <a-form-item :label="i18nText('1.9.421')" v-if="!isStaff">
135
- <a-table bordered :columns="columns" :dataSource="serviceState" :pagination="false" :rowKey="getRowkey">
136
- <template slot="operation" slot-scope="text, record">
137
- <a-switch
138
- :disabled="['ON-LINE', 'OFF-LINE'].includes(record.status)"
139
- :checkedChildren="i18nText('1.9.422')"
140
- :unCheckedChildren="i18nText('1.1.1.1.7')"
141
- :checked="record.enable"
142
- @change="() => handleStatusChange(record)"
143
- />
144
- </template>
145
-
146
- <template slot="icon" slot-scope="text, record">
147
- <svg-icon v-if="record.icon" :icon-class="record.icon" style="font-size:16px;"></svg-icon>
148
- </template>
149
- </a-table>
150
- </a-form-item>
151
- <a-form-item :label="i18nText('1.9.698')" v-if="toolbarList.length > 0">
152
- <!-- <a-checkbox-group
153
- :options="toolbarList"
154
- v-decorator="[`toolbar`]"
155
- /> -->
156
- <a-checkbox-group v-decorator="[`toolbar`]">
157
- <a-row>
158
- <a-col>
159
- <span style="display: inline-block;width: 70px;">PC:</span>
160
- <a-checkbox @change="toolbarChange(item, $event)" :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'PC')" :key="index">
161
- {{ item.label }}
162
- </a-checkbox>
163
- </a-col>
164
- <a-col>
165
- <span style="display: inline-block;width: 70px;">MOBILE:</span>
166
- <a-checkbox @change="toolbarChange(item, $event)" :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'MOBILE')" :key="index">
167
- {{ item.label }}
168
- </a-checkbox>
169
- </a-col>
170
- </a-row>
171
- </a-checkbox-group>
172
- </a-form-item>
173
- <a-form-item :label="i18nText('1.9.699')" v-if="toolbarList.length > 0">
174
- <a-checkbox-group v-decorator="[`closedToolbar`]">
175
- <a-row>
176
- <a-col>
177
- <span style="display: inline-block;width: 70px;">PC:</span>
178
- <a-checkbox :value="item.value" v-for="(item, index) in closedToolbarList.filter(item => item.source === 'PC')" :key="index">
179
- {{ item.label }}
180
- </a-checkbox>
181
- </a-col>
182
- <a-col>
183
- <span style="display: inline-block;width: 70px;">MOBILE:</span>
184
- <a-checkbox :value="item.value" v-for="(item, index) in closedToolbarList.filter(item => item.source === 'MOBILE')" :key="index">
185
- {{ item.label }}
186
- </a-checkbox>
187
- </a-col>
188
- </a-row>
189
- </a-checkbox-group>
190
- </a-form-item>
191
- </div>
192
- <div class="functional-module" v-if="isListClassify !== 'Y' && !isStaff">
193
- <span class="title">{{ i18nText('1.9.424') }}</span>
194
- <a-form-item :label="i18nText('1.9.425')">
195
- <a-checkbox-group :options="clientFunctionList" v-decorator="[`clientFunctionSetting`]" />
196
- </a-form-item>
197
- </div>
198
- <div class="functional-module" v-if="!isStaff">
199
- <span class="title" style="display: inline-block;margin-bottom: 10px;">
200
- {{ i18nText('1.9.426') }}
201
- <a-checkbox @change="handleEvaluate" :disabled="!evaluateId" :checked="evaluate"></a-checkbox>
202
- </span>
203
- </div>
204
- <div class="functional-module" v-if="!isConference && !isStaff">
205
- <span class="title" style="display: inline-block;margin-bottom: 10px;">
206
- {{ i18nText('1.9.427') }}
207
- <!-- <a-checkbox @change="handleBotSettingShow" :checked="showBotSetting"></a-checkbox> -->
208
- </span>
209
- <!-- <a-row class="bot-setting" v-if="showBotSetting">
210
- <a-col :span="4">
211
- <a-form-item label="secretId">
212
- <a-input v-decorator="['secretId']" style="width: 150px;"></a-input>
213
- </a-form-item>
214
- </a-col>
215
- <a-col :span="5">
216
- <a-form-item label="secretKey">
217
- <a-input v-decorator="['secretKey']" style="width: 150px;"></a-input>
218
- </a-form-item>
219
- </a-col>
220
- </a-row>
221
-
222
- <a-row class="bot-setting" v-if="showBotSetting">
223
- <a-form-item label="botId">
224
- <a-input v-decorator="['botId']" style="width: 150px;"></a-input>
225
- </a-form-item>
226
- </a-row> -->
227
- <a-row class="bot-setting">
228
- <a-form-item label="选择机器人">
229
- <a-select v-decorator="['robotId']" :placeholder="'选择机器人'" style="width: 200px;" allowClear showSearch :filterOption="filterOption">
230
- <a-select-option v-for="robot in robotList" :key="robot.id" :value="robot.id">{{ robot.name }}</a-select-option>
231
- </a-select>
232
- </a-form-item>
233
- </a-row>
234
- <a-row class="bot-setting">
235
- <a-form-item>
236
- <a-radio-group v-decorator="['mode']">
237
- <a-radio value="ROBOT_CHAT">机器人和人工客服</a-radio>
238
- <a-radio value="ROBOT">仅机器人</a-radio>
239
- </a-radio-group>
240
- </a-form-item>
241
- </a-row>
242
- </div>
243
- <div class="functional-module">
244
- <span class="title" style="display: block;margin-bottom: 10px;">
245
- 公共短语
246
- </span>
247
- <a-select style="width: 300px;margin-top: 15px;" mode="multiple" v-model="chatPublicCategory" showSearch placeholder="请选择">
248
- <a-select-option v-for="item in chatPublicCategoryList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
249
- </a-select>
250
- </div>
251
- <div class="functional-module">
252
- <span class="title">{{ i18nText('1.9.428') }}</span>
253
- <div class="broadcaste-wrap" v-for="(b, key) in broadcastList" :key="b.type">
254
- <div class="broadcaste-title">
255
- <a-switch v-model="b.isChecked" :checkedChildren="i18nText('1.9.422')" :unCheckedChildren="i18nText('1.1.1.1.7')" />
256
- <span>{{ key === 'PC' ? i18nText('1.9.429') : i18nText('1.1.8.1.8') }}</span>
257
- <a-icon type="plus-circle" theme="filled" style="color: green; fontSize: 18px;" @click="addBroadcast(b.type, b.list)" />
258
- </div>
259
- <ul>
260
- <li v-for="(v, i) in b.list" :key="i" class="broadcaste-item">
261
- <div>
262
- <span class="item-title">{{ i18nText('3.19.5') }}</span>
263
- <a-input v-model="v.content" allowClear />
264
- </div>
265
- <div>
266
- <span class="item-title">{{ i18nText('2.22.8.2') }}</span>
267
- <a-input v-model="v.url" allowClear />
268
- </div>
269
- <svg-icon @click="deleteBroadcast(i, b.list)" class="form-action svg-icon-btn" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" style="margin-left: 4px;" />
270
- </li>
271
- </ul>
272
- </div>
273
- </div>
274
- <div class="functional-module" v-if="!isStaff">
275
- <span class="title" style="display: inline-block;margin-bottom: 10px;"> {{ i18nText('1.9.678') }}: </span>
276
- <ul>
277
- <li v-for="(item, i) in refuseReasonList" :key="i" class="refuse-item">
278
- <a-input v-model.trim="item.text" :maxLength="15"></a-input>
279
- <svg-icon class="form-action svg-icon-btn" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" @click="refuseReasonDel(i)" />
280
- </li>
281
- </ul>
282
- <a-button class="refuse-add-btn" type="link" size="small" :disabled="refuseReasonList.length > 4" @click="refuseReasonAdd">
283
- <svg-icon icon-class="xinzengwenjian" style="margin-right:6px" />
284
- 添加
285
- </a-button>
286
- </div>
287
- <div class="functional-module" v-if="!isStaff">
288
- <span class="title" style="display: inline-block;margin-bottom: 10px;">
289
- 环境变量设置:
290
- </span>
291
- <a-row v-for="(item, index) in variableSetting" :key="index">
292
- <a-col :span="4">
293
- <a-form-item label="变量名称">
294
- <a-input v-model="item.name" style="width: 200px;" disabled></a-input>
295
- </a-form-item>
296
- </a-col>
297
- <a-col :span="4">
298
- <a-form-item label="变量值">
299
- <a-input v-model="item.value" style="width: 200px"></a-input>
300
- </a-form-item>
301
- </a-col>
302
- <a-col :span="5">
303
- <a-form-item label="备注">
304
- <a-input v-model="item.remark" style="width: 200px;" disabled></a-input>
305
- </a-form-item>
306
- </a-col>
307
- </a-row>
308
- </div>
309
- <div class="functional-module rightClickSetting">
310
- <span class="title" style="display: inline-block;margin-bottom: 10px;">
311
- 右键设置
312
- <a-icon type="plus-circle" theme="filled" style="color: green; fontSize: 18px;" @click="addRightClick()" />
313
- </span>
314
- <a-row v-for="(item, index) in rightClickSetting" :key="index">
315
- <a-col :span="handleRightClickSpan(item)">
316
- <a-form-item label="名称" class="rightClick-form">
317
- <a-input v-model="item.rightClickName" style="width: 98%" allowClear></a-input>
318
- </a-form-item>
319
- </a-col>
320
- <a-col :span="handleRightClickSpan(item)">
321
- <a-form-item label="操作" class="rightClick-form">
322
- <a-select style="width: 98%" v-model="item.rightClickDo" allowClear showSearch :filterOption="filterOption" placeholder="请选择">
323
- <a-select-option v-for="(i, index) in rightClickDoList" :key="index" :value="i.value">{{ i.label }}</a-select-option>
324
- </a-select>
325
- </a-form-item>
326
- </a-col>
327
- <a-col :span="11" v-if="item.rightClickDo === 'jumpUrl'">
328
- <a-form-item label="外部地址" class="rightClick-form">
329
- <a-input v-model="item.rightClickUrl" style="width: 100%;" allowClear></a-input>
330
- </a-form-item>
331
- </a-col>
332
- <svg-icon @click="deleteRightClick(index)" class="form-action svg-icon-btn" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" style="margin: 8px 0 0 4px;" />
333
- </a-row>
334
- </div>
335
- <div class="functional-module" v-if="!isConference && !isStaff">
336
- <span class="title" style="display: inline-block;margin-bottom: 10px;">
337
- 聊天客户端接入地址
338
- </span>
339
- <a-row class="client-url">
340
- <a-col :span="3">PC端:</a-col>
341
- <a-col :span="20">{{ pcUrl }} </a-col>
342
- </a-row>
343
- <a-row class="client-url">
344
- <a-col :span="3">移动端:</a-col>
345
- <a-col :span="20">{{ mobileUrl }} </a-col>
346
- </a-row>
347
- </div>
348
- </a-form>
349
- </div>
350
- <div class="form-bottom">
351
- <!-- <a-button @click="handleCancel">取消</a-button> -->
352
- <a-button type="primary" @click="handleSubmit" style="margin-left: 10px;">{{ i18nText('3.5.29') }}</a-button>
353
- </div>
354
- </div>
355
- </template>
356
-
357
- <script>
358
- import { mapGetters } from '../../store/helper';
359
- import fetch, { qs } from '@/utils/chatFetch';
360
- import vexutils from '@/utils/vexutils';
361
- import { Checkbox, Col, Form, Icon, Input, InputNumber, Radio, Row, Select, Tooltip, Table, Switch, Button } from 'ant-design-vue';
362
- import SvgIcon from '@/component/svg/index.vue';
363
-
364
- export default {
365
- inject: ['store', 'i18nText', 'dispatchEvent'],
366
- components: {
367
- [Icon.name]: Icon,
368
- [Row.name]: Row,
369
- [Col.name]: Col,
370
- [Form.name]: Form,
371
- [Form.Item.name]: Form.Item,
372
- [Checkbox.name]: Checkbox,
373
- [Select.name]: Select,
374
- [Select.Option.name]: Select.Option,
375
- [Radio.name]: Radio,
376
- [Radio.Group.name]: Radio.Group,
377
- [InputNumber.name]: InputNumber,
378
- [Tooltip.name]: Tooltip,
379
- [Checkbox.Group.name]: Checkbox.Group,
380
- [Input.name]: Input,
381
- [Table.name]: Table,
382
- [Switch.name]: Switch,
383
- [Button.name]: Button,
384
- SvgIcon
385
- },
386
- props: ['assemblyId', 'webURL'],
387
- data() {
388
- return {
389
- isListClassify: '',
390
- listClassify: [],
391
- showTimeSetting: false,
392
- showTimeDelay: false,
393
- showBotSetting: false,
394
- evaluate: false,
395
- readStatus: false,
396
- lineUpNotice: false,
397
- evaluateId: '',
398
- timeLengths: [5, 10, 20, 30, 40, 50, 60],
399
- functionSetting: [], // 服务端功能
400
- clientFunctionSetting: [], // 客户端功能
401
- functionList: [], // 服务端功能下拉列表
402
- clientFunctionList: [], // 客户端功能下拉列表
403
- toolbar: [],
404
- toolbarList: [],
405
- closedToolbarList: [],
406
- queryTimeSetting: [],
407
- queryTimeSettingList: [],
408
- serviceState: [],
409
- serverInfo: [],
410
- tabBarSetting: {},
411
- columns: [
412
- {
413
- title: this.i18nText('1.9.417'),
414
- dataIndex: 'title',
415
- key: 'title',
416
- align: 'center'
417
- },
418
- {
419
- title: this.i18nText('1.2.1.4.4'),
420
- dataIndex: 'description',
421
- key: 'description',
422
- align: 'center'
423
- },
424
- {
425
- title: this.i18nText('1.2.1.3.24'),
426
- dataIndex: 'updatedBy',
427
- key: 'updatedBy',
428
- align: 'center',
429
- scopedSlots: { customRender: 'operation' }
430
- },
431
- {
432
- title: 'icon',
433
- dataIndex: 'icon',
434
- key: 'icon',
435
- align: 'center',
436
- scopedSlots: { customRender: 'icon' }
437
- }
438
- ],
439
- submitData: { setting: {} },
440
- id: '',
441
- originSetting: {},
442
- broadcastList: {
443
- PC: {
444
- isChecked: false,
445
- list: []
446
- },
447
- MOBILE: {
448
- isChecked: false,
449
- list: []
450
- }
451
- },
452
- robotList: [],
453
- variableSetting: [
454
- {
455
- name: 'QUEUE_NOTICE_TIME',
456
- value: '5',
457
- remark: '每个会话平均时长'
458
- }
459
- ],
460
- chatPublicCategoryList: [],
461
- chatPublicCategory: '',
462
- rightClickSetting: [],
463
- rightClickDoList: [
464
- { label: '撤回', value: 'rollBack' },
465
- { label: '外部地址', value: 'jumpUrl' },
466
- { label: '重新发送', value: 'resend' }
467
- ],
468
- clientInfo: {},
469
- mobileUrl: '',
470
- pcUrl: '',
471
- refuseReasonList: []
472
- };
473
- },
474
- computed: {
475
- ...mapGetters(['userInfo', 'assemblySetting']),
476
- orgId() {
477
- return this.userInfo?.sysParams?.orgId;
478
- },
479
- isConference() {
480
- return this.assemblySetting?.type == 'conference';
481
- },
482
- isStaff() {
483
- return this.assemblySetting?.type == 'staff';
484
- },
485
- tabBarMobileEnable() {
486
- const isChecked = this.tabBarSetting?.mobileSetting?.isChecked;
487
- return isChecked == 'Y';
488
- },
489
- handleRightClickSpan() {
490
- return function(item) {
491
- if (item.rightClickDo === 'jumpUrl') return 5;
492
- return 11;
493
- };
494
- }
495
- },
496
- beforeCreate() {
497
- this.form = this.$form.createForm(this, { name: 'strategy-condition' });
498
- },
499
- created() {
500
- this.init();
501
- this.getBaseInfo();
502
- if (!this.isConference) {
503
- this.getRobotAll();
504
- }
505
- },
506
- watch: {},
507
- methods: {
508
- filterOption(...args) {
509
- return vexutils.filterOption.apply(this, args);
510
- },
511
- init() {
512
- this.mobileUrl = `${location.origin}${this.webURL}/h5/#/multiChat?assemblyId=${this.assemblyId || 'xxx'}&orgId=${this.orgId || 'xxx'}&userId=xxx&userType=xxx&name=xxx`;
513
- this.pcUrl = `${location.origin}${this.webURL}/web/#/multiChat?isOriginPage=1&assemblyId=${this.assemblyId || 'xxx'}&orgId=${this.orgId || 'xxx'}&userId=xxx&userType=xxx&name=xxx`;
514
- },
515
- /* 入口 */
516
- getBaseInfo() {
517
- fetch
518
- .get('/chat/event/getSysBaseInformation', {
519
- params: {
520
- assemblyId: this.assemblyId,
521
- type: 'BASE_INFORMATION'
522
- }
523
- })
524
- .then(({ data }) => {
525
- if (data.result === 'SUCCESS') {
526
- const chatPublicCategoryList = data.map?.chatPublicCategoryList || [];
527
- this.chatPublicCategoryList = chatPublicCategoryList.filter(v => v);
528
- let info = data.map.imformation[0];
529
- if (info) {
530
- this.id = info.id || null;
531
- let setting = info.settingObj;
532
- this.originSetting = setting;
533
- this.fillInfoData(setting);
534
- }
535
- }
536
- });
537
- },
538
- /* 编辑回填 */
539
- fillInfoData(setting) {
540
- let {
541
- timingSettingSwitch,
542
- timingSetting,
543
- serverSetting,
544
- clientSetting,
545
- queryTimeSetting = [],
546
- robotObj,
547
- robotSetting,
548
- toolbar = [],
549
- isListClassify,
550
- listClassify = [],
551
- rightClickSetting = [],
552
- variableSetting = [],
553
- chatPublicCategory,
554
- evaluate,
555
- readStatus,
556
- lineUpNotice,
557
- broadcast
558
- } = setting;
559
- this.readStatus = readStatus === 'Y';
560
- this.lineUpNotice = lineUpNotice === 'Y';
561
- this.showTimeSetting = timingSettingSwitch === '1';
562
- this.isListClassify = isListClassify;
563
- this.rightClickSetting = rightClickSetting;
564
- this.variableSetting = variableSetting;
565
- // 拒绝原因
566
- this.refuseReasonList = setting?.refuseReasonSetting?.list || [];
567
- if (chatPublicCategory) {
568
- this.chatPublicCategory = chatPublicCategory.split(',');
569
- } else {
570
- this.chatPublicCategory = [];
571
- }
572
- this.fillListClassify(listClassify);
573
- this.$nextTick(() => {
574
- this.fillServiceSetting(serverSetting);
575
- });
576
- this.fillClientSetting(clientSetting);
577
- this.fillToolbar(toolbar);
578
- this.fillQueryTimeSetting(queryTimeSetting);
579
- this.fillBroadcast(broadcast);
580
- this.fillTabBar(setting.tabBarSetting);
581
- this.$nextTick().then(() => {
582
- this.fillTimeSetting(timingSetting);
583
- });
584
- if (robotObj?.switch) {
585
- this.showBotSetting = true;
586
- let { secretId, secretKey, botId } = robotObj;
587
- this.$nextTick().then(() => {
588
- !this.isConference &&
589
- !this.isStaff &&
590
- this.form.setFieldsValue({
591
- secretKey,
592
- secretId,
593
- botId
594
- });
595
- });
596
- }
597
- !this.isConference && !this.isStaff && this.fillRobotSetting(robotSetting);
598
- if (evaluate) {
599
- this.evaluate = evaluate.isChecked === 'Y';
600
- this.evaluateId = evaluate.id;
601
- }
602
- },
603
- fillQueryTimeSetting(queryTimeSetting) {
604
- this.queryTimeSettingList = queryTimeSetting.map(item => ({
605
- label: item.title,
606
- value: item.title
607
- }));
608
- this.queryTimeSetting = queryTimeSetting;
609
- // let queryTimeSettingChecked = queryTimeSetting.reduce((result, item) => {
610
- // if (item.isChecked === "Y") {
611
- // result.push(item.title);
612
- // }
613
- // return result;
614
- // }, []);
615
- let queryTimeSettingChecked = queryTimeSetting.filter(item => item.isChecked === 'Y')[0]?.title;
616
- this.$nextTick(() => {
617
- this.form.setFieldsValue({ queryTimeSetting: queryTimeSettingChecked });
618
- });
619
- },
620
- fillRobotSetting(robotSetting) {
621
- if (!robotSetting) return;
622
- let { robotId, mode } = robotSetting;
623
- this.$nextTick(() => {
624
- this.form.setFieldsValue({ robotId, mode });
625
- });
626
- },
627
- fillBroadcast(broadcast) {
628
- if (!broadcast) return;
629
- for (let i in broadcast) {
630
- let item = broadcast[i];
631
- item.isChecked = item.isChecked == 'Y' ? true : false;
632
- if (!item.list) {
633
- item.list = [];
634
- }
635
- }
636
- this.broadcastList = broadcast;
637
- },
638
- fillToolbar(toolbar) {
639
- this.toolbarList = toolbar.map(item => ({
640
- label: item.name,
641
- value: item.name + '-' + item.source,
642
- source: item.source,
643
- isClosedAble: item.isClosedAble,
644
- isCloseChecked: item.isCloseChecked
645
- }));
646
- const btwList = toolbar.filter(item => item.isClosedAble == "Y" && item.isChecked == "Y");
647
- this.closedToolbarList = btwList.map(item => ({
648
- label: item.name,
649
- value: item.name + '-' + item.source,
650
- source: item.source,
651
- isClosedAble: item.isClosedAble,
652
- isCloseChecked: item.isCloseChecked
653
- }));
654
- this.toolbar = toolbar;
655
- let toolbarChecked = toolbar.reduce((result, item) => {
656
- if (item.isChecked === 'Y') {
657
- result.push(item.name + '-' + item.source);
658
- }
659
- return result;
660
- }, []);
661
- this.$nextTick(() => {
662
- this.form.setFieldsValue({ toolbar: toolbarChecked });
663
- });
664
- let closedToolbarChecked = this.closedToolbarList.reduce((result, item) => {
665
- if (item.isCloseChecked === 'Y') {
666
- result.push(item.label + '-' + item.source);
667
- }
668
- return result;
669
- }, []);
670
- this.$nextTick(() => {
671
- this.form.setFieldsValue({ closedToolbar: closedToolbarChecked });
672
- });
673
- },
674
- toolbarChange(item, e) {
675
- const checked = e.target.checked;
676
- let checkedItemIndex = -1;
677
- const checkedItems = [];
678
- this.closedToolbarList.forEach((itm, index) => {
679
- if (item.source == itm.source && item.value == itm.value) {
680
- checkedItemIndex = index;
681
- } else {
682
- checkedItems.push(itm.value);
683
- }
684
- })
685
- if (checked && checkedItemIndex == -1 && item.isClosedAble == "Y") {
686
- this.closedToolbarList.push(item);
687
- } else if (!checked && checkedItemIndex != -1) {
688
- this.form.setFieldsValue({ closedToolbar: checkedItems });
689
- this.closedToolbarList.splice(checkedItemIndex, 1);
690
- }
691
- },
692
- fillTabBar(data) {
693
- const mobileSetting = {
694
- isChecked: 'N',
695
- list: []
696
- };
697
- if (data.mobileSetting) {
698
- mobileSetting.isChecked = data.mobileSetting.isChecked || mobileSetting.isChecked;
699
- mobileSetting.list = (data?.mobileSetting?.list || []).map(v => {
700
- return Object.assign({}, v, {
701
- isChecked: v.isChecked || 'Y' // 无isChecked的旧数据设值为Y
702
- });
703
- });
704
- }
705
- this.tabBarSetting = {
706
- mobileSetting
707
- };
708
- },
709
- /* 回填时间设置 */
710
- fillTimeSetting(timeSetting) {
711
- if (this.isStaff) return;
712
- let { timeLength, showMode, delayedSetting, delayed } = timeSetting;
713
- this.form.setFieldsValue({
714
- timeLength,
715
- showMode
716
- });
717
- if (delayed) {
718
- this.showTimeDelay = true;
719
- let { timeLength, rightOffRemindTime } = delayedSetting;
720
- this.$nextTick().then(() => {
721
- this.form.setFieldsValue({
722
- 'delayed-timeLength': timeLength,
723
- rightOffRemindTime
724
- });
725
- });
726
- }
727
- },
728
- fillListClassify(listClassify) {
729
- if (this.isListClassify !== 'Y') {
730
- return;
731
- }
732
- this.listClassify = listClassify;
733
- this.listClassify.forEach(item => {
734
- let serverfunctionList = [];
735
- let serverfunctions = [];
736
- let clientfunctionList = [];
737
- let clientfunctions = [];
738
- item.serverFunctionSetting.map(i => {
739
- if (i.isshow === 'Y') {
740
- serverfunctionList.push({
741
- label: i.fTitle,
742
- value: i.function
743
- });
744
- }
745
- if (i.isChecked === 'Y') {
746
- serverfunctions.push(i.function);
747
- }
748
- });
749
- item.clientFunctionSetting.map(i => {
750
- if (i.isshow === 'Y') {
751
- clientfunctionList.push({
752
- label: i.fTitle,
753
- value: i.function
754
- });
755
- }
756
- if (i.isChecked === 'Y') {
757
- clientfunctions.push(i.function);
758
- }
759
- });
760
- if (item.enable === undefined) {
761
- this.$set(item, 'enable', true);
762
- }
763
- this.$set(item, 'serverfunctionList', serverfunctionList);
764
- this.$set(item, 'serverfunctions', serverfunctions);
765
- this.$set(item, 'clientfunctionList', clientfunctionList);
766
- this.$set(item, 'clientfunctions', clientfunctions);
767
- });
768
- },
769
- /* 回填服务端设置 */
770
- fillServiceSetting(serverSetting) {
771
- let { serverInfo, functionSetting, serviceState } = serverSetting;
772
-
773
- this.serverInfo = serverInfo;
774
- this.$nextTick().then(() => {
775
- !this.isStaff &&
776
- serverInfo.map(item => {
777
- this.form.setFieldsValue({ [item.key]: item.value });
778
- });
779
- });
780
- this.serviceState = serviceState;
781
-
782
- if (this.isListClassify === 'Y') {
783
- return;
784
- }
785
-
786
- this.functionSetting = functionSetting;
787
- this.getFunctionList();
788
- let serverFunction = functionSetting.reduce((server, item) => {
789
- if (item.isChecked === 'Y') {
790
- server.push(item.function);
791
- }
792
- return server;
793
- }, []);
794
- this.form.setFieldsValue({ functionSetting: serverFunction });
795
- },
796
- /* 回填客户端设置 */
797
- fillClientSetting(clientSetting) {
798
- if (this.isListClassify === 'Y' || this.isStaff) return;
799
- let { functionSetting } = clientSetting;
800
- this.clientFunctionSetting = functionSetting;
801
- this.getClientFunctionList();
802
- let clientFunction = functionSetting.reduce((client, item) => {
803
- if (item.isChecked === 'Y') {
804
- client.push(item.function);
805
- }
806
- return client;
807
- }, []);
808
- this.form.setFieldsValue({ clientFunctionSetting: clientFunction });
809
- },
810
- getFunctionList() {
811
- let functionList = [];
812
- this.functionSetting.map(item => {
813
- if (item.isshow === 'Y') {
814
- functionList.push({
815
- label: item.fTitle,
816
- value: item.function
817
- });
818
- }
819
- this.functionList = functionList;
820
- });
821
- },
822
- getClientFunctionList() {
823
- let clientFunctionList = [];
824
- this.clientFunctionSetting.map(item => {
825
- if (item.isshow === 'Y') {
826
- clientFunctionList.push({
827
- label: item.fTitle,
828
- value: item.function
829
- });
830
- }
831
- });
832
- this.clientFunctionList = clientFunctionList;
833
- },
834
- getRowkey(record) {
835
- return record.status;
836
- },
837
- handleTimeSettingShow(e) {
838
- this.showTimeSetting = e.target.checked;
839
- },
840
- handleTimeDelayShow(e) {
841
- this.showTimeDelay = e.target.checked;
842
- },
843
- handleBotSettingShow(e) {
844
- this.showBotSetting = e.target.checked;
845
- },
846
- getRobotAll() {
847
- this.spinningText = '3.2.8';
848
- let url = '/robot/getAll';
849
- return fetch.get(url).then(({ data }) => {
850
- if (data.result === 'SUCCESS') {
851
- let { list = [] } = data;
852
- if (list && list.length > 0) {
853
- this.robotList = list;
854
- }
855
- }
856
- });
857
- },
858
- handleEvaluate(e) {
859
- this.evaluate = e.target.checked;
860
- },
861
- handleStatusChange(record) {
862
- record.enable = !record.enable;
863
- },
864
- handleSubmit() {
865
- this.form.validateFields((err, values) => {
866
- if (err) return;
867
- let setting = {};
868
- this.handleTimeSetting(setting, values);
869
- this.handleToolbar(setting, values);
870
- this.handleQueryTimeSetting(setting, values);
871
- this.handleClassify(setting);
872
- let validate = this.handleServiceSetting(setting, values);
873
- if (validate) return;
874
- let broadcastValidate = this.handleBroadcast(setting);
875
- if (!broadcastValidate) return;
876
- this.handleClientSetting(setting, values);
877
- setting.robotObj = {
878
- switch: this.showBotSetting,
879
- secretId: this.form.getFieldValue('secretId'),
880
- secretKey: this.form.getFieldValue('secretKey'),
881
- botId: this.form.getFieldValue('botId')
882
- };
883
- setting.robotSetting = {
884
- robotId: this.form.getFieldValue('robotId'),
885
- mode: this.form.getFieldValue('mode')
886
- };
887
- setting.chatPublicCategory = this.chatPublicCategory.join(',');
888
- setting.rightClickSetting = this.rightClickSetting;
889
- setting.variableSetting = this.variableSetting;
890
- setting.tabBarSetting = this.tabBarSetting;
891
- setting.refuseReasonSetting = {
892
- list: this.refuseReasonList
893
- };
894
- setting = Object.assign({}, this.originSetting, setting);
895
- if (!setting.evaluate) {
896
- setting.evaluate = {};
897
- }
898
- setting.evaluate.isChecked = this.evaluate ? 'Y' : 'N';
899
- setting.readStatus = this.readStatus ? 'Y' : 'N';
900
- setting.lineUpNotice = this.lineUpNotice ? 'Y' : 'N';
901
- this.submitData.setting = JSON.stringify(setting);
902
- this.submitData.type = 'BASE_INFORMATION';
903
- this.submitData.assemblyId = this.assemblyId;
904
- if (this.id) {
905
- this.submitData.id = this.id;
906
- }
907
-
908
- this.saveSysBaseInformation();
909
- });
910
- },
911
- saveSysBaseInformation() {
912
- fetch.post('/chat/event/saveSysBaseInformation', qs.stringify(this.submitData)).then(({ data }) => {
913
- if (data.result === 'SUCCESS') {
914
- this.dispatchEvent('set_sysInfoSuccess', data.map);
915
- this.$message.success(this.i18nText('1.10.52'));
916
- }
917
- });
918
- },
919
- handleClassify(setting) {
920
- if (this.isListClassify !== 'Y') return;
921
- let listClassify = JSON.parse(JSON.stringify(this.listClassify));
922
- listClassify.forEach(item => {
923
- item.serverFunctionSetting.map(i => {
924
- if (item.serverfunctions.includes(i.function)) {
925
- i.isChecked = 'Y';
926
- } else {
927
- i.isChecked = 'N';
928
- }
929
- });
930
- item.clientFunctionSetting.map(i => {
931
- if (item.clientfunctions.includes(i.function)) {
932
- i.isChecked = 'Y';
933
- } else {
934
- i.isChecked = 'N';
935
- }
936
- });
937
- delete item.serverfunctions;
938
- delete item.serverfunctionList;
939
- delete item.clientfunctions;
940
- delete item.clientfunctionList;
941
- });
942
- setting.listClassify = listClassify;
943
- },
944
- handleQueryTimeSetting(setting, values) {
945
- if (this.queryTimeSettingList.length === 0) return;
946
- let { queryTimeSetting } = values;
947
- let clone = JSON.parse(JSON.stringify(this.queryTimeSetting));
948
- setting.queryTimeSetting = clone.reduce((result, item) => {
949
- if (queryTimeSetting === item.title) {
950
- item.isChecked = 'Y';
951
- } else {
952
- item.isChecked = 'N';
953
- }
954
- result.push(item);
955
- return result;
956
- }, []);
957
- },
958
- handleToolbar(setting, values) {
959
- if (this.toolbarList.length === 0) return;
960
- let { toolbar, closedToolbar } = values;
961
- let clone = JSON.parse(JSON.stringify(this.toolbar));
962
- setting.toolbar = clone.reduce((result, item) => {
963
- if (toolbar.includes(item.name + '-' + item.source)) {
964
- item.isChecked = 'Y';
965
- } else {
966
- item.isChecked = 'N';
967
- }
968
- if (closedToolbar.includes(item.name + '-' + item.source)) {
969
- item.isCloseChecked = 'Y';
970
- } else {
971
- item.isCloseChecked = 'N';
972
- }
973
- result.push(item);
974
- return result;
975
- }, []);
976
- },
977
- /* 客户端设置 */
978
- handleClientSetting(setting, values) {
979
- if (this.isListClassify === 'Y') return;
980
- setting.clientSetting = {
981
- functionSetting: []
982
- };
983
- let { clientFunctionSetting } = values;
984
- let clientFunctionClone = JSON.parse(JSON.stringify(this.clientFunctionSetting));
985
- setting.clientSetting.functionSetting = clientFunctionClone.reduce((result, func) => {
986
- if (clientFunctionSetting.includes(func.function)) {
987
- func.isChecked = 'Y';
988
- } else {
989
- func.isChecked = 'N';
990
- }
991
- result.push(func);
992
- return result;
993
- }, []);
994
- },
995
- /* 服务端设置 */
996
- handleServiceSetting(setting, values) {
997
- setting.serverSetting = {
998
- serverInfo: {},
999
- functionSetting: [],
1000
- serviceState: []
1001
- };
1002
-
1003
- this.serverInfo.map(item => {
1004
- item.value = this.form.getFieldValue(item.key);
1005
- });
1006
- for (let i = 0; i < this.serverInfo.length; i++) {
1007
- let info = this.serverInfo[i];
1008
- if (!info.value && info.key != 'customerName' && !this.isStaff) {
1009
- this.$message.error(`${info.title} ${this.i18nText('1.9.430')}!`);
1010
- return true;
1011
- }
1012
- }
1013
- setting.serverSetting.serverInfo = this.serverInfo;
1014
- if (this.isListClassify === 'Y') return;
1015
- let { functionSetting } = values;
1016
- let functionSettingClone = JSON.parse(JSON.stringify(this.functionSetting));
1017
- setting.serverSetting.functionSetting = functionSettingClone.reduce((result, func) => {
1018
- if (functionSetting.includes(func.function)) {
1019
- func.isChecked = 'Y';
1020
- } else {
1021
- func.isChecked = 'N';
1022
- }
1023
- result.push(func);
1024
- return result;
1025
- }, []);
1026
- setting.serverSetting.serviceState = this.serviceState;
1027
- },
1028
- handleBroadcast(setting) {
1029
- setting.broadcast = {};
1030
- for (let i in this.broadcastList) {
1031
- let broadcastItem = this.broadcastList[i];
1032
- for (let j = 0; j < broadcastItem.list.length; j++) {
1033
- let item = broadcastItem.list[j];
1034
- if (!item.content) {
1035
- this.$message.error(`${this.i18nText('1.2.1.11.60')}!`);
1036
- return false;
1037
- }
1038
- }
1039
- }
1040
- let copyList = JSON.parse(JSON.stringify(this.broadcastList));
1041
- for (let i in copyList) {
1042
- let item = copyList[i];
1043
- item.isChecked = item.isChecked ? 'Y' : 'N';
1044
- }
1045
- setting.broadcast = copyList;
1046
- return true;
1047
- },
1048
- /* 聊天设置 */
1049
- handleTimeSetting(setting, values) {
1050
- setting.timingSettingSwitch = this.showTimeSetting ? '1' : '0';
1051
- setting.timingSetting = {};
1052
- if (this.showTimeSetting) {
1053
- let { timeLength, showMode } = values;
1054
- Object.assign(setting.timingSetting, { timeLength, showMode });
1055
- setting.timingSetting.delayedSetting = {};
1056
- }
1057
- if (this.showTimeDelay && this.showTimeSetting) {
1058
- let { 'delayed-timeLength': timeLength, rightOffRemindTime } = values;
1059
- setting.timingSetting.delayed = true;
1060
- Object.assign(setting.timingSetting.delayedSetting, {
1061
- timeLength,
1062
- rightOffRemindTime
1063
- });
1064
- }
1065
- },
1066
- handleCancel() {},
1067
- handleClassifyToggle(item, e) {
1068
- this.$set(item, 'isChecked', e.target.checked ? 'Y' : 'N');
1069
- },
1070
- handleStatisticToggle(item, e) {
1071
- item.isStatistic = e.target.checked ? 'Y' : 'N';
1072
- },
1073
- handleCheckInput(v, item, key = 'isChecked') {
1074
- item[key] = v ? 'Y' : 'N';
1075
- },
1076
- addBroadcast(type, list) {
1077
- let item = {
1078
- content: '',
1079
- url: ''
1080
- };
1081
- list.push(item);
1082
- },
1083
- deleteBroadcast(index, list) {
1084
- list.splice(index, 1);
1085
- },
1086
- addRightClick() {
1087
- this.rightClickSetting = this.rightClickSetting.concat({
1088
- rightClickName: '',
1089
- rightClickUrl: '',
1090
- rightClickDo: ''
1091
- });
1092
- },
1093
- deleteRightClick(index) {
1094
- this.rightClickSetting.splice(index, 1);
1095
- },
1096
- handleGroupUp(index) {
1097
- if (index === 0) {
1098
- let current = this.listClassify[index];
1099
- let nextList = this.listClassify.slice(1);
1100
- this.listClassify = [].concat(nextList, current);
1101
- } else {
1102
- let current = this.listClassify[index];
1103
- let preList = this.listClassify.slice(0, index - 1);
1104
- let nextList = this.listClassify.slice(index - 1);
1105
- nextList.splice(1, 1);
1106
- this.listClassify = [].concat(preList, current, nextList);
1107
- }
1108
- },
1109
- refuseReasonAdd() {
1110
- this.refuseReasonList.push({
1111
- text: ''
1112
- });
1113
- },
1114
- refuseReasonDel(i) {
1115
- this.refuseReasonList.splice(i, 1);
1116
- },
1117
- handleRightOffRemindTimeBlur(event) {
1118
- const v = this.form.getFieldValue('timeLength') || 0;
1119
- // 限制 到期提醒 输入 数据不能大于等于会话时长
1120
- if (v && v <= event.target.value) {
1121
- this.form.setFieldsValue({
1122
- rightOffRemindTime: v - 1
1123
- });
1124
- }
1125
- }
1126
- }
1127
- };
1128
- </script>
1129
-
1130
- <style lang="less" scoped>
1131
- .chat-base-info {
1132
- height: 100%;
1133
- display: flex;
1134
- flex-direction: column;
1135
- padding: 15px;
1136
- padding-bottom: 0;
1137
- .main-form {
1138
- overflow: auto;
1139
- &::-webkit-scrollbar {
1140
- width: 5px;
1141
- }
1142
- }
1143
- .page-title {
1144
- font-weight: 500;
1145
- color: #2e2e2e;
1146
- font-size: 16px;
1147
- }
1148
- .main-form {
1149
- flex: 1;
1150
- }
1151
- .time-setting,
1152
- .delayed-setting {
1153
- padding-left: 20px;
1154
- /deep/ .ant-form-item {
1155
- display: flex;
1156
- }
1157
- }
1158
- .delayed-setting {
1159
- margin-left: 30px;
1160
- .unit {
1161
- display: inline-block;
1162
- margin-left: 10px;
1163
- }
1164
- }
1165
- /deep/ .ant-form-item {
1166
- margin-bottom: 0;
1167
- }
1168
- /deep/ .ant-form-item-children {
1169
- display: flex;
1170
- align-items: center;
1171
- }
1172
- .server-form-item {
1173
- /deep/ .ant-form-item-children {
1174
- flex-wrap: wrap;
1175
- }
1176
- }
1177
- .functional-module {
1178
- margin-bottom: 30px;
1179
- .title {
1180
- color: #506493;
1181
- line-height: 22px;
1182
- padding-left: 8px;
1183
- border-left: 3px solid #5585f5;
1184
- }
1185
- .broadcaste-wrap {
1186
- .broadcaste-title {
1187
- display: flex;
1188
- align-items: center;
1189
- margin: 8px 0;
1190
- > span {
1191
- margin: 0 8px;
1192
- }
1193
- }
1194
- .broadcaste-item {
1195
- display: flex;
1196
- align-items: center;
1197
- margin-bottom: 4px;
1198
- > div {
1199
- display: flex;
1200
- align-items: center;
1201
- width: 40%;
1202
- .item-title {
1203
- width: 60px;
1204
- margin: 4px;
1205
- }
1206
- }
1207
- }
1208
- }
1209
- .client-url {
1210
- margin-bottom: 8px;
1211
- }
1212
- }
1213
- /deep/ .ant-table-thead > tr > th,
1214
- /deep/ .ant-table-tbody > tr > td {
1215
- padding: 4px 30px;
1216
- }
1217
- .form-bottom {
1218
- display: flex;
1219
- align-items: center;
1220
- margin-top: auto;
1221
- margin-left: -15px;
1222
- padding-left: 15px;
1223
- height: 49px;
1224
- box-shadow: 0px -3px 8px 2px rgba(239, 243, 255, 1);
1225
- border-top: 1px solid #b8c5e2;
1226
- }
1227
- .title-input {
1228
- width: 150px;
1229
- margin-right: 20px;
1230
- text-align: center;
1231
- }
1232
- .bot-setting {
1233
- /deep/ .ant-form-item {
1234
- display: flex;
1235
- }
1236
- }
1237
- .serverinfo-wrapper {
1238
- display: flex;
1239
- align-items: center;
1240
- }
1241
- .serverinfo-label {
1242
- display: inline-block;
1243
- width: 100px;
1244
- padding-right: 8px;
1245
- overflow: hidden;
1246
- text-overflow: ellipsis;
1247
- white-space: nowrap;
1248
- }
1249
- .classify-wrapper {
1250
- display: flex;
1251
- align-items: flex-start;
1252
- .classify-item {
1253
- margin-left: 10px;
1254
- margin-bottom: 8px;
1255
- padding: 10px;
1256
- border: 1px solid #b8c5e2;
1257
- background-color: #f6f7fa;
1258
- .name {
1259
- display: inline-block;
1260
- width: 80px;
1261
- }
1262
- .statistic {
1263
- display: flex;
1264
- align-items: center;
1265
- justify-content: space-between;
1266
- margin-bottom: 10px;
1267
- }
1268
- .server {
1269
- margin-bottom: 10px;
1270
- }
1271
- }
1272
- }
1273
- .rightClickSetting {
1274
- /deep/ .ant-form-item {
1275
- display: flex;
1276
- }
1277
- }
1278
- .ASC_DESC {
1279
- /deep/ .ant-form-item-control-wrapper {
1280
- display: flex;
1281
- align-items: center;
1282
- }
1283
- }
1284
- .refuse-item {
1285
- margin-bottom: 8px;
1286
- display: flex;
1287
- align-items: center;
1288
- .ant-input {
1289
- max-width: 348px;
1290
- margin-right: 15px;
1291
- }
1292
- }
1293
- .refuse-add-btn {
1294
- border: none;
1295
- }
1296
- /deep/ .rightClick-form {
1297
- .ant-form-item-control-wrapper {
1298
- width: 100%;
1299
- }
1300
- }
1301
- }
1302
- </style>
1
+ <template>
2
+ <div class="chat-base-info">
3
+ <h3 class="page-title">{{ i18nText('2.4.3.1') }}</h3>
4
+ <div class="main-form">
5
+ <a-form :form="form">
6
+ <div class="functional-module" v-if="!isStaff">
7
+ <span class="title">{{ i18nText('1.9.401') }}</span>
8
+ <a-form-item>
9
+ <a-checkbox @change="handleTimeSettingShow" :checked="showTimeSetting">{{ i18nText('1.9.402') }}</a-checkbox>
10
+ <a-checkbox v-model="readStatus">已读回执</a-checkbox>
11
+ <a-checkbox v-model="lineUpNotice">排队提醒</a-checkbox>
12
+ </a-form-item>
13
+ <template v-if="showTimeSetting">
14
+ <a-row class="time-setting">
15
+ <a-col :span="12">
16
+ <a-form-item :label="i18nText('1.9.403')">
17
+ <a-input-number v-decorator="['timeLengthHours']" :min="0" :max="99" />
18
+ <span class="setting-hours-text">小时</span>
19
+ <a-input-number v-decorator="['timeLengthMins']" :min="0" :max="59" />
20
+ {{ i18nText('2.2.6.6') }}
21
+ </a-form-item>
22
+ </a-col>
23
+ <a-col :span="8">
24
+ <a-form-item :label="i18nText('1.9.405')" class="ASC_DESC">
25
+ <a-radio-group v-decorator="['showMode']">
26
+ <a-radio value="ASC">{{ i18nText('1.9.406') }}</a-radio>
27
+ <a-radio value="DESC">{{ i18nText('1.9.407') }}</a-radio>
28
+ </a-radio-group>
29
+ </a-form-item>
30
+ </a-col>
31
+ </a-row>
32
+ <a-form-item style="margin-left: 20px;">
33
+ <a-checkbox @change="handleTimeDelayShow" :checked="showTimeDelay">{{ i18nText('1.9.408') }}</a-checkbox>
34
+ </a-form-item>
35
+ <template v-if="showTimeDelay">
36
+ <a-row class="delayed-setting">
37
+ <a-col :span="12">
38
+ <a-form-item :label="i18nText('1.9.409')">
39
+ <a-input-number :precision="0" :min="1" v-decorator="['delayed-timeLength']" style="width: 80px;"></a-input-number>
40
+ <span class="unit">{{ i18nText('2.2.6.6') }}</span>
41
+ </a-form-item>
42
+ </a-col>
43
+ <a-col :span="10">
44
+ <a-form-item :label="i18nText('1.9.410')">
45
+ <a-input-number :precision="0" :min="1" v-decorator="['rightOffRemindTime']" style="width: 80px;" @blur="handleRightOffRemindTimeBlur"></a-input-number>
46
+ <span class="unit">{{ i18nText('1.9.411') }}</span>
47
+ </a-form-item>
48
+ </a-col>
49
+ </a-row>
50
+ </template>
51
+ </template>
52
+ </div>
53
+ <div class="functional-module">
54
+ <span class="title">{{ i18nText('1.9.412') }}</span>
55
+ <a-form-item :label="i18nText('1.9.413')" class="server-form-item" v-if="!isStaff">
56
+ <template v-for="item in serverInfo">
57
+ <div :key="item.key" v-if="item.type === 'TEXT'" class="serverinfo-wrapper">
58
+ <a-tooltip placement="top">
59
+ <template slot="title">{{ item.title }}</template>
60
+ <span class="serverinfo-label">{{ item.title }}:</span>
61
+ </a-tooltip>
62
+ <a-input v-decorator="[item.key]" class="title-input" allowClear></a-input>
63
+ </div>
64
+ </template>
65
+ </a-form-item>
66
+ <a-form-item :label="i18nText('1.9.414')" v-if="!isStaff">
67
+ <template v-for="item in serverInfo">
68
+ <div :key="item.key" v-if="item.type === 'BUTTON'" class="serverinfo-wrapper">
69
+ <a-tooltip placement="top">
70
+ <template slot="title">{{ item.title }}</template>
71
+ <span class="serverinfo-label">{{ item.title }}:</span>
72
+ </a-tooltip>
73
+ <a-input v-decorator="[item.key]" class="title-input" allowClear></a-input>
74
+ </div>
75
+ </template>
76
+ </a-form-item>
77
+ <a-form-item :label="i18nText('1.9.415')" v-if="queryTimeSettingList.length > 0">
78
+ <!-- <a-checkbox-group
79
+ :options="queryTimeSettingList"
80
+ v-decorator="[`queryTimeSetting`]"
81
+ />-->
82
+ <a-radio-group :options="queryTimeSettingList" v-decorator="[`queryTimeSetting`]"></a-radio-group>
83
+ </a-form-item>
84
+ <a-form-item :label="i18nText('1.9.416')">
85
+ <a-checkbox-group v-if="isListClassify !== 'Y'" :options="functionList" v-decorator="[`functionSetting`]" />
86
+ </a-form-item>
87
+ <template v-if="isListClassify === 'Y'">
88
+ <div v-for="(item, index) in listClassify" :key="index" class="classify-wrapper">
89
+ <!-- <a-checkbox
90
+ @change="e => handleClassifyToggle(item, e)"
91
+ :checked="item.isChecked === 'Y'"
92
+ ></a-checkbox>-->
93
+ <div class="classify-item">
94
+ <div class="statistic">
95
+ <div>
96
+ <span class="name">{{ i18nText('1.9.417') }}:</span>
97
+ <svg-icon :icon-class="item.icon" style="font-size: 20px;margin-right: 8px;"></svg-icon>
98
+ <a-input v-model="item.name" allowClear style="width: 150px;"></a-input>
99
+ <a-checkbox v-if="item.isStatistic !== 'NOT'" style="width: 100px;margin-left: 10px;" @change="e => handleStatisticToggle(item, e)" :checked="item.isStatistic === 'Y'">{{
100
+ i18nText('1.9.418')
101
+ }}</a-checkbox>
102
+ <a-checkbox style="width: 100px;margin-left: 10px;" v-model="item.enable">启用</a-checkbox>
103
+ </div>
104
+ <a-tooltip placement="top">
105
+ <template slot="title">上移</template>
106
+ <a-icon v-if="listClassify.length > 1" @click="handleGroupUp(index)" type="up" style="margin-right: 10px;" />
107
+ </a-tooltip>
108
+ </div>
109
+ <div class="server">
110
+ <span class="name">{{ i18nText('1.9.419') }}</span>
111
+ <a-checkbox-group :options="item.serverfunctionList" v-model="item.serverfunctions" />
112
+ </div>
113
+ <div class="client">
114
+ <span class="name">{{ i18nText('1.9.420') }}</span>
115
+ <a-checkbox-group :options="item.clientfunctionList" v-model="item.clientfunctions" />
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </template>
120
+ <!-- 问诊TAB栏 -->
121
+ <a-form-item :label="i18nText('1.1.8.1.8') + '-' + i18nText('1.10.232')" v-if="!isStaff">
122
+ <template v-if="tabBarSetting.mobileSetting && tabBarSetting.mobileSetting.list">
123
+ <a-checkbox
124
+ v-for="(item, index) in tabBarSetting.mobileSetting.list"
125
+ :key="index"
126
+ :disabled="!tabBarMobileEnable || item.isMsgBar == 'Y'"
127
+ :checked="item.isChecked == 'Y'"
128
+ @input="v => handleCheckInput(v, item)"
129
+ >
130
+ {{ item.content }}
131
+ </a-checkbox>
132
+ </template>
133
+ </a-form-item>
134
+ <a-form-item :label="i18nText('1.9.421')" v-if="!isStaff">
135
+ <a-table bordered :columns="columns" :dataSource="serviceState" :pagination="false" :rowKey="getRowkey">
136
+ <template slot="operation" slot-scope="text, record">
137
+ <a-switch
138
+ :disabled="['ON-LINE', 'OFF-LINE'].includes(record.status)"
139
+ :checkedChildren="i18nText('1.9.422')"
140
+ :unCheckedChildren="i18nText('1.1.1.1.7')"
141
+ :checked="record.enable"
142
+ @change="() => handleStatusChange(record)"
143
+ />
144
+ </template>
145
+
146
+ <template slot="icon" slot-scope="text, record">
147
+ <svg-icon v-if="record.icon" :icon-class="record.icon" style="font-size:16px;"></svg-icon>
148
+ </template>
149
+ </a-table>
150
+ </a-form-item>
151
+ <a-form-item :label="i18nText('1.9.698')" v-if="toolbarList.length > 0">
152
+ <!-- <a-checkbox-group
153
+ :options="toolbarList"
154
+ v-decorator="[`toolbar`]"
155
+ /> -->
156
+ <a-checkbox-group v-decorator="[`toolbar`]">
157
+ <a-row>
158
+ <a-col>
159
+ <span style="display: inline-block;width: 70px;">PC:</span>
160
+ <a-checkbox @change="toolbarChange(item, $event)" :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'PC')" :key="index">
161
+ {{ item.label }}
162
+ </a-checkbox>
163
+ </a-col>
164
+ <a-col>
165
+ <span style="display: inline-block;width: 70px;">MOBILE:</span>
166
+ <a-checkbox @change="toolbarChange(item, $event)" :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'MOBILE')" :key="index">
167
+ {{ item.label }}
168
+ </a-checkbox>
169
+ </a-col>
170
+ </a-row>
171
+ </a-checkbox-group>
172
+ </a-form-item>
173
+ <a-form-item :label="i18nText('1.9.699')" v-if="toolbarList.length > 0">
174
+ <a-checkbox-group v-decorator="[`closedToolbar`]">
175
+ <a-row>
176
+ <a-col>
177
+ <span style="display: inline-block;width: 70px;">PC:</span>
178
+ <a-checkbox :value="item.value" v-for="(item, index) in closedToolbarList.filter(item => item.source === 'PC')" :key="index">
179
+ {{ item.label }}
180
+ </a-checkbox>
181
+ </a-col>
182
+ <a-col>
183
+ <span style="display: inline-block;width: 70px;">MOBILE:</span>
184
+ <a-checkbox :value="item.value" v-for="(item, index) in closedToolbarList.filter(item => item.source === 'MOBILE')" :key="index">
185
+ {{ item.label }}
186
+ </a-checkbox>
187
+ </a-col>
188
+ </a-row>
189
+ </a-checkbox-group>
190
+ </a-form-item>
191
+ </div>
192
+ <div class="functional-module" v-if="isListClassify !== 'Y' && !isStaff">
193
+ <span class="title">{{ i18nText('1.9.424') }}</span>
194
+ <a-form-item :label="i18nText('1.9.425')">
195
+ <a-checkbox-group :options="clientFunctionList" v-decorator="[`clientFunctionSetting`]" />
196
+ </a-form-item>
197
+ </div>
198
+ <div class="functional-module" v-if="!isStaff">
199
+ <span class="title" style="display: inline-block;margin-bottom: 10px;">
200
+ {{ i18nText('1.9.426') }}
201
+ <a-checkbox @change="handleEvaluate" :disabled="!evaluateId" :checked="evaluate"></a-checkbox>
202
+ </span>
203
+ </div>
204
+ <div class="functional-module" v-if="!isConference && !isStaff">
205
+ <span class="title" style="display: inline-block;margin-bottom: 10px;">
206
+ {{ i18nText('1.9.427') }}
207
+ <!-- <a-checkbox @change="handleBotSettingShow" :checked="showBotSetting"></a-checkbox> -->
208
+ </span>
209
+ <!-- <a-row class="bot-setting" v-if="showBotSetting">
210
+ <a-col :span="4">
211
+ <a-form-item label="secretId">
212
+ <a-input v-decorator="['secretId']" style="width: 150px;"></a-input>
213
+ </a-form-item>
214
+ </a-col>
215
+ <a-col :span="5">
216
+ <a-form-item label="secretKey">
217
+ <a-input v-decorator="['secretKey']" style="width: 150px;"></a-input>
218
+ </a-form-item>
219
+ </a-col>
220
+ </a-row>
221
+
222
+ <a-row class="bot-setting" v-if="showBotSetting">
223
+ <a-form-item label="botId">
224
+ <a-input v-decorator="['botId']" style="width: 150px;"></a-input>
225
+ </a-form-item>
226
+ </a-row> -->
227
+ <a-row class="bot-setting">
228
+ <a-form-item label="选择机器人">
229
+ <a-select v-decorator="['robotId']" :placeholder="'选择机器人'" style="width: 200px;" allowClear showSearch :filterOption="filterOption">
230
+ <a-select-option v-for="robot in robotList" :key="robot.id" :value="robot.id">{{ robot.name }}</a-select-option>
231
+ </a-select>
232
+ </a-form-item>
233
+ </a-row>
234
+ <a-row class="bot-setting">
235
+ <a-form-item>
236
+ <a-radio-group v-decorator="['mode']">
237
+ <a-radio value="ROBOT_CHAT">机器人和人工客服</a-radio>
238
+ <a-radio value="ROBOT">仅机器人</a-radio>
239
+ </a-radio-group>
240
+ </a-form-item>
241
+ </a-row>
242
+ </div>
243
+ <div class="functional-module">
244
+ <span class="title" style="display: block;margin-bottom: 10px;">
245
+ 公共短语
246
+ </span>
247
+ <a-select style="width: 300px;margin-top: 15px;" mode="multiple" v-model="chatPublicCategory" showSearch placeholder="请选择">
248
+ <a-select-option v-for="item in chatPublicCategoryList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
249
+ </a-select>
250
+ </div>
251
+ <div class="functional-module">
252
+ <span class="title">{{ i18nText('1.9.428') }}</span>
253
+ <div class="broadcaste-wrap" v-for="(b, key) in broadcastList" :key="b.type">
254
+ <div class="broadcaste-title">
255
+ <a-switch v-model="b.isChecked" :checkedChildren="i18nText('1.9.422')" :unCheckedChildren="i18nText('1.1.1.1.7')" />
256
+ <span>{{ key === 'PC' ? i18nText('1.9.429') : i18nText('1.1.8.1.8') }}</span>
257
+ <a-icon type="plus-circle" theme="filled" style="color: green; fontSize: 18px;" @click="addBroadcast(b.type, b.list)" />
258
+ </div>
259
+ <ul>
260
+ <li v-for="(v, i) in b.list" :key="i" class="broadcaste-item">
261
+ <div>
262
+ <span class="item-title">{{ i18nText('3.19.5') }}</span>
263
+ <a-input v-model="v.content" allowClear />
264
+ </div>
265
+ <div>
266
+ <span class="item-title">{{ i18nText('2.22.8.2') }}</span>
267
+ <a-input v-model="v.url" allowClear />
268
+ </div>
269
+ <svg-icon @click="deleteBroadcast(i, b.list)" class="form-action svg-icon-btn" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" style="margin-left: 4px;" />
270
+ </li>
271
+ </ul>
272
+ </div>
273
+ </div>
274
+ <div class="functional-module" v-if="!isStaff">
275
+ <span class="title" style="display: inline-block;margin-bottom: 10px;"> {{ i18nText('1.9.678') }}: </span>
276
+ <ul>
277
+ <li v-for="(item, i) in refuseReasonList" :key="i" class="refuse-item">
278
+ <a-input v-model.trim="item.text" :maxLength="15"></a-input>
279
+ <svg-icon class="form-action svg-icon-btn" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" @click="refuseReasonDel(i)" />
280
+ </li>
281
+ </ul>
282
+ <a-button class="refuse-add-btn" type="link" size="small" :disabled="refuseReasonList.length > 4" @click="refuseReasonAdd">
283
+ <svg-icon icon-class="xinzengwenjian" style="margin-right:6px" />
284
+ 添加
285
+ </a-button>
286
+ </div>
287
+ <div class="functional-module" v-if="!isStaff">
288
+ <span class="title" style="display: inline-block;margin-bottom: 10px;">
289
+ 环境变量设置:
290
+ </span>
291
+ <a-row v-for="(item, index) in variableSetting" :key="index">
292
+ <a-col :span="4">
293
+ <a-form-item label="变量名称">
294
+ <a-input v-model="item.name" style="width: 200px;" disabled></a-input>
295
+ </a-form-item>
296
+ </a-col>
297
+ <a-col :span="4">
298
+ <a-form-item label="变量值">
299
+ <a-input v-model="item.value" style="width: 200px"></a-input>
300
+ </a-form-item>
301
+ </a-col>
302
+ <a-col :span="5">
303
+ <a-form-item label="备注">
304
+ <a-input v-model="item.remark" style="width: 200px;" disabled></a-input>
305
+ </a-form-item>
306
+ </a-col>
307
+ </a-row>
308
+ </div>
309
+ <div class="functional-module rightClickSetting">
310
+ <span class="title" style="display: inline-block;margin-bottom: 10px;">
311
+ 右键设置
312
+ <a-icon type="plus-circle" theme="filled" style="color: green; fontSize: 18px;" @click="addRightClick()" />
313
+ </span>
314
+ <a-row v-for="(item, index) in rightClickSetting" :key="index">
315
+ <a-col :span="handleRightClickSpan(item)">
316
+ <a-form-item label="名称" class="rightClick-form">
317
+ <a-input v-model="item.rightClickName" style="width: 98%" allowClear></a-input>
318
+ </a-form-item>
319
+ </a-col>
320
+ <a-col :span="handleRightClickSpan(item)">
321
+ <a-form-item label="操作" class="rightClick-form">
322
+ <a-select style="width: 98%" v-model="item.rightClickDo" allowClear showSearch :filterOption="filterOption" placeholder="请选择">
323
+ <a-select-option v-for="(i, index) in rightClickDoList" :key="index" :value="i.value">{{ i.label }}</a-select-option>
324
+ </a-select>
325
+ </a-form-item>
326
+ </a-col>
327
+ <a-col :span="11" v-if="item.rightClickDo === 'jumpUrl'">
328
+ <a-form-item label="外部地址" class="rightClick-form">
329
+ <a-input v-model="item.rightClickUrl" style="width: 100%;" allowClear></a-input>
330
+ </a-form-item>
331
+ </a-col>
332
+ <svg-icon @click="deleteRightClick(index)" class="form-action svg-icon-btn" icon-class="xitongtubiaoliebiaocaozuoanniushanchushixin" style="margin: 8px 0 0 4px;" />
333
+ </a-row>
334
+ </div>
335
+ <div class="functional-module" v-if="!isConference && !isStaff">
336
+ <span class="title" style="display: inline-block;margin-bottom: 10px;">
337
+ 聊天客户端接入地址
338
+ </span>
339
+ <a-row class="client-url">
340
+ <a-col :span="3">PC端:</a-col>
341
+ <a-col :span="20">{{ pcUrl }} </a-col>
342
+ </a-row>
343
+ <a-row class="client-url">
344
+ <a-col :span="3">移动端:</a-col>
345
+ <a-col :span="20">{{ mobileUrl }} </a-col>
346
+ </a-row>
347
+ </div>
348
+ </a-form>
349
+ </div>
350
+ <div class="form-bottom">
351
+ <!-- <a-button @click="handleCancel">取消</a-button> -->
352
+ <a-button type="primary" @click="handleSubmit" style="margin-left: 10px;">{{ i18nText('3.5.29') }}</a-button>
353
+ </div>
354
+ </div>
355
+ </template>
356
+
357
+ <script>
358
+ import { mapGetters } from '../../store/helper';
359
+ import fetch, { qs } from '@/utils/chatFetch';
360
+ import vexutils from '@/utils/vexutils';
361
+ import { Checkbox, Col, Form, Icon, Input, InputNumber, Radio, Row, Select, Tooltip, Table, Switch, Button } from 'ant-design-vue';
362
+ import SvgIcon from '@/component/svg/index.vue';
363
+
364
+ export default {
365
+ inject: ['store', 'i18nText', 'dispatchEvent'],
366
+ components: {
367
+ [Icon.name]: Icon,
368
+ [Row.name]: Row,
369
+ [Col.name]: Col,
370
+ [Form.name]: Form,
371
+ [Form.Item.name]: Form.Item,
372
+ [Checkbox.name]: Checkbox,
373
+ [Select.name]: Select,
374
+ [Select.Option.name]: Select.Option,
375
+ [Radio.name]: Radio,
376
+ [Radio.Group.name]: Radio.Group,
377
+ [InputNumber.name]: InputNumber,
378
+ [Tooltip.name]: Tooltip,
379
+ [Checkbox.Group.name]: Checkbox.Group,
380
+ [Input.name]: Input,
381
+ [Table.name]: Table,
382
+ [Switch.name]: Switch,
383
+ [Button.name]: Button,
384
+ SvgIcon
385
+ },
386
+ props: ['assemblyId', 'webURL'],
387
+ data() {
388
+ return {
389
+ isListClassify: '',
390
+ listClassify: [],
391
+ showTimeSetting: false,
392
+ showTimeDelay: false,
393
+ showBotSetting: false,
394
+ evaluate: false,
395
+ readStatus: false,
396
+ lineUpNotice: false,
397
+ evaluateId: '',
398
+ timeLength: '', // 会话时长,分钟计算
399
+ functionSetting: [], // 服务端功能
400
+ clientFunctionSetting: [], // 客户端功能
401
+ functionList: [], // 服务端功能下拉列表
402
+ clientFunctionList: [], // 客户端功能下拉列表
403
+ toolbar: [],
404
+ toolbarList: [],
405
+ closedToolbarList: [],
406
+ queryTimeSetting: [],
407
+ queryTimeSettingList: [],
408
+ serviceState: [],
409
+ serverInfo: [],
410
+ tabBarSetting: {},
411
+ columns: [
412
+ {
413
+ title: this.i18nText('1.9.417'),
414
+ dataIndex: 'title',
415
+ key: 'title',
416
+ align: 'center'
417
+ },
418
+ {
419
+ title: this.i18nText('1.2.1.4.4'),
420
+ dataIndex: 'description',
421
+ key: 'description',
422
+ align: 'center'
423
+ },
424
+ {
425
+ title: this.i18nText('1.2.1.3.24'),
426
+ dataIndex: 'updatedBy',
427
+ key: 'updatedBy',
428
+ align: 'center',
429
+ scopedSlots: { customRender: 'operation' }
430
+ },
431
+ {
432
+ title: 'icon',
433
+ dataIndex: 'icon',
434
+ key: 'icon',
435
+ align: 'center',
436
+ scopedSlots: { customRender: 'icon' }
437
+ }
438
+ ],
439
+ submitData: { setting: {} },
440
+ id: '',
441
+ originSetting: {},
442
+ broadcastList: {
443
+ PC: {
444
+ isChecked: false,
445
+ list: []
446
+ },
447
+ MOBILE: {
448
+ isChecked: false,
449
+ list: []
450
+ }
451
+ },
452
+ robotList: [],
453
+ variableSetting: [
454
+ {
455
+ name: 'QUEUE_NOTICE_TIME',
456
+ value: '5',
457
+ remark: '每个会话平均时长'
458
+ }
459
+ ],
460
+ chatPublicCategoryList: [],
461
+ chatPublicCategory: '',
462
+ rightClickSetting: [],
463
+ rightClickDoList: [
464
+ { label: '撤回', value: 'rollBack' },
465
+ { label: '外部地址', value: 'jumpUrl' },
466
+ { label: '重新发送', value: 'resend' }
467
+ ],
468
+ clientInfo: {},
469
+ mobileUrl: '',
470
+ pcUrl: '',
471
+ refuseReasonList: []
472
+ };
473
+ },
474
+ computed: {
475
+ ...mapGetters(['userInfo', 'assemblySetting']),
476
+ orgId() {
477
+ return this.userInfo?.sysParams?.orgId;
478
+ },
479
+ isConference() {
480
+ return this.assemblySetting?.type == 'conference';
481
+ },
482
+ isStaff() {
483
+ return this.assemblySetting?.type == 'staff';
484
+ },
485
+ tabBarMobileEnable() {
486
+ const isChecked = this.tabBarSetting?.mobileSetting?.isChecked;
487
+ return isChecked == 'Y';
488
+ },
489
+ handleRightClickSpan() {
490
+ return function(item) {
491
+ if (item.rightClickDo === 'jumpUrl') return 5;
492
+ return 11;
493
+ };
494
+ }
495
+ },
496
+ beforeCreate() {
497
+ this.form = this.$form.createForm(this, { name: 'strategy-condition' });
498
+ },
499
+ created() {
500
+ this.init();
501
+ this.getBaseInfo();
502
+ if (!this.isConference) {
503
+ this.getRobotAll();
504
+ }
505
+ },
506
+ watch: {},
507
+ methods: {
508
+ filterOption(...args) {
509
+ return vexutils.filterOption.apply(this, args);
510
+ },
511
+ init() {
512
+ this.mobileUrl = `${location.origin}${this.webURL}/h5/#/multiChat?assemblyId=${this.assemblyId || 'xxx'}&orgId=${this.orgId || 'xxx'}&userId=xxx&userType=xxx&name=xxx`;
513
+ this.pcUrl = `${location.origin}${this.webURL}/web/#/multiChat?isOriginPage=1&assemblyId=${this.assemblyId || 'xxx'}&orgId=${this.orgId || 'xxx'}&userId=xxx&userType=xxx&name=xxx`;
514
+ },
515
+ /* 入口 */
516
+ getBaseInfo() {
517
+ fetch
518
+ .get('/chat/event/getSysBaseInformation', {
519
+ params: {
520
+ assemblyId: this.assemblyId,
521
+ type: 'BASE_INFORMATION'
522
+ }
523
+ })
524
+ .then(({ data }) => {
525
+ if (data.result === 'SUCCESS') {
526
+ const chatPublicCategoryList = data.map?.chatPublicCategoryList || [];
527
+ this.chatPublicCategoryList = chatPublicCategoryList.filter(v => v);
528
+ let info = data.map.imformation[0];
529
+ if (info) {
530
+ this.id = info.id || null;
531
+ let setting = info.settingObj;
532
+ this.originSetting = setting;
533
+ this.fillInfoData(setting);
534
+ }
535
+ }
536
+ });
537
+ },
538
+ /* 编辑回填 */
539
+ fillInfoData(setting) {
540
+ let {
541
+ timingSettingSwitch,
542
+ timingSetting,
543
+ serverSetting,
544
+ clientSetting,
545
+ queryTimeSetting = [],
546
+ robotObj,
547
+ robotSetting,
548
+ toolbar = [],
549
+ isListClassify,
550
+ listClassify = [],
551
+ rightClickSetting = [],
552
+ variableSetting = [],
553
+ chatPublicCategory,
554
+ evaluate,
555
+ readStatus,
556
+ lineUpNotice,
557
+ broadcast
558
+ } = setting;
559
+ this.readStatus = readStatus === 'Y';
560
+ this.lineUpNotice = lineUpNotice === 'Y';
561
+ this.showTimeSetting = timingSettingSwitch === '1';
562
+ this.isListClassify = isListClassify;
563
+ this.rightClickSetting = rightClickSetting;
564
+ this.variableSetting = variableSetting;
565
+ // 拒绝原因
566
+ this.refuseReasonList = setting?.refuseReasonSetting?.list || [];
567
+ if (chatPublicCategory) {
568
+ this.chatPublicCategory = chatPublicCategory.split(',');
569
+ } else {
570
+ this.chatPublicCategory = [];
571
+ }
572
+ this.fillListClassify(listClassify);
573
+ this.$nextTick(() => {
574
+ this.fillServiceSetting(serverSetting);
575
+ });
576
+ this.fillClientSetting(clientSetting);
577
+ this.fillToolbar(toolbar);
578
+ this.fillQueryTimeSetting(queryTimeSetting);
579
+ this.fillBroadcast(broadcast);
580
+ this.fillTabBar(setting.tabBarSetting);
581
+ this.$nextTick().then(() => {
582
+ this.fillTimeSetting(timingSetting);
583
+ });
584
+ if (robotObj?.switch) {
585
+ this.showBotSetting = true;
586
+ let { secretId, secretKey, botId } = robotObj;
587
+ this.$nextTick().then(() => {
588
+ !this.isConference &&
589
+ !this.isStaff &&
590
+ this.form.setFieldsValue({
591
+ secretKey,
592
+ secretId,
593
+ botId
594
+ });
595
+ });
596
+ }
597
+ !this.isConference && !this.isStaff && this.fillRobotSetting(robotSetting);
598
+ if (evaluate) {
599
+ this.evaluate = evaluate.isChecked === 'Y';
600
+ this.evaluateId = evaluate.id;
601
+ }
602
+ },
603
+ fillQueryTimeSetting(queryTimeSetting) {
604
+ this.queryTimeSettingList = queryTimeSetting.map(item => ({
605
+ label: item.title,
606
+ value: item.title
607
+ }));
608
+ this.queryTimeSetting = queryTimeSetting;
609
+ // let queryTimeSettingChecked = queryTimeSetting.reduce((result, item) => {
610
+ // if (item.isChecked === "Y") {
611
+ // result.push(item.title);
612
+ // }
613
+ // return result;
614
+ // }, []);
615
+ let queryTimeSettingChecked = queryTimeSetting.filter(item => item.isChecked === 'Y')[0]?.title;
616
+ this.$nextTick(() => {
617
+ this.form.setFieldsValue({ queryTimeSetting: queryTimeSettingChecked });
618
+ });
619
+ },
620
+ fillRobotSetting(robotSetting) {
621
+ if (!robotSetting) return;
622
+ let { robotId, mode } = robotSetting;
623
+ this.$nextTick(() => {
624
+ this.form.setFieldsValue({ robotId, mode });
625
+ });
626
+ },
627
+ fillBroadcast(broadcast) {
628
+ if (!broadcast) return;
629
+ for (let i in broadcast) {
630
+ let item = broadcast[i];
631
+ item.isChecked = item.isChecked == 'Y' ? true : false;
632
+ if (!item.list) {
633
+ item.list = [];
634
+ }
635
+ }
636
+ this.broadcastList = broadcast;
637
+ },
638
+ fillToolbar(toolbar) {
639
+ this.toolbarList = toolbar.map(item => ({
640
+ label: item.name,
641
+ value: item.name + '-' + item.source + '-' + item.key,
642
+ source: item.source,
643
+ isClosedAble: item.isClosedAble,
644
+ isCloseChecked: item.isCloseChecked
645
+ }));
646
+ const btwList = toolbar.filter(item => item.isClosedAble == "Y" && item.isChecked == "Y");
647
+ this.closedToolbarList = btwList.map(item => ({
648
+ label: item.name,
649
+ value: item.name + '-' + item.source + '-' + item.key,
650
+ source: item.source,
651
+ isClosedAble: item.isClosedAble,
652
+ isCloseChecked: item.isCloseChecked
653
+ }));
654
+ this.toolbar = toolbar;
655
+ let toolbarChecked = toolbar.reduce((result, item) => {
656
+ if (item.isChecked === 'Y') {
657
+ result.push(item.name + '-' + item.source + '-' + item.key);
658
+ }
659
+ return result;
660
+ }, []);
661
+ this.$nextTick(() => {
662
+ this.form.setFieldsValue({ toolbar: toolbarChecked });
663
+ });
664
+ let closedToolbarChecked = this.closedToolbarList.reduce((result, item) => {
665
+ if (item.isCloseChecked === 'Y') {
666
+ result.push(item.label + '-' + item.source + '-' + item.key);
667
+ }
668
+ return result;
669
+ }, []);
670
+ this.$nextTick(() => {
671
+ this.form.setFieldsValue({ closedToolbar: closedToolbarChecked });
672
+ });
673
+ },
674
+ toolbarChange(item, e) {
675
+ const checked = e.target.checked;
676
+ let checkedItemIndex = -1;
677
+ const checkedItems = [];
678
+ this.closedToolbarList.forEach((itm, index) => {
679
+ if (item.source == itm.source && item.value == itm.value) {
680
+ checkedItemIndex = index;
681
+ } else {
682
+ checkedItems.push(itm.value);
683
+ }
684
+ })
685
+ if (checked && checkedItemIndex == -1 && item.isClosedAble == "Y") {
686
+ this.closedToolbarList.push(item);
687
+ } else if (!checked && checkedItemIndex != -1) {
688
+ this.form.setFieldsValue({ closedToolbar: checkedItems });
689
+ this.closedToolbarList.splice(checkedItemIndex, 1);
690
+ }
691
+ },
692
+ fillTabBar(data) {
693
+ const mobileSetting = {
694
+ isChecked: 'N',
695
+ list: []
696
+ };
697
+ if (data.mobileSetting) {
698
+ mobileSetting.isChecked = data.mobileSetting.isChecked || mobileSetting.isChecked;
699
+ mobileSetting.list = (data?.mobileSetting?.list || []).map(v => {
700
+ return Object.assign({}, v, {
701
+ isChecked: v.isChecked || 'Y' // 无isChecked的旧数据设值为Y
702
+ });
703
+ });
704
+ }
705
+ this.tabBarSetting = {
706
+ mobileSetting
707
+ };
708
+ },
709
+ /* 回填时间设置 */
710
+ fillTimeSetting(timeSetting) {
711
+ if (this.isStaff) return;
712
+ let { timeLength, showMode, delayedSetting, delayed } = timeSetting;
713
+ this.timeLength = timeLength;
714
+ let timeLengthMins = ''
715
+ let timeLengthHours = ''
716
+ if (this.timeLength) {
717
+ timeLengthMins = parseInt(this.timeLength) % 60;
718
+ timeLengthHours = parseInt(parseInt(this.timeLength) / 60);
719
+ }
720
+ this.form.setFieldsValue({
721
+ timeLengthMins,
722
+ timeLengthHours,
723
+ showMode
724
+ });
725
+ if (delayed) {
726
+ this.showTimeDelay = true;
727
+ let { timeLength, rightOffRemindTime } = delayedSetting;
728
+ this.$nextTick().then(() => {
729
+ this.form.setFieldsValue({
730
+ 'delayed-timeLength': timeLength,
731
+ rightOffRemindTime
732
+ });
733
+ });
734
+ }
735
+ },
736
+ fillListClassify(listClassify) {
737
+ if (this.isListClassify !== 'Y') {
738
+ return;
739
+ }
740
+ this.listClassify = listClassify;
741
+ this.listClassify.forEach(item => {
742
+ let serverfunctionList = [];
743
+ let serverfunctions = [];
744
+ let clientfunctionList = [];
745
+ let clientfunctions = [];
746
+ item.serverFunctionSetting.map(i => {
747
+ if (i.isshow === 'Y') {
748
+ serverfunctionList.push({
749
+ label: i.fTitle,
750
+ value: i.function
751
+ });
752
+ }
753
+ if (i.isChecked === 'Y') {
754
+ serverfunctions.push(i.function);
755
+ }
756
+ });
757
+ item.clientFunctionSetting.map(i => {
758
+ if (i.isshow === 'Y') {
759
+ clientfunctionList.push({
760
+ label: i.fTitle,
761
+ value: i.function
762
+ });
763
+ }
764
+ if (i.isChecked === 'Y') {
765
+ clientfunctions.push(i.function);
766
+ }
767
+ });
768
+ if (item.enable === undefined) {
769
+ this.$set(item, 'enable', true);
770
+ }
771
+ this.$set(item, 'serverfunctionList', serverfunctionList);
772
+ this.$set(item, 'serverfunctions', serverfunctions);
773
+ this.$set(item, 'clientfunctionList', clientfunctionList);
774
+ this.$set(item, 'clientfunctions', clientfunctions);
775
+ });
776
+ },
777
+ /* 回填服务端设置 */
778
+ fillServiceSetting(serverSetting) {
779
+ let { serverInfo, functionSetting, serviceState } = serverSetting;
780
+
781
+ this.serverInfo = serverInfo;
782
+ this.$nextTick().then(() => {
783
+ !this.isStaff &&
784
+ serverInfo.map(item => {
785
+ this.form.setFieldsValue({ [item.key]: item.value });
786
+ });
787
+ });
788
+ this.serviceState = serviceState;
789
+
790
+ if (this.isListClassify === 'Y') {
791
+ return;
792
+ }
793
+
794
+ this.functionSetting = functionSetting;
795
+ this.getFunctionList();
796
+ let serverFunction = functionSetting.reduce((server, item) => {
797
+ if (item.isChecked === 'Y') {
798
+ server.push(item.function);
799
+ }
800
+ return server;
801
+ }, []);
802
+ this.form.setFieldsValue({ functionSetting: serverFunction });
803
+ },
804
+ /* 回填客户端设置 */
805
+ fillClientSetting(clientSetting) {
806
+ if (this.isListClassify === 'Y' || this.isStaff) return;
807
+ let { functionSetting } = clientSetting;
808
+ this.clientFunctionSetting = functionSetting;
809
+ this.getClientFunctionList();
810
+ let clientFunction = functionSetting.reduce((client, item) => {
811
+ if (item.isChecked === 'Y') {
812
+ client.push(item.function);
813
+ }
814
+ return client;
815
+ }, []);
816
+ this.form.setFieldsValue({ clientFunctionSetting: clientFunction });
817
+ },
818
+ getFunctionList() {
819
+ let functionList = [];
820
+ this.functionSetting.map(item => {
821
+ if (item.isshow === 'Y') {
822
+ functionList.push({
823
+ label: item.fTitle,
824
+ value: item.function
825
+ });
826
+ }
827
+ this.functionList = functionList;
828
+ });
829
+ },
830
+ getClientFunctionList() {
831
+ let clientFunctionList = [];
832
+ this.clientFunctionSetting.map(item => {
833
+ if (item.isshow === 'Y') {
834
+ clientFunctionList.push({
835
+ label: item.fTitle,
836
+ value: item.function
837
+ });
838
+ }
839
+ });
840
+ this.clientFunctionList = clientFunctionList;
841
+ },
842
+ getRowkey(record) {
843
+ return record.status;
844
+ },
845
+ handleTimeSettingShow(e) {
846
+ this.showTimeSetting = e.target.checked;
847
+ },
848
+ handleTimeDelayShow(e) {
849
+ this.showTimeDelay = e.target.checked;
850
+ },
851
+ handleBotSettingShow(e) {
852
+ this.showBotSetting = e.target.checked;
853
+ },
854
+ getRobotAll() {
855
+ this.spinningText = '3.2.8';
856
+ let url = '/robot/getAll';
857
+ return fetch.get(url).then(({ data }) => {
858
+ if (data.result === 'SUCCESS') {
859
+ let { list = [] } = data;
860
+ if (list && list.length > 0) {
861
+ this.robotList = list;
862
+ }
863
+ }
864
+ });
865
+ },
866
+ handleEvaluate(e) {
867
+ this.evaluate = e.target.checked;
868
+ },
869
+ handleStatusChange(record) {
870
+ record.enable = !record.enable;
871
+ },
872
+ handleSubmit() {
873
+ this.form.validateFields((err, values) => {
874
+ if (err) return;
875
+ let setting = {};
876
+ this.handleTimeSetting(setting, values);
877
+ this.handleToolbar(setting, values);
878
+ this.handleQueryTimeSetting(setting, values);
879
+ this.handleClassify(setting);
880
+ let validate = this.handleServiceSetting(setting, values);
881
+ if (validate) return;
882
+ let broadcastValidate = this.handleBroadcast(setting);
883
+ if (!broadcastValidate) return;
884
+ this.handleClientSetting(setting, values);
885
+ setting.robotObj = {
886
+ switch: this.showBotSetting,
887
+ secretId: this.form.getFieldValue('secretId'),
888
+ secretKey: this.form.getFieldValue('secretKey'),
889
+ botId: this.form.getFieldValue('botId')
890
+ };
891
+ setting.robotSetting = {
892
+ robotId: this.form.getFieldValue('robotId'),
893
+ mode: this.form.getFieldValue('mode')
894
+ };
895
+ setting.chatPublicCategory = this.chatPublicCategory.join(',');
896
+ setting.rightClickSetting = this.rightClickSetting;
897
+ setting.variableSetting = this.variableSetting;
898
+ setting.tabBarSetting = this.tabBarSetting;
899
+ setting.refuseReasonSetting = {
900
+ list: this.refuseReasonList
901
+ };
902
+ setting = Object.assign({}, this.originSetting, setting);
903
+ if (!setting.evaluate) {
904
+ setting.evaluate = {};
905
+ }
906
+ setting.evaluate.isChecked = this.evaluate ? 'Y' : 'N';
907
+ setting.readStatus = this.readStatus ? 'Y' : 'N';
908
+ setting.lineUpNotice = this.lineUpNotice ? 'Y' : 'N';
909
+ this.submitData.setting = JSON.stringify(setting);
910
+ this.submitData.type = 'BASE_INFORMATION';
911
+ this.submitData.assemblyId = this.assemblyId;
912
+ if (this.id) {
913
+ this.submitData.id = this.id;
914
+ }
915
+
916
+ this.saveSysBaseInformation();
917
+ });
918
+ },
919
+ saveSysBaseInformation() {
920
+ fetch.post('/chat/event/saveSysBaseInformation', qs.stringify(this.submitData)).then(({ data }) => {
921
+ if (data.result === 'SUCCESS') {
922
+ this.dispatchEvent('set_sysInfoSuccess', data.map);
923
+ this.$message.success(this.i18nText('1.10.52'));
924
+ }
925
+ });
926
+ },
927
+ handleClassify(setting) {
928
+ if (this.isListClassify !== 'Y') return;
929
+ let listClassify = JSON.parse(JSON.stringify(this.listClassify));
930
+ listClassify.forEach(item => {
931
+ item.serverFunctionSetting.map(i => {
932
+ if (item.serverfunctions.includes(i.function)) {
933
+ i.isChecked = 'Y';
934
+ } else {
935
+ i.isChecked = 'N';
936
+ }
937
+ });
938
+ item.clientFunctionSetting.map(i => {
939
+ if (item.clientfunctions.includes(i.function)) {
940
+ i.isChecked = 'Y';
941
+ } else {
942
+ i.isChecked = 'N';
943
+ }
944
+ });
945
+ delete item.serverfunctions;
946
+ delete item.serverfunctionList;
947
+ delete item.clientfunctions;
948
+ delete item.clientfunctionList;
949
+ });
950
+ setting.listClassify = listClassify;
951
+ },
952
+ handleQueryTimeSetting(setting, values) {
953
+ if (this.queryTimeSettingList.length === 0) return;
954
+ let { queryTimeSetting } = values;
955
+ let clone = JSON.parse(JSON.stringify(this.queryTimeSetting));
956
+ setting.queryTimeSetting = clone.reduce((result, item) => {
957
+ if (queryTimeSetting === item.title) {
958
+ item.isChecked = 'Y';
959
+ } else {
960
+ item.isChecked = 'N';
961
+ }
962
+ result.push(item);
963
+ return result;
964
+ }, []);
965
+ },
966
+ handleToolbar(setting, values) {
967
+ if (this.toolbarList.length === 0) return;
968
+ let { toolbar, closedToolbar } = values;
969
+ let clone = JSON.parse(JSON.stringify(this.toolbar));
970
+ setting.toolbar = clone.reduce((result, item) => {
971
+ if (toolbar.includes(item.name + '-' + item.source + '-' + item.key)) {
972
+ item.isChecked = 'Y';
973
+ } else {
974
+ item.isChecked = 'N';
975
+ }
976
+ if (closedToolbar.includes(item.name + '-' + item.source + '-' + item.key)) {
977
+ item.isCloseChecked = 'Y';
978
+ } else {
979
+ item.isCloseChecked = 'N';
980
+ }
981
+ result.push(item);
982
+ return result;
983
+ }, []);
984
+ },
985
+ /* 客户端设置 */
986
+ handleClientSetting(setting, values) {
987
+ if (this.isListClassify === 'Y') return;
988
+ setting.clientSetting = {
989
+ functionSetting: []
990
+ };
991
+ let { clientFunctionSetting } = values;
992
+ let clientFunctionClone = JSON.parse(JSON.stringify(this.clientFunctionSetting));
993
+ setting.clientSetting.functionSetting = clientFunctionClone.reduce((result, func) => {
994
+ if (clientFunctionSetting.includes(func.function)) {
995
+ func.isChecked = 'Y';
996
+ } else {
997
+ func.isChecked = 'N';
998
+ }
999
+ result.push(func);
1000
+ return result;
1001
+ }, []);
1002
+ },
1003
+ /* 服务端设置 */
1004
+ handleServiceSetting(setting, values) {
1005
+ setting.serverSetting = {
1006
+ serverInfo: {},
1007
+ functionSetting: [],
1008
+ serviceState: []
1009
+ };
1010
+
1011
+ this.serverInfo.map(item => {
1012
+ item.value = this.form.getFieldValue(item.key);
1013
+ });
1014
+ for (let i = 0; i < this.serverInfo.length; i++) {
1015
+ let info = this.serverInfo[i];
1016
+ if (!info.value && info.key != 'customerName' && !this.isStaff) {
1017
+ this.$message.error(`${info.title} ${this.i18nText('1.9.430')}!`);
1018
+ return true;
1019
+ }
1020
+ }
1021
+ setting.serverSetting.serverInfo = this.serverInfo;
1022
+ if (this.isListClassify === 'Y') return;
1023
+ let { functionSetting } = values;
1024
+ let functionSettingClone = JSON.parse(JSON.stringify(this.functionSetting));
1025
+ setting.serverSetting.functionSetting = functionSettingClone.reduce((result, func) => {
1026
+ if (functionSetting.includes(func.function)) {
1027
+ func.isChecked = 'Y';
1028
+ } else {
1029
+ func.isChecked = 'N';
1030
+ }
1031
+ result.push(func);
1032
+ return result;
1033
+ }, []);
1034
+ setting.serverSetting.serviceState = this.serviceState;
1035
+ },
1036
+ handleBroadcast(setting) {
1037
+ setting.broadcast = {};
1038
+ for (let i in this.broadcastList) {
1039
+ let broadcastItem = this.broadcastList[i];
1040
+ for (let j = 0; j < broadcastItem.list.length; j++) {
1041
+ let item = broadcastItem.list[j];
1042
+ if (!item.content) {
1043
+ this.$message.error(`${this.i18nText('1.2.1.11.60')}!`);
1044
+ return false;
1045
+ }
1046
+ }
1047
+ }
1048
+ let copyList = JSON.parse(JSON.stringify(this.broadcastList));
1049
+ for (let i in copyList) {
1050
+ let item = copyList[i];
1051
+ item.isChecked = item.isChecked ? 'Y' : 'N';
1052
+ }
1053
+ setting.broadcast = copyList;
1054
+ return true;
1055
+ },
1056
+ /* 聊天设置 */
1057
+ handleTimeSetting(setting, values) {
1058
+ setting.timingSettingSwitch = this.showTimeSetting ? '1' : '0';
1059
+ setting.timingSetting = {};
1060
+ if (this.showTimeSetting) {
1061
+ let { showMode, timeLengthMins, timeLengthHours } = values;
1062
+ let settingMins = timeLengthMins ? timeLengthMins : 0;
1063
+ let settingHours = timeLengthHours ? timeLengthHours : 0;
1064
+ this.timeLength = settingMins + settingHours * 60;
1065
+ Object.assign(setting.timingSetting, { timeLength: this.timeLength, showMode });
1066
+ setting.timingSetting.delayedSetting = {};
1067
+ }
1068
+ if (this.showTimeDelay && this.showTimeSetting) {
1069
+ let { 'delayed-timeLength': timeLength, rightOffRemindTime } = values;
1070
+ setting.timingSetting.delayed = true;
1071
+ Object.assign(setting.timingSetting.delayedSetting, {
1072
+ timeLength,
1073
+ rightOffRemindTime
1074
+ });
1075
+ }
1076
+ },
1077
+ handleCancel() {},
1078
+ handleClassifyToggle(item, e) {
1079
+ this.$set(item, 'isChecked', e.target.checked ? 'Y' : 'N');
1080
+ },
1081
+ handleStatisticToggle(item, e) {
1082
+ item.isStatistic = e.target.checked ? 'Y' : 'N';
1083
+ },
1084
+ handleCheckInput(v, item, key = 'isChecked') {
1085
+ item[key] = v ? 'Y' : 'N';
1086
+ },
1087
+ addBroadcast(type, list) {
1088
+ let item = {
1089
+ content: '',
1090
+ url: ''
1091
+ };
1092
+ list.push(item);
1093
+ },
1094
+ deleteBroadcast(index, list) {
1095
+ list.splice(index, 1);
1096
+ },
1097
+ addRightClick() {
1098
+ this.rightClickSetting = this.rightClickSetting.concat({
1099
+ rightClickName: '',
1100
+ rightClickUrl: '',
1101
+ rightClickDo: ''
1102
+ });
1103
+ },
1104
+ deleteRightClick(index) {
1105
+ this.rightClickSetting.splice(index, 1);
1106
+ },
1107
+ handleGroupUp(index) {
1108
+ if (index === 0) {
1109
+ let current = this.listClassify[index];
1110
+ let nextList = this.listClassify.slice(1);
1111
+ this.listClassify = [].concat(nextList, current);
1112
+ } else {
1113
+ let current = this.listClassify[index];
1114
+ let preList = this.listClassify.slice(0, index - 1);
1115
+ let nextList = this.listClassify.slice(index - 1);
1116
+ nextList.splice(1, 1);
1117
+ this.listClassify = [].concat(preList, current, nextList);
1118
+ }
1119
+ },
1120
+ refuseReasonAdd() {
1121
+ this.refuseReasonList.push({
1122
+ text: ''
1123
+ });
1124
+ },
1125
+ refuseReasonDel(i) {
1126
+ this.refuseReasonList.splice(i, 1);
1127
+ },
1128
+ handleRightOffRemindTimeBlur(event) {
1129
+ const v = this.form.getFieldValue('timeLength') || 0;
1130
+ // 限制 到期提醒 输入 数据不能大于等于会话时长
1131
+ if (v && v <= event.target.value) {
1132
+ this.form.setFieldsValue({
1133
+ rightOffRemindTime: v - 1
1134
+ });
1135
+ }
1136
+ }
1137
+ }
1138
+ };
1139
+ </script>
1140
+
1141
+ <style lang="less" scoped>
1142
+ .chat-base-info {
1143
+ height: 100%;
1144
+ display: flex;
1145
+ flex-direction: column;
1146
+ padding: 15px;
1147
+ padding-bottom: 0;
1148
+ .main-form {
1149
+ overflow: auto;
1150
+ &::-webkit-scrollbar {
1151
+ width: 5px;
1152
+ }
1153
+ }
1154
+ .page-title {
1155
+ font-weight: 500;
1156
+ color: #2e2e2e;
1157
+ font-size: 16px;
1158
+ }
1159
+ .main-form {
1160
+ flex: 1;
1161
+ }
1162
+ .setting-hours-text {
1163
+ margin-right: 15px;
1164
+ }
1165
+ .time-setting,
1166
+ .delayed-setting {
1167
+ padding-left: 20px;
1168
+ /deep/ .ant-form-item {
1169
+ display: flex;
1170
+ }
1171
+ }
1172
+ .delayed-setting {
1173
+ margin-left: 30px;
1174
+ .unit {
1175
+ display: inline-block;
1176
+ margin-left: 10px;
1177
+ }
1178
+ }
1179
+ /deep/ .ant-form-item {
1180
+ margin-bottom: 0;
1181
+ }
1182
+ /deep/ .ant-form-item-children {
1183
+ display: flex;
1184
+ align-items: center;
1185
+ }
1186
+ .server-form-item {
1187
+ /deep/ .ant-form-item-children {
1188
+ flex-wrap: wrap;
1189
+ }
1190
+ }
1191
+ .functional-module {
1192
+ margin-bottom: 30px;
1193
+ .title {
1194
+ color: #506493;
1195
+ line-height: 22px;
1196
+ padding-left: 8px;
1197
+ border-left: 3px solid #5585f5;
1198
+ }
1199
+ .broadcaste-wrap {
1200
+ .broadcaste-title {
1201
+ display: flex;
1202
+ align-items: center;
1203
+ margin: 8px 0;
1204
+ > span {
1205
+ margin: 0 8px;
1206
+ }
1207
+ }
1208
+ .broadcaste-item {
1209
+ display: flex;
1210
+ align-items: center;
1211
+ margin-bottom: 4px;
1212
+ > div {
1213
+ display: flex;
1214
+ align-items: center;
1215
+ width: 40%;
1216
+ .item-title {
1217
+ width: 60px;
1218
+ margin: 4px;
1219
+ }
1220
+ }
1221
+ }
1222
+ }
1223
+ .client-url {
1224
+ margin-bottom: 8px;
1225
+ }
1226
+ }
1227
+ /deep/ .ant-table-thead > tr > th,
1228
+ /deep/ .ant-table-tbody > tr > td {
1229
+ padding: 4px 30px;
1230
+ }
1231
+ .form-bottom {
1232
+ display: flex;
1233
+ align-items: center;
1234
+ margin-top: auto;
1235
+ margin-left: -15px;
1236
+ padding-left: 15px;
1237
+ height: 49px;
1238
+ box-shadow: 0px -3px 8px 2px rgba(239, 243, 255, 1);
1239
+ border-top: 1px solid #b8c5e2;
1240
+ }
1241
+ .title-input {
1242
+ width: 150px;
1243
+ margin-right: 20px;
1244
+ text-align: center;
1245
+ }
1246
+ .bot-setting {
1247
+ /deep/ .ant-form-item {
1248
+ display: flex;
1249
+ }
1250
+ }
1251
+ .serverinfo-wrapper {
1252
+ display: flex;
1253
+ align-items: center;
1254
+ }
1255
+ .serverinfo-label {
1256
+ display: inline-block;
1257
+ width: 100px;
1258
+ padding-right: 8px;
1259
+ overflow: hidden;
1260
+ text-overflow: ellipsis;
1261
+ white-space: nowrap;
1262
+ }
1263
+ .classify-wrapper {
1264
+ display: flex;
1265
+ align-items: flex-start;
1266
+ .classify-item {
1267
+ margin-left: 10px;
1268
+ margin-bottom: 8px;
1269
+ padding: 10px;
1270
+ border: 1px solid #b8c5e2;
1271
+ background-color: #f6f7fa;
1272
+ .name {
1273
+ display: inline-block;
1274
+ width: 80px;
1275
+ }
1276
+ .statistic {
1277
+ display: flex;
1278
+ align-items: center;
1279
+ justify-content: space-between;
1280
+ margin-bottom: 10px;
1281
+ }
1282
+ .server {
1283
+ margin-bottom: 10px;
1284
+ }
1285
+ }
1286
+ }
1287
+ .rightClickSetting {
1288
+ /deep/ .ant-form-item {
1289
+ display: flex;
1290
+ }
1291
+ }
1292
+ .ASC_DESC {
1293
+ /deep/ .ant-form-item-control-wrapper {
1294
+ display: flex;
1295
+ align-items: center;
1296
+ }
1297
+ }
1298
+ .refuse-item {
1299
+ margin-bottom: 8px;
1300
+ display: flex;
1301
+ align-items: center;
1302
+ .ant-input {
1303
+ max-width: 348px;
1304
+ margin-right: 15px;
1305
+ }
1306
+ }
1307
+ .refuse-add-btn {
1308
+ border: none;
1309
+ }
1310
+ /deep/ .rightClick-form {
1311
+ .ant-form-item-control-wrapper {
1312
+ width: 100%;
1313
+ }
1314
+ }
1315
+ }
1316
+ </style>