| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <div class="upload_links">
- <div class="header">
- <div class="search">
- <div class="input">
- <img src="../../img/search.png" />
- <input
- type="text"
- @focus="focusInput"
- v-model="inputValue"
- class="inputFocus"
- placeholder="DLR Code / 经销商"
- />
- </div>
- <div class="area">
- <p>所属区域</p>
- <select v-model="areaValue">
- <option value="">请选择</option>
- <option v-for="(item, index) in areaList" :key="index">
- {{ item }}
- </option>
- </select>
- </div>
- <div class="time">
- <p>请选择时间段</p>
- <input type="date" v-model="startTime" />
- <span>至</span>
- <input type="date" v-model="endTime" />
- </div>
- <div class="current_button" @click="search">搜索</div>
- </div>
- </div>
- <div class="count">
- <p>针对论坛及其它平台链接上传</p>
- <div style="display: flex">
- <div><Count :sum="sum" /></div>
- <div class="current_button" @click="exportData">导出</div>
- </div>
- </div>
- <div class="tableBox">
- <Table :tableData="tableData" @go_detail="ulrJump"></Table>
- </div>
- <TablePage
- :currentPage="currentPage"
- :totalPage="totalPage"
- @change_page="changePage"
- @jump_page="jumpPage"
- ></TablePage>
- </div>
- </template>
- <script>
- import TablePage from "../../components/TablePage";
- import Count from "../../components/Count";
- import Table from "./components/UploadLinksTable";
- export default {
- components: {
- TablePage,
- Count,
- Table,
- },
- data() {
- return {
- inputValue: "",
- sum: 0,
- currentPage: 1,
- pageSize: 20,
- tableData: [],
- areaList: [],
- areaValue: "",
- startTime: "",
- endTime: "",
- onlineUrl: "http://8.140.188.129:8080", //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
- };
- },
- computed: {
- // 表格总页数
- totalPage() {
- return Math.ceil(this.sum / this.pageSize);
- },
- },
- methods: {
- // 当焦点在选择框时,清空选择框
- focusInput: function () {
- this.inputValue = "";
- },
- search: function () {
- let data = {
- queryParams: this.inputValue,
- localArea: this.areaValue,
- startTime: this.startTime,
- endTime: this.endTime,
- page: this.currentPage,
- rows: this.pageSize,
- };
- this.firmsLinkUpload(data);
- },
- changePage: function (page) {
- this.currentPage = page;
- let req = {
- queryParams: this.inputValue,
- localArea: this.areaValue,
- startTime: this.startTime,
- endTime: this.endTime,
- page: this.currentPage,
- rows: this.pageSize,
- };
- this.firmsLinkUpload(req);
- },
- // 点击上一页,下一页,首页,尾页
- jumpPage: function (item) {
- switch (item) {
- case 1:
- this.currentPage = 1;
- break;
- case 2:
- this.currentPage = this.currentPage - 1;
- break;
- case 3:
- this.currentPage = this.currentPage + 1;
- break;
- case 4:
- this.currentPage = this.totalPage;
- break;
- }
- let req = {
- queryParams: this.inputValue,
- localArea: this.areaValue,
- startTime: this.startTime,
- endTime: this.endTime,
- page: this.currentPage,
- rows: this.pageSize,
- };
- this.firmsLinkUpload(req);
- },
- ulrJump: function (url) {
- window.open(url);
- },
- exportData: function () {
- this.exportTem();
- },
- // 获取表格数据
- firmsLinkUpload: function (data = {}) {
- this.$http({
- method: "post",
- url: "/firmsLinkUpload",
- data: data,
- })
- .then((res) => {
- console.log(res.data.data);
- this.tableData = res.data.data;
- this.sum = res.data.count;
- })
- .catch((err) => {
- console.log(err);
- });
- },
- // 获取 所有区域 接口
- getAreaList: function () {
- this.$http({
- method: "post",
- url: "/sys/agent/selectAgentAreaInfoList",
- })
- .then((res) => {
- if (res.data && res.data.code === 200) {
- this.areaList = res.data.data;
- } else {
- console.log(res);
- }
- })
- .catch((err) => {
- console.log(err);
- });
- },
- // 导出 接口
- exportTem: function () {
- let url = this.onlineUrl + "/exportFactory";
- window.open(url);
- },
- },
- created() {
- let req = {
- page: this.currentPage,
- rows: this.pageSize,
- };
- this.firmsLinkUpload(req);
- this.getAreaList();
- },
- };
- </script>
- <style scoped lang="less">
- .upload_links {
- .header {
- padding: 10px;
- border: 1px solid #ccc;
- .search {
- display: flex;
- align-items: center;
- .input {
- background-color: #fff;
- border: 1px solid #ccc;
- padding: 2px;
- display: flex;
- img {
- width: 22px;
- height: 22px;
- border: 1px solid #ccc;
- }
- input {
- background-color: #fff;
- border: 1px solid #ccc;
- margin-left: 3px;
- color: #555;
- font-size: 12px;
- height: 18px;
- }
- }
- }
- .area {
- margin-left: 20px;
- display: flex;
- height: 28px;
- line-height: 28px;
- select {
- margin-left: 10px;
- height: 28px;
- width: 120px;
- font-size: 12px;
- color: #555;
- border: 1px solid #ccc;
- option {
- font-size: 12px;
- border: 1px solid #ccc;
- }
- }
- }
- .time {
- display: flex;
- margin-left: 20px;
- p {
- height: 28px;
- line-height: 28px;
- margin-right: 10px;
- }
- input {
- height: 26px;
- padding: 0;
- outline: none;
- border: 1px solid #ccc;
- margin-right: 10px;
- }
- span {
- height: 28px;
- line-height: 28px;
- margin-right: 10px;
- }
- }
- }
- .count {
- display: flex;
- justify-content: space-between;
- margin-top: 5px;
- p {
- margin-top: 10px;
- font-weight: 600;
- }
- }
- .tableBox {
- width: 1030px;
- overflow: auto;
- text-align: center;
- }
- }
- .inputFocus {
- outline: none;
- border: 1px solid #ccc;
- }
- .inputFocus:focus {
- animation: shadowAni 200ms linear forwards;
- }
- @keyframes shadowAni {
- 0% {
- border-color: #cccccc;
- box-shadow: inset 0px 0px 0 #ccc;
- }
- 100% {
- border-color: #75b9f0;
- box-shadow: 0px 0px 5px #75b9f0;
- }
- }
- </style>
|