|
|
@@ -2,41 +2,48 @@
|
|
2
|
2
|
<div class="app-container">
|
|
3
|
3
|
<div class="filter-container">
|
|
4
|
4
|
<el-select v-model="searchData.state" placeholder="请选择状态" size="medium" clearable>
|
|
5
|
|
- <el-option value="0" label="未启动"></el-option>
|
|
6
|
|
- <el-option value="1" label="启动"></el-option>
|
|
7
|
|
- <el-option value="2" label="已失效"></el-option>
|
|
|
5
|
+ <el-option value="0" label="未启动"/>
|
|
|
6
|
+ <el-option value="1" label="启动"/>
|
|
|
7
|
+ <el-option value="2" label="已失效"/>
|
|
8
|
8
|
</el-select>
|
|
9
|
9
|
<el-input v-model="searchData.key" placeholder="请输入关键词" class="filter-item" size="medium" clearable/>
|
|
10
|
|
- <el-date-picker v-model="searchData.value1" size="medium" type="daterange" clearable format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
|
|
11
|
|
- end-placeholder="结束日期">
|
|
12
|
|
- </el-date-picker>
|
|
|
10
|
+ <el-date-picker
|
|
|
11
|
+ v-model="searchData.value1"
|
|
|
12
|
+ size="medium"
|
|
|
13
|
+ type="daterange"
|
|
|
14
|
+ clearable
|
|
|
15
|
+ format="yyyy-MM-dd"
|
|
|
16
|
+ value-format="yyyy-MM-dd"
|
|
|
17
|
+ range-separator="至"
|
|
|
18
|
+ start-placeholder="开始日期"
|
|
|
19
|
+ end-placeholder="结束日期"/>
|
|
13
|
20
|
<el-button type="primary" class="filter-item" @click="btn_search">搜索</el-button>
|
|
14
|
21
|
<el-button type="primary" class="filter-item" @click="btn_add">添加</el-button>
|
|
15
|
22
|
</div>
|
|
16
|
23
|
<el-table v-loading="loading" :data="dataLists" border stripe @selection-change="handleSelectionChange">
|
|
17
|
|
-<!-- <el-table-column type="selection" width="55">
|
|
|
24
|
+ <!-- <el-table-column type="selection" width="55">
|
|
18
|
25
|
</el-table-column> -->
|
|
19
|
26
|
<el-table-column prop="F_Title" label="欢迎词标题" align="center" min-width="" />
|
|
20
|
27
|
<el-table-column label="欢迎词内容" align="center" min-width="">
|
|
21
|
28
|
<template slot-scope="scope">
|
|
22
|
|
- <span v-show='scope.row.F_Type==1'>{{scope.row.F_Content}}</span>
|
|
|
29
|
+ <span v-show="scope.row.F_Type==1">{{ scope.row.F_Content }}</span>
|
|
23
|
30
|
<svg-icon v-if="scope.row.F_Type==2" class="rec_file" icon-class="bofangluyin" @click.native="playSound(scope.row.F_Files,scope.row.F_CreateBy)" />
|
|
24
|
31
|
</template>
|
|
25
|
32
|
</el-table-column>
|
|
26
|
33
|
<!-- <el-table-column prop="F_Content" label="欢迎词内容" align="center" min-width="" /> -->
|
|
27
|
34
|
<el-table-column label="类型" align="center" min-width="">
|
|
28
|
35
|
<template slot-scope="scope">
|
|
29
|
|
- <span v-show='scope.row.F_Type==1'>文本</span>
|
|
30
|
|
- <span v-show='scope.row.F_Type==2'>语音文件</span>
|
|
|
36
|
+ <span v-show="scope.row.F_Type==1">文本</span>
|
|
|
37
|
+ <span v-show="scope.row.F_Type==2">语音文件</span>
|
|
31
|
38
|
</template>
|
|
32
|
39
|
</el-table-column>
|
|
33
|
40
|
<el-table-column prop="F_StartTime" label="生效时间" align="center" min-width="" />
|
|
34
|
41
|
<el-table-column prop="F_EndTime" label="失效时间" align="center" min-width="" />
|
|
35
|
42
|
<el-table-column label="状态" align="center" min-width="">
|
|
36
|
43
|
<template slot-scope="scope">
|
|
37
|
|
- <span v-show='scope.row.F_IsState==2'>已失效</span>
|
|
38
|
|
- <span v-show='scope.row.F_IsState==1'>生效中</span>
|
|
39
|
|
- <span v-show='scope.row.F_IsState==0'>未启动</span>
|
|
|
44
|
+ <span v-show="scope.row.F_IsState==2">已失效</span>
|
|
|
45
|
+ <span v-show="scope.row.F_IsState==1">生效中</span>
|
|
|
46
|
+ <span v-show="scope.row.F_IsState==0">未启动</span>
|
|
40
|
47
|
</template>
|
|
41
|
48
|
</el-table-column>
|
|
42
|
49
|
<el-table-column prop="F_CreateTime" label="添加时间" align="center" min-width="" />
|
|
|
@@ -48,166 +55,171 @@
|
|
48
|
55
|
</template>
|
|
49
|
56
|
</el-table-column>
|
|
50
|
57
|
</el-table>
|
|
51
|
|
- <pagination v-show="pageParams.total > 0" :total="pageParams.total" :pageindex.sync="pageParams.pageindex"
|
|
52
|
|
- :pagesize.sync="pageParams.pagesize" class="pagination" @pagination="getList" />
|
|
|
58
|
+ <pagination
|
|
|
59
|
+ v-show="pageParams.total > 0"
|
|
|
60
|
+ :total="pageParams.total"
|
|
|
61
|
+ :pageindex.sync="pageParams.pageindex"
|
|
|
62
|
+ :pagesize.sync="pageParams.pagesize"
|
|
|
63
|
+ class="pagination"
|
|
|
64
|
+ @pagination="getList" />
|
|
53
|
65
|
</div>
|
|
54
|
66
|
</template>
|
|
55
|
67
|
|
|
56
|
68
|
<script>
|
|
57
|
|
- import {
|
|
58
|
|
- getWordsLists,
|
|
59
|
|
- deleteWord,
|
|
60
|
|
- } from '@/api/telCall/welcomeManage'
|
|
61
|
|
- import addOrEdit from './addOrEdit'
|
|
62
|
|
- import audioPlayer from '@/components/context/audioPlayer'
|
|
63
|
|
- import {
|
|
64
|
|
- pickerOptions
|
|
65
|
|
- } from '@/utils'
|
|
66
|
|
- import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
|
|
|
69
|
+import {
|
|
|
70
|
+ getWordsLists,
|
|
|
71
|
+ deleteWord
|
|
|
72
|
+} from '@/api/telCall/welcomeManage'
|
|
|
73
|
+import addOrEdit from './addOrEdit'
|
|
|
74
|
+import audioPlayer from '@/components/context/audioPlayer'
|
|
|
75
|
+import {
|
|
|
76
|
+ pickerOptions
|
|
|
77
|
+} from '@/utils'
|
|
|
78
|
+import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
|
|
67
|
79
|
|
|
68
|
|
- export default {
|
|
69
|
|
- name: 'WelcomeManage',
|
|
70
|
|
- components: {
|
|
71
|
|
- Pagination
|
|
|
80
|
+export default {
|
|
|
81
|
+ name: 'WelcomeManage',
|
|
|
82
|
+ components: {
|
|
|
83
|
+ Pagination
|
|
|
84
|
+ },
|
|
|
85
|
+ filters: {
|
|
|
86
|
+ blackTextFilter(status) {
|
|
|
87
|
+ const statusMap = {
|
|
|
88
|
+ 0: '暂时',
|
|
|
89
|
+ 1: '永久',
|
|
|
90
|
+ 2: '已取消'
|
|
|
91
|
+ }
|
|
|
92
|
+ return statusMap[status]
|
|
72
|
93
|
},
|
|
73
|
|
- filters: {
|
|
74
|
|
- blackTextFilter(status) {
|
|
75
|
|
- const statusMap = {
|
|
76
|
|
- 0: '暂时',
|
|
77
|
|
- 1: '永久',
|
|
78
|
|
- 2: '已取消'
|
|
79
|
|
- }
|
|
80
|
|
- return statusMap[status]
|
|
|
94
|
+ blackTypeFilter(status) {
|
|
|
95
|
+ const statusMap = {
|
|
|
96
|
+ 0: '',
|
|
|
97
|
+ 1: 'danger',
|
|
|
98
|
+ 2: 'warning'
|
|
|
99
|
+ }
|
|
|
100
|
+ return statusMap[status]
|
|
|
101
|
+ }
|
|
|
102
|
+ },
|
|
|
103
|
+ data() {
|
|
|
104
|
+ return {
|
|
|
105
|
+ loading: false,
|
|
|
106
|
+ searchData: {
|
|
|
107
|
+ state: '',
|
|
|
108
|
+ key: '',
|
|
|
109
|
+ value1: ''
|
|
81
|
110
|
},
|
|
82
|
|
- blackTypeFilter(status) {
|
|
83
|
|
- const statusMap = {
|
|
84
|
|
- 0: '',
|
|
85
|
|
- 1: 'danger',
|
|
86
|
|
- 2: 'warning'
|
|
87
|
|
- }
|
|
88
|
|
- return statusMap[status]
|
|
|
111
|
+ pickerOptions,
|
|
|
112
|
+ pageParams: {
|
|
|
113
|
+ pageindex: 1, // 当前第几页
|
|
|
114
|
+ pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
|
115
|
+ total: 0 // 总共多少数据
|
|
|
116
|
+ },
|
|
|
117
|
+ dataLists: [], // 列表数据
|
|
|
118
|
+ multipleSelection: [],
|
|
|
119
|
+ selectArr: []
|
|
|
120
|
+ }
|
|
|
121
|
+ },
|
|
|
122
|
+ created() {
|
|
|
123
|
+ this.getList()
|
|
|
124
|
+ document.onkeyup = (e) => {
|
|
|
125
|
+ if (e.keyCode === 13) {
|
|
|
126
|
+ this.getList()
|
|
89
|
127
|
}
|
|
|
128
|
+ }
|
|
|
129
|
+ },
|
|
|
130
|
+ methods: {
|
|
|
131
|
+ getList() {
|
|
|
132
|
+ this.loading = true
|
|
|
133
|
+ return new Promise((resolve) => {
|
|
|
134
|
+ const params = {
|
|
|
135
|
+ page: this.pageParams.pageindex, // 第几页
|
|
|
136
|
+ pagesize: this.pageParams.pagesize, // 每页几条信息
|
|
|
137
|
+ state: this.searchData.state,
|
|
|
138
|
+ key: this.searchData.key,
|
|
|
139
|
+ starttime: this.searchData.value1 && this.searchData.value1[0],
|
|
|
140
|
+ endtime: this.searchData.value1 && this.searchData.value1[1]
|
|
|
141
|
+ }
|
|
|
142
|
+ getWordsLists(params).then((response) => {
|
|
|
143
|
+ this.loading = false
|
|
|
144
|
+ if (response.rows.length >= 0) {
|
|
|
145
|
+ this.pageParams.total = response.total
|
|
|
146
|
+ this.dataLists = response.rows
|
|
|
147
|
+ }
|
|
|
148
|
+ })
|
|
|
149
|
+ resolve()
|
|
|
150
|
+ })
|
|
90
|
151
|
},
|
|
91
|
|
- data() {
|
|
92
|
|
- return {
|
|
93
|
|
- loading: false,
|
|
94
|
|
- searchData: {
|
|
95
|
|
- state: '',
|
|
96
|
|
- key: '',
|
|
97
|
|
- value1:''
|
|
98
|
|
- },
|
|
99
|
|
- pickerOptions,
|
|
100
|
|
- pageParams: {
|
|
101
|
|
- pageindex: 1, // 当前第几页
|
|
102
|
|
- pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
|
|
103
|
|
- total: 0 // 总共多少数据
|
|
|
152
|
+ btn_search() {
|
|
|
153
|
+ this.pageParams.pageindex = 1
|
|
|
154
|
+ this.getList()
|
|
|
155
|
+ },
|
|
|
156
|
+ handleSelectionChange(val) {
|
|
|
157
|
+ this.multipleSelection = val
|
|
|
158
|
+ this.selectArr = val.map(item => item.F_Id)
|
|
|
159
|
+ },
|
|
|
160
|
+ btn_add() {
|
|
|
161
|
+ this.$layer.iframe({
|
|
|
162
|
+ content: {
|
|
|
163
|
+ content: addOrEdit, // 传递的组件对象
|
|
|
164
|
+ parent: this, // 当前的vue对象
|
|
|
165
|
+ data: {
|
|
|
166
|
+ rowid: ''
|
|
|
167
|
+ } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
104
|
168
|
},
|
|
105
|
|
- dataLists: [], // 列表数据
|
|
106
|
|
- multipleSelection: [],
|
|
107
|
|
- selectArr: []
|
|
108
|
|
- }
|
|
|
169
|
+ area: ['45%', '55%'],
|
|
|
170
|
+ title: '添加时段'
|
|
|
171
|
+ })
|
|
109
|
172
|
},
|
|
110
|
|
- created() {
|
|
111
|
|
- this.getList()
|
|
112
|
|
- document.onkeyup = (e) => {
|
|
113
|
|
- if (e.keyCode === 13) {
|
|
114
|
|
- this.getList()
|
|
115
|
|
- }
|
|
116
|
|
- }
|
|
|
173
|
+ btn_edit(editId) {
|
|
|
174
|
+ this.$layer.iframe({
|
|
|
175
|
+ content: {
|
|
|
176
|
+ content: addOrEdit, // 传递的组件对象
|
|
|
177
|
+ parent: this, // 当前的vue对象
|
|
|
178
|
+ data: {
|
|
|
179
|
+ rowid: editId.toString()
|
|
|
180
|
+ } // props
|
|
|
181
|
+ },
|
|
|
182
|
+ area: ['45%', '55%'],
|
|
|
183
|
+ title: '编辑时段'
|
|
|
184
|
+ })
|
|
117
|
185
|
},
|
|
118
|
|
- methods: {
|
|
119
|
|
- getList() {
|
|
120
|
|
- this.loading = true
|
|
121
|
|
- return new Promise((resolve) => {
|
|
122
|
|
- const params = {
|
|
123
|
|
- page: this.pageParams.pageindex, // 第几页
|
|
124
|
|
- pagesize: this.pageParams.pagesize, // 每页几条信息
|
|
125
|
|
- state: this.searchData.state,
|
|
126
|
|
- key: this.searchData.key,
|
|
127
|
|
- starttime:this.searchData.value1[0],
|
|
128
|
|
- endtime:this.searchData.value1[1]
|
|
129
|
|
- }
|
|
130
|
|
- getWordsLists(params).then((response) => {
|
|
131
|
|
- this.loading = false
|
|
132
|
|
- if (response.rows.length >= 0) {
|
|
133
|
|
- this.pageParams.total = response.total
|
|
134
|
|
- this.dataLists = response.rows
|
|
|
186
|
+ btn_delete(id) {
|
|
|
187
|
+ // if (this.multipleSelection.length == 0) {
|
|
|
188
|
+ // this.$message.error('没有要删除的选项')
|
|
|
189
|
+ // } else {
|
|
|
190
|
+ this.$confirm('您确定要删除吗?', '提示', {
|
|
|
191
|
+ confirmButtonText: '确定',
|
|
|
192
|
+ cancelButtonText: '取消',
|
|
|
193
|
+ type: 'warning'
|
|
|
194
|
+ })
|
|
|
195
|
+ .then(() => {
|
|
|
196
|
+ deleteWord(id).then((response) => {
|
|
|
197
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
198
|
+ this.getList()
|
|
|
199
|
+ this.$message.success('删除成功!')
|
|
135
|
200
|
}
|
|
136
|
201
|
})
|
|
137
|
|
- resolve()
|
|
138
|
202
|
})
|
|
139
|
|
- },
|
|
140
|
|
- btn_search() {
|
|
141
|
|
- this.pageParams.pageindex = 1
|
|
142
|
|
- this.getList()
|
|
143
|
|
- },
|
|
144
|
|
- handleSelectionChange(val) {
|
|
145
|
|
- this.multipleSelection = val;
|
|
146
|
|
- this.selectArr = val.map(item => item.F_Id)
|
|
147
|
|
- },
|
|
148
|
|
- btn_add() {
|
|
149
|
|
- this.$layer.iframe({
|
|
150
|
|
- content: {
|
|
151
|
|
- content: addOrEdit, // 传递的组件对象
|
|
152
|
|
- parent: this, // 当前的vue对象
|
|
153
|
|
- data: {
|
|
154
|
|
- rowid: ''
|
|
155
|
|
- } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
156
|
|
- },
|
|
157
|
|
- area: ['45%', '55%'],
|
|
158
|
|
- title: '添加时段'
|
|
|
203
|
+ .catch(() => {
|
|
|
204
|
+ this.$message('已取消删除')
|
|
159
|
205
|
})
|
|
160
|
|
- },
|
|
161
|
|
- btn_edit(editId) {
|
|
162
|
|
- this.$layer.iframe({
|
|
163
|
|
- content: {
|
|
164
|
|
- content: addOrEdit, // 传递的组件对象
|
|
165
|
|
- parent: this, // 当前的vue对象
|
|
166
|
|
- data: {
|
|
167
|
|
- rowid: editId.toString()
|
|
168
|
|
- } // props
|
|
169
|
|
- },
|
|
170
|
|
- area: ['45%', '55%'],
|
|
171
|
|
- title: '编辑时段'
|
|
172
|
|
- })
|
|
173
|
|
- },
|
|
174
|
|
- btn_delete(id) {
|
|
175
|
|
- // if (this.multipleSelection.length == 0) {
|
|
176
|
|
- // this.$message.error('没有要删除的选项')
|
|
177
|
|
- // } else {
|
|
178
|
|
- this.$confirm('您确定要删除吗?', '提示', {
|
|
179
|
|
- confirmButtonText: '确定',
|
|
180
|
|
- cancelButtonText: '取消',
|
|
181
|
|
- type: 'warning'
|
|
182
|
|
- })
|
|
183
|
|
- .then(() => {
|
|
184
|
|
- deleteWord(id).then((response) => {
|
|
185
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
186
|
|
- this.getList()
|
|
187
|
|
- this.$message.success('删除成功!')
|
|
188
|
|
- }
|
|
189
|
|
- })
|
|
190
|
|
- })
|
|
191
|
|
- .catch(() => {
|
|
192
|
|
- this.$message('已取消删除')
|
|
193
|
|
- })
|
|
194
|
206
|
// }
|
|
195
|
|
- },
|
|
196
|
|
- // 播放录音
|
|
197
|
|
- playSound(rec_file,artist) {
|
|
198
|
|
- this.$layer.iframe({
|
|
199
|
|
- content: {
|
|
200
|
|
- content: audioPlayer, // 传递的组件对象
|
|
201
|
|
- parent: this, // 当前的vue对象
|
|
202
|
|
- data: { recFiles: rec_file,artists:artist } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
203
|
|
- },
|
|
204
|
|
- area: ['600px', '230px'],
|
|
205
|
|
- shadeClose: true,
|
|
206
|
|
- title: '录音详情'
|
|
207
|
|
- })
|
|
208
|
|
- },
|
|
|
207
|
+ },
|
|
|
208
|
+ // 播放录音
|
|
|
209
|
+ playSound(rec_file, artist) {
|
|
|
210
|
+ this.$layer.iframe({
|
|
|
211
|
+ content: {
|
|
|
212
|
+ content: audioPlayer, // 传递的组件对象
|
|
|
213
|
+ parent: this, // 当前的vue对象
|
|
|
214
|
+ data: { recFiles: rec_file, artists: artist } // props//该方法会自动添加一个key为layerid的值, 该值为创建层的id, 可以直接使用
|
|
|
215
|
+ },
|
|
|
216
|
+ area: ['600px', '230px'],
|
|
|
217
|
+ shadeClose: true,
|
|
|
218
|
+ title: '录音详情'
|
|
|
219
|
+ })
|
|
209
|
220
|
}
|
|
210
|
221
|
}
|
|
|
222
|
+}
|
|
211
|
223
|
</script>
|
|
212
|
224
|
|
|
213
|
225
|
<style rel="stylesheet/scss" lang="scss" scoped>
|