| | |
| | | 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: [ |
| | | { |
| | |
| | | display: false, |
| | | }, |
| | | { |
| | | label: 'region', |
| | | label: '过期时间', |
| | | prop: 'expire', |
| | | type:"number", |
| | | span: 24, |
| | | hide: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入过期时间', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '地域简称', |
| | | prop: 'region', |
| | | span: 24, |
| | | hide: true, |
| | | display: false, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入地域简称', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '是否启用', |
| | |
| | | if (item.prop === 'appId') { |
| | | item.display = category === 4; |
| | | } |
| | | if (item.prop === 'region') { |
| | | item.display = category === 4 || category === 5; |
| | | } |
| | | // if (item.prop === 'region') { |
| | | // item.display = category === 4 || category === 5; |
| | | // } |
| | | }); |
| | | }, |
| | | 'debugForm.code'() { |
| | |
| | | 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; |