Commit d8e67540 authored by 徐一鸣's avatar 徐一鸣

up pages

parent 00300dc2
......@@ -24,7 +24,8 @@
type="primary"
@click="addRow()"
class="ces_toolbar_btn"
>新增</el-button>
>新增</el-button
>
<el-input
prefix-icon="el-icon-search"
v-if="searchShow"
......@@ -95,9 +96,19 @@
:header-cell-class-name="headerCellClassName"
v-cloak
>
<el-table-column v-if="isSelection" type="selection" align="center"></el-table-column>
<el-table-column
v-if="isSelection"
type="selection"
align="center"
></el-table-column>
<!-- 序号 -->
<el-table-column v-if="isIndex" type="index" :label="indexLabel" width="80" align="center"></el-table-column>
<el-table-column
v-if="isIndex"
type="index"
:label="indexLabel"
width="80"
align="center"
></el-table-column>
<!-- 数据栏 -->
<el-table-column
......@@ -114,28 +125,45 @@
<!-- 操作按钮 -->
<span v-if="item.type === 'Button'">
<b v-for="(btn, key) in item.btnList" :key="key">
<em
class="action"
v-if="btn.label == '分配'||btn.label == '已分配'"
>
<em v-if="btn.label == '分配'&&scope.row.state == 0" style="color: #0f2683" @click="handleClick(btn.type, scope.row)">{{ btn.label }}</em>
<em v-if="btn.label == '已分配'&&scope.row.state == 1">{{ btn.label }}</em>
<em v-if="btn.label == '分配'">
<em
v-if="btn.label == '分配' && scope.row.state == 0"
class="cur_pointer"
style="color: #0f2683"
@click="handleClick(btn.type, scope.row)"
>
分配
</em>
<em v-if="btn.label == '分配' && scope.row.state == 1">
已分配
</em>
</em>
<em
class="action"
v-else-if="btn.label == '删除'&&btn.local"
class="cur_pointer"
v-else-if="btn.label == '删除' && btn.local"
:class="btn.type"
:style="{color: btn.label=='删除' ? '#830f53' : '#0f2683'}"
:style="{
color: btn.label == '删除' ? '#830f53' : '#0f2683',
}"
@click="deleteLocal(scope)"
>{{ btn.label }}</em>
>{{ btn.label }}</em
>
<em
class="action"
class="cur_pointer"
v-else
:class="btn.type"
:style="{color: btn.label=='删除' ? '#830f53' : '#0f2683'}"
:style="{
color: btn.label == '删除' ? '#830f53' : '#0f2683',
}"
@click="handleClick(btn.type, scope.row)"
>{{ btn.label }}</em>
<em v-if="btn.line" style="padding:0 20px;color:#edf0ff">{{ btn.line }}</em>
>{{ btn.label }}</em
>
<em v-if="btn.line" style="padding:0 20px;color:#edf0ff">
{{ btn.line }}
</em>
</b>
</span>
<!--href 链接-->
......@@ -171,7 +199,9 @@
trigger="hover"
:content="scope.row[item.prop]"
>
<div slot="reference" class="overlit">{{ scope.row[item.prop] }}</div>
<div slot="reference" class="overlit">
{{ scope.row[item.prop] }}
</div>
</el-popover>
<!-- others -->
<span v-else>{{ scope.row[item.prop] }}</span>
......@@ -210,7 +240,7 @@
:disabled="pagination.page == 1"
></el-button>
&nbsp;&nbsp;第{{ pagination.page }}页 / 共{{
Math.ceil(pagination.total / pagination.rowsPerPage)
Math.ceil(pagination.total / pagination.rowsPerPage)
}}页
<el-button
icon="el-icon-arrow-right"
......@@ -218,9 +248,9 @@
size="mini"
@click="handleCurrentChange(1)"
:disabled="
pagination.page >=
Math.ceil(pagination.total / pagination.rowsPerPage)
"
pagination.page >=
Math.ceil(pagination.total / pagination.rowsPerPage)
"
></el-button>
</div>
</div>
......@@ -240,7 +270,7 @@ export default {
"v-apaas-table-input": tableInput,
"v-apaas-table-select": tableSelect,
"v-apaas-table-umhref": tableUmhref,
"d-confirm": DConfirm
"d-confirm": DConfirm,
},
props: {
// 表格型号:mini,medium,small
......@@ -265,78 +295,78 @@ export default {
// },
searchShow: {
type: Boolean,
default: false
default: false,
},
url: {
type: String,
default: ""
default: "",
},
detailsUrl: {
type: String,
default: ""
default: "",
},
rowprop: {
type: String,
default: ""
default: "",
},
ready: {
type: Boolean,
default: false
default: false,
},
addRowBtn: {
type: Boolean,
default: false
default: false,
},
couldNotEdit: {
type: Boolean,
default: false
default: false,
},
refreshInit: { type: Boolean },
sortBy: {
type: String,
default: ""
default: "",
},
searchNoName: { type: Boolean, default: false },
emptyText: {
type: String,
default: "暂无数据"
default: "暂无数据",
},
autoAdd: {
type: Boolean,
default: false
default: false,
},
border: {
type: Boolean,
default: false
default: false,
},
stripe: {
type: Boolean,
default: false
default: false,
},
radius: {
type: Boolean,
default: false
default: false,
},
pageSizeShow: {
type: Boolean,
default: false
default: false,
},
paginationShow: {
type: Boolean,
default: false
default: false,
},
headerCellClassName: {
type: String,
default: ""
default: "",
},
filterList: {
type: Array,
default: null
default: null,
},
showHeader: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
return {
......@@ -344,7 +374,7 @@ export default {
pagination: {
rowsPerPage: 10,
page: 1,
total: 0
total: 0,
},
delSelect: null,
helper: helper,
......@@ -353,23 +383,23 @@ export default {
pageOptions: [
{
value: "10",
label: "10"
label: "10",
},
{
value: "20",
label: "20"
label: "20",
},
{
value: "50",
label: "50"
}
label: "50",
},
],
search: "",
times: null,
showFliterList: false,
filterData: null, // 筛选条件
filterToggle: null, // 控制筛选条件的展开和收起
filterLength: 0 // 每行最多可容纳多少个过滤条件
filterLength: 0, // 每行最多可容纳多少个过滤条件
};
},
mounted() {
......@@ -387,25 +417,25 @@ export default {
if (val) {
this.getDataFromApiSync();
}
}
},
},
url: {
handler(val) {
this.getDataFromApiSync();
},
deep: true
deep: true,
},
filterList: {
handler(val) {
this.initFilterData();
},
deep: true
}
deep: true,
},
},
methods: {
//本地删除
deleteLocal(val){
this.selectedTabsPage.splice(val.$index, 1) 
deleteLocal(val) {
this.selectedTabsPage.splice(val.$index, 1);
},
// get data
getDataFromApiSync() {
......@@ -420,14 +450,14 @@ export default {
}
} else {
this.getDataFromApi().then(
data => {
(data) => {
this.selectedTabsPage = JSON.parse(JSON.stringify(data.newArr));
this.pagination.total = data.total;
if (this.autoAdd) {
this.addRow();
}
},
err => {
(err) => {
console.log("失败" + err);
}
);
......@@ -440,7 +470,7 @@ export default {
this.all_url = `/static/data.json`;
this.$http
.get(this.all_url)
.then(response => {
.then((response) => {
let newArr = response.data.data[this.url];
// if it is true url, total is response's total
let total = newArr.length;
......@@ -485,7 +515,7 @@ export default {
this.$message({
showClose: true,
message: this.label + "成功",
type: "success"
type: "success",
});
},
switchChange(val) {
......@@ -557,7 +587,7 @@ export default {
if (this.filterList && this.filterList.length) {
this.filterData = {};
this.filterToggle = {};
this.filterList.forEach(item => {
this.filterList.forEach((item) => {
this.$set(this.filterData, item.prop, []);
this.$set(this.filterToggle, item.prop, false);
});
......@@ -570,8 +600,8 @@ export default {
this.filterData[prop].push(filter);
}
console.log(this.filterData);
}
}
},
},
};
</script>
......@@ -621,7 +651,7 @@ em {
font-style: normal;
user-select: none;
}
em.action {
.cur_pointer {
cursor: pointer;
}
.ces-table .el-table--mini td,
......
This diff is collapsed.
This diff is collapsed.
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