wangqing 4 years ago
parent
commit
3da21d7b66
  1. 13
      src/views/form/statistics/filter.vue
  2. 12
      src/views/form/statistics/list.vue

13
src/views/form/statistics/filter.vue

@ -45,7 +45,9 @@
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button :disabled="selectedFields.length==0" type="primary" @click="submitFilterHandle"> </el-button>
<el-button :disabled="selectedFields.length==0&&filterParams!={}" type="primary"
@click="submitFilterHandle"
> </el-button>
</span>
</el-dialog>
</template>
@ -63,6 +65,8 @@ export default {
return {
dialogVisible: true,
selectedFields: [],
//
filterParamsComparison: {},
filterParams: {}
}
},
@ -76,7 +80,7 @@ export default {
this.$set(this.fields, item.leftIndex, item)
},
submitFilterHandle() {
this.$emit('filter', this.filterParams)
this.$emit('filter', this.filterParams, this.filterParamsComparison)
this.dialogVisible = false
},
selectedFieldHandle(index, item) {
@ -86,6 +90,11 @@ export default {
item.selected = true
this.$set(this.fields, index, item)
item.leftIndex = index
if (['SELECT', 'RADIO', 'CHECKBOX', 'IMAGE_SELECT'].includes(item.type)) {
this.filterParamsComparison[`filed${item.formItemId}`] = 'EQ'
} else {
this.filterParamsComparison[`filed${item.formItemId}`] = 'LIKE'
}
this.selectedFields.push(item)
}
}

12
src/views/form/statistics/list.vue

@ -129,9 +129,7 @@
</span>
</el-dialog>
</div>
<data-filter ref="dataFilter" :fields="projectItemList" @filter="(params)=>
{this.queryConditions.extParams=params;this.queryProjectResult()}"
/>
<data-filter ref="dataFilter" :fields="projectItemList" @filter="dataFilterHandle" />
</div>
</template>
@ -178,7 +176,8 @@ export default {
projectKey: '',
beginDateTime: '',
endDateTime: '',
extParams: {}
extParams: null,
extComparisons: null
}
}
},
@ -207,6 +206,11 @@ export default {
conditionFilterHandle() {
this.$refs.dataFilter.showDialogHandle()
},
dataFilterHandle(params, comparisons) {
this.queryConditions.extParams = params
this.queryConditions.extComparisons = comparisons
this.queryProjectResult()
},
queryProjectResult() {
this.$api.get('/user/project/result/page', {params: this.queryConditions}).then(res => {
let {records, total, size} = res.data

Loading…
Cancel
Save