1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- // pages/document/document.ts
- import { httpUtil } from "../../utils/restful"
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- lessId: '',
- itemList: null
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.setData({
- lessId: options.lessId
- })
- this.getDocumentAll();
- console.log("this.data.itemList:", this.data.itemList)
- },
- showActionWindow: function (evnet: any) {
- console.log("event:", evnet.detail.item)
- this.selectComponent("#popupwindow").showModal(evnet.detail.item, 1)
- },
- fileDel: function () {
- //文件删除了就重新请求刷新一下
- this.getDocumentAll();
- },
- getDocumentAll() {
- //根据ID查询文件库下所有文件
- let params = {
- lessId: this.data.lessId,
- userId: httpUtil.httpData.userId,
- pageNo: 1,
- pageSize: 100000,
- }
- httpUtil.wxGet(httpUtil.interfaces.getDocumentFile, params).then((res: any) => {
- console.log("获取所有文件成功:", res)
- this.setData({
- itemList: res.data.data.list
- })
- }).catch((res) => {
- console.log("获取所有文件失败:", res)
- })
- }
- })
|