查询升级
This commit is contained in:
parent
f261d485a9
commit
788cd2c0d2
|
|
@ -95,6 +95,7 @@ export function addCreateDateRange(params, dateRange) {
|
||||||
|
|
||||||
// 回显数据字典
|
// 回显数据字典
|
||||||
export function selectDictLabel(datas, value) {
|
export function selectDictLabel(datas, value) {
|
||||||
|
console.log(datas)
|
||||||
let actions = [];
|
let actions = [];
|
||||||
Object.keys(datas).some((key) => {
|
Object.keys(datas).some((key) => {
|
||||||
if (datas[key].dictValue === ('' + value)) {
|
if (datas[key].dictValue === ('' + value)) {
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
<el-input v-model="scope.row.label"></el-input>
|
<el-input v-model="scope.row.label"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="字典类型" min-width="10%">
|
<el-table-column label="显示字典类型" min-width="10%">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择">
|
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-dialog :title="selectedNodeParams.label" width="1200px"
|
<el-dialog :title="selectedNodeParams.label" width="1300px"
|
||||||
:visible.sync="tableColumnEditOpen"
|
:visible.sync="tableColumnEditOpen"
|
||||||
@close="closeEditColumns">
|
@close="closeEditColumns">
|
||||||
<el-table
|
<el-table
|
||||||
|
|
@ -203,7 +203,8 @@
|
||||||
<el-input v-model="scope.row.ucName" placeholder="请输入条件描述"/>
|
<el-input v-model="scope.row.ucName" placeholder="请输入条件描述"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="条件">
|
<el-table-column label="条件"
|
||||||
|
width="150px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.ucCon" @change="ucTypeChang(scope.$index,scope.row)">
|
<el-select v-model="scope.row.ucCon" @change="ucTypeChang(scope.$index,scope.row)">
|
||||||
<el-option label="=" value="EQ"/>
|
<el-option label="=" value="EQ"/>
|
||||||
|
|
@ -217,7 +218,8 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="显示类型">
|
<el-table-column label="显示类型"
|
||||||
|
width="150px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.ucType" @change="ucTypeChang(scope.$index,scope.row)">
|
<el-select v-model="scope.row.ucType" @change="ucTypeChang(scope.$index,scope.row)">
|
||||||
<el-option label="文本框" value="input"/>
|
<el-option label="文本框" value="input"/>
|
||||||
|
|
@ -225,7 +227,8 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="模拟数据">
|
<el-table-column label="模拟数据"
|
||||||
|
width="260px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-if="scope.row.type == 1" placeholder="请输入模拟数据" v-model="scope.row.ucMock"></el-input>
|
<el-input v-if="scope.row.type == 1" placeholder="请输入模拟数据" v-model="scope.row.ucMock"></el-input>
|
||||||
<div v-else-if="scope.row.type == 2">
|
<div v-else-if="scope.row.type == 2">
|
||||||
|
|
@ -258,6 +261,20 @@
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="显示字典类型" width="150px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dictTypeList"
|
||||||
|
:key="dict.dictType"
|
||||||
|
:label="dict.dictName"
|
||||||
|
:value="dict.dictType">
|
||||||
|
<span style="float: left">{{ dict.dictName }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -325,6 +342,7 @@ export default {
|
||||||
nodes: [],
|
nodes: [],
|
||||||
edges: []
|
edges: []
|
||||||
},
|
},
|
||||||
|
dictTypeList:[],
|
||||||
// 表格Column设置弹窗开关
|
// 表格Column设置弹窗开关
|
||||||
tableColumnEditOpen:false,
|
tableColumnEditOpen:false,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
@ -332,11 +350,6 @@ export default {
|
||||||
clientHeight: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
|
clientHeight: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
|
||||||
//todo 设置线段的选择 er图中只有一种线
|
//todo 设置线段的选择 er图中只有一种线
|
||||||
edgeShapeList: [
|
edgeShapeList: [
|
||||||
// { guid: "top-line", label: "直线", class: "iconfont icon-flow-line" },
|
|
||||||
// { guid: "dice-er-edge", label: "连线", class: "iconfont icon-flow-line" },
|
|
||||||
// { guid: "top-brokenline", label: "折线", class: "iconfont icon-flow-broken" },
|
|
||||||
// { guid: "top-polyline", label: "多段线", class: "iconfont icon-flow-broken" },
|
|
||||||
// { guid: "top-cubic", label: "曲线", class: "iconfont icon-flow-curve" }
|
|
||||||
],
|
],
|
||||||
graph: null,
|
graph: null,
|
||||||
grid: null,
|
grid: null,
|
||||||
|
|
@ -510,7 +523,6 @@ export default {
|
||||||
// 修改字段信息
|
// 修改字段信息
|
||||||
editColumns() {
|
editColumns() {
|
||||||
this.tableColumnEditOpen = true
|
this.tableColumnEditOpen = true
|
||||||
|
|
||||||
},
|
},
|
||||||
// 连线的三个选择框触发实践
|
// 连线的三个选择框触发实践
|
||||||
tableCommentChang(e) {
|
tableCommentChang(e) {
|
||||||
|
|
@ -583,6 +595,9 @@ export default {
|
||||||
},
|
},
|
||||||
dragendHandler() {
|
dragendHandler() {
|
||||||
},
|
},
|
||||||
|
tranDictData(list){
|
||||||
|
this.dictTypeList = list
|
||||||
|
},
|
||||||
initTopo(graphData) {
|
initTopo(graphData) {
|
||||||
let self = this
|
let self = this
|
||||||
if (self.graph) {
|
if (self.graph) {
|
||||||
|
|
@ -1162,6 +1177,7 @@ export default {
|
||||||
item.type = 1
|
item.type = 1
|
||||||
item.ucMock = ''
|
item.ucMock = ''
|
||||||
item.ucName = item.columnComment
|
item.ucName = item.columnComment
|
||||||
|
item.dictType = null
|
||||||
columns.push(item)
|
columns.push(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,23 +80,21 @@
|
||||||
<right-toolbar :showSearch.sync="previewDate.showSearch" @queryTable="handleQuery"></right-toolbar>
|
<right-toolbar :showSearch.sync="previewDate.showSearch" @queryTable="handleQuery"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="previewDate.data">
|
<el-table :data="previewDate.data">
|
||||||
<span v-for="(item,index) in previewDate.header">
|
<el-table-column v-for="(item,index) in previewDate.header"
|
||||||
<el-table-column v-if="checkDateType(item.prop)"
|
:label="item.label"
|
||||||
:label="item.label"
|
align="center"
|
||||||
align="center"
|
:key="index"
|
||||||
:key="index"
|
:prop="item.prop">
|
||||||
:prop="item.prop">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
<span v-if="checkDateType(item.prop)">
|
||||||
{{ parseDateOrTime(scope.row[item.prop]) }}
|
{{ parseDateOrTime(scope.row[item.prop]) }}
|
||||||
</template>
|
</span>
|
||||||
</el-table-column>
|
<span v-else-if="item.dictType!=null">
|
||||||
<el-table-column v-else
|
{{ dictFormat(item.dictType, scope.row[item.prop]) }}
|
||||||
:label="item.label"
|
</span>
|
||||||
align="center"
|
<span v-else>{{ scope.row[item.prop] }}</span>
|
||||||
:key="index"
|
</template>
|
||||||
:prop="item.prop"
|
</el-table-column>
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="previewDate.total>0"
|
v-show="previewDate.total>0"
|
||||||
|
|
@ -113,13 +111,15 @@
|
||||||
<script>
|
<script>
|
||||||
/* 局部注册 */
|
/* 局部注册 */
|
||||||
import Topology from './packages/topology/src/topology'
|
import Topology from './packages/topology/src/topology'
|
||||||
import { deepClone } from './utils/index'
|
import {deepClone} from './utils/index'
|
||||||
import { getQuery, getTables, updateQuery, preview } from '@/api/tool/top'
|
import {getQuery, getTables, updateQuery, preview} from '@/api/tool/top'
|
||||||
import { realData } from '@/api/system/data'
|
import {realData} from '@/api/system/data'
|
||||||
import { exportReal } from '../../../api/system/data'
|
import {exportReal} from '@/api/system/data'
|
||||||
|
import {optionSelect} from "@/api/system/dict/type";
|
||||||
import {eventBus} from "@/views/tool/top/utils/eventBus";
|
import {eventBus} from "@/views/tool/top/utils/eventBus";
|
||||||
import {Release} from "@/api/tool/query";
|
import {Release} from "@/api/tool/query";
|
||||||
import {Message} from "element-ui";
|
import {Message} from "element-ui";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DemoTopology',
|
name: 'DemoTopology',
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -162,14 +162,15 @@ export default {
|
||||||
tableComment: '主表字段',
|
tableComment: '主表字段',
|
||||||
relComment: '关联字段'
|
relComment: '关联字段'
|
||||||
},
|
},
|
||||||
autoRefreshTimer: null
|
autoRefreshTimer: null,
|
||||||
|
dictTypeDataList: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.topId = this.$route.params && this.$route.params.topId
|
this.topId = this.$route.params && this.$route.params.topId
|
||||||
getQuery(this.topId).then(res => {
|
getQuery(this.topId).then(res => {
|
||||||
this.baseData = res.data
|
this.baseData = res.data
|
||||||
eventBus.$emit('isRelease',this.baseData.isRelease)
|
eventBus.$emit('isRelease', this.baseData.isRelease)
|
||||||
|
|
||||||
console.log(res.data)
|
console.log(res.data)
|
||||||
if (res.data.topJson) {
|
if (res.data.topJson) {
|
||||||
|
|
@ -189,8 +190,29 @@ export default {
|
||||||
this.nodeTypeList = res.data.tables
|
this.nodeTypeList = res.data.tables
|
||||||
this.relationalMap = res.data.relationalMap
|
this.relationalMap = res.data.relationalMap
|
||||||
})
|
})
|
||||||
|
optionSelect().then(res => {
|
||||||
|
this.$refs.topology.tranDictData(res.data)
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// todo 异步请求问题 字典状态字典翻译
|
||||||
|
dictFormat: async function(dictType, data) {
|
||||||
|
console.log("请求开始",dictType, !this.dictTypeDataList[dictType])
|
||||||
|
if (!this.dictTypeDataList[dictType]) {
|
||||||
|
this.dictTypeDataList[dictType] = {}
|
||||||
|
await this.getDicts(dictType).then(res => {
|
||||||
|
this.dictTypeDataList[dictType] = res.data
|
||||||
|
console.log("请求响应",res.data)
|
||||||
|
console.log("数据集",this.dictTypeDataList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log('准备执行字段渲染',this.dictTypeDataList[dictType], data)
|
||||||
|
let res = this.selectDictLabel(this.dictTypeDataList[dictType], data + '')
|
||||||
|
console.log(res,"rses")
|
||||||
|
return res;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 重置
|
* 重置
|
||||||
*/
|
*/
|
||||||
|
|
@ -206,7 +228,7 @@ export default {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function() {
|
}).then(function () {
|
||||||
let data = {
|
let data = {
|
||||||
id: that.topId,
|
id: that.topId,
|
||||||
uniCons: that.previewDate.uconList
|
uniCons: that.previewDate.uconList
|
||||||
|
|
@ -265,11 +287,11 @@ export default {
|
||||||
},
|
},
|
||||||
changeOnLine(release) {
|
changeOnLine(release) {
|
||||||
let that = this
|
let that = this
|
||||||
this.$confirm(release === 1?'请确认top图结构无误并预览结果无误后上线?':'请确认是否撤销当前发布内容!', '警告', {
|
this.$confirm(release === 1 ? '请确认top图结构无误并预览结果无误后上线?' : '请确认是否撤销当前发布内容!', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function() {
|
}).then(function () {
|
||||||
let data = {
|
let data = {
|
||||||
id: that.baseData.id,
|
id: that.baseData.id,
|
||||||
isRelease: release
|
isRelease: release
|
||||||
|
|
@ -300,7 +322,7 @@ export default {
|
||||||
let edges = []
|
let edges = []
|
||||||
edgeList.forEach(edge => {
|
edgeList.forEach(edge => {
|
||||||
edges.push({
|
edges.push({
|
||||||
id:edge.id,
|
id: edge.id,
|
||||||
label: edge.label,
|
label: edge.label,
|
||||||
source: edge.source,
|
source: edge.source,
|
||||||
target: edge.target,
|
target: edge.target,
|
||||||
|
|
@ -324,12 +346,18 @@ export default {
|
||||||
}
|
}
|
||||||
this.previewDate.header = []
|
this.previewDate.header = []
|
||||||
let infoList = res.infoList
|
let infoList = res.infoList
|
||||||
infoList.forEach( info=>{
|
infoList.forEach(info => {
|
||||||
this.previewDate.header.push({
|
this.previewDate.header.push({
|
||||||
key: info.prop,
|
key: info.prop,
|
||||||
label: info.label,
|
label: info.label,
|
||||||
prop: info.prop
|
prop: info.prop,
|
||||||
|
dictType: info.dictType
|
||||||
})
|
})
|
||||||
|
// if (info.dictType!=null){
|
||||||
|
// this.getDicts(info.dictType).then(res => {
|
||||||
|
// this.dictTypeDataList[info.dictType] = res.data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
this.previewDate.title = this.baseData.uqName + '数据预览'
|
this.previewDate.title = this.baseData.uqName + '数据预览'
|
||||||
this.previewDate.open = true
|
this.previewDate.open = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue