|
|
@@ -10,14 +10,14 @@
|
|
|
<el-tabs type="border-card">
|
|
|
<el-tab-pane label="基础字段"
|
|
|
style="height:calc(100vh - 370px)">
|
|
|
- <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
|
|
|
+ <div :style="{'width':'100%','height':'100%','overflow':'auto'}">
|
|
|
<el-tree :data="data1"
|
|
|
@node-click="handleNodeClick"></el-tree>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="扩展字段"
|
|
|
style="height:calc(100vh - 370px)">
|
|
|
- <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
|
|
|
+ <div :style="{'width':'100%','height':'100%','overflow':'auto'}">
|
|
|
<el-tree :data="data"
|
|
|
@node-click="handleNodeClicKuoZhan"></el-tree>
|
|
|
</div>
|
|
|
@@ -414,7 +414,7 @@ export default {
|
|
|
// },
|
|
|
methods: {
|
|
|
getOrgTreeList () {
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'BasicSampleType')
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'BasicSampleType')
|
|
|
.then(res => {
|
|
|
this.orgtreelist = utils.toolfun_gettreejson(res.data, 'id', 'parent_id', 'id,label')
|
|
|
})
|
|
|
@@ -494,6 +494,7 @@ export default {
|
|
|
// 点击关闭时调用
|
|
|
closePopup () {
|
|
|
this.resetForm()
|
|
|
+ this.beforeClose()
|
|
|
// this.resetcustomcondition()
|
|
|
this.samplesourcesearchdialogVisable = false
|
|
|
},
|
|
|
@@ -516,9 +517,9 @@ export default {
|
|
|
// 查询扩展字段
|
|
|
searchKuoZhanData () {
|
|
|
this.data = []
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'CustomizeSearch')
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'CustomizeSearch', {type: 'SampleSource'})
|
|
|
.then(res => {
|
|
|
- var models = res.info.items
|
|
|
+ var models = res.data
|
|
|
for (var i = 0; i < models.length; i++) {
|
|
|
var kuozhan = {
|
|
|
label: '',
|
|
|
@@ -526,20 +527,20 @@ export default {
|
|
|
}
|
|
|
if (i !== 0) {
|
|
|
// 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
|
|
|
- if (models[i].SampleTypeId === models[i - 1].SampleTypeId) {
|
|
|
- this.data[this.data.length - 1].label = models[i].SampleTypeName
|
|
|
- this.data[this.data.length - 1].children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
|
|
|
+ if (models[i].GroupName === models[i - 1].GroupName) {
|
|
|
+ this.data[this.data.length - 1].label = models[i].GroupName
|
|
|
+ this.data[this.data.length - 1].children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
|
|
|
} else {
|
|
|
// 和上一条数据不是同一个样本类型
|
|
|
- kuozhan.label = models[i].SampleTypeName
|
|
|
- kuozhan.children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
|
|
|
+ kuozhan.label = models[i].GroupName
|
|
|
+ kuozhan.children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
|
|
|
// 不是同一种样本类型的时候需要增加一个元素
|
|
|
this.data.push(kuozhan)
|
|
|
}
|
|
|
} else {
|
|
|
// 第一次循环肯定要加入一个元素
|
|
|
kuozhan.label = models[i].SampleTypeName
|
|
|
- kuozhan.children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
|
|
|
+ kuozhan.children.push({ label: models[i].Name, FieldName: models[i].FieldName, FieldType: models[i].FieldType })
|
|
|
this.data.push(kuozhan)
|
|
|
}
|
|
|
}
|
|
|
@@ -561,7 +562,7 @@ export default {
|
|
|
// // 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
|
|
|
// if (models[i].SampleSourceId === models[i - 1].SampleSourceId) {
|
|
|
// this.data2[this.data2.length - 1].label = models[i].SampleSourceTypeName
|
|
|
- // this.data2[this.data2.length - 1].children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
|
|
|
+ // this.data2[this.data2.length - 1].children.push({ label: models[i].Name, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
|
|
|
// } else {
|
|
|
// // 和上一条数据不是同一个样本类型
|
|
|
// kuozhan.label = models[i].SampleSourceTypeName
|
|
|
@@ -606,8 +607,7 @@ export default {
|
|
|
|
|
|
_this.currentSearchId = _this.searchTemplates[0].id
|
|
|
_this.currentSearchTemplateName = _this.searchTemplates[0].name
|
|
|
- // console.log(_this.searchTemplates, 'searchTemplatessearchTemplatessearchTemplates')
|
|
|
- // console.log(this.searchTemplates[0].Fields, "this.searchTemplates[0].Fields")
|
|
|
+ console.log('_this.searchTemplates', _this.searchTemplates)
|
|
|
_this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
|
|
|
} else {
|
|
|
// _this.$message({
|
|
|
@@ -632,30 +632,32 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'DeleteSearchTemplate', {id: Id})
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'DeleteSearchTemplate', {id: Id})
|
|
|
.then(res => {
|
|
|
- if (res.info.code === 0) {
|
|
|
+ if (res.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg
|
|
|
+ })
|
|
|
let tabs = _this.searchTemplates
|
|
|
let activeName = _this.currentSearchTemplateName
|
|
|
if (activeName === targetName) {
|
|
|
tabs.forEach((tab, index) => {
|
|
|
- if (tab.Name === targetName) {
|
|
|
+ if (tab.name === targetName) {
|
|
|
let nextTab = tabs[index + 1] || tabs[index - 1]
|
|
|
if (nextTab) {
|
|
|
- activeName = nextTab.Name
|
|
|
+ activeName = nextTab.name
|
|
|
_this.searchTableData = this.getSearchTableData(nextTab.Fields)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- this.$observer.$emit('handleSeach', true)
|
|
|
_this.currentSearchTemplateName = activeName
|
|
|
- _this.searchTemplates = tabs.filter(tab => tab.Name !== targetName)
|
|
|
+ _this.searchTemplates = tabs.filter(tab => tab.name != targetName)
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: res.info.message
|
|
|
+ message: res.msg
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -668,16 +670,16 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- saveAndSearchWithTemplate () {
|
|
|
- let _this = this
|
|
|
- this.saveSearchTemplate(function () {
|
|
|
- _this.currentSearchTemplate = _this.currentSearchTemplateName
|
|
|
- _this.searchWithTemplate(_this.currentSearchTemplateName)
|
|
|
- })
|
|
|
- },
|
|
|
- searchWithTemplate () {
|
|
|
-
|
|
|
- },
|
|
|
+ // saveAndSearchWithTemplate () {
|
|
|
+ // let _this = this
|
|
|
+ // this.saveSearchTemplate(function () {
|
|
|
+ // _this.currentSearchTemplate = _this.currentSearchTemplateName
|
|
|
+ // _this.searchWithTemplate(_this.currentSearchTemplateName)
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // searchWithTemplate () {
|
|
|
+ //
|
|
|
+ // },
|
|
|
// 自定义搜索名称发生变化
|
|
|
customsearchnamechange () {
|
|
|
|
|
|
@@ -735,9 +737,7 @@ export default {
|
|
|
this.searchTableData[m].Value = this.searchTableData[m].Value[0] + '--' + this.searchTableData[m].Value[1]
|
|
|
}
|
|
|
if (typeof this.searchTableData[m].Value === 'object') {
|
|
|
- console.log(this.searchTableData[m].Value, '1111')
|
|
|
this.searchTableData[m].Value = this.searchTableData[m].Value.join('/')
|
|
|
- console.log(this.searchTableData[m].Value, '2222')
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -792,6 +792,7 @@ export default {
|
|
|
console.error(err)
|
|
|
})
|
|
|
// _this.resetcustomcondition()
|
|
|
+
|
|
|
},
|
|
|
clickmodeltypetag (name, id) {
|
|
|
// this.currentSearchTemplateName = val.getAttribute('id')
|
|
|
@@ -845,10 +846,8 @@ export default {
|
|
|
converdata.Name = data.label // 字段名称
|
|
|
converdata.Field = data.FieldName // column
|
|
|
converdata.kuoz = 'true'
|
|
|
- converdata.typecode = 'SampleType'
|
|
|
converdata.SampleTypeId = data.sampleTypeId
|
|
|
converdata.FieldType = data.FieldType
|
|
|
- converdata.TagIcon = data.TagIcon
|
|
|
this.searchTableData.push(converdata)
|
|
|
console.log(this.searchTableData, data.TagIcon, 'datadatadatadatadatadatadatadata')
|
|
|
this.acquritypeN(data)
|