|  | @@ -1,104 +1,102 @@
 | 
											
												
													
														|  |  <template>
 |  |  <template>
 | 
											
												
													
														|  |    <el-form
 |  |    <el-form
 | 
											
												
													
														|  |      class="save-form"
 |  |      class="save-form"
 | 
											
												
													
														|  | -    v-bind="{...$attrs, ...$props}"
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +    v-bind="{ ...$attrs, ...$props }"
 | 
											
												
													
														|  |      v-on="$listeners"
 |  |      v-on="$listeners"
 | 
											
												
													
														|  |      @submit.stop.native="submit"
 |  |      @submit.stop.native="submit"
 | 
											
												
													
														|  |      @reset.stop.native="reset"
 |  |      @reset.stop.native="reset"
 | 
											
												
													
														|  |      ref="form"
 |  |      ref="form"
 | 
											
												
													
														|  |    >
 |  |    >
 | 
											
												
													
														|  | -    <slot/>
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <slot />
 | 
											
												
													
														|  |    </el-form>
 |  |    </el-form>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  <script>
 |  |  <script>
 | 
											
												
													
														|  | -import { Searchs } from '@/helpers'
 |  | 
 | 
											
												
													
														|  | 
 |  | +import { Searchs } from "@/helpers";
 | 
											
												
													
														|  |  export default {
 |  |  export default {
 | 
											
												
													
														|  | -  name: 'save-form',
 |  | 
 | 
											
												
													
														|  | -  props: ['model', 'save-key', 'noclear'],
 |  | 
 | 
											
												
													
														|  | 
 |  | +  name: "save-form",
 | 
											
												
													
														|  | 
 |  | +  props: ["model", "save-key", "noclear"],
 | 
											
												
													
														|  |    data() {
 |  |    data() {
 | 
											
												
													
														|  |      return {
 |  |      return {
 | 
											
												
													
														|  | -      searchs: null
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | 
 |  | +      searchs: null,
 | 
											
												
													
														|  | 
 |  | +    };
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    mounted() {
 |  |    mounted() {
 | 
											
												
													
														|  | -    this.setFormValue()
 |  | 
 | 
											
												
													
														|  | 
 |  | +    this.setFormValue();
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    methods: {
 |  |    methods: {
 | 
											
												
													
														|  |      setFormValue() {
 |  |      setFormValue() {
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -      const searchs = new Searchs(this.saveKey || this.$route.path)
 |  | 
 | 
											
												
													
														|  | -      this.searchs = searchs
 |  | 
 | 
											
												
													
														|  | -      const active = searchs.get()
 |  | 
 | 
											
												
													
														|  | 
 |  | +      const searchs = new Searchs(this.saveKey || this.$route.path);
 | 
											
												
													
														|  | 
 |  | +      this.searchs = searchs;
 | 
											
												
													
														|  | 
 |  | +      const active = searchs.get();
 | 
											
												
													
														|  |        for (const key in active.form) {
 |  |        for (const key in active.form) {
 | 
											
												
													
														|  |          if (active.form.hasOwnProperty(key)) {
 |  |          if (active.form.hasOwnProperty(key)) {
 | 
											
												
													
														|  | -          const item = active.form[key]
 |  | 
 | 
											
												
													
														|  | -          this.model[key] = item
 |  | 
 | 
											
												
													
														|  | 
 |  | +          const item = active.form[key];
 | 
											
												
													
														|  | 
 |  | +          this.model[key] = item;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |        if (this.saveKey) {
 |  |        if (this.saveKey) {
 | 
											
												
													
														|  | -        this.searchs.update(this.$route.path, undefined, 'bind')
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.searchs.update(this.$route.path, undefined, "bind");
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      submit(evt) {
 |  |      submit(evt) {
 | 
											
												
													
														|  | -      evt.stopPropagation()
 |  | 
 | 
											
												
													
														|  | -      evt.stopImmediatePropagation()
 |  | 
 | 
											
												
													
														|  | -      evt.preventDefault()
 |  | 
 | 
											
												
													
														|  | 
 |  | +      evt.stopPropagation();
 | 
											
												
													
														|  | 
 |  | +      evt.stopImmediatePropagation();
 | 
											
												
													
														|  | 
 |  | +      evt.preventDefault();
 | 
											
												
													
														|  |        if (this.saveKey) {
 |  |        if (this.saveKey) {
 | 
											
												
													
														|  | -        this.searchs.update(this.$route.path, undefined, 'bind')
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.searchs.update(this.$route.path, undefined, "bind");
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  | -      this.searchs.update(this.model, undefined, 'form')
 |  | 
 | 
											
												
													
														|  | -        //  (  new Searchs().searchs)
 |  | 
 | 
											
												
													
														|  | 
 |  | +      this.searchs.update(this.model, undefined, "form");
 | 
											
												
													
														|  | 
 |  | +      //  (  new Searchs().searchs)
 | 
											
												
													
														|  |        if (this.$listeners.submit) {
 |  |        if (this.$listeners.submit) {
 | 
											
												
													
														|  | -        this.$listeners.submit(evt)
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.$listeners.submit(evt);
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      reset(evt) {
 |  |      reset(evt) {
 | 
											
												
													
														|  | -      evt.stopPropagation()
 |  | 
 | 
											
												
													
														|  | -      evt.stopImmediatePropagation()
 |  | 
 | 
											
												
													
														|  | -      evt.preventDefault()
 |  | 
 | 
											
												
													
														|  | -      let setItemEvent = new Event('watchStorage')
 |  | 
 | 
											
												
													
														|  | -      window.dispatchEvent(setItemEvent)
 |  | 
 | 
											
												
													
														|  | 
 |  | +      evt.stopPropagation();
 | 
											
												
													
														|  | 
 |  | +      evt.stopImmediatePropagation();
 | 
											
												
													
														|  | 
 |  | +      evt.preventDefault();
 | 
											
												
													
														|  | 
 |  | +      let setItemEvent = new Event("watchStorage");
 | 
											
												
													
														|  | 
 |  | +      window.dispatchEvent(setItemEvent);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        if (this.$listeners.reset) {
 |  |        if (this.$listeners.reset) {
 | 
											
												
													
														|  |          if (this.noclear == undefined) {
 |  |          if (this.noclear == undefined) {
 | 
											
												
													
														|  |            this.$nextTick(() => {
 |  |            this.$nextTick(() => {
 | 
											
												
													
														|  | -            this.resetFields()
 |  | 
 | 
											
												
													
														|  | 
 |  | +            this.resetFields();
 | 
											
												
													
														|  |              // this.setFormValue()
 |  |              // this.setFormValue()
 | 
											
												
													
														|  | -          })
 |  | 
 | 
											
												
													
														|  | 
 |  | +          });
 | 
											
												
													
														|  |          } else {
 |  |          } else {
 | 
											
												
													
														|  | -          this.resetFields()
 |  | 
 | 
											
												
													
														|  | 
 |  | +          this.resetFields();
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        this.$listeners.reset()
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.$listeners.reset();
 | 
											
												
													
														|  |        } else {
 |  |        } else {
 | 
											
												
													
														|  | -        this.resetFields()
 |  | 
 | 
											
												
													
														|  | 
 |  | +        this.resetFields();
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  | -    save(search = null, type = 'form') {
 |  | 
 | 
											
												
													
														|  | -      search = search ? search : this.model
 |  | 
 | 
											
												
													
														|  | -      this.searchs.update(search, undefined, type)
 |  | 
 | 
											
												
													
														|  | 
 |  | +    save(search = null, type = "form") {
 | 
											
												
													
														|  | 
 |  | +      search = search ? search : this.model;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +      this.searchs.update(search, undefined, type);
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      validate(FC) {
 |  |      validate(FC) {
 | 
											
												
													
														|  | -      this.$refs.form.validate(valid => {
 |  | 
 | 
											
												
													
														|  | -        FC(valid)
 |  | 
 | 
											
												
													
														|  | 
 |  | +      this.$refs.form.validate((valid) => {
 | 
											
												
													
														|  | 
 |  | +        FC(valid);
 | 
											
												
													
														|  |          if (valid) {
 |  |          if (valid) {
 | 
											
												
													
														|  | -          this.searchs.update(this.model, undefined, 'form')
 |  | 
 | 
											
												
													
														|  | 
 |  | +          this.searchs.update(this.model, undefined, "form");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -      })
 |  | 
 | 
											
												
													
														|  | 
 |  | +      });
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |      resetFields() {
 |  |      resetFields() {
 | 
											
												
													
														|  | -      this.$refs.form.resetFields()
 |  | 
 | 
											
												
													
														|  | -      this.searchs.update(this.model, undefined, 'form')
 |  | 
 | 
											
												
													
														|  | -      this.searchs.update({}, undefined, 'page')
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | 
 |  | +      this.$refs.form.resetFields();
 | 
											
												
													
														|  | 
 |  | +      this.searchs.update(this.model, undefined, "form");
 | 
											
												
													
														|  | 
 |  | +      this.searchs.update({}, undefined, "page");
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  | -}
 |  | 
 | 
											
												
													
														|  | 
 |  | +};
 | 
											
												
													
														|  |  </script>
 |  |  </script>
 | 
											
												
													
														|  |  <style lang="less" scoped>
 |  |  <style lang="less" scoped>
 | 
											
												
													
														|  | -.save-form{
 |  | 
 | 
											
												
													
														|  | -  ::v-deep  .el-input__inner{
 |  | 
 | 
											
												
													
														|  | 
 |  | +.save-form {
 | 
											
												
													
														|  | 
 |  | +  ::v-deep .el-input__inner {
 | 
											
												
													
														|  |      width: 180px;
 |  |      width: 180px;
 | 
											
												
													
														|  |      overflow: hidden;
 |  |      overflow: hidden;
 | 
											
												
													
														|  |      text-overflow: ellipsis;
 |  |      text-overflow: ellipsis;
 | 
											
										
											
												
													
														|  | @@ -106,22 +104,21 @@ export default {
 | 
											
												
													
														|  |    ::v-deep .el-select {
 |  |    ::v-deep .el-select {
 | 
											
												
													
														|  |      width: 100%;
 |  |      width: 100%;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -  ::v-deep .el-date-editor.el-input{
 |  | 
 | 
											
												
													
														|  | 
 |  | +  ::v-deep .el-date-editor.el-input {
 | 
											
												
													
														|  |      width: 180px;
 |  |      width: 180px;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -  ::v-deep  .el-form-item__content .el-col {
 |  | 
 | 
											
												
													
														|  | 
 |  | +  ::v-deep .el-form-item__content .el-col {
 | 
											
												
													
														|  |      width: 180px;
 |  |      width: 180px;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -  ::v-deep  .el-col.line{
 |  | 
 | 
											
												
													
														|  | -    width: 15px!important;
 |  | 
 | 
											
												
													
														|  | 
 |  | +  ::v-deep .el-col.line {
 | 
											
												
													
														|  | 
 |  | +    width: 15px !important;
 | 
											
												
													
														|  |      text-align: center;
 |  |      text-align: center;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -  ::v-deep  .el-date-editor--daterange{
 |  | 
 | 
											
												
													
														|  | 
 |  | +  ::v-deep .el-date-editor--daterange {
 | 
											
												
													
														|  |      width: 375px;
 |  |      width: 375px;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | -  ::v-deep  .el-form-item__content .el-col:last-child .el-form-item{
 |  | 
 | 
											
												
													
														|  | 
 |  | +  ::v-deep .el-form-item__content .el-col:last-child .el-form-item {
 | 
											
												
													
														|  |      margin-right: 0;
 |  |      margin-right: 0;
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  </style>
 |  |  </style>
 |