| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <template>
- <div class="full-container">
- <div style="display: flex; justify-content: space-between">
- <div style="display: flex">
- <el-input
- placeholder="请输入船名/MMSI/手机号"
- prefix-icon="el-icon-search"
- v-model="term"
- clearable
- style="height: 32px; width: 330px; line-height: 32px"
- ></el-input>
- <div class="seach-btn" @click="getShipList">查询</div>
- </div>
- </div>
- <div style="margin-top: 24px">
- <el-table :data="tableData" stripe style="width: 100%">
- <el-table-column
- type="index"
- label="序号"
- min-width="80"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="shipname"
- label="船舶名称"
- min-width="120"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="mmsi"
- label="MMSI"
- min-width="160"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="length"
- label="船长(米)"
- min-width="120"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="breadth"
- label="船宽(米)"
- min-width="160"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="draught"
- label="吃水(米)"
- min-width="120"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="loadTons"
- label="载货吨位(吨)"
- min-width="160"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="createTime"
- label="入驻时间"
- min-width="200"
- align="center"
- ></el-table-column>
- <el-table-column label="操作" min-width="80" align="center">
- <template v-slot="scope">
- <el-button
- @click="shipDetail(scope.row.shipId, tableData)"
- type="text"
- size="small"
- >
- 查看详情
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="width: 100%; text-align: right; margin-top: 43px">
- <el-pagination
- background
- layout="prev, pager, next"
- :total="total"
- @current-change="pageChange"
- ></el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { ref, h, reactive, toRefs, onMounted } from "vue";
- import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
- import store from "../../store";
- import router from "../../router";
- import md5 from "md5";
- import api from "../../apis/fetch";
- export default {
- setup() {
- let currentPage = ref(1);
- let term = ref();
- let tableData = ref();
- let total = ref();
- async function getShipList() {
- tableData.value = [];
- let res = await api.getShipList({
- currentPage: currentPage.value,
- size: 10,
- term: term.value,
- });
- term.value = "";
- if (res.data.status == 0) {
- tableData.value = res.data.result;
- total.value = res.data.total;
- }
- }
- async function shipDetail(shipId) {
- router.push({
- path: "/shipInfo/shipDetail",
- query: {
- shipId,
- },
- });
- }
- function pageChange(e) {
- currentPage.value = e;
- getShipList();
- }
- getShipList();
- onMounted(() => {});
- return {
- currentPage,
- term,
- tableData,
- total,
- getShipList,
- shipDetail,
- pageChange,
- };
- },
- };
- </script>
- <style scoped>
- .seach-btn {
- display: inline-block;
- width: 60px;
- height: 38px;
- background: #0094fe;
- border-radius: 2px;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #ffffff;
- text-align: center;
- line-height: 38px;
- margin-left: 10px;
- cursor: pointer;
- }
- .cargo-owner-add {
- width: 80px;
- height: 32px;
- border-radius: 2px;
- border: 1px solid #0094fe;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #0094fe;
- line-height: 32px;
- text-align: center;
- cursor: pointer;
- }
- :deep().el-dialog {
- width: 560px;
- padding: 20px 50px;
- border-radius: 6px;
- }
- :deep() .el-dialog__title {
- font-size: 18px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #0094fe;
- }
- </style>
|