diff --git a/src/assets/ditu.png b/src/assets/ditu.png new file mode 100644 index 00000000..c1c236de Binary files /dev/null and b/src/assets/ditu.png differ diff --git a/src/common/lang/en-us.js b/src/common/lang/en-us.js index 0998cd2f..cc84f8dd 100644 --- a/src/common/lang/en-us.js +++ b/src/common/lang/en-us.js @@ -1,4 +1,5 @@ const system = require('./system/en.js') +const personalCenter = require('./personalCenter/en.js') module.exports = { // 共用 @@ -112,6 +113,11 @@ module.exports = { confirmRelease: 'Confirm Release?', confirmWithdraw: 'Confirm to Withdraw?', doNotHavePermissionDeleteData: 'Do not have permission to delete this data', + + noData: 'No Data', + dataLoading: 'Data loading...', + confirmDelete: 'Confirm the listing title you want to delete?', + // 页面头部 header: { userMenuSearchMenu: 'Search menu', @@ -429,5 +435,7 @@ module.exports = { file: 'File' }, // 系统管理 - system + system, + // 个人中心 + personalCenter } diff --git a/src/common/lang/personalCenter/en.js b/src/common/lang/personalCenter/en.js new file mode 100644 index 00000000..d00f45e6 --- /dev/null +++ b/src/common/lang/personalCenter/en.js @@ -0,0 +1,27 @@ +// 个人中心的所有翻译 +module.exports = { + // 我的收藏 + collection: { + documentLibrary: 'Document Library', + problemKnowledgeBase: 'Knowledge Sharing', + serialNumber: 'No.', + title: 'Title', + status: 'Status', + collectionTime: 'Collection Time', + Collection: 'Collection', + CancelCollection: 'Cancel Collection', + confirmBulkUnsubscribe: 'Confirm Bulk Unsubscribe?', + unsubscribeConfirm: 'Unsubscribe Confirm?', + // 知识分享 + classification: 'Classification', + searchContent: 'Search Content', + + forward: 'Forward', + comment: 'Comment', + release: 'Release', + answer: 'Answer', + replyToComments: 'Reply To Comments', + noComment: 'No Comments', + cannotEmpty: 'Cannot Be Empty', + } +} diff --git a/src/common/lang/personalCenter/zh.js b/src/common/lang/personalCenter/zh.js new file mode 100644 index 00000000..c947a5da --- /dev/null +++ b/src/common/lang/personalCenter/zh.js @@ -0,0 +1,32 @@ +// 个人中心的所有翻译 +module.exports = { + // 我的收藏 + collection: { + documentLibrary: '文档库', + problemKnowledgeBase: '知识分享', + serialNumber: '编号', + title: '标题', + status: '状态', + collectionTime: '收藏时间', + collection: '收藏', + cancelCollection: '取消收藏', + batchCancel: '批量取消收藏', + + batchCancelCollection: '确认批量取消收藏?', + confirmCancelCollection: '确认取消收藏?', + + confirmBulkUnsubscribe: '确认批量取消订阅?', + unsubscribeConfirm: '确认取消订阅?', + // 知识分享 + classification: '分类', + searchContent: '搜索内容', + + forward: '转发', + comment: '评论', + release: '发布', + answer: '回复', + replyToComments: '回复评论', + noComment: '暂无评论', + cannotEmpty: '不能为空', + } +} diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index 32c0c741..682ed4aa 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -1,4 +1,5 @@ const system = require('./system/zh.js') +const personalCenter = require('./personalCenter/zh.js') module.exports = { // 共用 @@ -112,6 +113,9 @@ module.exports = { confirmRelease: '确认发布?', confirmWithdraw: '确认撤回?', doNotHavePermissionDeleteData: '没有权限删除此数据', + noData: '暂无数据', + dataLoading: '数据加载中...', + confirmDelete: '确定删除?', // 页面头部 header: { userMenuSearchMenu: '搜索菜单', @@ -429,5 +433,7 @@ module.exports = { file: '文件' }, // 系统管理 - system + system, + // 个人中心 + personalCenter } diff --git a/src/components/SelectedBy/index.vue b/src/components/SelectedBy/index.vue new file mode 100644 index 00000000..dbb00644 --- /dev/null +++ b/src/components/SelectedBy/index.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/src/components/jero/JLoading.vue b/src/components/jero/JLoading.vue new file mode 100644 index 00000000..9b22718d --- /dev/null +++ b/src/components/jero/JLoading.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/mixins/SimpleListMixin.js b/src/mixins/SimpleListMixin.js new file mode 100644 index 00000000..4134a0bb --- /dev/null +++ b/src/mixins/SimpleListMixin.js @@ -0,0 +1,252 @@ +/** + * 新增修改完成调用 modalFormOk方法 编辑弹框组件ref定义为modalForm + * 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal + * data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除 + */ +import { filterObj } from '@/utils/util' +import { getAction, postAction } from '@/api/manage' + +export const SimpleListMixin = { + data () { + return { + /* 查询条件-请不要在queryParam中声明非字符串值的属性 */ + queryParam: {}, + /* 数据源 */ + dataSource: [], + /* 分页参数 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 共' + total + '条' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + /* 排序参数 */ + isorter: { + column: 'createTime', + order: 'desc' + }, + /* 筛选参数 */ + filters: {}, + /* table加载状态 */ + loading: false, + /* table选中keys */ + selectedRowKeys: [], + /* table选中records */ + selectionRows: [], + /* 查询折叠 */ + toggleSearchStatus: false, + /* 高级查询条件生效状态 */ + superQueryFlag: false, + /* 高级查询条件 */ + superQueryParams: '', + /** 高级查询拼接方式 */ + superQueryMatchType: 'and' + } + }, + created () { + if (!this.disableMixinCreated) { + this.loadData() + // 初始化字典配置 在自己页面定义 + this.initDictConfig() + } + }, + methods: { + loadData (arg) { + if (!this.url.list) { + this.$message.error('请设置url.list属性!') + return + } + // 加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1 + } + const params = this.getQueryParams()// 查询条件 + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + // update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + // update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + initDictConfig () { + + }, + handleSuperQuery (params, matchType) { + // 高级查询方法 + if (!params) { + this.superQueryParams = '' + this.superQueryFlag = false + } else { + this.superQueryFlag = true + this.superQueryParams = JSON.stringify(params) + this.superQueryMatchType = matchType + } + this.loadData(1) + }, + getQueryParams () { + // 获取查询条件 + const sqp = {} + if (this.superQueryParams) { + sqp.superQueryParams = encodeURI(this.superQueryParams) + sqp.superQueryMatchType = this.superQueryMatchType + } + const param = Object.assign(sqp, this.queryParam, this.isorter, this.filters) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + return filterObj(param) + }, + getQueryField () { + // TODO 字段权限控制 + let str = 'id,' + this.columns.forEach(function (value) { + str += ',' + value.dataIndex + }) + return str + }, + + onSelectChange (selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + }, + onClearSelected () { + this.selectedRowKeys = [] + this.selectionRows = [] + }, + searchQuery () { + this.loadData(1) + // 点击查询清空列表选中行 + this.selectedRowKeys = [] + this.selectionRows = [] + }, + superQuery () { + this.$refs.superQueryModal.show() + }, + searchReset () { + this.queryParam = {} + this.loadData(1) + }, + batchDel () { + if (!this.url.deleteBatch) { + this.$message.error('请设置url.deleteBatch属性!') + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!') + return + } + let ids = '' + for (let a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + const that = this + this.$confirm({ + title: '确认删除', + content: '是否删除选中数据?', + onOk: function () { + that.loading = true + postAction(that.url.deleteBatch, { ids: ids }).then((res) => { + if (res.success) { + // 重新计算分页问题 + that.reCalculatePage(that.selectedRowKeys.length) + that.$message.success(res.message) + that.loadData() + that.onClearSelected() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.loading = false + }) + } + }) + }, + handleDelete: function (id) { + if (!this.url.delete) { + this.$message.error('请设置url.delete属性!') + return + } + const that = this + this.$confirm({ + title: '确认删除', + content: '确定要删除此条数据吗?', + onOk: function () { + postAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + that.$message.success(res.message) + // 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一 + if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) { + that.ipagination.current -= 1 + } + that.loadData() + } else { + that.$message.warning(res.message) + } + }) + } + }) + }, + reCalculatePage (count) { + // 总数量-count + const total = this.ipagination.total - count + // 获取删除后的分页数 + const currentIndex = Math.ceil(total / this.ipagination.pageSize) + // 删除后的分页数<所在当前页 + if (currentIndex < this.ipagination.current) { + this.ipagination.current = currentIndex + } + console.log('currentIndex', currentIndex) + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = this.$t('edit') + this.$refs.modalForm.disableSubmit = false + }, + handleAdd: function () { + this.$refs.modalForm.add() + this.$refs.modalForm.title = this.$t('newlyAdded') + this.$refs.modalForm.disableSubmit = false + }, + handleTableChange (pagination, filters, sorter) { + // 分页、排序、筛选变化时触发 + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field + this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' + } + this.ipagination = pagination + this.loadData() + }, + handleToggleSearch () { + this.toggleSearchStatus = !this.toggleSearchStatus + }, + + modalFormOk () { + // 新增/修改 成功时,重载列表 + this.loadData() + // 清空列表选中 + this.onClearSelected() + }, + handleDetail: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '详情' + this.$refs.modalForm.disableSubmit = true + } + } + +} diff --git a/src/views/personalCenter/myCollection/MyCollection.vue b/src/views/personalCenter/myCollection/MyCollection.vue new file mode 100644 index 00000000..c73bd30a --- /dev/null +++ b/src/views/personalCenter/myCollection/MyCollection.vue @@ -0,0 +1,51 @@ + + + + + + diff --git a/src/views/personalCenter/myCollection/pages/CollectionDocumentLibraryList.vue b/src/views/personalCenter/myCollection/pages/CollectionDocumentLibraryList.vue new file mode 100644 index 00000000..761a9f01 --- /dev/null +++ b/src/views/personalCenter/myCollection/pages/CollectionDocumentLibraryList.vue @@ -0,0 +1,236 @@ + + + + + + diff --git a/src/views/personalCenter/myCollection/pages/CollectionKnowledgeShareList.vue b/src/views/personalCenter/myCollection/pages/CollectionKnowledgeShareList.vue new file mode 100644 index 00000000..abbf1a01 --- /dev/null +++ b/src/views/personalCenter/myCollection/pages/CollectionKnowledgeShareList.vue @@ -0,0 +1,755 @@ + + + + + + diff --git a/src/views/personalCenter/myCollection/pages/CollectionKnowledgeShareListView.vue b/src/views/personalCenter/myCollection/pages/CollectionKnowledgeShareListView.vue new file mode 100644 index 00000000..b894fa21 --- /dev/null +++ b/src/views/personalCenter/myCollection/pages/CollectionKnowledgeShareListView.vue @@ -0,0 +1,790 @@ + + + + + diff --git a/src/views/system/tags/modules/AreaModal.vue b/src/views/system/tags/modules/AreaModal.vue index bfeb3782..b29f8b4e 100644 --- a/src/views/system/tags/modules/AreaModal.vue +++ b/src/views/system/tags/modules/AreaModal.vue @@ -54,13 +54,13 @@