feature-sht #3

Merged
yannqing merged 18 commits from feature-sht into master 2024-04-25 16:30:58 +08:00
2 changed files with 74 additions and 61 deletions
Showing only changes of commit e7d831c1af - Show all commits

View File

@ -46,13 +46,13 @@
<el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</el-button> <el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</el-button>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination larger background layout="prev, pager, next" :total="5" class="mt-4" <el-pagination larger background layout="prev, pager, next" :total="total" class="mt-4"
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" /> style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
</el-card> </el-card>
<!-- 新增弹窗 --> <!-- 新增弹窗 -->
<el-dialog title="新增子模块信息" v-model="dialogVisible" style="width: 27%" > <el-dialog title="新增子模块信息" v-model="dialogVisible" style="width: 27%">
<el-form :model="editForm" label-width="100px"> <el-form :model="editForm" label-width="100px">
<!-- <el-form-item label="序号"> <!-- <el-form-item label="序号">
@ -70,10 +70,11 @@
<el-form-item label="周期"> <el-form-item label="周期">
<el-input v-model="editForm.cycle" placeholder="请输入周期" /> <el-input v-model="editForm.cycle" placeholder="请输入周期" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="负责人"> <el-form-item label="负责人">
<el-input v-model="editForm.principalUser" placeholder="请输入负责人" /> <el-select v-model="editForm.principalId" placeholder="请选择负责人">
</el-form-item> --> <el-option v-for="person in persons" :key="person.id" :label="person.name" :value="person.id" />
</el-select>
</el-form-item>
<el-form-item label="子系统"> <el-form-item label="子系统">
<el-input :placeholder="`子系统 ${editForm.projectChildId}`" disabled /> <el-input :placeholder="`子系统 ${editForm.projectChildId}`" disabled />
</el-form-item> </el-form-item>
@ -97,8 +98,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { ElTable ,ElDialog, ElForm, ElFormItem, ElInput, ElButton } from 'element-plus'; import { ElTable, ElDialog, ElForm, ElFormItem, ElInput, ElButton } from 'element-plus';
import { getProjectModList ,addModule } from '@/api/manage'; import { getProjectModList, addModule } from '@/api/manage';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
@ -108,6 +109,11 @@ const sysId = route.query.id;
const router = useRouter(); const router = useRouter();
const dialogVisible = ref(false); const dialogVisible = ref(false);
const total = ref(5);
// //
const editForm = ref({ const editForm = ref({
name: 'name', name: 'name',
@ -117,8 +123,15 @@ const editForm = ref({
projectChildId: sysId, projectChildId: sysId,
deadLine: '', deadLine: '',
description: '', description: '',
principalId: '',
}); });
const persons = [
{id:0 ,name:"principal_user"},
{id:1 ,name:"console_user"},
{id:2 ,name:"developer_user"}
]
// //
const openEditDialog = () => { const openEditDialog = () => {
@ -128,16 +141,16 @@ const openEditDialog = () => {
}; };
// //
const handleCloseDialog = ()=>{ const handleCloseDialog = () => {
dialogVisible.value = false; dialogVisible.value = false;
} }
const submitEditInfo = ()=>{ const submitEditInfo = () => {
// //
const formattedDate = editForm.value.deadLine instanceof Date ? editForm.value.deadLine.toISOString() : editForm.value.deadLine; const formattedDate = editForm.value.deadLine instanceof Date ? editForm.value.deadLine.toISOString() : editForm.value.deadLine;
const body={ const body = {
name: editForm.value.name, name: editForm.value.name,
status: editForm.value.status, status: editForm.value.status,
workLoad: editForm.value.workLoad, workLoad: editForm.value.workLoad,
@ -145,11 +158,11 @@ const submitEditInfo = ()=>{
projectChildId: sysId, projectChildId: sysId,
deadLine: formattedDate, deadLine: formattedDate,
description: editForm.value.description, description: editForm.value.description,
principalId: 1, principalId: editForm.value.principalId,
} }
console.log(body); console.log(body);
const promise = addModule(body,getToken()); const promise = addModule(body, getToken());
console.log(promise); console.log(promise);
promise.then(res => { promise.then(res => {
@ -161,7 +174,7 @@ const submitEditInfo = ()=>{
fetchData(); fetchData();
ElMessage.success('新增成功'); ElMessage.success('新增成功');
} else { } else {
ElMessage.error("新增失败" +res.message); ElMessage.error("新增失败" + res.message);
console.log(res.message); console.log(res.message);
} }
}).catch(err => { }).catch(err => {
@ -244,7 +257,7 @@ const fetchData = () => {
const newData = data.map(item => parseData(item)) const newData = data.map(item => parseData(item))
// console.log(newData); // console.log(newData);
tableData.value = [...newData, ...tableData.value]; tableData.value = [...newData];
initialTableData.value = tableData.value.slice(); // tableDatainitialTableData initialTableData.value = tableData.value.slice(); // tableDatainitialTableData
} }

View File

@ -43,7 +43,7 @@
<el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</el-button> <el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</el-button>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination larger background layout="prev, pager, next" :total="50" class="mt-4" <el-pagination larger background layout="prev, pager, next" :total="5" class="mt-4"
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" /> style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
</el-card> </el-card>