diff --git a/package.json b/package.json index 5ee4b16..1d951d9 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "lib": "vue-cli-service build --target lib --dest lib packages/index.js" }, "dependencies": { - "core-js": "^3.8.3" + "core-js": "^3.8.3", + "vuedraggable": "^2.24.3" }, "devDependencies": { "@vue/cli-plugin-babel": "~5.0.0", @@ -20,9 +21,9 @@ "element-ui": "^2.15.14", "sass": "^1.32.7", "sass-loader": "^12.0.0", - "vue-template-compiler": "^2.6.14", "vue": "^2.6.14", "vue-router": "^3.5.1", + "vue-template-compiler": "^2.6.14", "vuex": "^3.6.2" }, "browserslist": [ diff --git a/packages/agUpload/src/index.vue b/packages/agUpload/src/index.vue index caaf0b5..cd7e4ba 100644 --- a/packages/agUpload/src/index.vue +++ b/packages/agUpload/src/index.vue @@ -1,28 +1,75 @@ - @@ -108,17 +339,25 @@ aspect-ratio: 1/1; border-radius: 4px; background-color: #fff; - cursor: pointer; + cursor: pointer; overflow: hidden; .uploadlabel{ font-size: 16px; color:#97a8be; display: block; width:100%; + cursor: pointer; height:100%; display: flex; align-items: center; justify-content: center; + flex-direction: column; + .draptiptext{ + font-size:13px; + color:#666; + text-align: center; + margin-top: 5px; + } } } .uploadimgbox{ @@ -135,6 +374,23 @@ border-radius: 4px; overflow: hidden; aspect-ratio: 1/1; + transition: all .3s; + &.imghover:hover{ + cursor: move; + } + &.tabsbg{ + border-radius:6px 6px 0 0; + background:#fff; + overflow:hidden; + } + &.opcacityzero{ + opacity: 0; + } + &.moving{ + opacity: 0; + visibility: hidden; + } + img{ display: block; aspect-ratio: 1/1; @@ -151,20 +407,199 @@ align-items: center; justify-content: center; gap:6px; + z-index: 1; i{ font-size: 20px; color:#fff; cursor: pointer; } } - &:hover{ + &:hover{ .uploadimgmask{ display: flex; } } } + .filetext{ + font-size:12px; + display: flex; + justify-content: center; + flex-direction: column; + padding:5px; + box-sizing: border-box; + overflow: hidden; + height:100%; + white-space: nowrap; /* 文本不换行 */ + overflow: hidden; /* 隐藏溢出的内容 */ + text-overflow: ellipsis; + text-align: center; + .filetitletext{ + font-size:15px; + } + } } +.uploadtextbox{ + .uploadtextcontain{ + .uploadtextcontaindefaultbtn{ + display:flex; + align-items:center; + gap:5px; + background: #fff; + width:fit-content; + padding:5px 12px; + box-sizing: border-box; + border-radius:4px; + font-size:13px; + } + } + .uploadtextlist{ + display: block; + list-style-type: disc; + margin-inline-start: 0px; + margin-inline-end: 0px; + padding-inline-start: 40px; + unicode-bidi: isolate; + margin: 0; + padding: 0; + list-style: none; + .upload-list--text{ + &:first-child{ + margin-top: 10px; + } + position: relative; + list-style: none; + transition: all .5s cubic-bezier(.55,0,.1,1); + font-size: 14px; + color: #606266; + line-height:1; + margin-top: 5px; + position: relative; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + cursor: pointer; + border-radius: 4px; + width: 100%; + &:hover{ + background-color: #f5f7fa; + .ag-icon-close{ + display:inline-block; + } + } + + .ag-upload-list__item-name{ + text-decoration: none; + color: #606266; + display: block; + margin-right: 40px; + overflow: hidden; + padding-left: 4px; + text-overflow: ellipsis; + transition: color .3s; + white-space: nowrap; + font-size: 14px; + line-height: 1.8; + .ag-icon-document{ + height: 100%; + margin-right: 7px; + color: #909399; + line-height: inherit; + &:hover{ + color: #409eff; + cursor: pointer; + } + } + } + .el-icon-close{ + position: relative; + right: 5px; + cursor: pointer; + opacity: .75; + color: #606266; + display:none; + } + } + } + .upload-list--picture{ + margin: 0; + padding: 0; + list-style: none; + .uploadtextitem{ + overflow: hidden; + position: relative; + z-index: 0; + background-color: #fff; + border: 1px solid #c0ccda; + border-radius: 6px; + box-sizing: border-box; + margin-top: 10px; + padding: 10px 10px 10px 90px; + height: 92px; + gap:10px; + display: flex; + align-items: center; + cursor: pointer; + &:hover{ + .ag-icon-close{ + display:inline-block; + } + } + .ag-upload-list__item-thumbnail{ + vertical-align: middle; + display: inline-block; + width: 70px; + height: 70px; + float: left; + position: relative; + z-index: 1; + margin-left: -80px; + background: #fff; + } + .ag-upload-list__item-name{ + flex:1; + color: #606266; + display: block; + margin-right: 40px; + overflow: hidden; + padding-left: 4px; + text-overflow: ellipsis; + transition: color .3s; + white-space: nowrap; + line-height: 70px; + margin-top: 0; + text-decoration: none; + .ag-icon-document{ + display:none; + } + &:hover{ + color: #409eff; + cursor: pointer; + } + } + + .ag-icon-close{ + position: absolute; + font-family: element-icons !important; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + line-height: 1; + vertical-align: baseline; + display: none; + -webkit-font-smoothing: antialiased; + line-height: 1; + top: 5px; + right: 5px; + cursor: pointer; + opacity: .75; + color: #606266; + } + } + } +} ::v-deep { .el-table { width: 100%; diff --git a/src/App.vue b/src/App.vue index bfbf534..c6a555f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -47,8 +47,9 @@
{{row.date}}
- - + + 点击上传 +
只能上传jpg/png文件,且不超过500kb