4 files modified
2 files added
| New file |
| | |
| | | import request from '@/axios'; |
| | | |
| | | export const remove = ids => { |
| | | return request({ |
| | | url: '/drone-yw/oss/bind/delete', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const deleteByOssId = ossId => { |
| | | return request({ |
| | | url: '/drone-yw/oss/bind/deleteByOssId', |
| | | method: 'post', |
| | | params: { |
| | | ossId, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const add = row => { |
| | | return request({ |
| | | url: '/drone-yw/oss/bind/add', |
| | | method: 'post', |
| | | data: row, |
| | | }); |
| | | }; |
| | | |
| | | export const update = row => { |
| | | return request({ |
| | | url: '/drone-yw/oss/bind/update', |
| | | method: 'post', |
| | | data: row, |
| | | }); |
| | | }; |
| | | |
| | | export const addOrUpdate = row => { |
| | | return request({ |
| | | url: '/drone-yw/oss/bind/addOrUpdate', |
| | | method: 'post', |
| | | data: row, |
| | | }); |
| | | }; |
| | |
| | | }); |
| | | }; |
| | | |
| | | export const getListPage = (current, size, params) => { |
| | | return request({ |
| | | url: '/blade-resource/oss/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const getDetail = id => { |
| | | return request({ |
| | | url: '/blade-resource/oss/detail', |
| | |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const disable = id => { |
| | | return request({ |
| | | url: '/blade-resource/oss/disable', |
| | | method: 'post', |
| | | params: { |
| | | id, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| New file |
| | |
| | | // oss 类型 |
| | | export let OSS_TYPE; |
| | | (function (OSS_TYPE) { |
| | | OSS_TYPE[(OSS_TYPE['minio'] = 1)] = 'minio'; |
| | | OSS_TYPE[(OSS_TYPE['七牛云'] = 2)] = '七牛云'; |
| | | OSS_TYPE[(OSS_TYPE['阿里云'] = 3)] = '阿里云'; |
| | | OSS_TYPE[(OSS_TYPE['腾讯云'] = 4)] = '腾讯云'; |
| | | OSS_TYPE[(OSS_TYPE['华为云'] = 5)] = '华为云'; |
| | | OSS_TYPE[(OSS_TYPE['amazon s3'] = 6)] = 'amazon s3'; |
| | | })(OSS_TYPE || (OSS_TYPE = {})); |
| | | |
| | | |
| | | export let OssTypeText = { |
| | | minio: 1, |
| | | 七牛云: 2, |
| | | 阿里云: 3, |
| | | 腾讯云: 4, |
| | | 华为云: 5, |
| | | amazons3: 6, |
| | | 1: 'minio', |
| | | 2: '七牛云', |
| | | 3: '阿里云', |
| | | 4: '腾讯云', |
| | | 5: '华为云', |
| | | 6: 'amazons3', |
| | | }; |
| | |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | icon="el-icon-collection-tag" |
| | | v-if="permission.deviceFirmware_manage" |
| | | @click.stop="handleOpenFirmwarm(scope.row, scope.index)" |
| | | >固件管理 |
| | | icon="el-icon-paperclip" |
| | | v-if="permission.oss_set" |
| | | @click.stop="handleOpenOssSet(scope.row, scope.index)" |
| | | >存储配置 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | |
| | | <span class="dialog-footer"> |
| | | <el-button @click="firmwareBox = false">取 消</el-button> |
| | | <el-button type="primary" @click="updateFirmwareConfirm">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="存储配置" |
| | | append-to-body |
| | | v-model="ossSetBox" |
| | | @close="handleOssSetClose" |
| | | width="600px" |
| | | > |
| | | <div style="display: flex; flex-direction: row; align-items: center"> |
| | | 存储对象配置: |
| | | <el-select v-model="ossEnd" clearable placeholder="请选择存储对象" style="width: 450px"> |
| | | <el-option |
| | | v-for="item in ossList" |
| | | :key="item.id" |
| | | :label="item.name + ': ' + item.endpoint" |
| | | :value="item.id" |
| | | > |
| | | <span style="float: left">{{ item.name + ': ' + item.endpoint }}</span> |
| | | <span v-if="item.status == 1" style="float: right; color: #8492a6; font-size: 13px">{{ |
| | | item.categoryName |
| | | }}</span> |
| | | <span v-if="item.status == 2" style="float: right; color: #40cb8b; font-size: 13px">{{ |
| | | item.categoryName |
| | | }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="cancelOssSet">取 消</el-button> |
| | | <el-button type="danger" @click="cancelOssSetConfirm">取消配置</el-button> |
| | | <el-button type="primary" @click="ossSetConfirm">配置</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | getDeviceFirmwareList, |
| | | getDevices, |
| | | } from '@/api/device/device'; |
| | | |
| | | import { deleteByOssId, addOrUpdate as addOrUpdateOssBind } from '@/api/device/ossBind'; |
| | | import { getListPage as getOssList } from '@/api/resource/oss'; |
| | | import { getLazyTree } from '@/api/base/region'; |
| | | import { EDockModeText, EDockModeCode } from '@/types/device'; |
| | | import { mapGetters } from 'vuex'; |
| | |
| | | DevicePerShare, |
| | | DockControlPanel, |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | operateTitle:"", |
| | | bindOssId: null, |
| | | deviceSn: '', |
| | | ossSetBox: false, |
| | | ossList: [], |
| | | ossEnd: '', |
| | | operateTitle: '', |
| | | rollFirmVersion: '', |
| | | firmList: [], |
| | | rollFirmwareBox: false, |
| | |
| | | }); |
| | | }, |
| | | init() { |
| | | this.page= { |
| | | (this.page = { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | this.onLoad(this.page); |
| | | }), |
| | | this.onLoad(this.page); |
| | | }, |
| | | // 打开权限分享页面 |
| | | handleOpenDevicePerShare(row) { |
| | |
| | | handleOpenRemoteDebugging(row) { |
| | | this.curDeviceInfo = row; |
| | | this.remoteDebuggingShow = true; |
| | | this.operateTitle = row.nickname + " - " + row.device_sn |
| | | this.operateTitle = row.nickname + ' - ' + row.device_sn; |
| | | }, |
| | | |
| | | // 打开存储对象配置页面 |
| | | handleOpenOssSet(row) { |
| | | var that = this; |
| | | this.deviceSn = row.device_sn; |
| | | this.ossSetBox = true; |
| | | this.bindOssId = row.oss_id; |
| | | this.ossEnd = row.oss_id; |
| | | // 查询下拉列表 |
| | | const param = { |
| | | categoryKeys: "1,3,6" |
| | | } |
| | | getOssList(1, 50,param).then(res => { |
| | | const data = res.data.data; |
| | | that.ossList = data.records; |
| | | }); |
| | | }, |
| | | // 打开固件管理页面 |
| | | handleOpenFirmwarm(row) { |
| | | var that = this; |
| | |
| | | done(); |
| | | }); |
| | | }, |
| | | handleOssSetClose() { |
| | | this.ossEnd = ''; |
| | | this.deviceSn = ''; |
| | | this.bindOssId = null; |
| | | }, |
| | | // 存储对象配置确定 |
| | | ossSetConfirm() { |
| | | var that = this; |
| | | // 判断是否已选择 |
| | | if (!this.ossEnd) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请选择对于的存储对象!', |
| | | }); |
| | | return; |
| | | } |
| | | // 新增或者修改操作 |
| | | const data = { |
| | | oss_id: this.ossEnd, |
| | | sn: this.deviceSn, |
| | | }; |
| | | // 新增 |
| | | addOrUpdateOssBind(data).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | that.ossSetBox = false; |
| | | this.onLoad(this.page); |
| | | done(); |
| | | }); |
| | | }, |
| | | // 取消配置 |
| | | cancelOssSetConfirm() { |
| | | var that = this; |
| | | // 判断是否已有配置 |
| | | if (!this.bindOssId) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '当前机场尚未配置存储对象信息!', |
| | | }); |
| | | return; |
| | | } |
| | | deleteByOssId(this.bindOssId).then(() => { |
| | | that.ossSetBox = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | }); |
| | | }, |
| | | // 取消按钮 oss |
| | | cancelOssSet() { |
| | | this.ossEnd = ''; |
| | | this.deviceSn = ''; |
| | | this.bindOssId = null; |
| | | this.ossSetBox = false; |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then( |
| | | () => { |
| | |
| | | type="primary" |
| | | text |
| | | icon="el-icon-circle-check" |
| | | v-if="permission.oss_enable" |
| | | v-if="scope.row.status==1 && permission.oss_enable" |
| | | @click.stop="handleEnable(scope.row)" |
| | | >启用 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | icon="VideoPause" |
| | | v-if="scope.row.status==2 && permission.oss_enable" |
| | | @click.stop="handleDisable(scope.row)" |
| | | >禁用 |
| | | </el-button> |
| | | </template> |
| | | <template #status="{ row }"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, getDetail, add, update, remove, enable } from '@/api/resource/oss'; |
| | | import { getListPage, getDetail, add, update, remove, enable, disable } from '@/api/resource/oss'; |
| | | import { mapGetters } from 'vuex'; |
| | | import func from '@/utils/func'; |
| | | |
| | |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | grid: true, |
| | | grid: false, |
| | | menuWidth: 350, |
| | | labelWidth: 100, |
| | | dialogWidth: 880, |
| | |
| | | span: 24, |
| | | width: 120, |
| | | searchLabelWidth: 50, |
| | | searchSpan:3, |
| | | row: true, |
| | | dicUrl: '/blade-system/dict/dictionary?code=oss', |
| | | props: { |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: '名称', |
| | | prop: 'name', |
| | | span: 24, |
| | | search: true, |
| | | searchSpan:5, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入名称', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '资源编号', |
| | | prop: 'ossCode', |
| | | span: 24, |
| | | width: 120, |
| | | searchLabelWidth: 100, |
| | | search: true, |
| | | searchSpan:4, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | prop: 'accessKey', |
| | | span: 24, |
| | | search: true, |
| | | width: 200, |
| | | searchSpan:5, |
| | | searchLabelWidth: 100, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | |
| | | label: 'secretKey', |
| | | prop: 'secretKey', |
| | | span: 24, |
| | | width: 200, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleDisable(row){ |
| | | this.$confirm('是否确定禁用用这条配置?', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return disable(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleDebug(row) { |
| | | this.box = true; |
| | | this.debugForm.code = row.ossCode; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | getListPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | |
| | | port: 2888, |
| | | proxy: { |
| | | '/api': { |
| | | // target: 'http://localhost', |
| | | target: 'https://wrj.shuixiongit.com/api', |
| | | target: 'http://localhost', |
| | | // target: 'https://wrj.shuixiongit.com/api', |
| | | changeOrigin: true, |
| | | rewrite: path => path.replace(/^\/api/, ''), |
| | | }, |