diff --git a/src/assets/images/tuple.png b/src/assets/images/tuple.png new file mode 100644 index 00000000..a3a7b740 Binary files /dev/null and b/src/assets/images/tuple.png differ 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/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, }, 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 = '修改设备类型'; });