无人机管理后台前端(已迁走)
zhongrj
2025-01-18 902018925188ae12fe11cea86435be7dddcadbe8
src/views/resource/oss.vue
@@ -43,9 +43,17 @@
          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 }">
@@ -62,7 +70,7 @@
</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';
@@ -89,7 +97,7 @@
        index: true,
        viewBtn: true,
        selection: true,
        grid: true,
        grid: false,
        menuWidth: 350,
        labelWidth: 100,
        dialogWidth: 880,
@@ -102,6 +110,7 @@
            span: 24,
            width: 120,
            searchLabelWidth: 50,
            searchSpan:3,
            row: true,
            dicUrl: '/blade-system/dict/dictionary?code=oss',
            props: {
@@ -121,11 +130,27 @@
            ],
          },
          {
            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,
@@ -171,7 +196,8 @@
            prop: 'accessKey',
            span: 24,
            search: true,
            width: 200,
            searchSpan:5,
            searchLabelWidth: 100,
            overHidden: true,
            rules: [
              {
@@ -185,7 +211,6 @@
            label: 'secretKey',
            prop: 'secretKey',
            span: 24,
            width: 200,
            overHidden: true,
            rules: [
              {
@@ -378,6 +403,24 @@
          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;
@@ -431,7 +474,7 @@
    },
    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;