|
@@ -14,7 +14,6 @@
|
|
|
<div class="search-input item-content">
|
|
|
<el-select
|
|
|
v-model="form.wpids"
|
|
|
- @change="onChangeStation(form.wpids)"
|
|
|
multiple
|
|
|
collapse-tags
|
|
|
popper-class="select"
|
|
@@ -34,7 +33,6 @@
|
|
|
<div class="search-input item-content">
|
|
|
<el-select
|
|
|
v-model="form.timetypes"
|
|
|
- @change="onChangeStation(form.timetypes)"
|
|
|
multiple
|
|
|
popper-class="select"
|
|
|
>
|
|
@@ -51,11 +49,7 @@
|
|
|
<div class="query-item flex-row">
|
|
|
<div class="lable item-name">是否启用:</div>
|
|
|
<div class="search-input item-content">
|
|
|
- <el-select
|
|
|
- v-model="form.isenable"
|
|
|
- @change="onChangeStation(form.isenable)"
|
|
|
- popper-class="select"
|
|
|
- >
|
|
|
+ <el-select v-model="form.isenable" popper-class="select">
|
|
|
<el-option
|
|
|
v-for="item in enables"
|
|
|
:key="item.value"
|
|
@@ -77,6 +71,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import axios from "axios";
|
|
|
+
|
|
|
export default {
|
|
|
name: "popup-create",
|
|
|
props: {
|
|
@@ -94,6 +90,10 @@ export default {
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
+ // 自定义事件
|
|
|
+ emits: {
|
|
|
+ onClick: null,
|
|
|
+ },
|
|
|
created() {
|
|
|
this.stations = this.station;
|
|
|
this.form = this.convertArray(this.data);
|
|
@@ -106,27 +106,36 @@ export default {
|
|
|
this.requestSave();
|
|
|
},
|
|
|
requestSave() {
|
|
|
- let that = this;
|
|
|
- that.API.requestData({
|
|
|
- method: "POST",
|
|
|
- baseURL: "http://10.155.32.4:8034/",
|
|
|
- subUrl: "/evaluation/saveModelMain",
|
|
|
- data: {
|
|
|
- name: that.form.name,
|
|
|
- wpids: that.form.wpids,
|
|
|
- timetypes: that.form.timetypes,
|
|
|
- createdate: new Date(),
|
|
|
- isenable: that.form.isenable,
|
|
|
- },
|
|
|
- success(res) {
|
|
|
- console.log(res);
|
|
|
+ if (this.form.name == undefined) return;
|
|
|
+ let params = {
|
|
|
+ name: this.form.name,
|
|
|
+ wpids: this.form.wpids.toString(),
|
|
|
+ timetypes: this.form.timetypes.toString(),
|
|
|
+ isenable: this.form.isenable,
|
|
|
+ };
|
|
|
+ if (this.form.id) {
|
|
|
+ params.id = this.form.id;
|
|
|
+ }
|
|
|
+
|
|
|
+ axios({
|
|
|
+ method: "post",
|
|
|
+ url: "http://10.155.32.4:8034/evaluation/saveModelMain/",
|
|
|
+ data: params,
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
},
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.form = {};
|
|
|
+ this.$emit("onClick", true);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
convertArray(form) {
|
|
|
if (form.wpids != undefined && form.timetypes != undefined) {
|
|
|
form.wpids = form.wpids.split(",");
|
|
|
form.timetypes = form.timetypes.split(",");
|
|
|
+ form.isenable = form.isenable == "是" ? 1 : 0;
|
|
|
}
|
|
|
return form;
|
|
|
},
|