diff --git a/bs-ui/src/components/FileUpload/index.vue b/bs-ui/src/components/FileUpload/index.vue index 8df7012..8bcba9e 100644 --- a/bs-ui/src/components/FileUpload/index.vue +++ b/bs-ui/src/components/FileUpload/index.vue @@ -9,24 +9,32 @@ :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" - :show-file-list="false" + :show-file-list="imageOnly" :headers="headers" + :on-remove="handleRemove" + :list-type="imageOnly?'picture-card':'text'" class="upload-file-uploader" ref="fileUpload" > - - 选取文件 - + + + + + + 选取文件 + 请上传 大小不超过 {{ fileSize }}MB 格式为 {{ fileType.join("/") }} 的文件 + + - + {{ getFileName(file.oldName) }} @@ -66,6 +74,10 @@ export default { isShowTip: { type: Boolean, default: true + }, + imageOnly: { + type: Boolean, + default: false, } }, data() { @@ -161,6 +173,10 @@ export default { this.uploadedSuccessfully(); } }, + handleRemove(file) { + this.fileList = this.fileList.filter(item => item !== file); + this.$emit("input", this.fileList); + }, // 删除文件 handleDelete(index) { this.fileList.splice(index, 1); diff --git a/bs-ui/src/layout/components/Navbar.vue b/bs-ui/src/layout/components/Navbar.vue index 62a50c7..6a9d4da 100644 --- a/bs-ui/src/layout/components/Navbar.vue +++ b/bs-ui/src/layout/components/Navbar.vue @@ -5,7 +5,9 @@ - + diff --git a/bs-ui/src/views/gallery/list/index.vue b/bs-ui/src/views/gallery/list/index.vue index 0696d07..7aa215c 100644 --- a/bs-ui/src/views/gallery/list/index.vue +++ b/bs-ui/src/views/gallery/list/index.vue @@ -55,6 +55,14 @@ + + + + + + + - + + + + + + + @@ -89,8 +100,14 @@ - - + + @@ -128,6 +145,7 @@ import { getToken } from "@/utils/auth"; import { formatDateStr } from "@/utils"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import { listTag } from "@/api/task/tag"; export default { name: 'List', @@ -149,6 +167,7 @@ export default { }, data() { return { + tags: [], cates: [], defaultProps: { children: 'children', @@ -166,6 +185,7 @@ export default { rules: { imageTitle: [{ required: true, message: '请输入图片标题', trigger: 'blur' }], photoTime: [{ required: true, message: '请输入图片拍摄时间', trigger: 'change' }], + uploadTime: [{ required: true, message: '请输入上传时间', trigger: 'change' }], cataId: [{ required: true, message: '请选择图片目录', trigger: 'change' }] }, imageUrl: '', @@ -197,6 +217,11 @@ export default { const list = res.data || []; this.cates = list; }); + + listTag().then(res => { + const list = res.data || []; + this.tags = list; + }); }, methods: { @@ -211,6 +236,12 @@ normalizer(node) { children: node.children, }; }, + tagChange(tagId) { + const index = this.tags.findIndex(val => val.id === tagId); + if (index > -1 && this.tags[index].saveDir) { + this.form.cataId = this.tags[index].saveDir; + } + }, resetQueryTable() { this.$refs.multipleTable?.clearSort(); this.tableSort = {}; diff --git a/bs-ui/src/views/gallery/query/components/ImageChooseDialog.vue b/bs-ui/src/views/gallery/query/components/ImageChooseDialog.vue new file mode 100644 index 0000000..238bfd0 --- /dev/null +++ b/bs-ui/src/views/gallery/query/components/ImageChooseDialog.vue @@ -0,0 +1,278 @@ + + + + 图片目录: + + + + + + + + + + + + 搜索 + 重置 + + + + + + + {{ imageName(scope.row) }} + + + + + + + + + + + + + + + + + + + + +. \ No newline at end of file diff --git a/bs-ui/src/views/system/tag/index.vue b/bs-ui/src/views/system/tag/index.vue index 271e690..e4932ee 100644 --- a/bs-ui/src/views/system/tag/index.vue +++ b/bs-ui/src/views/system/tag/index.vue @@ -85,15 +85,19 @@ @selection-change="handleSelectionChange"> - - - + + + {{ getCateName(scope.row.saveDir) }} + + + + - + @@ -200,6 +211,9 @@ import { pageListTag, getTag, delTag, addTag, updateTag } from "@/api/system/tag"; import FileUpload from "@/components/FileUpload"; import BranchCascaderDialog from "@/components/BranchCascaderDialog"; +import Treeselect from "@riophae/vue-treeselect"; +import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import { listCata } from "@/api/gallery/cata"; // 提取表单验证规则到单独的变量 const formRules = { @@ -216,7 +230,8 @@ const formRules = { export default { components: { - FileUpload + FileUpload, + Treeselect }, name: "Tag", dicts: ['sys_yes_no'], @@ -257,13 +272,34 @@ export default { // 表单参数 form: {}, // 表单校验 - rules: formRules + rules: formRules, + cates: [], + defaultProps: { + children: 'children', + label: 'cataName' + }, }; }, created() { this.getList(); + + listCata().then(res => { + const list = res.data || []; + this.cates = list; + }); }, methods: { + normalizer(node) { + return { + id: node.id, + label: node.cataName, + children: node.children, + }; + }, + getCateName(saveDir) { + const index = this.cates.findIndex(val => val.id == saveDir); + return index > -1 ? this.cates[index].cataName : ""; + }, /** 查询标签信息列表 */ getList() { this.loading = true; diff --git a/bs-ui/src/views/task-distribut/send/other-task/components/AuditDialog.vue b/bs-ui/src/views/task-distribut/send/other-task/components/AuditDialog.vue index 8b32176..2678f91 100644 --- a/bs-ui/src/views/task-distribut/send/other-task/components/AuditDialog.vue +++ b/bs-ui/src/views/task-distribut/send/other-task/components/AuditDialog.vue @@ -116,7 +116,8 @@ export default { userDept: this.$store.getters.userInfo.dept.deptName, feedbackTime: currentDate, taskDesc: '', - status: '0' + status: '0', + tags: this.info.ctTaskTags || [], }); } } diff --git a/bs-ui/src/views/task-distribut/send/other-task/components/AuditItem.vue b/bs-ui/src/views/task-distribut/send/other-task/components/AuditItem.vue index 0c1340c..6a1e362 100644 --- a/bs-ui/src/views/task-distribut/send/other-task/components/AuditItem.vue +++ b/bs-ui/src/views/task-distribut/send/other-task/components/AuditItem.vue @@ -48,15 +48,25 @@ {{ dialogForm.taskDesc || '无' }} - - - - 附件 - - - - - + + + + + {{ tagData.tagName + '图片' }} + + + + + + + + 选择图库图片 + + + + + + @@ -186,4 +196,33 @@ export default { .desc-form-item { margin: 0; } +.tk-images { + display: flex; + flex-wrap: wrap; + margin-top: 10px; + .tk-image-item { + width: 100px; + height: 100px; + margin-right: 10px; + margin-bottom: 10px; + border: 1px solid #eee; + background-color: #f5f7fa; + border-radius: 10px; + + } + + .tk-image-select { + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + width: 100px; + height: 100px; + flex-direction: column; + + .tk-image-title { + margin-top: 10px; + } + } +} diff --git a/bs-ui/src/views/task-distribut/send/other-task/components/EditDialog.vue b/bs-ui/src/views/task-distribut/send/other-task/components/EditDialog.vue index 7764258..8f2a916 100644 --- a/bs-ui/src/views/task-distribut/send/other-task/components/EditDialog.vue +++ b/bs-ui/src/views/task-distribut/send/other-task/components/EditDialog.vue @@ -28,7 +28,7 @@ placeholder="请选择任务类型" clearable filterable - style="width: calc(100% - 125px); display: inline-block;" + style="width: 100%;" > - - 选择模板 - + @@ -80,11 +73,75 @@ > + + + 选择标签模板 + + + 选择标签 + + + + + + + + + + + + + 移除 + + + + + @@ -206,6 +263,7 @@ 确定 + @@ -213,20 +271,23 @@ import TableEditMixin from "@/mixins/table-edit-mixin"; import FileUpload from "@/components/FileUpload"; import BranchCascaderDialog from "@/components/BranchCascaderDialog"; -import {addInfo, updateInfo} from "@/api/task/info"; +import {addInfo, updateInfo } from "@/api/task/info"; import { delBranch, listBranch, } from "@/api/task/branch"; import {pageListTemplate} from "@/api/task/template"; +import TagsDialog from "./TagsDialog"; +import { delTag, listTag } from "@/api/task/tag"; export default { components: { FileUpload, BranchCascaderDialog, + TagsDialog, }, mixins: [TableEditMixin], - dicts: ['task_type'], // 添加字典声明 + dicts: ['task_type', 'sys_yes_no'], // 添加字典声明 pageInfo: { defaultForm: { status: "0", // 0未发布,1已发布 2已完成/办结 @@ -302,6 +363,14 @@ export default { this.branchList = []; this.selectBranch = []; this.getBranchList(); + + if (data.id) { + listTag({taskId: this.dialogForm.id}).then(res => { + this.$set(this.dialogForm, "tags", res.data || []); + }).catch(e => { + + }); + } }, toAdd() { this.$refs.branchCascaderDialog.open(); @@ -400,7 +469,6 @@ export default { openTemplateDialog() { this.templateDialogVisible = true; this.resetTemplateQuery(); - this.fetchTemplates(); }, async fetchTemplates() { try { @@ -433,6 +501,38 @@ export default { const textContent = taskContent.replace(/<[^>]*>/g, ''); this.dialogForm.taskContent = textContent; this.templateDialogVisible = false; + this.dialogForm.tags = this.selectedTemplate.tags.map(val => { + return { + ...val, + _id: val.id, + id: null, + }; + }); + }, + showTagsDialog() { + this.$refs.tagsDialog.open(); + }, + tagsDialogConfirm(data) { + if (!this.dialogForm.tags) { + this.$set(this.dialogForm, 'tags', []); + } + const list = data.filter(val => !this.dialogForm.tags.some(i => i._id === val.id)).map(val => { + return { + ...val, + _id: val.id, + id: null, + }; + }); + this.dialogForm.tags.push(...list); + }, + handleDelete(row, index) { + if (row.id) { + delTag(row.id).then(() => { + this.dialogForm.tags.splice(index, 1); + }); + } else { + this.dialogForm.tags.splice(index, 1); + } } }, }; diff --git a/bs-ui/src/views/task-distribut/send/other-task/components/TagsDialog.vue b/bs-ui/src/views/task-distribut/send/other-task/components/TagsDialog.vue new file mode 100644 index 0000000..7d6f956 --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/components/TagsDialog.vue @@ -0,0 +1,130 @@ + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + {{ getCateName(scope.row.saveDir) }} + + + + + + + + + + + + \ No newline at end of file