Commit f3fae600 authored by 范加坤's avatar 范加坤

Merge branch 'develop' of http://39.104.186.147/one-net/alien-species-think-tank into develop

parents 6dbe731e 5edcd9bf
...@@ -8,13 +8,14 @@ ...@@ -8,13 +8,14 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@antv/g2": "^4.0.15", "@antv/g2": "^5.1.15",
"ant-design-vue": "^1.7.8", "ant-design-vue": "^1.7.8",
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dayjs": "^1.10.6", "dayjs": "^1.10.6",
"echarts": "^4.9.0", "echarts": "^4.9.0",
"element-resize-detector": "^1.2.3", "element-resize-detector": "^1.2.3",
"element-ui": "^2.15.14",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"mapbox-gl": "^2.0.1", "mapbox-gl": "^2.0.1",
"vue": "^2.6.11", "vue": "^2.6.11",
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
class="species-item" class="species-item"
v-for="(species, idx) in dataList" v-for="(species, idx) in dataList"
:key="'全部物种'" :key="'全部物种'"
@click="open(species)"
> >
{{ species["物种名称"] }} {{ species["物种名称"] }}
</div> </div>
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
class="species-item" class="species-item"
v-for="(species, idx) in getFilterDataList(item)" v-for="(species, idx) in getFilterDataList(item)"
:key="idx" :key="idx"
@click="open(item)" @click="open(species)"
> >
{{ species["物种名称"] }} {{ species["物种名称"] }}
</div> </div>
...@@ -287,12 +288,21 @@ export default { ...@@ -287,12 +288,21 @@ export default {
} }
}, },
search() { search() {
let path = "/data/species"; this.currentType
if (this.roster === BATCH_KEY.KEY_PROTECTED_AGRICULTURE) { this.name
path = "/data/speciesPlant"; let path = '/data/speciesDataList'
if (this.currentType || this.name) {
path += '?'
this.currentType && ( path += `currentType=${this.currentType}`)
this.name && (path += `${ this.currentType ? '&' : ''}name=${this.name}`);
} }
this.name && (path += `?name=${this.name}`); this.$router.push(path)
this.$router.push(path); // let path = "/data/species";
// if (this.roster === BATCH_KEY.KEY_PROTECTED_AGRICULTURE) {
// path = "/data/speciesPlant";
// }
// this.name && (path += `?name=${this.name}`);
// this.$router.push(path);
this.selectListShow = false; this.selectListShow = false;
}, },
checkSpeciesType(type) { checkSpeciesType(type) {
...@@ -300,18 +310,24 @@ export default { ...@@ -300,18 +310,24 @@ export default {
this.selectListShow = false; this.selectListShow = false;
}, },
async open(item) { async open(item) {
if (item.properties.id !== "无") { const { 序号 } = item
this.$router.push({ if (!序号) {
path: `${ this.$router.push({ path: '/data/speciesDataList'})
this.pKey === "alienSpecies" } else {
? "/detail/species" this.$router.push({ path: `/detail/speciesData?id=${序号}`})
: "/detail/speciesplant"
}`,
query: {
id: item.properties.id,
},
});
} }
// if (item.properties.id !== "无") {
// this.$router.push({
// path: `${
// this.pKey === "alienSpecies"
// ? "/detail/species"
// : "/detail/speciesplant"
// }`,
// query: {
// id: item.properties.id,
// },
// });
// }
}, },
async recordOpen(item) { async recordOpen(item) {
if (item.properties.id !== "无") { if (item.properties.id !== "无") {
......
...@@ -92,9 +92,10 @@ export default { ...@@ -92,9 +92,10 @@ export default {
}, },
methods: { methods: {
tabChange() { tabChange() {
this.showDataList = this.dataList.filter((item) => { const res = JSON.parse(JSON.stringify(this.dataList))
this.showDataList = res.filter((item) => {
if (this.type == "全部物种") return true; if (this.type == "全部物种") return true;
return item.类型 == this.type; return item.类型 === this.type;
}); });
this.searchValue = null; this.searchValue = null;
...@@ -104,14 +105,17 @@ export default { ...@@ -104,14 +105,17 @@ export default {
}, },
onSearch() { onSearch() {
// this.init(); // this.init();
this.showDataList = this.dataList.filter((item) => { const res = JSON.parse(JSON.stringify(this.dataList))
let r = true;
this.showDataList = res.filter((item) => {
const r = this.type === "全部物种" || this.type === item.类型;
if (this.searchValue) { if (this.searchValue) {
r = r = item["物种名称"].indexOf(this.searchValue) !== -1; return item["物种名称"].indexOf(this.searchValue) !== -1 && r;
} }
return r; return r;
}); });
this.type = "全部物种";
// this.type = "全部物种";
setTimeout(() => { setTimeout(() => {
this.waterFull(); this.waterFull();
...@@ -129,8 +133,19 @@ export default { ...@@ -129,8 +133,19 @@ export default {
this.dataList = res.data.sort((a, b) => { this.dataList = res.data.sort((a, b) => {
return a.序号 - b.序号; return a.序号 - b.序号;
}); });
this.showDataList = this.dataList; this.showDataList = JSON.parse(JSON.stringify(this.dataList));
console.log(this.$route);
const { query } = this.$route;
const { name, currentType } = query;
if (currentType) {
this.type = currentType;
this.tabChange();
}
if (name) {
this.searchValue = name;
this.onSearch();
}
setTimeout(() => { setTimeout(() => {
this.waterFull(); this.waterFull();
}, 1000); }, 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment