vue2 table 页面 + 功能 展示

 

首页代码 

<!-- 首页展示页面 + 弹框展示  -->
<template><div style><el-button type="text" size="small" @click="dailys()">测试跳转</el-button><!-- <div class="dingwei"><a href="#"><el-image:src="require('../assets/glxt.png')"@click="showAddDialog"></el-image></a></div> --><div style="text-align: center"><el-image :src="require('../assets/logonew.png')" class="imgnew" /></div><div class="contentnew"><el-button type="primary" @click="showAddDialog">新增内容</el-button><div class="linetit"><el-dialog :visible.sync="adddialogVisible" title="新增"><el-form ref="form" :model="form" label-width="80px" :rules="rules"><el-form-item label="项目名称" prop="projectName"><el-input v-model="form.projectName"></el-input></el-form-item><el-form-item label="项目类型" prop="projectType"><el-radio-group v-model="form.projectType"><el-radio label="统建"></el-radio><el-radio label="自建"></el-radio><el-radio label="应用支撑"></el-radio></el-radio-group></el-form-item><el-form-item label="项目状态" prop="projectStatus"><el-radio-group v-model="form.projectStatus"><el-radio label="立项"></el-radio><el-radio label="进行"></el-radio><el-radio label="验收"></el-radio><el-radio label="结项"></el-radio></el-radio-group></el-form-item><el-form-item label="预计结束时间" prop="expectedEndTime"><el-col :span="11"><el-date-pickertype="date"placeholder="选择日期"v-model="form.expectedEndTime"style="width: 100%"value-format="yyyy-MM-dd"></el-date-picker></el-col></el-form-item><el-form-item label="项目描述" prop="projectContent"><el-inputtype="textarea":rows="2"placeholder="请输入内容"v-model="form.projectContent"></el-input></el-form-item><el-form-item><el-button type="primary" @click="onSubmit('form')">立即创建</el-button><!-- <el-button >取消</el-button> --></el-form-item></el-form></el-dialog><span class="xiala">类型:</span><el-dropdown @command="handleCommand"><span class="el-dropdown-link" id="type1">请选择类型<i class="el-icon-arrow-down el-icon--right"></i></span><el-dropdown-menu slot="dropdown"><el-dropdown-item command="统建">统建</el-dropdown-item><el-dropdown-item command="自建">自建</el-dropdown-item><el-dropdown-item command="应用支撑">应用支撑</el-dropdown-item></el-dropdown-menu></el-dropdown><span class="xiala">状态:</span><el-dropdown @command="handleCommand2"><span class="el-dropdown-link" id="status1">请选择状态<i class="el-icon-arrow-down el-icon--right"></i></span><el-dropdown-menu slot="dropdown"><el-dropdown-item command="立项">立项</el-dropdown-item><el-dropdown-item command="进行">进行</el-dropdown-item><el-dropdown-item command="验收">验收</el-dropdown-item><el-dropdown-item command="结束">结束</el-dropdown-item></el-dropdown-menu></el-dropdown><div style="display: inline-block; margin-left: 10px"><span class="xiala">日期筛选:</span><el-date-pickerv-model="value1"type="daterange"range-separator="至"start-placeholder="开始日期"end-placeholder="结束日期"@change="handleTime"value-format="yyyy-MM-dd"></el-date-picker></div></div><div class="linetable"><el-table :data="tableData"><el-table-columntype="index"label="序号"width="200px"></el-table-column><el-table-columnprop="projectName"label="项目名称"width="300px"class-name="ellipsis-column"></el-table-column><el-table-column prop="projectType" label="类型"></el-table-column><el-table-column prop="projectStatus" label="状态"></el-table-column><el-table-column label="进展情况"   width="200px"><template slot-scope="scope"><el-button type="text" size="small" @click="showUpdate(scope.row)">查看进展</el-button></template></el-table-column><el-table-columnprop="expectedEndTime"label="预期结束时间"width="300px"></el-table-column><el-table-columnprop="projectContent"label="项目描述"width="300px"class-name="ellipsis-column"></el-table-column><el-table-column label="操作" width="200px"><template slot-scope="scope"><el-button type="text" size="small" @click="browses(scope.row)">查看</el-button><el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button><el-buttontype="text"size="small"@click="showDeleteDialog(scope.row)">删除</el-button></template></el-table-column></el-table><el-pagination@size-change="handleSizeChange"@current-change="handleCurrentChange":current-page="currentPage":page-sizes="[5, 10, 20]":page-size="pageSize":total="total"></el-pagination><!-- 删除 --><el-dialog:visible.sync="deletedata"title="编辑信息"@close="deletedata = false"><el-form:model="editForm"label-width="80px":rules="rules"ref="editForm"><p>确定删除吗?</p></el-form><span slot="footer" class="dialog-footer"><el-button @click="deletedata = false">取消</el-button><el-button type="primary" @click="handleDelete(currentRowData)">删除</el-button></span></el-dialog><!-- 编辑 --><el-dialog:visible.sync="dialogVisible"title="编辑信息"@close="dialogVisible = false"><el-form:model="editForm"label-width="80px":rules="rules"ref="editForm"><el-form-item label="项目名称" prop="projectName"><el-input v-model="editForm.projectName"></el-input></el-form-item><el-form-item label="项目类型" prop="projectType"><el-radio-group v-model="editForm.projectType"><el-radio label="统建"></el-radio><el-radio label="自建"></el-radio><el-radio label="应用支撑"></el-radio></el-radio-group></el-form-item><el-form-item label="项目状态" prop="projectStatus"><el-radio-group v-model="editForm.projectStatus"><el-radio label="立项"></el-radio><el-radio label="进行"></el-radio><el-radio label="验收"></el-radio><el-radio label="结项"></el-radio></el-radio-group></el-form-item><el-form-item label="预计结束时间" prop="expectedEndTime"><el-col :span="11"><el-date-pickertype="date"placeholder="选择日期"v-model="editForm.expectedEndTime"style="width: 100%"value-format="yyyy-MM-dd"></el-date-picker></el-col></el-form-item><el-form-item label="项目描述" prop="projectContent"><el-inputtype="textarea":rows="2"placeholder="请输入内容"v-model="editForm.projectContent"></el-input></el-form-item></el-form><span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">取消</el-button><el-button type="primary" @click="saveEdit('editForm')">保存</el-button></span></el-dialog><!-- 查看 --><el-dialog:visible.sync="browse"title="查看信息"@close="browse = false"><el-form:model="editForm"label-width="80px":rules="rules"ref="editForm"><el-form-item label="项目名称" prop="projectName"><el-inputv-model="editForm.projectName":disabled="true"></el-input></el-form-item><el-form-item label="项目类型" prop="projectType"><el-radio-group v-model="editForm.projectType"><el-radio label="统建" disabled></el-radio><el-radio label="自建" disabled></el-radio><el-radio label="应用支撑" disabled></el-radio></el-radio-group></el-form-item><el-form-item label="项目状态" prop="projectStatus"><el-radio-group v-model="editForm.projectStatus"><el-radio label="立项" disabled></el-radio><el-radio label="进行" disabled></el-radio><el-radio label="验收" disabled></el-radio><el-radio label="结项" disabled></el-radio></el-radio-group></el-form-item><el-form-item label="预计结束时间" prop="expectedEndTime"><el-col :span="11"><el-date-pickertype="date"placeholder="选择日期"v-model="editForm.expectedEndTime"style="width: 100%"value-format="yyyy-MM-dd"disabled></el-date-picker></el-col></el-form-item><el-form-item label="项目描述" prop="projectContent"><el-inputtype="textarea":rows="2"placeholder="请输入内容"v-model="editForm.projectContent"></el-input></el-form-item></el-form><span slot="footer" class="dialog-footer"><!-- <el-button @click="browse = false">取消</el-button> --><el-button type="primary" @click="browse = false">关闭</el-button></span></el-dialog><el-dialog:visible.sync="updateVisible"title="全部进展信息"width="50%":before-close="handleClose"><div class="block"><el-timeline :reverse="reverse"><el-timeline-itemv-for="(activity, index) in activities":key="index":timestamp="activity.timestamp">{{ activity.content }}</el-timeline-item></el-timeline></div><span slot="footer" class="dialog-footer"><el-button type="primary" @click="updateVisible = false">关闭</el-button></span></el-dialog></div></div></div>
</template><script>import daily from "./daily.vue";
import { fetchData } from "../api/index";
import { deleteData } from "../api/index";
import { editData } from "../api/index";
import { selectbytypeData } from "../api/index";
import { addData } from "../api/index";
export default {components: {daily,},data() {return {// 删除deletedata: false,value1: "",total: 0,tableData: [],currentPage: 1,pageSize: 10,dialogVisible: false,// 查看browse: false,updateVisible: false,updateContent: "",adddialogVisible: false,editForm: {},params: {type: "",status: "",page: 1,size: 10,startDate: "",endDate: "",},form: {projectName: "",projectType: "",projectStatus: "",expectedEndTime: "",projectContent: "",},rules: {projectName: [{ required: true, message: "请填写项目名称" }],projectType: [{ required: true, message: "请选择项目类型" }],projectStatus: [{ required: true, message: "请选择项目状态" }],expectedEndTime: [{ required: true, message: "请选择项目预计结束时间" },],projectContent: [{ required: true, message: "请选择项目描述" }],},reverse: true,activities: [{content: "活动按期开始",timestamp: "2018-04-15",},{content: "通过审核",timestamp: "2018-04-13",},{content: "创建成功",timestamp: "2018-04-11",},],};},computed: {currentPageData() {const start = this.currentPage * this.pageSize;const end = start + this.pageSize;return this.tableData.slice(start, end);},},methods: {// 跳转dailys(row) {window.open("http://localhost:8080/#/daily/");},// 类型handleCommand(command) {// console.log("选中的值为:", command);document.getElementById("type1").innerText = command;this.params.type = command;// console.log(this.params);// 在这里可以对选中的值进行处理selectbytypeData("/projects/search", this.params).then((response) => {// 请求成功处理// console.log(response.data.content);this.tableData = response.data.content;for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];// console.log(row.expectedEndTime.substring(0, 10));this.tableData[index].expectedEndTime = row.expectedEndTime.substring(0,10);}});},// 状态handleCommand2(command) {// console.log("选中的值为:", command);this.params.status = command;document.getElementById("status1").innerText = command;// console.log(this.params);// 在这里可以对选中的值进行处理selectbytypeData("/projects/search", this.params).then((response) => {// 请求成功处理// console.log(response.data.content);this.tableData = response.data.content;for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];// console.log(row.expectedEndTime.substring(0, 10));this.tableData[index].expectedEndTime = row.expectedEndTime.substring(0,10);}});},// 时间控件handleTime() {this.params.startDate = this.value1[0];this.params.endDate = this.value1[1];selectbytypeData("/projects/search", this.params).then((response) => {// 请求成功处理// console.log(response.data.content);this.tableData = response.data.content;for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];// console.log(row.expectedEndTime.substring(0, 10));this.tableData[index].expectedEndTime = row.expectedEndTime.substring(0,10);}});},// 图片showAddDialog() {this.adddialogVisible = true;},// 查看 弹框browses(row) {// console.log(row,'nihO')this.editForm = Object.assign({}, row);this.browse = true;},// 编辑 弹框handleEdit(row) {this.editForm = Object.assign({}, row);this.dialogVisible = true;},// 删除确认  按钮handleDelete(row) {const index = this.tableData.indexOf(row);// console.log("row is", row.id);deleteData("/projects", row.id).then((response) => {// 请求成功处理});if (index !== -1) {this.tableData.splice(index, 1);}this.deletedata = false; // 关闭对话框},// 删除 弹框showDeleteDialog(row) {this.currentRowData = row; // 将当前行的数据保存到 currentRowDatathis.deletedata = true; // 打开对话框},// 保存按钮saveEdit(editForm) {// 在这里保存编辑后的数据this.$refs[editForm].validate((valid) => {if (valid) {editData("/projects", this.editForm.id, this.editForm).then// response => {//   // 请求成功处理// }();this.dialogVisible = false;window.location.reload();} else {console.log("error submit!!");return false;}});},// 分页handleSizeChange(val) {this.pageSize = val;},// 分页handleCurrentChange(val) {this.currentPage = val;this.params.page = val;console.log(this.params, " this.params.page ");if (this.value1) {this.params.startDate = this.value1[0];this.params.endDate = this.value1[1];}fetchData("/projects", this.params).then((response) => {// 请求成功处理const currentPage = this.params.page;this.currentPage = currentPage;this.tableData = response.data.content;for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];// console.log(row.expectedEndTime.substring(0, 10));this.tableData[index].expectedEndTime = row.expectedEndTime.substring(0,10);}this.$forceUpdate();});},// 查看进展showUpdate(row) {// 在这里获取id参数,假设id字段在row对象中const id = row.id;// 序列化rowa对象const rowaJson = JSON.stringify(row);// 在新标签页中打开链接,携带序列化后的对象window.open(`http://localhost:8080/#/progess/${id}?data=${encodeURIComponent(rowaJson)}`,"_blank");console.log(rowaJson, "rowaJson");},handleClose(done) {this.updateContent = "";done();},// 立即创建onSubmit(form) {this.$refs[form].validate((valid) => {if (valid) {addData("/projects", this.form);this.adddialogVisible = false;window.location.reload();} else {console.log("error submit!!");return false;}});},},mounted() {// 获取信息fetchData("/projects", this.params).then((response) => {// 请求成功处理this.params.page = this.currentPage;this.tableData = response.data.content;console.log(response, "首次获取数据");for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];// console.log(row.expectedEndTime,'row')// console.log(row.expectedEndTime.substring(0, 10));this.tableData[index].expectedEndTime = row.expectedEndTime.substring(0,10);}this.total = response.data.totalElements;});},
};
</script>
<style>
.ellipsis-column .cell {display: block; /* 或者 inline-block,取决于你的布局需求 */overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
}.el-form-item__label {width: 120px !important;
}
.el-form-item__content {margin-left: 120px !important;
}
.el-pagination__rightwrapper {float: left !important;
}
.dingwei {margin-top: 100px;position: fixed;/* bottom: 150px;right: 40px;z-index: 999; */
}
.xiala {font-size: 16px;margin-left: 30px;
}
.linetit {float: left;width: 100%;text-align: left;line-height: 60px;border-bottom: 2px solid #d9ecff;background-color: #fff8f8;
}
.linetable {width: 100%;margin: 0px auto;
}
.el-dropdown-link {border: 1px solid #dcdfe6;background-color: #fff;color: #606266 !important;
}
.contentnew {width: 1800px;margin: 20px auto 0 auto;
}
.el-dropdown-link {cursor: pointer;font-size: 16px;padding: 6px 10px;line-height: 30px;border-radius: 8px;
}.el-pagination {margin-top: 20px;
}.el-icon-arrow-down {font-size: 12px;
}.el-table .el-table__cell {text-align: center !important;color: #333 !important;font-size: 16px !important;font-weight: normal !important;
}
.el-table th {background-color: #ecf5ff !important;
}
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell,
.el-table__body tr td {background-color: #fff !important;
}
.imgnew {margin: 90px auto;
}
.el-button--small {font-size: 15px !important;
}.btnnew {border: none !important;font-size: 22px !important;font-weight: bold !important;padding: 0 15px !important;
}#myButton {opacity: 0.5; /* 置灰 */pointer-events: none; /* 禁止点击 */
}
</style>

接受路由参数页面

<template><div><!-- <div class="dingwei"><a href="#"><el-image:src="require('../assets/glxt.png')"@click="showAddDialog"></el-image></a></div> --><div style="text-align: center"><el-image :src="require('../assets/jzqk.png')" class="imgnew" /></div><div class="contentnew"><div><p><span>项目名称</span>: {{ this.projectName }}</p><p><span>项目类型</span>: {{ this.projectType }}</p><p><span>项目状态</span>: {{ this.projectStatus }}</p><p><span>项目时间</span>: {{ this.expectedEndTime }}</p><p><span>项目描述</span>: {{ this.projectContent }}</p></div><el-dialog :visible.sync="adddialogVisible" title="新增进程"><el-form ref="form" :model="form" label-width="80px" :rules="rules"><el-form-item label="标题" prop="title"><el-input v-model="form.title"></el-input></el-form-item><el-form-item label="描述"><el-input type="textarea" v-model="form.description"></el-input></el-form-item><el-form-item label="负责人" prop="responsiblePerson"><el-input v-model="form.responsiblePerson"></el-input></el-form-item><el-form-item label="附件"><el-uploadclass="upload-demo"action="http://192.168.7.1:10020/project-updates/upload":on-success="handleSuccess":on-error="handleError"><el-button slot="trigger" size="small" type="primary">选择文件</el-button></el-upload></el-form-item><el-form-item label="时间" prop="updateTime"><el-col :span="11"><el-date-pickertype="date"placeholder="选择日期"v-model="form.updateTime"style="width: 100%"value-format="yyyy-MM-dd"></el-date-picker></el-col></el-form-item><el-form-item><el-button type="primary" @click="onSubmit('form')">立即创建</el-button></el-form-item></el-form></el-dialog><el-button type="primary" @click="showAddDialog">新增内容</el-button><el-table :data="tableData"><el-table-columntype="index"label="序号"width="100"></el-table-column><el-table-columnprop="description"label="描述"width="300px"class-name="ellipsis-column"></el-table-column><el-table-columnlabel="附件"width="200px"class-name="ellipsis-column"><template slot-scope="scope"><el-buttontype="text"size="small"@click="showUpdate(scope.row)"id="download":style="{ color: scope.row.attachment ? '#409eff' : 'grey' }">{{ scope.row.title }}</el-button></template></el-table-column><el-table-column prop="updateTime" label="时间"></el-table-column><el-table-column label="操作"><template slot-scope="scope"><el-button type="text" size="small" @click="browses(scope.row)">查看</el-button><el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button><el-buttontype="text"size="small"@click="showDeleteDialog(scope.row)">删除</el-button></template></el-table-column></el-table><!-- 删除 --><el-dialog:visible.sync="deletedata"title="编辑信息"@close="deletedata = false"><el-form:model="editForm"label-width="80px":rules="rules"ref="editForm"><p>确定删除吗?</p></el-form><span slot="footer" class="dialog-footer"><el-button @click="deletedata = false">取消</el-button><el-button type="primary" @click="handleDelete(currentRowData)">删除</el-button></span></el-dialog><el-pagination@size-change="handleSizeChange"@current-change="handleCurrentChange":current-page="currentPage":page-sizes="[5, 10, 20]":page-size="pageSize":total="total"></el-pagination><el-dialog:visible.sync="dialogVisible"title="编辑信息"@close="dialogVisible = false"><el-form:model="editForm"label-width="80px"ref="editForm":rules="rules"><el-form-item label="标题" prop="title"><el-input v-model="editForm.title"></el-input></el-form-item><el-form-item label="描述" prop="description"><el-input type="textarea" v-model="editForm.description"></el-input></el-form-item><el-form-item label="负责人" prop="responsiblePerson"><el-input v-model="editForm.responsiblePerson"></el-input></el-form-item><el-form-item label="附件" prop="attachment"><el-uploadclass="upload-demo"action="http://192.168.1.1:10020/project-updates/upload":on-success="handleSuccess":on-error="handleError":file-list="fileList":limit="1"><el-button slot="trigger" size="small" type="primary">选择文件</el-button><div slot="tip" class="el-upload__tip" style="color: red">只允许上传一个文件,请删除原文件后再上传</div></el-upload></el-form-item><el-form-item label="时间" prop="updateTime"><el-col :span="11"><el-date-pickertype="date"placeholder="选择日期"v-model="editForm.updateTime"style="width: 100%"></el-date-picker></el-col></el-form-item></el-form><span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">取消</el-button><el-button type="primary" @click="saveEdit('editForm')">保存</el-button></span></el-dialog><!-- 查看 --><el-dialog:visible.sync="browse"title="查看信息"@close="browse = false"><el-form:model="editForm"label-width="80px"ref="editForm":rules="rules"><el-form-item label="标题" prop="title"><el-input v-model="editForm.title" disabled></el-input></el-form-item><el-form-item label="描述" prop="description"><el-inputtype="textarea"v-model="editForm.description"disabled></el-input></el-form-item><el-form-item label="负责人" prop="responsiblePerson"><el-input v-model="editForm.responsiblePerson" disabled></el-input></el-form-item><el-form-item label="附件" prop="attachment"><el-uploadclass="upload-demo"action="http://192.168.7.1:10020/project-updates/upload":on-success="handleSuccess":on-error="handleError":file-list="fileList":limit="1"disabled><el-button slot="trigger" size="small" type="primary">选择文件</el-button><div slot="tip" class="el-upload__tip" style="color: red">只允许上传一个文件,请删除原文件后再上传</div></el-upload></el-form-item><el-form-item label="时间" prop="updateTime"><el-col :span="11"><el-date-pickertype="date"placeholder="选择日期"v-model="editForm.updateTime"style="width: 100%"disabled></el-date-picker></el-col></el-form-item></el-form><span slot="footer" class="dialog-footer"><el-button type="primary" @click="browse = false">关闭</el-button></span></el-dialog><el-dialog:visible.sync="updateVisible"title="全部进展信息"width="50%":before-close="handleClose"><div class="block"><el-timeline :reverse="reverse"><el-timeline-itemv-for="(activity, index) in activities":key="index":timestamp="activity.timestamp">{{ activity.content }}</el-timeline-item></el-timeline></div><span slot="footer" class="dialog-footer"><el-button type="primary" @click="updateVisible = false">关闭</el-button></span></el-dialog></div></div>
</template><script>
import { fetchData } from "../api/detail";
import { deleteData } from "../api/detail";
import { editData } from "../api/detail";
import { selectbytypeData } from "../api/detail";
import { addData } from "../api/detail";
export default {data() {return {// 删除deletedata: false,namefu: [],namefuArray: [],routerdata: "",dataParam: "",// 查看browse: false,projectName: "",projectType: "",projectStatus: "",expectedEndTime: "",projectContent: "",fileList: [],tableData: [],total: 0,currentPage: 1,pageSize: 10,dialogVisible: false,updateVisible: false,updateContent: "",adddialogVisible: false,id: "",editForm: {},params: {type: "",status: "",page: 1,size: 10,},form: {projectId: "",title: "",description: "",attachment: "",responsiblePerson: "",// projectStatus: "",updateTime: "",},rules: {title: [{ required: true, message: "请输入标题", trigger: "blur" }],responsiblePerson: [{ required: true, message: "请输入负责人姓名", trigger: "change" },],updateTime: [{ required: true, message: "请选择时间", trigger: "change" },],},reverse: true,activities: [{content: "活动按期开始",timestamp: "2018-04-15",},{content: "通过审核",timestamp: "2018-04-13",},{content: "创建成功",timestamp: "2018-04-11",},],};},computed: {},methods: {// 附件handleSuccess(response, file, fileList) {// 处理上传成功的逻辑this.fileList = [];this.fileList = response;this.form.attachment = response;console.log(this.form.attachment);},handleError() {"文件上传失败";},// 图片弹框showAddDialog() {this.adddialogVisible = true;},// 查看browses(row) {// console.log(row,'nihO')this.editForm = Object.assign({}, row);this.browse = true;},// 编辑 按钮handleEdit(row) {this.editForm = Object.assign({}, row);//   this.editForm.attachment = "111";console.log(row.attachment);if (row.attachment) {const obj = {};obj.name = row.attachment.substring(52);obj.url = row.attachment;this.fileList = [];this.fileList.push(obj);}this.dialogVisible = true;},// 删除 弹框showDeleteDialog(row) {this.currentRowData = row; // 将当前行的数据保存到 currentRowDatathis.deletedata = true; // 打开对话框},// 删除 按钮handleDelete(row) {const index = this.tableData.indexOf(row);// console.log("row is", row.id);deleteData("/project-updates", row.id).then((response) => {// 请求成功处理});if (index !== -1) {this.tableData.splice(index, 1);}this.deletedata = false; // 关闭对话框},// 保存  编辑saveEdit(form) {// 在这里保存编辑后的数据console.log("保存编辑后的数据", this.editForm.id);this.$refs[form].validate((valid) => {if (valid) {this.editForm.attachment=this.fileList;this.projectId = this.$route.params.id;console.log(this.projectId);console.log(form, "from");editData("/project-updates", this.editForm.id, this.editForm).then((response) => {// 请求成功处理});this.dialogVisible = false;window.location.reload();} else {console.log("error submit!!");return false;}});},// 分页handleSizeChange(val) {this.pageSize = val;},handleCurrentChange(val) {this.currentPage = val;this.params.page = val;fetchData("/project-updates/projectPage",this.$route.params.id,this.params).then((response) => {// 请求成功处理const currentPage = this.params.page;this.currentPage = currentPage;this.tableData = response.data.content;for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];// console.log(row.expectedEndTime.substring(0, 10));this.tableData[index].updateTime = row.updateTime.substring(0, 10);}this.$forceUpdate();});},// 附件showUpdate(row) {// 在这里获取id参数,假设id字段在row对象中const lianjie = row.attachment;const downloadElement = this.$el.querySelector("#download");if (lianjie) {window.open(lianjie, "_blank");} else {downloadElement.classList.add("grey");}},handleClose(done) {this.updateContent = "";done();},// 立即创建onSubmit(form) {// console.log(this.form,'from')this.$refs[form].validate((valid) => {if (valid) {// alert("submit!");this.form.projectId = this.id;// this.form.attachment=this.fileList;addData("/project-updates", this.form);this.adddialogVisible = false;window.location.reload();console.log(this.form, "this.form");} else {console.log("error submit!!");return false;}});},},created() {fetchData("/project-updates/projectPage",// 接受上一个页面传过来的路由值this.$route.params.id,this.params).then((response) => {if (response) {// 请求成功处理console.log(response.data,'response');this.tableData = response.data.content;this.routerid = this.$route.params.id;this.routerdata = this.$route.query.data;this.projectName = JSON.parse(this.routerdata).projectName;this.projectType = JSON.parse(this.routerdata).projectType;this.projectStatus = JSON.parse(this.routerdata).projectStatus;this.expectedEndTime = JSON.parse(this.routerdata).expectedEndTime;this.projectContent = JSON.parse(this.routerdata).projectContent;for (let index = 0; index < this.tableData.length; index++) {const row = this.tableData[index];this.namefu = row.description;this.namefuArray.push(this.namefu); // 将每次的namefu值保存到数组中this.tableData[index].updateTime = row.updateTime.substring(0, 10);}this.total = response.data.totalElements;}});},mounted() {this.id = this.$route.params.id;// console.log("获取到的id参数为:", this.id);},
};
</script>
<style>
.ellipsis-column .cell {display: block; /* 或者 inline-block,取决于你的布局需求 */overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
}
.el-form-item__label {width: 120px !important;
}
.el-pagination__rightwrapper {float: left !important;
}
.el-form-item__content {margin-left: 120px !important;
}
.dingwei {position: fixed;bottom: 150px;right: 40px;z-index: 999;
}
.xiala {font-size: 16px;margin-left: 30px;
}
.linetit {float: left;width: 100%;text-align: left;line-height: 60px;border-bottom: 2px solid #d9ecff;background-color: #fff8f8;
}
.linetable {width: 100%;margin: 0px auto;
}
.el-dropdown-link {border: 1px solid #dcdfe6;background-color: #fff;color: #606266 !important;
}
.contentnew {width: 1800px;margin: 20px auto 0 auto;
}
.el-dropdown-link {cursor: pointer;font-size: 16px;padding: 6px 10px;line-height: 30px;border-radius: 8px;
}.el-pagination {margin-top: 20px;
}.el-icon-arrow-down {font-size: 12px;
}.el-table .el-table__cell {text-align: center !important;color: #333 !important;font-size: 16px !important;font-weight: normal !important;
}
.el-table th {background-color: #ecf5ff !important;
}
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell,
.el-table__body tr td {background-color: #fff !important;
}
.imgnew {margin: 90px auto;
}
.el-button--small {font-size: 15px !important;
}.btnnew {border: none !important;font-size: 22px !important;font-weight: bold !important;padding: 0 15px !important;
}
</style>

api页面

import axios from 'axios';const BASE_URL = 'http://192.168.1.1:10020';const api = axios.create({baseURL: BASE_URL,timeout: 10000,headers: {'Access-Control-Allow-Origin': "*"}
});// ----------------- 日报--------------------------------//获取全部数据,分页情况params是分页参数page size
export const dailyfetchData = (endpoint, params) => {return api.get(`${endpoint}?page=${params.page}&size=${params.size}`);
};//新增
export const dailyaddData = (endpoint, params) => {console.log('api')return api.post(endpoint, params);
};//删除 
export const dailydeleteData = (endpoint, id) => {return api.delete(`${endpoint}/${id}`);
};//修改
export const dailyeditData = (endpoint, id, params) => {return api.put(`${endpoint}/${id}`, params);
};// -------------------------------------------------//获取全部数据,分页情况params是分页参数page size
export const fetchData = (endpoint, params) => {return api.get(`${endpoint}?page=${params.page}&size=${params.size}`);
};
//删除
export const deleteData = (endpoint, id) => {return api.delete(`${endpoint}/${id}`);
};
//修改
export const editData = (endpoint, id, params) => {return api.put(`${endpoint}/${id}`, params);
};
//查询
export const searchData = (endpoint, id) => {return api.get(`${endpoint}/${id}`);
};
//新增
export const addData = (endpoint, params) => {return api.post(endpoint, params);
};
//通过类型查询
export const selectbytypeData = (endpoint, params) => {if (!params.status && params.type && params.startDate) {return api.get(`${endpoint}?type=${params.type}&startDate=${params.startDate}&endDate=${params.endDate}&page=${params.page}&size=${params.size}`);} else if (!params.type && params.status && params.startDate) {return api.get(`${endpoint}?status=${params.status}&startDate=${params.startDate}&endDate=${params.endDate}&page=${params.page}&size=${params.size}`);} else if (!params.startDate && params.type && params.status) {return api.get(`${endpoint}?type=${params.type}&status=${params.status}&page=${params.page}&size=${params.size}`);} else if (!params.status && !params.type && params.startDate) {return api.get(`${endpoint}?startDate=${params.startDate}&endDate=${params.endDate}&page=${params.page}&size=${params.size}`);} else if (!params.status && !params.startDate && params.type) {return api.get(`${endpoint}?type=${params.type}&page=${params.page}&size=${params.size}`);} else if (!params.type && !params.startDate && params.status) {return api.get(`${endpoint}?status=${params.status}&page=${params.page}&size=${params.size}`);} else {return api.get(`${endpoint}?type=${params.type}&status=${params.status}&startDate=${params.startDate}&endDate=${params.endDate}&page=${params.page}&size=${params.size}`);}// return api.get(`${endpoint}?type=${params.type}&status=${params.status}&startDate=${params.startDate}&endDate=${params.endDate}&page=${params.page}&size=${params.size}`);
};

 router页面

import Vue from 'vue'
import VueRouter from 'vue-router'Vue.use(VueRouter)const routes = [{path: '/',name: 'home',beforeEnter: (to, from, next) => {document.title = '信息化项目管理系统';next();},component: () => import(/* webpackChunkName: "about" */ '../views/MyVue.vue')},{path: '/daily',name: 'daily',beforeEnter: (to, from, next) => {document.title = '信息化项目管理系统';next();},component: () => import(/* webpackChunkName: "about" */ '../views/daily.vue')},{path: '/progess/:id',name: 'progess',beforeEnter: (to, from, next) => {document.title = '信息化项目管理系统';next();},// route level code-splitting// this generates a separate chunk (about.[hash].js) for this route// which is lazy-loaded when the route is visited.component: () => import(/* webpackChunkName: "about" */ '../views/progess.vue')}
]const router = new VueRouter({routes
})export default router

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/759798.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【办公类-16-07-07】“2023下学期 大班户外游戏2(有场地和无场地版,每天不同场地)”(python 排班表系列)

作品展示 背景需求&#xff1a; 2024年2月教务组发放的是“每周五天内容相同&#xff0c;两周10天内容相同”的户外游戏安排 【办公类-16-07-05】合并版“2023下学期 大班户外游戏&#xff08;有场地和无场地版&#xff0c;两周一次&#xff09;”&#xff08;python 排班表系…

css预处理器scss的使用如何全局引入

目录 scss 基本功能 1、嵌套 2、变量 $ 3、mixin 和 include 4、extend 5、import scss 在项目中的使用 1、存放 scss 文件 2、引入 variables 和 mixins 2-1、局部引入 2-2、全局引入 3、入口文件中引入其他文件 项目中使用 css 预处理器&#xff0c;可以提高 cs…

Uibot6.0 (RPA财务机器人师资培训第1天 )RPA+AI、RPA基础语法

训练网站&#xff1a;泓江科技 (lessonplan.cn)https://laiye.lessonplan.cn/list/ec0f5080-e1de-11ee-a1d8-3f479df4d981(本博客中会有部分课程ppt截屏,如有侵权请及请及时与小北我取得联系~&#xff09; 紧接着小北之前的几篇博客&#xff0c;友友们我们即将开展新课的学习~…

Vulnhub - Raven2

希望和各位大佬一起学习&#xff0c;如果文章内容有错请多多指正&#xff0c;谢谢&#xff01; 个人博客链接&#xff1a;CH4SER的个人BLOG – Welcome To Ch4sers Blog Raven2 靶机下载地址&#xff1a;https://www.vulnhub.com/entry/raven-2,269/ 0x01 信息收集 Nmap扫描…

spring-boot-devtools debug SilentExitException

spring-boot-devtools debug SilentExitException&#xff1a;springboot热部署debug模式进入SilentExitException /** Copyright 2012-2019 the original author or authors.** Licensed under the Apache License, Version 2.0 (the "License");* you may not use …

软考网工学习笔记(6) 广域通信网

公共交换电话网&#xff08;pstn&#xff09; 在pstn是为了语音通信而建立的网络。从20世纪60你年代开始用于数据传输 电话网有三个部分组成&#xff1a; 本地回路 &#xff0c;干线 和 交换机 。 干线 和 交换机 一般采用数字传输和交换技术 &#xff0c;而 本地回路基本采…

Ubutun部署docker,并使用docker部署springboot项目,关闭软件可继续访问

工具为xftp和xshell。 我这里使用的Ubuntu的版本是20.04的&#xff0c;话不多说&#xff0c;我们来直接上代码。 首先我们最好使用管理员权限进行操作&#xff0c;预防操作时遇到权限问题。 部署docker 登入管理员 不登入管理员也没关系。 su根据提示输入密码&#xff0c;进…

2024蓝桥杯每日一题(并查集)

备战2024年蓝桥杯 -- 每日一题 Python大学A组 试题一&#xff1a;奶酪 试题二&#xff1a;合并集合 试题三&#xff1a;连通块中点的数量 试题四&#xff1a;网络分析 试题一&#xff1a;奶酪 【题目描述】 现有一块大奶酪&#xff0c;它的高度为 hℎ…

shell source脚本中如何读取另外一个脚本中的变量

目录 前言语法举例注意 前言 要在一个Shell脚本中读取另一个Shell脚本中的变量&#xff0c;可以使用source命令或者.命令。这些命令用于在当前Shell环境中运行指定的脚本&#xff0c;从而使得脚本中的变量在当前Shell中可用。 语法 #!/bin/bash # 读取另一个Shell脚本中的变…

金智维的务实主义,打响大模型落地“突围战”

今年以来&#xff0c;新质生产力成为全社会关注的焦点。新质生产力的特征之一&#xff0c;就是深化新技术应用&#xff0c;尤其是AI及大模型&#xff0c;要加速落地到实际业务场景中&#xff0c;为千行万业提质增效。 2024是大模型技术做深、价值做实的一年。3月20日&#xff0…

【C++】详解智能指针

目录 一、智能指针的作用二、内存泄露1、什么是内存泄露2、内存泄漏分类3、如何避免内存泄露 三、智能指针的使用及原理1、RAII2、智能指针的原理3、std::auto_ptr4、std::unique_ptr5、std::shared_ptr1、std::shared_ptr原理2、std::shared_ptr的线程安全问题4、std::shared_…

python爬虫学习第二天----类型转换

&#x1f388;&#x1f388;作者主页&#xff1a; 喔的嘛呀&#x1f388;&#x1f388; &#x1f388;&#x1f388;所属专栏&#xff1a;python爬虫学习&#x1f388;&#x1f388; ✨✨谢谢大家捧场&#xff0c;祝屏幕前的小伙伴们每天都有好运相伴左右&#xff0c;一定要天天…

电脑如何录视频?进阶教程来了!

随着科技的飞速发展&#xff0c;视频录制已成为我们日常生活和工作中不可或缺的一部分。无论是进行在线教育、制作教学视频&#xff0c;还是记录游戏过程、直播分享&#xff0c;录屏都扮演着至关重要的角色。可是您知道电脑如何录视频吗&#xff1f;本文将介绍两种电脑录视频的…

稀碎从零算法笔记Day23-LeetCode:二叉树的最大深度

题型&#xff1a;链表、二叉树的遍历 链接&#xff1a;104. 二叉树的最大深度 - 力扣&#xff08;LeetCode&#xff09; 来源&#xff1a;LeetCode 题目描述 给定一个二叉树 root &#xff0c;返回其最大深度。 二叉树的 最大深度 是指从根节点到最远叶子节点的最长路径上…

vue2从基础到高级学习笔记

在实际的工作中,我常使用vue的用法去实现效果,但是你要是问我为什么这样写,它的原理是啥就答不上来了。对vue的认知一直停留在表面,写这篇文章主要是为了理清并弄透彻vue的原理。 学习目标 1 学会一些基本用法的原理 2 弄懂vue核心设计原理 3 掌握vue高级api的用法 一 vue…

环境安装篇 之 安装kubevela

云原生学习路线导航页&#xff08;持续更新中&#xff09; 本文是 环境安装 系列文章&#xff0c;介绍 oam规范标准实施项目 kubevela 的安装详细步骤kubevela 官方安装文档&#xff1a;https://kubevela.io/zh/docs/installation/kubernetes/ 1.CentOS 安装kubevela 1.1.前提…

电脑数据安全新篇章:备份文件,守护您的珍贵数据

备份文件&#xff0c;无疑是电脑使用中不可或缺的重要一环。在数字化时代&#xff0c;我们的工作、学习和生活都离不开电脑&#xff0c;而电脑中的数据更是我们宝贵的财富。一旦数据丢失或损坏&#xff0c;可能会带来无法估量的损失。因此&#xff0c;备份文件的重要性不言而喻…

Vue.js+SpringBoot开发高校宿舍调配管理系统

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能需求2.1 学生端2.2 宿管2.3 老师端 三、系统展示四、核心代码4.1 查询单条个人习惯4.2 查询我的室友4.3 查询宿舍4.4 查询指定性别全部宿舍4.5 初次分配宿舍 五、免责说明 一、摘要 1.1 项目介绍 基于JAVAVueSpringBootMySQL的…

力扣hot100:4. 寻找两个正序数组的中位数(归并排序/二分/双指针)

目录 一、暴力排序 二、归并排序 三、双指针 四、二分查找 如果本题不说明时间复杂度应该为O(log(mn)&#xff0c;那么本题应该是一个简单题&#xff0c;解决的方法有很多。这里先列举出普通方法&#xff0c;再来讨论二分。 一、暴力排序 不管啦&#xff0c;直接纯暴力&…

黑白照片怎么变彩色?3个实用上色方法分享

黑白照片怎么变彩色&#xff1f;这是一个让许多人感到好奇和期待的问题。随着科技的发展&#xff0c;现在已经有多种软件可以将黑白照片转变为彩色&#xff0c;让历史的回忆重新焕发出生机。这些软件利用先进的算法和图像处理技术&#xff0c;能够精准地还原出照片中的色彩&…