|
@@ -26,10 +26,10 @@
|
|
|
@change="getDataListByType(dataForm.applicationType)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in applicationTypeOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="data in applicationTypeOptions"
|
|
|
+ :key="data"
|
|
|
+ :label="data"
|
|
|
+ :value="data"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -195,18 +195,6 @@ export default {
|
|
|
viewDetailVisible: false,
|
|
|
filterVal: "",
|
|
|
applicationTypeOptions: [
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "全部",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "水文",
|
|
|
- label: "水文",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "采矿",
|
|
|
- label: "采矿",
|
|
|
- },
|
|
|
],
|
|
|
};
|
|
|
},
|
|
@@ -221,6 +209,12 @@ export default {
|
|
|
// 获取数据列表
|
|
|
getDataList() {
|
|
|
this.dataListLoading = true;
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl("/category/select"),
|
|
|
+ method: "get",
|
|
|
+ }).then(({ data }) => {
|
|
|
+ this.applicationTypeOptions = this.unique(data.list);
|
|
|
+ });
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl("/generator/applications/list"),
|
|
|
method: "get",
|
|
@@ -267,7 +261,14 @@ export default {
|
|
|
this.$refs.addOrUpdate.init(id);
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ //去重
|
|
|
+ unique(arr) {
|
|
|
+ var ss = [];
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
+ ss[i] = arr[i].categoryName;
|
|
|
+ }
|
|
|
+ return Array.from(new Set(ss));
|
|
|
+ },
|
|
|
// 查看详情
|
|
|
viewApplicationDetail(id) {
|
|
|
var item = this.dataList.filter((item) => item.applicationId === id);
|