diff --git a/src/api/bst/attach.js b/src/api/bst/attach.js new file mode 100644 index 0000000..96d4cae --- /dev/null +++ b/src/api/bst/attach.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询资源列表 +export function listAttach(query) { + return request({ + url: '/bst/attach/list', + method: 'get', + params: query + }) +} + +// 查询资源详细 +export function getAttach(id) { + return request({ + url: '/bst/attach/' + id, + method: 'get' + }) +} + +// 新增资源 +export function addAttach(data) { + return request({ + url: '/bst/attach', + method: 'post', + data: data + }) +} + +// 修改资源 +export function updateAttach(data) { + return request({ + url: '/bst/attach', + method: 'put', + data: data + }) +} + +// 删除资源 +export function delAttach(id) { + return request({ + url: '/bst/attach/' + id, + method: 'delete' + }) +} diff --git a/src/api/bst/attachClassify.js b/src/api/bst/attachClassify.js new file mode 100644 index 0000000..0c0b865 --- /dev/null +++ b/src/api/bst/attachClassify.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询资源分类列表 +export function listAttachClassify(query) { + return request({ + url: '/bst/attachClassify/list', + method: 'get', + params: query + }) +} + +// 查询资源分类详细 +export function getAttachClassify(id) { + return request({ + url: '/bst/attachClassify/' + id, + method: 'get' + }) +} + +// 新增资源分类 +export function addAttachClassify(data) { + return request({ + url: '/bst/attachClassify', + method: 'post', + data: data + }) +} + +// 修改资源分类 +export function updateAttachClassify(data) { + return request({ + url: '/bst/attachClassify', + method: 'put', + data: data + }) +} + +// 删除资源分类 +export function delAttachClassify(id) { + return request({ + url: '/bst/attachClassify/' + id, + method: 'delete' + }) +} + +// 查询所有分类 +export function listAttachClassifyAll() { + return request({ + url: '/bst/attachClassify/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/components/AttachCard/index.vue b/src/components/AttachCard/index.vue index ce26c46..8d32e5e 100644 --- a/src/components/AttachCard/index.vue +++ b/src/components/AttachCard/index.vue @@ -46,6 +46,12 @@ + + +
+ +
+ @@ -65,7 +71,7 @@ export default { type: Array, default: () => [], required: false - } + }, }, data() { return { diff --git a/src/components/AvatarList/index.vue b/src/components/AvatarList/index.vue index 8f239c3..d90f11a 100644 --- a/src/components/AvatarList/index.vue +++ b/src/components/AvatarList/index.vue @@ -1,7 +1,7 @@ @@ -54,24 +91,53 @@ export default { idProp: { type: String, default: 'userId' + }, + charIndex: { + type: Number, + default: 0 + }, + maxCount: { + type: Number, + default: 0 + }, + unit: { + type: String, + default: '项' + } + }, + computed: { + showTotal() { + return this.maxCount > 0 && this.list.length > this.maxCount; + }, + displayList() { + if (this.maxCount > 0 && this.list.length > this.maxCount) { + return this.list.slice(0, this.maxCount); + } + return this.list; } }, methods: { // 获取首字 getFirstChar(name) { - return name ? name.charAt(0) : '?' + if (!name) { + return '?'; + } + if (this.charIndex < 0) { + return name.charAt(name.length + this.charIndex); + } + return name.charAt(this.charIndex); }, // 根据ID生成固定的随机颜色 getRandomColor(id) { const colors = [ - '#FFB5C5', // 浅粉色 - '#98FB98', // 浅绿色 - '#87CEFA', // 浅蓝色 - '#DDA0DD', // 梅红色 - '#F0E68C', // 浅黄色 - '#E6E6FA', // 薰衣草色 - '#FFA07A', // 浅珊瑚色 - '#B0E0E6' // 粉蓝色 + '#BBDEFB', // 浅蓝色 + '#E1BEE7', // 浅紫色 + '#C8E6C9', // 浅绿色 + '#FFE0B2', // 浅橙色 + '#CFD8DC', // 浅灰蓝色 + '#B3E5FC', // 天蓝色 + '#F8BBD0', // 浅粉色 + '#D7CCC8' // 浅棕色 ] const index = parseInt(id) % colors.length return colors[index] @@ -101,7 +167,52 @@ export default { align-items: center; justify-content: center; background-color: inherit; + font-size: 16px; + } + } + + .total-text { + border: none; + display: flex; + align-items: center; + + .total-count { + font-size: 13px; + color: #606266; + margin-left: 4px; + } + + &:hover { + transform: none; } } } + +.total-list { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 12px; + padding: 8px; + + .total-item { + display: flex; + align-items: center; + gap: 8px; + + .total-item-name { + font-size: 16px; + color: #606266; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} + +::v-deep .avatar-list-popover { + .el-popover__title { + margin: 0; + padding: 8px; + } +} \ No newline at end of file diff --git a/src/components/Business/AttachClassify/AttachClassifySelect.vue b/src/components/Business/AttachClassify/AttachClassifySelect.vue new file mode 100644 index 0000000..abecc30 --- /dev/null +++ b/src/components/Business/AttachClassify/AttachClassifySelect.vue @@ -0,0 +1,84 @@ + + + \ No newline at end of file diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index da16a07..90deaff 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -25,6 +25,12 @@ :data="uploadData" drag > + +