|
@@ -1,128 +1,124 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="分机号" prop="extension">
|
|
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="" prop="extension">
|
|
|
<el-input
|
|
|
- v-model="queryParams.extension"
|
|
|
- placeholder="请输入分机号"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.extension"
|
|
|
+ placeholder="请输入分机号"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="SIP注册密码" prop="password">
|
|
|
+ <el-form-item label="" prop="password">
|
|
|
<el-input
|
|
|
- v-model="queryParams.password"
|
|
|
- placeholder="请输入SIP注册密码"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.password"
|
|
|
+ placeholder="请输入SIP注册密码"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="主叫显示名称" prop="callerName">
|
|
|
+ <el-form-item label="" prop="callerName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.callerName"
|
|
|
- placeholder="请输入主叫显示名称"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.callerName"
|
|
|
+ placeholder="请输入主叫显示名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="主叫号码" prop="callerNumber">
|
|
|
+ <el-form-item label="" prop="callerNumber">
|
|
|
<el-input
|
|
|
- v-model="queryParams.callerNumber"
|
|
|
- placeholder="请输入主叫号码"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.callerNumber"
|
|
|
+ placeholder="请输入主叫号码"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所属域名或IP" prop="domain">
|
|
|
+ <el-form-item label="" prop="domain">
|
|
|
<el-input
|
|
|
- v-model="queryParams.domain"
|
|
|
- placeholder="请输入所属域名或IP"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.domain"
|
|
|
+ placeholder="请输入所属域名或IP"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="拨号上下文" prop="context">
|
|
|
+ <el-form-item label="" prop="context">
|
|
|
<el-input
|
|
|
- v-model="queryParams.context"
|
|
|
- placeholder="请输入拨号上下文"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.context"
|
|
|
+ placeholder="请输入拨号上下文"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否允许注册" prop="enableRegister">
|
|
|
+ <el-form-item label="" prop="enableRegister">
|
|
|
<el-input
|
|
|
- v-model="queryParams.enableRegister"
|
|
|
- placeholder="请输入是否允许注册"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.enableRegister"
|
|
|
+ placeholder="请输入是否允许注册"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否允许外呼" prop="enableOutbound">
|
|
|
+ <el-form-item label="" prop="enableOutbound">
|
|
|
<el-input
|
|
|
- v-model="queryParams.enableOutbound"
|
|
|
- placeholder="请输入是否允许外呼"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.enableOutbound"
|
|
|
+ placeholder="请输入是否允许外呼"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="指定出局网关名,如supplier_a" prop="gatewayName">
|
|
|
+ <el-form-item label="" prop="gatewayName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.gatewayName"
|
|
|
- placeholder="请输入指定出局网关名,如supplier_a"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ v-model="queryParams.gatewayName"
|
|
|
+ placeholder="请输入指定出局网关名,如supplier_a"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['cti:extension:add']"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['cti:extension:add']"
|
|
|
>新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- icon="el-icon-edit"
|
|
|
- size="mini"
|
|
|
- :disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- v-hasPermi="['cti:extension:edit']"
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="Edit"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['cti:extension:edit']"
|
|
|
>修改</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['cti:extension:remove']"
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="Delete"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['cti:extension:remove']"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="warning"
|
|
|
- plain
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['cti:extension:export']"
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="Download"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['cti:extension:export']"
|
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="extensionList" @selection-change="handleSelectionChange">
|
|
@@ -139,36 +135,24 @@
|
|
|
<el-table-column label="指定出局网关名,如supplier_a" align="center" prop="gatewayName" />
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['cti:extension:edit']"
|
|
|
- >修改</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['cti:extension:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cti:extension:edit']">修改</el-button>
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['cti:extension:remove']">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改分机管理对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="extensionRef" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="分机号" prop="extension">
|
|
|
<el-input v-model="form.extension" placeholder="请输入分机号" />
|
|
|
</el-form-item>
|
|
@@ -200,171 +184,169 @@
|
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
-import { listExtension, getExtension, delExtension, addExtension, updateExtension } from "@/api/cti/extension"
|
|
|
+<script setup name="Extension">
|
|
|
+import { listExtension, getExtension, delExtension, addExtension, updateExtension } from "@/api/cti/extension";
|
|
|
|
|
|
-export default {
|
|
|
- name: "Extension",
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 分机管理表格数据
|
|
|
- extensionList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- extension: null,
|
|
|
- password: null,
|
|
|
- callerName: null,
|
|
|
- callerNumber: null,
|
|
|
- domain: null,
|
|
|
- context: null,
|
|
|
- enableRegister: null,
|
|
|
- enableOutbound: null,
|
|
|
- gatewayName: null,
|
|
|
- },
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- extension: [
|
|
|
- { required: true, message: "分机号不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- password: [
|
|
|
- { required: true, message: "SIP注册密码不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getList()
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+
|
|
|
+const extensionList = ref([]);
|
|
|
+const open = ref(false);
|
|
|
+const loading = ref(true);
|
|
|
+const showSearch = ref(true);
|
|
|
+const ids = ref([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
+const total = ref(0);
|
|
|
+const title = ref("");
|
|
|
+
|
|
|
+const data = reactive({
|
|
|
+ form: {},
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ extension: null,
|
|
|
+ password: null,
|
|
|
+ callerName: null,
|
|
|
+ callerNumber: null,
|
|
|
+ domain: null,
|
|
|
+ context: null,
|
|
|
+ enableRegister: null,
|
|
|
+ enableOutbound: null,
|
|
|
+ gatewayName: null,
|
|
|
},
|
|
|
- methods: {
|
|
|
- /** 查询分机管理列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true
|
|
|
- listExtension(this.queryParams).then(response => {
|
|
|
- this.extensionList = response.rows
|
|
|
- this.total = response.total
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false
|
|
|
- this.reset()
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- id: null,
|
|
|
- extension: null,
|
|
|
- password: null,
|
|
|
- callerName: null,
|
|
|
- callerNumber: null,
|
|
|
- domain: null,
|
|
|
- context: null,
|
|
|
- enableRegister: null,
|
|
|
- enableOutbound: null,
|
|
|
- gatewayName: null,
|
|
|
- createTime: null,
|
|
|
- updateTime: null,
|
|
|
- remark: null
|
|
|
+ rules: {
|
|
|
+ extension: [
|
|
|
+ { required: true, message: "分机号不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ password: [
|
|
|
+ { required: true, message: "SIP注册密码不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const { queryParams, form, rules } = toRefs(data);
|
|
|
+
|
|
|
+/** 查询分机管理列表 */
|
|
|
+function getList() {
|
|
|
+ loading.value = true;
|
|
|
+ listExtension(queryParams.value).then(response => {
|
|
|
+ extensionList.value = response.rows;
|
|
|
+ total.value = response.total;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 取消按钮
|
|
|
+function cancel() {
|
|
|
+ open.value = false;
|
|
|
+ reset();
|
|
|
+}
|
|
|
+
|
|
|
+// 表单重置
|
|
|
+function reset() {
|
|
|
+ form.value = {
|
|
|
+ id: null,
|
|
|
+ extension: null,
|
|
|
+ password: null,
|
|
|
+ callerName: null,
|
|
|
+ callerNumber: null,
|
|
|
+ domain: null,
|
|
|
+ context: null,
|
|
|
+ enableRegister: null,
|
|
|
+ enableOutbound: null,
|
|
|
+ gatewayName: null,
|
|
|
+ createTime: null,
|
|
|
+ updateTime: null,
|
|
|
+ remark: null
|
|
|
+ };
|
|
|
+ proxy.resetForm("extensionRef");
|
|
|
+}
|
|
|
+
|
|
|
+/** 搜索按钮操作 */
|
|
|
+function handleQuery() {
|
|
|
+ queryParams.value.pageNum = 1;
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+/** 重置按钮操作 */
|
|
|
+function resetQuery() {
|
|
|
+ proxy.resetForm("queryRef");
|
|
|
+ handleQuery();
|
|
|
+}
|
|
|
+
|
|
|
+// 多选框选中数据
|
|
|
+function handleSelectionChange(selection) {
|
|
|
+ ids.value = selection.map(item => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
+ multiple.value = !selection.length;
|
|
|
+}
|
|
|
+
|
|
|
+/** 新增按钮操作 */
|
|
|
+function handleAdd() {
|
|
|
+ reset();
|
|
|
+ open.value = true;
|
|
|
+ title.value = "添加分机管理";
|
|
|
+}
|
|
|
+
|
|
|
+/** 修改按钮操作 */
|
|
|
+function handleUpdate(row) {
|
|
|
+ reset();
|
|
|
+ const _id = row.id || ids.value
|
|
|
+ getExtension(_id).then(response => {
|
|
|
+ form.value = response.data;
|
|
|
+ open.value = true;
|
|
|
+ title.value = "修改分机管理";
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 提交按钮 */
|
|
|
+function submitForm() {
|
|
|
+ proxy.$refs["extensionRef"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (form.value.id != null) {
|
|
|
+ updateExtension(form.value).then(response => {
|
|
|
+ proxy.$modal.msgSuccess("修改成功");
|
|
|
+ open.value = false;
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addExtension(form.value).then(response => {
|
|
|
+ proxy.$modal.msgSuccess("新增成功");
|
|
|
+ open.value = false;
|
|
|
+ getList();
|
|
|
+ });
|
|
|
}
|
|
|
- this.resetForm("form")
|
|
|
- },
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
- this.resetForm("queryForm")
|
|
|
- this.handleQuery()
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.reset()
|
|
|
- this.open = true
|
|
|
- this.title = "添加分机管理"
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset()
|
|
|
- const id = row.id || this.ids
|
|
|
- getExtension(id).then(response => {
|
|
|
- this.form = response.data
|
|
|
- this.open = true
|
|
|
- this.title = "修改分机管理"
|
|
|
- })
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updateExtension(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功")
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- } else {
|
|
|
- addExtension(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功")
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const ids = row.id || this.ids
|
|
|
- this.$modal.confirm('是否确认删除分机管理编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delExtension(ids)
|
|
|
- }).then(() => {
|
|
|
- this.getList()
|
|
|
- this.$modal.msgSuccess("删除成功")
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('cti/extension/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `extension_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 删除按钮操作 */
|
|
|
+function handleDelete(row) {
|
|
|
+ const _ids = row.id || ids.value;
|
|
|
+ proxy.$modal.confirm('是否确认删除分机管理编号为"' + _ids + '"的数据项?').then(function() {
|
|
|
+ return delExtension(_ids);
|
|
|
+ }).then(() => {
|
|
|
+ getList();
|
|
|
+ proxy.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+}
|
|
|
+
|
|
|
+/** 导出按钮操作 */
|
|
|
+function handleExport() {
|
|
|
+ proxy.download('cti/extension/export', {
|
|
|
+ ...queryParams.value
|
|
|
+ }, `extension_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
+
|
|
|
+getList();
|
|
|
</script>
|