feature-sht #3
|
@ -46,13 +46,13 @@
|
|||
<el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</el-button>
|
||||
</el-table-column>
|
||||
</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" />
|
||||
</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-item label="序号">
|
||||
|
@ -70,10 +70,11 @@
|
|||
<el-form-item label="周期">
|
||||
<el-input v-model="editForm.cycle" placeholder="请输入周期" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="负责人">
|
||||
<el-input v-model="editForm.principalUser" placeholder="请输入负责人" />
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="负责人">
|
||||
<el-select v-model="editForm.principalId" placeholder="请选择负责人">
|
||||
<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-input :placeholder="`子系统 ${editForm.projectChildId}`" disabled />
|
||||
</el-form-item>
|
||||
|
@ -97,8 +98,8 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ElTable ,ElDialog, ElForm, ElFormItem, ElInput, ElButton } from 'element-plus';
|
||||
import { getProjectModList ,addModule } from '@/api/manage';
|
||||
import { ElTable, ElDialog, ElForm, ElFormItem, ElInput, ElButton } from 'element-plus';
|
||||
import { getProjectModList, addModule } from '@/api/manage';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { getToken } from '@/utils/auth';
|
||||
|
||||
|
@ -108,6 +109,11 @@ const sysId = route.query.id;
|
|||
|
||||
const router = useRouter();
|
||||
const dialogVisible = ref(false);
|
||||
const total = ref(5);
|
||||
|
||||
|
||||
|
||||
|
||||
//表单显示内容
|
||||
const editForm = ref({
|
||||
name: 'name',
|
||||
|
@ -117,8 +123,15 @@ const editForm = ref({
|
|||
projectChildId: sysId,
|
||||
deadLine: '',
|
||||
description: '',
|
||||
principalId: '',
|
||||
|
||||
});
|
||||
|
||||
const persons = [
|
||||
{id:0 ,name:"principal_user"},
|
||||
{id:1 ,name:"console_user"},
|
||||
{id:2 ,name:"developer_user"}
|
||||
]
|
||||
// 点击新增按钮打开弹窗
|
||||
const openEditDialog = () => {
|
||||
|
||||
|
@ -128,16 +141,16 @@ const openEditDialog = () => {
|
|||
|
||||
};
|
||||
//关闭弹窗
|
||||
const handleCloseDialog = ()=>{
|
||||
const handleCloseDialog = () => {
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
|
||||
const submitEditInfo = ()=>{
|
||||
const submitEditInfo = () => {
|
||||
// 将日期对象转换为日期字符串
|
||||
const formattedDate = editForm.value.deadLine instanceof Date ? editForm.value.deadLine.toISOString() : editForm.value.deadLine;
|
||||
|
||||
|
||||
const body={
|
||||
const body = {
|
||||
name: editForm.value.name,
|
||||
status: editForm.value.status,
|
||||
workLoad: editForm.value.workLoad,
|
||||
|
@ -145,11 +158,11 @@ const submitEditInfo = ()=>{
|
|||
projectChildId: sysId,
|
||||
deadLine: formattedDate,
|
||||
description: editForm.value.description,
|
||||
principalId: 1,
|
||||
principalId: editForm.value.principalId,
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
const promise = addModule(body,getToken());
|
||||
const promise = addModule(body, getToken());
|
||||
console.log(promise);
|
||||
|
||||
promise.then(res => {
|
||||
|
@ -161,7 +174,7 @@ const submitEditInfo = ()=>{
|
|||
fetchData();
|
||||
ElMessage.success('新增成功');
|
||||
} else {
|
||||
ElMessage.error("新增失败" +res.message);
|
||||
ElMessage.error("新增失败" + res.message);
|
||||
console.log(res.message);
|
||||
}
|
||||
}).catch(err => {
|
||||
|
@ -244,7 +257,7 @@ const fetchData = () => {
|
|||
const newData = data.map(item => parseData(item))
|
||||
// console.log(newData);
|
||||
|
||||
tableData.value = [...newData, ...tableData.value];
|
||||
tableData.value = [...newData];
|
||||
initialTableData.value = tableData.value.slice(); // 将tableData的内容赋值给initialTableData
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</el-button>
|
||||
</el-table-column>
|
||||
</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" />
|
||||
</el-card>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user