bug
jiangping
2023-12-06 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5
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
<template>
  <GlobalWindow
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
    :width="width"
  >
  <p class="tip">为角色 <em>{{name}}</em> 配置权限</p>
    <p class="tip-warn"><i class="el-icon-warning"></i>提醒:权限配置后需重新登录后生效</p>
    <el-transfer
    filterable
    :filter-method="filterMethod"
    filter-placeholder="请输入搜索内容"
     :titles="['未授权权限', '已授权权限']"
    v-model="value"
       :props="{
        key: 'id',
        label: 'name'
      }"
     :data="data">
  </el-transfer>
  <button @click="sd">wwwwww</button>
  </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { permission } from '@/api/system/systemRole'
export default {
  name: 'OperaSystemRoleWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  props: ['name'],
  data () {
    // const generateData = _ => {
    //   const data = []
    // const cities = ['上海', '北京', '广州', '深圳', '南京', '西安', '成都']
    // const pinyin = ['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu']
    // cities.forEach((city, index) => {
    //   data.push({
    //     label: city,
    //     key: index,
    //     pinyin: pinyin[index]
    //   })
    // })
    // return data
    // }
    return {
      role: null,
      width: '40%',
      value: [],
      city: [],
      data: [],
      roles: []
      // filterMethod (query, item) {
      //   return item.pinyin.indexOf(query) > -1
      // }
    }
  },
  methods: {
    sd () {
      permission().then(res => {
        this.roles = res
      })
    }
  }
}
</script>
<style scoped lang="scss">
@import "@/assets/style/variables.scss";
.global-window {
  .tip {
    em {
      font-style: normal;
      color: $primary-color;
      font-weight: bold;
    }
  }
  .tip-warn {
    margin: 4px 0 12px 0;
    font-size: 12px;
    color: #999;
    i {
      color: orange;
      margin-right: 4px;
      font-size: 14px;
      position: relative;
      top: 1px;
    }
  }
}
</style>