85
      accessedRouters = filterAsyncRoutes(asyncRoutes, roles, menus)
86
      commit('SET_ROUTES', accessedRouters)
87
      resolve()
60 88
    })
61 89
  }
62 90
}

Merge branch 'master' of http://10.1.235.20:3000/asiainfo/static · e5f6c38355 - Nuosi Git Service
Explorar el Código

Merge branch 'master' of http://10.1.235.20:3000/asiainfo/static

guohh %!s(int64=3) %!d(string=hace) años
padre
commit
e5f6c38355

+ 7 - 2
2022/aiot-evaluate/src/components/form/IpuForm.vue

@ -69,7 +69,7 @@
69 69
        ></ipu-date-picker>
70 70
      </el-form-item>
71 71
    </template>
72
    <el-form-item>
72
    <el-form-item class="last-btns">
73 73
      <slot name="btns"></slot>
74 74
    </el-form-item>
75 75
  </el-form>
@ -98,4 +98,9 @@ const blurEvent = (form) => {
98 98
// 校验规则
99 99
</script>
100 100
101
<style lang="scss" scoped></style>
101
<style lang="scss" scoped>
102
.last-btns {
103
  margin-left: auto;
104
  height: 28px;
105
}
106
</style>

+ 5 - 1
2022/aiot-evaluate/src/components/index.js

@ -12,7 +12,8 @@ import IpuDrawer from './dialog/drawer/index.vue';
12 12
import IpuDialog from './dialog/dialog';
13 13
import IpuPanel from './panel';
14 14
import IpuButtonGroup from './button-group';
15
15
import IpuTableModule from './table-module';
16
import IpuPagination from './pagination';
16 17
/**
17 18
 * 注册全局组件
18 19
 * @param app
@ -39,6 +40,9 @@ export function setupGlobalComponents(app) {
39 40
  app.component('ipu-button-group', IpuButtonGroup);
40 41
  // panel
41 42
  app.component('ipu-panel', IpuPanel);
43
  // 表格页面
44
  app.component('ipu-table-module', IpuTableModule);
45
  app.component('ipu-page', IpuPagination);
42 46
43 47
  //
44 48
}

+ 50 - 0
2022/aiot-evaluate/src/components/pagination/index.vue

@ -0,0 +1,50 @@
1
<template>
2
  <el-pagination
3
    v-model:currentPage="page.num"
4
    v-model:page-size="page.size"
5
    :total="page.total"
6
    v-bind="pageAttrs"
7
    @size-change="handleSizeChange"
8
    @current-change="handleCurrentChange"
9
  />
10
</template>
11
12
<script setup>
13
import { defineEmits, defineProps } from 'vue';
14
const emits = defineEmits();
15
defineProps({
16
  pageAttrs: {
17
    type: Object,
18
    default: () => {
19
      return {
20
        background: true,
21
        layout: 'total, sizes, prev, pager, next, jumper',
22
        pageSizes: [25, 50, 100, 1000],
23
        small: 'small'
24
      };
25
    }
26
  },
27
  page: {
28
    type: Object,
29
    default: () => {
30
      return {
31
        num: 1,
32
        size: 25,
33
        total: 0
34
      };
35
    }
36
  }
37
});
38
39
// 切换size
40
function handleSizeChange(size) {
41
  emits('handleSizeChange', size);
42
}
43
44
// 切换page
45
function handleCurrentChange(page) {
46
  emits('handleCurrentChange', page);
47
}
48
</script>
49
50
<style scoped lang="scss"></style>

+ 3 - 1
2022/aiot-evaluate/src/components/panel/index.vue

@ -52,14 +52,16 @@ defineProps({
52 52
  .ipu-panel-slot-left,
53 53
  .ipu-panel-slot-right {
54 54
    display: flex;
55
    justify-content: space-around;
55

56 56
    align-items: center;
57 57
  }
58 58
  .ipu-panel-slot-left {
59
    justify-content: flex-start;
59 60
    width: 40%;
60 61
  }
61 62
  .ipu-panel-slot-right {
62 63
    width: 40%;
64
    justify-content: flex-end;
63 65
  }
64 66
}
65 67
</style>

+ 9 - 1
2022/aiot-evaluate/src/components/search-params/index.vue

@ -143,4 +143,12 @@ const blurEvent = (form) => {
143 143
};
144 144
</script>
145 145
146
<style scoped lang="scss"></style>
146
<style scoped lang="scss">
147
.search-params {
148
  background: #fff;
149
  padding: 20px 10px 0 10px;
150
  border-radius: 5px;
151
  border-top: 1px solid #ccc;
152
  border-bottom: 1px solid #ccc;
153
}
154
</style>

+ 70 - 2
2022/aiot-evaluate/src/components/table-module/index.vue

@ -1,13 +1,81 @@
1 1
<template>
2
  <div class="table-module">
2
  <ipu-panel :title="pageData?.title">
3
    <template #slot-right>
4
      <ipu-button-group :btns="pageData?.btns"> </ipu-button-group>
5
    </template>
6
    <!-- 搜索 -->
7
    <ipu-search
8
      :searchParams="pageData?.searchParams"
9
      :formValues="pageData?.formValues"
10
      @search="search"
11
      @clearSearch="clearSearch"
12
    ></ipu-search>
13
    <!-- 表格 -->
14
    <ipu-table
15
      :tableHeader="pageData?.tableHeader"
16
      :tableData="pageData?.tableData"
17
    >
18
      <template #custom="scope">
19
        <el-button
20
          v-for="btn in pageData?.tableBtns"
21
          :key="btn.name"
22
          v-bind="btn.attrs"
23
          text
24
          @click="btn.onClick(scope.row)"
25
          >{{ btn.label }}</el-button
26
        >
27
      </template>
28
    </ipu-table>
3 29
4
  </div>
30
    <!-- 分页器 -->
31
    <ipu-page
32
      class="pagination"
33
      :page="pageData?.page"
34
      @handleCurrentChange="handleCurrentChange"
35
      @handleSizeChange="handleSizeChange"
36
    ></ipu-page>
37
  </ipu-panel>
5 38
</template>
6 39
7 40
<script setup>
41
import { defineProps, defineEmits } from 'vue';
42
const props = defineProps({
43
  pageData: {
44
    type: Object,
45
    default: () => {}
46
  }
47
});
8 48
49
const emits = defineEmits(['search',
50
  'clearSearch',
51
  'handleCurrentChange',
52
  'handleSizeChange']);
53
54
// 搜索
55
const search = (formValues) => {
56
  emits('search', formValues);
57
};
58
// 清除搜索
59
const clearSearch = (formValues) => {
60
  emits('clearSearch', formValues);
61
};
62
63
// 切换size
64
function handleSizeChange(size) {
65
  emits('handleSizeChange', size);
66
}
67
68
// 切换page
69
function handleCurrentChange(page) {
70
  emits('handleCurrentChange', page);
71
}
9 72
</script>
10 73
11 74
<style scoped lang="scss">
75
.pagination {
76
  margin: 10px 10px 0 0;
12 77
78
  display: flex;
79
  justify-content: flex-end;
80
}
13 81
</style>

+ 0 - 21
2022/aiot-evaluate/src/components/table/TableAction.vue

@ -1,21 +0,0 @@
1
<template>
2
  <span>
3
    <template v-for="btn in btns">
4
      <el-button :type="btn?.type" text @click.stop="btn?.onClick(value)">
5
        {{ btn.label }}
6
      </el-button>
7
    </template>
8
  </span>
9
</template>
10
11
<script setup>
12
import { defineProps } from 'vue';
13
const props = defineProps({
14
  value: {
15
    type: Array,
16
    default: () => {}
17
  }
18
});
19
</script>
20
21
<style scoped lang="scss"></style>

+ 30 - 2
2022/aiot-evaluate/src/components/table/index.vue

@ -1,5 +1,23 @@
1 1
<template>
2
  <el-table class="g-table" hei :data="tableData">
2
  <el-table
3
    class="g-table"
4
    :data="tableData"
5
    :header-cell-style="{
6
      padding: '0 4px',
7
      height: '39px',
8
      'font-weight': '600',
9
      'font-size': '14px',
10
      'line-height': '39px',
11
      color: '#000',
12
      'background-color': '#fafafa'
13
    }"
14
    :cell-style="{
15
      padding: '0 4px',
16
      height: '60px',
17
      'line-height': '60px',
18
      'font-size': '14px'
19
    }"
20
  >
3 21
    <template v-for="header in tableHeader" :key="header?.name">
4 22
      <!-- 自自定义按钮 -->
5 23
      <el-table-column
@ -55,4 +73,14 @@ const props = defineProps({
55 73
console.log(props);
56 74
</script>
57 75
58
<style scoped lang="scss"></style>
76
<style scoped lang="scss">
77
:deep(.el-table__inner-wrapper) {
78
  font-size: 14px;
79
  .el-table__header-wrapper {
80
    font-size: 14px;
81
    thead tr {
82
      font-size: 14px;
83
    }
84
  }
85
}
86
</style>

+ 164 - 204
2022/aiot-evaluate/src/views/demos/ApiResourceManagement.vue

@ -1,29 +1,13 @@
1 1
<template>
2
  <ipu-panel title="API资源管理">
3
    <template #slot-left>
4
      <ipu-button-group :btns="btns"> </ipu-button-group>
5
    </template>
6
    <!-- 搜索 -->
7
    <ipu-search
8
      :searchParams="searchParams"
9
      :formValues="formValues"
10
      @search="search"
11
      @clearSearch="clearSearch"
12
    ></ipu-search>
13
    <!-- 表格 -->
14
    <ipu-table :tableHeader="tableHeader" :tableData="tableData">
15
      <template #custom="scope">
16
        <el-button type="danger" text @click="deleteRow(scope)">删除</el-button>
17
        <el-button text @click="edit(scope)">编辑</el-button>
18
      </template>
19
    </ipu-table>
20
  </ipu-panel>
2
  <ipu-table-module
3
    @search="search"
4
    @clearSearch="clearSearch"
5
    @handleSizeChange="handleSizeChange"
6
    @handleCurrentChange="handleCurrentChange"
7
    :pageData="pageData"
8
  ></ipu-table-module>
21 9
22 10
  <!-- 弹窗 -->
23
  <!-- <ipu-drawer
24
    :dialogForm="dialogForm"
25
    :before-close="cancleDialog"
26
  ></ipu-drawer> -->
27 11
  <ipu-dialog
28 12
    :dialogForm="dialogForm"
29 13
    @changeEvent="changeEvent"
@ -36,57 +20,13 @@
36 20
<script setup>
37 21
import { ref, getCurrentInstance } from 'vue';
38 22
39
// --------查询资源----------
40
const tableHeader = ref([
41
  {
42
    label: '资源名称',
43
    name: 'resourceName',
44
    width: '193'
45
  },
46
  {
47
    label: '资源编码',
48
    name: 'resourceId',
49
    width: '193'
50
  },
51
  {
52
    label: '资源类型',
53
    name: 'resourceType',
54
    width: '137'
55
  },
56
  {
57
    label: '所属应用',
58
    name: 'belongApplication',
59
    width: '193'
60
  },
61
  {
62
    label: '资源地址',
63
    name: 'resourceUrl',
64
    width: '217'
65
  },
66
  {
67
    label: '排序',
68
    name: 'sort',
69
    width: '217'
70
  },
71
  {
72
    label: '资源地址',
73
    name: 'resourceUrl',
74
    width: '217'
75
  },
76
  {
77
    label: '输入',
78
    type: 'input',
79
    name: 'input',
80
    width: '217'
81
  },
82
  {
83
    label: '操作',
84
    type: 'custom',
85
    name: 'custom',
86
    width: '217'
87
  }
88
]);
23
function handleCurrentChange(page) {
24
  console.log(page);
25
}
89 26
27
function handleSizeChange(size) {
28
  console.log(size);
29
}
90 30
const tableData = ref([
91 31
  {
92 32
    resourceId: '212ajo35eng12',
@ -151,142 +91,167 @@ const tableData = ref([
151 91
    resourceType: '这是一个终端柜管理角色',
152 92
    resourceUrl: '/product/productManage',
153 93
    sort: 1
154
  },
155
  {
156
    resourceId: '212ajo35eng12',
157
    resourceName: '终端柜安卓系统',
158
    belongApplication: '6523',
159
    resourceType: '这是一个终端柜管理角色',
160
    resourceUrl: '/product/productManage',
161
    sort: 1
162
  },
163
  {
164
    resourceId: '212ajo35eng12',
165
    resourceName: '终端柜安卓系统',
166
    belongApplication: '6523',
167
    resourceType: '这是一个终端柜管理角色',
168
    resourceUrl: '/product/productManage',
169
    sort: 1
170
  },
171
  {
172
    resourceId: '17493713',
173
    resourceName: '5G专网系统',
174
    belongApplication: '4340',
175
    resourceType: '这是一个终端柜管理角色',
176
    resourceUrl: '/product/productManage',
177
    sort: 1
178
  },
179
  {
180
    resourceId: '212ajo35eng12',
181
    resourceName: '终端柜安卓系统',
182
    belongApplication: '6523',
183
    resourceType: '这是一个终端柜管理角色',
184
    resourceUrl: '/product/productManage',
185
    sort: 1
186
  },
187
  {
188
    resourceId: '212ajo35eng12',
189
    resourceName: '终端柜安卓系统',
190
    belongApplication: '6523',
191
    resourceType: '这是一个终端柜管理角色',
192
    resourceUrl: '/product/productManage',
193
    sort: 1
194 94
  }
195 95
]);
196
const formValues = {
197
  resourceName: '',
198
  sourceType: [],
199
  resourceName1: ''
200
};
201
// 搜索项
202
const searchParams = ref([{
203
  name: 'resourceName',
204
  type: 'input',
205
  label: 'API资源名称',
206
  value: '',
207
  styles: {
208
    width: 200
209
  },
210
  attrs: {
211
    clearable: true
212
  },
213
  rules: [{
214
    required: true,
215
    message: 'Please input email address',
216
    trigger: 'blur'
96
97
function editRow(row) {
98
  console.log(row);
99
}
100
const pageData = ref({
101
  title: 'API资源管理',
102
  btns: [{
103
    name: 'add',
104
    onClick: addRole,
105
    label: '新建API资源',
106
    // 是否有边框线
107
    isLine: true,
108
    attrs: {
109
      type: 'primary',
110
      icon: 'Plus',
111
      text: true
112
    }
113
  }],
114
  searchParams: [{
115
    name: 'resourceName',
116
    type: 'input',
117
    label: '资源名称',
118
    value: '',
119
    styles: {
120
      width: 200
121
    },
122
    attrs: {
123
      clearable: true
124
    },
125
    rules: [{
126
      required: true,
127
      message: 'Please input email address',
128
      trigger: 'blur'
129
    },
130
    {
131
      type: 'email',
132
      message: 'Please input correct email address',
133
      trigger: ['blur', 'change']
134
    }]
217 135
  },
218 136
  {
219
    type: 'email',
220
    message: 'Please input correct email address',
221
    trigger: ['blur', 'change']
222
  }]
223
},
224
{
225
  name: 'sourceType',
226
  label: '资源类型',
227
  type: 'select',
228
  attrs: {
229
    clearable: true,
230
    disabled: false,
231
    multiple: true,
232
    options: [
233
      {
137
    name: 'sourceType',
138
    label: '资源类型',
139
    type: 'select',
140
    attrs: {
141
      clearable: true,
142
      disabled: false,
143
      multiple: true,
144
      options: [{
234 145
        label: '资源1',
235 146
        value: 'label'
236 147
      },
237 148
      {
238 149
        label: '资源2',
239 150
        value: 'label2'
240
      },
241
      {
242
        label: '资源3',
243
        value: 'labe3'
244
      },
245
      {
246
        label: '资源4',
247
        value: 'label4'
248
      },
249
      {
250
        label: '资源5',
251
        value: 'label5'
252
      },
253
      {
254
        label: '资源6',
255
        value: 'label6'
256
      }
257
    ]
151
      }]
152
    },
153
    width: 200,
154
    value: []
258 155
  },
259
  width: 200,
260
  value: []
261
},
262
{
263
  name: 'resourceName1',
264
  type: 'input',
265
  width: 200,
266
  attrs: {
267
    disabled: false,
268
    clearable: true
156
  {
157
    name: 'resourceName1',
158
    type: 'input',
159
    width: 200,
160
    attrs: {
161
      disabled: false,
162
      clearable: true
163
    },
164
    label: '资源名称1',
165
    value: ''
166
  }],
167
  formValues: {
168
    resourceName: '',
169
    sourceType: [],
170
    resourceName1: ''
269 171
  },
270
  label: '资源名称1',
271
  value: ''
272
}]);
273
const addRole = () => {
274
  dialogForm.value.drawerData.isOpen = true;
275
};
276
277
// header头按钮组
278
const btns = ref([{
279
  name: 'add',
280
  onClick: addRole,
281
  label: '新建API资源',
282
  // 是否有边框线
283
  isLine: true,
284
  attrs: {
285
    type: 'primary',
286
    icon: 'Plus',
287
    text: true
172
  tableHeader: [
173
    {
174
      label: '资源名称',
175
      name: 'resourceName',
176
      width: '193'
177
    },
178
    {
179
      label: '资源编码',
180
      name: 'resourceId',
181
      width: '193'
182
    },
183
    {
184
      label: '资源类型',
185
      name: 'resourceType',
186
      width: '137'
187
    },
188
    {
189
      label: '所属应用',
190
      name: 'belongApplication',
191
      width: '193'
192
    },
193
    {
194
      label: '资源地址',
195
      name: 'resourceUrl',
196
      width: '217'
197
    },
198
    {
199
      label: '排序',
200
      name: 'sort',
201
      width: '217'
202
    },
203
    {
204
      label: '资源地址',
205
      name: 'resourceUrl',
206
      width: '217'
207
    },
208
    {
209
      label: '输入',
210
      type: 'input',
211
      name: 'input',
212
      width: '217'
213
    },
214
    {
215
      label: '操作',
216
      type: 'custom',
217
      name: 'custom',
218
      width: '217'
219
    }
220
  ],
221
  tableData: tableData.value,
222
  tableBtns: [{
223
    name: 'delete',
224
    onClick: deleteRow,
225
    label: '删除',
226
    // 是否有边框线
227
    isLine: false,
228
    attrs: {
229
      type: 'danger',
230
      text: true
231
    }
232
  },
233
  {
234
    name: 'edit',
235
    onClick: editRow,
236
    label: '编辑',
237
    // 是否有边框线
238
    isLine: false,
239
    attrs: {
240
      text: true
241
    }
242
  }],
243
  page: {
244
    num: 1,
245
    size: 25,
246
    total: 100
288 247
  }
289
}]);
248
});
249
// --------查询资源----------
250
251
// 搜索项
252
function addRole() {
253
  dialogForm.value.drawerData.isOpen = true;
254
}
290 255
291 256
// 搜索
292 257
const search = (data) => {
@ -338,12 +303,7 @@ function confirmDialog(value) {
338 303
}
339 304
const dialogForm = ref({
340 305
  // form返回
341
  formValues: {
342
    roleName: '',
343
    roleCode: '',
344
    roleDescription: '',
345
    clientId: ''
346
  },
306
  formValues: {},
347 307
  // form 属性
348 308
  forms: [{
349 309
    name: 'roleName',
@ -394,9 +354,9 @@ const dialogForm = ref({
394 354
  }
395 355
});
396 356
397
const deleteRow = (row) => {
357
function deleteRow(row) {
398 358
  console.log(row);
399
};
359
}
400 360
401 361
const changeEvent = (form) => {
402 362
  console.log(form);