feature-sht #3
|
@ -46,14 +46,14 @@
|
||||||
<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="序号">
|
||||||
<el-input v-model="editForm.id" placeholder="请输入id" />
|
<el-input v-model="editForm.id" placeholder="请输入id" />
|
||||||
|
@ -70,21 +70,22 @@
|
||||||
<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 label="子系统">
|
|
||||||
<el-input :placeholder="`子系统 ${editForm.projectChildId}`" disabled />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="截止时间">
|
<el-form-item label="子系统">
|
||||||
<el-date-picker v-model="editForm.deadLine" type="date" placeholder="选择日期">
|
<el-input :placeholder="`子系统 ${editForm.projectChildId}`" disabled />
|
||||||
</el-date-picker>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="截止时间">
|
||||||
<el-form-item label="子模块简介">
|
<el-date-picker v-model="editForm.deadLine" type="date" placeholder="选择日期">
|
||||||
<el-input v-model="editForm.description" placeholder="请输入子模块简介" />
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 添加其他需要编辑的表单项 -->
|
<el-form-item label="子模块简介">
|
||||||
|
<el-input v-model="editForm.description" placeholder="请输入子模块简介" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 添加其他需要编辑的表单项 -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer" style="display: flex;flex-direction: row;justify-content: center;">
|
<span slot="footer" class="dialog-footer" style="display: flex;flex-direction: row;justify-content: center;">
|
||||||
<el-button @click="handleCloseDialog">取消</el-button>
|
<el-button @click="handleCloseDialog">取消</el-button>
|
||||||
|
@ -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,45 +141,45 @@ 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,
|
||||||
cycle: editForm.value.cycle,
|
cycle: editForm.value.cycle,
|
||||||
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);
|
||||||
|
|
||||||
|
const promise = addModule(body, getToken());
|
||||||
|
console.log(promise);
|
||||||
|
|
||||||
|
promise.then(res => {
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
console.log(res.data);
|
||||||
|
|
||||||
|
dialogVisible.value = false;
|
||||||
|
|
||||||
|
fetchData();
|
||||||
|
ElMessage.success('新增成功');
|
||||||
|
} else {
|
||||||
|
ElMessage.error("新增失败" + res.message);
|
||||||
|
console.log(res.message);
|
||||||
}
|
}
|
||||||
console.log(body);
|
}).catch(err => {
|
||||||
|
console.log(err);
|
||||||
const promise = addModule(body,getToken());
|
})
|
||||||
console.log(promise);
|
|
||||||
|
|
||||||
promise.then(res => {
|
|
||||||
if (res.data.code === 200) {
|
|
||||||
console.log(res.data);
|
|
||||||
|
|
||||||
dialogVisible.value = false;
|
|
||||||
|
|
||||||
fetchData();
|
|
||||||
ElMessage.success('新增成功');
|
|
||||||
} else {
|
|
||||||
ElMessage.error("新增失败" +res.message);
|
|
||||||
console.log(res.message);
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(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(); // 将tableData的内容赋值给initialTableData
|
initialTableData.value = tableData.value.slice(); // 将tableData的内容赋值给initialTableData
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user