mirror of https://gitee.com/lmlz_0/dc-ui.git
ljlong_2630
11 months ago
15 changed files with 907 additions and 149 deletions
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询TB变量转换列表
|
|||
export function listTbcodetransform(query) { |
|||
return request({ |
|||
url: '/model/dcBusiTbcodetransform/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询TB变量转换详细
|
|||
export function getTbcodetransform(id) { |
|||
return request({ |
|||
url: '/model/dcBusiTbcodetransform/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增TB变量转换
|
|||
export function addTbcodetransform(data) { |
|||
return request({ |
|||
url: '/model/dcBusiTbcodetransform', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改TB变量转换
|
|||
export function updateTbcodetransform(data) { |
|||
return request({ |
|||
url: '/model/dcBusiTbcodetransform', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除TB变量转换
|
|||
export function delTbcodetransform(id) { |
|||
return request({ |
|||
url: '/model/dcBusiTbcodetransform/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出TB变量转换
|
|||
export function exportTbcodetransform(query) { |
|||
return request({ |
|||
url: '/${baseUrl}/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询TB服务信息列表
|
|||
export function listTbserverinfo(query) { |
|||
return request({ |
|||
url: '/model/dcBusiServerinfo/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询TB服务信息详细
|
|||
export function getTbserverinfo(id) { |
|||
return request({ |
|||
url: '/model/dcBusiServerinfo/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增TB服务信息
|
|||
export function addTbserverinfo(data) { |
|||
return request({ |
|||
url: '/model/dcBusiServerinfo', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改TB服务信息
|
|||
export function updateTbserverinfo(data) { |
|||
return request({ |
|||
url: '/model/dcBusiServerinfo', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除TB服务信息
|
|||
export function delTbserverinfo(id) { |
|||
return request({ |
|||
url: '/model/dcBusiServerinfo/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出TB服务信息
|
|||
export function exportTbserverinfo(query) { |
|||
return request({ |
|||
url: '/${baseUrl}/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,303 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" |
|||
class="my-custom-form"> |
|||
<el-row> |
|||
<el-col :span="4"> |
|||
<el-form-item label="TB设备UUID" prop="tbDeviceUuid" label-width="auto"> |
|||
<el-input v-model="queryParams.tbDeviceUuid" placeholder="请输入TB设备UUID" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="TB变量名称" prop="tbVarName" label-width="auto"> |
|||
<el-input v-model="queryParams.tbVarName" placeholder="请输入TB变量名称" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="TB服务id" prop="tbServiceId" label-width="auto"> |
|||
<el-input v-model="queryParams.tbServiceId" placeholder="请输入TB服务id" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="中台设备UUID" prop="centerDeviceuuid" label-width="auto"> |
|||
<el-input v-model="queryParams.centerDeviceuuid" placeholder="请输入中台设备UUID" clearable |
|||
@keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="中台参数编码" prop="centerParamcode" label-width="auto"> |
|||
<el-input v-model="queryParams.centerParamcode" placeholder="请输入中台参数编码" clearable |
|||
@keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="中台参数模版编码" prop="centerParamclass" label-width="auto"> |
|||
<el-input v-model="queryParams.centerParamclass" placeholder="请输入中台参数模版编码" clearable |
|||
@keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="分区" prop="partion" label-width="auto"> |
|||
<el-select v-model="queryParams.partion" placeholder="请选择分区" clearable> |
|||
<el-option v-for="dict in dc_device_partion" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item class="childTextAlignLeft"> |
|||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
|||
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button type="success" icon="Plus" @click="handleAdd">新增</el-button> |
|||
</el-col> |
|||
<!-- <el-col :span="1.5"> |
|||
<el-button type="success" icon="Edit" @click="handleUpdate">修改</el-button> |
|||
</el-col> --> |
|||
<el-col :span="1.5"> |
|||
<el-button type="success" icon="Delete" @click="handleDelete">删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button type="warning" icon="Download" @click="handleExport">导出</el-button> |
|||
</el-col> |
|||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="tbcodetransformList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="TB设备UUID" align="center" prop="tbDeviceUuid" /> |
|||
<el-table-column label="TB变量名称" align="center" prop="tbVarName" /> |
|||
<el-table-column label="TB服务id" align="center" prop="tbServiceId" /> |
|||
<el-table-column label="中台设备UUID" align="center" prop="centerDeviceuuid" /> |
|||
<el-table-column label="中台参数编码" align="center" prop="centerParamcode" /> |
|||
<el-table-column label="主键" align="center" prop="id" /> |
|||
<el-table-column label="中台参数模版编码" align="center" prop="centerParamclass" /> |
|||
<el-table-column label="分区" align="center" prop="partion"> |
|||
<template #default="scope"> |
|||
<dict-tag :options="dc_device_partion" :value="scope.row.partion" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|||
<template #default="scope"> |
|||
<el-button type="text" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button> |
|||
<el-button type="text" icon="Delete" @click="handleDelete(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" |
|||
@pagination="getList" /> |
|||
|
|||
<!-- 添加或修改TB变量转换对话框 --> |
|||
<el-dialog :title="title" v-model="open" width="800px" append-to-body> |
|||
<el-form ref="tbcodetransformRef" :model="form" :rules="rules" class="my-custom-form"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="TB设备UUID" prop="tbDeviceUuid" label-width="auto"> |
|||
<el-input v-model="form.tbDeviceUuid" placeholder="请输入TB设备UUID" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="TB变量名称" prop="tbVarName" label-width="auto"> |
|||
<el-input v-model="form.tbVarName" placeholder="请输入TB变量名称" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="TB服务id" prop="tbServiceId" label-width="auto"> |
|||
<el-input v-model="form.tbServiceId" placeholder="请输入TB服务id" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="中台设备UUID" prop="centerDeviceuuid" label-width="auto"> |
|||
<el-input v-model="form.centerDeviceuuid" placeholder="请输入中台设备UUID" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="中台参数编码" prop="centerParamcode" label-width="auto"> |
|||
<el-input v-model="form.centerParamcode" placeholder="请输入中台参数编码" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="中台参数模版编码" prop="centerParamclass" label-width="auto"> |
|||
<el-input v-model="form.centerParamclass" placeholder="请输入中台参数模版编码" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="分区" prop="partion"> |
|||
<el-select v-model="form.partion" placeholder="请选择分区" label-width="auto"> |
|||
<el-option v-for="dict in dc_device_partion" :key="dict.value" :label="dict.label" |
|||
:value="dict.value"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
</el-form> |
|||
<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> |
|||
<style lang="scss" > |
|||
@import "@/assets/styles/self-defined.scss"; |
|||
</style> |
|||
<script setup name="Tbcodetransform"> |
|||
import { listTbcodetransform, getTbcodetransform, delTbcodetransform, addTbcodetransform, updateTbcodetransform } from "@/api/model/tbcodetransform"; |
|||
|
|||
const { proxy } = getCurrentInstance(); |
|||
const { dc_device_partion } = proxy.useDict('dc_device_partion'); |
|||
|
|||
const tbcodetransformList = 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, |
|||
tbDeviceUuid: null, |
|||
tbVarName: null, |
|||
tbServiceId: null, |
|||
centerDeviceuuid: null, |
|||
centerParamcode: null, |
|||
centerParamclass: null, |
|||
partion: null |
|||
}, |
|||
rules: { |
|||
} |
|||
}); |
|||
|
|||
const { queryParams, form, rules } = toRefs(data); |
|||
|
|||
/** 查询TB变量转换列表 */ |
|||
function getList() { |
|||
loading.value = true; |
|||
listTbcodetransform(queryParams.value).then(response => { |
|||
tbcodetransformList.value = response.rows; |
|||
total.value = response.total; |
|||
loading.value = false; |
|||
}); |
|||
} |
|||
|
|||
// 取消按钮 |
|||
function cancel() { |
|||
open.value = false; |
|||
reset(); |
|||
} |
|||
|
|||
// 表单重置 |
|||
function reset() { |
|||
form.value = { |
|||
tbDeviceUuid: null, |
|||
tbVarName: null, |
|||
tbServiceId: null, |
|||
centerDeviceuuid: null, |
|||
centerParamcode: null, |
|||
id: null, |
|||
centerParamclass: null, |
|||
partion: null |
|||
}; |
|||
proxy.resetForm("tbcodetransformRef"); |
|||
} |
|||
|
|||
/** 搜索按钮操作 */ |
|||
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 = "添加TB变量转换"; |
|||
} |
|||
|
|||
/** 修改按钮操作 */ |
|||
function handleUpdate(row) { |
|||
reset(); |
|||
const _id = row.id || ids.value |
|||
getTbcodetransform(_id).then(response => { |
|||
form.value = response.data; |
|||
open.value = true; |
|||
title.value = "修改TB变量转换"; |
|||
}); |
|||
} |
|||
|
|||
/** 提交按钮 */ |
|||
function submitForm() { |
|||
proxy.$refs["tbcodetransformRef"].validate(valid => { |
|||
if (valid) { |
|||
if (form.value.id != null) { |
|||
updateTbcodetransform(form.value).then(response => { |
|||
proxy.$modal.msgSuccess("修改成功"); |
|||
open.value = false; |
|||
getList(); |
|||
}); |
|||
} else { |
|||
addTbcodetransform(form.value).then(response => { |
|||
proxy.$modal.msgSuccess("新增成功"); |
|||
open.value = false; |
|||
getList(); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
function handleDelete(row) { |
|||
const _ids = row.id || ids.value; |
|||
proxy.$modal.confirm('是否确认删除TB变量转换编号为"' + _ids + '"的数据项?').then(function () { |
|||
return delTbcodetransform(_ids); |
|||
}).then(() => { |
|||
getList(); |
|||
proxy.$modal.msgSuccess("删除成功"); |
|||
}).catch(() => { }); |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
function handleExport() { |
|||
proxy.download('model/dcBusiTbcodetransform/export', { |
|||
...queryParams.value |
|||
}, `tbcodetransform_${new Date().getTime()}.xlsx`) |
|||
} |
|||
|
|||
getList(); |
|||
</script> |
@ -0,0 +1,332 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" class="my-custom-form"> |
|||
<el-row> |
|||
<el-col :span="4"> |
|||
<el-form-item label="用户名" prop="userName" label-width="auto"> |
|||
<el-input v-model="queryParams.userName" placeholder="请输入用户名" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="密码" prop="passWord" label-width="auto"> |
|||
<el-input v-model="queryParams.passWord" placeholder="请输入密码" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="IP地址" prop="restUrl" label-width="auto"> |
|||
<el-input v-model="queryParams.restUrl" placeholder="请输入IP地址" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="端口号" prop="restPort" label-width="auto"> |
|||
<el-input v-model="queryParams.restPort" placeholder="请输入端口号" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="是否可用" prop="enabled" label-width="auto"> |
|||
<el-select v-model="queryParams.enabled" placeholder="请选择是否可用" clearable> |
|||
<el-option v-for="dict in enabled" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="服务名" prop="seviceName" label-width="auto"> |
|||
<el-input v-model="queryParams.seviceName" placeholder="请输入服务名" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="备注" prop="note" label-width="auto"> |
|||
<el-input v-model="queryParams.note" placeholder="请输入备注" clearable @keyup.enter="handleQuery" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="服务类型" prop="seviceType" label-width="auto"> |
|||
<el-select v-model="queryParams.seviceType" placeholder="请选择服务类型" clearable> |
|||
<el-option v-for="dict in dc_collectserver_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item class="childTextAlignLeft"> |
|||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
|||
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button type="success" icon="Plus" @click="handleAdd">新增</el-button> |
|||
</el-col> |
|||
<!-- <el-col :span="1.5"> |
|||
<el-button type="success" icon="Edit" @click="handleUpdate">修改</el-button> |
|||
</el-col> --> |
|||
<el-col :span="1.5"> |
|||
<el-button type="success" icon="Delete" @click="handleDelete">删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button type="warning" icon="Download" @click="handleExport">导出</el-button> |
|||
</el-col> |
|||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="tbserverinfoList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="用户名" align="center" prop="userName" /> |
|||
<el-table-column label="密码" align="center" prop="passWord" /> |
|||
<el-table-column label="IP地址" align="center" prop="restUrl" /> |
|||
<el-table-column label="端口号" align="center" prop="restPort" /> |
|||
<el-table-column label="是否可用" align="center" prop="enabled" > |
|||
<template #default="scope"> |
|||
<dict-tag :options="enabledTable" :value="scope.row.enabled" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="服务名" align="center" prop="seviceName" /> |
|||
<el-table-column label="备注" align="center" prop="note" /> |
|||
<el-table-column label="主键" align="center" prop="id" /> |
|||
<el-table-column label="服务类型" align="center" prop="seviceType" > |
|||
<template #default="scope"> |
|||
<dict-tag :options="dc_collectserver_type" :value="scope.row.seviceType" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|||
<template #default="scope"> |
|||
<el-button type="text" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button> |
|||
<el-button type="text" icon="Delete" @click="handleDelete(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" |
|||
@pagination="getList" /> |
|||
|
|||
<!-- 添加或修改TB服务信息对话框 --> |
|||
<el-dialog :title="title" v-model="open" width="800px" append-to-body> |
|||
<el-form ref="tbserverinfoRef" :model="form" :rules="rules" class="my-custom-form"> |
|||
|
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="用户名" prop="userName" label-width="auto"> |
|||
<el-input v-model="form.userName" placeholder="请输入用户名" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="密码" prop="passWord" label-width="auto"> |
|||
<el-input v-model="form.passWord" placeholder="请输入密码" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="IP地址" prop="restUrl" label-width="auto"> |
|||
<el-input v-model="form.restUrl" placeholder="请输入IP地址" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="端口号" prop="restPort" label-width="auto"> |
|||
<el-input v-model="form.restPort" placeholder="请输入端口号" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="是否可用" prop="enabled" label-width="auto"> |
|||
<el-select v-model="form.enabled" placeholder="请选择是否可用"> |
|||
<el-option v-for="dict in enabled" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="服务名" prop="seviceName" label-width="auto"> |
|||
<el-input v-model="form.seviceName" placeholder="请输入服务名" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="备注" prop="note" label-width="auto"> |
|||
<el-input v-model="form.note" placeholder="请输入备注" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="服务类型" prop="seviceType" label-width="auto"> |
|||
<el-select v-model="form.seviceType" placeholder="请选择服务类型"> |
|||
<el-option v-for="dict in dc_collectserver_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
</el-form> |
|||
<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> |
|||
<style lang="scss" > |
|||
@import "@/assets/styles/self-defined.scss"; |
|||
</style> |
|||
<script setup name="Tbserverinfo"> |
|||
import { listTbserverinfo, getTbserverinfo, delTbserverinfo, addTbserverinfo, updateTbserverinfo } from "@/api/model/tbserverinfo"; |
|||
|
|||
const { proxy } = getCurrentInstance(); |
|||
const { dc_collectserver_type } = proxy.useDict('dc_collectserver_type'); |
|||
const tbserverinfoList = 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 enabled = [ |
|||
{ |
|||
value: true, |
|||
label: '是' |
|||
}, |
|||
{ |
|||
value: false, |
|||
label: '否' |
|||
} |
|||
]; |
|||
const enabledTable = [ |
|||
{ |
|||
value: 'true', |
|||
label: '是' |
|||
}, |
|||
{ |
|||
value: 'false', |
|||
label: '否' |
|||
} |
|||
]; |
|||
|
|||
const data = reactive({ |
|||
form: {}, |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
userName: null, |
|||
passWord: null, |
|||
restUrl: null, |
|||
restPort: null, |
|||
enabled: true, |
|||
seviceName: null, |
|||
note: null, |
|||
seviceType: null |
|||
}, |
|||
rules: { |
|||
} |
|||
}); |
|||
|
|||
const { queryParams, form, rules } = toRefs(data); |
|||
|
|||
/** 查询TB服务信息列表 */ |
|||
function getList() { |
|||
loading.value = true; |
|||
listTbserverinfo(queryParams.value).then(response => { |
|||
tbserverinfoList.value = response.rows; |
|||
total.value = response.total; |
|||
loading.value = false; |
|||
}); |
|||
} |
|||
|
|||
// 取消按钮 |
|||
function cancel() { |
|||
open.value = false; |
|||
reset(); |
|||
} |
|||
|
|||
// 表单重置 |
|||
function reset() { |
|||
form.value = { |
|||
userName: null, |
|||
passWord: null, |
|||
restUrl: null, |
|||
restPort: null, |
|||
enabled: null, |
|||
seviceName: null, |
|||
note: null, |
|||
id: null, |
|||
seviceType: null |
|||
}; |
|||
proxy.resetForm("tbserverinfoRef"); |
|||
} |
|||
|
|||
/** 搜索按钮操作 */ |
|||
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 = "添加TB服务信息"; |
|||
} |
|||
|
|||
/** 修改按钮操作 */ |
|||
function handleUpdate(row) { |
|||
reset(); |
|||
const _id = row.id || ids.value |
|||
getTbserverinfo(_id).then(response => { |
|||
form.value = response.data; |
|||
open.value = true; |
|||
title.value = "修改TB服务信息"; |
|||
}); |
|||
} |
|||
|
|||
/** 提交按钮 */ |
|||
function submitForm() { |
|||
proxy.$refs["tbserverinfoRef"].validate(valid => { |
|||
if (valid) { |
|||
if (form.value.id != null) { |
|||
updateTbserverinfo(form.value).then(response => { |
|||
proxy.$modal.msgSuccess("修改成功"); |
|||
open.value = false; |
|||
getList(); |
|||
}); |
|||
} else { |
|||
addTbserverinfo(form.value).then(response => { |
|||
proxy.$modal.msgSuccess("新增成功"); |
|||
open.value = false; |
|||
getList(); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
function handleDelete(row) { |
|||
debugger |
|||
const _ids = row.id || ids.value; |
|||
proxy.$modal.confirm('是否确认删除TB服务信息编号为"' + _ids + '"的数据项?').then(function () { |
|||
return delTbserverinfo(_ids); |
|||
}).then(() => { |
|||
getList(); |
|||
proxy.$modal.msgSuccess("删除成功"); |
|||
}).catch(() => { }); |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
function handleExport() { |
|||
proxy.download('model/dcBusiServerinfo/export', { |
|||
...queryParams.value |
|||
}, `tbserverinfo_${new Date().getTime()}.xlsx`) |
|||
} |
|||
|
|||
getList(); |
|||
</script> |
Loading…
Reference in new issue