|
|
@ -6,227 +6,210 @@
|
|
|
|
!-->
|
|
|
|
!-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div class="app-container">
|
|
|
|
<el-form ref="form"
|
|
|
|
<el-form ref="form" :model="params" :rules="rules" label-width="120px">
|
|
|
|
:model="params"
|
|
|
|
|
|
|
|
:rules="rules"
|
|
|
|
|
|
|
|
label-width="120px">
|
|
|
|
|
|
|
|
<!-- 搜索 -->
|
|
|
|
<!-- 搜索 -->
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4">
|
|
|
|
:sm="20"
|
|
|
|
|
|
|
|
:md="12"
|
|
|
|
|
|
|
|
:lg="6"
|
|
|
|
|
|
|
|
:xl="4">
|
|
|
|
|
|
|
|
<el-form-item label="数据源名称">
|
|
|
|
<el-form-item label="数据源名称">
|
|
|
|
<el-input v-model.trim="params.sourceName"
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model.trim="params.sourceName"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
placeholder="数据源名称"
|
|
|
|
placeholder="数据源名称"
|
|
|
|
class="filter-item"
|
|
|
|
class="filter-item"
|
|
|
|
@keyup.enter.native="crud.toQuery" />
|
|
|
|
@keyup.enter.native="crud.toQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4">
|
|
|
|
:sm="20"
|
|
|
|
|
|
|
|
:md="12"
|
|
|
|
|
|
|
|
:lg="6"
|
|
|
|
|
|
|
|
:xl="4">
|
|
|
|
|
|
|
|
<el-form-item label="数据源编码">
|
|
|
|
<el-form-item label="数据源编码">
|
|
|
|
<el-input v-model.trim="params.sourceCode"
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model.trim="params.sourceCode"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
placeholder="数据源Code"
|
|
|
|
placeholder="数据源Code"
|
|
|
|
class="filter-item"
|
|
|
|
class="filter-item"
|
|
|
|
@keyup.enter.native="crud.toQuery" />
|
|
|
|
@keyup.enter.native="crud.toQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4" class="query">
|
|
|
|
:sm="20"
|
|
|
|
<el-form-item label="数据源类型" size="mini">
|
|
|
|
:md="12"
|
|
|
|
<Dictionary
|
|
|
|
:lg="6"
|
|
|
|
v-model="params.sourceType"
|
|
|
|
:xl="4">
|
|
|
|
|
|
|
|
<el-form-item label="数据源类型"
|
|
|
|
|
|
|
|
size="mini">
|
|
|
|
|
|
|
|
<Dictionary v-model="params.sourceType"
|
|
|
|
|
|
|
|
:updata-dict="params.sourceType"
|
|
|
|
:updata-dict="params.sourceType"
|
|
|
|
:dict-key="'SOURCE_TYPE'" />
|
|
|
|
:dict-key="'SOURCE_TYPE'"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="4" :lg="4" :xl="4" class="query">
|
|
|
|
:sm="20"
|
|
|
|
<el-button type="primary" size="mini" @click="search('form')"
|
|
|
|
:md="4"
|
|
|
|
>查询</el-button
|
|
|
|
:lg="4"
|
|
|
|
>
|
|
|
|
:xl="4">
|
|
|
|
<el-button type="danger" size="mini" @click="reset('form')"
|
|
|
|
<el-button type="primary"
|
|
|
|
>重置</el-button
|
|
|
|
size="mini"
|
|
|
|
>
|
|
|
|
@click="search('form')">查询</el-button>
|
|
|
|
|
|
|
|
<el-button type="danger"
|
|
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
|
|
@click="reset('form')">重置</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<el-button type="primary"
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
type="primary"
|
|
|
|
icon="el-icon-plus"
|
|
|
|
icon="el-icon-plus"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="showAddLogModel()">新增</el-button>
|
|
|
|
@click="showAddLogModel()"
|
|
|
|
|
|
|
|
>新增</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
<!--表格渲染-->
|
|
|
|
<!--表格渲染-->
|
|
|
|
<el-table v-loading="listLoading"
|
|
|
|
<el-table
|
|
|
|
|
|
|
|
v-loading="listLoading"
|
|
|
|
border
|
|
|
|
border
|
|
|
|
:data="list"
|
|
|
|
:data="list"
|
|
|
|
class="mt10"
|
|
|
|
class="mt10"
|
|
|
|
element-loading-text="Loading"
|
|
|
|
element-loading-text="Loading"
|
|
|
|
style="width: 100%">
|
|
|
|
style="width: 100%"
|
|
|
|
<el-table-column align="center"
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
label="序号"
|
|
|
|
label="序号"
|
|
|
|
type="index"
|
|
|
|
type="index"
|
|
|
|
min-width="40" />
|
|
|
|
min-width="40"
|
|
|
|
<el-table-column prop="sourceType"
|
|
|
|
/>
|
|
|
|
label="数据源类型" />
|
|
|
|
<el-table-column prop="sourceType" label="数据源类型" />
|
|
|
|
<el-table-column prop="sourceNameCode"
|
|
|
|
<el-table-column prop="sourceNameCode" label="数据源名称[编码]" />
|
|
|
|
label="数据源名称[编码]" />
|
|
|
|
<el-table-column prop="sourceDesc" label="数据源描述" />
|
|
|
|
<el-table-column prop="sourceDesc"
|
|
|
|
<el-table-column prop="createBy" label="创建人" width="100" />
|
|
|
|
label="数据源描述" />
|
|
|
|
<el-table-column prop="createTime" label="创建时间" width="140" />
|
|
|
|
<el-table-column prop="createBy"
|
|
|
|
<el-table-column prop="updateBy" label="修改人" width="100" />
|
|
|
|
label="创建人"
|
|
|
|
<el-table-column prop="updateTime" label="修改时间" width="140" />
|
|
|
|
width="100" />
|
|
|
|
<el-table-column label="操作" width="120px" align="center">
|
|
|
|
<el-table-column prop="createTime"
|
|
|
|
|
|
|
|
label="创建时间"
|
|
|
|
|
|
|
|
width="140" />
|
|
|
|
|
|
|
|
<el-table-column prop="updateBy"
|
|
|
|
|
|
|
|
label="修改人"
|
|
|
|
|
|
|
|
width="100" />
|
|
|
|
|
|
|
|
<el-table-column prop="updateTime"
|
|
|
|
|
|
|
|
label="修改时间"
|
|
|
|
|
|
|
|
width="140" />
|
|
|
|
|
|
|
|
<el-table-column label="操作"
|
|
|
|
|
|
|
|
width="120px"
|
|
|
|
|
|
|
|
align="center">
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button type="text"
|
|
|
|
<el-button type="text" @click="showAddLogModel(scope.row)"
|
|
|
|
@click="showAddLogModel(scope.row)">编辑</el-button>
|
|
|
|
>编辑</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
<!-- <el-popconfirm :title="'确定删除' + scope.row.sourceNameCode + '吗?'"
|
|
|
|
<!-- <el-popconfirm :title="'确定删除' + scope.row.sourceNameCode + '吗?'"
|
|
|
|
@onConfirm="delData(scope.row)"> -->
|
|
|
|
@onConfirm="delData(scope.row)"> -->
|
|
|
|
<el-button slot="reference"
|
|
|
|
<el-button slot="reference" @click="delData(scope.row)" type="text"
|
|
|
|
@click="delData(scope.row)"
|
|
|
|
>删除</el-button
|
|
|
|
type="text">删除</el-button>
|
|
|
|
>
|
|
|
|
<!-- </el-popconfirm> -->
|
|
|
|
<!-- </el-popconfirm> -->
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
<div class="block">
|
|
|
|
<div class="block">
|
|
|
|
<el-pagination :total="totalCount"
|
|
|
|
<el-pagination
|
|
|
|
|
|
|
|
:total="totalCount"
|
|
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
|
|
:page-size="params.pageSize"
|
|
|
|
:page-size="params.pageSize"
|
|
|
|
:current-page="params.pageNumber"
|
|
|
|
:current-page="params.pageNumber"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
@current-change="handleCurrentChange" />
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!--表单组件-->
|
|
|
|
<!--表单组件-->
|
|
|
|
<el-dialog title="项目基础配置"
|
|
|
|
<el-dialog
|
|
|
|
|
|
|
|
title="项目基础配置"
|
|
|
|
width="50%"
|
|
|
|
width="50%"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
center
|
|
|
|
center
|
|
|
|
:visible.sync="basicDialog"
|
|
|
|
:visible.sync="basicDialog"
|
|
|
|
@close="closeDialog">
|
|
|
|
@close="closeDialog"
|
|
|
|
<el-form ref="userForm"
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
|
|
ref="userForm"
|
|
|
|
:model="dialogForm"
|
|
|
|
:model="dialogForm"
|
|
|
|
:rules="rules"
|
|
|
|
:rules="rules"
|
|
|
|
size="small"
|
|
|
|
size="small"
|
|
|
|
label-width="100px">
|
|
|
|
label-width="100px"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="6" :lg="6" :xl="6">
|
|
|
|
:sm="20"
|
|
|
|
<el-form-item label="数据源类型" prop="sourceType">
|
|
|
|
:md="6"
|
|
|
|
<el-select
|
|
|
|
:lg="6"
|
|
|
|
v-model.trim="dialogForm.sourceType"
|
|
|
|
:xl="6">
|
|
|
|
|
|
|
|
<el-form-item label="数据源类型"
|
|
|
|
|
|
|
|
prop="sourceType">
|
|
|
|
|
|
|
|
<el-select v-model.trim="dialogForm.sourceType"
|
|
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
placeholder="请选择"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
@change="selectChange">
|
|
|
|
@change="selectChange"
|
|
|
|
<el-option v-for="item in dictionaryOptions"
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="item in dictionaryOptions"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
:label="item.text"
|
|
|
|
:label="item.text"
|
|
|
|
:value="item.id" />
|
|
|
|
:value="item.id"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="7" :lg="7" :xl="7">
|
|
|
|
:sm="20"
|
|
|
|
<el-form-item label="数据源编码" prop="sourceCode">
|
|
|
|
:md="7"
|
|
|
|
<el-input
|
|
|
|
:lg="7"
|
|
|
|
:disabled="updataDisabled"
|
|
|
|
:xl="7">
|
|
|
|
v-model.trim="dialogForm.sourceCode"
|
|
|
|
<el-form-item label="数据源编码"
|
|
|
|
/>
|
|
|
|
prop="sourceCode"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-input :disabled="updataDisabled" v-model.trim="dialogForm.sourceCode" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="7" :lg="7" :xl="7">
|
|
|
|
:sm="20"
|
|
|
|
<el-form-item label="数据源名称" prop="sourceName">
|
|
|
|
:md="7"
|
|
|
|
|
|
|
|
:lg="7"
|
|
|
|
|
|
|
|
:xl="7">
|
|
|
|
|
|
|
|
<el-form-item label="数据源名称"
|
|
|
|
|
|
|
|
prop="sourceName">
|
|
|
|
|
|
|
|
<el-input v-model.trim="dialogForm.sourceName" />
|
|
|
|
<el-input v-model.trim="dialogForm.sourceName" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xs="24"
|
|
|
|
<el-col :xs="24" :sm="20" :md="20" :lg="20" :xl="20">
|
|
|
|
:sm="20"
|
|
|
|
|
|
|
|
:md="20"
|
|
|
|
|
|
|
|
:lg="20"
|
|
|
|
|
|
|
|
:xl="20">
|
|
|
|
|
|
|
|
<el-form-item label="数据源描述">
|
|
|
|
<el-form-item label="数据源描述">
|
|
|
|
<el-input v-model.trim="dialogForm.sourceDesc"
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model.trim="dialogForm.sourceDesc"
|
|
|
|
type="textarea"
|
|
|
|
type="textarea"
|
|
|
|
:autosize="{ minRows: 2, maxRows: 4 }" />
|
|
|
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-row :gutter="10">
|
|
|
|
<el-col v-for="(data, index) in dataLink"
|
|
|
|
<el-col
|
|
|
|
|
|
|
|
v-for="(data, index) in dataLink"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
:xs="24"
|
|
|
|
:xs="24"
|
|
|
|
:sm="20"
|
|
|
|
:sm="20"
|
|
|
|
:md="20"
|
|
|
|
:md="20"
|
|
|
|
:lg="20"
|
|
|
|
:lg="20"
|
|
|
|
:xl="20">
|
|
|
|
:xl="20"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-form-item :label="data.labelValue">
|
|
|
|
<el-form-item :label="data.labelValue">
|
|
|
|
<el-input v-model.trim="data.value" />
|
|
|
|
<el-input v-model.trim="data.value" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer"
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button @click="closeDialog">取消</el-button>
|
|
|
|
<el-button @click="closeDialog">取消</el-button>
|
|
|
|
<el-button type="warning"
|
|
|
|
<el-button type="warning" @click="test">测试</el-button>
|
|
|
|
@click="test">测试</el-button>
|
|
|
|
<el-button type="primary" @click="UserConfirm('userForm')"
|
|
|
|
<el-button type="primary"
|
|
|
|
>确定</el-button
|
|
|
|
@click="UserConfirm('userForm')">确定</el-button>
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { pageList, testConnection, addDataSource, editDataSource, deleteDataSource } from '@/api/report'
|
|
|
|
import {
|
|
|
|
import { getDictList } from '@/api/dict-data' // 获取数据字典
|
|
|
|
pageList,
|
|
|
|
import Dictionary from '@/components/Dictionary/index'
|
|
|
|
testConnection,
|
|
|
|
|
|
|
|
addDataSource,
|
|
|
|
|
|
|
|
editDataSource,
|
|
|
|
|
|
|
|
deleteDataSource
|
|
|
|
|
|
|
|
} from "@/api/report";
|
|
|
|
|
|
|
|
import { getDictList } from "@/api/dict-data"; // 获取数据字典
|
|
|
|
|
|
|
|
import Dictionary from "@/components/Dictionary/index";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'Support',
|
|
|
|
name: "Support",
|
|
|
|
components: { Dictionary },
|
|
|
|
components: { Dictionary },
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
dictionaryOptions: [], // 数据源类型
|
|
|
|
dictionaryOptions: [], // 数据源类型
|
|
|
|
selectedList: [],
|
|
|
|
selectedList: [],
|
|
|
|
clickType: '',
|
|
|
|
clickType: "",
|
|
|
|
formData: {},
|
|
|
|
formData: {},
|
|
|
|
list: null,
|
|
|
|
list: null,
|
|
|
|
totalCount: 0,
|
|
|
|
totalCount: 0,
|
|
|
@ -236,201 +219,206 @@ export default {
|
|
|
|
dialogFormVisible: false,
|
|
|
|
dialogFormVisible: false,
|
|
|
|
basicDialog: false,
|
|
|
|
basicDialog: false,
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
sourceName: '',
|
|
|
|
sourceName: "",
|
|
|
|
sourceCode: '',
|
|
|
|
sourceCode: "",
|
|
|
|
sourceType: '',
|
|
|
|
sourceType: "",
|
|
|
|
pageNumber: 1,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
order: 'DESC',
|
|
|
|
order: "DESC",
|
|
|
|
sort: 'update_time',
|
|
|
|
sort: "update_time"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
dialogForm: {
|
|
|
|
dialogForm: {
|
|
|
|
sourceName: '',
|
|
|
|
sourceName: "",
|
|
|
|
sourceCode: '',
|
|
|
|
sourceCode: "",
|
|
|
|
sourceType: '',
|
|
|
|
sourceType: "",
|
|
|
|
sourceDesc: '',
|
|
|
|
sourceDesc: "",
|
|
|
|
sourceConfig: '',
|
|
|
|
sourceConfig: ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
dataLink: [],
|
|
|
|
dataLink: [],
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
sourceType: [{ required: true, message: '数据集名称必选', trigger: 'change' }],
|
|
|
|
sourceType: [
|
|
|
|
sourceCode: [{ required: true, message: '数据集编码必填', trigger: 'blur' }],
|
|
|
|
{ required: true, message: "数据集名称必选", trigger: "change" }
|
|
|
|
sourceName: [{ required: true, message: '数据源名称必选', trigger: 'blur' }],
|
|
|
|
],
|
|
|
|
|
|
|
|
sourceCode: [
|
|
|
|
|
|
|
|
{ required: true, message: "数据集编码必填", trigger: "blur" }
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
sourceName: [
|
|
|
|
|
|
|
|
{ required: true, message: "数据源名称必选", trigger: "blur" }
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
value: '',
|
|
|
|
value: "",
|
|
|
|
updataDisabled: false,
|
|
|
|
updataDisabled: false,
|
|
|
|
testReplyCode: null
|
|
|
|
testReplyCode: null
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {},
|
|
|
|
watch: {},
|
|
|
|
// 在生命周期 beforeCreate里面改变this指向
|
|
|
|
// 在生命周期 beforeCreate里面改变this指向
|
|
|
|
beforeCreate: function() {},
|
|
|
|
beforeCreate: function() {},
|
|
|
|
mounted() {},
|
|
|
|
mounted() {},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getSystem()
|
|
|
|
this.getSystem();
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
// 查询
|
|
|
|
// 查询
|
|
|
|
search() {
|
|
|
|
search() {
|
|
|
|
this.params.pageNumber = 1
|
|
|
|
this.params.pageNumber = 1;
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 重置
|
|
|
|
// 重置
|
|
|
|
reset(formName) {
|
|
|
|
reset(formName) {
|
|
|
|
// this.$refs[formName].resetFields()
|
|
|
|
// this.$refs[formName].resetFields()
|
|
|
|
this.params.sourceName = ''
|
|
|
|
this.params.sourceName = "";
|
|
|
|
this.params.sourceCode = ''
|
|
|
|
this.params.sourceCode = "";
|
|
|
|
this.params.pageNumber = 1
|
|
|
|
this.params.pageNumber = 1;
|
|
|
|
this.params.sourceType = ''
|
|
|
|
this.params.sourceType = "";
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async queryByPage() {
|
|
|
|
async queryByPage() {
|
|
|
|
const res = await pageList(this.params)
|
|
|
|
const res = await pageList(this.params);
|
|
|
|
if (res.code != '200') return
|
|
|
|
if (res.code != "200") return;
|
|
|
|
this.listLoading = true
|
|
|
|
this.listLoading = true;
|
|
|
|
this.list = res.data.records
|
|
|
|
this.list = res.data.records;
|
|
|
|
this.list.forEach((value) => {
|
|
|
|
this.list.forEach(value => {
|
|
|
|
value['sourceNameCode'] = value.sourceName + '[' + value.sourceCode + ']'
|
|
|
|
value["sourceNameCode"] =
|
|
|
|
})
|
|
|
|
value.sourceName + "[" + value.sourceCode + "]";
|
|
|
|
this.totalCount = res.data.total
|
|
|
|
});
|
|
|
|
this.totalPage = res.data.pages
|
|
|
|
this.totalCount = res.data.total;
|
|
|
|
this.listLoading = false
|
|
|
|
this.totalPage = res.data.pages;
|
|
|
|
|
|
|
|
this.listLoading = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleSizeChange(val) {
|
|
|
|
handleSizeChange(val) {
|
|
|
|
this.params.pageSize = val
|
|
|
|
this.params.pageSize = val;
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
this.params.pageNumber = val
|
|
|
|
this.params.pageNumber = val;
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 关闭模态框
|
|
|
|
// 关闭模态框
|
|
|
|
closeDialog(bool) {
|
|
|
|
closeDialog(bool) {
|
|
|
|
// bool && this.search('form') // 点确定关闭弹窗的时候才会刷新列表
|
|
|
|
// bool && this.search('form') // 点确定关闭弹窗的时候才会刷新列表
|
|
|
|
// this.$refs['userForm'].resetFields()
|
|
|
|
// this.$refs['userForm'].resetFields()
|
|
|
|
this.basicDialog = false
|
|
|
|
this.basicDialog = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 打开模态框
|
|
|
|
// 打开模态框
|
|
|
|
showAddLogModel(val) {
|
|
|
|
showAddLogModel(val) {
|
|
|
|
this.basicDialog = true
|
|
|
|
this.basicDialog = true;
|
|
|
|
if (val == undefined) {
|
|
|
|
if (val == undefined) {
|
|
|
|
this.updataDisabled = false
|
|
|
|
this.updataDisabled = false;
|
|
|
|
this.getSystem()
|
|
|
|
this.getSystem();
|
|
|
|
this.dialogForm = {
|
|
|
|
this.dialogForm = {
|
|
|
|
sourceName: '',
|
|
|
|
sourceName: "",
|
|
|
|
sourceCode: '',
|
|
|
|
sourceCode: "",
|
|
|
|
sourceType: '',
|
|
|
|
sourceType: "",
|
|
|
|
sourceDesc: '',
|
|
|
|
sourceDesc: "",
|
|
|
|
sourceConfig: '',
|
|
|
|
sourceConfig: ""
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.updataDisabled = true
|
|
|
|
this.updataDisabled = true;
|
|
|
|
this.dialogForm = val
|
|
|
|
this.dialogForm = val;
|
|
|
|
const newSourceType = this.dialogForm
|
|
|
|
const newSourceType = this.dialogForm;
|
|
|
|
let newDataLink = []
|
|
|
|
let newDataLink = [];
|
|
|
|
this.dictionaryOptions.map((item) => {
|
|
|
|
this.dictionaryOptions.map(item => {
|
|
|
|
if (item.id == newSourceType.sourceType) {
|
|
|
|
if (item.id == newSourceType.sourceType) {
|
|
|
|
newDataLink = JSON.parse(item.extend)
|
|
|
|
newDataLink = JSON.parse(item.extend);
|
|
|
|
var sourceConfigJson = JSON.parse(newSourceType.sourceConfig)
|
|
|
|
var sourceConfigJson = JSON.parse(newSourceType.sourceConfig);
|
|
|
|
for (var i = 0; i < newDataLink.length; i++) {
|
|
|
|
for (var i = 0; i < newDataLink.length; i++) {
|
|
|
|
newDataLink[i].value = sourceConfigJson[newDataLink[i].label]
|
|
|
|
newDataLink[i].value = sourceConfigJson[newDataLink[i].label];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.dataLink = newDataLink
|
|
|
|
this.dataLink = newDataLink;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 获取数据字典
|
|
|
|
// 获取数据字典
|
|
|
|
async getSystem() {
|
|
|
|
async getSystem() {
|
|
|
|
const { code, data } = await getDictList('SOURCE_TYPE')
|
|
|
|
const { code, data } = await getDictList("SOURCE_TYPE");
|
|
|
|
if (code != '200') return
|
|
|
|
if (code != "200") return;
|
|
|
|
this.dictionaryOptions = data
|
|
|
|
this.dictionaryOptions = data;
|
|
|
|
this.dialogForm.sourceType = this.dictionaryOptions[0].text
|
|
|
|
this.dialogForm.sourceType = this.dictionaryOptions[0].text;
|
|
|
|
this.dataLink = JSON.parse(this.dictionaryOptions[0].extend)
|
|
|
|
this.dataLink = JSON.parse(this.dictionaryOptions[0].extend);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selectChange(val) {
|
|
|
|
selectChange(val) {
|
|
|
|
this.dataLink = []
|
|
|
|
this.dataLink = [];
|
|
|
|
const extendJSON = this.dictionaryOptions.find(function(obj) {
|
|
|
|
const extendJSON = this.dictionaryOptions.find(function(obj) {
|
|
|
|
return obj.id == val
|
|
|
|
return obj.id == val;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.dataLink = JSON.parse(extendJSON.extend)
|
|
|
|
this.dataLink = JSON.parse(extendJSON.extend);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 测试
|
|
|
|
// 测试
|
|
|
|
test() {
|
|
|
|
test() {
|
|
|
|
const newList = {}
|
|
|
|
const newList = {};
|
|
|
|
this.dataLink.forEach((item) => {
|
|
|
|
this.dataLink.forEach(item => {
|
|
|
|
newList[item.label] = item.value
|
|
|
|
newList[item.label] = item.value;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.dialogForm.sourceConfig = JSON.stringify(newList)
|
|
|
|
this.dialogForm.sourceConfig = JSON.stringify(newList);
|
|
|
|
testConnection(this.dialogForm).then((data) => {
|
|
|
|
testConnection(this.dialogForm).then(data => {
|
|
|
|
if (data.code == '200') {
|
|
|
|
if (data.code == "200") {
|
|
|
|
this.testReplyCode = data.code;
|
|
|
|
this.testReplyCode = data.code;
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '测试成功!',
|
|
|
|
message: "测试成功!",
|
|
|
|
type: 'success'
|
|
|
|
type: "success"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.testReplyCode = null
|
|
|
|
this.testReplyCode = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async delData(val) {
|
|
|
|
async delData(val) {
|
|
|
|
this.$confirm('确定删除?', '提示', {
|
|
|
|
this.$confirm("确定删除?", "提示", {
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
type: 'warning',
|
|
|
|
type: "warning"
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then(async () => {
|
|
|
|
.then(async () => {
|
|
|
|
this.$emit('deletelayer')
|
|
|
|
this.$emit("deletelayer");
|
|
|
|
this.visible = false
|
|
|
|
this.visible = false;
|
|
|
|
const { code, data } = await deleteDataSource(val)
|
|
|
|
const { code, data } = await deleteDataSource(val);
|
|
|
|
if (code != '200') return
|
|
|
|
if (code != "200") return;
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
type: 'success',
|
|
|
|
type: "success",
|
|
|
|
message: '删除成功!',
|
|
|
|
message: "删除成功!"
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
.catch(() => {
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
type: 'info',
|
|
|
|
type: "info",
|
|
|
|
message: '已取消删除',
|
|
|
|
message: "已取消删除"
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 提交
|
|
|
|
// 提交
|
|
|
|
async UserConfirm(formName) {
|
|
|
|
async UserConfirm(formName) {
|
|
|
|
const newList = {}
|
|
|
|
const newList = {};
|
|
|
|
this.dataLink.forEach((item) => {
|
|
|
|
this.dataLink.forEach(item => {
|
|
|
|
newList[item.label] = item.value
|
|
|
|
newList[item.label] = item.value;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.dialogForm.sourceConfig = JSON.stringify(newList)
|
|
|
|
this.dialogForm.sourceConfig = JSON.stringify(newList);
|
|
|
|
this.$refs[formName].validate(async (valid, obj) => {
|
|
|
|
this.$refs[formName].validate(async (valid, obj) => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
if (this.testReplyCode != '200') {
|
|
|
|
if (this.testReplyCode != "200") {
|
|
|
|
this.$message.error("测试结果为成功后方可保存!")
|
|
|
|
this.$message.error("测试结果为成功后方可保存!");
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.dialogForm.id == undefined) {
|
|
|
|
if (this.dialogForm.id == undefined) {
|
|
|
|
const { code } = await addDataSource(this.dialogForm)
|
|
|
|
const { code } = await addDataSource(this.dialogForm);
|
|
|
|
if (code != '200') return
|
|
|
|
if (code != "200") return;
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const { code } = await editDataSource(this.dialogForm)
|
|
|
|
const { code } = await editDataSource(this.dialogForm);
|
|
|
|
if (code != '200') return
|
|
|
|
if (code != "200") return;
|
|
|
|
this.queryByPage()
|
|
|
|
this.queryByPage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.closeDialog(false)
|
|
|
|
this.closeDialog(false);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.title {
|
|
|
|
.title {
|
|
|
@ -438,4 +426,7 @@ export default {
|
|
|
|
display: inline-block;
|
|
|
|
display: inline-block;
|
|
|
|
text-align: left;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.query {
|
|
|
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|