Browse Source

平台管控-管理员

gzb
wangzhonglu 9 months ago
parent
commit
3f2a210e36

+ 53
- 0
src/assets/less/common.less View File

@@ -341,6 +341,7 @@ fieldset[disabled] .ivu-input,
341 341
   user-select: text;
342 342
 }
343 343
 // 按钮样式
344
+.ivu-modal-confirm-footer .ivu-btn.ivu-btn-primary,
344 345
 .primary_btn.ivu-btn.ivu-btn-primary {
345 346
   border: none;
346 347
   border-radius: 8px;
@@ -349,6 +350,21 @@ fieldset[disabled] .ivu-input,
349 350
   box-shadow: inset 0 1px 2px 0 #ffffffb3, inset 0 -2px 3px 0 #ffffff4d,
350 351
     0 3px 5px 0 #339dff80, inset 0 -2px 0 0 #2b89e0;
351 352
 }
353
+.ivu-modal-confirm-body {
354
+  color: #7C8DB5;
355
+  font-size: 16px;
356
+}
357
+.ivu-btn.ivu-btn-default {
358
+  color: #7C8DB5;
359
+  border: 1px solid #b8c2d9;
360
+  border-radius: 8px;
361
+}
362
+.ivu-modal-confirm-footer .ivu-btn.ivu-btn-text {
363
+  margin-right: 16px;
364
+  color: #7C8DB5;
365
+  border: 1px solid #b8c2d9;
366
+  border-radius: 8px;
367
+}
352 368
 .main_root {
353 369
   margin: 0 16px 10px;
354 370
   min-height: calc(100% - 10px);
@@ -356,6 +372,7 @@ fieldset[disabled] .ivu-input,
356 372
   border: 1px solid #e9f0f9;
357 373
   background-color: #fff;
358 374
 }
375
+// 表格
359 376
 .table_wrap {
360 377
   margin: 0 16px;
361 378
   border: 1px solid #e8eaec;
@@ -374,4 +391,40 @@ fieldset[disabled] .ivu-input,
374 391
 .page_wrap {
375 392
   padding: 16px;
376 393
   text-align: right;
394
+}
395
+// 自定义树选择输入框
396
+.tree_drop_input {
397
+  display: flex;
398
+  justify-content: space-between;
399
+  align-items: center;
400
+  padding: 0 8px;
401
+  height: 32px;
402
+  color: #515a6e;
403
+  background-color: #fff;
404
+  border-radius: 6px;
405
+  border: 1px solid #dcdee2;
406
+  transition: all 0.2s ease-in-out;
407
+  cursor: pointer;
408
+  &:hover {
409
+    border-color: #57a3f3;
410
+  }
411
+  .tree_drop_selected {
412
+    width: calc(100% - 15px);
413
+    height: 30px;
414
+    line-height: 30px;
415
+    overflow: hidden;
416
+    text-overflow: ellipsis;
417
+    white-space: nowrap;
418
+    &:empty::before {
419
+      content: attr(placeholder);
420
+      color: #c0c4cc;
421
+    }
422
+  }
423
+  .tree_drop_arrow {
424
+    color: #808695;
425
+    transition: all 0.2s ease-in-out;
426
+    &.arrow_down {
427
+      transform: rotate(180deg);
428
+    }
429
+  }
377 430
 }

+ 165
- 0
src/components/CustomTree/CustomTree.vue View File

@@ -0,0 +1,165 @@
1
+<template>
2
+  <div class="tree_root">
3
+    <div class="level_root" v-for="levelItem in list" :key="levelItem.treeid">
4
+      <div
5
+        :class="[
6
+          'level_item',
7
+          selectedTreeItem.treeid === levelItem.treeid ? 'selected' : ''
8
+        ]"
9
+        @click="toChangeSelected(levelItem)"
10
+      >
11
+        <div class="level_item_main">
12
+          <div
13
+            class="arrow_icon_box"
14
+            @click="toChangeOpenChildren(levelItem)"
15
+            v-if="levelItem.childList && levelItem.childList.length > 0"
16
+          >
17
+            <Icon
18
+              :class="['arrow_icon', levelItem.open ? 'arrow_down' : '']"
19
+              type="ios-arrow-forward"
20
+              :size="16"
21
+            />
22
+          </div>
23
+          <div v-else class="replace_dom"></div>
24
+          <div class="level_title">
25
+            {{ levelItem.treealias }}
26
+          </div>
27
+        </div>
28
+      </div>
29
+      <CustomTreeItem
30
+        v-if="levelItem.childList && levelItem.childList.length > 0"
31
+        :list="levelItem.childList"
32
+        :selected-tree-item="selectedTreeItem"
33
+        :open="levelItem.open"
34
+        :level="1"
35
+        @toChangeSelected="toChangeSelected"
36
+      ></CustomTreeItem>
37
+    </div>
38
+  </div>
39
+</template>
40
+
41
+<script>
42
+import CustomTreeItem from "./CustomTreeItem.vue";
43
+export default {
44
+  name: "CustomTree",
45
+  components: {
46
+    CustomTreeItem
47
+  },
48
+  props: {
49
+    // 列表数据
50
+    list: {
51
+      type: Array,
52
+      default() {
53
+        return [];
54
+      }
55
+    }
56
+  },
57
+  data() {
58
+    return {
59
+      // 选中树
60
+      selectedTreeItem: {}
61
+    };
62
+  },
63
+  watch: {
64
+    list: {
65
+      handler() {
66
+        // 如果已选中就回显
67
+        let selectedTreeItem = this.originSelectedTreeItem(this.list);
68
+        if (selectedTreeItem) {
69
+          this.toChangeSelected(selectedTreeItem);
70
+        }
71
+      },
72
+      deep: true,
73
+      immediate: true
74
+    }
75
+  },
76
+  methods: {
77
+    // 已选中就回显
78
+    originSelectedTreeItem(list) {
79
+      if (list.length > 0 && this.selectedTreeItem.treeid) {
80
+        for (let treeItem of list) {
81
+          if (treeItem.treeid === this.selectedTreeItem.treeid) {
82
+            this.selectedTreeItem = treeItem;
83
+            return treeItem;
84
+          }
85
+          if (treeItem.childList && treeItem.childList.length > 0) {
86
+            let selectedTreeItem = this.originSelectedTreeItem(
87
+              treeItem.childList
88
+            );
89
+            if (selectedTreeItem) {
90
+              return selectedTreeItem;
91
+            }
92
+          }
93
+        }
94
+      }
95
+    },
96
+    // 选中树
97
+    toChangeSelected(levelItem) {
98
+      if (
99
+        this.selectedTreeItem.treeid === levelItem.treeid ||
100
+        !levelItem.treeid
101
+      ) {
102
+        return;
103
+      }
104
+      this.selectedTreeItem = levelItem;
105
+      this.$emit("selectedTreeItem", this.selectedTreeItem);
106
+    },
107
+    // 展开树
108
+    toChangeOpenChildren(levelItem) {
109
+      levelItem.open = !levelItem.open;
110
+    }
111
+  }
112
+};
113
+</script>
114
+
115
+<style lang="less" scoped>
116
+.tree_root {
117
+  position: relative;
118
+  padding: 10px 0;
119
+  width: 100%;
120
+  .level_root {
121
+    position: relative;
122
+    width: 100%;
123
+    .level_item {
124
+      margin: 0 5px;
125
+      border-radius: 4px;
126
+      cursor: pointer;
127
+      &.selected,
128
+      &:hover {
129
+        color: var(--font_selected_color);
130
+        background-color: var(--bg_transparent_color);
131
+      }
132
+      .level_item_main {
133
+        display: flex;
134
+        justify-content: flex-start;
135
+        align-items: center;
136
+        .arrow_icon_box {
137
+          display: flex;
138
+          justify-content: flex-start;
139
+          align-items: center;
140
+          width: 20px;
141
+          height: 32px;
142
+          .arrow_icon {
143
+            transition: all 0.2s ease-in-out;
144
+            &.arrow_down {
145
+              transform: rotate(90deg);
146
+            }
147
+          }
148
+        }
149
+        .replace_dom {
150
+          width: 20px;
151
+          height: 32px;
152
+        }
153
+        .level_title {
154
+          width: calc(100% - 28px);
155
+          font-size: 12px;
156
+          line-height: 32px;
157
+          overflow: hidden;
158
+          text-overflow: ellipsis;
159
+          white-space: nowrap;
160
+        }
161
+      }
162
+    }
163
+  }
164
+}
165
+</style>

+ 139
- 0
src/components/CustomTree/CustomTreeItem.vue View File

@@ -0,0 +1,139 @@
1
+<template>
2
+  <div>
3
+    <div
4
+      class="level_root"
5
+      v-for="levelItem in list"
6
+      :key="levelItem.treeid"
7
+      v-show="open"
8
+    >
9
+      <div
10
+        :class="[
11
+          'level_item',
12
+          selectedTreeItem.treeid === levelItem.treeid ? 'selected' : ''
13
+        ]"
14
+        @click="toChangeSelected(levelItem)"
15
+      >
16
+        <div
17
+          class="level_item_main"
18
+          :style="{
19
+            marginLeft: `${level * 20}px`
20
+          }"
21
+        >
22
+          <div
23
+            class="arrow_icon_box"
24
+            @click="toChangeOpenChildren(levelItem)"
25
+            v-if="levelItem.childList && levelItem.childList.length > 0"
26
+          >
27
+            <Icon
28
+              :class="['arrow_icon', levelItem.open ? 'arrow_down' : '']"
29
+              type="ios-arrow-forward"
30
+              :size="16"
31
+            />
32
+          </div>
33
+          <div v-else class="replace_dom"></div>
34
+          <div class="level_title">
35
+            {{ levelItem.treealias }}
36
+          </div>
37
+        </div>
38
+      </div>
39
+      <CustomTreeItem
40
+        v-if="levelItem.childList && levelItem.childList.length > 0"
41
+        :list="levelItem.childList"
42
+        :selected-tree-item="selectedTreeItem"
43
+        :open="levelItem.open"
44
+        :level="level + 1"
45
+        @toChangeSelected="toChangeSelected"
46
+      ></CustomTreeItem>
47
+    </div>
48
+  </div>
49
+</template>
50
+
51
+<script>
52
+export default {
53
+  name: "CustomTreeItem",
54
+  props: {
55
+    // 列表数据
56
+    list: {
57
+      type: Array,
58
+      default() {
59
+        return [];
60
+      }
61
+    },
62
+    // 选中项
63
+    selectedTreeItem: {
64
+      type: Object,
65
+      default() {
66
+        return {};
67
+      }
68
+    },
69
+    // 是否展开
70
+    open: {
71
+      type: Boolean,
72
+      default: false
73
+    },
74
+    // 当前层级
75
+    level: {
76
+      type: Number,
77
+      default: 1
78
+    }
79
+  },
80
+  data() {
81
+    return {};
82
+  },
83
+  methods: {
84
+    toChangeSelected(levelItem) {
85
+      this.$emit("toChangeSelected", levelItem);
86
+    },
87
+    toChangeOpenChildren(levelItem) {
88
+      levelItem.open = !levelItem.open;
89
+    }
90
+  }
91
+};
92
+</script>
93
+
94
+<style lang="less" scoped>
95
+.level_root {
96
+  position: relative;
97
+  width: 100%;
98
+  .level_item {
99
+    margin: 0 5px;
100
+    border-radius: 4px;
101
+    cursor: pointer;
102
+    &.selected,
103
+    &:hover {
104
+      color: var(--font_selected_color);
105
+      background-color: var(--bg_transparent_color);
106
+    }
107
+    .level_item_main {
108
+      display: flex;
109
+      justify-content: flex-start;
110
+      align-items: center;
111
+      .arrow_icon_box {
112
+        display: flex;
113
+        justify-content: flex-start;
114
+        align-items: center;
115
+        width: 20px;
116
+        height: 32px;
117
+        .arrow_icon {
118
+          transition: all 0.2s ease-in-out;
119
+          &.arrow_down {
120
+            transform: rotate(90deg);
121
+          }
122
+        }
123
+      }
124
+      .replace_dom {
125
+        width: 20px;
126
+        height: 32px;
127
+      }
128
+      .level_title {
129
+        width: calc(100% - 28px);
130
+        font-size: 12px;
131
+        line-height: 32px;
132
+        overflow: hidden;
133
+        text-overflow: ellipsis;
134
+        white-space: nowrap;
135
+      }
136
+    }
137
+  }
138
+}
139
+</style>

+ 449
- 4
src/views/platformSection/regionManage/adminManage.vue View File

@@ -1,14 +1,459 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Dropdown
6
+          :transfer="true"
7
+          trigger="custom"
8
+          class="search_drop"
9
+          :visible="searchForm.showDrop"
10
+          placement="bottom-start"
11
+        >
12
+          <div
13
+            class="tree_drop_input"
14
+            @click="searchForm.showDrop = !searchForm.showDrop"
15
+          >
16
+            <div class="tree_drop_selected">
17
+              {{ searchForm.areaname }}
18
+            </div>
19
+            <div>
20
+              <Icon
21
+                :class="[
22
+                  'tree_drop_arrow',
23
+                  searchForm.showDrop ? 'arrow_down' : ''
24
+                ]"
25
+                type="ios-arrow-down"
26
+              ></Icon>
27
+            </div>
28
+          </div>
29
+          <DropdownMenu
30
+            slot="list"
31
+            style="width: 200px"
32
+            @mousedown.native.stop
33
+            @click.native.stop
34
+          >
35
+            <CustomTree
36
+              :list="searchForm.dropList"
37
+              @selectedTreeItem="searchAreaChange"
38
+            ></CustomTree>
39
+          </DropdownMenu>
40
+        </Dropdown>
41
+        <Input
42
+          v-model="searchForm.name"
43
+          placeholder="请输入名称"
44
+          search
45
+          @on-search="searchList()"
46
+          style="width: 150px"
47
+        />
48
+      </div>
49
+      <Button type="primary" class="primary_btn" @click="toAdd()">新建</Button>
50
+    </div>
51
+    <div class="table_wrap">
52
+      <Table :columns="columns" :data="searchForm.list">
53
+        <template slot-scope="{ row }" slot="createtimeSlot">
54
+          <div>{{ date_format(row.createtime) }}</div>
55
+        </template>
56
+        <template slot-scope="{ row }" slot="updatetimeSlot">
57
+          <div>{{ date_format(row.updatetime) }}</div>
58
+        </template>
59
+        <template slot-scope="{ row }" slot="actionSlot">
60
+          <div class="action_list">
61
+            <div @click="toView(row)">查看</div>
62
+            <div @click="toEdit(row)">编辑</div>
63
+            <div class="action_del" @click="toDel(row)">删除</div>
64
+          </div>
65
+        </template>
66
+      </Table>
67
+    </div>
68
+    <div class="page_wrap">
69
+      <Page
70
+        :transfer="true"
71
+        :total="searchForm.total"
72
+        :current="searchForm.page"
73
+        :page-size="searchForm.size"
74
+        :page-size-opts="[10, 20, 40, 60]"
75
+        @on-change="pageChange"
76
+        @on-page-size-change="pageSizeChange"
77
+        show-total
78
+        show-sizer
79
+      ></Page>
80
+    </div>
81
+    <!-- 新建 -->
82
+    <Modal
83
+      class="modal1"
84
+      :mask-closable="false"
85
+      v-model="areaInfo.show"
86
+      :title="areaInfo.id ? '编辑' : '新建'"
87
+    >
88
+      <Form
89
+        ref="addForm"
90
+        :model="areaInfo"
91
+        :rules="rules"
92
+        :label-width="100"
93
+        inline
94
+      >
95
+        <FormItem label="区域名称" prop="areaname" style="width: 100%">
96
+          <Input
97
+            v-model="areaInfo.areaname"
98
+            placeholder="请输入区域名称"
99
+          ></Input>
100
+        </FormItem>
101
+        <FormItem
102
+          label="管理员名称"
103
+          prop="admin"
104
+          style="width: calc(50% - 10px)"
105
+        >
106
+          <Input
107
+            v-model="areaInfo.admin"
108
+            placeholder="请输入管理员名称"
109
+          ></Input>
110
+        </FormItem>
111
+        <FormItem
112
+          label="登录账号"
113
+          prop="loginname"
114
+          style="width: calc(50% - 10px)"
115
+        >
116
+          <Input
117
+            v-model="areaInfo.loginname"
118
+            placeholder="请输入登录账号"
119
+          ></Input>
120
+        </FormItem>
121
+        <FormItem label="密码" prop="pwd" style="width: calc(50% - 10px)">
122
+          <Input v-model="areaInfo.pwd" placeholder="请输入密码"></Input>
123
+        </FormItem>
124
+        <FormItem label="确认密码" prop="pwd1" style="width: calc(50% - 10px)">
125
+          <Input v-model="areaInfo.pwd1" placeholder="请输入确认密码"></Input>
126
+        </FormItem>
127
+        <FormItem label="手机号码" prop="phone" style="width: calc(50% - 10px)">
128
+          <Input v-model="areaInfo.phone" placeholder="请输入手机号码"></Input>
129
+        </FormItem>
130
+        <FormItem
131
+          label="短信验证码"
132
+          prop="code"
133
+          style="width: calc(50% - 10px)"
134
+        >
135
+          <Input
136
+            style="width: calc(100% - 102px)"
137
+            v-model="areaInfo.code"
138
+            placeholder="请输入短信验证码"
139
+          ></Input>
140
+          <div class="code_btn disabled">获取验证码</div>
141
+        </FormItem>
142
+      </Form>
143
+      <div slot="footer">
144
+        <Button @click="areaInfo.show = false">取消</Button>
145
+        <Button @click="saveAddInfo()" type="primary">保存</Button>
146
+      </div>
147
+    </Modal>
148
+    <!-- 查看 -->
149
+    <Modal
150
+      class="modal1"
151
+      :mask-closable="false"
152
+      v-model="viewInfo.show"
153
+      title="查看"
154
+    >
155
+      <div class="view_title">河南星火燎原软件科技有限公司</div>
156
+      <Table
157
+        style="border: 1px solid #e8eaec; border-bottom: none"
158
+        :columns="viewInfo.columns"
159
+        :data="viewInfo.list"
160
+      ></Table>
161
+      <div slot="footer" style="text-align: center">
162
+        <Button @click="viewInfo.show = false">关闭</Button>
163
+      </div>
164
+    </Modal>
165
+  </div>
3 166
 </template>
4 167
 
5 168
 <script>
169
+import CustomTree from "@/components/CustomTree/CustomTree.vue";
170
+import { date_format } from "@/utils";
6 171
 export default {
172
+  components: {
173
+    CustomTree
174
+  },
7 175
   data() {
8
-    return {};
176
+    return {
177
+      date_format,
178
+      searchForm: {
179
+        showDrop: false,
180
+        dropList: [],
181
+        areaname: "",
182
+        areaid: null,
183
+        page: 1,
184
+        size: 10,
185
+        list: [],
186
+        total: 0
187
+      },
188
+      // 新建/编辑
189
+      areaInfo: {
190
+        show: false,
191
+        id: null,
192
+        areaname: "",
193
+        admin: "",
194
+        loginname: "",
195
+        pwd: "",
196
+        pwd1: "",
197
+        phone: "",
198
+        code: ""
199
+      },
200
+      // 查看
201
+      viewInfo: {
202
+        show: false,
203
+        areaname: "",
204
+        list: [],
205
+        columns: [
206
+          {
207
+            title: "序号",
208
+            type: "index",
209
+            width: 70,
210
+            align: "center"
211
+          },
212
+          {
213
+            title: "名称",
214
+            key: "admin",
215
+            align: "center"
216
+          },
217
+          {
218
+            title: "账号",
219
+            key: "loginname",
220
+            align: "center"
221
+          },
222
+          {
223
+            title: "手机号码",
224
+            key: "phone",
225
+            align: "center"
226
+          }
227
+        ]
228
+      },
229
+      rules: {
230
+        areaname: [
231
+          {
232
+            required: true,
233
+            message: "请输入区域名称",
234
+            trigger: "blur"
235
+          }
236
+        ],
237
+        admin: [
238
+          {
239
+            required: true,
240
+            message: "请输入管理员名称",
241
+            trigger: "blur"
242
+          }
243
+        ],
244
+        loginname: [
245
+          {
246
+            required: true,
247
+            message: "请输入请输入登录账号",
248
+            trigger: "blur"
249
+          }
250
+        ],
251
+        pwd: [
252
+          {
253
+            required: true,
254
+            message: "请输入密码",
255
+            trigger: "blur"
256
+          }
257
+        ],
258
+        pwd1: [
259
+          {
260
+            required: true,
261
+            message: "请输入确认密码",
262
+            trigger: "blur"
263
+          }
264
+        ]
265
+      },
266
+      columns: [
267
+        {
268
+          title: "序号",
269
+          align: "center",
270
+          width: 70,
271
+          render: (h, params) => {
272
+            return h(
273
+              "span",
274
+              params.index +
275
+                (this.searchForm.page - 1) * this.searchForm.size +
276
+                1
277
+            );
278
+          }
279
+        },
280
+        {
281
+          title: "区域名称",
282
+          key: "areaname",
283
+          align: "center"
284
+        },
285
+        {
286
+          title: "创建人",
287
+          key: "createname",
288
+          width: 140,
289
+          align: "center"
290
+        },
291
+        {
292
+          title: "创建时间",
293
+          slot: "createtimeSlot",
294
+          width: 190,
295
+          align: "center"
296
+        },
297
+        {
298
+          title: "操作人",
299
+          key: "updatename",
300
+          width: 140,
301
+          align: "center"
302
+        },
303
+        {
304
+          title: "操作时间",
305
+          slot: "updatetimeSlot",
306
+          width: 190,
307
+          align: "center"
308
+        },
309
+        {
310
+          title: "操作",
311
+          slot: "actionSlot",
312
+          width: 220,
313
+          align: "center"
314
+        }
315
+      ]
316
+    };
317
+  },
318
+  created() {
319
+    this.searchList();
9 320
   },
10
-  methods: {}
321
+  methods: {
322
+    // 区域选择改变
323
+    searchAreaChange() {},
324
+    // 搜索
325
+    searchList() {
326
+      this.searchForm.page = 1;
327
+      this.getList();
328
+    },
329
+    // 页码改变
330
+    pageChange(page) {
331
+      this.searchForm.page = page;
332
+      this.getList();
333
+    },
334
+    // 每页显示数量改变
335
+    pageSizeChange(size) {
336
+      this.searchForm.size = size;
337
+      this.searchForm.page = 1;
338
+      this.getList();
339
+    },
340
+    // 获取列表
341
+    getList() {
342
+      this.searchForm.list = [
343
+        {
344
+          id: 1,
345
+          areaname: "区域一",
346
+          createname: "区域一",
347
+          createtime: 1710838418,
348
+          updatename: "区域一",
349
+          updatetime: 1710838430
350
+        },
351
+        {
352
+          id: 2,
353
+          areaname: "区域二",
354
+          createname: "区域一",
355
+          createtime: 1710838418,
356
+          updatename: "区域一",
357
+          updatetime: 1710838430
358
+        },
359
+        {
360
+          id: 3,
361
+          areaname: "区域三",
362
+          createname: "区域一",
363
+          createtime: 1710838418,
364
+          updatename: "区域一",
365
+          updatetime: 1710838430
366
+        }
367
+      ];
368
+      this.searchForm.total = 3;
369
+    },
370
+    // 新建
371
+    toAdd() {
372
+      this.areaInfo.show = true;
373
+      this.areaInfo.areaname = "";
374
+      this.areaInfo.admin = "";
375
+      this.areaInfo.loginname = "";
376
+      this.areaInfo.pwd = "";
377
+      this.areaInfo.pwd1 = "";
378
+      this.areaInfo.phone = "";
379
+      this.areaInfo.code = "";
380
+    },
381
+    // 保存新建
382
+    saveAddInfo() {
383
+      this.areaInfo.show = false;
384
+    },
385
+    // 查看
386
+    toView() {
387
+      this.viewInfo.show = true;
388
+      this.viewInfo.areaname = "河南星火燎原软件科技有限公司";
389
+      this.viewInfo.list = [
390
+        {
391
+          admin: "周文彦",
392
+          loginname: "zhouwenyan@xhkjedu.com",
393
+          phone: "15610230213"
394
+        },
395
+        {
396
+          admin: "齐思宇",
397
+          loginname: "zhouwenyan@xhkjedu.com",
398
+          phone: "15610230213"
399
+        }
400
+      ];
401
+    },
402
+    // 编辑
403
+    toEdit(row) {
404
+      this.areaInfo.show = true;
405
+      this.areaInfo.id = row.id;
406
+    },
407
+    // 删除
408
+    toDel() {
409
+      this.$Modal.confirm({
410
+        title: "提示",
411
+        content: "您确定删除选中数据吗?",
412
+        onOk: () => {},
413
+        onCancel: () => {}
414
+      });
415
+    }
416
+  }
11 417
 };
12 418
 </script>
13 419
 
14
-<style lang="less" scoped></style>
420
+<style lang="less" scoped>
421
+.search_header {
422
+  display: flex;
423
+  justify-content: space-between;
424
+  align-items: center;
425
+  margin: 16px 16px;
426
+  .search_left {
427
+    display: flex;
428
+    justify-content: flex-start;
429
+    align-items: center;
430
+    .search_drop {
431
+      margin-right: 10px;
432
+      width: 200px;
433
+    }
434
+  }
435
+}
436
+.code_btn {
437
+  display: inline-block;
438
+  margin-left: 10px;
439
+  padding: 0 10px;
440
+  color: #339dff;
441
+  line-height: 30px;
442
+  border: 1px solid #339dff;
443
+  border-radius: 6px;
444
+  background-color: #fff;
445
+  cursor: pointer;
446
+  &.disabled {
447
+    color: #c5c8ce;
448
+    background-color: #f7f7f7;
449
+    border-color: #dcdee2;
450
+    cursor: not-allowed;
451
+  }
452
+}
453
+.view_title {
454
+  margin-bottom: 16px;
455
+  font-size: 18px;
456
+  font-weight: bold;
457
+  text-align: center;
458
+}
459
+</style>

+ 134
- 25
src/views/platformSection/regionManage/regionManage.vue View File

@@ -45,19 +45,19 @@
45 45
     <Modal
46 46
       class="modal1"
47 47
       :mask-closable="false"
48
-      v-model="addInfo.show"
49
-      title="新建"
48
+      v-model="areaInfo.show"
49
+      :title="areaInfo.id ? '编辑' : '新建'"
50 50
     >
51 51
       <Form
52 52
         ref="addForm"
53
-        :model="addInfo"
53
+        :model="areaInfo"
54 54
         :rules="rules"
55 55
         :label-width="100"
56 56
         inline
57 57
       >
58 58
         <FormItem label="区域名称" prop="areaname" style="width: 100%">
59 59
           <Input
60
-            v-model="addInfo.areaname"
60
+            v-model="areaInfo.areaname"
61 61
             placeholder="请输入区域名称"
62 62
           ></Input>
63 63
         </FormItem>
@@ -66,7 +66,10 @@
66 66
           prop="admin"
67 67
           style="width: calc(50% - 10px)"
68 68
         >
69
-          <Input v-model="addInfo.admin" placeholder="请输入管理员名称"></Input>
69
+          <Input
70
+            v-model="areaInfo.admin"
71
+            placeholder="请输入管理员名称"
72
+          ></Input>
70 73
         </FormItem>
71 74
         <FormItem
72 75
           label="登录账号"
@@ -74,32 +77,54 @@
74 77
           style="width: calc(50% - 10px)"
75 78
         >
76 79
           <Input
77
-            v-model="addInfo.loginname"
80
+            v-model="areaInfo.loginname"
78 81
             placeholder="请输入登录账号"
79 82
           ></Input>
80 83
         </FormItem>
81 84
         <FormItem label="密码" prop="pwd" style="width: calc(50% - 10px)">
82
-          <Input v-model="addInfo.pwd" placeholder="请输入密码"></Input>
85
+          <Input v-model="areaInfo.pwd" placeholder="请输入密码"></Input>
83 86
         </FormItem>
84 87
         <FormItem label="确认密码" prop="pwd1" style="width: calc(50% - 10px)">
85
-          <Input v-model="addInfo.pwd1" placeholder="请输入确认密码"></Input>
88
+          <Input v-model="areaInfo.pwd1" placeholder="请输入确认密码"></Input>
86 89
         </FormItem>
87 90
         <FormItem label="手机号码" prop="phone" style="width: calc(50% - 10px)">
88
-          <Input v-model="addInfo.phone" placeholder="请输入手机号码"></Input>
91
+          <Input v-model="areaInfo.phone" placeholder="请输入手机号码"></Input>
89 92
         </FormItem>
90 93
         <FormItem
91 94
           label="短信验证码"
92 95
           prop="code"
93 96
           style="width: calc(50% - 10px)"
94 97
         >
95
-          <Input v-model="addInfo.code" placeholder="请输入短信验证码"></Input>
98
+          <Input
99
+            style="width: calc(100% - 102px)"
100
+            v-model="areaInfo.code"
101
+            placeholder="请输入短信验证码"
102
+          ></Input>
103
+          <div class="code_btn disabled">获取验证码</div>
96 104
         </FormItem>
97 105
       </Form>
98 106
       <div slot="footer">
99
-        <Button @click="addInfo.show = false">取消</Button>
107
+        <Button @click="areaInfo.show = false">取消</Button>
100 108
         <Button @click="saveAddInfo()" type="primary">保存</Button>
101 109
       </div>
102 110
     </Modal>
111
+    <!-- 查看 -->
112
+    <Modal
113
+      class="modal1"
114
+      :mask-closable="false"
115
+      v-model="viewInfo.show"
116
+      title="查看"
117
+    >
118
+      <div class="view_title">河南星火燎原软件科技有限公司</div>
119
+      <Table
120
+        style="border: 1px solid #e8eaec; border-bottom: none"
121
+        :columns="viewInfo.columns"
122
+        :data="viewInfo.list"
123
+      ></Table>
124
+      <div slot="footer" style="text-align: center">
125
+        <Button @click="viewInfo.show = false">关闭</Button>
126
+      </div>
127
+    </Modal>
103 128
   </div>
104 129
 </template>
105 130
 
@@ -116,8 +141,10 @@ export default {
116 141
         list: [],
117 142
         total: 0
118 143
       },
119
-      addInfo: {
144
+      // 新建/编辑
145
+      areaInfo: {
120 146
         show: false,
147
+        id: null,
121 148
         areaname: "",
122 149
         admin: "",
123 150
         loginname: "",
@@ -126,6 +153,35 @@ export default {
126 153
         phone: "",
127 154
         code: ""
128 155
       },
156
+      // 查看
157
+      viewInfo: {
158
+        show: false,
159
+        areaname: "",
160
+        list: [],
161
+        columns: [
162
+          {
163
+            title: "序号",
164
+            type: "index",
165
+            width: 70,
166
+            align: "center"
167
+          },
168
+          {
169
+            title: "名称",
170
+            key: "admin",
171
+            align: "center"
172
+          },
173
+          {
174
+            title: "账号",
175
+            key: "loginname",
176
+            align: "center"
177
+          },
178
+          {
179
+            title: "手机号码",
180
+            key: "phone",
181
+            align: "center"
182
+          }
183
+        ]
184
+      },
129 185
       rules: {
130 186
         areaname: [
131 187
           {
@@ -267,27 +323,57 @@ export default {
267 323
     },
268 324
     // 新建
269 325
     toAdd() {
270
-      this.addInfo.show = true;
271
-      this.addInfo.areaname = "";
272
-      this.addInfo.admin = "";
273
-      this.addInfo.loginname = "";
274
-      this.addInfo.pwd = "";
275
-      this.addInfo.pwd1 = "";
276
-      this.addInfo.phone = "";
277
-      this.addInfo.code = "";
326
+      this.areaInfo.show = true;
327
+      this.areaInfo.areaname = "";
328
+      this.areaInfo.admin = "";
329
+      this.areaInfo.loginname = "";
330
+      this.areaInfo.pwd = "";
331
+      this.areaInfo.pwd1 = "";
332
+      this.areaInfo.phone = "";
333
+      this.areaInfo.code = "";
278 334
     },
279 335
     // 保存新建
280 336
     saveAddInfo() {
281
-      this.addInfo.show = false;
337
+      this.areaInfo.show = false;
282 338
     },
283 339
     // 进入
284
-    toEnter() {},
340
+    toEnter() {
341
+      this.$router.push({
342
+        path: "/region/home",
343
+        query: {}
344
+      });
345
+    },
285 346
     // 查看
286
-    toView() {},
347
+    toView() {
348
+      this.viewInfo.show = true;
349
+      this.viewInfo.areaname = "河南星火燎原软件科技有限公司";
350
+      this.viewInfo.list = [
351
+        {
352
+          admin: "周文彦",
353
+          loginname: "zhouwenyan@xhkjedu.com",
354
+          phone: "15610230213"
355
+        },
356
+        {
357
+          admin: "齐思宇",
358
+          loginname: "zhouwenyan@xhkjedu.com",
359
+          phone: "15610230213"
360
+        }
361
+      ];
362
+    },
287 363
     // 编辑
288
-    toEdit() {},
364
+    toEdit(row) {
365
+      this.areaInfo.show = true;
366
+      this.areaInfo.id = row.id;
367
+    },
289 368
     // 删除
290
-    toDel() {}
369
+    toDel() {
370
+      this.$Modal.confirm({
371
+        title: "提示",
372
+        content: "您确定删除选中数据吗?",
373
+        onOk: () => {},
374
+        onCancel: () => {}
375
+      });
376
+    }
291 377
   }
292 378
 };
293 379
 </script>
@@ -299,4 +385,27 @@ export default {
299 385
   align-items: center;
300 386
   margin: 16px 16px;
301 387
 }
388
+.code_btn {
389
+  display: inline-block;
390
+  margin-left: 10px;
391
+  padding: 0 10px;
392
+  color: #339dff;
393
+  line-height: 30px;
394
+  border: 1px solid #339dff;
395
+  border-radius: 6px;
396
+  background-color: #fff;
397
+  cursor: pointer;
398
+  &.disabled {
399
+    color: #c5c8ce;
400
+    background-color: #f7f7f7;
401
+    border-color: #dcdee2;
402
+    cursor: not-allowed;
403
+  }
404
+}
405
+.view_title {
406
+  margin-bottom: 16px;
407
+  font-size: 18px;
408
+  font-weight: bold;
409
+  text-align: center;
410
+}
302 411
 </style>

+ 12
- 1
src/views/regionSection/index.vue View File

@@ -52,6 +52,7 @@
52 52
           <span>公告</span>
53 53
         </router-link>
54 54
       </div>
55
+      <div class="out_region" @click="exitToPreviousLevel()">退出区域</div>
55 56
     </div>
56 57
     <div class="section_main">
57 58
       <router-view></router-view>
@@ -84,11 +85,16 @@ export default {
84 85
     }
85 86
   },
86 87
   methods: {
88
+    // 选中菜单后隐藏下拉
87 89
     routeDropdownChange() {
88 90
       this.routeDropdown = false;
89 91
       setTimeout(() => {
90 92
         this.routeDropdown = true;
91 93
       }, 500);
94
+    },
95
+    // 退出到上一级
96
+    exitToPreviousLevel() {
97
+      this.$router.push("/platform/home");
92 98
     }
93 99
   }
94 100
 };
@@ -101,7 +107,7 @@ export default {
101 107
   overflow: auto;
102 108
   .section_header {
103 109
     display: flex;
104
-    justify-content: flex-start;
110
+    justify-content: space-between;
105 111
     align-items: center;
106 112
     margin: 10px 16px;
107 113
     padding: 13px 20px;
@@ -179,6 +185,11 @@ export default {
179 185
         }
180 186
       }
181 187
     }
188
+    .out_region {
189
+      line-height: 32px;
190
+      font-size: 16px;
191
+      cursor: pointer;
192
+    }
182 193
   }
183 194
   .section_main {
184 195
     position: relative;

+ 12
- 1
src/views/schoolSection/index.vue View File

@@ -6,6 +6,7 @@
6 6
           <span>首页</span>
7 7
         </router-link>
8 8
       </div>
9
+      <div class="out_region" @click="exitToPreviousLevel()">退出学校</div>
9 10
     </div>
10 11
     <div class="section_main">
11 12
       <router-view></router-view>
@@ -21,11 +22,16 @@ export default {
21 22
     };
22 23
   },
23 24
   methods: {
25
+    // 选中菜单后隐藏下拉
24 26
     routeDropdownChange() {
25 27
       this.routeDropdown = false;
26 28
       setTimeout(() => {
27 29
         this.routeDropdown = true;
28 30
       }, 500);
31
+    },
32
+    // 退出到上一级
33
+    exitToPreviousLevel() {
34
+      this.$router.push("/region/home");
29 35
     }
30 36
   }
31 37
 };
@@ -38,7 +44,7 @@ export default {
38 44
   overflow: auto;
39 45
   .section_header {
40 46
     display: flex;
41
-    justify-content: flex-start;
47
+    justify-content: space-between;
42 48
     align-items: center;
43 49
     margin: 10px 16px;
44 50
     padding: 13px 20px;
@@ -116,6 +122,11 @@ export default {
116 122
         }
117 123
       }
118 124
     }
125
+    .out_region {
126
+      line-height: 32px;
127
+      font-size: 16px;
128
+      cursor: pointer;
129
+    }
119 130
   }
120 131
   .section_main {
121 132
     position: relative;

Loading…
Cancel
Save