月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-06-14 a7ceb07fdcbcac1edcecb8c96bfa7808ea7670c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<template>
  <div class="modelBox">
    <el-form
      label-width="80px"
      :model="formLabelAlign"
    >
      <el-form-item :label="$t('common.name')">
        <el-input v-model="formLabelAlign.name"></el-input>
      </el-form-item>
      <el-form-item :label="$t('common.type')">
        <el-input v-model="formLabelAlign.type"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          v-show="isShow"
          type="success"
          plain
          size="small"
          @click="InsertData"
        >{{$t('common.increase')}}</el-button>
        <el-button
          v-show="!isShow"
          type="info"
          plain
          size="small"
          @click="EditData"
        >{{$t('common.update')}}</el-button>
      </el-form-item>
    </el-form>
    <!-- <el-table
      :data="tableData"
      style="width: 100%"
      height="calc(100% - 50px)"
    >
    </el-table> -->
    <!-- <div
      class="bottomPage pagination_box"
      style="margin-top:10px"
    > -->
    <!-- <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="listData.pageIndex"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="listData.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="listData.count"
      >
      </el-pagination> -->
    <!-- </div> -->
 
  </div>
</template>
 
<script>
import { comprehensive_selectModelByPageAndCount, comprehensive_insertModel } from '../../api/api.js'
export default {
  data() {
    return {
      resinfo: null,
      tableData: [],
      listData: {
        pageIndex: 1,
        pageSize: 10,
        layerid: null,
      },
      isShow: false,
      formLabelAlign: {
        name: '',
        type: ''
      }
 
    }
  },
  mounted() {
    this.startListData();
    this.setModeCatch();
  },
  methods: {
    async InsertData() {
      var obj = {
        modelid: this.resinfo.id,
        name: this.formLabelAlign.name,
        type: this.formLabelAlign.type
      }
      const data = await comprehensive_insertModel(obj)
      this.startModelData();
 
    },
    EditData() {
 
    },
    //模型捕捉
    setModeCatch() {
      var that = this;
 
    },
    //分页切换
    handleSizeChange(val) {
      this.listdata.pageSize = val;
      this.listData.pageIndex = 1;
      this.startModelData();
    },
    //分页切换
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      this.startModelData();
    },
    //初始化查询
    startListData() {
      this.listData = {
        pageIndex: 1,
        pageSize: 10,
        layerid: null,
      };
 
      this.resinfo = this.$store.state.attachinfo;
      this.startModelData();
    },
    //查询模型属性数据
    async startModelData() {
      if (this.resinfo) {
        this.listData.layerid = this.resinfo.id;
 
        const data = await comprehensive_selectModelByPageAndCount(this.listData)
        if (data.code != 200) {
          return;
        }
        if (data.count == 0) {
          this.isShow = true;
        } else {
          this.isShow = false;
        }
 
      }
    },
  },
 
}
</script>
 
<style lang="less" scoped>
.modelBox {
  width: 100%;
  height: 100%;
}
</style>