zhouwx
2024-08-05 4f6cdee3d3a9967b6955aacc354bf557430c0643
src/views/onlineEducation/courseManage/courseChapters/components/chooseResource.vue
@@ -5,6 +5,8 @@
        title="选择资源"
        width="600px"
        :before-close="handleClose"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
    <div style="margin-bottom: 10px">
      <el-form>
@@ -12,8 +14,8 @@
          <el-input style="width: 20%" v-model="data.queryParams.name "></el-input>
          <el-button type="primary" style="margin-left: 30px" @click="getList">查询</el-button>
          <el-button plain @click="reset">重置</el-button>
          <el-button type="primary" @click="openResource">资源上传</el-button>
        </el-form-item>
      </el-form>
    </div>
    <!-- 表格数据 -->
@@ -25,6 +27,7 @@
          <span>{{scope.row.resourceType == 1 ? '视频':scope.row.resourceType == 2 ? '音频':'文档'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="上传时间" prop="createTime" align="center"  />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
        <template #default="scope">
          <el-button link type="primary" @click="choose(scope.row)">选择</el-button>
@@ -40,18 +43,21 @@
        @pagination="getList"
    />
    </el-dialog>
    <resource-dialog ref="resourceRef" @getList="getList"></resource-dialog>
  </div>
</template>
<script setup>
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import resourceDialog from '@/views/onlineEducation/courseManage/courseResource/componets/resourceDialog.vue'
import {checkResourceName, delResource, getResource} from "@/api/onlineEducation/courseResource";
import {checkName} from "@/api/onlineEducation/company";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const emit = defineEmits(["chooseRes"]);
const dialogRef = ref();
const resourceRef = ref()
const data = reactive({
  queryParams: {
    pageNum: 1,
@@ -99,6 +105,10 @@
  loading.value = false
}
const openResource = () => {
  resourceRef.value.openDialog('add',{})
}
const choose = (value) => {
  console.log("co",value)
  emit('chooseRes',value)