From f60a46ed1df05d8b5e2f24c0ec5a698f13c2bb59 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 16 Oct 2023 13:35:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 4 +- .../equipment/components/AssetsUpload.vue | 236 +++++++++--- .../equipment/components/EquipmentDrawer.vue | 88 ++++- .../components/EquipmentInfoForm.vue | 337 ++++++++++++++++++ src/views/core/base/equipment/index.vue | 5 + 5 files changed, 599 insertions(+), 71 deletions(-) create mode 100644 src/views/core/base/equipment/components/EquipmentInfoForm.vue diff --git a/.env.dev b/.env.dev index 40051292..574a759f 100644 --- a/.env.dev +++ b/.env.dev @@ -12,9 +12,9 @@ ENV = 'development' VUE_APP_TITLE = 产线监控系统 # 芋道管理系统/开发环境 -VUE_APP_BASE_API = 'http://192.168.1.49:48080' +# VUE_APP_BASE_API = 'http://192.168.1.49:48080' # VUE_APP_BASE_API = 'http://192.168.1.8:48080' -# VUE_APP_BASE_API = 'http://192.168.0.33:48080' +VUE_APP_BASE_API = 'http://192.168.0.33:48080' # VUE_APP_BASE_API = 'http://192.168.1.188:48080' # 路由懒加载 diff --git a/src/views/core/base/equipment/components/AssetsUpload.vue b/src/views/core/base/equipment/components/AssetsUpload.vue index c6453eac..c6d410e5 100644 --- a/src/views/core/base/equipment/components/AssetsUpload.vue +++ b/src/views/core/base/equipment/components/AssetsUpload.vue @@ -13,21 +13,31 @@ 展开 -
+
- +
将文件拖到此处或 点击上传
- - some tips.... + {{ + isPicMode ? '仅支持上传 .jpg .png 格式文件, 且' : '' + }}文件大小不超过2MB
+ + + + + + diff --git a/src/views/core/base/equipment/index.vue b/src/views/core/base/equipment/index.vue index 6ec5e6ae..16c881d8 100644 --- a/src/views/core/base/equipment/index.vue +++ b/src/views/core/base/equipment/index.vue @@ -53,6 +53,7 @@ v-if="editVisible" ref="drawer" :mode="editMode" + @update-mode="editMode = $event" :data-id="form.id" :sections="[ { @@ -462,6 +463,8 @@ export default { label: '上传资料', fieldName: 'assets', subcomponent: AssetsUpload, + prop: 'uploadedAssets', + default: [], bind: { 'is-pic-mode': false, }, @@ -474,6 +477,8 @@ export default { label: '上传图片', fieldName: 'images', subcomponent: AssetsUpload, + // prop: '', + // default: [], bind: { 'is-pic-mode': true, }, From 32cbf9076f5955b81beeb139ef1f8df1f3db1360 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 16 Oct 2023 17:03:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=B1=BB=E5=9E=8B=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/tuple.png | Bin 0 -> 944 bytes src/components/DialogForm/index.vue | 196 ++++++++++++++++---- src/views/core/base/equipmentType/index.vue | 49 ++--- 3 files changed, 182 insertions(+), 63 deletions(-) create mode 100644 src/assets/images/tuple.png diff --git a/src/assets/images/tuple.png b/src/assets/images/tuple.png new file mode 100644 index 0000000000000000000000000000000000000000..a3a7b740b12d58cb71832bad0290910b1f01cdf2 GIT binary patch literal 944 zcmV;h15f;kP)Px&YDq*vR7gv;)>)|TQy9nb&oR$aWQff3P$)x&P?QTIL)^KLA;ZNnM}|zH$UKCi zkRgtwxFPe<5rqp}C~{24OfHQ5cF#I3|NiHF&wF9jZtwqIYdzn!p5gbbd1fD5;Y@sp z`)1ufZ^jMV;3BMwPjK0c`^^H}78e$5F|Ne7{}*t(f~``Jzyh6lEXxgdzy(+t-_*^% z>qu+k5bTBxuskxK7{7!?{i&t_cf|Px`wCa#`_91OIKJk`Zu<|O$HVwD3nl?~!g(Dm zZv3IFX5Yy;xW0eFTlf@zU<>StjcfjW+z{x}fIAm#rE{s7U;)!KQ(;WOdY=i|pFm-lG!9GXa_;Uw41N+u@Kmji6I0=X0;|5%>07>y7ENLDo z+qZos%IamkG?t~$zwz|O*6wfj*#Jp$XlYBj=e1wIg;b!THAEDYpm9EUF}JDWR__NUdx zhw$tOY*MYZ<(uLfq)hG!@KWTIIel)?MqHCbdI9&2z$VpdTb??;yo4ZfH$T8zus-g< ztDWIMRx5YEI{@xd!jP07mQN3hQsrQ&!E2+h0p5=U`+B_B8P0;uG0e(Iwc55v=mU$( z6QaBEawY@3xm135!^l#8qK#3LWL^v$Tk#l{PlM&~fkpTOy9=+h$pBOAF_ff8a5Q_yN4!=lhP^dr2QLJi*xO!8+mpF zmYNLg_CblwEe$Y+ZmhqDZtV?b?NCA5d|-KgB&(AkspmIGJhP-9rrkt-ekm8v@>WSE z2bKp`V7FFp9OEqku2aRC-+2>a%H69YQnfqMVKUM$Z%XT#25U(( zT(<^}!lBh0mu4roiU-mc+lyc-bJ8PfE$o3jIdbDQ%hl1u5329AN7YnNTktO*8^ht? SJopR%0000c9~I literal 0 HcmV?d00001 diff --git a/src/components/DialogForm/index.vue b/src/components/DialogForm/index.vue index e55394de..72d7e166 100644 --- a/src/components/DialogForm/index.vue +++ b/src/components/DialogForm/index.vue @@ -48,23 +48,6 @@ :placeholder="`请选择${col.label}`" value-format="timestamp" v-bind="col.bind"> - - - 点击上传 - -
- {{ col.uploadTips || '只能上传jpg/png文件,大小不超过2MB' }} -
-
+ +
+ + + + + + + 上传文件 + +
+ {{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }} +
+
+ + +
@@ -83,6 +103,9 @@ @@ -309,4 +379,52 @@ export default { .el-select { width: 100%; } + +.upload-area { + // background: #ccc; + // display: grid; + // grid-auto-rows: 34px; + // grid-template-columns: repeat(6, minmax(32px, max-content)); + // gap: 8px; + // align-items: center; + position: relative; + overflow: hidden; + transition: height 0.3s ease-out; +} + +.upload-in-dialog { + // display: inline-block; + margin-right: 24px; + // background: #ccc; + position: relative; + // top: -13px; + float: left; +} + +.close-icon { + // background: #ccc; + position: absolute; + top: 0; + right: 12px; + z-index: 100; + transition: transform 0.3s ease-out; +} + +.close-icon.open { + transform: rotateZ(90deg); +} + + + diff --git a/src/views/core/base/equipmentType/index.vue b/src/views/core/base/equipmentType/index.vue index 6fa94502..c5358201 100644 --- a/src/views/core/base/equipmentType/index.vue +++ b/src/views/core/base/equipmentType/index.vue @@ -37,22 +37,7 @@ @close="cancel" @cancel="cancel" @confirm="submitForm"> - -
-

文件列表

-
-
    -
  • - {{ JSON.stringify(item) }} -
  • -
-
-
    -
  • - {{ JSON.stringify(item) }} -
  • -
-
+
@@ -70,7 +55,7 @@ import { exportEquipmentTypeExcel, } from '@/api/base/equipmentType'; -import { getAccessToken } from '@/utils/auth'; +// import { getAccessToken } from '@/utils/auth'; export default { name: 'EquipmentType', @@ -164,15 +149,13 @@ export default { prop: 'parentId', url: '/base/equipment-type/page?pageNo=1&pageSize=100', }, + {}, + ], + [ { upload: true, label: '上传资料', - prop: 'uploadFiles', - url: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 请求地址 - bind: { - headers: { Authorization: 'Bearer ' + getAccessToken() }, - 'show-file-list': false, - }, + prop: 'files', }, ], [{ input: true, label: '备注', prop: 'remark' }], @@ -251,7 +234,25 @@ export default { const id = row.id; getEquipmentType(id).then((response) => { this.form = response.data; - debugger; + // this.form = { + // code: 'SBLX20230925184444000041', + // name: '测试131', + // remark: '测试可删除', + // id: '1706258479729336322', + // files: [ + // { fileName: '1.png', fileUrl: '', fileType: 2 }, + // { fileName: '1.asdfaslkjfkasdf.png', fileUrl: '', fileType: 2 }, + // { fileName: '2.txt', fileUrl: '', fileType: 2 }, + // { fileName: '1.rar', fileUrl: '', fileType: 2 }, + // { fileName: '1.kkk', fileUrl: '', fileType: 2 }, + // { fileName: 'test.file', fileUrl: '', fileType: 2 }, + // { fileName: '222', fileUrl: '', fileType: 2 }, + // { fileName: 'g', fileUrl: '', fileType: 2 }, + // ], + // createTime: 1695638697000, + // parentId: '1701869972319584257', + // }; + // debugger; this.open = true; this.title = '修改设备类型'; });