<!--
|
* @Description: 添加资源---- 子模块
|
-->
|
<template>
|
<el-container style="padding: 0px">
|
<!-- <el-aside style="padding: 0px;
|
border: 0.5px solid #ebeef5;">
|
<el-tree :data="treedata" :props="defaultProps" node-key="id" :default-expanded-keys="[4]"
|
@node-click="handleNodeDataClick">
|
<span slot-scope="{ node, data }">
|
<i :class="data.icon"></i>
|
<span style="padding-left: 4px">{{ node.label }}</span>
|
</span>
|
</el-tree>
|
</el-aside> -->
|
<el-main class="tablemain" style="
|
margin: 0px;
|
padding: 5px;
|
">
|
<el-form :inline="true">
|
<el-form-item>
|
<el-input size="small" placeholder="请输入关键字查询" prefix-icon="el-icon-search" clearable v-model="filterString"
|
@keyup.enter.native="handleQuery">
|
</el-input>
|
</el-form-item>
|
</el-form>
|
<el-table :data="tableDdata" border size="mini" @selection-change="handleSelectionChange"
|
style="width: 100%;background-color: transparent;" rowKey="id">
|
<el-table-column type="selection" width="40"> </el-table-column>
|
<el-table-column prop="name" label="服务名称">
|
</el-table-column>
|
<el-table-column prop="type" label="类型" width="180">
|
</el-table-column>
|
<el-table-column prop="title" label="服务描述">
|
</el-table-column>
|
<el-table-column label="操作">
|
<template scope="scope">
|
<div style="display:flex;flex-direction: row;">
|
<el-select v-model="scope.row.cimLevel">
|
<el-option v-for="item in cimLevelDict" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
<el-select v-model="scope.row.dataType">
|
<el-option v-for="item in cimTypeDict" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</div>
|
</template>
|
</el-table-column>
|
|
</el-table>
|
|
<div style="width: 100%; margin: 20px 0px; text-align: center">
|
<el-pagination layout="total, prev, pager, next" :total="total" @current-change="pager"
|
:page-size="listData.pageSize" :current-page="listData.pageNo">
|
</el-pagination>
|
</div>
|
</el-main>
|
</el-container>
|
</template>
|
<script>
|
import { mapState } from "vuex";
|
import { getServicesList } from "@/api/api";
|
export default {
|
data() {
|
return {
|
defaultProps: {
|
children: "children",
|
label: "label",
|
},
|
selectedDataRows: [],
|
//列表的数据分页
|
listData: {
|
pageNo: 1,
|
pageSize: 10,
|
},
|
serviceData: [],
|
tableDdata: [],
|
requestSuffix: "dlg",
|
filterString: "",
|
total: 0,
|
cimLevelDict: [
|
{
|
value: '1',
|
label: 'CIM1'
|
},
|
{
|
value: '2',
|
label: 'CIM2'
|
},
|
{
|
value: '3',
|
label: 'CIM3'
|
},
|
{
|
value: '4',
|
label: 'CIM4'
|
},
|
{
|
value: '5',
|
label: 'CIM5'
|
},
|
{
|
value: '6',
|
label: 'CIM6'
|
},
|
{
|
value: '7',
|
label: 'CIM7'
|
},
|
],
|
cimTypeDict: [
|
{
|
value: '1',
|
label: '时空基础'
|
},
|
{
|
value: '2',
|
label: '规划管控'
|
},
|
{
|
value: '3',
|
label: '工程管理'
|
},
|
{
|
value: '4',
|
label: '资源调查'
|
},
|
{
|
value: '5',
|
label: '公共专题'
|
},
|
{
|
value: '6',
|
label: '物联感知'
|
},
|
]
|
};
|
},
|
methods: {
|
handleNodeDataClick(data) {
|
this.selectedDataRows = [];
|
this.requestSuffix = data.datatype;
|
this.handleQuery();
|
},
|
handleQuery() {
|
this.getListData();
|
},
|
handleSelectionChange(val) {
|
this.selectedDataRows = val;
|
},
|
|
getListData() {
|
let that = this;
|
this.tableData = [];
|
getServicesList().then((res) => {
|
let s = that.filterString;
|
if (res.code === 200) {
|
that.serviceData = s === "" ? res.data : res.data.filter((d) => { return d.name.indexOf(s) > -1 });
|
that.tableDdata = that.serviceData.slice(0, 10);
|
that.total = that.serviceData.length;
|
}
|
});
|
}, pager(newPagenum) {
|
this.listData.pageNo = newPagenum;
|
this.tableDdata = this.serviceData.slice((this.listData.pageNo - 1) * this.listData.pageSize, this.listData.pageNo * this.listData.pageSize);
|
},
|
},
|
computed: {
|
...mapState({
|
treedata: (state) => (state.dataMenuTypes ? state.dataMenuTypes : []),
|
}),
|
}, created() {
|
this.getListData();
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
.tablemain {
|
|
/deep/ .el-input__inner {
|
background-color: transparent;
|
background-image: none;
|
border-radius: 0px;
|
border: 1px solid #5c6d96;
|
color: #ffffff;
|
}
|
|
.el-table /deep/ tr {
|
background-color: transparent;
|
color: rgba(240, 250, 254, 0.65);
|
}
|
|
.el-table /deep/ tr th {
|
background-color: rgba(240, 250, 254, 0.1);
|
color: rgba(240, 250, 254, 0.85);
|
}
|
|
.el-table /deep/ tr:hover>td {
|
background-color: rgba(0, 166, 226, 0.4) !important;
|
}
|
|
.el-pagination /deep/ .btn-prev,
|
.el-pagination /deep/ .btn-next,
|
.el-pagination /deep/ .el-input__inner,
|
.el-pagination /deep/ .el-pager li {
|
background-color: rgba(0, 166, 226, 0.02);
|
border-radius: 2px 2px 2px 2px;
|
border: 1px solid rgba(240, 250, 254, 0.3);
|
color: rgba(240, 250, 254, 0.65) !important;
|
}
|
|
.el-pagination /deep/ .el-pager li.active {
|
background-color: #1890ff !important;
|
cursor: default;
|
}
|
|
.el-pagination /deep/ .el-pagination__jump {
|
color: rgba(240, 250, 254, 0.65);
|
}
|
}
|
|
.item {
|
color: #000000;
|
font-weight: bold;
|
font-size: 14px;
|
padding-left: 30px;
|
}
|
</style>
|