// component/teacher/teacherFile/teacherFile.ts import { httpUtil } from '../../../utils/restful' Component({ /** * 组件的属性列表 */ properties: { }, /** * 组件的初始数据 */ data: { fileList: [], hiddenInput: false, inputText: '' }, lifetimes: { attached: function () { // 在组件实例被从页面节点树添加时执行 this.getLessAll() }, detached: function () { // 在组件实例被从页面节点树移除时执行 }, }, /** * 组件的方法列表 */ methods: { getLessAll: function () { let params = { pageNo: 1, pageSize: 10000, title: this.data.inputText } httpUtil.wxGet(httpUtil.interfaces.createLess, params).then((res: any) => { console.log("获取所有文件库成功", res) this.setData({ fileList: res.data.data.list }) }).catch((res) => { console.log("获取所有文件库失败:", res) }) }, inputSearch: function (e) { let content = e.detail.value['search - input'] ? e.detail.value['search - input'] : e.detail.value this.setData({ inputText: content }) console.log(" this.data.inputText:", this.data.inputText) this.getLessAll() }, showWindow: function (event: any) { // console.log("点击了更多的按钮:", event) this.triggerEvent("showWindow", { item: event.detail.item }) this.setData({ hiddenInput: true }) }, hideWindow: function () { console.log("hideWindow-- -- -- --") this.setData({ hiddenInput: false }) }, realod: function () { this.getLessAll() } } })