基于廊坊系统为基础,国防科技大学系统演示Demo
lixuliang
2024-04-30 7f0f5bc0be05b8a9206bcff083442379504db009
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
 
<template>
  <div class="dictionaryBox">
    <My-bread :list="[
        `通信方案筹划`,
        `方案讲评`,
      ]"></My-bread>
    <el-divider />
    <div class="menuBox">
      <div class="menuTitle">
        <div>
          <el-input size="small"
                    prefix-icon="el-icon-search"></el-input>
        </div>
        <div>
          <el-button type="success"
                     size="small"
                     @click="handlerInsert">添加</el-button>
          <el-button type="danger"
                     size="small"
                     @click="handlerDel">删除</el-button>
        </div>
      </div>
 
      <div class="menuContent">
 
        <el-table :data="tableData"
                  style="width: 100%;height:calc(100% - 1px); "
                  @selection-change="handleSelectionChange">
          <el-table-column prop="name"
                           align="center"
                           label="名称">
          </el-table-column>
          <el-table-column prop="coord"
                           align="center"
                           label="链路">
          </el-table-column>
          <el-table-column prop="types"
                           align="center"
                           label="链接站点">
          </el-table-column>
          <el-table-column prop="bak"
                           align="center"
                           label="链路状态">
          </el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button size="mini"
                         plain
                         type="warning"
                         @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
 
            </template>
          </el-table-column>
        </el-table>
 
      </div>
      <div class="menupage">
        <el-pagination @size-change="handleSizeChange"
                       @current-change="handleCurrentChange"
                       :current-page="listData.pageIndex"
                       :page-sizes="[100, 200, 300, 400]"
                       :page-size="listData.pageSize"
                       layout="total, sizes, prev, pager, next, jumper"
                       :total="listData.count"></el-pagination>
 
      </div>
    </div>
    <el-dialog :title="title"
               :visible.sync="dialogVisible"
               width="50%"
               :before-close="handleClose">
      <el-form :model="editFrom"
               label-width="80px">
        <el-form-item label="名称">
          <el-input v-model="editFrom.name"
                    style="width:calc(100% - 100px);"
                    placeholder="请输入名称"></el-input>
        </el-form-item>
        <el-form-item label="链路">
          <el-input v-model="editFrom.coord"
                    style="width:calc(100% - 100px);"
                    placeholder="请输入位置"></el-input>
        </el-form-item>
        <el-form-item label="链接站点">
          <el-input v-model="editFrom.coord"
                    style="width:calc(100% - 100px);"
                    placeholder="请输入位置"></el-input>
        </el-form-item>
        <el-form-item label="链路状态">
          <el-input v-model="editFrom.bak"
                    style="width:calc(100% - 100px);"
                    placeholder="请输入备注"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer"
            class="dialog-footer">
        <el-button size="small"
                   @click="setSubMite">取 消</el-button>
        <el-button type="primary"
                   size="small"
                   @click="handleClose">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
 
<script>
 
import MyBread from "@/components/MyBread.vue";
 
export default {
  name: "multimedia",
  components: { MyBread },
  data () {
    return {
      listData: {
        pageIndex: 1,
        pageSize: 100,
        count: 0,
      },
      tableData: [
 
      ],
      options: [
        {
          name: '指挥所通信枢纽',
          val: "t1"
        },{
          name: '干线通讯枢纽',
          val: "t2"
        },{
          name: '辅助通讯枢纽',
          val: "t3"
        }
      ],
      multipleSelection: [],
 
      dialogVisible: false,
      title: "",
      editFrom: {
        types: "",
      }
    };
  },
  watch: {
 
  },
  created () {
    this.setTableDataStart();
  },
  methods: {
    handleClose () {
      this.title="";
      this.dialogVisible=false;
      this.editFrom.types=this.options[0].val
    },
    setSubMite () {
      this.handleClose();
    },
    handlerInsert () {
      this.title="新增";
      this.dialogVisible=true;
    },
    handleEdit (index,row) {
      this.editFrom=JSON.parse(JSON.stringify(row));
      this.title="修改";
      this.dialogVisible=true;
    },
    handlerDel () {
 
    },
    formatter (row,column) {
      var obj=this.options.filter(res => {
        if(row.types==res.val) {
          return res;
        }
      });
      return obj[0].name
    },
    setTableDataStart () {
      this.tableData=[{
        name: 'XXX链路1',
        types: ' ',
        coord: "",
        bak: ""
      },{
        name: 'XXX链路2',
        types: ' ',
        coord: "",
        bak: "",
      }]
      this.listData.count=this.tableData.length;
      this.handleClose();
    },
    handleSelectionChange (res) {
      this.multipleSelection=res;
    },
    handleSizeChange (val) {
      console.log(`每页 ${val} 条`);
      this.listData.pageSize.val;
    },
    handleCurrentChange (val) {
      console.log(`当前页: ${val}`);
      this.listData.pageIndex=val;
    }
  }
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.dictionaryBox {
  height: calc(100% - 40px);
  width: calc(100% - 40px);
  padding: 10px;
  background: #f4f8ff;
  margin: 10px;
  border-radius: 5px;
}
.menuBox {
  width: calc(100% - 20px);
  height: calc(95% - 20px);
  margin: 10px;
 
  display: flex;
  position: relative;
  flex-direction: column;
  .menuTitle {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .menuContent {
    flex: 1;
  }
  .menupage {
    margin-top: 10px;
  }
}
</style>