From 3cb358495ee26ca2e776dbca079b4c2a89502f23 Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Thu, 29 Aug 2024 14:42:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=AE=A1=E7=90=863?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/company/archives/archives.js | 24 +++ src/utils/createUUID.js | 5 - src/utils/createUniqueCode.js | 17 ++ src/utils/dict.js | 2 + .../form/PropertyDealChangeForm.vue | 2 +- .../form/PropertyDealDisposalForm.vue | 2 +- .../archives/components/ArchivesTable.vue | 122 +++++++++-- .../archives/components/ArchivesType.vue | 16 -- .../archives/form/ArchivesCatalogForm.vue | 1 - .../views/archives/form/ArchivesForm.vue | 199 ++++++++++++++++++ 10 files changed, 351 insertions(+), 39 deletions(-) create mode 100644 src/api/company/archives/archives.js delete mode 100644 src/utils/createUUID.js create mode 100644 src/utils/createUniqueCode.js delete mode 100644 src/views/knowledge/views/archives/components/ArchivesType.vue create mode 100644 src/views/knowledge/views/archives/form/ArchivesForm.vue diff --git a/src/api/company/archives/archives.js b/src/api/company/archives/archives.js new file mode 100644 index 0000000..17604bd --- /dev/null +++ b/src/api/company/archives/archives.js @@ -0,0 +1,24 @@ +import request from '@/utils/request' + +export function updateArchives(data){ + return request({ + url: "/archives/update", + method: "post", + data + }) +} + +export function queryArchivesPage(params){ + return request({ + url: "/archives/list", + method: "get", + params + }) +} + +export function removeArchivesById(id){ + return request({ + url: "/archives/remove/" + id, + method: 'delete' + }) +} diff --git a/src/utils/createUUID.js b/src/utils/createUUID.js deleted file mode 100644 index a261edd..0000000 --- a/src/utils/createUUID.js +++ /dev/null @@ -1,5 +0,0 @@ -import {v4 as uuidv4} from 'uuid' - -export function createUUID(){ - return uuidv4().replace(/-/g, '') -} diff --git a/src/utils/createUniqueCode.js b/src/utils/createUniqueCode.js new file mode 100644 index 0000000..eb411cb --- /dev/null +++ b/src/utils/createUniqueCode.js @@ -0,0 +1,17 @@ +import { v4 as uuidv4 } from 'uuid' + +export function createUUID() { + return uuidv4().replace(/-/g, '') +} + +export function createHashCodeByStr(str) { + let hash = 0 + if (str.length === 0) return hash + for (let i = 0; i < str.length; i++) { + const char = str.charCodeAt(i) + hash = ((hash << 5) - hash) + char + hash = hash & hash // 转换为32位整数 + } + // 将整数转换为16进制字符串,以缩短code长度 + return Math.abs(hash).toString(16) +} diff --git a/src/utils/dict.js b/src/utils/dict.js index 1284e6d..b8c035c 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -169,6 +169,8 @@ export const DICT_TYPE = { RESCUE_CAR_TYPE: 'rescue_car_type', // 档案分类 ARCHIVES_TYPE: 'archives_type', + // 档案项分类 + ARCHIVES_ITEM_TYPE: 'archives_item_type', } /** diff --git a/src/views/company/property/propertyDealChange/form/PropertyDealChangeForm.vue b/src/views/company/property/propertyDealChange/form/PropertyDealChangeForm.vue index 62b75f1..26a8a27 100644 --- a/src/views/company/property/propertyDealChange/form/PropertyDealChangeForm.vue +++ b/src/views/company/property/propertyDealChange/form/PropertyDealChangeForm.vue @@ -186,7 +186,7 @@ - - diff --git a/src/views/knowledge/views/archives/form/ArchivesCatalogForm.vue b/src/views/knowledge/views/archives/form/ArchivesCatalogForm.vue index e407681..7ba657a 100644 --- a/src/views/knowledge/views/archives/form/ArchivesCatalogForm.vue +++ b/src/views/knowledge/views/archives/form/ArchivesCatalogForm.vue @@ -166,7 +166,6 @@ export default { deleteRoleIds: this.formData.deleteRoleIds.join(","), createRoleIds: this.formData.createRoleIds.join(","), } - console.log(data) // 修改的提交 if (data.dataId) { await updateArchivesRoleAndDict(data) diff --git a/src/views/knowledge/views/archives/form/ArchivesForm.vue b/src/views/knowledge/views/archives/form/ArchivesForm.vue new file mode 100644 index 0000000..eeb2545 --- /dev/null +++ b/src/views/knowledge/views/archives/form/ArchivesForm.vue @@ -0,0 +1,199 @@ + + + + + + + + + + 档案信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 档案内容 + + + + + + + {{ dict.label }} + + + + + + + + + + + + + + + + + + + +