@94ai/softphone 5.0.16 → 5.0.17
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.
- package/html-softphone-demo/embed-ui/index.html +21 -0
- package/html-softphone-demo/embed-ui/softphone.js +55 -2
- package/html-softphone-demo/index.html +37 -36
- package/html-softphone-demo/micro-call-ui/draggable.html +168 -0
- package/html-softphone-demo/micro-call-ui/draggable.js +1 -0
- package/html-softphone-demo/micro-call-ui/index.html +1 -0
- package/html-softphone-demo/micro-call-ui/microphone.js +3 -6
- package/html-softphone-demo/softphone.umd.min.js +2 -2
- package/html-softphone-demo/vue-esm-ui/common-ui.es.browser.js +56545 -0
- package/html-softphone-demo/vue-esm-ui/vue-esm.html +2043 -0
- package/html-softphone-demo/vue-sfc-ui/CryptoJS.js +3 -0
- package/html-softphone-demo/vue-sfc-ui/vue-sfc.html +1858 -0
- package/html-softphone-demo/vue-umd-ui/common-ui.umd.browser.js +338 -0
- package/html-softphone-demo/vue-umd-ui/vue-umd.html +1978 -0
- package/lib/index.d.ts +1 -1
- package/lib/softphone.cjs.min.cjs +1 -1
- package/lib/softphone.esm-bundler.min.mjs +1 -1
- package/lib/softphone.umd.min.js +1 -2
- package/package.json +1 -1
|
@@ -0,0 +1,2043 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport"
|
|
6
|
+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
8
|
+
<title>Document</title>
|
|
9
|
+
<script src="https://unpkg.com/qiankun@2.10.16/dist/index.umd.min.js"></script> <!-- 👈 引入qiankun -->
|
|
10
|
+
<script src="https://unpkg.com/wujie@2.1.0/lib/index.js"></script> <!-- 👈 引入wujie -->
|
|
11
|
+
<script src="https://unpkg.com/crypto-js@4.2.0/crypto-js.js"></script> <!-- 👈 引入软电话签名算法库 -->
|
|
12
|
+
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.2/lib/theme-chalk/index.css"> <!-- 引入element-ui主题 -->
|
|
13
|
+
<link rel="stylesheet" href="https://unpkg.com/@94ai/nf-theme-chalk@8.3.23/lib/css/index.css"> <!-- 引入common-ui主题 -->
|
|
14
|
+
<style>
|
|
15
|
+
/**
|
|
16
|
+
页面定制样式
|
|
17
|
+
*/
|
|
18
|
+
html,body {
|
|
19
|
+
padding: 0px;
|
|
20
|
+
}
|
|
21
|
+
.nf-keyword-html .nf-keyword-input-item-box {
|
|
22
|
+
overflow-y: auto!important;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<!--多个 importmap 标签必须全部放在首个模块之前,浏览器会合并映射配置。-->
|
|
28
|
+
<!--element-ui,qiankun,wujie 三个包的作者偷懒,没有针对esm做构建产物,其中element-plus才开始做esm构建输出,都是element-ui的锅导致做特殊模块引流-->
|
|
29
|
+
<script type="importmap">
|
|
30
|
+
{
|
|
31
|
+
"imports": {
|
|
32
|
+
"fs":"data:text/javascript,",
|
|
33
|
+
"path":"data:text/javascript,",
|
|
34
|
+
|
|
35
|
+
"vue":"https://unpkg.com/vue@2.7.14/dist/vue.esm.browser.js",
|
|
36
|
+
"vue-demi":"https://unpkg.com/vue-demi@0.14.10/lib/v2.7/index.mjs",
|
|
37
|
+
"common-ui":"https://unpkg.com/@94ai/codepen@8.3.23/lib/common-ui/common-ui.es.browser.js",
|
|
38
|
+
|
|
39
|
+
"element-ui":"data:text/javascript,export const FormItem = window.ELEMENT.FormItem;export const Form = window.ELEMENT.Form;export const Checkbox = window.ELEMENT.Checkbox;export const Radio = window.ELEMENT.Radio;export const TableColumn = window.ELEMENT.TableColumn;export const Loading = window.ELEMENT.Loading;export default {FormItem:window.ELEMENT.FormItem,Form:window.ELEMENT.Form,Checkbox:window.ELEMENT.Checkbox,Radio:window.ELEMENT.Radio,TableColumn:window.ELEMENT.TableColumn,Loading:window.ELEMENT.Loading};",
|
|
40
|
+
|
|
41
|
+
"qiankun":"data:text/javascript,export const initGlobalState = window.qiankun.initGlobalState;export const addGlobalUncaughtErrorHandler = window.qiankun.addGlobalUncaughtErrorHandler;export const registerMicroApps = window.qiankun.registerMicroApps;export const start = window.qiankun.start;export const loadMicroApp = window.qiankun.loadMicroApp;export default {initGlobalState:window.qiankun.initGlobalState,addGlobalUncaughtErrorHandler:window.qiankun.addGlobalUncaughtErrorHandler,registerMicroApps:window.qiankun.registerMicroApps,loadMicroApp:window.qiankun.loadMicroApp,start:window.qiankun.start};",
|
|
42
|
+
|
|
43
|
+
"wujie":"data:text/javascript,export const bus = window.wujie.bus;export const setupApp = window.wujie.setupApp;export const startApp = window.wujie.startApp;export default {bus:window.wujie.bus,setupApp:window.wujie.setupApp,startApp:window.wujie.startApp};"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<!--type="module" 天生自带 defer 效果,但他会在defer异步队列中和defer一起按照标签顺序做顺序执行-->
|
|
49
|
+
<script type="module">
|
|
50
|
+
import {
|
|
51
|
+
default as Vue
|
|
52
|
+
} from 'vue'
|
|
53
|
+
if (!window.Vue) {
|
|
54
|
+
window.Vue = Vue
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<!--umd element-ui 执行代码注册时需要window里面有Vue:这里不加defer会导致上面type=module异步scipt中Vue的window注册代码还没跑就同步执行element-ui的代码-->
|
|
59
|
+
<script defer src="https://unpkg.com/element-ui@2.13.2/lib/index.js"></script>
|
|
60
|
+
|
|
61
|
+
<!-- 一、defer:异步下载、HTML 全部解析完成后、DOMContentLoaded 前按标签顺序同步执行,每个都会进 defer 执行队列-->
|
|
62
|
+
<!-- 注意:
|
|
63
|
+
1. 内联<script defer>:浏览器直接忽略 defer,同步立即执行;
|
|
64
|
+
2. <script type="module" async>:
|
|
65
|
+
- 外联 会异步下载,下载完成就立刻执行,不管defer队列的顺序,不依赖标签顺序,执行顺序不可控。async 脱离 defer 队列、脱离 DOM 就绪卡点-。
|
|
66
|
+
- 内联(无src)写 async, async属性完全失效,哪怕内部有 import 导入依赖,依旧走原生 Module 的 defer 逻辑 -->
|
|
67
|
+
|
|
68
|
+
<!-- 二、原生无修饰 <script>(内联/src外链:无 defer、async、type="module")-->
|
|
69
|
+
<!-- 浏览器流程:
|
|
70
|
+
解析 HTML 遇到普通 script
|
|
71
|
+
1. 若是外链:暂停 DOM 解析、停止页面渲染,去下载 JS 文件。JS 下载完成后立即执行脚本。执行完毕,继续往下解析 HTML
|
|
72
|
+
2. 内联普通 script:直接同步执行,阻塞 DOM 构建。-->
|
|
73
|
+
|
|
74
|
+
<!-- 三、type="module"(内联/外链都生效)-->
|
|
75
|
+
<!-- 模块及依赖异步加载,不阻塞 HTML
|
|
76
|
+
默认行为≈defer:DOM 构建完成后,再按标签顺序执行模块脚本
|
|
77
|
+
模块内部的import依赖会并行加载 -->
|
|
78
|
+
|
|
79
|
+
<!-- 四、<script type="importmap">-->
|
|
80
|
+
<!-- 属于同步解析,读到就立刻解析配置,注册模块导入映射;
|
|
81
|
+
不执行 JS 逻辑,只做配置;
|
|
82
|
+
必须出现在所有 type="module" 之前,否则模块裸导入匹配失败;
|
|
83
|
+
不阻塞 HTML 渲染太久(仅 JSON 解析)。 -->
|
|
84
|
+
|
|
85
|
+
<!-- 五:async 是用于外链 JS(带 src)的脚本加载属性
|
|
86
|
+
作用:
|
|
87
|
+
- 脚本文件后台异步下载,不阻塞 HTML 解析、页面渲染;
|
|
88
|
+
- 脚本下载完成后,立刻中断当前 HTML 解析,直接执行 JS;
|
|
89
|
+
- 无顺序保障,多个 async 脚本「谁先下载好谁先跑」。
|
|
90
|
+
硬性前提:
|
|
91
|
+
- async 对内联 <script> 完全无效,浏览器直接忽略。 -->
|
|
92
|
+
<script>
|
|
93
|
+
/**
|
|
94
|
+
* element-ui的umd做了process的判断,都是element-ui的锅。需指定一个默认环境
|
|
95
|
+
*/
|
|
96
|
+
const process = {
|
|
97
|
+
env: {
|
|
98
|
+
NODE_ENV: 'production'
|
|
99
|
+
},
|
|
100
|
+
stdout: {
|
|
101
|
+
isTTY: false
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
<script type="module">
|
|
106
|
+
import {
|
|
107
|
+
ref,
|
|
108
|
+
getCurrentInstance,
|
|
109
|
+
reactive,
|
|
110
|
+
computed
|
|
111
|
+
} from 'vue'
|
|
112
|
+
|
|
113
|
+
import CommonUI from 'common-ui'
|
|
114
|
+
|
|
115
|
+
Vue.use(ELEMENT).use(CommonUI) // 👈 注册common-ui
|
|
116
|
+
|
|
117
|
+
new Vue({
|
|
118
|
+
el: '#app',
|
|
119
|
+
data() {
|
|
120
|
+
return {
|
|
121
|
+
testData: 1
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
testAlert() {
|
|
126
|
+
alert(1)
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
setup() {
|
|
130
|
+
/**
|
|
131
|
+
* nf-keyword
|
|
132
|
+
*/
|
|
133
|
+
const keywords = ref([])
|
|
134
|
+
|
|
135
|
+
const delAllKeywordFn = (tags) => {
|
|
136
|
+
keywords.value = []
|
|
137
|
+
console.log(tags)
|
|
138
|
+
}
|
|
139
|
+
const delItem = (item) => {
|
|
140
|
+
console.log(item)
|
|
141
|
+
}
|
|
142
|
+
const copySuccess = (str) => {
|
|
143
|
+
console.log(str)
|
|
144
|
+
}
|
|
145
|
+
const getItemDisabledStatus = (tag) => {
|
|
146
|
+
if(tag.content === 'aa') {
|
|
147
|
+
return true
|
|
148
|
+
}
|
|
149
|
+
return false
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* nf-keyword
|
|
153
|
+
*/
|
|
154
|
+
/**
|
|
155
|
+
* nf-table
|
|
156
|
+
*/
|
|
157
|
+
const deepClone = (source) => {
|
|
158
|
+
if (!source && typeof source !== 'object') {
|
|
159
|
+
throw new Error('error arguments shallowClone')
|
|
160
|
+
}
|
|
161
|
+
const targetObj = source.constructor === Array ? [] : {}
|
|
162
|
+
Object.keys(source).forEach((keys) => {
|
|
163
|
+
if (source[keys] && typeof source[keys] === 'object') {
|
|
164
|
+
targetObj[keys] = source[keys].constructor === Array ? [] : {}
|
|
165
|
+
targetObj[keys] = deepClone(source[keys])
|
|
166
|
+
} else {
|
|
167
|
+
targetObj[keys] = source[keys]
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
return targetObj
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
定制表格合计行的显示
|
|
175
|
+
*/
|
|
176
|
+
const getSummaries = (param) => {
|
|
177
|
+
const { columns, data } = param;
|
|
178
|
+
const sums = [];
|
|
179
|
+
columns.forEach((column, index) => {
|
|
180
|
+
if (index === 0) {
|
|
181
|
+
sums[index] = '汇总';
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (index === 1 || index === 2) {
|
|
185
|
+
sums[index] = '--';
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const values = data.map(item => Number(item[column.property]));
|
|
189
|
+
if (!values.every(value => isNaN(value))) {
|
|
190
|
+
sums[index] = values.reduce((prev, curr) => {
|
|
191
|
+
const value = Number(curr);
|
|
192
|
+
if (!isNaN(value)) {
|
|
193
|
+
return prev + curr;
|
|
194
|
+
} else {
|
|
195
|
+
return prev;
|
|
196
|
+
}
|
|
197
|
+
}, 0);
|
|
198
|
+
sums[index] += '%';
|
|
199
|
+
} else {
|
|
200
|
+
sums[index] = '--';
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
return sums;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
用来模拟表单数据加载
|
|
207
|
+
*/
|
|
208
|
+
const mockData = [
|
|
209
|
+
{
|
|
210
|
+
name: "复制_测试",
|
|
211
|
+
startTime: "2022-12-21 00:00:00",
|
|
212
|
+
companyName: "konghang",
|
|
213
|
+
completionRate: 1,
|
|
214
|
+
operationName: "a26",
|
|
215
|
+
viceOperationName:"副负责人",
|
|
216
|
+
address: 'xxx',
|
|
217
|
+
id: 1,
|
|
218
|
+
unit: 22,
|
|
219
|
+
taskId: 1,
|
|
220
|
+
getOptionsId: 1,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "测试",
|
|
224
|
+
startTime: "2022-12-25 00:00:00",
|
|
225
|
+
companyName: "konghang1",
|
|
226
|
+
completionRate: 0.6,
|
|
227
|
+
operationName: "a28",
|
|
228
|
+
viceOperationName:"副负责人",
|
|
229
|
+
address: 'xxx',
|
|
230
|
+
id: 2,
|
|
231
|
+
unit: 22,
|
|
232
|
+
taskId: 2,
|
|
233
|
+
getOptionsId: 2,
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
/**
|
|
237
|
+
用来动态改变nf-search-form渲染框架的json data
|
|
238
|
+
*/
|
|
239
|
+
const mockColumns = [
|
|
240
|
+
{
|
|
241
|
+
label: '启动日期',
|
|
242
|
+
prop: 'startTime',
|
|
243
|
+
labelTooltip: '启动日期labelTooltip',
|
|
244
|
+
attr: {
|
|
245
|
+
width: 200
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
label: '任务完成率',
|
|
250
|
+
prop: 'completionRate',
|
|
251
|
+
/** 定制表头slot */
|
|
252
|
+
headerSlot: 'completionRateHeader',
|
|
253
|
+
attr: {
|
|
254
|
+
/** 定制formatter */
|
|
255
|
+
formatter: row => {
|
|
256
|
+
return `${row.completionRate}%`
|
|
257
|
+
},
|
|
258
|
+
'min-width': 130
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
label: '运营负责人',
|
|
263
|
+
prop: 'operationName',
|
|
264
|
+
/** 定制slot */
|
|
265
|
+
slot: 'operationName',
|
|
266
|
+
attr: {
|
|
267
|
+
'min-width': 135
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
label: '操作',
|
|
272
|
+
prop: 'operation',
|
|
273
|
+
/** 定制动作slot */
|
|
274
|
+
slot: 'operation',
|
|
275
|
+
attr: {
|
|
276
|
+
fixed: 'right',
|
|
277
|
+
'min-width': 200
|
|
278
|
+
},
|
|
279
|
+
}
|
|
280
|
+
];
|
|
281
|
+
/**
|
|
282
|
+
定制nf-search-form渲染框架的json data
|
|
283
|
+
*/
|
|
284
|
+
const searchOptionTable = ref([
|
|
285
|
+
{
|
|
286
|
+
label: '普通输入框',
|
|
287
|
+
prop: 'normalInputBox',
|
|
288
|
+
element: 'el-input',
|
|
289
|
+
width: '200px',
|
|
290
|
+
category: '分类一',
|
|
291
|
+
placeholder: '选择右侧下拉查询新增表格数据'
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: '数字输入框',
|
|
295
|
+
prop: 'numberInputBox',
|
|
296
|
+
element: 'el-input-number',
|
|
297
|
+
class: 'nf-input-number-custom',
|
|
298
|
+
placeholder: '这里输入后搜索即清空数据',
|
|
299
|
+
width: '200px',
|
|
300
|
+
category: '分类一'
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
label: '普通下拉',
|
|
304
|
+
prop: 'normalDropdown',
|
|
305
|
+
element: 'el-select',
|
|
306
|
+
'data-key': 'value',
|
|
307
|
+
options: [
|
|
308
|
+
{ label: '查询新增10条数据', value: 1 },
|
|
309
|
+
{ label: '查询数据结果为10条', value: 2 }
|
|
310
|
+
],
|
|
311
|
+
category: '分类一'
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
label: '虚拟下拉',
|
|
315
|
+
prop: 'virtualDropdown',
|
|
316
|
+
element: 'el-select',
|
|
317
|
+
'data-key': 'value',
|
|
318
|
+
'virtual-list': true,
|
|
319
|
+
options: [
|
|
320
|
+
{ label: '给点意见', value: '1' },
|
|
321
|
+
{ label: '售后问题', value: '2' }
|
|
322
|
+
],
|
|
323
|
+
category: '分类一'
|
|
324
|
+
}
|
|
325
|
+
]);
|
|
326
|
+
const nfTable = reactive({});
|
|
327
|
+
const proxy = getCurrentInstance()?.proxy
|
|
328
|
+
/**
|
|
329
|
+
通过方法批量产生demo数据
|
|
330
|
+
*/
|
|
331
|
+
const useTableInteractiveProgram = (index) => {
|
|
332
|
+
/**
|
|
333
|
+
表格配置
|
|
334
|
+
*/
|
|
335
|
+
nfTable[`tableData${index}`] = ref([]);
|
|
336
|
+
nfTable[`tableColumns${index}`] = ref([
|
|
337
|
+
{
|
|
338
|
+
label: '选择',
|
|
339
|
+
type: 'selection',
|
|
340
|
+
prop: 'selection',
|
|
341
|
+
attr: {
|
|
342
|
+
/** 固定死宽度 */
|
|
343
|
+
width: '100px',
|
|
344
|
+
fixed: 'left',
|
|
345
|
+
align: 'center'
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
label: 'id',
|
|
350
|
+
prop: 'id',
|
|
351
|
+
attr: {
|
|
352
|
+
/** 固定死宽度,拖拽最小值根据内容单行撑开的宽度最小值,常用做法 */
|
|
353
|
+
width: '100px'
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
label: '编号',
|
|
358
|
+
prop: 'taskId',
|
|
359
|
+
attr: {
|
|
360
|
+
/** 固定死宽度,拖拽最小值根据内容单行撑开的宽度最小值,常用做法 */
|
|
361
|
+
width: '100px'
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
label: '任务名称',
|
|
366
|
+
prop: 'name',
|
|
367
|
+
attr: {
|
|
368
|
+
/** 宽度最小值,同时也是拖拽最小值,一般很多表头项时设置width即可,不用设置min-width */
|
|
369
|
+
'min-width': '120px'
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
label: '所属企业',
|
|
374
|
+
prop: 'companyName',
|
|
375
|
+
attr: {
|
|
376
|
+
/** 如果表头项很少可以设置min-width */
|
|
377
|
+
'min-width': 120
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
label: '启动日期',
|
|
382
|
+
prop: 'startTime',
|
|
383
|
+
attr: {
|
|
384
|
+
/** 不设置默认根据分配高度自动折行 */
|
|
385
|
+
/** width: 160 */
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
label: '操作',
|
|
390
|
+
attr: {
|
|
391
|
+
fixed: 'right',
|
|
392
|
+
'min-width': 200
|
|
393
|
+
},
|
|
394
|
+
prop: 'operation',
|
|
395
|
+
operationList: [{
|
|
396
|
+
name: '详情',
|
|
397
|
+
onClick(row, scope) {
|
|
398
|
+
alert('详情')
|
|
399
|
+
console.log(row, scope)
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
name: '编辑',
|
|
403
|
+
onClick() {
|
|
404
|
+
alert('编辑')
|
|
405
|
+
}
|
|
406
|
+
}, {
|
|
407
|
+
name: '语音通知',
|
|
408
|
+
onClick() {
|
|
409
|
+
alert('语音通知')
|
|
410
|
+
}
|
|
411
|
+
}]
|
|
412
|
+
}
|
|
413
|
+
]);
|
|
414
|
+
/**
|
|
415
|
+
actionBar配置
|
|
416
|
+
*/
|
|
417
|
+
nfTable[`changeSelectFn${index}`] = (selection, row) => {
|
|
418
|
+
if(selection.length === nfTable[`searchForm${index}`].value.pageSize) {
|
|
419
|
+
nfTable[`select${index}`].value = true
|
|
420
|
+
nfTable[`actionBarOptList${index}`].value[0].value = true;
|
|
421
|
+
} else {
|
|
422
|
+
nfTable[`select${index}`].value = false
|
|
423
|
+
nfTable[`actionBarOptList${index}`].value[0].value = false;
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
nfTable[`changeSelectAllFn${index}`] = (selection) => {
|
|
427
|
+
if(selection.length === nfTable[`searchForm${index}`].value.pageSize) {
|
|
428
|
+
nfTable[`select${index}`].value = true
|
|
429
|
+
nfTable[`actionBarOptList${index}`].value[0].value = true;
|
|
430
|
+
} else {
|
|
431
|
+
nfTable[`select${index}`].value = false
|
|
432
|
+
nfTable[`actionBarOptList${index}`].value[0].value = false;
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
nfTable[`select${index}`] = ref();
|
|
436
|
+
nfTable[`selectAll${index}`] = (val) => {
|
|
437
|
+
nfTable[`select${index}`].value = val;
|
|
438
|
+
proxy?.$refs[`nfTable${index}`]?.toggleAllSelection()
|
|
439
|
+
};
|
|
440
|
+
nfTable[`actionBarOptList${index}`] = ref([
|
|
441
|
+
{
|
|
442
|
+
element: 'el-checkbox',
|
|
443
|
+
value: false,
|
|
444
|
+
text: '当页全选',
|
|
445
|
+
events: {
|
|
446
|
+
change(val) {
|
|
447
|
+
nfTable[`actionBarOptList${index}`].value[0].value = val;
|
|
448
|
+
proxy?.$refs[`nfTable${index}`]?.toggleAllSelection()
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
element: 'el-button',
|
|
454
|
+
value: '开启',
|
|
455
|
+
type: 'primary',
|
|
456
|
+
events: {
|
|
457
|
+
click() {
|
|
458
|
+
alert('开启')
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
element: 'el-button',
|
|
464
|
+
value: '暂停',
|
|
465
|
+
type: 'danger',
|
|
466
|
+
events: {
|
|
467
|
+
click() {
|
|
468
|
+
alert('暂停')
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
element: 'el-button',
|
|
474
|
+
value: '删除',
|
|
475
|
+
type: 'danger',
|
|
476
|
+
events: {
|
|
477
|
+
click() {
|
|
478
|
+
alert('删除')
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
]);
|
|
483
|
+
/**
|
|
484
|
+
mock数据
|
|
485
|
+
*/
|
|
486
|
+
nfTable[`addTableData${index}`] = (repeat = 1, limit, immediately = false) => {
|
|
487
|
+
nfTable[`searchForm${index}`].value.loading = true;
|
|
488
|
+
const addData = () => {
|
|
489
|
+
Array(repeat).fill(0).forEach(_ => nfTable[`tableData${index}`].value = nfTable[`tableData${index}`].value.concat(deepClone(mockData).map(itemM => {
|
|
490
|
+
itemM.id = itemM.id + nfTable[`tableData${index}`].value.length;
|
|
491
|
+
return itemM
|
|
492
|
+
})));
|
|
493
|
+
if (limit) {
|
|
494
|
+
nfTable[`tableData${index}`].value = nfTable[`tableData${index}`].value.slice(0, limit)
|
|
495
|
+
}
|
|
496
|
+
nfTable[`searchForm${index}`].value.loading = false
|
|
497
|
+
}
|
|
498
|
+
if (immediately) {
|
|
499
|
+
addData();
|
|
500
|
+
} else {
|
|
501
|
+
setTimeout(() => {
|
|
502
|
+
addData();
|
|
503
|
+
}, 1000)
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
表单配置
|
|
508
|
+
*/
|
|
509
|
+
nfTable[`searchForm${index}`] = ref({
|
|
510
|
+
pageNo: 1,
|
|
511
|
+
pageSize: 3,
|
|
512
|
+
loading: false,
|
|
513
|
+
});
|
|
514
|
+
nfTable[`searchChange${index}`] = (data) => {
|
|
515
|
+
nfTable[`searchForm${index}`].value = {
|
|
516
|
+
...nfTable[`searchForm${index}`].value,
|
|
517
|
+
...data
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
nfTable[`onSearch${index}`] = (data) => {
|
|
521
|
+
const newAdd = data.normalDropdown === 2;
|
|
522
|
+
const limitAdd = data.normalDropdown === 1;
|
|
523
|
+
const numberInputBox = !!data.numberInputBox;
|
|
524
|
+
if (numberInputBox) {
|
|
525
|
+
nfTable[`tableData${index}`].value = [];
|
|
526
|
+
return
|
|
527
|
+
}
|
|
528
|
+
nfTable[`addTableData${index}`](newAdd || limitAdd ? 5: 1, data.normalDropdown === 2 ? 10 : 0)
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
分页配置
|
|
532
|
+
*/
|
|
533
|
+
nfTable[`pageConfig${index}`] = computed(() => {
|
|
534
|
+
const { pageNo, pageSize, loading } = nfTable[`searchForm${index}`].value;
|
|
535
|
+
return {
|
|
536
|
+
'current-page': pageNo,
|
|
537
|
+
'page-size': pageSize,
|
|
538
|
+
disabled: loading,
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
nfTable[`pageSizeChangeFn${index}`] = (val) => {
|
|
542
|
+
console.log(`pageSizeChangeFn${index}`, val);
|
|
543
|
+
nfTable[`searchForm${index}`].value.pageSize = val
|
|
544
|
+
};
|
|
545
|
+
nfTable[`pageCurrentChangeFn${index}`] = (val) => {
|
|
546
|
+
console.log(`pageCurrentChangeFn${index}`, val);
|
|
547
|
+
nfTable[`searchForm${index}`].value.pageNo = val
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
columnEdit配置
|
|
551
|
+
*/
|
|
552
|
+
nfTable[`columnEditDialog${index}`] = () => {
|
|
553
|
+
if (proxy?.$refs[`nfTable${index}`]) {
|
|
554
|
+
proxy.$refs[`nfTable${index}`].nfColumCheckDialogVisible = true
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
初始化数据 👈 组装好所有需要的数据丢进nf-table即可
|
|
560
|
+
*/
|
|
561
|
+
useTableInteractiveProgram(3);
|
|
562
|
+
useTableInteractiveProgram(5);
|
|
563
|
+
nfTable.addTableData3(2, 0, true);
|
|
564
|
+
nfTable.addTableData5(2, 0, true);
|
|
565
|
+
/**
|
|
566
|
+
补丁数据
|
|
567
|
+
*/
|
|
568
|
+
nfTable.tableColumns3 = ref(deepClone(nfTable.tableColumns1?.value || []).slice(0, -2).concat(deepClone(mockColumns)));
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
由于使用了分页slot,这里自定义分页逻辑 - 前端分页
|
|
572
|
+
*/
|
|
573
|
+
const showData = computed(() => {
|
|
574
|
+
const list = nfTable.tableData3.value;
|
|
575
|
+
const pageSize = pageAttrs.value['page-size'];
|
|
576
|
+
const currentPage = pageAttrs.value['current-page'] || 1;
|
|
577
|
+
if (list.length > pageSize) {
|
|
578
|
+
return list.slice((currentPage - 1) * pageSize, currentPage * pageSize)
|
|
579
|
+
} else {
|
|
580
|
+
return list
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
const pageAttrs = computed(() => {
|
|
584
|
+
const { pageNo, pageSize, loading } = nfTable.searchForm3.value;
|
|
585
|
+
return {
|
|
586
|
+
background: false,
|
|
587
|
+
layout: 'total, sizes, prev, pager, next',
|
|
588
|
+
'page-sizes': [3, 10, 20, 30, 40, 50, 100, 200],
|
|
589
|
+
'current-page': pageNo,
|
|
590
|
+
'page-size': pageSize,
|
|
591
|
+
total: nfTable.tableData3.value.length,
|
|
592
|
+
disabled: loading,
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
const pageEvents = computed(() => {
|
|
596
|
+
return {
|
|
597
|
+
'size-change':nfTable.pageSizeChangeFn3,
|
|
598
|
+
'current-change':nfTable.pageCurrentChangeFn3
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
/**
|
|
602
|
+
* nf-table
|
|
603
|
+
*/
|
|
604
|
+
/**
|
|
605
|
+
* nf-search-form
|
|
606
|
+
*/
|
|
607
|
+
const EXCHANGE_KEY_TYPE = {
|
|
608
|
+
range: 1, // 数组值分割多个字段
|
|
609
|
+
multiple: 2, // 分割逗号
|
|
610
|
+
}
|
|
611
|
+
const nfSearchFormRef = ref()
|
|
612
|
+
|
|
613
|
+
const columns = ref(6)
|
|
614
|
+
const inline = ref(true)
|
|
615
|
+
const labelPosition = ref('top')
|
|
616
|
+
const changeLabelPosition = (val) => {
|
|
617
|
+
labelPosition.value = val
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
const isCollapseChange = (collapse) => {
|
|
621
|
+
console.log(collapse)
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const rules = ref({
|
|
625
|
+
normalInputBox: [
|
|
626
|
+
{ required: true, message: '支持校验', trigger: 'change' },
|
|
627
|
+
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'change' }
|
|
628
|
+
],
|
|
629
|
+
})
|
|
630
|
+
|
|
631
|
+
const btnItemList = ref([
|
|
632
|
+
'search',
|
|
633
|
+
'export',
|
|
634
|
+
'reset',
|
|
635
|
+
{
|
|
636
|
+
name: '自定义配置按钮',
|
|
637
|
+
onClick(formData) {
|
|
638
|
+
console.log('点击了自定义按钮', formData);
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: '动态展示按钮show(formData)',
|
|
643
|
+
show(formData) {
|
|
644
|
+
return formData.showKey === '3'
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
]);
|
|
648
|
+
|
|
649
|
+
const submitForm = (formName) => {
|
|
650
|
+
nfSearchFormRef.value?.onNfSearchFormValidate()
|
|
651
|
+
};
|
|
652
|
+
const resetForm = (formName) => {
|
|
653
|
+
nfSearchFormRef.value?.resetNfSearchFormModel();
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
// 模拟后端接口
|
|
657
|
+
const mockIndexSearch = ref(0);
|
|
658
|
+
const mockKeywordIndexSearch = ref(0);
|
|
659
|
+
const mockKeywordSearch = ref('');
|
|
660
|
+
const testPageSearch = (param) => {
|
|
661
|
+
return new Promise((resolve) => {
|
|
662
|
+
setTimeout(() => {
|
|
663
|
+
// 模拟后端接口关键字
|
|
664
|
+
if (param.pageNo === 1) {
|
|
665
|
+
mockIndexSearch.value = 0
|
|
666
|
+
mockKeywordIndexSearch.value = 0
|
|
667
|
+
}
|
|
668
|
+
console.log(param.pageNo)
|
|
669
|
+
if (param.keyword) {
|
|
670
|
+
mockIndexSearch.value = 0
|
|
671
|
+
if (mockKeywordSearch.value !== param.keyword) {
|
|
672
|
+
mockKeywordSearch.value = param.keyword
|
|
673
|
+
mockKeywordIndexSearch.value = 0
|
|
674
|
+
}
|
|
675
|
+
} else {
|
|
676
|
+
mockKeywordIndexSearch.value = 0
|
|
677
|
+
mockKeywordSearch.value = ''
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
const mockData = {
|
|
681
|
+
records: [
|
|
682
|
+
{
|
|
683
|
+
value: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+0)+mockKeywordSearch.value,
|
|
684
|
+
label: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+0)+mockKeywordSearch.value,
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
value: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+1)+mockKeywordSearch.value,
|
|
688
|
+
label: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+1)+mockKeywordSearch.value,
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
value: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+2)+mockKeywordSearch.value,
|
|
692
|
+
label: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+2)+mockKeywordSearch.value,
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
value: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+3)+mockKeywordSearch.value,
|
|
696
|
+
label: (mockKeywordSearch.value ? mockKeywordSearchIndexSearch.value : mockIndexSearch.value)+((param.pageNo - 1)*4+3)+mockKeywordSearch.value,
|
|
697
|
+
}
|
|
698
|
+
],
|
|
699
|
+
total: 100,
|
|
700
|
+
};
|
|
701
|
+
resolve(mockData)
|
|
702
|
+
}, 1000)
|
|
703
|
+
})
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
const searchOption = ref([
|
|
708
|
+
{
|
|
709
|
+
label: '普通输入框',
|
|
710
|
+
prop: 'normalInputBox',
|
|
711
|
+
element: 'el-input',
|
|
712
|
+
width: '200px',
|
|
713
|
+
category: '分类一',
|
|
714
|
+
isShowColon: true
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
label: '输入框带append',
|
|
718
|
+
prop: 'normalInputBox2',
|
|
719
|
+
element: 'el-input',
|
|
720
|
+
width: '200px',
|
|
721
|
+
category: '分类一',
|
|
722
|
+
isShowColon: true,
|
|
723
|
+
append: '元'
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
label: '输入框带prepend',
|
|
727
|
+
prop: 'normalInputBox3',
|
|
728
|
+
element: 'el-input',
|
|
729
|
+
width: '200px',
|
|
730
|
+
category: '分类一',
|
|
731
|
+
isShowColon: true,
|
|
732
|
+
prepend: '前prepend'
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
label: '数字输入框',
|
|
736
|
+
prop: 'numberInputBox',
|
|
737
|
+
element: 'el-input-number',
|
|
738
|
+
width: '200px',
|
|
739
|
+
category: '分类一'
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
label: '普通下拉',
|
|
743
|
+
prop: 'normalDropdown',
|
|
744
|
+
element: 'el-select',
|
|
745
|
+
'data-key': 'value',
|
|
746
|
+
options: [
|
|
747
|
+
{ label: '给点意见', value: '1' },
|
|
748
|
+
{ label: '售后问题', value: '2' }
|
|
749
|
+
],
|
|
750
|
+
category: '分类一'
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
label: '动态展示show(formData)',
|
|
754
|
+
prop: 'showKey',
|
|
755
|
+
element: 'el-select',
|
|
756
|
+
'data-key': 'value',
|
|
757
|
+
options: [
|
|
758
|
+
{ label: '展示所属企业form-item', value: '1' },
|
|
759
|
+
{ label: '展示所属任务form-item', value: '2' },
|
|
760
|
+
{ label: '展示"动态展示按钮"', value: '3' },
|
|
761
|
+
],
|
|
762
|
+
category: '分类一'
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
label: '所属企业',
|
|
766
|
+
prop: 'companyId',
|
|
767
|
+
element: 'el-select',
|
|
768
|
+
'data-key': 'value',
|
|
769
|
+
options: [
|
|
770
|
+
{ label: '企业1', value: '1' },
|
|
771
|
+
{ label: '企业2', value: '2' }
|
|
772
|
+
],
|
|
773
|
+
show(formData) {
|
|
774
|
+
return formData.showKey === '1'
|
|
775
|
+
},
|
|
776
|
+
category: '分类一'
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
label: '所属任务',
|
|
780
|
+
prop: 'taskId',
|
|
781
|
+
element: 'el-select',
|
|
782
|
+
'data-key': 'value',
|
|
783
|
+
options: [
|
|
784
|
+
{ label: '任务1', value: '1' },
|
|
785
|
+
{ label: '任务2', value: '2' }
|
|
786
|
+
],
|
|
787
|
+
show(formData) {
|
|
788
|
+
return formData.showKey === '2'
|
|
789
|
+
},
|
|
790
|
+
category: '分类一'
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
label: 'changeProps下拉',
|
|
794
|
+
prop: 'changePropsKey',
|
|
795
|
+
element: 'el-select',
|
|
796
|
+
'data-key': 'value',
|
|
797
|
+
options: [
|
|
798
|
+
{ label: 'changeProps1', value: 1 },
|
|
799
|
+
{ label: 'changeProps2', value: 2 }
|
|
800
|
+
],
|
|
801
|
+
changeProps: ['getOptionsKey'],
|
|
802
|
+
category: '分类一'
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
label: 'getOptions下拉',
|
|
806
|
+
prop: 'getOptionsKey',
|
|
807
|
+
element: 'el-select',
|
|
808
|
+
'data-key': 'value',
|
|
809
|
+
getOptions(callback, formData) {
|
|
810
|
+
console.log('获取到当前所依赖的表单数据', formData)
|
|
811
|
+
setTimeout(() => {
|
|
812
|
+
callback([
|
|
813
|
+
{ label: 'getOptions1', value: '1' },
|
|
814
|
+
{ label: 'getOptions2', value: '2' }
|
|
815
|
+
])
|
|
816
|
+
}, 5000)
|
|
817
|
+
},
|
|
818
|
+
category: '分类一'
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
label: '日期区间配置(exchangeKey)',
|
|
822
|
+
prop: 'exchangeTime',
|
|
823
|
+
type: 'daterange',
|
|
824
|
+
element: 'el-date-picker',
|
|
825
|
+
category: '分类二',
|
|
826
|
+
exchangeKey: { type: EXCHANGE_KEY_TYPE.range, value: ['beginTime', 'endTime'] },
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
label: '全选下拉',
|
|
830
|
+
prop: 'multipleDropdown',
|
|
831
|
+
element: 'el-select',
|
|
832
|
+
multiple: true,
|
|
833
|
+
selectAll: true,
|
|
834
|
+
selectAllText: '我全都要',
|
|
835
|
+
'data-key': 'value',
|
|
836
|
+
options: [{
|
|
837
|
+
value: '选项1',
|
|
838
|
+
label: '黄金糕'
|
|
839
|
+
}, {
|
|
840
|
+
value: '选项2',
|
|
841
|
+
label: '双皮奶'
|
|
842
|
+
}, {
|
|
843
|
+
value: '选项3',
|
|
844
|
+
label: '蚵仔煎'
|
|
845
|
+
}, {
|
|
846
|
+
value: '选项4',
|
|
847
|
+
label: '龙须面'
|
|
848
|
+
}, {
|
|
849
|
+
value: '选项5',
|
|
850
|
+
label: '北京烤鸭'
|
|
851
|
+
}, {
|
|
852
|
+
value: '选项6',
|
|
853
|
+
label: '干炒牛河'
|
|
854
|
+
}, {
|
|
855
|
+
value: '选项7',
|
|
856
|
+
label: '艇仔粥'
|
|
857
|
+
}, {
|
|
858
|
+
value: '选项8',
|
|
859
|
+
label: '油条'
|
|
860
|
+
}, {
|
|
861
|
+
value: '选项9',
|
|
862
|
+
label: '糯米鸡'
|
|
863
|
+
}],
|
|
864
|
+
category: '分类一'
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
label: '虚拟下拉',
|
|
868
|
+
prop: 'virtualDropdown',
|
|
869
|
+
element: 'el-select',
|
|
870
|
+
'data-key': 'value',
|
|
871
|
+
'virtual-list': true,
|
|
872
|
+
options: [
|
|
873
|
+
{ label: '给点意见', value: '1' },
|
|
874
|
+
{ label: '售后问题', value: '2' }
|
|
875
|
+
],
|
|
876
|
+
category: '分类一'
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
label: '分页虚拟下拉',
|
|
880
|
+
prop: 'pageVirtualDropdown',
|
|
881
|
+
element: 'nf-lazy-select',
|
|
882
|
+
'data-key': 'value',
|
|
883
|
+
'virtual-list': true,
|
|
884
|
+
request: testPageSearch,
|
|
885
|
+
category: '分类一'
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
label: '多选穿梭',
|
|
889
|
+
prop: 'multipleChoiceShuttle',
|
|
890
|
+
element: 'nf-transfer-select',
|
|
891
|
+
initValue: [],
|
|
892
|
+
options:[{
|
|
893
|
+
value: '选项1',
|
|
894
|
+
label: '黄金糕'
|
|
895
|
+
}, {
|
|
896
|
+
value: '选项2',
|
|
897
|
+
label: '双皮奶'
|
|
898
|
+
}, {
|
|
899
|
+
value: '选项3',
|
|
900
|
+
label: '蚵仔煎'
|
|
901
|
+
}, {
|
|
902
|
+
value: '选项4',
|
|
903
|
+
label: '龙须面'
|
|
904
|
+
}, {
|
|
905
|
+
value: '选项5',
|
|
906
|
+
label: '北京烤鸭'
|
|
907
|
+
}],
|
|
908
|
+
category: '分类一'
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
label: '级联',
|
|
912
|
+
prop: 'elCascader',
|
|
913
|
+
element: 'el-cascader',
|
|
914
|
+
'popper-class': 'nf-search-form-demo',
|
|
915
|
+
options: [{
|
|
916
|
+
value: 'zhinan',
|
|
917
|
+
label: '指南',
|
|
918
|
+
children: [{
|
|
919
|
+
value: 'shejiyuanze',
|
|
920
|
+
label: '设计原则',
|
|
921
|
+
children: [{
|
|
922
|
+
value: 'yizhi',
|
|
923
|
+
label: '一致'
|
|
924
|
+
}]
|
|
925
|
+
}, {
|
|
926
|
+
value: 'daohang',
|
|
927
|
+
label: '导航',
|
|
928
|
+
children: [{
|
|
929
|
+
value: 'cexiangdaohang',
|
|
930
|
+
label: '侧向导航'
|
|
931
|
+
}]
|
|
932
|
+
}]
|
|
933
|
+
}, {
|
|
934
|
+
value: 'zujian',
|
|
935
|
+
label: '组件',
|
|
936
|
+
children: [{
|
|
937
|
+
value: 'basic',
|
|
938
|
+
label: 'Basic',
|
|
939
|
+
children: [{
|
|
940
|
+
value: 'layout',
|
|
941
|
+
label: 'Layout 布局'
|
|
942
|
+
}]
|
|
943
|
+
}]
|
|
944
|
+
}, {
|
|
945
|
+
value: 'ziyuan',
|
|
946
|
+
label: '资源',
|
|
947
|
+
children: [{
|
|
948
|
+
value: 'axure',
|
|
949
|
+
label: 'Axure Components'
|
|
950
|
+
}]
|
|
951
|
+
}],
|
|
952
|
+
category: '分类一'
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
label: '任意时间点',
|
|
956
|
+
prop: 'anyPointInTime',
|
|
957
|
+
element: 'el-time-picker',
|
|
958
|
+
'picker-options': {
|
|
959
|
+
start: '08:30',
|
|
960
|
+
step: '00:10',
|
|
961
|
+
end: '18:30'
|
|
962
|
+
},
|
|
963
|
+
category: '分类二'
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
label: '任意时间区间',
|
|
967
|
+
prop: 'anyTimeInterval',
|
|
968
|
+
element: 'el-time-picker',
|
|
969
|
+
'is-range': true,
|
|
970
|
+
'picker-options': {
|
|
971
|
+
start: '08:30',
|
|
972
|
+
step: '00:10',
|
|
973
|
+
end: '18:30'
|
|
974
|
+
},
|
|
975
|
+
category: '分类二'
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
label: '年份选择',
|
|
979
|
+
prop: 'year',
|
|
980
|
+
type: 'year',
|
|
981
|
+
element: 'el-date-picker',
|
|
982
|
+
category: '分类二'
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
label: '半年选择',
|
|
986
|
+
prop: 'halfyear',
|
|
987
|
+
element: 'nf-half-year-picker',
|
|
988
|
+
category: '分类二'
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
label: '季度选择',
|
|
992
|
+
prop: 'quarter',
|
|
993
|
+
element: 'nf-quarter-picker',
|
|
994
|
+
category: '分类二'
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
label: '月份选择',
|
|
998
|
+
prop: 'month',
|
|
999
|
+
type: 'month',
|
|
1000
|
+
element: 'el-date-picker',
|
|
1001
|
+
category: '分类二'
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
label: '周数选择',
|
|
1005
|
+
prop: 'week',
|
|
1006
|
+
type: 'week',
|
|
1007
|
+
element: 'el-date-picker',
|
|
1008
|
+
category: '分类二'
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
label: '日期选择',
|
|
1012
|
+
prop: 'date',
|
|
1013
|
+
type: 'date',
|
|
1014
|
+
element: 'el-date-picker',
|
|
1015
|
+
category: '分类二'
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
label: '日期区间',
|
|
1019
|
+
prop: 'daterange',
|
|
1020
|
+
type: 'daterange',
|
|
1021
|
+
element: 'el-date-picker',
|
|
1022
|
+
category: '分类二'
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
label: '周区间',
|
|
1026
|
+
prop: 'weekrange',
|
|
1027
|
+
element: 'nf-double-week',
|
|
1028
|
+
category: '分类二'
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
label: '月份区间',
|
|
1032
|
+
prop: 'monthrange',
|
|
1033
|
+
type: 'monthrange',
|
|
1034
|
+
element: 'el-date-picker',
|
|
1035
|
+
category: '分类二'
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
label: '季度区间',
|
|
1039
|
+
prop: 'quarterrange',
|
|
1040
|
+
element: 'nf-double-quarter',
|
|
1041
|
+
category: '分类二'
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
label: '半年区间',
|
|
1045
|
+
prop: 'halfyearrrange',
|
|
1046
|
+
element: 'nf-double-half-year',
|
|
1047
|
+
category: '分类二'
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
label: '年区间',
|
|
1051
|
+
prop: 'yearrrange',
|
|
1052
|
+
element: 'nf-double-year',
|
|
1053
|
+
category: '分类二'
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
label: '日期和时间点',
|
|
1057
|
+
prop: 'datetime',
|
|
1058
|
+
type: 'datetime',
|
|
1059
|
+
element: 'el-date-picker',
|
|
1060
|
+
category: '分类二'
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
label: '日期和时间范围',
|
|
1064
|
+
prop: 'datetimerange',
|
|
1065
|
+
type: 'datetimerange',
|
|
1066
|
+
element: 'el-date-picker',
|
|
1067
|
+
category: '分类二'
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
label: '固定时间',
|
|
1071
|
+
prop: 'fixedtime',
|
|
1072
|
+
element: 'el-time-select',
|
|
1073
|
+
'picker-options': {
|
|
1074
|
+
start: '08:30',
|
|
1075
|
+
step: '00:10',
|
|
1076
|
+
end: '18:30'
|
|
1077
|
+
},
|
|
1078
|
+
category: '分类三'
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
label: '固定时间区间',
|
|
1082
|
+
prop: 'fixedTimeInterval',
|
|
1083
|
+
element: 'el-time-select',
|
|
1084
|
+
type: 'datetimerange',
|
|
1085
|
+
'picker-options': {
|
|
1086
|
+
start: '08:30',
|
|
1087
|
+
step: '00:10',
|
|
1088
|
+
end: '18:30'
|
|
1089
|
+
},
|
|
1090
|
+
category: '分类三'
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
label: '数字区间',
|
|
1094
|
+
prop: 'numberRange',
|
|
1095
|
+
element: 'number-range',
|
|
1096
|
+
initValue: [],
|
|
1097
|
+
min: 0,
|
|
1098
|
+
category: '分类三',
|
|
1099
|
+
class: 'number-range-box',
|
|
1100
|
+
inputSlot: {
|
|
1101
|
+
append: 'repeatCountAppend',
|
|
1102
|
+
doubleAppend: 'doubleRepeatCountAppend',
|
|
1103
|
+
doubleSegment: 'doubleRepeatCountAppendSegment',
|
|
1104
|
+
},
|
|
1105
|
+
tag: 'el-input',
|
|
1106
|
+
events: {
|
|
1107
|
+
input: (val) => {
|
|
1108
|
+
let flag = false
|
|
1109
|
+
const val0 = val[0]?.replace(/[^0-9]/g, '')
|
|
1110
|
+
const val1 = val[1]?.replace(/[^0-9]/g, '')
|
|
1111
|
+
if (val[0] && val0 != val[0]) {
|
|
1112
|
+
flag = true
|
|
1113
|
+
}
|
|
1114
|
+
if (val[1] && val1 != val[1]) {
|
|
1115
|
+
flag = true
|
|
1116
|
+
}
|
|
1117
|
+
if (flag && this.$refs.unfinishNfSearchForm) {
|
|
1118
|
+
this.$refs.nfSearchForm.unfinishNfSearchForm.repeatCountVal = [val0, val1]
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
label: '自定义slot',
|
|
1125
|
+
prop: 'custumSlot',
|
|
1126
|
+
slot: 'custumSlot',
|
|
1127
|
+
category: '分类四',
|
|
1128
|
+
},
|
|
1129
|
+
])
|
|
1130
|
+
|
|
1131
|
+
const searchForm = ref({
|
|
1132
|
+
custumSlot: ''
|
|
1133
|
+
})
|
|
1134
|
+
|
|
1135
|
+
const searchFn = (data) => {
|
|
1136
|
+
console.log(data)
|
|
1137
|
+
searchForm.value = ref({
|
|
1138
|
+
...searchForm.value,
|
|
1139
|
+
...data
|
|
1140
|
+
})
|
|
1141
|
+
}
|
|
1142
|
+
const resetFieldsFn = () => {
|
|
1143
|
+
searchForm.value.custumSlot = ''
|
|
1144
|
+
}
|
|
1145
|
+
const exportFn = (data) => {
|
|
1146
|
+
console.log(data)
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* nf-search-form
|
|
1150
|
+
*/
|
|
1151
|
+
/**
|
|
1152
|
+
* nf-lazy-select
|
|
1153
|
+
*/
|
|
1154
|
+
const test = ref([]);
|
|
1155
|
+
const test1 = ref();
|
|
1156
|
+
const test2 = ref();
|
|
1157
|
+
const testChange1 = () => {
|
|
1158
|
+
console.log('testChange1')
|
|
1159
|
+
}
|
|
1160
|
+
const testChange2 = () => {
|
|
1161
|
+
console.log('testChange2')
|
|
1162
|
+
}
|
|
1163
|
+
const testChange3 = () => {
|
|
1164
|
+
console.log('testChange3')
|
|
1165
|
+
}
|
|
1166
|
+
const testInput1 = () => {
|
|
1167
|
+
console.log('testInput1')
|
|
1168
|
+
}
|
|
1169
|
+
const testInput2 = () => {
|
|
1170
|
+
console.log('testInput2')
|
|
1171
|
+
}
|
|
1172
|
+
const testInput3 = () => {
|
|
1173
|
+
console.log('testInput3')
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// 模拟后端接口
|
|
1177
|
+
const mockIndex = ref(0);
|
|
1178
|
+
const mockKeywordIndex = ref(0);
|
|
1179
|
+
const mockKeyword = ref('');
|
|
1180
|
+
const testPage = (param) => {
|
|
1181
|
+
return new Promise((resolve) => {
|
|
1182
|
+
setTimeout(() => {
|
|
1183
|
+
// 模拟后端接口关键字
|
|
1184
|
+
if (param.pageNo === 1) {
|
|
1185
|
+
mockIndex.value = 0
|
|
1186
|
+
mockKeywordIndex.value = 0
|
|
1187
|
+
}
|
|
1188
|
+
console.log(param.pageNo)
|
|
1189
|
+
if (param.keyword) {
|
|
1190
|
+
mockIndex.value = 0
|
|
1191
|
+
if (mockKeyword.value !== param.keyword) {
|
|
1192
|
+
mockKeyword.value = param.keyword
|
|
1193
|
+
mockKeywordIndex.value = 0
|
|
1194
|
+
}
|
|
1195
|
+
} else {
|
|
1196
|
+
mockKeywordIndex.value = 0
|
|
1197
|
+
mockKeyword.value = ''
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
const mockData = {
|
|
1201
|
+
records: [
|
|
1202
|
+
{
|
|
1203
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+0)+mockKeyword.value,
|
|
1204
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+0)+mockKeyword.value + '显示',
|
|
1205
|
+
a: 1,
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+1)+mockKeyword.value,
|
|
1209
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+1)+mockKeyword.value + '显示'
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+2)+mockKeyword.value,
|
|
1213
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+2)+mockKeyword.value + '显示'
|
|
1214
|
+
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+3)+mockKeyword.value,
|
|
1218
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+3)+mockKeyword.value + '显示'
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+4)+mockKeyword.value,
|
|
1222
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+4)+mockKeyword.value + '显示'
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+5)+mockKeyword.value,
|
|
1226
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+5)+mockKeyword.value + '显示'
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+6)+mockKeyword.value,
|
|
1230
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+6)+mockKeyword.value + '显示'
|
|
1231
|
+
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+7)+mockKeyword.value,
|
|
1235
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+7)+mockKeyword.value + '显示'
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+8)+mockKeyword.value,
|
|
1239
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+8)+mockKeyword.value + '显示'
|
|
1240
|
+
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
value: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+9)+mockKeyword.value,
|
|
1244
|
+
label: (mockKeyword.value ? mockKeywordIndex.value : mockIndex.value)+((param.pageNo - 1)*10+9)+mockKeyword.value + '显示'
|
|
1245
|
+
}
|
|
1246
|
+
],
|
|
1247
|
+
total: 1000,
|
|
1248
|
+
};
|
|
1249
|
+
resolve(mockData)
|
|
1250
|
+
}, 1000)
|
|
1251
|
+
})
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* nf-lazy-select
|
|
1255
|
+
*/
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* nf-radio
|
|
1259
|
+
*/
|
|
1260
|
+
// 1-当天,2-按日,3-按周,4-按月
|
|
1261
|
+
const TimeTypeMap = {
|
|
1262
|
+
today: 1,
|
|
1263
|
+
day: 2,
|
|
1264
|
+
week: 3,
|
|
1265
|
+
month: 4
|
|
1266
|
+
}
|
|
1267
|
+
const multipleActiveIndex = ref([TimeTypeMap['day']])
|
|
1268
|
+
const queryList = ref([ {
|
|
1269
|
+
name: '今日',
|
|
1270
|
+
value: TimeTypeMap['today'],
|
|
1271
|
+
tip: '',
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
name: '按日',
|
|
1275
|
+
value: TimeTypeMap['day'],
|
|
1276
|
+
tip: '按日统计,默认查询最近7天'
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
name: '按周',
|
|
1280
|
+
value: TimeTypeMap['week'],
|
|
1281
|
+
tip: '按周统计,默认查询最近4周,最近可选上一周'
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
name: '按月',
|
|
1285
|
+
value: TimeTypeMap['month'],
|
|
1286
|
+
tip: '按月统计,默认查询最近6个月,最近可选上一个月'
|
|
1287
|
+
}
|
|
1288
|
+
])
|
|
1289
|
+
const changeHandler = ({index,value}) => {
|
|
1290
|
+
console.log(index)
|
|
1291
|
+
console.log(value)
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* nf-radio
|
|
1295
|
+
*/
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* nf-input
|
|
1299
|
+
*/
|
|
1300
|
+
const text = ref('字数长度很长,自定义el-input背景可以看出展示会出现输入框文本被遮挡,nf-input做了数据统计遮挡优化')
|
|
1301
|
+
const textarea = ref('字数长度很长,自定义el-input背景可以看出展示会出现输入框文本被遮挡,nf-input做了数据统计遮挡优化')
|
|
1302
|
+
/**
|
|
1303
|
+
* nf-input
|
|
1304
|
+
*/
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* nf-drawer
|
|
1308
|
+
*/
|
|
1309
|
+
const drawer = ref(false)
|
|
1310
|
+
const tabs = ref([
|
|
1311
|
+
{ name: "基础配置", slot: "tab-1" },
|
|
1312
|
+
{ name: "高级配置", slot: "tab-2" },
|
|
1313
|
+
{ name: "特殊配置", slot: "tab-3" },
|
|
1314
|
+
]);
|
|
1315
|
+
const handleConfirm = (done) => {
|
|
1316
|
+
setTimeout(() => {
|
|
1317
|
+
done()
|
|
1318
|
+
}, 1000);
|
|
1319
|
+
};
|
|
1320
|
+
/**
|
|
1321
|
+
* nf-drawer
|
|
1322
|
+
*/
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* 动态提示
|
|
1326
|
+
*/
|
|
1327
|
+
const app = getCurrentInstance()?.proxy
|
|
1328
|
+
const openMessage = () => {
|
|
1329
|
+
// app.$openMessage("这是一条消息提示");
|
|
1330
|
+
// app.$openMessage.success("这是一条消息提示");
|
|
1331
|
+
// app.$openMessage.warning("这是一条消息提示");
|
|
1332
|
+
app.$openMessage.error("这是一条消息提示");
|
|
1333
|
+
};
|
|
1334
|
+
const openNotify = () => {
|
|
1335
|
+
// app.$openNotify({
|
|
1336
|
+
// title: "提示",
|
|
1337
|
+
// message: "这是一条不会自动关闭的消息",
|
|
1338
|
+
// duration: 0,
|
|
1339
|
+
// });
|
|
1340
|
+
app.$openNotify({
|
|
1341
|
+
title: "成功",
|
|
1342
|
+
message: "这是一条成功的提示消息",
|
|
1343
|
+
type: "success",
|
|
1344
|
+
});
|
|
1345
|
+
// app.$openNotify({
|
|
1346
|
+
// title: "警告",
|
|
1347
|
+
// message: "这是一条警告的提示消息",
|
|
1348
|
+
// type: "warning",
|
|
1349
|
+
// });
|
|
1350
|
+
// app.$openNotify.info({
|
|
1351
|
+
// title: "消息",
|
|
1352
|
+
// message: "这是一条消息的提示消息",
|
|
1353
|
+
// });
|
|
1354
|
+
// app.$openNotify.error({
|
|
1355
|
+
// title: "错误",
|
|
1356
|
+
// message: "这是一条错误的提示消息",
|
|
1357
|
+
// })
|
|
1358
|
+
};
|
|
1359
|
+
const openConfirm = () => {
|
|
1360
|
+
// app.$openConfirm({
|
|
1361
|
+
// type: "success",
|
|
1362
|
+
// title: "成功",
|
|
1363
|
+
// message: "这是一条消息提示",
|
|
1364
|
+
// onConfirm: (done) => done(),
|
|
1365
|
+
// });
|
|
1366
|
+
// app.$openConfirm.success({
|
|
1367
|
+
// type: "warning",
|
|
1368
|
+
// title: "警告",
|
|
1369
|
+
// message: "这是一条警告消息提示",
|
|
1370
|
+
// onConfirm: (done) => {
|
|
1371
|
+
// setTimeout(() => {
|
|
1372
|
+
// done();
|
|
1373
|
+
// }, 1000);
|
|
1374
|
+
// },
|
|
1375
|
+
// });
|
|
1376
|
+
app.$openConfirm({
|
|
1377
|
+
type: "error",
|
|
1378
|
+
title: "错误",
|
|
1379
|
+
message: "这是一条错误消息提示",
|
|
1380
|
+
onConfirm: (done) => done(),
|
|
1381
|
+
});
|
|
1382
|
+
// app.$openMessage({
|
|
1383
|
+
// type: "info",
|
|
1384
|
+
// title: "HTML 片段",
|
|
1385
|
+
// message: '<strong>这是 <i>HTML</i> 片段</strong>',
|
|
1386
|
+
// dangerouslyUseHTMLString: true,
|
|
1387
|
+
// onConfirm: (done) => done(),
|
|
1388
|
+
// });
|
|
1389
|
+
// app.$openConfirm({
|
|
1390
|
+
// title: "提示",
|
|
1391
|
+
// message: "这是一条消息提示"
|
|
1392
|
+
// }).then(done => {
|
|
1393
|
+
// app.$openMessage("你点击了确定")
|
|
1394
|
+
// setTimeout(()=>{
|
|
1395
|
+
// done()
|
|
1396
|
+
// }, 1000)
|
|
1397
|
+
// }).catch(()=>{
|
|
1398
|
+
// app.$openMessage("你点击了取消")
|
|
1399
|
+
// })
|
|
1400
|
+
};
|
|
1401
|
+
/**
|
|
1402
|
+
* 动态提示
|
|
1403
|
+
*/
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* nf-audio
|
|
1407
|
+
*/
|
|
1408
|
+
const betweenStart = ref(0.3)
|
|
1409
|
+
const betweenEnd = ref(1.6)
|
|
1410
|
+
const nfAudio = ref()
|
|
1411
|
+
const url = 'https://oss.xccjh.top/xccjh-images/%E5%B0%8F%E4%B8%83-%E5%A5%B3-%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88%E5%93%88.wav'
|
|
1412
|
+
const jumpToTime = 0.5
|
|
1413
|
+
const backSecond = 0.3
|
|
1414
|
+
const forwardSecond = 0.6
|
|
1415
|
+
function download(){
|
|
1416
|
+
alert('下载成功')
|
|
1417
|
+
}
|
|
1418
|
+
function betweenPlay() {
|
|
1419
|
+
nfAudio.value.betweenPlay()
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* nf-audio
|
|
1423
|
+
*/
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* nf-microphone
|
|
1427
|
+
*/
|
|
1428
|
+
const sign = ref('')
|
|
1429
|
+
const timestamp = ref(Date.now())
|
|
1430
|
+
|
|
1431
|
+
const agentTag = 'zoujh-test'
|
|
1432
|
+
const appKey = '032d44009bff1752'
|
|
1433
|
+
const appSecret = '4c7304c94c5e8725613516d4d6db679b'
|
|
1434
|
+
|
|
1435
|
+
const str = appKey + timestamp.value
|
|
1436
|
+
const sha1 = window.CryptoJS.HmacSHA1(str, appSecret)
|
|
1437
|
+
sign.value = window.CryptoJS.enc.Base64.stringify(sha1)
|
|
1438
|
+
|
|
1439
|
+
const nfSoftPhone1 = ref()
|
|
1440
|
+
const commonSoftphone = ref()
|
|
1441
|
+
|
|
1442
|
+
const softphoneConnectCallBack1 = async (data) => {
|
|
1443
|
+
console.log('softphone-connect1', data)
|
|
1444
|
+
commonSoftphone.value = data.commonSoftphone
|
|
1445
|
+
// await (await data.commonSoftphone.getUserAgentManager()).toggleNap(false)
|
|
1446
|
+
}
|
|
1447
|
+
const softphoneCallRefreshCallBack1 = (data) => {
|
|
1448
|
+
console.log('softphone-call-refresh1', data)
|
|
1449
|
+
}
|
|
1450
|
+
const softphoneSeatStatusChangeCallBack1 = (data) => {
|
|
1451
|
+
console.log('softphone-seats-status-change1', data)
|
|
1452
|
+
}
|
|
1453
|
+
const softphoneAcceptCallBack1 = (data) => {
|
|
1454
|
+
console.log('softphone-accept1', data)
|
|
1455
|
+
}
|
|
1456
|
+
const softphoneIgnoreCallBack1 = (data) => {
|
|
1457
|
+
console.log('softphone-ignore1', data)
|
|
1458
|
+
}
|
|
1459
|
+
const softphoneHangupCallBack1 = (data) => {
|
|
1460
|
+
console.log('softphone-hangup1', data)
|
|
1461
|
+
}
|
|
1462
|
+
const softphoneAutoIgnoreCallback1 = (data) => {
|
|
1463
|
+
console.log('softphone-auto-ignore-callback1', data)
|
|
1464
|
+
}
|
|
1465
|
+
const softphoneSessionStateChangeCallBack1 = (data) => {
|
|
1466
|
+
console.log('softphone-session-state-change1', data)
|
|
1467
|
+
}
|
|
1468
|
+
const softphoneIncomingCallBack1 = (data) => {
|
|
1469
|
+
console.log('softphone-incoming1', data)
|
|
1470
|
+
}
|
|
1471
|
+
const softphoneSendDtmfCallBack1 = (data) => {
|
|
1472
|
+
console.log('softphone-send-dtmf1', data)
|
|
1473
|
+
}
|
|
1474
|
+
const softphoneConnectRegisteredCallBack1 = (data) => {
|
|
1475
|
+
console.log('softphone-connect-registered1', data)
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
const softphoneSignOverduedCallBack1 = (done) => {
|
|
1479
|
+
console.log('softphone-sign-overdued1')
|
|
1480
|
+
const timestamp = Date.now()
|
|
1481
|
+
done({
|
|
1482
|
+
timestamp,
|
|
1483
|
+
sign: window.CryptoJS.enc.Base64.stringify(window.CryptoJS.HmacSHA1(appKey + timestamp, appSecret))
|
|
1484
|
+
})
|
|
1485
|
+
} // 👈 注册sign过期后重新刷新sign逻辑
|
|
1486
|
+
|
|
1487
|
+
// setTimeout(() => {
|
|
1488
|
+
// commonSoftphone.value.getUserAgentManagerSync().callNumber('15018707394')
|
|
1489
|
+
// }, 5000)
|
|
1490
|
+
|
|
1491
|
+
/**
|
|
1492
|
+
* nf-microphone
|
|
1493
|
+
*/
|
|
1494
|
+
return {
|
|
1495
|
+
|
|
1496
|
+
keywords,
|
|
1497
|
+
delAllKeywordFn,
|
|
1498
|
+
delItem,
|
|
1499
|
+
copySuccess,
|
|
1500
|
+
getItemDisabledStatus,
|
|
1501
|
+
|
|
1502
|
+
showData,
|
|
1503
|
+
pageAttrs,
|
|
1504
|
+
pageEvents,
|
|
1505
|
+
nfTable,
|
|
1506
|
+
searchOptionTable,
|
|
1507
|
+
mockColumns,
|
|
1508
|
+
mockData,
|
|
1509
|
+
getSummaries,
|
|
1510
|
+
|
|
1511
|
+
EXCHANGE_KEY_TYPE,
|
|
1512
|
+
nfSearchFormRef,
|
|
1513
|
+
columns,
|
|
1514
|
+
inline,
|
|
1515
|
+
labelPosition,
|
|
1516
|
+
changeLabelPosition,
|
|
1517
|
+
isCollapseChange,
|
|
1518
|
+
rules,
|
|
1519
|
+
btnItemList,
|
|
1520
|
+
submitForm,
|
|
1521
|
+
resetForm,
|
|
1522
|
+
mockIndexSearch,
|
|
1523
|
+
mockKeywordIndexSearch,
|
|
1524
|
+
mockKeywordSearch,
|
|
1525
|
+
testPageSearch,
|
|
1526
|
+
searchOption,
|
|
1527
|
+
searchForm,
|
|
1528
|
+
searchFn,
|
|
1529
|
+
resetFieldsFn,
|
|
1530
|
+
exportFn,
|
|
1531
|
+
|
|
1532
|
+
test,
|
|
1533
|
+
test1,
|
|
1534
|
+
test2,
|
|
1535
|
+
testChange1,
|
|
1536
|
+
testChange2,
|
|
1537
|
+
testChange3,
|
|
1538
|
+
testInput1,
|
|
1539
|
+
testInput2,
|
|
1540
|
+
testInput3,
|
|
1541
|
+
mockIndex,
|
|
1542
|
+
mockKeywordIndex,
|
|
1543
|
+
mockKeyword,
|
|
1544
|
+
testPage,
|
|
1545
|
+
|
|
1546
|
+
TimeTypeMap,
|
|
1547
|
+
multipleActiveIndex,
|
|
1548
|
+
queryList,
|
|
1549
|
+
changeHandler,
|
|
1550
|
+
|
|
1551
|
+
text,
|
|
1552
|
+
textarea,
|
|
1553
|
+
|
|
1554
|
+
drawer,
|
|
1555
|
+
tabs,
|
|
1556
|
+
handleConfirm,
|
|
1557
|
+
|
|
1558
|
+
openMessage,
|
|
1559
|
+
openNotify,
|
|
1560
|
+
openConfirm,
|
|
1561
|
+
|
|
1562
|
+
download,
|
|
1563
|
+
betweenPlay,
|
|
1564
|
+
nfAudio,
|
|
1565
|
+
url,
|
|
1566
|
+
betweenStart,
|
|
1567
|
+
betweenEnd,
|
|
1568
|
+
jumpToTime,
|
|
1569
|
+
backSecond,
|
|
1570
|
+
forwardSecond,
|
|
1571
|
+
|
|
1572
|
+
sign,
|
|
1573
|
+
timestamp,
|
|
1574
|
+
agentTag,
|
|
1575
|
+
appKey,
|
|
1576
|
+
appSecret,
|
|
1577
|
+
nfSoftPhone1,
|
|
1578
|
+
commonSoftphone,
|
|
1579
|
+
softphoneConnectCallBack1,
|
|
1580
|
+
softphoneCallRefreshCallBack1,
|
|
1581
|
+
softphoneSeatStatusChangeCallBack1,
|
|
1582
|
+
softphoneAcceptCallBack1,
|
|
1583
|
+
softphoneIgnoreCallBack1,
|
|
1584
|
+
softphoneHangupCallBack1,
|
|
1585
|
+
softphoneAutoIgnoreCallback1,
|
|
1586
|
+
softphoneSessionStateChangeCallBack1,
|
|
1587
|
+
softphoneIncomingCallBack1,
|
|
1588
|
+
softphoneSendDtmfCallBack1,
|
|
1589
|
+
softphoneConnectRegisteredCallBack1,
|
|
1590
|
+
softphoneSignOverduedCallBack1,
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
})
|
|
1594
|
+
</script>
|
|
1595
|
+
<div id="app">
|
|
1596
|
+
<div class="demo">
|
|
1597
|
+
<el-row style="margin-top: 10px">
|
|
1598
|
+
<h3>1. 按钮和动态提示</h3>
|
|
1599
|
+
<span class="test-sass" @click="openNotify">点击打开common-ui【通知】</span>
|
|
1600
|
+
<el-button @click="openMessage">element-ui按钮,点击提示common-ui【消息】</el-button>
|
|
1601
|
+
<nf-button type="danger" @click="drawer = true">common-ui按钮,点击打开common-ui【抽屉】</nf-button>
|
|
1602
|
+
<nf-button text type="danger" @click="openConfirm">带hover的自定义颜色文本,点击打开common-ui【弹框】</nf-button>
|
|
1603
|
+
<nf-drawer
|
|
1604
|
+
title="我是标题"
|
|
1605
|
+
:visible.sync="drawer"
|
|
1606
|
+
@confirm="handleConfirm"
|
|
1607
|
+
current-tab="高级配置"
|
|
1608
|
+
:tabs="tabs"
|
|
1609
|
+
>
|
|
1610
|
+
<div style="padding: 20px;" slot="tab-1">我是自定义的基础配置</div>
|
|
1611
|
+
<div style="padding: 20px;" slot="tab-2">我是自定义的高级配置</div>
|
|
1612
|
+
<div style="padding: 20px;" slot="tab-3">我是自定义的特殊配置</div>
|
|
1613
|
+
</nf-drawer>
|
|
1614
|
+
</el-row>
|
|
1615
|
+
<div style="margin-top: 10px">
|
|
1616
|
+
<h3>2. 输入框</h3>
|
|
1617
|
+
<el-input
|
|
1618
|
+
v-model="text"
|
|
1619
|
+
maxlength="100000"
|
|
1620
|
+
:show-word-limit="true"
|
|
1621
|
+
style='width: 500px;vertical-align: top'
|
|
1622
|
+
></el-input>
|
|
1623
|
+
<el-input
|
|
1624
|
+
style='width: 200px'
|
|
1625
|
+
type="textarea"
|
|
1626
|
+
v-model="textarea"
|
|
1627
|
+
maxlength="100000"
|
|
1628
|
+
:show-word-limit="true"
|
|
1629
|
+
></el-input>
|
|
1630
|
+
<el-divider>上面el-input</el-divider>
|
|
1631
|
+
<el-divider>下面nf-input</el-divider>
|
|
1632
|
+
<nf-input
|
|
1633
|
+
v-model="text"
|
|
1634
|
+
maxlength="100000"
|
|
1635
|
+
:show-word-limit="true"
|
|
1636
|
+
style='width: 500px;vertical-align: top'
|
|
1637
|
+
></nf-input>
|
|
1638
|
+
<nf-input
|
|
1639
|
+
style='width: 200px'
|
|
1640
|
+
type="textarea"
|
|
1641
|
+
v-model="textarea"
|
|
1642
|
+
maxlength="100000"
|
|
1643
|
+
:show-word-limit="true"
|
|
1644
|
+
></nf-input>
|
|
1645
|
+
</div>
|
|
1646
|
+
<div style="margin-top: 10px">
|
|
1647
|
+
<h3>3. 折叠检测器</h3>
|
|
1648
|
+
<nf-action style='width: fit-content;' :span='3'>
|
|
1649
|
+
<nf-button type="text" size="mini">导入</nf-button>
|
|
1650
|
+
<nf-button type="text" size="mini">详情</nf-button>
|
|
1651
|
+
<nf-button type="text" size="mini">复制</nf-button>
|
|
1652
|
+
<nf-button type="text" size="mini">停用</nf-button>
|
|
1653
|
+
<nf-button type="text" size="mini">启用</nf-button>
|
|
1654
|
+
<nf-button type="text" size="mini">编辑</nf-button>
|
|
1655
|
+
</nf-action>
|
|
1656
|
+
<span style="display: inline-block;margin-left: 20px;width: 360px;">
|
|
1657
|
+
<nf-text-overflow content="似水流年是一个人所有的一切,只有这个东西,才真正归你所有。其余的一切,都是片刻的欢娱和不幸,转眼间就已跑到那似水流年里去" ></nf-text-overflow>
|
|
1658
|
+
</span>
|
|
1659
|
+
</div>
|
|
1660
|
+
<div style="margin-top: 10px;">
|
|
1661
|
+
<h3>4. 标签</h3>
|
|
1662
|
+
<nf-tag style='margin-right: 20px;' type='success'>已通过</nf-tag>
|
|
1663
|
+
<nf-tag style='margin-right: 20px;' type='info'>已发布</nf-tag>
|
|
1664
|
+
<nf-tag style='margin-right: 20px;' type='disabled'>已删除</nf-tag>
|
|
1665
|
+
<nf-tag style='margin-right: 20px;' type='warning'>待处理</nf-tag>
|
|
1666
|
+
<nf-tag style='margin-right: 20px;' type='tip'>审核中</nf-tag>
|
|
1667
|
+
<nf-tag style='margin-right: 20px;' type='danger'>草稿发布失败</nf-tag>
|
|
1668
|
+
</div>
|
|
1669
|
+
<div style="margin-top: 10px;">
|
|
1670
|
+
<h3>5. 选择器</h3>
|
|
1671
|
+
<nf-radio-group
|
|
1672
|
+
style="display: inline-block"
|
|
1673
|
+
:groups="queryList"
|
|
1674
|
+
multiple
|
|
1675
|
+
@change="changeHandler"
|
|
1676
|
+
:value.sync="multipleActiveIndex"
|
|
1677
|
+
></nf-radio-group>
|
|
1678
|
+
</div>
|
|
1679
|
+
<div style="margin-top: 10px;">
|
|
1680
|
+
<h3>6. 虚拟滚动分页选择器</h3>
|
|
1681
|
+
<div style="width: 600px;">
|
|
1682
|
+
<!-- request 👈 定制分页请求方法,要求返回promise<{records: any[], total:number}>,入参({[pageNoAlias]: number,[pageSizeAlias]: number,[keywordAlias]: string}) -->
|
|
1683
|
+
<!-- pageSize 👈 定制每次分页请求数量 -->
|
|
1684
|
+
<!-- virtual-list 👈 默认不开启虚拟滚动,设置true开启 -->
|
|
1685
|
+
<!-- keeps 👈 默认30,定制虚拟滚动最多真实渲染的下拉项数量 -->
|
|
1686
|
+
<!-- key-value 👈 list每个数据项渲染对应的label和value对应的prop,类型[string, string],默认值['label', 'value'] -->
|
|
1687
|
+
<!-- data-key 👈 虚拟滚动要求在list每个数据项有一个唯一值,该属性用以指定数据项唯一值对应的prop,类型string -->
|
|
1688
|
+
|
|
1689
|
+
<nf-lazy-select
|
|
1690
|
+
v-model="test"
|
|
1691
|
+
|
|
1692
|
+
:request="testPage"
|
|
1693
|
+
:page-size='10'
|
|
1694
|
+
keyword-alias="keyword"
|
|
1695
|
+
page-no-alias="pageNo"
|
|
1696
|
+
page-size-alias="pageSize"
|
|
1697
|
+
|
|
1698
|
+
loading-sesc='加载中...'
|
|
1699
|
+
no-data-text='无数据'
|
|
1700
|
+
placeholder='请输入英文字母'
|
|
1701
|
+
|
|
1702
|
+
virtual-list
|
|
1703
|
+
:keeps='15'
|
|
1704
|
+
:key-value="['label', 'value']"
|
|
1705
|
+
data-key='value'
|
|
1706
|
+
multiple
|
|
1707
|
+
@change='testChange1'
|
|
1708
|
+
@input='testInput1'
|
|
1709
|
+
:visible-change-keyword-cached="true"
|
|
1710
|
+
:visible-change-select-list-cached="true"
|
|
1711
|
+
>
|
|
1712
|
+
<template slot='option' slot-scope="{row}">
|
|
1713
|
+
<span v-if='row.value == 0'>
|
|
1714
|
+
<span style='color: red' >label: 《{{row.label}}》</span> - value: 《{{row.value}}》
|
|
1715
|
+
</span>
|
|
1716
|
+
<span style='color: blue' v-if='row.value == 1'>{{row.label}}</span>
|
|
1717
|
+
<span v-if='row.value != 0 && row.value != 1'>{{row.label}}</span>
|
|
1718
|
+
</template>
|
|
1719
|
+
</nf-lazy-select>
|
|
1720
|
+
|
|
1721
|
+
<el-divider>上面多选 </el-divider>
|
|
1722
|
+
<el-divider>下面单选 </el-divider>
|
|
1723
|
+
|
|
1724
|
+
<nf-lazy-select
|
|
1725
|
+
v-model="test1"
|
|
1726
|
+
|
|
1727
|
+
:request="testPage"
|
|
1728
|
+
@change='testChange2'
|
|
1729
|
+
@input='testInput2'
|
|
1730
|
+
|
|
1731
|
+
:visible-change-keyword-cached="true"
|
|
1732
|
+
:visible-change-select-list-cached="true"
|
|
1733
|
+
|
|
1734
|
+
:page-size='10'
|
|
1735
|
+
keyword-alias="keyword"
|
|
1736
|
+
page-no-alias="pageNo"
|
|
1737
|
+
page-size-alias="pageSize"
|
|
1738
|
+
|
|
1739
|
+
loading-sesc='加载中...'
|
|
1740
|
+
no-data-text='无数据'
|
|
1741
|
+
placeholder='请输入英文字母'
|
|
1742
|
+
|
|
1743
|
+
virtual-list
|
|
1744
|
+
:keeps='15'
|
|
1745
|
+
:key-value="['label', 'value']"
|
|
1746
|
+
data-key='value'
|
|
1747
|
+
></nf-lazy-select>
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
<el-divider>上面开启虚拟滚动 </el-divider>
|
|
1751
|
+
<el-divider>下面不开启虚拟滚动 </el-divider>
|
|
1752
|
+
|
|
1753
|
+
<nf-lazy-select
|
|
1754
|
+
v-model="test2"
|
|
1755
|
+
@change='testChange3'
|
|
1756
|
+
@input='testInput3'
|
|
1757
|
+
|
|
1758
|
+
:request="testPage"
|
|
1759
|
+
:pageSize='10'
|
|
1760
|
+
|
|
1761
|
+
loading-desc='加载中...'
|
|
1762
|
+
no-data-text='无数据'
|
|
1763
|
+
placeholder='请输入英文字母'
|
|
1764
|
+
|
|
1765
|
+
:key-value="['label', 'value']"
|
|
1766
|
+
>
|
|
1767
|
+
<template slot='option' slot-scope="{row}">
|
|
1768
|
+
<span v-if='row.value == 0'>
|
|
1769
|
+
<span style='color: red' >label: 《{{row.label}}》</span> - value: 《{{row.value}}》
|
|
1770
|
+
</span>
|
|
1771
|
+
<span style='color: blue' v-if='row.value == 1'>{{row.label}}</span>
|
|
1772
|
+
<span v-if='row.value != 0 && row.value != 1'>{{row.label}}</span>
|
|
1773
|
+
</template>
|
|
1774
|
+
</nf-lazy-select>
|
|
1775
|
+
</div>
|
|
1776
|
+
</div>
|
|
1777
|
+
<div style="margin-top: 10px;" :gutter="20">
|
|
1778
|
+
<h3>7. 关键词与变量</h3>
|
|
1779
|
+
<nf-keywords
|
|
1780
|
+
class="nf-keyword-html"
|
|
1781
|
+
style="width: 600px"
|
|
1782
|
+
:data="keywords"
|
|
1783
|
+
@del-all="delAllKeywordFn"
|
|
1784
|
+
@del-item="delItem"
|
|
1785
|
+
@copy-success="copySuccess"
|
|
1786
|
+
:get-item-disabled-status="getItemDisabledStatus"
|
|
1787
|
+
></nf-keywords>
|
|
1788
|
+
</div>
|
|
1789
|
+
<div style="margin-top: 10px;" :gutter="20">
|
|
1790
|
+
<h3>8. 音频组件</h3>
|
|
1791
|
+
<nf-button @click='betweenPlay' style='transform: translateY(-22px);'>区间播放</nf-button>
|
|
1792
|
+
<nf-audio
|
|
1793
|
+
style="display: inline-flex;"
|
|
1794
|
+
debuglog
|
|
1795
|
+
ref='nfAudio'
|
|
1796
|
+
:src='url'
|
|
1797
|
+
@download='download'
|
|
1798
|
+
:jump-time='jumpToTime'
|
|
1799
|
+
:back-second='backSecond'
|
|
1800
|
+
:forward-second='forwardSecond'
|
|
1801
|
+
:between-start='betweenStart'
|
|
1802
|
+
:between-end='betweenEnd'
|
|
1803
|
+
></nf-audio>
|
|
1804
|
+
</div>
|
|
1805
|
+
<div style="margin-top: 10px" >
|
|
1806
|
+
<h3>9. 空状态</h3>
|
|
1807
|
+
<el-row :gutter="20" style="width: 1200px">
|
|
1808
|
+
<el-col :span="6">
|
|
1809
|
+
<nf-empty type='message' border></nf-empty>
|
|
1810
|
+
</el-col>
|
|
1811
|
+
<el-col :span="6">
|
|
1812
|
+
<nf-empty type='internet' :image-size='145'></nf-empty>
|
|
1813
|
+
</el-col>
|
|
1814
|
+
<el-col :span="6">
|
|
1815
|
+
<nf-empty :image-size='140' type='authority'></nf-empty>
|
|
1816
|
+
</el-col>
|
|
1817
|
+
<el-col :span="6">
|
|
1818
|
+
<nf-empty :image-size='140' type='server'></nf-empty>
|
|
1819
|
+
</el-col>
|
|
1820
|
+
</el-row>
|
|
1821
|
+
</div>
|
|
1822
|
+
<div style="margin-top: 10px">
|
|
1823
|
+
<h3>10. 表格</h3>
|
|
1824
|
+
<nf-table
|
|
1825
|
+
ref='nfTable3'
|
|
1826
|
+
:data="showData"
|
|
1827
|
+
storage-key='nf-table-test3'
|
|
1828
|
+
:column-edit="true"
|
|
1829
|
+
:columns="nfTable.tableColumns3.value"
|
|
1830
|
+
:table-events="{
|
|
1831
|
+
select:nfTable.changeSelectFn3,
|
|
1832
|
+
'select-all': nfTable.changeSelectAllFn3
|
|
1833
|
+
}"
|
|
1834
|
+
:table-attrs="{
|
|
1835
|
+
'show-summary': true,
|
|
1836
|
+
'summary-method': getSummaries,
|
|
1837
|
+
'row-key': 'id'
|
|
1838
|
+
}"
|
|
1839
|
+
:loading='nfTable.searchForm3.value.loading'
|
|
1840
|
+
>
|
|
1841
|
+
<!-- 👈 上述只配置表格类属性和事件,下述其他通过slot定制 -->
|
|
1842
|
+
<!-- 定制列目显示 -->
|
|
1843
|
+
<el-button
|
|
1844
|
+
slot="columnEdit"
|
|
1845
|
+
@click="nfTable.columnEditDialog3()"
|
|
1846
|
+
class="nf-column-display"
|
|
1847
|
+
type="pripary"
|
|
1848
|
+
:plain="true"
|
|
1849
|
+
icon="el-icon-plus"
|
|
1850
|
+
size="mini"
|
|
1851
|
+
:round="false"
|
|
1852
|
+
:circle="false"
|
|
1853
|
+
:loading="false"
|
|
1854
|
+
:disabled="false"
|
|
1855
|
+
>
|
|
1856
|
+
slot定制表格列目显示隐藏
|
|
1857
|
+
</el-button>
|
|
1858
|
+
<!-- 定制表单 -->
|
|
1859
|
+
<nf-search-form
|
|
1860
|
+
slot="searchBox"
|
|
1861
|
+
:form-options="searchOptionTable"
|
|
1862
|
+
:label-width="80"
|
|
1863
|
+
storage-key='nf-search-form-test3'
|
|
1864
|
+
:column-edit='true'
|
|
1865
|
+
:columns="4"
|
|
1866
|
+
btn-model="inline"
|
|
1867
|
+
btn-items='search'
|
|
1868
|
+
@on-search='nfTable.onSearch3'
|
|
1869
|
+
@on-change="nfTable.searchChange3"
|
|
1870
|
+
check-btn-text='slot定制表单列目显示隐藏'
|
|
1871
|
+
></nf-search-form>
|
|
1872
|
+
<!-- 定制单个表格项 -->
|
|
1873
|
+
<span slot="operationName" slot-scope="scope" v-text="`${scope.row.operationName} ${scope.row.viceOperationName}`"></span>
|
|
1874
|
+
<span slot="operation" slot-scope="scope">
|
|
1875
|
+
<el-button size="mini" type="text">详情</el-button>
|
|
1876
|
+
<el-button size="mini" type="text">编辑</el-button>
|
|
1877
|
+
<el-button size="mini" type="text">语音</el-button>
|
|
1878
|
+
</span>
|
|
1879
|
+
<!-- 定制单个表头 -->
|
|
1880
|
+
<span slot="completionRateHeader">
|
|
1881
|
+
<span style="margin-right: 4px;">任务完成率</span>
|
|
1882
|
+
<el-tooltip placement="right" effect="light">
|
|
1883
|
+
<div slot="content">累计完成率=(累计导入数-进行中外呼数)/累计导入数</div>
|
|
1884
|
+
<i class="iconfont icon-bangzhuzhongxin" style="font-weight: normal"></i>
|
|
1885
|
+
</el-tooltip>
|
|
1886
|
+
</span>
|
|
1887
|
+
<!-- 定制actionBar -->
|
|
1888
|
+
<span slot="actionBar">
|
|
1889
|
+
<el-checkbox style='margin-right: 20px;' @change='nfTable.selectAll3' v-model='nfTable.select3.value'>当页全选</el-checkbox>
|
|
1890
|
+
<el-button type="success" size='mini'>开启</el-button>
|
|
1891
|
+
<el-button type="danger" size='mini'> 暂停</el-button>
|
|
1892
|
+
<el-button type="danger" size='mini'>删除</el-button>
|
|
1893
|
+
</span>
|
|
1894
|
+
<!-- 定制empty -->
|
|
1895
|
+
<span slot="empty">
|
|
1896
|
+
定制empty
|
|
1897
|
+
</span>
|
|
1898
|
+
<!-- 定制append -->
|
|
1899
|
+
<span slot="append">
|
|
1900
|
+
slot定制append
|
|
1901
|
+
</span>
|
|
1902
|
+
<!-- 定制分页 -->
|
|
1903
|
+
<span slot="pagination" style='float: right'>
|
|
1904
|
+
<el-pagination ref="nfTablePaginationRef" v-bind="pageAttrs" v-on="pageEvents" />
|
|
1905
|
+
</span>
|
|
1906
|
+
</nf-table>
|
|
1907
|
+
|
|
1908
|
+
<el-divider> 上面当窗口很小时 操作列和选择列 固定横向拖拽(可以F12打开控制台缩小窗口试试)</el-divider>
|
|
1909
|
+
<el-divider> 下面配合nf-empty使用 </el-divider>
|
|
1910
|
+
|
|
1911
|
+
<nf-table
|
|
1912
|
+
ref='nfTable4'
|
|
1913
|
+
:data="[]"
|
|
1914
|
+
storage-key='nf-table-test4'
|
|
1915
|
+
:column-edit="true"
|
|
1916
|
+
search-form-storage-key='nf-search-form-test4'
|
|
1917
|
+
:columns="nfTable.tableColumns5.value"
|
|
1918
|
+
:loading='nfTable.searchForm5.value.loading'
|
|
1919
|
+
>
|
|
1920
|
+
<!-- 去除searchBox -->
|
|
1921
|
+
<span slot="searchBox"></span>
|
|
1922
|
+
<!-- 定制append -->
|
|
1923
|
+
<span slot="append">
|
|
1924
|
+
slot定制append
|
|
1925
|
+
</span>
|
|
1926
|
+
<!-- 定制empty -->
|
|
1927
|
+
<nf-empty style='margin-top: 20px;' slot="empty" :image-size='145'></nf-empty>
|
|
1928
|
+
</nf-table>
|
|
1929
|
+
</div>
|
|
1930
|
+
<div style="margin-top: 10px">
|
|
1931
|
+
<h3>11. 表单</h3>
|
|
1932
|
+
<!-- form-options 👈 唯一必传,控制所有表单项目渲染的 json data(表单填充数据不用给,组件初始化后通过ref或@回调获取即可),其他所有属性可选 -->
|
|
1933
|
+
<!-- rules 👈 可选,定制表单校验规则 -->
|
|
1934
|
+
|
|
1935
|
+
<!-- columns 👈 可选,几个表单项自动收起,默认自动检测为一行的数量 -->
|
|
1936
|
+
<!-- is-collapse 👈 可选,初始化是否展开 -->
|
|
1937
|
+
|
|
1938
|
+
<!-- btn-items 👈 可选,开启默认按钮 -->
|
|
1939
|
+
<!-- reverse-btn-slot 👈 可选,反转自定义按钮slot和默认按钮的顺序 -->
|
|
1940
|
+
|
|
1941
|
+
<!-- closable 👈 可选,打开控制显示每个表单项的显示隐藏icon,功能同 列编辑 异曲同工,默认false -->
|
|
1942
|
+
<!-- column-edit 👈 可选,开启列编辑,默认false -->
|
|
1943
|
+
<!-- check-mode 👈 可选,列编辑交互模式,默认drawer(drawer/dialog) -->
|
|
1944
|
+
<!-- storage-key 👈 可选,开启列编辑后必给,列编辑数据缓存key,用来做多个表单缓存命名空间区分,默认nf-search-form-columns-cached-key -->
|
|
1945
|
+
<!-- priority 👈 可选,开启列编辑后,打开列编辑弹框缓存回显列目项优先级,处理item.initHidden,table.showColumn和cookies.cached回显优先级,默认cached(cached/value) -->
|
|
1946
|
+
|
|
1947
|
+
<!-- itemWidth 👈 可选,默认227, 每个search form item content的宽度定制,实现label上下布局(用于各种语言的最佳布局)表单项对齐,如果需要单独做一个定制宽度,form-options的每个item传入width即可 -->
|
|
1948
|
+
|
|
1949
|
+
<!-- inline 👈 可选,行内表单,支持所有el-form属性设置 -->
|
|
1950
|
+
<!-- label-position 👈 可选,表单标签位置,同上,支持所有el-form属性设置 -->
|
|
1951
|
+
<!-- btn-model 👈 可选,操作按钮和自定义按钮slot是否单独一行,为了兼容ai-search-form默认继承了这个功能 -->
|
|
1952
|
+
<!-- btn-box-label 👈 可选,btn-model='inline'时,定制按钮slot和默认按钮作为最后一个form-item包裹在内,-->
|
|
1953
|
+
<!-- 该属性设置form-item的label,用来在上下label布局对齐高度,或手动改透明度组直接当作label用 -->
|
|
1954
|
+
<nf-search-form
|
|
1955
|
+
:form-options="searchOption"
|
|
1956
|
+
:rules='rules'
|
|
1957
|
+
|
|
1958
|
+
:columns='columns'
|
|
1959
|
+
@isCollapseChange="isCollapseChange"
|
|
1960
|
+
|
|
1961
|
+
:btn-items="btnItemList"
|
|
1962
|
+
@onSearch="searchFn"
|
|
1963
|
+
@onExport="exportFn"
|
|
1964
|
+
@onResetFields='resetFieldsFn'
|
|
1965
|
+
|
|
1966
|
+
:closable='true'
|
|
1967
|
+
storage-key='nf-search-form-test1'
|
|
1968
|
+
:column-edit='true'
|
|
1969
|
+
check-mode='drawer'
|
|
1970
|
+
|
|
1971
|
+
:inline='inline'
|
|
1972
|
+
:label-position='labelPosition'
|
|
1973
|
+
btn-model='inline'
|
|
1974
|
+
btn-box-label='自定按钮slot定制的内容 + 默认按钮:'
|
|
1975
|
+
|
|
1976
|
+
ref='nfSearchFormRef'
|
|
1977
|
+
>
|
|
1978
|
+
<!-- slot='custumSlot' 👈 数字区间slot定制 -->
|
|
1979
|
+
<span slot="repeatCountAppend">Not</span>
|
|
1980
|
+
<span slot="doubleRepeatCountAppend">In</span>
|
|
1981
|
+
<span slot="doubleRepeatCountAppendSegment" class="iconfont icon-dao" style="margin: 0 5px"></span>
|
|
1982
|
+
<!-- slot='custumSlot' 👈 数据项slot定制 -->
|
|
1983
|
+
<el-input
|
|
1984
|
+
slot='custumSlot'
|
|
1985
|
+
v-model='searchForm.custumSlot'
|
|
1986
|
+
placehold='请输入'
|
|
1987
|
+
clearable
|
|
1988
|
+
prefix-icon="el-icon-search"
|
|
1989
|
+
suffix-icon="el-icon-date"
|
|
1990
|
+
style='display:inline-block;width: 100%'
|
|
1991
|
+
></el-input>
|
|
1992
|
+
<!-- slot='btnBox' 👈 操作按钮slot定制 -->
|
|
1993
|
+
<span slot='btnBox' style='align-self: self-start;margin-right: 10px;'>
|
|
1994
|
+
<div>
|
|
1995
|
+
<el-button size='mini' @click='inline=!inline'>切换块级</el-button>
|
|
1996
|
+
<el-button size='mini' @click='columns++'>增加折叠个数</el-button>
|
|
1997
|
+
<el-button size='mini' @click='columns--'>减少折叠个数</el-button>
|
|
1998
|
+
</div>
|
|
1999
|
+
<div>
|
|
2000
|
+
<el-button size='mini' @click='changeLabelPosition("top")'>表单项前缀向上</el-button>
|
|
2001
|
+
<el-button size='mini' @click='changeLabelPosition("right")'>表单项前缀向右</el-button>
|
|
2002
|
+
</div>
|
|
2003
|
+
<div>
|
|
2004
|
+
<el-button size='mini' @click='changeLabelPosition("left")'>表单项前缀向左</el-button>
|
|
2005
|
+
<el-button size='mini' type="primary" @click="submitForm()">表单校验</el-button>
|
|
2006
|
+
<el-button size='mini' @click="resetForm()">重置校验</el-button>
|
|
2007
|
+
</div>
|
|
2008
|
+
</span>
|
|
2009
|
+
</nf-search-form>
|
|
2010
|
+
</div>
|
|
2011
|
+
<div style="margin-top: 10px">
|
|
2012
|
+
<h3>12. 软电话</h3>
|
|
2013
|
+
<nf-microphone
|
|
2014
|
+
ref="nfSoftPhone1"
|
|
2015
|
+
|
|
2016
|
+
:agent-tag="agentTag"
|
|
2017
|
+
:app-key="appKey"
|
|
2018
|
+
:sign.sync='sign'
|
|
2019
|
+
:timestamp.sync='timestamp'
|
|
2020
|
+
ext-status="1"
|
|
2021
|
+
|
|
2022
|
+
name="nf-softphone0"
|
|
2023
|
+
destination-origin="nf-softphone1"
|
|
2024
|
+
ancestor-origin="nf-softphone1"
|
|
2025
|
+
|
|
2026
|
+
@softphone-connect="softphoneConnectCallBack1"
|
|
2027
|
+
@softphone-call-refresh="softphoneCallRefreshCallBack1"
|
|
2028
|
+
@softphone-seats-status-change="softphoneSeatStatusChangeCallBack1"
|
|
2029
|
+
@softphone-accept="softphoneAcceptCallBack1"
|
|
2030
|
+
@softphone-ignore="softphoneIgnoreCallBack1"
|
|
2031
|
+
@softphone-hangup="softphoneHangupCallBack1"
|
|
2032
|
+
@softphone-auto-ignore-callback="softphoneAutoIgnoreCallback1"
|
|
2033
|
+
@softphone-session-state-change="softphoneSessionStateChangeCallBack1"
|
|
2034
|
+
@softphone-incoming="softphoneIncomingCallBack1"
|
|
2035
|
+
@softphone-send-dtmf="softphoneSendDtmfCallBack1"
|
|
2036
|
+
@softphone-connect-registered="softphoneConnectRegisteredCallBack1"
|
|
2037
|
+
@softphone-sign-overdued="softphoneSignOverduedCallBack1"
|
|
2038
|
+
></nf-microphone>
|
|
2039
|
+
</div>
|
|
2040
|
+
</div>
|
|
2041
|
+
</div>
|
|
2042
|
+
</body>
|
|
2043
|
+
</html>
|