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

up pages

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