diff --git "a/public/\345\257\274\345\207\272Excel.svg" "b/public/\345\257\274\345\207\272Excel.svg" new file mode 100644 index 0000000000000000000000000000000000000000..8a534bf213e47763d8361ae8619c58af723724e1 --- /dev/null +++ "b/public/\345\257\274\345\207\272Excel.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index cee8e63e27b1030da8640924896c1fe401403f22..f23afd34d825e711a25f8ebfaa0726f226bc7bc5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,10 +7,10 @@ import departments from './component/humanResources/department.vue' - + + diff --git a/src/component/enterpriseAnnouncement/announcementType.vue b/src/component/enterpriseAnnouncement/announcementType.vue index aa407e1611745aa222ca231ddc32a549c9f8db08..f83727bfca417289c21d1d5cd4c94f89e0c34328 100644 --- a/src/component/enterpriseAnnouncement/announcementType.vue +++ b/src/component/enterpriseAnnouncement/announcementType.vue @@ -109,7 +109,7 @@ const disabledDialog = ref(false); const detailsDialog = ref(false); const editDialog = ref(false); const deleteDialog = ref(false); -const rowID = ref(); +const row = ref(); provide("addSubcategoriesDialog", addSubcategoriesDialog); provide("disabledDialog", disabledDialog); provide("detailsDialog", detailsDialog); @@ -117,7 +117,7 @@ provide("editDialog", editDialog); provide("deleteDialog", deleteDialog); provide("tableData", tableData); -provide("rowID", rowID); +provide("row", row); provide("changeState",()=>{ console.log(1111); }) diff --git a/src/component/humanResources/department.vue b/src/component/humanResources/department.vue index 23fc31ae059fc48f193c468cd06d4a6234939a9d..f9a7005e3d93031742eb43c5f316858c48013cf1 100644 --- a/src/component/humanResources/department.vue +++ b/src/component/humanResources/department.vue @@ -9,14 +9,20 @@ import { ref, provide, onMounted } from 'vue'; import { getHumanResourcesDepartment } from '@/api/api'; import { FlatToTree } from '@/util/toTree'; import { deepClone } from '@/util/deepCode'; +import { computed } from '@vue/reactivity'; const addText = ref('添加部门'); let tableData = ref([ ]) +let respData = ref(); +const getData = () => { + getHumanResourcesDepartment().then((res)=>{ + respData.value = res.data.data.data; + tableData.value = FlatToTree(deepClone(res.data.data.data)).tree; + }) +} onMounted(async () => { - let data = (await getHumanResourcesDepartment()).data.data.data; - console.log(deepClone(data)); - tableData.value = FlatToTree(deepClone(data)).tree; + getData(); }) let tableType = ref([ @@ -63,21 +69,25 @@ let tableType = ref([ align: "center" }, { - name:'状态', - type:'state', - width:'120px', + name: '状态', + type: 'state', + width: '120px', } ] ); let operation = ref({ type: ["addSubcategories", "edit", "delete"], width: "220px" }); - - - - - - - +const addDept = ref(); +const addSubDept = ref(); +const editDept = computed({ + get: () => { + return row.value.departmentName; + }, + set: (val) => { + row.value.departmentName = val; + getData(); + } +}) @@ -99,7 +109,7 @@ const disabledDialog = ref(false); const detailsDialog = ref(false); const editDialog = ref(false); const deleteDialog = ref(false); -const rowID = ref(); +const row = ref(); provide("addSubcategoriesDialog", addSubcategoriesDialog); provide("disabledDialog", disabledDialog); provide("detailsDialog", detailsDialog); @@ -107,11 +117,11 @@ provide("editDialog", editDialog); provide("deleteDialog", deleteDialog); provide("tableData", tableData); -provide("rowID", rowID); +provide("row", row); provide("changeState", () => { console.log(1111); }) -provide("subString","子部门"); +provide("subString", "子部门"); provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { if (column.property === "state") { if (row.state == "正常") { @@ -140,16 +150,19 @@ provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { - + + - + + - + + - + diff --git a/src/component/main/header/add_download/downloadItem.vue b/src/component/main/header/add_download/downloadItem.vue index 3f8d79371df0b64bbd1061f880583e2d99b7f7fc..74bcb13687ea88fbd7a8a6d7f5c21237ec2cd728 100644 --- a/src/component/main/header/add_download/downloadItem.vue +++ b/src/component/main/header/add_download/downloadItem.vue @@ -1,14 +1,14 @@ diff --git a/src/component/main/header/add_download/downloadItem/item.vue b/src/component/main/header/add_download/downloadItem/item.vue index e65c9f65db9e95cf4ab401acfb7298fae4c9ad2d..2fdb1fa7186256ceb5f773782b4d007e75bc4a78 100644 --- a/src/component/main/header/add_download/downloadItem/item.vue +++ b/src/component/main/header/add_download/downloadItem/item.vue @@ -1,19 +1,13 @@ diff --git a/src/component/main/tableList/table/operation/operations.vue b/src/component/main/tableList/table/operation/operations.vue index fec8c53a0a23a1f8d1a9c3e270ff2b3f797fa8ab..c9753bbf4bc86b48bbe0df35328b03700146b38f 100644 --- a/src/component/main/tableList/table/operation/operations.vue +++ b/src/component/main/tableList/table/operation/operations.vue @@ -5,11 +5,11 @@ import detailss from './details.vue'; import disabled from './disabled.vue'; import addSubcategories from './addSubcategories.vue'; import { inject } from 'vue'; - +import { deepClone } from '../../../../../util/deepCode' const prop = defineProps<{ operationNul: { type: string[], width: string, coordin: Map> }, - row: number + row: {id:number} }>() const isExist = (tempString: string) => { if (prop.operationNul.type.includes(tempString)) { @@ -18,7 +18,7 @@ const isExist = (tempString: string) => { if(!prop.operationNul.coordin){ return false; } - if(prop.operationNul.coordin.get(prop.row)?.has(tempString)){ + if(prop.operationNul.coordin.get(prop.row.id)?.has(tempString)){ return true; } return false; @@ -28,9 +28,9 @@ const disabledDialog = inject("disabledDialog"); const detailsDialog = inject("detailsDialog"); const editDialog = inject("editDialog"); const deleteDialog = inject("deleteDialog"); -const rowID: any = inject("rowID"); +const row: any = inject("row"); const clickButton = (callback: Function) => { - rowID.value = prop.row; + row.value = deepClone(prop.row); callback(0); } diff --git a/src/component/main/tableList/table/table.vue b/src/component/main/tableList/table/table.vue index 54f84b3db77b42cf65f96478a70de8902514ac57..e62e9dcef7f4b1491d5e5b3eeff0a7662b0ad436 100644 --- a/src/component/main/tableList/table/table.vue +++ b/src/component/main/tableList/table/table.vue @@ -54,7 +54,7 @@ const changeState:any = inject("changeState"); diff --git a/src/util/message.js b/src/util/message.js new file mode 100644 index 0000000000000000000000000000000000000000..4f6ec316eecbc75cff7a43659e044fa6c387f5c3 --- /dev/null +++ b/src/util/message.js @@ -0,0 +1,17 @@ +import { ElMessage } from 'element-plus' + +export function message(code){ + if (code === 10000) { + ElMessage({ + showClose: true, + message: '成功', + type: 'success', + }) + } else { + ElMessage({ + showClose: true, + message: '成功', + type: 'error', + }) + } +} \ No newline at end of file