vue2-client 1.6.28 → 1.6.30
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/CHANGELOG.md +582 -579
- package/index.js +30 -30
- package/package.json +1 -1
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +4 -1
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +115 -113
- package/src/base-client/components/common/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +1 -1
- package/src/base-client/components/common/XAddForm/XAddForm.vue +326 -326
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XForm/XForm.vue +180 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +591 -591
- package/src/base-client/components/common/XFormTable/XFormTable.vue +336 -336
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +46 -46
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/exception/404.vue +25 -25
- package/src/pages/login/Login.vue +365 -365
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +68 -68
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +64 -64
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +47 -47
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/map-utils.js +3 -3
- package/src/utils/request.js +311 -311
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,317 +1,317 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-card :bordered="false">
|
|
4
|
-
<a-row>
|
|
5
|
-
<a-col :sm="8" :xs="24">
|
|
6
|
-
<info :bordered="true" :value="`${this.coll.filesNum}个文件`" title="所有文件数量"/>
|
|
7
|
-
</a-col>
|
|
8
|
-
<a-col :sm="8" :xs="24">
|
|
9
|
-
<info :bordered="true" :value="`${this.coll.weekFiles}个文件`" title="本周上传文件数量"/>
|
|
10
|
-
</a-col>
|
|
11
|
-
<a-col :sm="8" :xs="24">
|
|
12
|
-
<info :value="`${this.coll.fileSize} mb`" title="储存用量"/>
|
|
13
|
-
</a-col>
|
|
14
|
-
</a-row>
|
|
15
|
-
</a-card>
|
|
16
|
-
<a-card
|
|
17
|
-
:bordered="false"
|
|
18
|
-
style="margin-top: 24px"
|
|
19
|
-
title="文件仓库列表">
|
|
20
|
-
<div v-show="!loading" class="operate">
|
|
21
|
-
<a-button icon="plus" style="width: 100%" type="dashed" @click="add_edit">添加</a-button>
|
|
22
|
-
</div>
|
|
23
|
-
<a-list :loading="loading" size="large">
|
|
24
|
-
<a-list-item v-for="(item, index) in data" :key="index">
|
|
25
|
-
<a-list-item-meta :description="item.f_describe">
|
|
26
|
-
<a-avatar
|
|
27
|
-
slot="avatar"
|
|
28
|
-
:icon="item.f_stock_type ==='oss'?'cloud-server':'hdd'"
|
|
29
|
-
:style="{ backgroundColor: '#1890ff', color: item.progress?'rgba(255,255,255)':'rgba(255,255,255, 0.50)' }"
|
|
30
|
-
shape="square"
|
|
31
|
-
size="large"
|
|
32
|
-
/>
|
|
33
|
-
<a slot="title">{{ item.f_name }}</a>
|
|
34
|
-
</a-list-item-meta>
|
|
35
|
-
<div slot="actions">
|
|
36
|
-
<a-button
|
|
37
|
-
block
|
|
38
|
-
type="link"
|
|
39
|
-
@click="add_edit(item)">
|
|
40
|
-
编辑
|
|
41
|
-
</a-button>
|
|
42
|
-
</div>
|
|
43
|
-
<div
|
|
44
|
-
class="
|
|
45
|
-
list-content">
|
|
46
|
-
<div class="list-content-item" style="width: 150px">
|
|
47
|
-
<span style="color:rgba(0,0,0, 0.65)">仓库类型</span>
|
|
48
|
-
<p>{{ item.f_stock_type }}</p>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="list-content-item" style="width: 150px">
|
|
51
|
-
<span style="color:rgba(0,0,0, 0.65)">根目录</span>
|
|
52
|
-
<p>{{ item.f_root_path }}{{ item.f_alias }}</p>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="list-content-item" style="width: 150px">
|
|
55
|
-
<span style="color:rgba(0,0,0, 0.65)">文件大小</span>
|
|
56
|
-
<p>{{ item.file_size }} mb</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="list-content-item">
|
|
59
|
-
<a-progress :percent="Number(item.progress.toFixed(2))" style="width: 180px"/>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</a-list-item>
|
|
63
|
-
</a-list>
|
|
64
|
-
<a-modal
|
|
65
|
-
:maskClosable="false"
|
|
66
|
-
:title="form.id ? '修改仓库信息':'新增仓库信息'"
|
|
67
|
-
:visible="visible"
|
|
68
|
-
@cancel="handleCancel"
|
|
69
|
-
@ok="handleOk"
|
|
70
|
-
>
|
|
71
|
-
<a-form-model
|
|
72
|
-
ref="formModel"
|
|
73
|
-
:model="form"
|
|
74
|
-
:rules="itemRules"
|
|
75
|
-
layout="vertical">
|
|
76
|
-
<a-row :gutter="24">
|
|
77
|
-
<a-col :span="12">
|
|
78
|
-
<a-form-model-item label="仓库名称" prop="f_name">
|
|
79
|
-
<a-input v-model="form.f_name" placeholder="仓库名称"/>
|
|
80
|
-
</a-form-model-item>
|
|
81
|
-
</a-col>
|
|
82
|
-
<!-- <a-col :span="12">-->
|
|
83
|
-
<!-- <a-form-model-item label="仓库别名" prop="f_alias">-->
|
|
84
|
-
<!-- <a-input placeholder="仓库名称" v-model="form.f_alias"/>-->
|
|
85
|
-
<!-- </a-form-model-item>-->
|
|
86
|
-
<!-- </a-col>-->
|
|
87
|
-
<a-col :span="12">
|
|
88
|
-
<a-form-model-item
|
|
89
|
-
label="仓库类型"
|
|
90
|
-
prop="f_stock_type">
|
|
91
|
-
<a-select v-model="form.f_stock_type">
|
|
92
|
-
<a-select-option key="server">服务器</a-select-option>
|
|
93
|
-
<a-select-option key="oss">对象存储</a-select-option>
|
|
94
|
-
</a-select>
|
|
95
|
-
</a-form-model-item>
|
|
96
|
-
</a-col>
|
|
97
|
-
<a-col :span="24">
|
|
98
|
-
|
|
99
|
-
<a-form-model-item
|
|
100
|
-
label="根目录"
|
|
101
|
-
prop="f_alias">
|
|
102
|
-
<a-input v-model="form.f_alias" placeholder="根目录" @blur="aliasBlur">
|
|
103
|
-
<!-- TODO 先这么写单独文件服务出来后根据文件地址服务写 -->
|
|
104
|
-
<a-select slot="addonBefore" v-model="form.f_root_path" default-value="D:\nginx-resource\" style="width: 13rem">
|
|
105
|
-
<a-select-option value="D:\nginx-resource\">
|
|
106
|
-
D:\nginx-resource\
|
|
107
|
-
</a-select-option>
|
|
108
|
-
</a-select>
|
|
109
|
-
</a-input>
|
|
110
|
-
</a-form-model-item>
|
|
111
|
-
</a-col>
|
|
112
|
-
</a-row>
|
|
113
|
-
<a-row v-for="(item,index) in form.f_lower_path_json" :key="index" :gutter="24">
|
|
114
|
-
<a-col :span="12">
|
|
115
|
-
<a-form-model-item :label="`扩展路径 ${index+1}`">
|
|
116
|
-
<a-popconfirm
|
|
117
|
-
:visible="pop_visible[index]"
|
|
118
|
-
cancel-text="取消"
|
|
119
|
-
ok-text="确认"
|
|
120
|
-
placement="topLeft"
|
|
121
|
-
title="是否要删除此条扩展路径"
|
|
122
|
-
@cancel="refresh_pop()"
|
|
123
|
-
@confirm="executeDelLower(index)"
|
|
124
|
-
>
|
|
125
|
-
<a-icon slot="icon" style="color: red" type="question-circle-o"/>
|
|
126
|
-
<a-input
|
|
127
|
-
v-model="form.f_lower_path_json[index].value"
|
|
128
|
-
placeholder="扩展路径"
|
|
129
|
-
@keydown.delete="delLower(index)"
|
|
130
|
-
@keydown.enter="delLower(index,'enter')"/>
|
|
131
|
-
</a-popconfirm>
|
|
132
|
-
</a-form-model-item>
|
|
133
|
-
</a-col>
|
|
134
|
-
<a-col :span="12">
|
|
135
|
-
<a-form-model-item :label="`扩展路径 ${index+1} 描述`">
|
|
136
|
-
<a-input v-model="form.f_lower_path_json[index].label" placeholder="扩展路径描述"/>
|
|
137
|
-
</a-form-model-item>
|
|
138
|
-
</a-col>
|
|
139
|
-
</a-row>
|
|
140
|
-
<a-form-item>
|
|
141
|
-
<a-button style="width: 100%" type="dashed" @click="addLower">
|
|
142
|
-
<a-icon type="plus"/>
|
|
143
|
-
添加一个扩展路径
|
|
144
|
-
</a-button>
|
|
145
|
-
</a-form-item>
|
|
146
|
-
<a-form-item>
|
|
147
|
-
<a-input v-model="form.f_describe" placeholder="仓库描述"/>
|
|
148
|
-
</a-form-item>
|
|
149
|
-
</a-form-model>
|
|
150
|
-
</a-modal>
|
|
151
|
-
</a-card>
|
|
152
|
-
</div>
|
|
153
|
-
</template>
|
|
154
|
-
|
|
155
|
-
<script>
|
|
156
|
-
import Info from './Info'
|
|
157
|
-
import { post } from '@vue2-client/services/api/restTools'
|
|
158
|
-
|
|
159
|
-
export default {
|
|
160
|
-
name: 'FileManager',
|
|
161
|
-
components: { Info },
|
|
162
|
-
data () {
|
|
163
|
-
return {
|
|
164
|
-
data: [],
|
|
165
|
-
visible: false,
|
|
166
|
-
rules: '',
|
|
167
|
-
coll: {
|
|
168
|
-
filesNum: 0,
|
|
169
|
-
fileSize: 0,
|
|
170
|
-
weekFiles: 0
|
|
171
|
-
},
|
|
172
|
-
loading: false,
|
|
173
|
-
form: {
|
|
174
|
-
f_name: '',
|
|
175
|
-
f_alias: '',
|
|
176
|
-
f_describe: '',
|
|
177
|
-
f_stock_type: 'server',
|
|
178
|
-
f_root_path: '',
|
|
179
|
-
f_lower_path_json: [],
|
|
180
|
-
f_lower_path_vec: []
|
|
181
|
-
},
|
|
182
|
-
pop_visible: [],
|
|
183
|
-
itemRules: {
|
|
184
|
-
f_name: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }],
|
|
185
|
-
f_alias: [{ required: true, message: '仓库根目录路径不正确', pattern: /^((?:[a-zA-Z0-9]+\\?)*)$/, trigger: 'blur' }],
|
|
186
|
-
f_stock_type: [{ required: true, message: '请选择仓库类型', trigger: 'blur' }],
|
|
187
|
-
},
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
mounted () {
|
|
191
|
-
this.getStockList()
|
|
192
|
-
},
|
|
193
|
-
methods: {
|
|
194
|
-
// 请求仓库列表
|
|
195
|
-
getStockList () {
|
|
196
|
-
this.loading = true
|
|
197
|
-
// 请求仓库列表
|
|
198
|
-
post('/api/af-system/logic/getFilesStock', {}).then(res => {
|
|
199
|
-
this.data = res.sort((a, b) => a.progress - b.progress)
|
|
200
|
-
// 请求仓库列表
|
|
201
|
-
post('/api/af-system/logic/getFilesColl', {}).then(res => {
|
|
202
|
-
this.coll = res
|
|
203
|
-
this.loading = false
|
|
204
|
-
})
|
|
205
|
-
})
|
|
206
|
-
.catch(e => {
|
|
207
|
-
})
|
|
208
|
-
},
|
|
209
|
-
// 添加扩展路径
|
|
210
|
-
addLower () {
|
|
211
|
-
this.form.f_lower_path_json.push({ label: '', value: '' })
|
|
212
|
-
this.refresh_pop()
|
|
213
|
-
},
|
|
214
|
-
delLower (index, type) {
|
|
215
|
-
if (this.pop_visible[index]) {
|
|
216
|
-
// 如果提示框打开则直接删除
|
|
217
|
-
if (type === 'enter') {
|
|
218
|
-
this.executeDelLower(index)
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
// 否则提示
|
|
222
|
-
if (!this.form.f_lower_path_json[index].value) {
|
|
223
|
-
this.pop_visible[index] = true
|
|
224
|
-
this.pop_visible = JSON.parse(JSON.stringify(this.pop_visible))
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
// 删除扩展路径
|
|
229
|
-
executeDelLower (index) {
|
|
230
|
-
if (!this.form.f_lower_path_json[index].value) {
|
|
231
|
-
this.form.f_lower_path_json.splice(index, 1)
|
|
232
|
-
}
|
|
233
|
-
this.refresh_pop()
|
|
234
|
-
},
|
|
235
|
-
// 刷新 控制删除提示框的 数组
|
|
236
|
-
refresh_pop () {
|
|
237
|
-
this.pop_visible = Array(this.form.f_lower_path_json.length).fill(false)
|
|
238
|
-
},
|
|
239
|
-
add_edit (item = {}) {
|
|
240
|
-
// todo 添加或者修改
|
|
241
|
-
this.form = Object.assign({
|
|
242
|
-
f_name: '',
|
|
243
|
-
f_alias: '',
|
|
244
|
-
f_describe: '',
|
|
245
|
-
f_stock_type: 'server',
|
|
246
|
-
f_root_path: '',
|
|
247
|
-
f_lower_path_json: [],
|
|
248
|
-
f_lower_path_vec: []
|
|
249
|
-
}, item)
|
|
250
|
-
this.visible = true
|
|
251
|
-
},
|
|
252
|
-
handleOk () {
|
|
253
|
-
this.$refs.formModel.validate(valid => {
|
|
254
|
-
if (valid) {
|
|
255
|
-
const countLower = this.form.f_lower_path_json.filter(item => !/^[A-Za-z]+$/.test(item.value))
|
|
256
|
-
if (countLower.length > 0) {
|
|
257
|
-
this.$message.error(`${countLower.map(item => item.label).join(';')},输入不合法,扩展路径应仅有大小写字母构成`)
|
|
258
|
-
return
|
|
259
|
-
}
|
|
260
|
-
const server = this.form.f_stock_type === 'server' && /^[a-zA-Z]:\\(?:\w+\\?)*$/.test(this.form.f_root_path)
|
|
261
|
-
const cloud = this.form.f_stock_type === 'oss' && /^\/(?:[^/]+\/)*$/.test(this.form.f_root_path)
|
|
262
|
-
if (!(server || cloud)) {
|
|
263
|
-
this.$message.error(`${this.form.f_stock_type === 'server' ? '根目录路径不正确,示例:E:\\demo' : '根目录路径不正确,示例:/img-1251014762/blog'}`)
|
|
264
|
-
return
|
|
265
|
-
}
|
|
266
|
-
this.submitStock()
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
},
|
|
270
|
-
submitStock () {
|
|
271
|
-
// 保存仓库信息
|
|
272
|
-
post('/api/af-system/entity/t_files_manager', this.form).then(res => {
|
|
273
|
-
this.$message.success('提交成功')
|
|
274
|
-
this.visible = false
|
|
275
|
-
this.getStockList()
|
|
276
|
-
}).catch(e => {
|
|
277
|
-
})
|
|
278
|
-
// todo
|
|
279
|
-
},
|
|
280
|
-
handleCancel () {
|
|
281
|
-
this.visible = !this.visible
|
|
282
|
-
this.$refs.formModel.resetFields()
|
|
283
|
-
},
|
|
284
|
-
aliasBlur () {
|
|
285
|
-
if (this.form.f_alias.substr(this.form.f_alias.length - 1, this.form.f_alias.length) === '\\') {
|
|
286
|
-
this.form.f_alias = this.form.f_alias.substr(0, this.form.f_alias.length - 1)
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
</script>
|
|
292
|
-
|
|
293
|
-
<style lang="less" scoped>
|
|
294
|
-
.ant-avatar-lg {
|
|
295
|
-
width: 48px;
|
|
296
|
-
height: 48px;
|
|
297
|
-
line-height: 48px;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.list-content-item {
|
|
301
|
-
color: rgba(0, 0, 0, .45);
|
|
302
|
-
display: inline-block;
|
|
303
|
-
vertical-align: middle;
|
|
304
|
-
font-size: 14px;
|
|
305
|
-
margin-left: 40px;
|
|
306
|
-
|
|
307
|
-
span {
|
|
308
|
-
line-height: 20px;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
p {
|
|
312
|
-
margin-top: 4px;
|
|
313
|
-
margin-bottom: 0;
|
|
314
|
-
line-height: 22px;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-card :bordered="false">
|
|
4
|
+
<a-row>
|
|
5
|
+
<a-col :sm="8" :xs="24">
|
|
6
|
+
<info :bordered="true" :value="`${this.coll.filesNum}个文件`" title="所有文件数量"/>
|
|
7
|
+
</a-col>
|
|
8
|
+
<a-col :sm="8" :xs="24">
|
|
9
|
+
<info :bordered="true" :value="`${this.coll.weekFiles}个文件`" title="本周上传文件数量"/>
|
|
10
|
+
</a-col>
|
|
11
|
+
<a-col :sm="8" :xs="24">
|
|
12
|
+
<info :value="`${this.coll.fileSize} mb`" title="储存用量"/>
|
|
13
|
+
</a-col>
|
|
14
|
+
</a-row>
|
|
15
|
+
</a-card>
|
|
16
|
+
<a-card
|
|
17
|
+
:bordered="false"
|
|
18
|
+
style="margin-top: 24px"
|
|
19
|
+
title="文件仓库列表">
|
|
20
|
+
<div v-show="!loading" class="operate">
|
|
21
|
+
<a-button icon="plus" style="width: 100%" type="dashed" @click="add_edit">添加</a-button>
|
|
22
|
+
</div>
|
|
23
|
+
<a-list :loading="loading" size="large">
|
|
24
|
+
<a-list-item v-for="(item, index) in data" :key="index">
|
|
25
|
+
<a-list-item-meta :description="item.f_describe">
|
|
26
|
+
<a-avatar
|
|
27
|
+
slot="avatar"
|
|
28
|
+
:icon="item.f_stock_type ==='oss'?'cloud-server':'hdd'"
|
|
29
|
+
:style="{ backgroundColor: '#1890ff', color: item.progress?'rgba(255,255,255)':'rgba(255,255,255, 0.50)' }"
|
|
30
|
+
shape="square"
|
|
31
|
+
size="large"
|
|
32
|
+
/>
|
|
33
|
+
<a slot="title">{{ item.f_name }}</a>
|
|
34
|
+
</a-list-item-meta>
|
|
35
|
+
<div slot="actions">
|
|
36
|
+
<a-button
|
|
37
|
+
block
|
|
38
|
+
type="link"
|
|
39
|
+
@click="add_edit(item)">
|
|
40
|
+
编辑
|
|
41
|
+
</a-button>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
class="
|
|
45
|
+
list-content">
|
|
46
|
+
<div class="list-content-item" style="width: 150px">
|
|
47
|
+
<span style="color:rgba(0,0,0, 0.65)">仓库类型</span>
|
|
48
|
+
<p>{{ item.f_stock_type }}</p>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="list-content-item" style="width: 150px">
|
|
51
|
+
<span style="color:rgba(0,0,0, 0.65)">根目录</span>
|
|
52
|
+
<p>{{ item.f_root_path }}{{ item.f_alias }}</p>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="list-content-item" style="width: 150px">
|
|
55
|
+
<span style="color:rgba(0,0,0, 0.65)">文件大小</span>
|
|
56
|
+
<p>{{ item.file_size }} mb</p>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="list-content-item">
|
|
59
|
+
<a-progress :percent="Number(item.progress.toFixed(2))" style="width: 180px"/>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</a-list-item>
|
|
63
|
+
</a-list>
|
|
64
|
+
<a-modal
|
|
65
|
+
:maskClosable="false"
|
|
66
|
+
:title="form.id ? '修改仓库信息':'新增仓库信息'"
|
|
67
|
+
:visible="visible"
|
|
68
|
+
@cancel="handleCancel"
|
|
69
|
+
@ok="handleOk"
|
|
70
|
+
>
|
|
71
|
+
<a-form-model
|
|
72
|
+
ref="formModel"
|
|
73
|
+
:model="form"
|
|
74
|
+
:rules="itemRules"
|
|
75
|
+
layout="vertical">
|
|
76
|
+
<a-row :gutter="24">
|
|
77
|
+
<a-col :span="12">
|
|
78
|
+
<a-form-model-item label="仓库名称" prop="f_name">
|
|
79
|
+
<a-input v-model="form.f_name" placeholder="仓库名称"/>
|
|
80
|
+
</a-form-model-item>
|
|
81
|
+
</a-col>
|
|
82
|
+
<!-- <a-col :span="12">-->
|
|
83
|
+
<!-- <a-form-model-item label="仓库别名" prop="f_alias">-->
|
|
84
|
+
<!-- <a-input placeholder="仓库名称" v-model="form.f_alias"/>-->
|
|
85
|
+
<!-- </a-form-model-item>-->
|
|
86
|
+
<!-- </a-col>-->
|
|
87
|
+
<a-col :span="12">
|
|
88
|
+
<a-form-model-item
|
|
89
|
+
label="仓库类型"
|
|
90
|
+
prop="f_stock_type">
|
|
91
|
+
<a-select v-model="form.f_stock_type">
|
|
92
|
+
<a-select-option key="server">服务器</a-select-option>
|
|
93
|
+
<a-select-option key="oss">对象存储</a-select-option>
|
|
94
|
+
</a-select>
|
|
95
|
+
</a-form-model-item>
|
|
96
|
+
</a-col>
|
|
97
|
+
<a-col :span="24">
|
|
98
|
+
|
|
99
|
+
<a-form-model-item
|
|
100
|
+
label="根目录"
|
|
101
|
+
prop="f_alias">
|
|
102
|
+
<a-input v-model="form.f_alias" placeholder="根目录" @blur="aliasBlur">
|
|
103
|
+
<!-- TODO 先这么写单独文件服务出来后根据文件地址服务写 -->
|
|
104
|
+
<a-select slot="addonBefore" v-model="form.f_root_path" default-value="D:\nginx-resource\" style="width: 13rem">
|
|
105
|
+
<a-select-option value="D:\nginx-resource\">
|
|
106
|
+
D:\nginx-resource\
|
|
107
|
+
</a-select-option>
|
|
108
|
+
</a-select>
|
|
109
|
+
</a-input>
|
|
110
|
+
</a-form-model-item>
|
|
111
|
+
</a-col>
|
|
112
|
+
</a-row>
|
|
113
|
+
<a-row v-for="(item,index) in form.f_lower_path_json" :key="index" :gutter="24">
|
|
114
|
+
<a-col :span="12">
|
|
115
|
+
<a-form-model-item :label="`扩展路径 ${index+1}`">
|
|
116
|
+
<a-popconfirm
|
|
117
|
+
:visible="pop_visible[index]"
|
|
118
|
+
cancel-text="取消"
|
|
119
|
+
ok-text="确认"
|
|
120
|
+
placement="topLeft"
|
|
121
|
+
title="是否要删除此条扩展路径"
|
|
122
|
+
@cancel="refresh_pop()"
|
|
123
|
+
@confirm="executeDelLower(index)"
|
|
124
|
+
>
|
|
125
|
+
<a-icon slot="icon" style="color: red" type="question-circle-o"/>
|
|
126
|
+
<a-input
|
|
127
|
+
v-model="form.f_lower_path_json[index].value"
|
|
128
|
+
placeholder="扩展路径"
|
|
129
|
+
@keydown.delete="delLower(index)"
|
|
130
|
+
@keydown.enter="delLower(index,'enter')"/>
|
|
131
|
+
</a-popconfirm>
|
|
132
|
+
</a-form-model-item>
|
|
133
|
+
</a-col>
|
|
134
|
+
<a-col :span="12">
|
|
135
|
+
<a-form-model-item :label="`扩展路径 ${index+1} 描述`">
|
|
136
|
+
<a-input v-model="form.f_lower_path_json[index].label" placeholder="扩展路径描述"/>
|
|
137
|
+
</a-form-model-item>
|
|
138
|
+
</a-col>
|
|
139
|
+
</a-row>
|
|
140
|
+
<a-form-item>
|
|
141
|
+
<a-button style="width: 100%" type="dashed" @click="addLower">
|
|
142
|
+
<a-icon type="plus"/>
|
|
143
|
+
添加一个扩展路径
|
|
144
|
+
</a-button>
|
|
145
|
+
</a-form-item>
|
|
146
|
+
<a-form-item>
|
|
147
|
+
<a-input v-model="form.f_describe" placeholder="仓库描述"/>
|
|
148
|
+
</a-form-item>
|
|
149
|
+
</a-form-model>
|
|
150
|
+
</a-modal>
|
|
151
|
+
</a-card>
|
|
152
|
+
</div>
|
|
153
|
+
</template>
|
|
154
|
+
|
|
155
|
+
<script>
|
|
156
|
+
import Info from './Info'
|
|
157
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
158
|
+
|
|
159
|
+
export default {
|
|
160
|
+
name: 'FileManager',
|
|
161
|
+
components: { Info },
|
|
162
|
+
data () {
|
|
163
|
+
return {
|
|
164
|
+
data: [],
|
|
165
|
+
visible: false,
|
|
166
|
+
rules: '',
|
|
167
|
+
coll: {
|
|
168
|
+
filesNum: 0,
|
|
169
|
+
fileSize: 0,
|
|
170
|
+
weekFiles: 0
|
|
171
|
+
},
|
|
172
|
+
loading: false,
|
|
173
|
+
form: {
|
|
174
|
+
f_name: '',
|
|
175
|
+
f_alias: '',
|
|
176
|
+
f_describe: '',
|
|
177
|
+
f_stock_type: 'server',
|
|
178
|
+
f_root_path: '',
|
|
179
|
+
f_lower_path_json: [],
|
|
180
|
+
f_lower_path_vec: []
|
|
181
|
+
},
|
|
182
|
+
pop_visible: [],
|
|
183
|
+
itemRules: {
|
|
184
|
+
f_name: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }],
|
|
185
|
+
f_alias: [{ required: true, message: '仓库根目录路径不正确', pattern: /^((?:[a-zA-Z0-9]+\\?)*)$/, trigger: 'blur' }],
|
|
186
|
+
f_stock_type: [{ required: true, message: '请选择仓库类型', trigger: 'blur' }],
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
mounted () {
|
|
191
|
+
this.getStockList()
|
|
192
|
+
},
|
|
193
|
+
methods: {
|
|
194
|
+
// 请求仓库列表
|
|
195
|
+
getStockList () {
|
|
196
|
+
this.loading = true
|
|
197
|
+
// 请求仓库列表
|
|
198
|
+
post('/api/af-system/logic/getFilesStock', {}).then(res => {
|
|
199
|
+
this.data = res.sort((a, b) => a.progress - b.progress)
|
|
200
|
+
// 请求仓库列表
|
|
201
|
+
post('/api/af-system/logic/getFilesColl', {}).then(res => {
|
|
202
|
+
this.coll = res
|
|
203
|
+
this.loading = false
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
.catch(e => {
|
|
207
|
+
})
|
|
208
|
+
},
|
|
209
|
+
// 添加扩展路径
|
|
210
|
+
addLower () {
|
|
211
|
+
this.form.f_lower_path_json.push({ label: '', value: '' })
|
|
212
|
+
this.refresh_pop()
|
|
213
|
+
},
|
|
214
|
+
delLower (index, type) {
|
|
215
|
+
if (this.pop_visible[index]) {
|
|
216
|
+
// 如果提示框打开则直接删除
|
|
217
|
+
if (type === 'enter') {
|
|
218
|
+
this.executeDelLower(index)
|
|
219
|
+
}
|
|
220
|
+
} else {
|
|
221
|
+
// 否则提示
|
|
222
|
+
if (!this.form.f_lower_path_json[index].value) {
|
|
223
|
+
this.pop_visible[index] = true
|
|
224
|
+
this.pop_visible = JSON.parse(JSON.stringify(this.pop_visible))
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
// 删除扩展路径
|
|
229
|
+
executeDelLower (index) {
|
|
230
|
+
if (!this.form.f_lower_path_json[index].value) {
|
|
231
|
+
this.form.f_lower_path_json.splice(index, 1)
|
|
232
|
+
}
|
|
233
|
+
this.refresh_pop()
|
|
234
|
+
},
|
|
235
|
+
// 刷新 控制删除提示框的 数组
|
|
236
|
+
refresh_pop () {
|
|
237
|
+
this.pop_visible = Array(this.form.f_lower_path_json.length).fill(false)
|
|
238
|
+
},
|
|
239
|
+
add_edit (item = {}) {
|
|
240
|
+
// todo 添加或者修改
|
|
241
|
+
this.form = Object.assign({
|
|
242
|
+
f_name: '',
|
|
243
|
+
f_alias: '',
|
|
244
|
+
f_describe: '',
|
|
245
|
+
f_stock_type: 'server',
|
|
246
|
+
f_root_path: '',
|
|
247
|
+
f_lower_path_json: [],
|
|
248
|
+
f_lower_path_vec: []
|
|
249
|
+
}, item)
|
|
250
|
+
this.visible = true
|
|
251
|
+
},
|
|
252
|
+
handleOk () {
|
|
253
|
+
this.$refs.formModel.validate(valid => {
|
|
254
|
+
if (valid) {
|
|
255
|
+
const countLower = this.form.f_lower_path_json.filter(item => !/^[A-Za-z]+$/.test(item.value))
|
|
256
|
+
if (countLower.length > 0) {
|
|
257
|
+
this.$message.error(`${countLower.map(item => item.label).join(';')},输入不合法,扩展路径应仅有大小写字母构成`)
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
const server = this.form.f_stock_type === 'server' && /^[a-zA-Z]:\\(?:\w+\\?)*$/.test(this.form.f_root_path)
|
|
261
|
+
const cloud = this.form.f_stock_type === 'oss' && /^\/(?:[^/]+\/)*$/.test(this.form.f_root_path)
|
|
262
|
+
if (!(server || cloud)) {
|
|
263
|
+
this.$message.error(`${this.form.f_stock_type === 'server' ? '根目录路径不正确,示例:E:\\demo' : '根目录路径不正确,示例:/img-1251014762/blog'}`)
|
|
264
|
+
return
|
|
265
|
+
}
|
|
266
|
+
this.submitStock()
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
},
|
|
270
|
+
submitStock () {
|
|
271
|
+
// 保存仓库信息
|
|
272
|
+
post('/api/af-system/entity/t_files_manager', this.form).then(res => {
|
|
273
|
+
this.$message.success('提交成功')
|
|
274
|
+
this.visible = false
|
|
275
|
+
this.getStockList()
|
|
276
|
+
}).catch(e => {
|
|
277
|
+
})
|
|
278
|
+
// todo
|
|
279
|
+
},
|
|
280
|
+
handleCancel () {
|
|
281
|
+
this.visible = !this.visible
|
|
282
|
+
this.$refs.formModel.resetFields()
|
|
283
|
+
},
|
|
284
|
+
aliasBlur () {
|
|
285
|
+
if (this.form.f_alias.substr(this.form.f_alias.length - 1, this.form.f_alias.length) === '\\') {
|
|
286
|
+
this.form.f_alias = this.form.f_alias.substr(0, this.form.f_alias.length - 1)
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
</script>
|
|
292
|
+
|
|
293
|
+
<style lang="less" scoped>
|
|
294
|
+
.ant-avatar-lg {
|
|
295
|
+
width: 48px;
|
|
296
|
+
height: 48px;
|
|
297
|
+
line-height: 48px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.list-content-item {
|
|
301
|
+
color: rgba(0, 0, 0, .45);
|
|
302
|
+
display: inline-block;
|
|
303
|
+
vertical-align: middle;
|
|
304
|
+
font-size: 14px;
|
|
305
|
+
margin-left: 40px;
|
|
306
|
+
|
|
307
|
+
span {
|
|
308
|
+
line-height: 20px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
p {
|
|
312
|
+
margin-top: 4px;
|
|
313
|
+
margin-bottom: 0;
|
|
314
|
+
line-height: 22px;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
</style>
|