From 423087ff5925c1a9a1d11c14fa00ebe175b67089 Mon Sep 17 00:00:00 2001 From: jlzhou <12020042@qq.com> Date: Fri, 9 May 2025 15:21:24 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-ui/src/assets/css/login.scss | 48 +--- admin-ui/src/auto/components/WCode.vue | 228 ++++++++++++++++++ .../src/auto/components/WFileUploader.vue | 9 +- admin-ui/src/auto/components/WIcon.vue | 53 ++++ .../src/auto/components/WImageUploader.vue | 13 +- admin-ui/src/auto/components/WImageView.vue | 11 +- .../src/auto/components/WPropertiesInput.vue | 77 ++++++ admin-ui/src/views/login.vue | 4 +- admin-ui/src/views/test.vue | 11 +- admin-ui/src/views/test/icon.vue | 51 ++++ admin-ui/src/views/test/template.vue | 9 + admin-ui/src/views/test/uploader.vue | 2 + 12 files changed, 463 insertions(+), 53 deletions(-) create mode 100644 admin-ui/src/auto/components/WCode.vue create mode 100644 admin-ui/src/auto/components/WIcon.vue create mode 100644 admin-ui/src/auto/components/WPropertiesInput.vue create mode 100644 admin-ui/src/views/test/icon.vue create mode 100644 admin-ui/src/views/test/template.vue diff --git a/admin-ui/src/assets/css/login.scss b/admin-ui/src/assets/css/login.scss index 7821263..54f0d14 100644 --- a/admin-ui/src/assets/css/login.scss +++ b/admin-ui/src/assets/css/login.scss @@ -165,54 +165,24 @@ body { } &>.h2 { - margin-top: 0.6em; + margin-top: 0.7em; display: flex; justify-content: space-between; align-items: center; + color: var(--primary-color); - & label:has(input[type="checkbox"]) { - margin-top: .3em; - font-size: .9em; - --color: #aaa; - color: var(--color); - display: flex; - justify-content: flex-start; - align-items: center; - cursor: pointer; - font-weight: normal; - - &::before { - content: ""; - background-color: var(--color); - border: .13em solid var(--color); - box-sizing: border-box; - padding: .17em; - background-clip: content-box; - height: 1em; - width: 1em; - margin-right: .3em; - border-radius: 2em; - } - - &>input[type="checkbox"] { - display: none; - } + * { + font-size: .8rem; } - & label:has(input[type="checkbox"]:checked) { - --color: var(--primary-color); - } - - & label:hover { - filter: brightness(0.8); - } - - & a { - color: var(--primary-color); + &>div>div, a { text-decoration: none; &:hover { - filter: brightness(0.7); + filter: brightness(1.1); + } + &:active { + filter: brightness(.9); } } } diff --git a/admin-ui/src/auto/components/WCode.vue b/admin-ui/src/auto/components/WCode.vue new file mode 100644 index 0000000..5423d97 --- /dev/null +++ b/admin-ui/src/auto/components/WCode.vue @@ -0,0 +1,228 @@ + + + \ No newline at end of file diff --git a/admin-ui/src/auto/components/WFileUploader.vue b/admin-ui/src/auto/components/WFileUploader.vue index 3367e05..9a93813 100644 --- a/admin-ui/src/auto/components/WFileUploader.vue +++ b/admin-ui/src/auto/components/WFileUploader.vue @@ -59,6 +59,10 @@ const props = defineProps({ return r.data } }, + before: { + type: Function, + default: (file) => { return true } + }, /** * 上传路径前缀 */ @@ -256,6 +260,9 @@ const fileInputChange = () => { } const addUploadFile = async (file) => { + if (!props.before(file)) { + return + } if (props.max > 1 && props.max == data.value.length) { ElMessage.error('最多只允许上传' + props.max + '个文件') return @@ -469,7 +476,7 @@ const chunkFile = (file, chunksize) => { return chunksList; } -defineExpose({ open, reloadUploadKey }) +defineExpose({ open, reloadUploadKey,addUploadFile }) diff --git a/admin-ui/src/auto/components/WImageUploader.vue b/admin-ui/src/auto/components/WImageUploader.vue index 9e4eef9..665b22a 100644 --- a/admin-ui/src/auto/components/WImageUploader.vue +++ b/admin-ui/src/auto/components/WImageUploader.vue @@ -99,6 +99,10 @@ const props = defineProps({ return r.data } }, + before: { + type: Function, + default: (file) => { return true } + }, /** * 上传路径前缀 */ @@ -289,7 +293,10 @@ const fileInputChange = () => { } const addUploadFile = async (file) => { - console.debug(file) + + if (!props.before(file)) { + return + } if (props.max > 1 && props.max == data.value.length) { ElMessage.error('最多只允许上传' + props.max + '个文件') return @@ -337,7 +344,7 @@ const uploadFiles = async () => { console.debug('end') }).finally(() => { data.value = data.value.filter(a => !a.error && !a.abort) - console.debug('finally',data.value) + console.debug('finally', data.value) doing.value = false uploading.value = false }) @@ -412,7 +419,7 @@ const uploadFile = async (index, retry = 0) => { } -defineExpose({ open, reloadUploadKey }) +defineExpose({ open, reloadUploadKey, addUploadFile }) \ No newline at end of file diff --git a/admin-ui/src/views/login.vue b/admin-ui/src/views/login.vue index e616e6e..56e4110 100644 --- a/admin-ui/src/views/login.vue +++ b/admin-ui/src/views/login.vue @@ -27,8 +27,8 @@
-
-
忘记密码?
+
记住密码
+
忘记密码?
登 录 diff --git a/admin-ui/src/views/test.vue b/admin-ui/src/views/test.vue index 784aa80..d21a579 100644 --- a/admin-ui/src/views/test.vue +++ b/admin-ui/src/views/test.vue @@ -15,17 +15,18 @@ \ No newline at end of file diff --git a/admin-ui/src/views/test/template.vue b/admin-ui/src/views/test/template.vue new file mode 100644 index 0000000..6668e9f --- /dev/null +++ b/admin-ui/src/views/test/template.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/admin-ui/src/views/test/uploader.vue b/admin-ui/src/views/test/uploader.vue index db16d51..6f4c195 100644 --- a/admin-ui/src/views/test/uploader.vue +++ b/admin-ui/src/views/test/uploader.vue @@ -38,6 +38,7 @@ const getUploadKey =async () => {
  • 属性(watermark):是否添加水印,默认:true
  • 属性(noEffect):是否无效果,本质设置css属性,默认:false
  • 属性(list):是否显示列表,默认:true
  • +
  • 属性(before):文件添加之前的方法,返回true则继续
  • css属性(--image-size):图片显示大小,默认: 10em
  • css属性(--image-border-radius):图片显示圆角,默认: .4em
  • css属性(--image-margin):图片外边距,默认: .5em .5em 0 0
  • @@ -116,6 +117,7 @@ const getUploadKey =async () => {
  • 属性(chunksize):分片大小,默认:5Mb,不建议修改
  • 属性(list):是否显示列表,默认:true
  • 属性(border):文件项是否显示边框,默认:true
  • +
  • 属性(before):文件添加之前的方法,返回true则继续
  • 插槽(button):上传按钮插槽
  • 插槽(default):文件列表,作用域:list,不建议定义
  • 事件(change):modelValue发送了变化