From 98a1a0cb6912319b33b64ebde726ef3fd95b3d61 Mon Sep 17 00:00:00 2001 From: wx-jincw Date: Sun, 23 Feb 2025 11:25:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=81=E7=A7=BB=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BranchCascaderDialog/index.vue | 121 +++++++ bs-ui/src/mixins/common-mixin.js | 45 +++ bs-ui/src/mixins/dict-mixin.js | 40 +++ bs-ui/src/mixins/table-edit-mixin.js | 67 ++++ bs-ui/src/mixins/table-mixin.js | 150 ++++++++ .../components/ReviewConclusionRules.vue | 60 ++++ .../components/SectionTitle.vue | 71 ++++ .../feedback/other-task/index.vue | 266 ++++++++++++++ .../other-task/components/AuditDialog.vue | 147 ++++++++ .../send/other-task/components/AuditItem.vue | 189 ++++++++++ .../send/other-task/components/Detail.vue | 89 +++++ .../send/other-task/components/EditDialog.vue | 333 ++++++++++++++++++ .../other-task/components/RemarkDialog.vue | 80 +++++ .../task-distribut/send/other-task/index.vue | 271 ++++++++++++++ 14 files changed, 1929 insertions(+) create mode 100644 bs-ui/src/components/BranchCascaderDialog/index.vue create mode 100644 bs-ui/src/mixins/common-mixin.js create mode 100644 bs-ui/src/mixins/dict-mixin.js create mode 100644 bs-ui/src/mixins/table-edit-mixin.js create mode 100644 bs-ui/src/mixins/table-mixin.js create mode 100644 bs-ui/src/views/task-distribut/components/ReviewConclusionRules.vue create mode 100644 bs-ui/src/views/task-distribut/components/SectionTitle.vue create mode 100644 bs-ui/src/views/task-distribut/feedback/other-task/index.vue create mode 100644 bs-ui/src/views/task-distribut/send/other-task/components/AuditDialog.vue create mode 100644 bs-ui/src/views/task-distribut/send/other-task/components/AuditItem.vue create mode 100644 bs-ui/src/views/task-distribut/send/other-task/components/Detail.vue create mode 100644 bs-ui/src/views/task-distribut/send/other-task/components/EditDialog.vue create mode 100644 bs-ui/src/views/task-distribut/send/other-task/components/RemarkDialog.vue create mode 100644 bs-ui/src/views/task-distribut/send/other-task/index.vue diff --git a/bs-ui/src/components/BranchCascaderDialog/index.vue b/bs-ui/src/components/BranchCascaderDialog/index.vue new file mode 100644 index 0000000..b8c775d --- /dev/null +++ b/bs-ui/src/components/BranchCascaderDialog/index.vue @@ -0,0 +1,121 @@ + + + + + \ No newline at end of file diff --git a/bs-ui/src/mixins/common-mixin.js b/bs-ui/src/mixins/common-mixin.js new file mode 100644 index 0000000..4043920 --- /dev/null +++ b/bs-ui/src/mixins/common-mixin.js @@ -0,0 +1,45 @@ + +const CommonMixin = { + computed: { + // MXCombiQuery() { + // return { + // ...this.query, + // ...this.tableSort, + // }; + // }, + // MXCombiListQuery() { + // return { + // ...this.MXCombiQuery, + // ...this.page, + // }; + // } + }, + methods: { + MXCombiQuery() { + return { + ...this.query, + ...this.tableSort, + }; + }, + MXCombiListQuery() { + return { + ...this.MXCombiQuery(), + ...this.page, + }; + }, + // 删除提示 + $deleteConfirm(text = '') { + return this.$confirm(`确定删除数据${text}?`, '删除提示', { + type: 'warning' + }); + }, + // 批量删除提示 + $multDelConfirm(text = '') { + return this.$confirm(`确定删除选中的数据${text}?`, '批量删除提示', { + type: 'warning' + }); + }, + } +} + +export default CommonMixin; diff --git a/bs-ui/src/mixins/dict-mixin.js b/bs-ui/src/mixins/dict-mixin.js new file mode 100644 index 0000000..b6811f4 --- /dev/null +++ b/bs-ui/src/mixins/dict-mixin.js @@ -0,0 +1,40 @@ + +const DictMixin = { + dicts: [], + computed: { + dict() { + return this.$store.getters.dict; + } + }, + created() { + if (this.$options.dicts) { + const noDicts = []; + const hasDicts = []; + this.$options.dicts.forEach((type) => { + if (!this.dict[type]) { + noDicts.push(type); + } else { + hasDicts.push(type); + } + }); + + if (hasDicts.length > 0 && this.MXDictFetched) { + this.MXDictFetched(hasDicts); + } + + if (noDicts.length === 0) { + return; + } + this.$store.dispatch('dict/fetchDict', { + types: noDicts, + success: () => { + if (this.MXDictFetched) { + this.MXDictFetched(noDicts); + } + } + }); + } + } +} + +export default DictMixin; diff --git a/bs-ui/src/mixins/table-edit-mixin.js b/bs-ui/src/mixins/table-edit-mixin.js new file mode 100644 index 0000000..57f7d0c --- /dev/null +++ b/bs-ui/src/mixins/table-edit-mixin.js @@ -0,0 +1,67 @@ +export default { + name: 'EditDialog', + pageInfo: { + defaultForm: {}, + title: '', + updateApi: null, + addApi: null, + }, + data() { + return { + saving: false, + dialogVisible: false, + dialogForm: { ...this.$options.pageInfo.defaultForm }, + rules: {}, + title: '' + } + }, + methods: { + open(data = {}) { + this.title = `${data.id ? '编辑': '新增'}${this.$options.pageInfo.title}`; + this.dialogVisible = true; + this.dialogForm = { ...this.$options.pageInfo.defaultForm, ...data }; + this.$nextTick(() => { + this.$refs.dialogForm.clearValidate(); + }); + }, + closeVisible() { + this.dialogVisible = false; + }, + combinDialogForm() { + return this.dialogForm; + }, + mixin_isEdit() { + return !!this.dialogForm.id; + }, + submitForm() { + this.$refs.dialogForm.validate((valid) => { + if (valid) { + this.saving = true; + if (this.mixin_isEdit()) { + this.$options.pageInfo.updateApi(this.combinDialogForm()).then(res => { + this.saving = false; + this.$message.success('编辑成功'); + this.$emit('refresh'); + this.closeVisible(); + }).catch(() => { + this.saving = false; + }); + } else { + this.$options.pageInfo.addApi(this.combinDialogForm()).then(res => { + this.saving = false; + this.$message.success('新增成功'); + this.$emit('refresh'); + this.closeVisible(); + }).catch(() => { + this.saving = false; + }); + } + } else { + this.submitValidateErr(); + } + }); + }, + submitValidateErr() { + } + } +} \ No newline at end of file diff --git a/bs-ui/src/mixins/table-mixin.js b/bs-ui/src/mixins/table-mixin.js new file mode 100644 index 0000000..3545092 --- /dev/null +++ b/bs-ui/src/mixins/table-mixin.js @@ -0,0 +1,150 @@ +export default { + pageInfo: { + title: '列表数据', + exportUrl: '', + pageListApi: null, + deleteApi: null, + defaultQuery: {}, + // 是否手动加载 + customLoad: false, + // 是否添加导出日志 + isLog: false, + }, + data() { + return { + // 表格相关参数start + tableLoading: false, + total: 0, + selectrows: [], + tableData: [], + page: { + ...this.MXDefaultPage() + }, + query: { ...this.MXPageInfo().defaultQuery }, + tableSort: {}, + // 表格相关参数end + }; + }, + created() { + this.MXCreated(); + if (this.MXPageInfo().customLoad) { + return; + } + this.getTableList(); + }, + methods: { + MXCreated() { + + }, + MXPageInfo() { + return this.$options.pageInfo || {} + }, + MXDefaultPage() { + return { + pageNum: 1, + pageSize: 10, + }; + }, + // 导出数据 + exportData(e) { + this.$exportExcelData( + this, + this.MXPageInfo().exportUrl, + `${this.MXPageInfo().title}.xlsx`, + null, + this.MXCombiQuery(), + false, + null, + !(e && e.hideConfirm), + { + isLog: this.MXPageInfo().isLog, + } + ).then(() => { + this.$emit('exportData', {...this.query}); + }); + + }, + async getTableList() { + if (this.$refs.seachForm && this.queryRules) { + const valid = await this.$refs.seachForm.validate(); + if (!valid) { + + return; + } + } + + this.$emit('getTableList', {...this.query}); + if (!this.MXPageInfo().pageListApi) { + return; + } + this.tableLoading = true; + console.log('合成入参:', this.MXCombiListQuery()); + this.MXPageInfo().pageListApi(this.MXCombiListQuery()) + .then((response) => { + this.tableData = response.items || response.rows || response || []; + this.total = response.count || this.tableData.length; + this.tableLoading = false; + this.didGetTableList(true); + }) + .catch((_) => { + this.tableLoading = false; + this.didGetTableList(false); + }); + }, + didGetTableList(success) { + + }, + queryTable() { + this.page = { + ...this.MXDefaultPage() + }; + this.getTableList(); + }, + resetQueryTable() { + this.$refs.multipleTable?.clearSort(); + this.tableSort = {}; + this.page = { + ...this.MXDefaultPage() + }; + + this.query = { ...this.MXPageInfo().defaultQuery }; + this.getTableList(); + }, + // 改变多选 + handleSelectionChange(val) { + this.selectrows = val; + }, + // 改变排序 + sortChange({ column, prop, order }) { + this.tableSort = { prop, order }; + this.getTableList(); + }, + // --- 表格相关函数end -- + toEdit(detail) { + this.$refs.editDialog.open(detail); + }, + toAdd() { + this.$refs.editDialog.open(); + }, + importData() { + this.$refs.importDialog.open(); + }, + toDelete(row) { + this.$deleteConfirm().then(() => { + this.MXPageInfo().deleteApi(row.id).then((_) => { + this.$message.success('删除成功'); + this.getTableList(); + }); + }); + }, + toMultDelete() { + const ids = this.selectrows.map((item) => item.id); + this.$multDelConfirm(`${ids.length}条`).then(() => { + this.MXPageInfo().deleteApi(ids).then((_) => { + this.$message.success('删除成功'); + this.getTableList(); + }); + }); + } + }, +}; \ No newline at end of file diff --git a/bs-ui/src/views/task-distribut/components/ReviewConclusionRules.vue b/bs-ui/src/views/task-distribut/components/ReviewConclusionRules.vue new file mode 100644 index 0000000..8983612 --- /dev/null +++ b/bs-ui/src/views/task-distribut/components/ReviewConclusionRules.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file diff --git a/bs-ui/src/views/task-distribut/components/SectionTitle.vue b/bs-ui/src/views/task-distribut/components/SectionTitle.vue new file mode 100644 index 0000000..c2c60c6 --- /dev/null +++ b/bs-ui/src/views/task-distribut/components/SectionTitle.vue @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/bs-ui/src/views/task-distribut/feedback/other-task/index.vue b/bs-ui/src/views/task-distribut/feedback/other-task/index.vue new file mode 100644 index 0000000..00e103c --- /dev/null +++ b/bs-ui/src/views/task-distribut/feedback/other-task/index.vue @@ -0,0 +1,266 @@ + + + + \ No newline at end of file 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 new file mode 100644 index 0000000..9f8f057 --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/components/AuditDialog.vue @@ -0,0 +1,147 @@ + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000..fa9b18a --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/components/AuditItem.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/bs-ui/src/views/task-distribut/send/other-task/components/Detail.vue b/bs-ui/src/views/task-distribut/send/other-task/components/Detail.vue new file mode 100644 index 0000000..a18be48 --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/components/Detail.vue @@ -0,0 +1,89 @@ + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000..54553ea --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/components/EditDialog.vue @@ -0,0 +1,333 @@ + + + + + + \ No newline at end of file diff --git a/bs-ui/src/views/task-distribut/send/other-task/components/RemarkDialog.vue b/bs-ui/src/views/task-distribut/send/other-task/components/RemarkDialog.vue new file mode 100644 index 0000000..afc5a94 --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/components/RemarkDialog.vue @@ -0,0 +1,80 @@ + + + + + + \ No newline at end of file diff --git a/bs-ui/src/views/task-distribut/send/other-task/index.vue b/bs-ui/src/views/task-distribut/send/other-task/index.vue new file mode 100644 index 0000000..a86738c --- /dev/null +++ b/bs-ui/src/views/task-distribut/send/other-task/index.vue @@ -0,0 +1,271 @@ + + + + \ No newline at end of file