wui-components-v2 1.0.56 → 1.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ const props = defineProps<{
15
15
  pageType?: string
16
16
  data: Entities
17
17
  rowActions?: rowActions[]
18
- zpaging: any
18
+ zpaging?: any
19
19
  }>()
20
20
  const pageType = ref('')
21
21
  onLoad((option: any) => {
@@ -34,6 +34,8 @@ const groups = ref<Groups>({
34
34
  pointSourceId: '',
35
35
  mstrucId: '',
36
36
  relationNames: [],
37
+ readOnly: false,
38
+ displayConfig: [],
37
39
  })
38
40
  const loading = ref(false)
39
41
  // 折叠面板
@@ -26,7 +26,7 @@ function splitUrlStr(str: string) {
26
26
  {{ item.title }}:
27
27
  </view>
28
28
  <view v-if="item.controlType === 'file' || item.extControlType === 'file' || item.extControlType === 'relfile'" class="flex-1 text-gray-800 dark:text-white">
29
- <wd-img enable-preview :width="100" :height="100" :src="formatItemData(data.fieldMap[item.sourceId], item.extControlType || item.controlType)">
29
+ <wd-img v-if="data.fieldMap[item.sourceId]" enable-preview :width="100" :height="100" :src="formatItemData(data.fieldMap[item.sourceId], item.extControlType || item.controlType)">
30
30
  <template #error>
31
31
  <view class="error-wrap">
32
32
  <wd-button type="text" @click="downloadFile(formatItemData(data.fieldMap[item.sourceId], item.extControlType || item.controlType))">
@@ -0,0 +1,162 @@
1
+ <script setup lang="ts">
2
+ import { defineProps, ref } from 'vue'
3
+ import {
4
+ useMessage,
5
+ } from 'wot-design-uni'
6
+ import { useUser } from '../../composables/useUser'
7
+
8
+ defineOptions({
9
+ name: 'User',
10
+ })
11
+
12
+ const user = useUser().getUserInfo()
13
+ const message = useMessage()
14
+ const userInfo = ref({
15
+ name: user.name,
16
+ nickName: user.nickName,
17
+ // viewPersonalInfoable: user.viewPersonalInfoable,
18
+ })
19
+ // 退出登录
20
+ function quit() {
21
+ message
22
+ .confirm({
23
+ // msg: '提示文案',
24
+ title: '退出登录',
25
+ })
26
+ .then(() => {
27
+ uni.removeStorageSync('token')
28
+ uni.reLaunch({
29
+ url: '/pages/login/index',
30
+ })
31
+ })
32
+ .catch(() => {
33
+ console.log('点击了取消按钮')
34
+ })
35
+ }
36
+
37
+ // 系统设置
38
+ function setting() {
39
+ uni.navigateTo({
40
+ url: '/pages/system-settings/index',
41
+ })
42
+ }
43
+
44
+ // 查看用户信息
45
+ // function goUserInfo() {
46
+ // uni.navigateTo({
47
+ // url: `/pages/detail/index?sourceId=${uni.getStorageSync('userInfo').gtmplSourceId}&id=${uni.getStorageSync('userInfo').id}`,
48
+ // })
49
+ // }
50
+ </script>
51
+
52
+ <template>
53
+ <view class="user">
54
+ <view class="top-box">
55
+ <!-- 用户头部信息 -->
56
+ <view class="user-header">
57
+ <view class="user-info">
58
+ <!-- <img src="user.avatar" class="avatar" alt="用户头像"> -->
59
+ <image class="avatar" src="./user-avatar-fill.png" />
60
+ <view class="user-text">
61
+ <view class="user-name">
62
+ {{ userInfo.name }}
63
+ </view>
64
+ <view class="user-nickname">
65
+ 昵称:{{ userInfo.nickName }}
66
+ </view>
67
+ </view>
68
+ </view>
69
+ </view>
70
+ </view>
71
+
72
+ <wd-cell-group>
73
+ <!-- <wd-cell
74
+ v-if="userInfo.viewPersonalInfoable" title="个人信息" icon="user" :is-link="true" :clickable="true"
75
+ @click="goUserInfo"
76
+ /> -->
77
+ <!-- <wd-cell title="修改密码" icon="keywords" :is-link="true" :clickable="true" /> -->
78
+ <wd-cell title="系统设置" icon="logout" :is-link="true" :clickable="true" @click="setting" />
79
+ <wd-cell title="退出登录" icon="logout" :is-link="true" :clickable="true" @click="quit" />
80
+ </wd-cell-group>
81
+ <wd-message-box />
82
+ </view>
83
+ </template>
84
+
85
+ <style scoped lang="scss">
86
+ .user {
87
+ background-color: #f5f5f5;
88
+ // height: 100vh;
89
+
90
+ .top-box {
91
+ padding: 15px;
92
+
93
+ .user-header {
94
+ border-radius: 10px;
95
+ margin: auto;
96
+ background: linear-gradient(135deg, #4a6cf7 0%, #2541b2 100%);
97
+ color: white;
98
+ padding: 30px 20px;
99
+ box-shadow: 0 4px 12px rgba(74, 108, 247, 0.2);
100
+ position: relative;
101
+ overflow: hidden;
102
+ }
103
+
104
+ .user-header::before {
105
+ content: "";
106
+ position: absolute;
107
+ top: -50px;
108
+ right: -50px;
109
+ width: 150px;
110
+ height: 150px;
111
+ background: rgba(255, 255, 255, 0.1);
112
+ border-radius: 50%;
113
+ }
114
+
115
+ .user-header::after {
116
+ content: "";
117
+ position: absolute;
118
+ bottom: -80px;
119
+ left: -30px;
120
+ width: 200px;
121
+ height: 200px;
122
+ background: rgba(255, 255, 255, 0.05);
123
+ border-radius: 50%;
124
+ }
125
+
126
+ .user-info {
127
+ display: flex;
128
+ align-items: center;
129
+ position: relative;
130
+ z-index: 1;
131
+ }
132
+
133
+ .avatar {
134
+ width: 140rpx;
135
+ height: 140rpx;
136
+ border-radius: 50%;
137
+ border: 3px solid rgba(255, 255, 255, 0.3);
138
+ margin-right: 15px;
139
+ object-fit: cover;
140
+ // background-color: #fff;
141
+ }
142
+
143
+ .user-text {
144
+ flex: 1;
145
+ }
146
+
147
+ .user-name {
148
+ font-size: 20px;
149
+ font-weight: 600;
150
+ margin-bottom: 5px;
151
+ }
152
+
153
+ .user-nickname {
154
+ font-size: 14px;
155
+ opacity: 0.9;
156
+ display: flex;
157
+ align-items: center;
158
+ }
159
+ }
160
+
161
+ }
162
+ </style>
package/index.ts CHANGED
@@ -21,6 +21,7 @@ import editPage from './components/edit-page/edit-page.vue'
21
21
  import detailsPage from './components/details-page/details-page.vue'
22
22
  import UpdateComponent from './components/update-component/update-component.vue'
23
23
  import ScanBindingSensor from './components/scan-binding-sensor/scan-binding-sensor.vue'
24
+ import User from './components/user/user.vue'
24
25
  // 组件列表
25
26
  const coms: Array<{ name: string }> = [
26
27
  SystemSettings,
@@ -36,6 +37,7 @@ const coms: Array<{ name: string }> = [
36
37
  detailsPage,
37
38
  UpdateComponent,
38
39
  ScanBindingSensor,
40
+ User,
39
41
  ]
40
42
 
41
43
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",
package/utils/index.ts CHANGED
@@ -39,14 +39,11 @@ export function formatItemData(data: any, type: string) {
39
39
 
40
40
  if (type === 'file' || type === 'relfile') {
41
41
  if (data) {
42
+ console.log('[Mock] file', data)
42
43
  // 判断是否为JSON文件
43
44
  if (typeof data === 'string') {
44
45
  const a = JSON.parse(data)
45
46
  return `${baseUrl}/v3/files${a.base.path}?@token=${token}&@programToken=${hydrocarbonProgramToken}&name=${a.base.fileName}`
46
- // return {
47
- // url: `${baseUrl}/v3/files${a.base.path}?@token=${token}&@programToken=${hydrocarbonProgramToken}`,
48
- // name: a.base.fileName,
49
- // }
50
47
  }
51
48
  else {
52
49
  return data.url