2
This commit is contained in:
		
							parent
							
								
									30c5b4c8a5
								
							
						
					
					
						commit
						fd4a5faf7c
					
				@ -16,7 +16,11 @@
 | 
			
		||||
        <li
 | 
			
		||||
          v-for="item of MONTH_NAME"
 | 
			
		||||
          :key="item"
 | 
			
		||||
          :class="{ 'layui-this': MONTH_NAME.indexOf(item) === Month }"
 | 
			
		||||
          :class="{
 | 
			
		||||
            'layui-this': MONTH_NAME.indexOf(item) === Month,
 | 
			
		||||
            'layui-laydate-current':
 | 
			
		||||
              Month === '' && parseInt(item) - 1 === dayjs().month(),
 | 
			
		||||
          }"
 | 
			
		||||
          @click="handleMonthClick(item)"
 | 
			
		||||
        >
 | 
			
		||||
          {{ item.slice(0, 3) }}
 | 
			
		||||
 | 
			
		||||
@ -36,6 +36,9 @@
 | 
			
		||||
                'laydate-range-hover': ifHasRangeHoverClass(
 | 
			
		||||
                  getUnix(item, 'left')
 | 
			
		||||
                ),
 | 
			
		||||
                'layui-laydate-current':
 | 
			
		||||
                  (startTime.unix === -1 || endTime.unix === -1) &&
 | 
			
		||||
                  getUnix(item, 'left') === dayjs().startOf('month').valueOf(),
 | 
			
		||||
              }"
 | 
			
		||||
              @click="handleMonthClick(getUnix(item, 'left'))"
 | 
			
		||||
              @mouseenter="monthItemMouseEnter($event, item)"
 | 
			
		||||
@ -80,6 +83,9 @@
 | 
			
		||||
                'laydate-range-hover': ifHasRangeHoverClass(
 | 
			
		||||
                  getUnix(item, 'right')
 | 
			
		||||
                ),
 | 
			
		||||
                'layui-laydate-current':
 | 
			
		||||
                  (startTime.unix === -1 || endTime.unix === -1) &&
 | 
			
		||||
                  getUnix(item, 'right') === dayjs().startOf('month').valueOf(),
 | 
			
		||||
              }"
 | 
			
		||||
              @click="handleMonthClick(getUnix(item, 'right'))"
 | 
			
		||||
              @mouseenter="monthItemMouseEnter($event, item)"
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,10 @@
 | 
			
		||||
        <li
 | 
			
		||||
          v-for="item of yearList"
 | 
			
		||||
          :key="item"
 | 
			
		||||
          :class="{ 'layui-this': Year === item }"
 | 
			
		||||
          :class="{
 | 
			
		||||
            'layui-this': Year === item,
 | 
			
		||||
            'layui-laydate-current': !Year && item === dayjs().year(),
 | 
			
		||||
          }"
 | 
			
		||||
          @click="handleYearClick(item)"
 | 
			
		||||
        >
 | 
			
		||||
          {{ item }}
 | 
			
		||||
 | 
			
		||||
@ -27,6 +27,9 @@
 | 
			
		||||
                    (item.value == startDate || item.value == endDate)),
 | 
			
		||||
                'laydate-range-hover': ifHasRangeHoverClass(item),
 | 
			
		||||
                'layui-disabled': item.type !== 'current' && datePicker.range,
 | 
			
		||||
                'layui-laydate-current':
 | 
			
		||||
                  modelValue === -1 &&
 | 
			
		||||
                  item.value === dayjs().startOf('day').valueOf(),
 | 
			
		||||
              }"
 | 
			
		||||
              @click="handleDayClick(item)"
 | 
			
		||||
              @mouseenter="dayItemMouseEnter($event, item)"
 | 
			
		||||
@ -48,6 +51,7 @@ export default {
 | 
			
		||||
import { useI18n } from "../../../../language";
 | 
			
		||||
import { computed, inject } from "vue";
 | 
			
		||||
import { provideType } from "../../interface";
 | 
			
		||||
import dayjs from "dayjs";
 | 
			
		||||
 | 
			
		||||
export interface DateContentProps {
 | 
			
		||||
  dateList: any;
 | 
			
		||||
 | 
			
		||||
@ -248,6 +248,21 @@ html #layuicss-laydate {
 | 
			
		||||
  line-height: 26px;
 | 
			
		||||
  padding: 10px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.layui-laydate-footer .laydate-footer-btns span {
 | 
			
		||||
  border-radius: 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.layui-laydate-footer .laydate-footer-btns span:first-child {
 | 
			
		||||
  border-top-left-radius: 2px;
 | 
			
		||||
  border-bottom-left-radius: 2px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.layui-laydate-footer .laydate-footer-btns span:last-child {
 | 
			
		||||
  border-top-right-radius: 2px;
 | 
			
		||||
  border-bottom-right-radius: 2px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.layui-laydate-footer span {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  vertical-align: top;
 | 
			
		||||
@ -576,4 +591,7 @@ html #layuicss-laydate {
 | 
			
		||||
  .layui-laydate-main{
 | 
			
		||||
    width: 340px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.layui-laydate-current{
 | 
			
		||||
  background-color: var(--global-neutral-color-3);
 | 
			
		||||
}
 | 
			
		||||
@ -172,6 +172,7 @@ const slots = slot.default && slot.default();
 | 
			
		||||
const context = getCurrentInstance();
 | 
			
		||||
const emit = defineEmits([
 | 
			
		||||
  "choose",
 | 
			
		||||
  "chooseAfter",
 | 
			
		||||
  "before",
 | 
			
		||||
  "done",
 | 
			
		||||
  "error",
 | 
			
		||||
@ -193,8 +194,8 @@ const isDragEnter = ref(false);
 | 
			
		||||
const activeUploadFiles = ref<any[]>([]);
 | 
			
		||||
const activeUploadFilesImgs = ref<any[]>([]);
 | 
			
		||||
const orgFileInput = templateRef<HTMLElement>("orgFileInput");
 | 
			
		||||
let _cropper: any = null;
 | 
			
		||||
 | 
			
		||||
let _cropper: any = null;
 | 
			
		||||
let computedCutLayerOption: ComputedRef<LayerModal>;
 | 
			
		||||
 | 
			
		||||
if (props.cutOptions && props.cutOptions.layerOption) {
 | 
			
		||||
@ -264,14 +265,13 @@ const errorF = (errorText: string) => {
 | 
			
		||||
  let errorMsg = errorText ? errorText : defaultErrorMsg;
 | 
			
		||||
  errorMsg = `layui-vue:${errorMsg}`;
 | 
			
		||||
  console.warn(errorMsg);
 | 
			
		||||
  layer.msg(errorMsg, { icon: 2, time: 1000 }, function (res: unknown) { });
 | 
			
		||||
  layer.msg(errorMsg, { icon: 2, time: 1000 }, function (res: unknown) {});
 | 
			
		||||
  emit("error", Object.assign({ currentTimeStamp, msg: errorMsg }));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const localUpload = (option: localUploadOption, callback: Function) => {
 | 
			
		||||
  let xhr: XMLHttpRequest, url;
 | 
			
		||||
  xhr = new XMLHttpRequest();
 | 
			
		||||
  url = option.url;
 | 
			
		||||
  let xhr: XMLHttpRequest = new XMLHttpRequest();
 | 
			
		||||
  let url = option.url;
 | 
			
		||||
  let formData = option.formData;
 | 
			
		||||
  const cb = callback;
 | 
			
		||||
  xhr.onreadystatechange = function () {
 | 
			
		||||
@ -352,6 +352,7 @@ const uploadChange = (e: any) => {
 | 
			
		||||
    props.cut &&
 | 
			
		||||
    props.acceptMime.indexOf("image") != -1 &&
 | 
			
		||||
    props.multiple == false;
 | 
			
		||||
 | 
			
		||||
  let arm2 =
 | 
			
		||||
    props.cut &&
 | 
			
		||||
    props.acceptMime.indexOf("image") != -1 &&
 | 
			
		||||
@ -441,9 +442,22 @@ onUnmounted(() => {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="layui-upload layui-upload-wrap" :class="disabledPreview ? 'layui-upload-file-disabled' : ''">
 | 
			
		||||
    <input type="file" class="layui-upload-file" ref="orgFileInput" :name="field" :field="field" :multiple="multiple"
 | 
			
		||||
      :accept="acceptMime" :disabled="disabled" @click="clickOrgInput" @change="uploadChange" />
 | 
			
		||||
  <div
 | 
			
		||||
    class="layui-upload layui-upload-wrap"
 | 
			
		||||
    :class="disabledPreview ? 'layui-upload-file-disabled' : ''"
 | 
			
		||||
  >
 | 
			
		||||
    <input
 | 
			
		||||
      type="file"
 | 
			
		||||
      class="layui-upload-file"
 | 
			
		||||
      ref="orgFileInput"
 | 
			
		||||
      :name="field"
 | 
			
		||||
      :field="field"
 | 
			
		||||
      :multiple="multiple"
 | 
			
		||||
      :accept="acceptMime"
 | 
			
		||||
      :disabled="disabled"
 | 
			
		||||
      @click="clickOrgInput"
 | 
			
		||||
      @change="uploadChange"
 | 
			
		||||
    />
 | 
			
		||||
    <div v-if="!drag">
 | 
			
		||||
      <div class="layui-upload-btn-box" @click.stop="chooseFile">
 | 
			
		||||
        <template v-if="slot.default">
 | 
			
		||||
@ -451,18 +465,24 @@ onUnmounted(() => {
 | 
			
		||||
        </template>
 | 
			
		||||
        <template v-else>
 | 
			
		||||
          <lay-button type="primary" :disabled="disabled">{{
 | 
			
		||||
              text
 | 
			
		||||
            text
 | 
			
		||||
          }}</lay-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div v-else ref="dragRef" class="layui-upload-drag" :class="
 | 
			
		||||
      disabled
 | 
			
		||||
        ? 'layui-upload-drag-disable'
 | 
			
		||||
        : isDragEnter
 | 
			
		||||
    <div
 | 
			
		||||
      v-else
 | 
			
		||||
      ref="dragRef"
 | 
			
		||||
      class="layui-upload-drag"
 | 
			
		||||
      :class="
 | 
			
		||||
        disabled
 | 
			
		||||
          ? 'layui-upload-drag-disable'
 | 
			
		||||
          : isDragEnter
 | 
			
		||||
          ? 'layui-upload-drag-draging'
 | 
			
		||||
          : ''
 | 
			
		||||
    " @click.stop="chooseFile">
 | 
			
		||||
      "
 | 
			
		||||
      @click.stop="chooseFile"
 | 
			
		||||
    >
 | 
			
		||||
      <i class="layui-icon"></i>
 | 
			
		||||
      <p>{{ dragText }}</p>
 | 
			
		||||
      <div class="layui-hide" id="uploadDemoView">
 | 
			
		||||
@ -470,17 +490,38 @@ onUnmounted(() => {
 | 
			
		||||
        <img src="" alt="上传成功后渲染" style="max-width: 196px" />
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <lay-layer v-model="innerCutVisible" :title="computedCutLayerOption.title" :move="computedCutLayerOption.move"
 | 
			
		||||
      :resize="computedCutLayerOption.resize" :shade="computedCutLayerOption.shade"
 | 
			
		||||
      :shadeClose="computedCutLayerOption.shadeClose" :shadeOpacity="computedCutLayerOption.shadeOpacity"
 | 
			
		||||
      :zIndex="computedCutLayerOption.zIndex" :btnAlign="computedCutLayerOption.btnAlign"
 | 
			
		||||
      :area="computedCutLayerOption.area" :anim="computedCutLayerOption.anim"
 | 
			
		||||
      :isOutAnim="computedCutLayerOption.isOutAnim" :btn="computedCutLayerOption.btn" @close="clearAllCutEffect">
 | 
			
		||||
      <div class="copper-container" v-for="(base64str, index) in activeUploadFilesImgs" :key="`file${index}`">
 | 
			
		||||
        <img :src="base64str" :id="`_lay_upload_img${index}`" class="_lay_upload_img" />
 | 
			
		||||
    <lay-layer
 | 
			
		||||
      v-model="innerCutVisible"
 | 
			
		||||
      :title="computedCutLayerOption.title"
 | 
			
		||||
      :move="computedCutLayerOption.move"
 | 
			
		||||
      :resize="computedCutLayerOption.resize"
 | 
			
		||||
      :shade="computedCutLayerOption.shade"
 | 
			
		||||
      :shadeClose="computedCutLayerOption.shadeClose"
 | 
			
		||||
      :shadeOpacity="computedCutLayerOption.shadeOpacity"
 | 
			
		||||
      :zIndex="computedCutLayerOption.zIndex"
 | 
			
		||||
      :btnAlign="computedCutLayerOption.btnAlign"
 | 
			
		||||
      :area="computedCutLayerOption.area"
 | 
			
		||||
      :anim="computedCutLayerOption.anim"
 | 
			
		||||
      :isOutAnim="computedCutLayerOption.isOutAnim"
 | 
			
		||||
      :btn="computedCutLayerOption.btn"
 | 
			
		||||
      @close="clearAllCutEffect"
 | 
			
		||||
    >
 | 
			
		||||
      <div
 | 
			
		||||
        class="copper-container"
 | 
			
		||||
        v-for="(base64str, index) in activeUploadFilesImgs"
 | 
			
		||||
        :key="`file${index}`"
 | 
			
		||||
      >
 | 
			
		||||
        <img
 | 
			
		||||
          :src="base64str"
 | 
			
		||||
          :id="`_lay_upload_img${index}`"
 | 
			
		||||
          class="_lay_upload_img"
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
    </lay-layer>
 | 
			
		||||
    <div class="layui-upload-list" :class="disabledPreview ? 'layui-upload-list-disabled' : ''">
 | 
			
		||||
    <div
 | 
			
		||||
      class="layui-upload-list"
 | 
			
		||||
      :class="disabledPreview ? 'layui-upload-list-disabled' : ''"
 | 
			
		||||
    >
 | 
			
		||||
      <slot name="preview"></slot>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user