|
@@ -4,175 +4,94 @@
|
|
|
<el-main class="" style="overflow-y: auto;">
|
|
|
<template>
|
|
|
<el-collapse v-model="activeNames" style="margin: 0px 5px 0px 5px;">
|
|
|
- <el-collapse-item v-for="item in field" :title="item.name" :name="item.id" :key="item.id" :loading="loading"
|
|
|
- @click.native="handleChange(item)">
|
|
|
|
|
|
+ <el-collapse-item v-for="item in field" :title="item.name" :name="item.value" :key="item.value"
|
|
|
+ @click.native.stop="handleChange(item)">
|
|
|
|
|
|
- <div style="display:flex;margin-bottom: 10px;">
|
|
|
- <div v-if="[1].includes(item.type)" class="year-data-picker">
|
|
|
- <el-date-picker clear-icon size="small" type="year" v-model="valObj.valueOne" value-format="yyyy"
|
|
|
- placeholder="请选择时间"></el-date-picker>
|
|
|
- <span style="margin: 5px;">至</span>
|
|
|
- <el-date-picker clear-icon size="small" type="year" v-model="valObj.valueTwo" value-format="yyyy"
|
|
|
- placeholder="请选择时间"></el-date-picker>
|
|
|
+ <div @click.stop="handleStop">
|
|
|
+ <div style="display:flex;margin-bottom: 10px;">
|
|
|
+ <div v-if="[1].includes(item.type)" class="year-data-picker">
|
|
|
+ <el-date-picker clear-icon size="small" type="year" value-format="yyyy"
|
|
|
+ placeholder="请选择时间"></el-date-picker>
|
|
|
+ <span style="margin: 5px;">至</span>
|
|
|
+ <el-date-picker clear-icon size="small" type="year" value-format="yyyy"
|
|
|
+ placeholder="请选择时间"></el-date-picker>
|
|
|
+ </div>
|
|
|
+ <template v-if="![4, 5].includes(item.type)">
|
|
|
+ <el-input size="small" placeholder="请输入查询内容"></el-input>
|
|
|
+ <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"
|
|
|
+ icon="el-icon-search" circle></el-button>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
- <template v-if="![4, 5].includes(item.type)">
|
|
|
- <el-input size="small" v-model="valObj.valueOne" placeholder="请输入查询内容"></el-input>
|
|
|
- <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"
|
|
|
- icon="el-icon-search" circle></el-button>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <el-checkbox-group v-model="valObj[item.id]" @change.stop="onChange($event, item.id)">
|
|
|
- <div class="source-checkbox" v-if="ifShow">
|
|
|
- <el-checkbox v-for="source in item.options" :label="source.id" :key="source.id">
|
|
|
- <span class="source-checkbox-label" :title="source.name">{{ source.name }}</span>
|
|
|
- <span class="source-checkbox-count">({{ getCount(item, source.id) }})</span>
|
|
|
- </el-checkbox>
|
|
|
- </div>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-checkbox-group v-model="item.check" @change.stop="onChange($event, item)">
|
|
|
+ <div class="source-checkbox" v-if="ifShow">
|
|
|
+ <el-checkbox v-for="source in item.options" :label="source.id" :key="source.id">
|
|
|
+ <span class="source-checkbox-label" :title="source.name">{{ source.name }}</span>
|
|
|
+ <span class="source-checkbox-count">({{ getCount(item, source.id) }})</span>
|
|
|
+ </el-checkbox>
|
|
|
+ </div>
|
|
|
+ </el-checkbox-group>
|
|
|
|
|
|
- <div class="patent-query-filter-search-bottom">
|
|
|
- <el-button type="success" size="small" @click.stop="handleSelectAll(item)">全选</el-button>
|
|
|
- <el-button type="danger" size="small" @click.stop="handleSelectCancel(item)">取消</el-button>
|
|
|
+ <div class="patent-query-filter-search-bottom">
|
|
|
+ <el-button type="success" size="small" @click.stop="handleSelectAll(item)">全选</el-button>
|
|
|
+ <el-button type="danger" size="small" @click.stop="handleSelectCancel(item)">取消</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
</template>
|
|
|
</el-main>
|
|
|
<el-footer style="display: flex;align-items: center;justify-content: end;">
|
|
|
- <el-button type="primary" size="small" @click="handleMore">更多过滤项</el-button>
|
|
|
+ <slot name="footerBtn"></slot>
|
|
|
+
|
|
|
</el-footer>
|
|
|
</el-container>
|
|
|
|
|
|
- <fieldsVue ref="fieldsVue" type="" :projectId="projectId" :taskId="taskId" :filed="true" @getFieldList="getFieldList">
|
|
|
- </fieldsVue>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import fieldsVue from '@/views/components/dialog/fields.vue'
|
|
|
export default {
|
|
|
- props: ['projectId', 'taskId'],
|
|
|
+ props: {
|
|
|
+ field: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkArr: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
components: {
|
|
|
- fieldsVue
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- // 控制折叠面板
|
|
|
activeNames: [],
|
|
|
- // 存放数据
|
|
|
- field: [],
|
|
|
- loading: false,
|
|
|
- // 勾选的数据
|
|
|
- valObj: {
|
|
|
- check: [],
|
|
|
- valueOne: '',
|
|
|
- valueTwo: '',
|
|
|
- },
|
|
|
- // 分页信息
|
|
|
- queryParams: {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
- },
|
|
|
- total: 0,
|
|
|
- // 总数据
|
|
|
- customFields: [],
|
|
|
- // 是否重新创建dom
|
|
|
ifShow: true,
|
|
|
- filedAll:[],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ field: {
|
|
|
+ handler() {
|
|
|
+ this.ifShow = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.ifShow = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- // 获取自定义字段的栏位数据
|
|
|
- this.getList()
|
|
|
- // 获取显示的统计栏位
|
|
|
- this.getShowCountColumns()
|
|
|
- // 获取所有统计栏位的数据
|
|
|
- this.getAllCountColumns()
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- // 获取所有的统计栏位
|
|
|
- getAllCountColumns() {
|
|
|
- let params = {
|
|
|
- projectId:this.projectId,
|
|
|
- taskId:this.taskId,
|
|
|
- }
|
|
|
- this.$api.getAllCountColumns(params).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取显示的统计栏位
|
|
|
- getShowCountColumns() {
|
|
|
- let params = {
|
|
|
- projectId:this.projectId,
|
|
|
- taskId:this.taskId,
|
|
|
- }
|
|
|
- this.$api.getShowCountColumns(params).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 过滤组件传的值
|
|
|
- getFieldList(val) {
|
|
|
- this.filed = this.filed.concat(data)
|
|
|
- },
|
|
|
- // 更多过滤项
|
|
|
- handleMore() {
|
|
|
- this.$refs.handleMore.open(this.filedAll)
|
|
|
- },
|
|
|
- // 全选
|
|
|
- handleSelectAll(val) {
|
|
|
- this.valObj[val.id] = val.options.map(item => {
|
|
|
- return item.id
|
|
|
- })
|
|
|
- // this.valObj[val.id]=[8]
|
|
|
- // console.log(check);
|
|
|
- // this.valObj.check[val.id] = JSON.parse(JSON.stringify(check))
|
|
|
- // this.valObj.check[val.id] = check
|
|
|
- this.$set(this.valObj, val.id, 8)
|
|
|
- console.log(this.valObj);
|
|
|
- },
|
|
|
- // 取消
|
|
|
- handleSelectCancel(val) {
|
|
|
- this.valObj.check[val.id] = []
|
|
|
- },
|
|
|
- // 查询自定义栏位数据
|
|
|
- getList() {
|
|
|
- var params = {
|
|
|
- ...this.queryParams,
|
|
|
- searchQuery: `projectId=${this.projectId}`,
|
|
|
- orderDTOList: [],
|
|
|
- }
|
|
|
- this.loading = true
|
|
|
- this.$api.queryCustomField(params).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.field = response.data.data.filter(item => {
|
|
|
- return item.type != 6
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- // 查询自定义栏位选项数据
|
|
|
- async queryCustomOption(row) {
|
|
|
- let params = {
|
|
|
- customFieldId: row.id,
|
|
|
- }
|
|
|
- await this.$api.queryCustomOption(params).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.$set(row, 'options', response.data.data)
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- // 处理树类型的文件数字
|
|
|
+ handleStop(){},
|
|
|
+ // 处理专利文件数字
|
|
|
getCount(field, value) {
|
|
|
var num = 0
|
|
|
if (field.nums) {
|
|
@@ -185,65 +104,37 @@ export default {
|
|
|
return num
|
|
|
}
|
|
|
},
|
|
|
- refresh() {
|
|
|
- this.$set(this, 'ifShow', false)
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$set(this, 'ifShow', true)
|
|
|
- })
|
|
|
- },
|
|
|
- // 点击当前的折叠面板
|
|
|
- async handleChange(val) {
|
|
|
- this.$set(this.valObj, val.id, [])
|
|
|
- await this.queryCustomOption(val)
|
|
|
- this.$nextTick(() => {
|
|
|
- this.esCountSearch(val)
|
|
|
- })
|
|
|
+ // 点击面板
|
|
|
+ handleChange(row) {
|
|
|
+ console.log(row);
|
|
|
+ this.$emit('collapseChange', { row: row, sign: 'check' })
|
|
|
},
|
|
|
// 点击折叠面板中的搜索
|
|
|
handleSearch(val) {
|
|
|
- // this.queryCustomOption(val)
|
|
|
- this.esCountSearch(val)
|
|
|
- },
|
|
|
- // 获取统计数字
|
|
|
- esCountSearch(val) {
|
|
|
- let params = [{
|
|
|
- field: 'field',
|
|
|
- fieldId: val.id,
|
|
|
- valueOne: this.valObj.valueOne || '',
|
|
|
- valueTwo: this.valObj.valueTwo || '',
|
|
|
- }]
|
|
|
- this.$api.esCountSearch(params).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.$set(val, 'nums', response.data.detailDTOS)
|
|
|
- this.refresh()
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
-
|
|
|
- })
|
|
|
+ this.$emit('search', { row: val })
|
|
|
},
|
|
|
// 选中的数据
|
|
|
- onChange(filed, filedId) {
|
|
|
- let obj = {
|
|
|
- [filedId]: filed
|
|
|
+ onChange(data, field) {
|
|
|
+ console.log(data, field);
|
|
|
+ var obj = {
|
|
|
+ fieldId: field.value,
|
|
|
+ fieldType: field.fieldType,
|
|
|
+ value: [],
|
|
|
}
|
|
|
- this.handleFiledData(obj, filedId)
|
|
|
+ let arr = []
|
|
|
+ arr.push(obj)
|
|
|
+ this.$emit('customTab',arr)
|
|
|
+ console.log(obj);
|
|
|
},
|
|
|
- // 处理customFields中的数据
|
|
|
- handleFiledData(obj, filedId) {
|
|
|
- if (this.customFields && this.customFields.length > 0) {
|
|
|
- this.customFields.forEach(item => {
|
|
|
- for (let k in item) {
|
|
|
- if (k == filedId) {
|
|
|
- item[k] = obj[filedId]
|
|
|
- } else {
|
|
|
- this.customFields.push(obj)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.customFields.push(obj)
|
|
|
- }
|
|
|
- // this.$emit('customFields', this.customFields)
|
|
|
+ // 全选
|
|
|
+ handleSelectAll(val) {
|
|
|
+ val.check = val.options.map(item => {
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 取消
|
|
|
+ handleSelectCancel(val) {
|
|
|
+ val.check=[]
|
|
|
},
|
|
|
},
|
|
|
}
|