|
|
@@ -2,32 +2,39 @@
|
|
|
<a-card>
|
|
|
<!-- 标签页 -->
|
|
|
<a-tabs v-model:activeKey="formState.verifyStatus" @change="tabChange">
|
|
|
- <a-tab-pane key="0" tab="未发布" v-if="!pageType"></a-tab-pane>
|
|
|
+ <a-tab-pane key="0" tab="未发布"></a-tab-pane>
|
|
|
<a-tab-pane key="1" tab="待审核"></a-tab-pane>
|
|
|
- <a-tab-pane key="2" tab="已发布" v-if="!pageType"></a-tab-pane>
|
|
|
+ <a-tab-pane key="2" tab="已发布"></a-tab-pane>
|
|
|
<!-- <a-tab-pane key="3" tab="已审核" v-if="pageType == 'economize'"></a-tab-pane> -->
|
|
|
<a-tab-pane key="4" tab="回收站"></a-tab-pane>
|
|
|
</a-tabs>
|
|
|
<!-- 搜索和操作区域 -->
|
|
|
<a-row :gutter="16" style="margin-bottom: 16px">
|
|
|
<a-col :span="18">
|
|
|
- <a-input v-model:value="formState.fileName" placeholder="请输入资源名称" style="width: 200px" />
|
|
|
+ <a-input v-model:value="formState.fileName" placeholder="请输入资源名称" style="width: 150px" />
|
|
|
<a-cascader
|
|
|
- style="width: 200px; margin-left: 8px"
|
|
|
- v-model:value="formState.majorIdName"
|
|
|
+ style="width: 240px; margin-left: 8px"
|
|
|
+ v-model:value="majorIdName"
|
|
|
:options="collegeMajorOptions"
|
|
|
- :fieldNames="{ label: 'name', value: 'parentId', children: 'children' }"
|
|
|
+ :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
placeholder="请选择院系"
|
|
|
changeOnSelect
|
|
|
@change="changeCollegeMajor"
|
|
|
/>
|
|
|
+ <!-- <a-select
|
|
|
+ v-model:value="formState.majorId"
|
|
|
+ style="width: 150px; margin-left: 8px"
|
|
|
+ :fieldNames="{ label: 'majorName', value: 'majorCode' }"
|
|
|
+ :options="majorOptions"
|
|
|
+ placeholder="请选择专业"
|
|
|
+ /> -->
|
|
|
<a-select
|
|
|
- v-model:value="formState.resourceTypeName"
|
|
|
- style="width: 200px; margin-left: 8px"
|
|
|
+ v-model:value="formState.resourceType"
|
|
|
+ style="width: 150px; margin-left: 8px"
|
|
|
:options="courseTypeOptions"
|
|
|
placeholder="请选择资源类型"
|
|
|
/>
|
|
|
- <a-select v-model:value="formState.suffix" placeholder="请选择资源格式" style="width: 200px; margin-left: 8px">
|
|
|
+ <a-select v-model:value="formState.suffix" placeholder="请选择资源格式" style="width: 150px; margin-left: 8px">
|
|
|
<a-select-option value="mp4">mp4</a-select-option>
|
|
|
<a-select-option value="ppt">ppt</a-select-option>
|
|
|
<a-select-option value="word">word</a-select-option>
|
|
|
@@ -270,11 +277,16 @@
|
|
|
fileName: null,
|
|
|
verifyStatus: '0',
|
|
|
resourcesId: null,
|
|
|
- majorIdName: null,
|
|
|
- resourceTypeName: null,
|
|
|
+ // majorId: null, //专业
|
|
|
+ collegeId: null, //院校一级id
|
|
|
+ collegeTwoId: null, //院校二级id
|
|
|
+ collegeThreeId: null, //院校三级id
|
|
|
+ resourceType: null,
|
|
|
suffix: null
|
|
|
})
|
|
|
// 添加选择状态
|
|
|
+ const majorIdName = ref([])
|
|
|
+ const majorOptions = ref([]) //专业
|
|
|
const selectedRowKeys = ref([])
|
|
|
const selectedRows = ref([])
|
|
|
const publishedData = ref([]) //当前点击数据
|
|
|
@@ -452,9 +464,13 @@
|
|
|
size: pagination.pageSize,
|
|
|
verifyStatus: formState.verifyStatus,
|
|
|
fileName: formState.fileName,
|
|
|
- majorIdName: formState.majorIdName?.join(','),
|
|
|
- resourceTypeName: formState.resourceTypeName,
|
|
|
- suffix: formState.suffix
|
|
|
+ resourceType: formState.resourceType,
|
|
|
+ suffix: formState.suffix,
|
|
|
+ // majorId: formState.majorId,
|
|
|
+ collegeTwoId: formState.collegeTwoId,
|
|
|
+ collegeId: formState.collegeId,
|
|
|
+ collegeThreeId: formState.collegeThreeId,
|
|
|
+ isSelf: !pageType ? 1 : 0
|
|
|
}
|
|
|
resourceAuditApi
|
|
|
.page(params)
|
|
|
@@ -471,6 +487,19 @@
|
|
|
loading.value = false
|
|
|
})
|
|
|
}
|
|
|
+ const changeCollegeMajor = (value, selectedOptions) => {
|
|
|
+ console.log('Selected:', value, selectedOptions)
|
|
|
+ majorIdName.value = selectedOptions.map((it) => it.name).join('/')
|
|
|
+ formState.collegeId = value[0] || null
|
|
|
+ formState.collegeTwoId = value[1] || null
|
|
|
+ formState.collegeThreeId = value[2] || null
|
|
|
+ if (selectedOptions.length) {
|
|
|
+ // 获取选中的最后一级
|
|
|
+ const lastSelected = selectedOptions[selectedOptions.length - 1]
|
|
|
+ console.log(lastSelected, '最后一级id')
|
|
|
+ getCollegeMajor(lastSelected.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
const getList = () => {
|
|
|
getListData()
|
|
|
uploadModalVisible.value = false
|
|
|
@@ -487,6 +516,17 @@
|
|
|
console.log(err)
|
|
|
})
|
|
|
}
|
|
|
+ const getCollegeMajor = (id) => {
|
|
|
+ resourceAuditApi
|
|
|
+ .zyselect({ collegeId: id })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res.data, '专业下拉数据')
|
|
|
+ majorOptions.value = res.data
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
// 方法
|
|
|
const handleSearch = () => {
|
|
|
console.log('Search:', searchValue.value)
|
|
|
@@ -495,10 +535,14 @@
|
|
|
|
|
|
const handleReset = () => {
|
|
|
searchValue.value = null
|
|
|
- formState.majorIdName = null
|
|
|
+ majorIdName.value = null
|
|
|
formState.fileName = null
|
|
|
- formState.resourceTypeName = null
|
|
|
+ formState.resourceType = null
|
|
|
formState.suffix = null
|
|
|
+ formState.collegeTwoId = null
|
|
|
+ // formState.majorId = null
|
|
|
+ formState.collegeId = null
|
|
|
+ formState.collegeThreeId = null
|
|
|
getListData()
|
|
|
}
|
|
|
const tabChange = () => {
|
|
|
@@ -708,9 +752,9 @@
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- if (pageType == 'economize') {
|
|
|
- formState.verifyStatus = '1'
|
|
|
- }
|
|
|
+ // if (pageType == 'economize') {
|
|
|
+ // formState.verifyStatus = '1'
|
|
|
+ // }
|
|
|
getOrgTreeSelector()
|
|
|
getListData()
|
|
|
})
|