|
@@ -3,32 +3,8 @@
|
|
|
<div style="padding: 20px;">
|
|
|
<div class="indicia-top-components">
|
|
|
<div>
|
|
|
- <el-select v-model="screenValue" size="small" class="indicia-top-select">
|
|
|
- <el-option v-for="item in screenOptions" :key="item.value" :label="item.label" :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <template v-if="screenValue != 'date'">
|
|
|
- <el-input v-model="screenInputValue" :placeholder="getPlaceholder()" size="small"
|
|
|
- style="margin-left: 10px;width: 200px;"></el-input>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-date-picker v-model="screenInputValue" value-format="yyyy-MM-dd" size="small" type="date" :placeholder="getPlaceholder()" style="margin-left: 10px;width: 200px;"></el-date-picker>
|
|
|
- <!-- <el-date-picker v-model="screenInputValue.end" value-format="yyyy-MM-dd" size="small" type="date" :placeholder="getPlaceholder()" style="margin-left: 10px;width: 200px;"></el-date-picker> -->
|
|
|
- </template>
|
|
|
- <el-button size="small" type="primary" @click="screenBtn" class="indicia-top-button">搜 索</el-button>
|
|
|
- <template v-if="searchOptions.length>0">
|
|
|
- <el-popover placement="bottom" title="" width="200" trigger="hover" class="margin-left_10">
|
|
|
- <div v-for="(item, index) in searchOptions" :key="index" class="workspace-content-header-query-box">
|
|
|
- <el-tag closable type="success" @close="handleDelete(item,index)" style="margin-bottom: 5px;">
|
|
|
- {{ item.label +':'+ item.content}}
|
|
|
- </el-tag>
|
|
|
- </div>
|
|
|
- <!-- <el-button style="" >
|
|
|
- 检索条件<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </el-button> -->
|
|
|
- <span slot="reference" size="small" type="primary" style="font-size: 14px;"> 检索信息:({{ searchOptions[0].label +':'+searchOptions[0].content }}<i class="el-icon-arrow-down el-icon--right"></i>)</span>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
+ <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
|
|
|
+ </mySearch>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span>分组查询:</span>
|
|
@@ -41,15 +17,16 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- table及collapse组件 -->
|
|
|
- <div class="indicia-components" :style="{'height': sonHeight + 'px'}">
|
|
|
- <component :dataArr="tableCollapseList" :collapseList="collapseList" :queryParams="queryParams" :sonHeight="sonHeight"
|
|
|
- @collapseVal="collapseVal" :is="componentType" :loading="loading" :componentType="componentType">
|
|
|
+ <div class="indicia-components" :style="{ 'height': sonHeight + 'px' }">
|
|
|
+ <component :dataArr="tableCollapseList" :collapseList="collapseList" :queryParams="queryParams"
|
|
|
+ :sonHeight="sonHeight" @collapseVal="collapseVal" :is="componentType" :loading="loading"
|
|
|
+ :componentType="componentType">
|
|
|
</component>
|
|
|
</div>
|
|
|
<!-- collapse分页 -->
|
|
|
<div style="text-align: center;">
|
|
|
<el-pagination background layout="total, prev, pager, next, jumper" :current-page.sync="queryParams.current"
|
|
|
- :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="total" >
|
|
|
+ :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -66,37 +43,39 @@ export default {
|
|
|
indiciaCollapse,
|
|
|
indiciaCard,
|
|
|
},
|
|
|
- mixins:[importExcel,],
|
|
|
+ mixins: [importExcel,],
|
|
|
data() {
|
|
|
return {
|
|
|
componentType: 'indiciaCard',//切换组件,默认card组件
|
|
|
- screenOptions: [
|
|
|
+ // 检索条件
|
|
|
+ searchFiled: [
|
|
|
{
|
|
|
label: '标注',
|
|
|
- value: 'remark',
|
|
|
+ value: 'markNoteText',
|
|
|
+ type: 'String',
|
|
|
placeholder: '请输入标注',
|
|
|
},
|
|
|
{
|
|
|
label: '专利号',
|
|
|
value: 'patentNo',
|
|
|
+ type: 'String',
|
|
|
placeholder: '请输入专利号',
|
|
|
},
|
|
|
- // {
|
|
|
- // label: '标注的位置',
|
|
|
- // value: 'address',
|
|
|
- // placeholder: '请输入标注的位置'
|
|
|
- // },
|
|
|
{
|
|
|
label: '标注人',
|
|
|
- value: 'name',
|
|
|
+ value: 'createName',
|
|
|
+ type: 'String',
|
|
|
placeholder: '请输入标注人',
|
|
|
},
|
|
|
{
|
|
|
label: '标注时间',
|
|
|
- value: 'date',
|
|
|
+ value: 'markTime',
|
|
|
+ type: '2',
|
|
|
placeholder: '请选择标注时间',
|
|
|
},
|
|
|
- ],//筛选
|
|
|
+ ],
|
|
|
+ //检索条件
|
|
|
+ searchOption: {},
|
|
|
groupingOption: [
|
|
|
{
|
|
|
label: '不分组',
|
|
@@ -108,14 +87,14 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '标注人',
|
|
|
- value: 'name',
|
|
|
+ value: 'createName',
|
|
|
},
|
|
|
{
|
|
|
label: '标注时间',
|
|
|
- value: 'date',
|
|
|
+ value: 'markTime',
|
|
|
},
|
|
|
],//分组
|
|
|
- screenValue: 'remark',//筛选的值
|
|
|
+ screenValue: 'markNoteText',//筛选的值
|
|
|
screenInputValue: '',//筛选输入的值
|
|
|
groupingValue: 'noGrouping',//分组的值
|
|
|
queryParams: {
|
|
@@ -125,50 +104,67 @@ export default {
|
|
|
total: 0,
|
|
|
tableCollapseList: [],//获取的数据
|
|
|
collapseList: [],//collapse数据
|
|
|
- sonHeight: document.documentElement.clientHeight -230,//页面高度
|
|
|
+ sonHeight: document.documentElement.clientHeight - 230,//页面高度
|
|
|
loading: false,
|
|
|
- searchOptions:[],//检索条件
|
|
|
+ // searchOptions: [],//检索条件
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取检索条件检索
|
|
|
+ search(val) {
|
|
|
+ let params = {}
|
|
|
+ val.forEach(item => {
|
|
|
+ if (item.type == 3) {
|
|
|
+ params[item.value] = item.searchValue.map(itemValue => {
|
|
|
+ return itemValue.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ params[item.value] = item.searchValue.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 返回条件对象
|
|
|
+ this.searchOption = this.$commonJS.ArrayToArray(val)
|
|
|
+ // 调用查询接口
|
|
|
+ this.queryParams.current = 1
|
|
|
+ this.isCollapse()
|
|
|
+ },
|
|
|
// 请求card数据
|
|
|
getList(val) {
|
|
|
this.loading = true
|
|
|
if (val) {
|
|
|
- let a=this.searchOptions.filter(item => {
|
|
|
- return item.value!=this.queryParams.grouping
|
|
|
- })
|
|
|
- a.push({ value: this.queryParams.grouping, content: val })
|
|
|
+ // let a = this.searchOptions.filter(item => {
|
|
|
+ // return item.value != this.queryParams.groupField
|
|
|
+ // })
|
|
|
+ // a.push({ value: this.queryParams.groupField, content: val })
|
|
|
var params = {
|
|
|
- search:a
|
|
|
+ searchQuery: `${this.queryParams.groupField}=${val}`
|
|
|
}
|
|
|
} else {
|
|
|
var params = {
|
|
|
- //...扩展、展开
|
|
|
...this.queryParams,
|
|
|
- search:this.searchOptions,
|
|
|
+ searchQuery: this.$commonJS.objectToString(this.searchOption || {}),
|
|
|
}
|
|
|
}
|
|
|
this.$api.queryScratchWords(params).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- this.tableCollapseList = res.data.records
|
|
|
+ this.tableCollapseList = res.data.data
|
|
|
if (!val) {
|
|
|
- this.total=res.data.total
|
|
|
+ this.total = res.data.total
|
|
|
}
|
|
|
- this.loading=false
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
this.tableCollapseList = []
|
|
|
if (!val) {
|
|
|
- this.total=0
|
|
|
- }
|
|
|
- this.loading=false
|
|
|
+ this.total = 0
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
},
|
|
|
// 查询分组
|
|
@@ -176,22 +172,23 @@ export default {
|
|
|
this.loading = true
|
|
|
let params = {
|
|
|
//...扩展、展开
|
|
|
- search:this.searchOptions,
|
|
|
+ searchQuery: this.$commonJS.objectToString(this.searchOption || {}),
|
|
|
+ // search: this.searchOptions,
|
|
|
...this.queryParams,
|
|
|
}
|
|
|
- this.$api.queryGroupScratchS(params).then((res) => {
|
|
|
+ this.$api.queryScratchWordsGroup(params).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- this.collapseList = res.data.records
|
|
|
- this.total=res.data.total
|
|
|
+ this.collapseList = res.data.data
|
|
|
+ this.total = res.data.total
|
|
|
this.loading = false
|
|
|
if (this.collapseList.length > 0) {
|
|
|
- this.getList(this.collapseList[0][this.queryParams.grouping])
|
|
|
+ this.getList(this.collapseList[0].key)
|
|
|
}
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
this.collapseList = []
|
|
|
- this.total=0
|
|
|
- this.loading=false
|
|
|
+ this.total = 0
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
},
|
|
|
// 判断是查询分组还是只检索
|
|
@@ -203,29 +200,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 搜索事件
|
|
|
- screenBtn() {
|
|
|
+ screenBtn() {
|
|
|
this.editSearchOptions()
|
|
|
this.isCollapse()
|
|
|
- this.screenInputValue=''
|
|
|
+ this.screenInputValue = ''
|
|
|
},
|
|
|
// 修改检索数组
|
|
|
- editSearchOptions() {
|
|
|
- this.searchOptions.push(
|
|
|
- {
|
|
|
- value: this.screenValue,
|
|
|
- label: this.screenOptions.find(item => { return item.value == this.screenValue }).label,
|
|
|
- content: this.screenInputValue,
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
+ // editSearchOptions() {
|
|
|
+ // this.searchOptions.push(
|
|
|
+ // {
|
|
|
+ // value: this.screenValue,
|
|
|
+ // label: this.screenOptions.find(item => { return item.value == this.screenValue }).label,
|
|
|
+ // content: this.screenInputValue,
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // },
|
|
|
// 分组监听事件
|
|
|
- changeGrouping(val) {
|
|
|
+ changeGrouping(val) {
|
|
|
this.queryParams.current = 1
|
|
|
if (val == 'noGrouping') {//不分组
|
|
|
- this.componentType='indiciaCard'
|
|
|
+ this.componentType = 'indiciaCard'
|
|
|
} else {
|
|
|
this.componentType = 'indiciaCollapse'
|
|
|
- this.queryParams.grouping = val
|
|
|
+ this.queryParams.groupField = val
|
|
|
}
|
|
|
this.isCollapse()
|
|
|
},
|
|
@@ -235,17 +232,17 @@ export default {
|
|
|
this.isCollapse()
|
|
|
},
|
|
|
// 获取输入框提示信息
|
|
|
- getPlaceholder() {
|
|
|
- let a = this.screenOptions.filter(item => {
|
|
|
- return item.value == this.screenValue
|
|
|
- })
|
|
|
- return a[0].placeholder
|
|
|
- },
|
|
|
+ // getPlaceholder() {
|
|
|
+ // let a = this.screenOptions.filter(item => {
|
|
|
+ // return item.value == this.screenValue
|
|
|
+ // })
|
|
|
+ // return a[0].placeholder
|
|
|
+ // },
|
|
|
// 删除检索条件
|
|
|
- handleDelete(val,index) {
|
|
|
- this.searchOptions.splice(index, 1)
|
|
|
- this.isCollapse()
|
|
|
- },
|
|
|
+ // handleDelete(val, index) {
|
|
|
+ // this.searchOptions.splice(index, 1)
|
|
|
+ // this.isCollapse()
|
|
|
+ // },
|
|
|
// 子组件
|
|
|
collapseVal(val) {
|
|
|
this.getList(val)
|
|
@@ -281,6 +278,6 @@ export default {
|
|
|
overflow: auto;
|
|
|
// padding-right: 40px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
</style>
|