/******************************************************************************* * Copyright(c) 2022 dongke All rights reserved. / Confidential * 类的信息: * 1.程序名称: * 编辑履历: * 作者 日期 版本 修改内容 * 周兴 2024-3-12 1.00 底部工具栏-保存 *******************************************************************************/ const util = require('@/utils/util.js') Component({ /** * 组件的属性列表 */ properties: { // 按钮 buttonList: { type: Array, }, // 内容 contentList: { type: Array, }, // 内容是否一行显示 contentLineFlag: { type: Boolean, }, // 按钮自动宽度 btnAutoWidthFlag: { type: Boolean, }, checkFlag: { type: Boolean, value: false, }, // 按钮是居右 btnRightFlag: { type: Boolean, }, cssType: { //css 样式 type: String, value: 'default' }, countName: { type: String, value: '数量' }, countEnd: { type: String, value: '件' }, // loading:{ // type:Boolean, // value:false // }, // 结果集 value: { type: String, observer: function (newVal) { if (newVal) { this.setData({ form: JSON.parse(newVal) || {} }) } else { this.setData({ form: {} }) } } }, }, /** * 组件的初始数据 */ data: { form: {}, }, /** * 组件生命周期 */ lifetimes: { attached: function () { // 防抖 this.submit = util.debounce(this.submit, this); }, detached: function () { // 在组件实例被从页面节点树移除时执行 }, }, /** * 组件的方法列表 */ methods: { /** * @desc : 修改复选框的值 * @author : 周兴 * @date : 2024/2/2 11:46 */ change(e) { if (this.data.checkFlag) { return } let code = e.currentTarget.dataset.code let form = this.data.form form[code] = e.detail this.setData({ form: form, value: JSON.stringify(form) }) this.triggerEvent("change", { code: code }) }, /** * @desc : 点击按钮 * @author : 周兴 * @date : 2024/2/2 11:46 */ submit(e) { let item = e.currentTarget.dataset.item this.triggerEvent("open", { name: item.code, customUrl: item.customUrl }) }, } })