...
|
...
|
@@ -6,7 +6,7 @@ |
|
|
:placeholder="filters.subject.holder"></Input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.emergency.label">
|
|
|
<Select v-model.trim="filters.emergency.model">
|
|
|
<Select v-model.trim="filters.emergency.model" clearable>
|
|
|
<Option v-for="option in filters.emergency.options"
|
|
|
:value="option.value"
|
|
|
:key="option.value">{{option.label}}</Option>
|
...
|
...
|
@@ -16,15 +16,15 @@ |
|
|
<select-brand v-model="filters.brand.model"></select-brand>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.status.label">
|
|
|
<Select v-model.trim="filters.status.model">
|
|
|
<Select v-model.trim="filters.status.model" clearable>
|
|
|
<Option v-for="option in filters.status.options"
|
|
|
:value="option.value"
|
|
|
:key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
</filter-item>
|
|
|
<filter-item>
|
|
|
<Button type="primary" @click="filterSearch">筛选</Button>
|
|
|
<Button @click="clearFilter">清空条件</Button>
|
|
|
<Button type="primary" @click="doSearch">筛选</Button>
|
|
|
<Button @click="reset">清空条件</Button>
|
|
|
</filter-item>
|
|
|
</layout-filter>
|
|
|
|
...
|
...
|
@@ -37,9 +37,9 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import _ from 'lodash';
|
|
|
import {list as diffList} from './store';
|
|
|
import {DiffService} from 'services/repository';
|
|
|
import {SelectBrand} from 'components/select';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
...
|
...
|
@@ -47,32 +47,78 @@ export default { |
|
|
},
|
|
|
created() {
|
|
|
this.DiffService = new DiffService();
|
|
|
|
|
|
this.DiffService.list()
|
|
|
.then(res => {
|
|
|
this.$Loading.finish();
|
|
|
this.dataList = res.data.records;
|
|
|
});
|
|
|
this.search(this.params());
|
|
|
},
|
|
|
methods: {
|
|
|
clearFilter() {
|
|
|
search(params) {
|
|
|
this.$Loading.start();
|
|
|
this.DiffService.list(params)
|
|
|
.then(res => {
|
|
|
this.$Loading.finish();
|
|
|
this.dataList = res.data.records;
|
|
|
this.page.total = res.data.totalCount;
|
|
|
}, () => {
|
|
|
this.$Loading.finish();
|
|
|
});
|
|
|
|
|
|
},
|
|
|
filterSearch() {
|
|
|
params() {
|
|
|
const defVal = {
|
|
|
pageNo: 1,
|
|
|
pageSize: 20,
|
|
|
statuses: [3, 21, 22]
|
|
|
};
|
|
|
const keyMap = {
|
|
|
brandId: 'brand',
|
|
|
statuses: 'status',
|
|
|
subject: 'subject',
|
|
|
emergencyDegree: 'emergency'
|
|
|
};
|
|
|
|
|
|
if (this.enableFilter) {
|
|
|
let model;
|
|
|
|
|
|
_.each(keyMap, (val, key) => {
|
|
|
model = this.filters[val].model;
|
|
|
|
|
|
if (('' + model).length) {
|
|
|
if (key === 'statuses') {
|
|
|
defVal[key] = [model];
|
|
|
} else {
|
|
|
defVal[key] = model;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return defVal;
|
|
|
},
|
|
|
pageChange() {
|
|
|
reset() {
|
|
|
_.each(this.filters, item => {
|
|
|
item.model = '';
|
|
|
});
|
|
|
this.page.current = 1;
|
|
|
this.enableFilter = false;
|
|
|
this.search(this.params());
|
|
|
},
|
|
|
doSearch() {
|
|
|
this.enableFilter = true;
|
|
|
this.search(this.params());
|
|
|
},
|
|
|
goDetail(id) {
|
|
|
pageChange(no) {
|
|
|
let params;
|
|
|
|
|
|
params = this.params();
|
|
|
params.pageNo = no;
|
|
|
this.search(params);
|
|
|
this.page.current = no;
|
|
|
},
|
|
|
toDetail(id) {
|
|
|
this.$router.push({
|
|
|
query: {
|
|
|
id
|
|
|
},
|
|
|
query: { id },
|
|
|
name: 'repository.diff.detail',
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
SelectBrand
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|