|
@@ -102,7 +102,7 @@
|
|
|
:total="total"
|
|
:total="total"
|
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
|
- :current-page.sync="pageindex"
|
|
|
|
|
|
|
+ :current-page="pageindex"
|
|
|
:page-size="pagesize"
|
|
:page-size="pagesize"
|
|
|
>
|
|
>
|
|
|
</el-pagination>
|
|
</el-pagination>
|
|
@@ -130,6 +130,34 @@ export default {
|
|
|
certificateTypeValue: null, //证书类型
|
|
certificateTypeValue: null, //证书类型
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ // 监听路由变化,当从其他页面返回时更新状态
|
|
|
|
|
+ '$route.query': {
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ handler(newQuery) {
|
|
|
|
|
+ if (newQuery.pageindex) {
|
|
|
|
|
+ this.pageindex = Number(newQuery.pageindex);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (newQuery.value) {
|
|
|
|
|
+ this.value = newQuery.value;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (newQuery.pagesize) {
|
|
|
|
|
+ this.pagesize = Number(newQuery.pagesize);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ searchinput: {
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ handler(newQuery) {
|
|
|
|
|
+ if (newQuery) {
|
|
|
|
|
+ this.pageindex = 1;
|
|
|
|
|
+ this.pagesize=20
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
//#region 页码
|
|
//#region 页码
|
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
@@ -141,25 +169,38 @@ export default {
|
|
|
this.listpage();
|
|
this.listpage();
|
|
|
},
|
|
},
|
|
|
typeChange() {
|
|
typeChange() {
|
|
|
|
|
+ this.pageindex = 1;
|
|
|
|
|
+ this.pagesize = 20;
|
|
|
this.listpage();
|
|
this.listpage();
|
|
|
},
|
|
},
|
|
|
//#endregion
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region 头接口
|
|
//#region 头接口
|
|
|
|
|
+ // 修改pushRouter方法,传递完整的查询状态
|
|
|
pushRouter(id) {
|
|
pushRouter(id) {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: "/certificate/list/addList",
|
|
path: "/certificate/list/addList",
|
|
|
query: {
|
|
query: {
|
|
|
id,
|
|
id,
|
|
|
|
|
+ // 传递项目ID
|
|
|
value: this.value,
|
|
value: this.value,
|
|
|
- },
|
|
|
|
|
|
|
+ // 传递证书类型
|
|
|
|
|
+ certificateTypeValue: this.certificateTypeValue,
|
|
|
|
|
+ // 传递搜索关键词
|
|
|
|
|
+ searchinput: this.searchinput,
|
|
|
|
|
+ // 传递当前页码
|
|
|
|
|
+ pageindex: this.pageindex,
|
|
|
|
|
+ // 传递每页条数
|
|
|
|
|
+ pagesize: this.pagesize
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
- console.log(this.value, "value");
|
|
|
|
|
},
|
|
},
|
|
|
//#endregion
|
|
//#endregion
|
|
|
|
|
|
|
|
//#region 列表接口
|
|
//#region 列表接口
|
|
|
projectChange() {
|
|
projectChange() {
|
|
|
|
|
+ this.pageindex = 1;
|
|
|
|
|
+ this.pagesize = 20;
|
|
|
//下拉框change事件
|
|
//下拉框change事件
|
|
|
this.listpage();
|
|
this.listpage();
|
|
|
},
|
|
},
|
|
@@ -196,19 +237,29 @@ export default {
|
|
|
this.listpage();
|
|
this.listpage();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- async queryProjectList() {
|
|
|
|
|
- //获取所有项目
|
|
|
|
|
- const { data: res } = await queryProjectList();
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.options = res.data;
|
|
|
|
|
- if (this.$route.query.value) {
|
|
|
|
|
- this.value = this.$route.query.value;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.value = this.value = this.options[0].id;
|
|
|
|
|
- }
|
|
|
|
|
- this.listpage();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ async queryProjectList() {
|
|
|
|
|
+ const { data: res } = await queryProjectList();
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.options = res.data;
|
|
|
|
|
+ // 处理路由参数
|
|
|
|
|
+ if (this.$route.query.value) {
|
|
|
|
|
+ this.value = this.$route.query.value;
|
|
|
|
|
+ // 确保页码是数字类型
|
|
|
|
|
+ this.pageindex = Number(this.$route.query.pageindex) || 1;
|
|
|
|
|
+ this.pagesize = Number(this.$route.query.pagesize) || 20;
|
|
|
|
|
+ this.certificateTypeValue = this.$route.query.certificateTypeValue
|
|
|
|
|
+ ? Number(this.$route.query.certificateTypeValue)
|
|
|
|
|
+ : null;
|
|
|
|
|
+ this.searchinput = this.$route.query.searchinput || '';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.value = this.options[0].id || '';
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.listpage();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+},
|
|
|
|
|
+
|
|
|
async listpage() {
|
|
async listpage() {
|
|
|
//分页获取证书列表数据
|
|
//分页获取证书列表数据
|
|
|
const { data: res } = await listpage({
|
|
const { data: res } = await listpage({
|