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

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

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