cnhis-design-vue 2.1.21 → 2.1.22

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 +2270 -2270
  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 +205 -195
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +31 -31
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +1 -1
  33. package/es/empty/index.js +8 -8
  34. package/es/fabric-chart/index.js +138 -100
  35. package/es/form/index.js +8 -8
  36. package/es/form-model/index.js +8 -8
  37. package/es/form-table/index.js +62 -62
  38. package/es/index/index.js +787 -739
  39. package/es/index/style.css +1 -1
  40. package/es/input/index.js +9 -9
  41. package/es/input-number/index.js +8 -8
  42. package/es/layout/index.js +8 -8
  43. package/es/list/index.js +8 -8
  44. package/es/locale-provider/index.js +8 -8
  45. package/es/map/index.js +9 -9
  46. package/es/mentions/index.js +8 -8
  47. package/es/menu/index.js +8 -8
  48. package/es/message/index.js +8 -8
  49. package/es/multi-chat/index.js +92 -92
  50. package/es/multi-chat-client/index.js +86 -86
  51. package/es/multi-chat-history/index.js +4 -4
  52. package/es/multi-chat-record/index.js +14 -14
  53. package/es/multi-chat-setting/index.js +27 -27
  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 +142 -142
  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 +736 -688
  88. package/lib/cui.umd.js +736 -688
  89. package/lib/cui.umd.min.js +14 -14
  90. package/package.json +107 -107
  91. package/packages/big-table/src/BigTable.vue +3044 -3039
  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/fabric-chart/src/components/TimeScaleValue.vue +113 -113
  99. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  100. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1066 -1055
  101. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  102. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  103. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  104. package/packages/multi-chat/chat/chatFooter.vue +1594 -1594
  105. package/packages/multi-chat/chat/chatMain.vue +1466 -1466
  106. package/packages/multi-chat/chat/quickReply.vue +439 -439
  107. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  108. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  109. package/packages/multi-chat/store/actions.js +448 -448
  110. package/packages/multi-chat/store/state.js +112 -112
  111. package/packages/scale-view/formitem/r-choice.vue +714 -714
  112. package/packages/scale-view/scaleView.vue +2010 -2010
  113. package/packages/select-person/select-person.vue +1658 -1658
  114. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  115. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  116. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  117. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  118. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1825 -1825
  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 +2109 -2109
  122. package/src/directive/preventReClick.js +12 -12
@@ -1,1316 +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-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>
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>