|
|
@@ -1,9 +1,27 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
- <el-form-item label="关键词" prop="keyword">
|
|
|
- <el-input v-model="queryParams.keyword" placeholder="请输入关键词" clearable size="small"
|
|
|
- @keyup.enter.native="handleQuery" />
|
|
|
+ <el-form-item label="接口名称" prop="apiName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.apiName"
|
|
|
+ placeholder="请输入接口名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接口类型" prop="apiType">
|
|
|
+ <el-select v-model="queryParams.apiType" placeholder="请选择类型" clearable size="small">
|
|
|
+ <el-option label="SIP" :value="0" />
|
|
|
+ <el-option label="网关" :value="1" />
|
|
|
+ <el-option label="API" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
|
|
+ <el-option label="启用" :value="1" />
|
|
|
+ <el-option label="禁用" :value="0" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
@@ -13,26 +31,65 @@
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
- <el-table v-loading="loading" :data="list">
|
|
|
- <el-table-column type="selection" width="50" align="center" />
|
|
|
- <el-table-column label="ID" align="center" prop="id" width="80" />
|
|
|
- <el-table-column label="名称" align="center" prop="name" />
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
|
|
+ <el-table v-loading="loading" :data="list" border style="width: 100%">
|
|
|
+ <el-table-column label="接口ID" align="center" prop="apiId" width="90" />
|
|
|
+ <el-table-column label="接口名称" align="center" prop="apiName" min-width="100" show-overflow-tooltip />
|
|
|
+ <el-table-column label="接口类型" align="center" prop="apiType" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ getApiTypeLabel(scope.row.apiType) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="价格(元/分钟)" align="center" prop="salePrice" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.salePrice != null ? scope.row.salePrice : '未定价' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="优先级" align="center" prop="priority" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.priority != null ? scope.row.priority : '-' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="主线路" align="center" prop="isPrimary" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ <el-tag v-if="scope.row.isPrimary === 1" type="success" size="small">是</el-tag>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" align="center" prop="status" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.status === 0 || scope.row.status === '0'" type="danger" size="small">禁用</el-tag>
|
|
|
+ <el-tag v-else type="success" size="small">启用</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="备注"
|
|
|
+ align="center"
|
|
|
+ prop="remark"
|
|
|
+ width="300"
|
|
|
+ show-overflow-tooltip
|
|
|
+ :formatter="formatRemark"
|
|
|
+ />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { listCompanyVoiceApi } from '@/api/company/companyVoiceApi'
|
|
|
+
|
|
|
export default {
|
|
|
- name: 'Company语音API',
|
|
|
+ name: 'CompanyVoiceApi',
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
@@ -42,18 +99,31 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- keyword: null
|
|
|
- }
|
|
|
+ apiName: null,
|
|
|
+ apiType: null,
|
|
|
+ status: null
|
|
|
+ },
|
|
|
+ apiTypeMap: { 0: 'SIP', 1: '网关', 2: 'API', '0': 'SIP', '1': '网关', '2': 'API' }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getApiTypeLabel(type) {
|
|
|
+ return this.apiTypeMap[type] || '未知'
|
|
|
+ },
|
|
|
+ formatRemark(row) {
|
|
|
+ return row.remark || '-'
|
|
|
+ },
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
- // TODO: 接入实际API
|
|
|
- this.loading = false
|
|
|
+ listCompanyVoiceApi(this.queryParams).then(response => {
|
|
|
+ this.list = response.rows || []
|
|
|
+ this.total = response.total || 0
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1
|
|
|
@@ -62,10 +132,7 @@ export default {
|
|
|
resetQuery() {
|
|
|
this.resetForm('queryForm')
|
|
|
this.handleQuery()
|
|
|
- },
|
|
|
- handleDetail(row) { this.$message.info('详情功能待实现') },
|
|
|
- handleUpdate(row) { this.$message.info('修改功能待实现') },
|
|
|
- handleDelete(row) { this.$message.confirm('确认删除?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.$message.success('删除成功') }) }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|