vue_zhongyou 1.0.7 → 1.0.9
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.
- package/package.json +1 -1
- package//345/212/237/350/203/275/344/273/243/347/240/201/AI/345/257/271/350/257/235/ChatForm.vue +378 -0
- package//345/212/237/350/203/275/344/273/243/347/240/201/AI/345/257/271/350/257/235/DynamicMobileForm.vue +399 -0
- package//345/212/237/350/203/275/344/273/243/347/240/201/AI/345/257/271/350/257/235/aiChatPage.vue +757 -0
- package//345/212/237/350/203/275/344/273/243/347/240/201/AI/345/257/271/350/257/235/newChatCardList.vue +202 -0
- package//346/226/207/346/241/243/ai/346/250/241/345/235/227.md +33 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="chat-card-list">
|
|
3
|
+
<div
|
|
4
|
+
v-for="item in items"
|
|
5
|
+
:key="item.title"
|
|
6
|
+
class="chat-card"
|
|
7
|
+
@click="handleClick(item)"
|
|
8
|
+
>
|
|
9
|
+
<div class="title" v-if="item.title">{{ item.title }}</div>
|
|
10
|
+
<div class="card-header">
|
|
11
|
+
<div class="left-content">
|
|
12
|
+
<div class="subtitle" v-if="item.subtitle">{{ item.subtitle }}</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="right-content">
|
|
15
|
+
<van-tag :type="statusType(item.statusName)">{{ item.statusName }}</van-tag>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="card-info" v-if="item.creator || item.createTime">
|
|
19
|
+
<span class="creator" v-if="item.creator">创建人:{{ item.creator }}</span>
|
|
20
|
+
<span class="time" v-if="item.dpName">部门:{{ item.dpName }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="depart" v-if="item.createTime">
|
|
23
|
+
创建日期:{{ item.createTime }}
|
|
24
|
+
</div>
|
|
25
|
+
<div class="process-node" v-if="item.currentNode">
|
|
26
|
+
当前流程:{{ item.currentNode }}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="load-more" v-if="showLoadMore && !loading" @click="loadMore">
|
|
30
|
+
查看更多
|
|
31
|
+
</div>
|
|
32
|
+
<div class="loading" v-if="loading">
|
|
33
|
+
加载中...
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup>
|
|
40
|
+
import { defineProps, defineEmits, computed } from 'vue'
|
|
41
|
+
const props = defineProps({
|
|
42
|
+
// 聊天卡片列表
|
|
43
|
+
items: {
|
|
44
|
+
type: Array,
|
|
45
|
+
required: true,
|
|
46
|
+
default: () => []
|
|
47
|
+
},
|
|
48
|
+
// 是否显示"查看更多"按钮
|
|
49
|
+
showLoadMore: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
// 每页显示的卡片数量
|
|
54
|
+
pageSize: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 10
|
|
57
|
+
},
|
|
58
|
+
// 当前页码
|
|
59
|
+
currentPage: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 1
|
|
62
|
+
},
|
|
63
|
+
// 是否正在加载
|
|
64
|
+
loading: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
console.log(props);
|
|
70
|
+
|
|
71
|
+
const emit = defineEmits(['item-click', 'load-more'])
|
|
72
|
+
|
|
73
|
+
const statusType = (statusName) => {
|
|
74
|
+
if (['待办','待审'].includes(statusName)) {
|
|
75
|
+
return 'primary'
|
|
76
|
+
} else if (['草稿'].includes(statusName)) {
|
|
77
|
+
return 'info'
|
|
78
|
+
} else if (['已完成'].includes(statusName)) {
|
|
79
|
+
return 'success'
|
|
80
|
+
} else if (['驳回'].includes(statusName)) {
|
|
81
|
+
return 'danger'
|
|
82
|
+
} else {
|
|
83
|
+
return 'default'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const handleClick = (item) => {
|
|
88
|
+
emit('item-click', item)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const loadMore = () => {
|
|
92
|
+
emit('load-more')
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style lang='scss' scoped>
|
|
98
|
+
|
|
99
|
+
.chat-card{
|
|
100
|
+
background: #f7f7f9;
|
|
101
|
+
border-radius: 12px;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
padding: 12px;
|
|
104
|
+
box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.1);
|
|
105
|
+
transition: all 0.3s ease;
|
|
106
|
+
margin-bottom: 16px;
|
|
107
|
+
&:active {
|
|
108
|
+
transform: scale(0.98);
|
|
109
|
+
}
|
|
110
|
+
.title {
|
|
111
|
+
font-size: 16px;
|
|
112
|
+
font-weight: 500;
|
|
113
|
+
color: #2c3e50;
|
|
114
|
+
margin-bottom: 4px;
|
|
115
|
+
line-height: 1.4;
|
|
116
|
+
display: -webkit-box;
|
|
117
|
+
-webkit-box-orient: vertical;
|
|
118
|
+
-webkit-line-clamp: 2;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
.card-header{
|
|
124
|
+
display: flex;
|
|
125
|
+
justify-content: space-between;
|
|
126
|
+
align-items: flex-end;
|
|
127
|
+
.left-content{
|
|
128
|
+
flex:1;
|
|
129
|
+
.subtitle {
|
|
130
|
+
font-size: 13px;
|
|
131
|
+
color: #7f8c8d;
|
|
132
|
+
line-height: 1.4;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
.right-content{
|
|
136
|
+
width: 50px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.card-info {
|
|
141
|
+
display: flex;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
border-top: 1px solid #e1e8ed;
|
|
144
|
+
font-size: 12px;
|
|
145
|
+
color: #555;
|
|
146
|
+
margin-top: 8px;
|
|
147
|
+
padding: 4px 0;
|
|
148
|
+
|
|
149
|
+
.creator, .time {
|
|
150
|
+
flex: 1;
|
|
151
|
+
overflow: hidden;
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
text-overflow: ellipsis;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.creator {
|
|
157
|
+
margin-right: 10px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.process-node {
|
|
162
|
+
font-size: 12px;
|
|
163
|
+
border-radius: 4px;
|
|
164
|
+
padding: 4px 0px;
|
|
165
|
+
max-width: calc(100% - 24px);
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
white-space: nowrap;
|
|
168
|
+
text-overflow: ellipsis;
|
|
169
|
+
}
|
|
170
|
+
.depart {
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
border-radius: 4px;
|
|
173
|
+
padding: 4px 0px;
|
|
174
|
+
max-width: calc(100% - 24px);
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
white-space: nowrap;
|
|
177
|
+
text-overflow: ellipsis;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
.load-more {
|
|
181
|
+
text-align: center;
|
|
182
|
+
padding: 12px 0;
|
|
183
|
+
color: #1989fa;
|
|
184
|
+
font-size: 14px;
|
|
185
|
+
border-radius: 8px;
|
|
186
|
+
margin: 16px 0;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
user-select: none;
|
|
189
|
+
|
|
190
|
+
&:active {
|
|
191
|
+
opacity: 0.8;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.loading {
|
|
196
|
+
text-align: center;
|
|
197
|
+
padding: 12px 0;
|
|
198
|
+
color: #999;
|
|
199
|
+
font-size: 14px;
|
|
200
|
+
margin: 16px 0;
|
|
201
|
+
}
|
|
202
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
### 前端模块
|
|
2
|
+
1、表单模块
|
|
3
|
+
前端封装一个json表单,根据json内容生产对应表单项
|
|
4
|
+
例如:
|
|
5
|
+
```js
|
|
6
|
+
[
|
|
7
|
+
{
|
|
8
|
+
type: 'input',
|
|
9
|
+
field: 'title',
|
|
10
|
+
value: ''
|
|
11
|
+
label: '公文标题',
|
|
12
|
+
placeholder: '请输入标题',
|
|
13
|
+
rules: [
|
|
14
|
+
{ required: true, message: '请输入标题' }
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: 'select',
|
|
19
|
+
field: 'category',
|
|
20
|
+
value: 'notice'
|
|
21
|
+
label: '公文类型',
|
|
22
|
+
placeholder: '请选择类型',
|
|
23
|
+
options: [
|
|
24
|
+
{ label: '通知', value: 'notice' },
|
|
25
|
+
{ label: '通报', value: 'circular' },
|
|
26
|
+
{ label: '请示', value: 'request' }
|
|
27
|
+
],
|
|
28
|
+
rules: [{ required: true, message: '请选择类型' }]
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2、卡片模块
|