|
|
@@ -8,241 +8,110 @@
|
|
|
<div class="middle">
|
|
|
<div class="filter">
|
|
|
<div class="condition">
|
|
|
- <el-select v-model="value" class="sel" placeholder="数据库类型">
|
|
|
- <el-option label="Mariadb 数据库" value="1" />
|
|
|
- <el-option label="MySQL6.0 及以下数据库" value="2" />
|
|
|
- <el-option label="MySQL8.0 及以下数据库" value="3" />
|
|
|
- <el-option label="Oracle 10g、11g 数据库" value="3" />
|
|
|
- <el-option label="PostgreSQL 数据库" value="3" />
|
|
|
+ <el-select v-model="searchInput.dsClassValue" class="sel" placeholder="数据库类型">
|
|
|
+ <el-option v-for="item in dsClass.list" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
- <el-select v-model="value" class="sel" placeholder="连接状态">
|
|
|
+ <el-select v-model="searchInput.connectStatus" class="sel" placeholder="连接状态">
|
|
|
<el-option label="正常" value="1" />
|
|
|
- <el-option label="不可用" value="2" />
|
|
|
+ <el-option label="异常" value="0" />
|
|
|
</el-select>
|
|
|
- <el-input
|
|
|
- :clearable="true"
|
|
|
- @clear="searchBtn"
|
|
|
- v-model="searchInput.keyWord"
|
|
|
- class="sel"
|
|
|
- placeholder="数据源名称"
|
|
|
- />
|
|
|
+ <el-input :clearable="true" @clear="searchBtn" v-model="searchInput.keyWord" class="sel"
|
|
|
+ placeholder="数据源名称" />
|
|
|
</div>
|
|
|
- <el-button
|
|
|
- color="rgba(0, 97, 255, 1)"
|
|
|
- type="primary"
|
|
|
- class="search"
|
|
|
- @click="searchBtn"
|
|
|
- ><el-icon>
|
|
|
+ <el-button color="rgba(0, 97, 255, 1)" type="primary" class="search" @click="searchBtn"><el-icon>
|
|
|
<Search />
|
|
|
</el-icon>
|
|
|
- <span>查询</span></el-button
|
|
|
- >
|
|
|
+ <span>查询</span></el-button>
|
|
|
</div>
|
|
|
<!-- 按钮列表 -->
|
|
|
<div class="gongneng">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- color="rgba(0, 97, 255, 1)"
|
|
|
- plain
|
|
|
- @click="addClick"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- color="rgba(0, 97, 255, 1)"
|
|
|
- plain
|
|
|
- @click="editClick"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- color="rgba(0, 97, 255, 1)"
|
|
|
- @click="delClick"
|
|
|
- plain
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" color="rgba(0, 97, 255, 1)" plain @click="addClick">新增</el-button>
|
|
|
+ <el-button type="primary" color="rgba(0, 97, 255, 1)" plain @click="editClick">编辑</el-button>
|
|
|
+ <el-button type="primary" color="rgba(0, 97, 255, 1)" @click="delClick" plain>删除</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer" v-loading="loading">
|
|
|
- <el-table
|
|
|
- :row-class-name="tableRowClassName"
|
|
|
- :data="tableData.list"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- style="width: 100%"
|
|
|
- :header-cell-style="{
|
|
|
+ <el-table :row-class-name="tableRowClassName" :data="tableData.list" @selection-change="handleSelectionChange"
|
|
|
+ style="width: 100%" :header-cell-style="{
|
|
|
background: 'rgba(240, 243, 247, 1)',
|
|
|
height: '50px',
|
|
|
border: 0,
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-table-column align="center" type="selection" width="80" />
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="type"
|
|
|
- width="200"
|
|
|
- label="类型"
|
|
|
- />
|
|
|
- <el-table-column align="center" prop="name" label="名称" />
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="link"
|
|
|
- width="320"
|
|
|
- label="连接地址"
|
|
|
- />
|
|
|
- <el-table-column align="center" prop="status" label="连接状态">
|
|
|
+ }">
|
|
|
+ <!-- <el-table-column align="center" type="selection" width="80" /> -->
|
|
|
+ <el-table-column align="center" prop="dsClsId" width="200" label="类型" />
|
|
|
+ <el-table-column align="center" prop="dsName" label="名称" />
|
|
|
+ <el-table-column align="center" prop="dsUrl" width="300" label="连接地址" />
|
|
|
+ <el-table-column align="center" prop="dsStatus" label="连接状态">
|
|
|
<template #default="scope">
|
|
|
- <span class="normal">正常</span>
|
|
|
+ <span v-if="scope.row.dsStatus == 1" class="normal">正常</span>
|
|
|
+ <span v-else class="abnormal">异常</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="describe"
|
|
|
- show-overflow-tooltip
|
|
|
- label="描述"
|
|
|
- />
|
|
|
- <!-- <el-table-column align="center" label="操作" width="200">
|
|
|
+ <el-table-column align="center" prop="dsDescrition" show-overflow-tooltip label="描述" />
|
|
|
+ <el-table-column align="center" label="操作" width="200">
|
|
|
<template #default="scope">
|
|
|
<div class="edit">
|
|
|
<div class="look" @click="editClick(scope.row)">编辑</div>
|
|
|
- <el-popconfirm
|
|
|
- width="220"
|
|
|
- confirm-button-text="确认"
|
|
|
- cancel-button-text="取消"
|
|
|
- :icon="InfoFilled"
|
|
|
- icon-color="#f89626"
|
|
|
- title="是否删除此房型?"
|
|
|
- @confirm="del(scope.row)"
|
|
|
- @cancel="cancelEvent"
|
|
|
- >
|
|
|
+ <el-popconfirm width="220" confirm-button-text="确认" cancel-button-text="取消" :icon="InfoFilled"
|
|
|
+ icon-color="#f89626" title="是否删除此房型?" @confirm="del(scope.row)" @cancel="cancelEvent">
|
|
|
<template #reference>
|
|
|
<div class="del">删除</div>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
|
|
|
<!-- 分页组件 -->
|
|
|
<div class="pageSize">
|
|
|
<span></span>
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- :current-page="currentPage"
|
|
|
- :page-size="pageSize"
|
|
|
- layout="total, prev, pager, next, jumper, slot"
|
|
|
- :total="total"
|
|
|
- @update:current-page="handleCurrentChange"
|
|
|
- />
|
|
|
+ <el-pagination background :current-page="currentPage" :page-size="pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper, slot" :total="total" @update:current-page="handleCurrentChange" />
|
|
|
</div>
|
|
|
|
|
|
- <!-- 编辑按钮 -->
|
|
|
- <el-dialog
|
|
|
- class="editDialog"
|
|
|
- v-model="editVisible"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :title="titleDialog"
|
|
|
- align-center
|
|
|
- width="900"
|
|
|
- :before-close="cancelEdit"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="editRef"
|
|
|
- :model="editRuleForm"
|
|
|
- :rules="editRules"
|
|
|
- label-width="100px"
|
|
|
- class="demo-ruleForm"
|
|
|
- :size="formSize"
|
|
|
- label-position="right"
|
|
|
- status-icon
|
|
|
- >
|
|
|
- <el-form-item label="类型 :" prop="type">
|
|
|
- <el-select
|
|
|
- v-model="editRuleForm.type"
|
|
|
- multiple
|
|
|
- placeholder="请选择类型"
|
|
|
- style="width: 740px"
|
|
|
- >
|
|
|
- <el-option label="学生肖像" value="1" />
|
|
|
- <el-option label="车辆预约" value="2" />
|
|
|
- <el-option label="校园打卡" value="3" />
|
|
|
- <el-option label="校园报修" value="4" />
|
|
|
+ <!-- 编辑对话框 -->
|
|
|
+ <el-dialog class="editDialog" v-model="editVisible" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
|
+ :title="titleDialog" align-center width="900" :before-close="cancelEdit">
|
|
|
+ <el-form ref="editRef" :model="editRuleForm" :rules="editRules" label-width="100px" class="demo-ruleForm"
|
|
|
+ :size="formSize" label-position="right" status-icon>
|
|
|
+ <el-form-item label="类型 :" prop="dsClsId">
|
|
|
+ <el-select v-model="editRuleForm.dsClsId" placeholder="请选择类型" style="width: 740px">
|
|
|
+ <el-option v-for="item in dsClassAdd.list" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="名称 :" prop="yname">
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.yname"
|
|
|
- placeholder="数据源名称.如: xxx数据库"
|
|
|
- clearable
|
|
|
- style="width: 740px"
|
|
|
- />
|
|
|
+ <el-form-item label="名称 :" prop="dsName">
|
|
|
+ <el-input v-model="editRuleForm.dsName" placeholder="数据源名称.如: xxx数据库" clearable style="width: 740px" />
|
|
|
</el-form-item>
|
|
|
<div v-if="titleDialog == '新增'">
|
|
|
<span class="typeTitle">使用辅助选项请先选择类型</span>
|
|
|
<el-form-item label="辅助选项 :">
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.location"
|
|
|
- placeholder="数据库服务IP地址"
|
|
|
- clearable
|
|
|
- style="width: 300px; margin-right: 10px"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.port"
|
|
|
- placeholder="数据库服务端口号"
|
|
|
- clearable
|
|
|
- style="width: 210px; margin-right: 10px"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.kname"
|
|
|
- placeholder="数据库名称"
|
|
|
- clearable
|
|
|
- style="width: 210px"
|
|
|
- />
|
|
|
+ <el-input v-model="editRuleForm.ip" placeholder="数据库服务IP地址" clearable @keyup="paramsChange" @clear="paramsChange"
|
|
|
+ style="width: 300px; margin-right: 10px" />
|
|
|
+ <el-input v-model="editRuleForm.port" placeholder="数据库服务端口号" clearable @keyup="paramsChange" @clear="paramsChange"
|
|
|
+ style="width: 210px; margin-right: 10px" />
|
|
|
+ <el-input v-model="editRuleForm.dbname" placeholder="数据库名称" clearable @keyup="paramsChange" @clear="paramsChange"
|
|
|
+ style="width: 210px" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <el-form-item label="连接地址 :" prop="link">
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.link"
|
|
|
- placeholder="数据库连接地址"
|
|
|
- clearable
|
|
|
- style="width: 740px"
|
|
|
- />
|
|
|
+ <el-form-item label="连接地址 :" prop="dsUrl">
|
|
|
+ <el-input v-model="editRuleForm.dsUrl" readonly placeholder="数据库连接地址" clearable style="width: 740px" />
|
|
|
</el-form-item>
|
|
|
<div class="account">
|
|
|
- <el-form-item label="数据库账号 :" prop="account">
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.account"
|
|
|
- placeholder="请输入数据库账号"
|
|
|
- clearable
|
|
|
- />
|
|
|
+ <el-form-item label="数据库账号 :" prop="dsUser">
|
|
|
+ <el-input v-model="editRuleForm.dsUser" placeholder="请输入数据库账号" clearable />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="数据库密码 :" prop="password">
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.password"
|
|
|
- placeholder="请输入数据库密码"
|
|
|
- clearable
|
|
|
- />
|
|
|
+ <el-form-item label="数据库密码 :" prop="dsPassword">
|
|
|
+ <el-input v-model="editRuleForm.dsPassword" placeholder="请输入数据库密码" clearable />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <el-form-item label="描述 :" prop="describe">
|
|
|
- <el-input
|
|
|
- v-model="editRuleForm.describe"
|
|
|
- placeholder="请输入该数据库相关简述"
|
|
|
- clearable
|
|
|
- type="textarea"
|
|
|
- :rows="5"
|
|
|
- style="width: 740px"
|
|
|
- />
|
|
|
+ <el-form-item label="描述 :" prop="dsDescrition">
|
|
|
+ <el-input v-model="editRuleForm.dsDescrition" placeholder="请输入该数据库相关简述" clearable type="textarea" :rows="5"
|
|
|
+ style="width: 740px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="options">
|
|
|
- <el-button
|
|
|
- color="rgba(41, 109, 227, 1)"
|
|
|
- class="queding"
|
|
|
- type="primary"
|
|
|
- @click="confirmEdit(editRef)"
|
|
|
- >
|
|
|
+ <el-button color="rgba(41, 109, 227, 1)" class="queding" type="primary" @click="confirmEdit(editRef)">
|
|
|
确认
|
|
|
</el-button>
|
|
|
<el-button @click="cancelEdit(editRef)">取消</el-button>
|
|
|
@@ -251,27 +120,14 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 勾选删除 -->
|
|
|
- <el-dialog
|
|
|
- class="closeAccount"
|
|
|
- v-model="selDelVisible"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- title="勾选删除"
|
|
|
- align-center
|
|
|
- width="500"
|
|
|
- :before-close="cancelSelDel"
|
|
|
- >
|
|
|
+ <el-dialog class="closeAccount" v-model="selDelVisible" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
|
+ title="勾选删除" align-center width="500" :before-close="cancelSelDel">
|
|
|
<div class="content">
|
|
|
<img src="@/assets/images/warning.png" alt="" />
|
|
|
<span>是否删除勾选的数据库?</span>
|
|
|
</div>
|
|
|
<div class="option">
|
|
|
- <el-button
|
|
|
- color="rgba(41, 109, 227, 1)"
|
|
|
- class="queding"
|
|
|
- type="primary"
|
|
|
- @click="confirmSelDel"
|
|
|
- >
|
|
|
+ <el-button color="rgba(41, 109, 227, 1)" class="queding" type="primary" @click="confirmSelDel">
|
|
|
确认
|
|
|
</el-button>
|
|
|
<el-button @click="cancelSelDel">取消</el-button>
|
|
|
@@ -279,14 +135,7 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
<div class="bgImg" v-if="bgImg">
|
|
|
- <el-carousel
|
|
|
- @click="bgImg = false"
|
|
|
- ref="bgImgs"
|
|
|
- indicator-position
|
|
|
- arrow="always"
|
|
|
- :autoplay="false"
|
|
|
- trigger
|
|
|
- >
|
|
|
+ <el-carousel @click="bgImg = false" ref="bgImgs" indicator-position arrow="always" :autoplay="false" trigger>
|
|
|
<el-carousel-item v-for="item in bgImgList" :key="item.id">
|
|
|
<img :src="item.url" alt="" />
|
|
|
</el-carousel-item>
|
|
|
@@ -319,47 +168,23 @@ const router = useRouter();
|
|
|
const loading = ref(false);
|
|
|
const tableData = reactive({
|
|
|
list: [
|
|
|
- {
|
|
|
- type: "Oracle 10g、11g 数据库",
|
|
|
- name: "消息平台",
|
|
|
- link: "jdbc:oracle:thin:@172.16.30.21:1408:orcl",
|
|
|
- status: 1,
|
|
|
- describe: "消息平台",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "Mariadb 数据库",
|
|
|
- name: "学工数据库",
|
|
|
- link: "jdbc:oracle:thin:@172.16.30.21:1408:orcl",
|
|
|
- status: 1,
|
|
|
- describe: "学工数据库",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "Oracle 10g、11g 数据库",
|
|
|
- name: "教务中间库",
|
|
|
- link: "jdbc:oracle:thin:@172.16.30.21:1408:orcl",
|
|
|
- status: 1,
|
|
|
- describe: "教务中间库",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "MySQL6.0 及以下数据库",
|
|
|
- name: "新认证正式库",
|
|
|
- link: "jdbc:oracle:thin:@172.16.30.21:1408:orcl",
|
|
|
- status: 1,
|
|
|
- describe: "新认证正式库",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "PostgreSQL 数据库",
|
|
|
- name: "迎新系统",
|
|
|
- link: "jdbc:oracle:thin:@172.16.30.21:1408:orcl",
|
|
|
- status: 1,
|
|
|
- describe: "迎新系统",
|
|
|
- },
|
|
|
+ ],
|
|
|
+});
|
|
|
+// 页面中数据源类别下拉列表参数
|
|
|
+const dsClass = reactive({
|
|
|
+ list: [
|
|
|
+ ],
|
|
|
+});
|
|
|
+// 新增对话框中的数据源类别下拉列表参数
|
|
|
+const dsClassAdd = reactive({
|
|
|
+ list: [
|
|
|
],
|
|
|
});
|
|
|
|
|
|
const searchInput = reactive({
|
|
|
- keyWord: "",
|
|
|
- createTime: "",
|
|
|
+ dsClassValue: "",
|
|
|
+ connectStatus: "",// 是否数据源连接状态
|
|
|
+ keyWord: ""
|
|
|
}); // 搜索按钮数据
|
|
|
|
|
|
const currentPage = ref(1); // 当前页
|
|
|
@@ -372,50 +197,50 @@ const titleDialog = ref("");
|
|
|
const editVisible = ref(false);
|
|
|
const editRef = ref();
|
|
|
const editRuleForm = reactive({
|
|
|
- type: "", // 类型
|
|
|
- yname: "", // 数据源名称
|
|
|
- location: "", // 数据库服务IP地址
|
|
|
+ dsId: "", // 数据源id
|
|
|
+ dsClsId: "", // 数据源类型id
|
|
|
+ dsName: "", // 数据源名称
|
|
|
+ dsUrl: "", // 数据库连接地址
|
|
|
+ dsUser: "", // 数据库账号
|
|
|
+ dsPassword: "", // 数据库密码
|
|
|
+ dsDescrition: "", // 描述
|
|
|
+ ip: "", // 数据库服务IP地址
|
|
|
port: "", // 数据库服务端口号
|
|
|
- kname: "", // 数据库名称
|
|
|
- link: "", // 数据库连接地址
|
|
|
- account: "", // 数据库账号
|
|
|
- password: "", // 数据库密码
|
|
|
- describe: "", // 描述
|
|
|
- id: "",
|
|
|
+ dbname: "", // 数据库名称
|
|
|
});
|
|
|
|
|
|
// 表单验证
|
|
|
const editRules = reactive({
|
|
|
- type: [{ required: true, message: "类型不能为空", trigger: "blur" }],
|
|
|
- yname: [
|
|
|
+ dsClsId: [{ required: true, message: "类型不能为空", trigger: "blur" }],
|
|
|
+ dsName: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "数据源名称不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- link: [
|
|
|
+ dsUrl: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "数据库连接地址不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- account: [
|
|
|
+ dsUser: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "数据库账号不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- password: [
|
|
|
+ dsPassword: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "数据库密码不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- describe: [
|
|
|
+ dsDescrition: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "描述不能为空",
|
|
|
@@ -424,53 +249,112 @@ const editRules = reactive({
|
|
|
],
|
|
|
});
|
|
|
|
|
|
+const paramsChange = () => {
|
|
|
+ if (editRuleForm.dsClsId == "") {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: "请先选择数据库类型",
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ editRuleForm.ip = "";
|
|
|
+ editRuleForm.port = "";
|
|
|
+ editRuleForm.dbname = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (editRuleForm.ip == "" && editRuleForm.port == "" && editRuleForm.dbname == "") {
|
|
|
+ editRuleForm.dsUrl = "";
|
|
|
+ } else {
|
|
|
+ editRuleForm.dsUrl = "jdbc:mysql://" + editRuleForm.ip + ":" + editRuleForm.port + "/" + editRuleForm.dbname;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 删除弹窗
|
|
|
const selDelVisible = ref(false);
|
|
|
|
|
|
-// 查看房型列表
|
|
|
+// 数据源类别列表
|
|
|
+const getDsClass = async () => {
|
|
|
+ loading.value = true;
|
|
|
+ let data = {
|
|
|
+ currentPage: 1,
|
|
|
+ pageCount: 100,
|
|
|
+ managerId: sessionStorage.getItem("token"),
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "get",
|
|
|
+ url: api.value + "/wanzai/api/smartDataClass/queryPageSmartDataClass",
|
|
|
+ headers: {
|
|
|
+ // token: sessionStorage.getItem("token"),
|
|
|
+ // user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ params: data,
|
|
|
+ });
|
|
|
+ // console.log(res, "数据源类别");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ loading.value = false;
|
|
|
+ res.data.data.list.forEach((item) => {
|
|
|
+ dsClass.list.push({
|
|
|
+ label: item.dsClsName,
|
|
|
+ value: item.dsClsId,
|
|
|
+ });
|
|
|
+ dsClassAdd.list.push({
|
|
|
+ label: item.dsClsName,
|
|
|
+ value: item.dsClsId,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 数据源列表
|
|
|
const getList = async () => {
|
|
|
- // loading.value = true;
|
|
|
- // let data = {
|
|
|
- // page: currentPage.value,
|
|
|
- // rows: pageSize.value,
|
|
|
- // hName: searchInput.keyWord, // 房型名称
|
|
|
- // managerId: sessionStorage.getItem("token"),
|
|
|
- // };
|
|
|
- // let res = await axios({
|
|
|
- // method: "post",
|
|
|
- // url: api.value + "/mhotel/housequeryPage.action",
|
|
|
- // headers: {
|
|
|
- // // token: sessionStorage.getItem("token"),
|
|
|
- // // user_head: sessionStorage.getItem("userhead"),
|
|
|
- // },
|
|
|
- // params: data,
|
|
|
- // });
|
|
|
- // console.log(res, "房型管理");
|
|
|
- // if (res.data.code == 200) {
|
|
|
- // loading.value = false;
|
|
|
- // tableData.list = res.data.data.pageList;
|
|
|
- // total.value = res.data.data.total;
|
|
|
- // // ElMessage({
|
|
|
- // // type: "success",
|
|
|
- // // showClose: true,
|
|
|
- // // message: res.data.message,
|
|
|
- // // center: true,
|
|
|
- // // });
|
|
|
- // } else {
|
|
|
- // loading.value = false;
|
|
|
- // ElMessage({
|
|
|
- // type: "error",
|
|
|
- // showClose: true,
|
|
|
- // message: res.data.message,
|
|
|
- // center: true,
|
|
|
- // });
|
|
|
- // }
|
|
|
+ loading.value = true;
|
|
|
+ let data = {
|
|
|
+ currentPage: currentPage.value,
|
|
|
+ pageCount: pageSize.value,
|
|
|
+ dsClsId: searchInput.dsClassValue,
|
|
|
+ dsName: searchInput.keyWord, // 数据源名称
|
|
|
+ dsStatus: searchInput.connectStatus, // 数据源状态
|
|
|
+ managerId: sessionStorage.getItem("token"),
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "get",
|
|
|
+ url: api.value + "/wanzai/api/smartDataClass/queryPageSmartDataSource",
|
|
|
+ headers: {
|
|
|
+ // token: sessionStorage.getItem("token"),
|
|
|
+ // user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ params: data,
|
|
|
+ });
|
|
|
+ // console.log(res, "数据源");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ loading.value = false;
|
|
|
+ tableData.list = res.data.data.list;
|
|
|
+ total.value = res.data.data.totalCount;
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 搜索功能
|
|
|
const searchBtn = lodash.debounce(async () => {
|
|
|
getList();
|
|
|
}, 300);
|
|
|
+
|
|
|
// 添加按钮 (-------------------------------------------)
|
|
|
const addClick = async () => {
|
|
|
titleDialog.value = "新增";
|
|
|
@@ -512,7 +396,7 @@ const addClick = async () => {
|
|
|
// }
|
|
|
};
|
|
|
|
|
|
-//编辑按钮 (-------------------------------------------)
|
|
|
+// 编辑按钮 (-------------------------------------------)
|
|
|
const editClick = async () => {
|
|
|
if (selectData.list.length == 1) {
|
|
|
titleDialog.value = "编辑";
|
|
|
@@ -631,57 +515,7 @@ const handleSelectionChange = (val) => {
|
|
|
console.log(val);
|
|
|
selectData.list = val;
|
|
|
};
|
|
|
-//导出功能
|
|
|
-// const importExcel = async () => {
|
|
|
-// if (searchInput.createTime == null) {
|
|
|
-// searchInput.createTime = "";
|
|
|
-// }
|
|
|
-// let data = new FormData();
|
|
|
-// data.set("car_number", searchInput.carnumber);
|
|
|
-// data.set("create_time", searchInput.createTime);
|
|
|
-// let res = await axios({
|
|
|
-// method: "post",
|
|
|
-// url: api.value + "/carBook/cinfotoExcel.action",
|
|
|
-// headers: {
|
|
|
-// token: sessionStorage.getItem("token"),
|
|
|
-// },
|
|
|
-// data: data,
|
|
|
-// });
|
|
|
-// // console.log(res, "导出账号");
|
|
|
-// if (res.data.code == 200) {
|
|
|
-// // const elt = document.createElement("a");
|
|
|
-// // elt.setAttribute(
|
|
|
-// // "href",
|
|
|
-// // "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
|
|
|
-// // );
|
|
|
-// // elt.setAttribute("download", "file.png");
|
|
|
-// // elt.style.display = "none";
|
|
|
-// // document.body.appendChild(elt);
|
|
|
-// // elt.click();
|
|
|
-// var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
|
|
|
-// console.log("获得地址数据:", downloadPath);
|
|
|
-// var downloadLink = document.createElement("a");
|
|
|
-// downloadLink.style.display = "none"; // 使其隐藏
|
|
|
-// downloadLink.href = downloadPath;
|
|
|
-// downloadLink.download = "";
|
|
|
-// downloadLink.click();
|
|
|
-// document.body.appendChild(downloadLink);
|
|
|
-// document.body.removeChild(downloadLink);
|
|
|
-// ElMessage({
|
|
|
-// type: "success",
|
|
|
-// showClose: true,
|
|
|
-// message: res.data.message,
|
|
|
-// center: true,
|
|
|
-// });
|
|
|
-// } else {
|
|
|
-// ElMessage({
|
|
|
-// type: "error",
|
|
|
-// showClose: true,
|
|
|
-// message: res.data.message,
|
|
|
-// center: true,
|
|
|
-// });
|
|
|
-// }
|
|
|
-// };
|
|
|
+
|
|
|
// 表格斑马纹颜色修改
|
|
|
const tableRowClassName = ({ row, rowIndex }) => {
|
|
|
if (rowIndex % 2 === 0) {
|
|
|
@@ -701,6 +535,7 @@ const handleCurrentChange = (value) => {
|
|
|
onBeforeMount(async () => {
|
|
|
api.value = store.state.user.api;
|
|
|
getList();
|
|
|
+ getDsClass();
|
|
|
});
|
|
|
onUnmounted(() => {
|
|
|
// document.removeEventListener("keyup", Enters);
|
|
|
@@ -740,10 +575,12 @@ onUnmounted(() => {
|
|
|
color: rgba(111, 182, 184, 1);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.scroll {
|
|
|
height: calc(100% - 61px);
|
|
|
overflow: auto;
|
|
|
}
|
|
|
+
|
|
|
.middle {
|
|
|
width: 96%;
|
|
|
margin: 0 auto;
|
|
|
@@ -765,9 +602,11 @@ onUnmounted(() => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin: 10px 30px 10px 0;
|
|
|
+
|
|
|
.sel {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
+
|
|
|
:deep(.el-input .el-input__inner) {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
@@ -780,6 +619,7 @@ onUnmounted(() => {
|
|
|
span {
|
|
|
color: #fff;
|
|
|
}
|
|
|
+
|
|
|
.el-button {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
@@ -849,12 +689,19 @@ onUnmounted(() => {
|
|
|
|
|
|
:deep(.el-table__row td) {
|
|
|
padding: 0;
|
|
|
+
|
|
|
// border: 0;
|
|
|
.normal {
|
|
|
background-color: rgba(139, 195, 74, 1);
|
|
|
color: #fff;
|
|
|
padding: 4px;
|
|
|
}
|
|
|
+
|
|
|
+ .abnormal {
|
|
|
+ background-color: rgba(212, 48, 48, 1);
|
|
|
+ color: #fff;
|
|
|
+ padding: 4px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.el-button--primary {
|
|
|
@@ -896,23 +743,29 @@ onUnmounted(() => {
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 编辑按钮
|
|
|
:deep(.editDialog) {
|
|
|
// height: 420px;
|
|
|
border-radius: 11px;
|
|
|
+
|
|
|
.el-dialog__header {
|
|
|
border-radius: 11px 11px 0 0;
|
|
|
background: rgba(237, 241, 245, 1);
|
|
|
font-weight: 600;
|
|
|
margin: 0;
|
|
|
+
|
|
|
.el-dialog__headerbtn {
|
|
|
outline: none;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.el-dialog__body {
|
|
|
padding: 30px 30px 10px 30px;
|
|
|
+
|
|
|
.el-form-item__content {
|
|
|
width: 200px;
|
|
|
+
|
|
|
.el-input-group__append {
|
|
|
background-color: rgba(222, 234, 252, 1);
|
|
|
color: rgba(0, 97, 255, 1);
|
|
|
@@ -920,19 +773,23 @@ onUnmounted(() => {
|
|
|
user-select: none;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.el-form {
|
|
|
.typeTitle {
|
|
|
display: block;
|
|
|
color: red;
|
|
|
margin: 0 0 6px 100px;
|
|
|
}
|
|
|
+
|
|
|
.account {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+
|
|
|
.el-form-item {
|
|
|
.el-form-item__content {
|
|
|
width: 300px;
|
|
|
}
|
|
|
+
|
|
|
.el-input {
|
|
|
width: 300px;
|
|
|
}
|
|
|
@@ -943,6 +800,7 @@ onUnmounted(() => {
|
|
|
.options {
|
|
|
margin: 50px 20px 20px 0;
|
|
|
width: 100%;
|
|
|
+
|
|
|
.el-form-item__content {
|
|
|
display: flex;
|
|
|
flex-direction: row-reverse;
|
|
|
@@ -955,6 +813,7 @@ onUnmounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 删除数据库
|
|
|
:deep(.closeAccount) {
|
|
|
// height: 600px;
|
|
|
@@ -978,6 +837,7 @@ onUnmounted(() => {
|
|
|
|
|
|
.el-dialog__body {
|
|
|
padding: 0px 20px 20px 20px;
|
|
|
+
|
|
|
// height: 200px;
|
|
|
// display: flex;
|
|
|
// flex-direction: column-reverse;
|
|
|
@@ -986,12 +846,14 @@ onUnmounted(() => {
|
|
|
font-size: 16px;
|
|
|
padding: 20px 30px;
|
|
|
display: flex;
|
|
|
+
|
|
|
img {
|
|
|
width: 25px;
|
|
|
height: 25px;
|
|
|
margin: 0 8px 0 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.option {
|
|
|
display: flex;
|
|
|
flex-direction: row-reverse;
|
|
|
@@ -1016,6 +878,7 @@ onUnmounted(() => {
|
|
|
}
|
|
|
|
|
|
.el-pagination {
|
|
|
+
|
|
|
// width: 1600px;
|
|
|
:deep(.el-pagination__total) {
|
|
|
color: #000;
|