Compare commits

..

No commits in common. "08c365b0edf4f97abfbb53afd9c929bbffef32ad" and "415a4c17c19d254fabeaf96e1c8c072aabe8358d" have entirely different histories.

3 changed files with 9 additions and 19 deletions

View File

@ -145,7 +145,6 @@ watch(() => props.modelValue, (newVal) => {
.dialog-footer{ .dialog-footer{
text-align: center; text-align: center;
padding-bottom: 10px; padding-bottom: 10px;
-webkit-app-region: no-drag;
} }

View File

@ -6,7 +6,7 @@
<div class="page-right"> <div class="page-right">
<!-- 搜索 --> <!-- 搜索 -->
<ResoureSearch #add> <ResoureSearch #add>
<el-button v-if="sourceStore.isCreate" type="primary" round @click="openDialog" class="create-btn"> <el-button v-if="hasPermission(['platformmanager'])" type="primary" round @click="openDialog" class="create-btn">
<i class="iconfont icon-jiahao"></i> <i class="iconfont icon-jiahao"></i>
新建资源</el-button> 新建资源</el-button>
</ResoureSearch> </ResoureSearch>
@ -19,7 +19,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, ref, toRaw } from 'vue' import { ref, toRaw } from 'vue'
import useResoureStore from './store' import useResoureStore from './store'
import ChooseTextbook from '@/components/choose-textbook/index.vue' import ChooseTextbook from '@/components/choose-textbook/index.vue'
import ResoureSearch from './container/resoure-search.vue' import ResoureSearch from './container/resoure-search.vue'
@ -27,7 +27,7 @@ import ResoureList from './container/resoure-list.vue'
import uploadDialog from '@/components/upload-dialog/index.vue' import uploadDialog from '@/components/upload-dialog/index.vue'
import uploaderState from '@/store/modules/uploader' import uploaderState from '@/store/modules/uploader'
import { hasPermission } from '@/utils/hasPermission' import { hasPermission } from '@/utils/hasPermission'
//
const sourceStore = useResoureStore() const sourceStore = useResoureStore()
const isDialogOpen = ref(false) const isDialogOpen = ref(false)
@ -82,10 +82,6 @@ const fileCallBack = (res) => {
} }
} }
onMounted(()=>{
sourceStore.getCreate()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -27,6 +27,11 @@ tabs.forEach((item) => {
item.value = userStore.user.deptId item.value = userStore.user.deptId
} }
}) })
tabs.forEach((item, i) => {
if (item.label == '平台资源' && !hasPermission(['platformmanager'])) {
tabs.splice(i, 1)
}
})
const structQuery = { const structQuery = {
pageNum: 1, pageNum: 1,
@ -44,8 +49,6 @@ export default defineStore('resource', {
//节点数据 //节点数据
nodeData: {}, nodeData: {},
loading: false, loading: false,
//
isCreate: true,
//查询条件 //查询条件
query: { query: {
textbookId: '', textbookId: '',
@ -73,6 +76,7 @@ export default defineStore('resource', {
if (data.fileSuffix == -1) { if (data.fileSuffix == -1) {
data.fileSuffix = '' data.fileSuffix = ''
} }
console.log(data, 200)
getSmarttalkPage(data).then((res) => { getSmarttalkPage(data).then((res) => {
this.result.total = res.total this.result.total = res.total
this.result.list = res.rows this.result.list = res.rows
@ -83,7 +87,6 @@ export default defineStore('resource', {
}, },
changeTab(val) { changeTab(val) {
this.query.fileSource = val this.query.fileSource = val
this.getCreate()
this.handleQuery() this.handleQuery()
}, },
changeType(val) { changeType(val) {
@ -97,14 +100,6 @@ export default defineStore('resource', {
// 关键词搜索 // 关键词搜索
changeName() { changeName() {
this.handleQuery() this.handleQuery()
},
getCreate(){
if(this.query.fileSource == '平台'){
this.isCreate = hasPermission(['platformmanager'])
}
else{
this.isCreate = hasPermission(['schoolteacher','headmaster'])
}
} }
} }
}) })