123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <template>
- <el-dialog title="选择数据模型" :visible.sync="show">
- <el-input v-model="search" size="mini" placeholder="输入关键字搜索">
- <el-button slot="append" icon="el-icon-search" @click="searchme"></el-button>
- </el-input>
- <el-table :data="tableData" @row-click="selectme" border style="width: 100%" header-row-class-name="tableHeadbg">
- <el-table-column label="" width="45">
- <template slot-scope="scope">
- <el-radio v-model="checked" name="myselect2" :label="scope.row.cubeId"> </el-radio>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="cubeName" label="模型名称"></el-table-column>
- <el-table-column align="center" prop="desc" label="说明"></el-table-column>
- <el-table-column align="center" prop="dsetName" label="数据集"></el-table-column>
- </el-table>
- <el-pagination
- background
- layout="prev, pager, next"
- :total="total">
- </el-pagination>
-
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="save()">确 定</el-button>
- <el-button @click="show = false">取 消</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import {ajax} from '@/common/biConfig'
- import $ from 'jquery'
- export default {
- data(){
- return {
- show:false,
- checked:null,
- tableData:[],
- search:null,
- total:0,
- page:1,
- rows:10,
- }
- },
- mounted(){
- },
- computed: {
- },
- methods: {
- select(){
- this.show = true;
- this.search = null;
- this.loadData();
- },
- save(){
- let chk = this.checked;
- if(!chk){
- this.$notify.error({title: '未勾选数据',offset: 50});
- return;
- }
- var p = this.$parent;
- p.pageInfo.selectDs = chk;
- p.initdataset();
- this.show = false;
- },
- selectme:function(a, b){
- this.checked = a.cubeId;
- },
- searchme(){
- this.loadData();
- },
- loadData(){
- ajax({
- url:"model/pageCube.action",
- type:"POST",
- data:{rows:this.rows, page:this.page,key:this.search},
- success:(resp)=>{
- this.total = resp.total;
- this.tableData = resp.rows.map(m=>{
- return {
- cubeId:m.cubeId,
- cubeName:m.cubeName,
- desc:m.desc,
- dsetName:m.dsetName
- }
- });
- }
- }, this);
- }
- },
- watch: {
- }
- }
- </script>
- <style lang="css">
- .el-dialog__body{
- padding: 5px;
- }
- </style>
|