You need to sign in or sign up before continuing.
提交 69549de4 编写于 作者: 水晶土豆

Thu Nov 16 21:10:00 CST 2023 inscode

上级 a9b2315d
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1700139114421" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7379" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M583.601758 143.254681 583.601758 0.058328 32.219819 150.154835l0 723.69033 551.380916 150.096507L583.600735 880.744295l406.386614 0L989.987349 143.254681 583.601758 143.254681 583.601758 143.254681zM583.601758 680.871105l102.873995 0 0 89.603761L583.601758 770.474866 583.601758 680.871105 583.601758 680.871105zM583.601758 536.131607l102.873995 0 0 89.603761L583.601758 625.735367 583.601758 536.131607 583.601758 536.131607zM583.601758 391.398248l102.873995 0 0 89.598644L583.601758 480.996892 583.601758 391.398248 583.601758 391.398248zM583.601758 246.658749l102.873995 0 0 89.603761L583.601758 336.26251 583.601758 246.658749 583.601758 246.658749zM751.072981 680.871105l128.640846 0 0 89.603761L751.072981 770.474866 751.072981 680.871105 751.072981 680.871105zM751.072981 536.131607l128.640846 0 0 89.603761L751.072981 625.735367 751.072981 536.131607 751.072981 536.131607zM751.072981 391.398248l128.640846 0 0 89.598644L751.072981 480.996892 751.072981 391.398248 751.072981 391.398248zM751.072981 246.658749l128.640846 0 0 89.603761L751.072981 336.26251 751.072981 246.658749 751.072981 246.658749zM244.351194 361.325325l67.00916 105.808838 69.898976-112.453165 57.895595-2.791579-97.595782 155.007353 104.622826 166.755931-62.872956-3.085268-73.619718-121.659851-74.839499 114.441449-59.146075-2.888793 104.622826-153.465231-97.596805-142.68777L244.351194 361.325325 244.351194 361.325325zM244.351194 361.325325" fill="#272636" p-id="7380"></path></svg>
\ No newline at end of file
...@@ -7,10 +7,10 @@ import departments from './component/humanResources/department.vue' ...@@ -7,10 +7,10 @@ import departments from './component/humanResources/department.vue'
</script> </script>
<template> <template>
<!-- <contractCategory></contractCategory> <!-- <contractCategory></contractCategory> -->
<contract-list></contract-list> --> <contract-list></contract-list>
<announcementType></announcementType> <!-- <announcementType></announcementType>
<departments></departments> <departments></departments> -->
<el-row> <el-row>
<el-col>后台管理平台</el-col> <el-col>后台管理平台</el-col>
</el-row> </el-row>
......
...@@ -6,9 +6,9 @@ import addDownload from '@/component/main/header/add_download/addDownload.vue' ...@@ -6,9 +6,9 @@ import addDownload from '@/component/main/header/add_download/addDownload.vue'
import addButton from '@/component/main/header/add_download/button.vue' import addButton from '@/component/main/header/add_download/button.vue'
import { TableType, _tableData, _operation, _cellStyle } from '@/component/main/tableList/tableList' import { TableType, _tableData, _operation, _cellStyle } from '@/component/main/tableList/tableList'
import { ref, provide, reactive, onMounted, watch } from 'vue'; import { ref, provide, reactive, onMounted, watch } from 'vue';
import ejectDialog from '@/component/main/ejectDialog.vue' import ejectDialog from '@/component/main/ejectDialog.vue';
import { getContractCategory } from '@/api/api' import { getContractCategory } from '@/api/api';
import { ElMessage } from 'element-plus' import { message } from '@/util/message';
import { computed } from '@vue/reactivity'; import { computed } from '@vue/reactivity';
// pagination // pagination
...@@ -47,7 +47,7 @@ const tableType = ref(new TableType()); ...@@ -47,7 +47,7 @@ const tableType = ref(new TableType());
tableType.value = [ tableType.value = [
{ name: "id号", type: "id", width: "150px", isSort: false, align: "center" }, { name: "id号", type: "id", width: "150px", isSort: false, align: "center" },
{ name: "类别名称", type: "typeName", width: "auto", isSort: false, align: "left" }, { name: "类别名称", type: "typeName", width: "auto", isSort: false, align: "left" },
{ name: "状态", type: "state", width: "150px", isSort: false, align: "center", isReadOnly: true } { name: "状态", type: "state", width: "150px", isSort: false, align: "center", isReadOnly: false }
] ]
const operation = ref(_operation); const operation = ref(_operation);
operation.value = { operation.value = {
...@@ -73,28 +73,20 @@ const cellSetStyle = ({ row, column, rowIndex, columnIndex }) => { ...@@ -73,28 +73,20 @@ const cellSetStyle = ({ row, column, rowIndex, columnIndex }) => {
//dialog //dialog
const bangDingtest = ref(); const bangDingtest = ref();
const inputDialog = ref(); const inputDialog = ref();
const inputEditDialog = ref(); const inputEditDialog = computed({
get: () => {
return row.value.typeName;
},
set: (val) => {
row.value.typeName = val;
getData();
}
});
onMounted(() => { onMounted(() => {
watch(() => rowID.value, () => {
const temp = (tableData.value.filter((item) => item.id == rowID.value)[0]);
inputEditDialog.value = (temp ? temp.typeName : "");
})
}) })
const sendRequest = ()=>{ const sendRequest = () => {
console.log('发送请求'); console.log('发送请求');
if ('成功') { message(10000);
ElMessage({
showClose: true,
message: '成功',
type: 'success',
})
} else {
ElMessage({
showClose: true,
message: '成功',
type: 'error',
})
}
} }
//对话框 //对话框
...@@ -104,7 +96,7 @@ const disabledDialog = ref(false); ...@@ -104,7 +96,7 @@ const disabledDialog = ref(false);
const detailsDialog = ref(false); const detailsDialog = ref(false);
const editDialog = ref(false); const editDialog = ref(false);
const deleteDialog = ref(false); const deleteDialog = ref(false);
const rowID = ref(); const row = ref();
provide("addSubcategoriesDialog", addSubcategoriesDialog); provide("addSubcategoriesDialog", addSubcategoriesDialog);
provide("disabledDialog", disabledDialog); provide("disabledDialog", disabledDialog);
provide("detailsDialog", detailsDialog); provide("detailsDialog", detailsDialog);
...@@ -112,8 +104,8 @@ provide("editDialog", editDialog); ...@@ -112,8 +104,8 @@ provide("editDialog", editDialog);
provide("deleteDialog", deleteDialog); provide("deleteDialog", deleteDialog);
provide("tableData", tableData); provide("tableData", tableData);
provide("rowID", rowID); provide("row", row);
provide("changeState",()=>{ provide("changeState", () => {
console.log(1111); console.log(1111);
}) })
provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => {
...@@ -151,7 +143,7 @@ provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { ...@@ -151,7 +143,7 @@ provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => {
<template #header>新增类别</template> <template #header>新增类别</template>
<el-input v-model="inputDialog" /> <el-input v-model="inputDialog" />
</ejectDialog> </ejectDialog>
<ejectDialog v-model:openDialog="editDialog"> <ejectDialog v-model:openDialog="editDialog" :confirm="sendRequest">
<template #header>编辑类别</template> <template #header>编辑类别</template>
<el-input v-model="inputEditDialog" /> <el-input v-model="inputEditDialog" />
</ejectDialog> </ejectDialog>
......
...@@ -83,7 +83,7 @@ const disabledDialog = ref(false); ...@@ -83,7 +83,7 @@ const disabledDialog = ref(false);
const detailsDialog = ref(false); const detailsDialog = ref(false);
const editDialog = ref(false); const editDialog = ref(false);
const deleteDialog = ref(false); const deleteDialog = ref(false);
const rowID = ref(); const row = ref();
provide("addSubcategoriesDialog", addSubcategoriesDialog); provide("addSubcategoriesDialog", addSubcategoriesDialog);
provide("disabledDialog", disabledDialog); provide("disabledDialog", disabledDialog);
provide("detailsDialog", detailsDialog); provide("detailsDialog", detailsDialog);
...@@ -93,7 +93,7 @@ provide("deleteDialog", deleteDialog); ...@@ -93,7 +93,7 @@ provide("deleteDialog", deleteDialog);
provide("tableData", tableData); provide("tableData", tableData);
provide("tablePagination", tablePagination); provide("tablePagination", tablePagination);
provide("contractSelect", contractSelect); provide("contractSelect", contractSelect);
provide("rowID",rowID); provide("row",row);
provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => {
if (column.property === "state") { if (column.property === "state") {
if (row.state == "正常") { if (row.state == "正常") {
...@@ -131,9 +131,10 @@ provide("changeState",()=>{ ...@@ -131,9 +131,10 @@ provide("changeState",()=>{
</template> </template>
</mains> </mains>
<ejectDialog v-model:open-dialog="addDialog"> <ejectDialog v-model:open-dialog="addDialog">
<template #default></template> <template #header>添加合同</template>
</ejectDialog> </ejectDialog>
<ejectDialog v-model:open-dialog="detailsDialog"> <ejectDialog v-model:open-dialog="detailsDialog">
<template #header>合同详情</template>
<template #default></template> <template #default></template>
</ejectDialog> </ejectDialog>
<ejectDialog v-model:open-dialog="editDialog"> <ejectDialog v-model:open-dialog="editDialog">
......
...@@ -109,7 +109,7 @@ const disabledDialog = ref(false); ...@@ -109,7 +109,7 @@ const disabledDialog = ref(false);
const detailsDialog = ref(false); const detailsDialog = ref(false);
const editDialog = ref(false); const editDialog = ref(false);
const deleteDialog = ref(false); const deleteDialog = ref(false);
const rowID = ref(); const row = ref();
provide("addSubcategoriesDialog", addSubcategoriesDialog); provide("addSubcategoriesDialog", addSubcategoriesDialog);
provide("disabledDialog", disabledDialog); provide("disabledDialog", disabledDialog);
provide("detailsDialog", detailsDialog); provide("detailsDialog", detailsDialog);
...@@ -117,7 +117,7 @@ provide("editDialog", editDialog); ...@@ -117,7 +117,7 @@ provide("editDialog", editDialog);
provide("deleteDialog", deleteDialog); provide("deleteDialog", deleteDialog);
provide("tableData", tableData); provide("tableData", tableData);
provide("rowID", rowID); provide("row", row);
provide("changeState",()=>{ provide("changeState",()=>{
console.log(1111); console.log(1111);
}) })
......
...@@ -9,14 +9,20 @@ import { ref, provide, onMounted } from 'vue'; ...@@ -9,14 +9,20 @@ import { ref, provide, onMounted } from 'vue';
import { getHumanResourcesDepartment } from '@/api/api'; import { getHumanResourcesDepartment } from '@/api/api';
import { FlatToTree } from '@/util/toTree'; import { FlatToTree } from '@/util/toTree';
import { deepClone } from '@/util/deepCode'; import { deepClone } from '@/util/deepCode';
import { computed } from '@vue/reactivity';
const addText = ref('添加部门'); const addText = ref('添加部门');
let tableData = 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 () => { onMounted(async () => {
let data = (await getHumanResourcesDepartment()).data.data.data; getData();
console.log(deepClone(data));
tableData.value = FlatToTree(deepClone(data)).tree;
}) })
let tableType = ref([ let tableType = ref([
...@@ -63,21 +69,25 @@ let tableType = ref([ ...@@ -63,21 +69,25 @@ let tableType = ref([
align: "center" align: "center"
}, },
{ {
name:'状态', name: '状态',
type:'state', type: 'state',
width:'120px', width: '120px',
} }
] ]
); );
let operation = ref({ type: ["addSubcategories", "edit", "delete"], width: "220px" }); 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); ...@@ -99,7 +109,7 @@ const disabledDialog = ref(false);
const detailsDialog = ref(false); const detailsDialog = ref(false);
const editDialog = ref(false); const editDialog = ref(false);
const deleteDialog = ref(false); const deleteDialog = ref(false);
const rowID = ref(); const row = ref();
provide("addSubcategoriesDialog", addSubcategoriesDialog); provide("addSubcategoriesDialog", addSubcategoriesDialog);
provide("disabledDialog", disabledDialog); provide("disabledDialog", disabledDialog);
provide("detailsDialog", detailsDialog); provide("detailsDialog", detailsDialog);
...@@ -107,11 +117,11 @@ provide("editDialog", editDialog); ...@@ -107,11 +117,11 @@ provide("editDialog", editDialog);
provide("deleteDialog", deleteDialog); provide("deleteDialog", deleteDialog);
provide("tableData", tableData); provide("tableData", tableData);
provide("rowID", rowID); provide("row", row);
provide("changeState", () => { provide("changeState", () => {
console.log(1111); console.log(1111);
}) })
provide("subString","子部门"); provide("subString", "子部门");
provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => {
if (column.property === "state") { if (column.property === "state") {
if (row.state == "正常") { if (row.state == "正常") {
...@@ -140,16 +150,19 @@ provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => { ...@@ -140,16 +150,19 @@ provide("cellSetStyle", ({ row, column, rowIndex, columnIndex }) => {
</addDownload> </addDownload>
</headers> </headers>
<ejectDialog v-model:openDialog="addDialog"> <ejectDialog v-model:openDialog="addDialog">
<template #header>fdsafs</template> <template #header>添加部门</template>
<el-input v-model="addDept"></el-input>
</ejectDialog> </ejectDialog>
<ejectDialog v-model:openDialog="addSubcategoriesDialog"> <ejectDialog v-model:openDialog="addSubcategoriesDialog">
<template #header>fdsafs</template> <template #header>添加子部门</template>
<el-input v-model="addSubDept"></el-input>
</ejectDialog> </ejectDialog>
<ejectDialog v-model:openDialog="editDialog"> <ejectDialog v-model:openDialog="editDialog">
<template #header>fdsafs</template> <template #header>编辑部门名称</template>
<el-input v-model="editDept"></el-input>
</ejectDialog> </ejectDialog>
<ejectDialog v-model:openDialog="deleteDialog"> <ejectDialog v-model:openDialog="deleteDialog">
<template #header>fdsafs</template> <template #header>删除</template>
</ejectDialog> </ejectDialog>
</mains> </mains>
</template> </template>
......
<script setup> <script setup>
import tableItem from './downloadItem/item.vue'; import tableItem from './downloadItem/item.vue';
const rightItem = [ const rightItem = [
{ title: "筛选列" }, { title: "筛选列",src:'' },
{ title: "导出EXCEL" } { title: "导出EXCEL",src:'../../../../../../public/导出Excel.svg' }
] ]
</script> </script>
<template> <template>
<div v-for="itemTemp in rightItem"> <div v-for="itemTemp in rightItem">
<tableItem :title="itemTemp.title"></tableItem> <tableItem :title="itemTemp.title" :src="itemTemp.src"></tableItem>
</div> </div>
</template> </template>
......
<script setup> <script setup>
import { ref, watch } from 'vue';
const prop = defineProps({ const prop = defineProps({
title: "" title: "",
src:""
}) })
const title = ref();
watch(() => prop.title, (item) => {
title.value = item;
})
</script> </script>
<template> <template>
<el-button class="iconItem" :title="title"> <el-button class="iconItem" :title="prop.title">
<img class="img" src="https://ts1.cn.mm.bing.net/th/id/R-C.7d171db3d5e4715470332922ae1e2622?rik=ksUKRpcEYpBR8w&riu=http%3a%2f%2fseopic.699pic.com%2fphoto%2f50000%2f8606.jpg_wh1200.jpg&ehk=jLHx5b3kslxDSEGzmtVL2P30uk2vYjzOP1cub86g7T8%3d&risl=&pid=ImgRaw&r=0" alt=""> <img class="img" :src="prop.src" alt="">
</el-button> </el-button>
</template> </template>
......
...@@ -5,11 +5,11 @@ import detailss from './details.vue'; ...@@ -5,11 +5,11 @@ import detailss from './details.vue';
import disabled from './disabled.vue'; import disabled from './disabled.vue';
import addSubcategories from './addSubcategories.vue'; import addSubcategories from './addSubcategories.vue';
import { inject } from 'vue'; import { inject } from 'vue';
import { deepClone } from '../../../../../util/deepCode'
const prop = defineProps<{ const prop = defineProps<{
operationNul: { type: string[], width: string, coordin: Map<number,Set<string>> }, operationNul: { type: string[], width: string, coordin: Map<number,Set<string>> },
row: number row: {id:number}
}>() }>()
const isExist = (tempString: string) => { const isExist = (tempString: string) => {
if (prop.operationNul.type.includes(tempString)) { if (prop.operationNul.type.includes(tempString)) {
...@@ -18,7 +18,7 @@ const isExist = (tempString: string) => { ...@@ -18,7 +18,7 @@ const isExist = (tempString: string) => {
if(!prop.operationNul.coordin){ if(!prop.operationNul.coordin){
return false; return false;
} }
if(prop.operationNul.coordin.get(prop.row)?.has(tempString)){ if(prop.operationNul.coordin.get(prop.row.id)?.has(tempString)){
return true; return true;
} }
return false; return false;
...@@ -28,9 +28,9 @@ const disabledDialog = inject("disabledDialog"); ...@@ -28,9 +28,9 @@ const disabledDialog = inject("disabledDialog");
const detailsDialog = inject("detailsDialog"); const detailsDialog = inject("detailsDialog");
const editDialog = inject("editDialog"); const editDialog = inject("editDialog");
const deleteDialog = inject("deleteDialog"); const deleteDialog = inject("deleteDialog");
const rowID: any = inject("rowID"); const row: any = inject("row");
const clickButton = (callback: Function) => { const clickButton = (callback: Function) => {
rowID.value = prop.row; row.value = deepClone(prop.row);
callback(0); callback(0);
} }
......
...@@ -54,7 +54,7 @@ const changeState:any = inject("changeState"); ...@@ -54,7 +54,7 @@ const changeState:any = inject("changeState");
</el-table-column> </el-table-column>
<el-table-column fixed="right" class="head" prop="operation" :width="operation.width" label="操作" align="center"> <el-table-column fixed="right" class="head" prop="operation" :width="operation.width" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<operationr :row="Number(row.id)" :operationNul="operation"></operationr> <operationr :row="row" :operationNul="operation"></operationr>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册