{"remainingRequest":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\artfess-module\\src\\components\\datetime\\HtDate.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\artfess-module\\src\\components\\datetime\\HtDate.vue","mtime":1675232038652},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.number.constructor\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport utils from \"@/utils.js\";\nimport HtFieldTail from \"@/components/HtFieldTail.vue\";\nexport default {\n  name: \"ht-date\",\n  props: {\n    currentDate: String,\n    //当前时间\n    validate: [String, Object],\n    value: String,\n    name: String,\n    defaultTime: {\n      type: String,\n      default: \"00:00:00\"\n    },\n    permission: {\n      type: String,\n      default: \"w\",\n      validator: function validator(value) {\n        return [\"b\", \"w\", \"r\", \"n\"].indexOf(value) !== -1;\n      }\n    },\n    size: {\n      type: String,\n      default: \"small\"\n    },\n    showDate: {\n      type: Boolean,\n      default: false\n    },\n    day: Number,\n    format: {\n      type: String,\n      default: \"yyyy-MM-dd HH:mm:ss\"\n    },\n    valueFormat: {\n      type: String,\n      default: \"\"\n    },\n    placeholder: String,\n    readonly: {\n      type: Boolean,\n      default: false\n    },\n    clearable: {\n      type: Boolean,\n      default: true\n    },\n    disabled: {\n      type: Boolean,\n      default: false\n    },\n    modelExpression: {\n      type: String,\n      default: \"\"\n    }\n  },\n  components: {\n    HtFieldTail: HtFieldTail\n  },\n  watch: {\n    currentDate: function currentDate(newVal, oldVal) {\n      this.getDate(true);\n    }\n  },\n  data: function data() {\n    return {\n      type: \"datetime\",\n      inputName: null,\n      writeable: true,\n      valFormat: \"\"\n    };\n  },\n  computed: {\n    dateFormat: function dateFormat() {\n      // 通过日期格式来判断控件类型：日期、日期时间\n      if (/^\\w{4}-\\w{1,2}-\\w{1,2}$/.test(this.format)) {\n        this.type = \"date\";\n      }\n\n      return this.format ? this.format : this.valueFormat;\n    },\n    dateValueFormat: function dateValueFormat() {\n      // 通过日期格式来判断控件类型：日期、日期时间\n      if (/^\\w{4}-\\w{1,2}-\\w{1,2}$/.test(this.format)) {\n        this.type = \"date\";\n      }\n\n      return this.valueFormat ? this.valueFormat : this.format;\n    },\n    inputVal: {\n      get: function get() {\n        // 只读情况\n        if (!this.inputWriteable) {\n          var date = this.value;\n\n          if (this.value && this.value.constructor == String) {\n            var showV = this.value.replace(/\\-/g, \"/\");\n            return new Date(showV).format(this.dateFormat);\n          }\n\n          return date && date.constructor == Date ? date.format(this.dateFormat) : date;\n        }\n\n        return this.value;\n      },\n      set: function set(val) {\n        if (val && val.constructor == Date) {\n          this.$emit(\"input\", val.format(this.valFormat));\n        } else {\n          this.$emit(\"input\", val);\n        }\n      }\n    },\n    inputWriteable: function inputWriteable() {\n      return this.writeable ? utils.getWriteable(this.permission) : this.writeable;\n    },\n    inputValidate: function inputValidate() {\n      return utils.addRequiredOrNot(this.permission, this.validate, this);\n    }\n  },\n  methods: {\n    getDate: function getDate(flag) {\n      this.valFormat = this.valueFormat ? this.valueFormat : this.format;\n      this.valFormat = this.valFormat ? this.valFormat.replace(\"HH\", \"hh\") : \"yyyy-MM-dd hh:mm:ss\"; //是否显示当前日期\n\n      if ((!this.value || flag) && this.showDate) {\n        var curDate = null; //判断是否传入当前时间\n\n        if (this.currentDate) {\n          curDate = new Date(this.currentDate);\n        } else {\n          curDate = new Date();\n        }\n\n        if (this.day) {\n          //是否指定了相隔的天数\n          curDate = new Date(curDate.getTime() + this.day * 24 * 60 * 60 * 1000);\n        }\n\n        this.inputVal = curDate.format(this.valFormat);\n      }\n    }\n  },\n  created: function created() {\n    this.inputName = this.name ? this.name : utils.getName();\n    this.$validator = this.$root.$validator;\n    this.getDate(false);\n  }\n};",null]}