master
parent
8f004f5b01
commit
9691598913
|
@ -10,11 +10,10 @@ import axios from 'axios'
|
|||
import VueAxios from 'vue-axios'
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
axios.defaults.baseURL='https://a99zg89a.xiaomy.net'
|
||||
|
||||
axios.interceptors.request.use(config => {
|
||||
|
||||
config.headers.Authorization = "Basic c2FiZXI6c2FiZXJfc2VjcmV0"
|
||||
|
||||
console.log(config.headers)
|
||||
return config
|
||||
})
|
||||
let app=createApp(App)
|
||||
|
|
|
@ -45,8 +45,12 @@ export default {
|
|||
this.axios
|
||||
.post("/hysc/auth/token", param)
|
||||
.then(function (response) {
|
||||
console.log(response.data.code,"登录");
|
||||
console.log(response.data,"登录");
|
||||
if (response.data.code == 200) {
|
||||
|
||||
that.axios.defaults.headers.common['Blade-Auth'] ="bearer "+response.data.data.accessToken
|
||||
console.log( that.axios.defaults.headers);
|
||||
console.log();
|
||||
that.$router.push("/index");
|
||||
}else{
|
||||
that.$alert(response.data.msg,"登录失败", {
|
||||
|
|
|
@ -24,7 +24,43 @@
|
|||
</el-date-picker>
|
||||
</div>
|
||||
|
||||
<button type="button" class="queryProject"> <img src="" alt=""> 查询</button>
|
||||
<button type="button" @click="queryProject()" class="queryProject">
|
||||
<img src="" alt="" /> 查询
|
||||
</button>
|
||||
<button type="button" class="addProject">
|
||||
<img src="" alt="" /> 新建
|
||||
</button>
|
||||
</div>
|
||||
<div class="projectTable">
|
||||
<el-table :data="tableData" style="width: 100%" max-height="500">
|
||||
<el-table-column fixed prop="date" label="Date" width="150" />
|
||||
<el-table-column prop="name" label="Name" width="120" />
|
||||
<el-table-column prop="state" label="State" width="120" />
|
||||
<el-table-column prop="city" label="City" width="120" />
|
||||
<el-table-column prop="address" label="Address" width="600" />
|
||||
<el-table-column prop="zip" label="Zip" width="120" />
|
||||
<el-table-column fixed="right" label="Operations" width="120">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.prevent="deleteRow(scope.$index)"
|
||||
>
|
||||
Remove
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
background
|
||||
v-model:currentPage="currentPage4"
|
||||
layout=" prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -44,15 +80,121 @@ export default {
|
|||
return {
|
||||
projectName: "",
|
||||
projectDate: "",
|
||||
projectData: {
|
||||
current: 1,
|
||||
endTime: "",
|
||||
name: "",
|
||||
size: "",
|
||||
startTime: "",
|
||||
},
|
||||
tableData: [
|
||||
{
|
||||
date: "2016-05-03",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-02",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-04",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-01",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-08",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-06",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-07",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
{
|
||||
date: "2016-05-07",
|
||||
name: "王小虎",
|
||||
province: "上海",
|
||||
city: "普陀区",
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
zip: 200333,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getProject();
|
||||
},
|
||||
methods: {
|
||||
deleteRow(index) {
|
||||
console.log(index);
|
||||
this.tableData.splice(index, 1);
|
||||
},
|
||||
queryProject() {
|
||||
this.getProject();
|
||||
},
|
||||
getProject() {
|
||||
let param = new URLSearchParams();
|
||||
|
||||
methods: {},
|
||||
param.append("current", this.projectData.current);
|
||||
param.append("endTime", this.projectData.endTime);
|
||||
param.append("name", this.projectData.name);
|
||||
param.append("size", this.projectData.size);
|
||||
param.append("startTime", this.projectData.startTime);
|
||||
|
||||
this.axios
|
||||
.get("/hysc/project/getProjectPage", param)
|
||||
.then(function (response) {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style >
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 120px;
|
||||
}
|
||||
.disFlex {
|
||||
display: flex;
|
||||
}
|
||||
|
@ -73,18 +215,21 @@ export default {
|
|||
}
|
||||
.search {
|
||||
display: flex;
|
||||
position: relative;
|
||||
padding-left: 18px;
|
||||
align-items: center;
|
||||
}
|
||||
.searchInput .el-input__inner {
|
||||
height: 40px;
|
||||
}
|
||||
.searchInput {
|
||||
margin-right: 10px;
|
||||
width: 340px;
|
||||
}
|
||||
.queryProject {
|
||||
width: 90px;
|
||||
height: 36px;
|
||||
background: #0544A4;
|
||||
background: #0544a4;
|
||||
box-shadow: 0px 2px 7px 0px rgba(120, 137, 149, 0.25);
|
||||
border-radius: 3px;
|
||||
margin-left: 20px;
|
||||
|
@ -92,6 +237,19 @@ border: none;
|
|||
font-size: 15px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
}
|
||||
.addProject {
|
||||
width: 90px;
|
||||
height: 36px;
|
||||
background: #fbc861;
|
||||
box-shadow: 0px 2px 7px 0px #fff0cb;
|
||||
border-radius: 3px;
|
||||
border: none;
|
||||
position: absolute;
|
||||
right: 18px;
|
||||
}
|
||||
.projectTable {
|
||||
margin-top: 30px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue