Commit 0432854f authored by 刘殿昕's avatar 刘殿昕

fix-table,云资源样式,购物车,菜单

parent e515b59c
This diff is collapsed.
...@@ -73,44 +73,8 @@ export default { ...@@ -73,44 +73,8 @@ export default {
props: {}, props: {},
data: () => ({ data: () => ({
checkShopAll: false, checkShopAll: false,
checkList: [false, false, false], checkList: [],
list: [ list: []
{
id: 0,
name: "水路货物周转量情况",
type: "基础数据服务",
creator: "贵州省交通运输厅0",
state: 1,
mapService: 1,
num: 2,
checkedSubscription: false,
specification: 1,
specificationApplication: 2
},
{
id: 1,
name: "水路货物周转量情况水路货物周水路货物周转量情况水路货物周",
type: "基础数据服务",
creator: "贵州省交通运输厅1",
state: 1,
num: 2,
checkedSubscription: false,
specification: 1,
specificationApplication: 2
},
{
id: 2,
name: "水路货物周转量情况水路货物周水路货物周转量情况水路货物周",
type: "基础数据服务",
creator: "贵州省交通运输厅2",
state: 1,
mapService: 1,
num: 2,
checkedSubscription: true,
specification: 1,
specificationApplication: 2
}
]
}), }),
mounted() { mounted() {
this.getList(); this.getList();
...@@ -128,8 +92,12 @@ export default { ...@@ -128,8 +92,12 @@ export default {
getList() { getList() {
this.$api.serviceShop.getShoppingCart().then(response => { this.$api.serviceShop.getShoppingCart().then(response => {
if (response.data.success == "1") { if (response.data.success == "1") {
console.log(response.data.data) console.log(response.data.data);
this.list = response.data.data; this.list = response.data.data;
for (const index in this.list) {
this.checkList.push(false);
}
console.log(this.checkList);
} else { } else {
console.log(response.data.message); console.log(response.data.message);
} }
...@@ -141,6 +109,7 @@ export default { ...@@ -141,6 +109,7 @@ export default {
changeState(val) { changeState(val) {
console.log(val); console.log(val);
this.$set(this.checkList, val.index, val.state); this.$set(this.checkList, val.index, val.state);
console.log(this.checkList);
if (this.checkList.indexOf(false) == -1) { if (this.checkList.indexOf(false) == -1) {
this.checkShopAll = true; this.checkShopAll = true;
} else { } else {
......
...@@ -268,21 +268,12 @@ export default { ...@@ -268,21 +268,12 @@ export default {
loading: { type: Boolean, default: false }, loading: { type: Boolean, default: false },
// 表格数据 // 表格数据
headers: { type: Array, default: () => [] }, headers: { type: Array, default: () => [] },
// 表格列配置
// tableData: { type: Array, default: () => [] },
// 是否显示表格复选框 // 是否显示表格复选框
isSelection: { type: Boolean, default: false }, isSelection: { type: Boolean, default: false },
defaultSelections: { type: [Array, Object], default: () => null }, defaultSelections: { type: [Array, Object], default: () => null },
// 是否显示表格索引 // 是否显示表格索引
isIndex: { type: Boolean, default: false }, isIndex: { type: Boolean, default: false },
indexLabel: { type: String, default: "序号" }, indexLabel: { type: String, default: "序号" },
// 是否显示分页
// isPagination: { type: Boolean, default: true },
// // 分页数据
// pagination: {
// type: Object,
// default: () => ({ pageSize: 10, pageNum: 1, total: 0 })
// },
searchShow: { searchShow: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -368,11 +359,14 @@ export default { ...@@ -368,11 +359,14 @@ export default {
getSelectBtn: { getSelectBtn: {
type: Boolean, type: Boolean,
default: false default: false
},
params: {
type: Object,
default: () => {}
} }
}, },
data() { data() {
return { return {
all_url: "",
pagination: { pagination: {
rowsPerPage: 10, rowsPerPage: 10,
page: 1, page: 1,
...@@ -424,6 +418,12 @@ export default { ...@@ -424,6 +418,12 @@ export default {
this.getDataFromApiSync(); this.getDataFromApiSync();
}, },
deep: true deep: true
},
params: {
handler(val) {
this.getDataFromApiSync();
},
deep: true
} }
}, },
methods: { methods: {
...@@ -479,13 +479,20 @@ export default { ...@@ -479,13 +479,20 @@ export default {
let total = newArr.length; let total = newArr.length;
resolve({ newArr, total }); resolve({ newArr, total });
} else { } else {
this.all_url = `/static/data.json`; let query = this.params;
this.$http query.Page = this.pagination.page;
.get(this.all_url) query.Size = this.pagination.rowsPerPage;
let arr = this.url.split(".");
let obj = this.$api;
arr.forEach(item => {
obj = obj[item];
});
console.log(query);
obj(query)
.then(response => { .then(response => {
let newArr = response.data.data[this.url]; let newArr = response.data.data;
// if it is true url, total is response's total // if it is true url, total is response's total
let total = newArr.length; let total = response.data.total;
resolve({ newArr, total }); resolve({ newArr, total });
}) })
.catch(function(response) { .catch(function(response) {
...@@ -502,6 +509,7 @@ export default { ...@@ -502,6 +509,7 @@ export default {
searchVal() { searchVal() {
if (this.times !== null) clearTimeout(this.times); if (this.times !== null) clearTimeout(this.times);
this.times = setTimeout(() => { this.times = setTimeout(() => {
this.resetPageNumber();
this.getDataFromApiSync(); this.getDataFromApiSync();
}, 500); }, 500);
}, },
...@@ -651,9 +659,9 @@ export default { ...@@ -651,9 +659,9 @@ export default {
let newRow = {}; let newRow = {};
let arr = this.headers; let arr = this.headers;
arr.forEach(item => { arr.forEach(item => {
newRow[item.prop] = "" newRow[item.prop] = "";
}) });
newRow.flag = true //新增标记 newRow.flag = true; //新增标记
newRow.id = newRow.id =
parseInt(Math.random() * 100000, 10) + parseInt(Math.random() * 100000, 10) +
"" + "" +
...@@ -665,6 +673,7 @@ export default { ...@@ -665,6 +673,7 @@ export default {
return this.selectedTabsPage; return this.selectedTabsPage;
}, },
filterChange(filter) { filterChange(filter) {
this.resetPageNumber();
console.log(filter); console.log(filter);
}, },
// 上传文件事件 // 上传文件事件
...@@ -695,6 +704,10 @@ export default { ...@@ -695,6 +704,10 @@ export default {
self.changeUp(arr[i].children, id, input, header); self.changeUp(arr[i].children, id, input, header);
} }
} }
},
// 重置页码
resetPageNumber() {
this.pagination.page = 1;
} }
} }
}; };
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
size="mini" size="mini"
:border="false" :border="false"
:headers="headers" :headers="headers"
url="tableData" url="serviceShop.getServiceShopList"
:searchShow="true" :searchShow="true"
:addRowBtn="addRowBtn" :addRowBtn="addRowBtn"
:autoAdd="false" :autoAdd="false"
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
:pageSizeShow="true" :pageSizeShow="true"
:filterList="filterList" :filterList="filterList"
cellClassName="cell_width" cellClassName="cell_width"
:params="params"
></ces-table> ></ces-table>
<h3>可编辑表格,供服务测试用</h3> <h3>可编辑表格,供服务测试用</h3>
<ces-table <ces-table
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
size="mini" size="mini"
:border="true" :border="true"
:headers="headers1" :headers="headers1"
url="tableData" url="serviceShop.getServiceShopList"
:searchShow="false" :searchShow="false"
:addRowBtn="false" :addRowBtn="false"
:autoAdd="true" :autoAdd="true"
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
:stripe="false" :stripe="false"
:paginationShow="false" :paginationShow="false"
:pageSizeShow="false" :pageSizeShow="false"
:params="params"
></ces-table> ></ces-table>
<h3>带树结构表格,供服务测试用</h3> <h3>带树结构表格,供服务测试用</h3>
<ces-table <ces-table
...@@ -53,7 +55,7 @@ ...@@ -53,7 +55,7 @@
size="mini" size="mini"
:border="true" :border="true"
:headers="headers2" :headers="headers2"
url="tableData1" url="serviceShop.getServiceShopList"
:searchShow="false" :searchShow="false"
:addRowBtn="true" :addRowBtn="true"
:autoAdd="false" :autoAdd="false"
...@@ -69,6 +71,7 @@ ...@@ -69,6 +71,7 @@
:pageSizeShow="false" :pageSizeShow="false"
headerCellClassName="th_pink" headerCellClassName="th_pink"
:getSelectBtn="true" :getSelectBtn="true"
:params="params"
></ces-table> ></ces-table>
</div> </div>
</template> </template>
...@@ -118,7 +121,13 @@ export default { ...@@ -118,7 +121,13 @@ export default {
], ],
headers1: [ headers1: [
{ label: "服务url", prop: "date", type: "input", align: "left" }, { label: "服务url", prop: "date", type: "input", align: "left" },
{ label: "服务名称", prop: "ssss", type: "upload", align: "center", uploadKey: "type" }, {
label: "服务名称",
prop: "ssss",
type: "upload",
align: "center",
uploadKey: "type"
},
{ {
label: "文件类型", label: "文件类型",
prop: "type", prop: "type",
...@@ -169,7 +178,16 @@ export default { ...@@ -169,7 +178,16 @@ export default {
prop: "fwzt", prop: "fwzt",
data: ["数据服务", "时空服务", "视频服务", "感知服务", "综合服务"] data: ["数据服务", "时空服务", "视频服务", "感知服务", "综合服务"]
} }
] ],
params: {
serviceName: 1,
serviceType1: 1,
serviceType2s: 1,
serviceType3s: 1,
dataDomains: 1,
organizeIds: 1,
orderBy: 1,
}
}), }),
components: { components: {
cesTable cesTable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment