ZZJ
2021-11-09 ccee429d379e0108b7445f72ade8d97c110a6fb3
src/pages/library/components/addBase.vue
@@ -5,7 +5,7 @@
      :model="form"
      :rules="rules"
      label-width="150px"
      class="mt50"
      class="add-base-form"
      label-position="left"
    >
      <el-row>
@@ -75,7 +75,7 @@
            required
            prop="startTime"
          >
            <el-col :span="11" class="pick-time">
            <el-col :span="11" class>
              <el-date-picker
                size="small"
                type="datetime"
@@ -121,11 +121,11 @@
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row> -->
      </el-row>-->
      <el-row>
        <el-col :span="6" :offset="15">
          <el-form-item style="margin-top:50px;text-align:right;" label-width="0px">
            <el-button type="info" size="small" @click="onCancle">取消</el-button>
            <el-button type="info" size="small" @click="onCancle" style="color:#222">取消</el-button>
            <el-button type="primary" size="small" @click="onSubmit('baseForm')" class="save">保存</el-button>
          </el-form-item>
        </el-col>
@@ -193,7 +193,7 @@
    baseObject: function (newVal, oldVal) {
      this.foreverChecked = false
      this.form = newVal
      console.log(this.form,'baseObject')
      console.log(this.form, 'baseObject')
      if (!newVal.endTime || newVal.endTime === undefined || newVal.endTime === null) {
        this.form.isForever = '1'
        this.foreverChecked = true
@@ -249,7 +249,7 @@
              tableName: this.form.tableName,
              startTime: this.$moment(this.form.startTime).format('YYYY-MM-DD HH:mm:ss'),
              tableType: this.form.tableType,
              isForever: this.foreverChecked ? '1':'0',
              isForever: this.foreverChecked ? '1' : '0',
              id: this.form.id,
              endTime: this.form.endTime ? this.$moment(this.form.endTime).format('YYYY-MM-DD HH:mm:ss') : '',
              bwType: this.form.bwType,
@@ -283,7 +283,7 @@
              tableName: this.form.tableName,
              startTime: this.$moment(this.form.startTime).format('YYYY-MM-DD 00:00:00'),
              tableType: this.form.tableType,
              isForever: this.foreverChecked ? '1':'0',
              isForever: this.foreverChecked ? '1' : '0',
              id: this.form.id,
              endTime: this.form.endTime ? this.$moment(this.form.endTime).format('YYYY-MM-DD 23:59:59') : '',
              bwType: this.form.bwType,
@@ -309,7 +309,7 @@
        })
      }
    },
    onCancle(){
    onCancle() {
      this.$emit('closeAdd')
    },
    forever(value) {
@@ -319,14 +319,14 @@
    },
    init() {
      console.log('添加底库表单收到的数据', this.baseObject, this.type)
      if(Object.keys(this.baseObject).length > 3){
      if (Object.keys(this.baseObject).length > 3) {
        this.form = this.baseObject
        if (!this.form.endTime) {
          this.foreverChecked = true
        } else {
          this.foreverChecked = false
        }
      }else{
      } else {
        this.$refs.baseForm.resetFields()
      }
    },
@@ -386,6 +386,9 @@
}
</script>
<style lang="scss">
.add-base-form {
  margin-top: 50px;
}
.el-radio__inner {
  border: 1px solid #dcdfe6;
  border-radius: 100%;
@@ -396,10 +399,10 @@
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.el-radio__input.is-checked .el-radio__inner {
  border-color: #3d68e1;
  background: #3d68e1;
}
// .el-radio__input.is-checked .el-radio__inner {
//   border-color: #3d68e1;
//   background: #3d68e1;
// }
.save {
  background: #3d68e1;
  border-radius: 2px;
@@ -447,15 +450,15 @@
    line-height: 40px;
    outline: none;
    padding: 0 0 0 15px;
    -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
    -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 100%;
  }
  .el-input--prefix .el-input__inner {
    padding-left: 22px;
  }
  .el-input--suffix .el-input__inner {
      padding-right: 0;
    padding-right: 0;
  }
  .el-input__prefix {
    position: absolute;
@@ -463,7 +466,7 @@
    left: 0px;
    top: 0;
    text-align: center;
    color: #C0C4CC;
    color: #c0c4cc;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
  }
@@ -473,10 +476,13 @@
    right: -2px;
    top: 0;
    text-align: center;
    color: #C0C4CC;
    color: #c0c4cc;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    pointer-events: none;
  }
  .el-button--info {
    color: #222222 !important;
  }
}
</style>