Skip to content

Commit

Permalink
feat(equipmentCloud): 通道添加上传文件功能
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed Aug 10, 2022
1 parent e5c48d2 commit f04d2f4
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 164 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* 物模型延时缓存 ([c8dd9d4](https://github.com/dgiot/dgiot-dashboard/commit/c8dd9d4713fb9f36129fb660ecc68c55c73df775))
* **cloudTest:** evidence ([e8d0510](https://github.com/dgiot/dgiot-dashboard/commit/e8d051073aee73634a11fe3d31f0a7c4f54f67be))
* **dashboard): build(发布版本:** dgiot-dashboard@v4.5.6 ([1d4302c](https://github.com/dgiot/dgiot-dashboard/commit/1d4302cd183474db6bbbb6dbc4fbc46163d351c8)), closes [#511](https://github.com/dgiot/dgiot-dashboard/issues/511)
* **equipmentCloud:** 字典修复 ([24a9690](https://github.com/dgiot/dgiot-dashboard/commit/24a96904b4879da9a952c9f6bf7358048863198c))


### Features
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* 物模型延时缓存 ([c8dd9d4](https://github.com/dgiot/dgiot-dashboard/commit/c8dd9d4713fb9f36129fb660ecc68c55c73df775))
* **cloudTest:** evidence ([e8d0510](https://github.com/dgiot/dgiot-dashboard/commit/e8d051073aee73634a11fe3d31f0a7c4f54f67be))
* **dashboard): build(发布版本:** dgiot-dashboard@v4.5.6 ([1d4302c](https://github.com/dgiot/dgiot-dashboard/commit/1d4302cd183474db6bbbb6dbc4fbc46163d351c8)), closes [#511](https://github.com/dgiot/dgiot-dashboard/issues/511)
* **equipmentCloud:** 字典修复 ([24a9690](https://github.com/dgiot/dgiot-dashboard/commit/24a96904b4879da9a952c9f6bf7358048863198c))


### Features
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* 物模型延时缓存 ([c8dd9d4](https://github.com/dgiot/dgiot-dashboard/commit/c8dd9d4713fb9f36129fb660ecc68c55c73df775))
* **cloudTest:** evidence ([e8d0510](https://github.com/dgiot/dgiot-dashboard/commit/e8d051073aee73634a11fe3d31f0a7c4f54f67be))
* **dashboard): build(发布版本:** dgiot-dashboard@v4.5.6 ([1d4302c](https://github.com/dgiot/dgiot-dashboard/commit/1d4302cd183474db6bbbb6dbc4fbc46163d351c8)), closes [#511](https://github.com/dgiot/dgiot-dashboard/issues/511)
* **equipmentCloud:** 字典修复 ([24a9690](https://github.com/dgiot/dgiot-dashboard/commit/24a96904b4879da9a952c9f6bf7358048863198c))


### Features
Expand Down
75 changes: 50 additions & 25 deletions src/views/CloudFunction/engine/createchannel.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<div class="createResourcechannel">
<dgiot-input ref="uploadFinish" @fileInfo="fileInfo" />

<dgiot-input
ref="uploadFinish"
accept=".csv"
:params="inputParams"
@fileInfo="fileInfo"
@files="files"
/>
<el-form
ref="addchannel"
label-width="auto"
Expand Down Expand Up @@ -61,20 +66,6 @@
addchannel.region == item.cType ? '#00bad0' : '#c0c4cc',
}"
>
<!-- <div slot="header" class="clearfix">-->
<!-- <el-button-->
<!-- :disabled="resourceid != ''"-->
<!-- :type="-->
<!-- addchannel.region == item.cType ? 'success' : 'primary'-->
<!-- "-->
<!-- size="mini"-->
<!-- style="text-align: center"-->
<!-- @click="setCard(item.cType)"-->
<!-- >-->
<!-- {{ addchannel.region == item.cType ? '已选' : '选择' }}-->
<!-- </el-button>-->
<!-- <p>{{ item.title.zh }}</p>-->
<!-- </div>-->
<div class="text item" @click="setCard(item.cType)">
<el-row :gutter="24">
<el-col :span="6">
Expand Down Expand Up @@ -234,6 +225,13 @@
:value="item1.enum[index1]"
/>
</el-select>
<div v-else-if="item.type == 'upload'">
<el-button type="primary" @click.native="uploadCkick(item)">
{{ $translateTitle('application.uploadfile') }}
</el-button>
&nbsp;
<span>{{ addchannel[item.filename] }}</span>
</div>
<div v-else-if="item.allowCreate">
<el-button
@click.native="dybaneucForms[item.showname].unshift({})"
Expand Down Expand Up @@ -388,6 +386,8 @@
},
],
},
inputParams: {},
listLoading: false,
addchannel: {
codes: '{}',
name: '',
Expand Down Expand Up @@ -435,20 +435,45 @@
this.$refs['addchannel'].resetFields()
this.resourceid = ''
},
uploadCkick(type, index) {
console.log(type, index)
this.channeindex = index
uploadCkick(item) {
// 触发子组件的点击事件
this.$refs['uploadFinish'].$refs.uploader.dispatchEvent(
new MouseEvent('click')
)
this.inputParams = {
item: item,
file: '',
scene: 'app',
path: 'product/csv/',
}
},
async fileInfo(info) {
console.log('uploadFinish', info)
console.log(this.channelregion)
this.channelregion[this.channeindex].params.ico.default = info.url
console.log(this.channelregion[this.channeindex].params.ico.default)
const res = await putResourceTypes(this.channelregion)
console.log(res)
this.$set(this.addchannel, this.inputParams.item.showname, info.path)
this.$set(
this.addchannel,
this.inputParams.item.filename,
this.inputParams.filename
)
this.inputParams = {}
if (info.url) {
this.$message({
showClose: true,
duration: 2000,
type: 'success',
message: '上传成功',
})
} else {
this.$message({
showClose: true,
duration: 2000,
type: 'error',
message: '上传失败',
})
}
},
files(file) {
this.inputParams.filename = file.name
this.inputParams.file = file
},
// 关闭本页面
handleClose() {
Expand Down
139 changes: 0 additions & 139 deletions src/views/DeviceCloud/manage/product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,133 +288,6 @@
</a-card>
</el-col>
</el-row>
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="列表模式" name="table">-->
<!-- <el-table-->
<!-- v-loading="listLoading"-->
<!-- :cell-style="{ 'text-align': 'center' }"-->
<!-- :data="proTableData"-->
<!-- :header-cell-style="{ 'text-align': 'center' }"-->
<!-- :height="height"-->
<!-- border-->
<!-- size="mini"-->
<!-- style="width: 100%"-->
<!-- >-->
<!-- <el-table-column-->
<!-- label="ProductID"-->
<!-- prop="objectId"-->
<!-- width="auto"-->
<!-- show-overflow-tooltip-->
<!-- sortable-->
<!-- />-->
<!-- <el-table-column-->
<!-- width="auto"-->
<!-- show-overflow-tooltip-->
<!-- sortable-->
<!-- prop="name"-->
<!-- :label="$translateTitle('product.productname')"-->
<!-- />-->
<!-- <el-table-column-->
<!-- show-overflow-tooltip-->
<!-- sortable-->
<!-- prop="nodeType"-->
<!-- width="auto"-->
<!-- :label="$translateTitle('product.nodetype')"-->
<!-- >-->
<!-- <template #default="{ row }">-->
<!-- <span v-if="row.nodeType == 3">-->
<!-- {{ $translateTitle("product.direct") }}-->
<!-- </span>-->
<!-- <span v-if="row.nodeType == 1">-->
<!-- {{ $translateTitle("product.gateway") }}-->
<!-- </span>-->
<!-- <span v-if="row.nodeType == 2">-->
<!-- {{ $translateTitle("product.groupgateway") }}-->
<!-- </span>-->
<!-- <span v-else-if="row.nodeType == 0">-->
<!-- {{ $translateTitle("product.equipment") }}-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- show-overflow-tooltip-->
<!-- sortable-->
<!-- prop="nodeType"-->
<!-- width="auto"-->
<!-- :label="$translateTitle('product.classification')"-->
<!-- >-->
<!-- <template #default="{ row }">-->
<!-- <span>-->
<!-- {{ row.category ? row.category.name : "" }}-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- &lt;!&ndash; <el-table-column :label="$translateTitle('product.producttemplet')">&ndash;&gt;-->
<!-- &lt;!&ndash; <template #default="{ row }">&ndash;&gt;-->
<!-- &lt;!&ndash; <span>&ndash;&gt;-->
<!-- &lt;!&ndash; {{ row.producttemplet ? row.producttemplet.name : '' }}&ndash;&gt;-->
<!-- &lt;!&ndash; </span>&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-table-column>&ndash;&gt;-->
<!-- <el-table-column-->
<!-- show-overflow-tooltip-->
<!-- sortable-->
<!-- prop="createdAt"-->
<!-- width="auto"-->
<!-- :label="$translateTitle('product.addingtime')"-->
<!-- >-->
<!-- <template #default="{ row }">-->
<!-- <span>{{ utc2beijing(row.createdAt) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- ref="rightCol"-->
<!-- :label="$translateTitle('developer.operation')"-->
<!-- fixed="right"-->
<!-- width="auto"-->
<!-- min-width="280"-->
<!-- >-->
<!-- <template #default="{ row, $index }">-->
<!-- <el-button-->
<!-- :underline="false"-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- style="margin-left: 10px"-->
<!-- @click="deviceToDetail(row)"-->
<!-- >-->
<!-- {{ $translateTitle("product.config") }}-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- :underline="false"-->
<!-- size="mini"-->
<!-- type="warning"-->
<!-- @click="editorDict(row.objectId)"-->
<!-- >-->
<!-- {{ $translateTitle("product.dict") }}-->
<!-- </el-button>-->

<!-- <el-button size="mini" @click="goKonva(row.objectId)">-->
<!-- {{ $translateTitle("concentrator.konva") }}-->
<!-- </el-button>-->

<!-- <el-button-->
<!-- :underline="false"-->
<!-- size="mini"-->
<!-- type="success"-->
<!-- @click="editorProduct(row.objectId)"-->
<!-- >-->
<!-- {{ $translateTitle("concentrator.edit") }}-->
<!-- </el-button>-->

<!-- <el-button size="mini" type="danger" @click="makeSure(row, $index)">-->
<!-- {{ $translateTitle("task.Delete") }}-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </el-tab-pane>-->
<!-- </el-tabs>-->

<el-pagination
background
:key="paginationKey + 'forensics'"
Expand All @@ -426,16 +299,6 @@
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
<!-- <div class="elpagination" style="margin-top: 20px">-->
<!-- <el-pagination-->
<!-- :page-size="length"-->
<!-- :page-sizes="[8, 16, 24, 48]"-->
<!-- :total="total"-->
<!-- layout="total, sizes, prev, pager, next, jumper"-->
<!-- @current-change="productCurrentChange"-->
<!-- @size-change="productSizeChange"-->
<!-- />-->
<!-- </div>-->
</div>
<div class="devproduct-prodialog">
<!-- 创建产品对话框 ###-->
Expand Down Expand Up @@ -1514,8 +1377,6 @@
选泽文件
</el-button>
</el-upload>

<!-- </el-row> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
Expand Down

1 comment on commit f04d2f4

@vercel
Copy link

@vercel vercel bot commented on f04d2f4 Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dgiot-dashboard – ./

dgiot-dashboard-dgiot.vercel.app
dgiot-dashboard.vercel.app
dgiot-dashboard-git-master-dgiot.vercel.app

Please sign in to comment.