"use strict"; const common_vendor = require("../../common/vendor.js"); const js_sdk_validator_cmsTemp = require("../../js_sdk/validator/cms-temp.js"); const db = common_vendor.er.database(); const dbOrderBy = ""; const dbSearchFields = []; const pageSize = 20; const pageCurrent = 1; const orderByMapping = { "ascending": "asc", "descending": "desc" }; const _sfc_main = { data() { return { collectionList: "cms-temp", query: "", where: "", orderby: dbOrderBy, orderByFieldName: "", selectedIndexs: [], options: { pageSize, pageCurrent, filterData: {}, ...js_sdk_validator_cmsTemp.enumConverter }, imageStyles: { width: 64, height: 64 }, exportExcel: { "filename": "cms-temp.xls", "type": "xls", "fields": { "font_color": "font_color", "backgrond_color": "backgrond_color", "select_src": "select_src", "temptele_src": "temptele_src", "temptele_name": "temptele_name", "select_icon_color": "select_icon_color", "icon_color": "icon_color", "user_name_color": "user_name_color", "btn_color": "btn_color" } }, exportExcelData: [] }; }, onLoad() { this._filter = {}; }, onReady() { this.$refs.udb.loadData(); }, methods: { onqueryload(data) { this.exportExcelData = data; }, getWhere() { const query = this.query.trim(); if (!query) { return ""; } const queryRe = new RegExp(query, "i"); return dbSearchFields.map((name) => queryRe + ".test(" + name + ")").join(" || "); }, search() { const newWhere = this.getWhere(); this.where = newWhere; this.$nextTick(() => { this.loadData(); }); }, loadData(clear = true) { this.$refs.udb.loadData({ clear }); }, onPageChanged(e) { this.selectedIndexs.length = 0; this.$refs.table.clearSelection(); this.$refs.udb.loadData({ current: e.current }); }, navigateTo(url, clear) { common_vendor.index.navigateTo({ url, events: { refreshData: () => { this.loadData(clear); } } }); }, // 多选处理 selectedItems() { var dataList = this.$refs.udb.dataList; return this.selectedIndexs.map((i) => dataList[i]._id); }, // 批量删除 delTable() { this.$refs.udb.remove(this.selectedItems(), { success: (res) => { this.$refs.table.clearSelection(); } }); }, // 多选 selectionChange(e) { this.selectedIndexs = e.detail.index; }, confirmDelete(id) { this.$refs.udb.remove(id, { success: (res) => { this.$refs.table.clearSelection(); } }); }, sortChange(e, name) { this.orderByFieldName = name; if (e.order) { this.orderby = name + " " + orderByMapping[e.order]; } else { this.orderby = ""; } this.$refs.table.clearSelection(); this.$nextTick(() => { this.$refs.udb.loadData(); }); }, filterChange(e, name) { this._filter[name] = { type: e.filterType, value: e.filter }; let newWhere = js_sdk_validator_cmsTemp.filterToWhere(this._filter, db.command); if (Object.keys(newWhere).length) { this.where = newWhere; } else { this.where = ""; } this.$nextTick(() => { this.$refs.udb.loadData(); }); } } }; if (!Array) { const _easycom_download_excel2 = common_vendor.resolveComponent("download-excel"); const _easycom_uni_th2 = common_vendor.resolveComponent("uni-th"); const _easycom_uni_tr2 = common_vendor.resolveComponent("uni-tr"); const _easycom_uni_td2 = common_vendor.resolveComponent("uni-td"); const _easycom_uni_table2 = common_vendor.resolveComponent("uni-table"); const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination"); const _easycom_unicloud_db2 = common_vendor.resolveComponent("unicloud-db"); (_easycom_download_excel2 + _easycom_uni_th2 + _easycom_uni_tr2 + _easycom_uni_td2 + _easycom_uni_table2 + _easycom_uni_pagination2 + _easycom_unicloud_db2)(); } const _easycom_download_excel = () => "../../components/download-excel/download-excel.js"; const _easycom_uni_th = () => "../../uni_modules/uni-table/components/uni-th/uni-th.js"; const _easycom_uni_tr = () => "../../uni_modules/uni-table/components/uni-tr/uni-tr.js"; const _easycom_uni_td = () => "../../uni_modules/uni-table/components/uni-td/uni-td.js"; const _easycom_uni_table = () => "../../uni_modules/uni-table/components/uni-table/uni-table.js"; const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js"; const _easycom_unicloud_db = () => "../../node-modules/@dcloudio/uni-components/lib/unicloud-db/unicloud-db.js"; if (!Math) { (_easycom_download_excel + _easycom_uni_th + _easycom_uni_tr + _easycom_uni_td + _easycom_uni_table + _easycom_uni_pagination + _easycom_unicloud_db)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return { a: common_vendor.o((...args) => $options.search && $options.search(...args)), b: $data.query, c: common_vendor.o(($event) => $data.query = $event.detail.value), d: common_vendor.o((...args) => $options.search && $options.search(...args)), e: common_vendor.o(($event) => $options.navigateTo("./add")), f: !$data.selectedIndexs.length, g: common_vendor.o((...args) => $options.delTable && $options.delTable(...args)), h: common_vendor.p({ fields: $data.exportExcel.fields, data: $data.exportExcelData, type: $data.exportExcel.type, name: $data.exportExcel.filename }), i: common_vendor.w(({ data, pagination, loading, error, options }, s0, i0) => { return { a: "ac9c780a-4-" + i0 + "," + ("ac9c780a-3-" + i0), b: "ac9c780a-5-" + i0 + "," + ("ac9c780a-3-" + i0), c: "ac9c780a-6-" + i0 + "," + ("ac9c780a-3-" + i0), d: "ac9c780a-7-" + i0 + "," + ("ac9c780a-3-" + i0), e: "ac9c780a-8-" + i0 + "," + ("ac9c780a-3-" + i0), f: "ac9c780a-9-" + i0 + "," + ("ac9c780a-3-" + i0), g: "ac9c780a-10-" + i0 + "," + ("ac9c780a-3-" + i0), h: "ac9c780a-11-" + i0 + "," + ("ac9c780a-3-" + i0), i: "ac9c780a-12-" + i0 + "," + ("ac9c780a-3-" + i0), j: "ac9c780a-13-" + i0 + "," + ("ac9c780a-3-" + i0), k: "ac9c780a-3-" + i0 + "," + ("ac9c780a-2-" + i0), l: common_vendor.f(data, (item, index, i1) => { return { a: common_vendor.t(item.font_color), b: "ac9c780a-15-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), c: common_vendor.t(item.backgrond_color), d: "ac9c780a-16-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), e: common_vendor.t(item.select_src), f: "ac9c780a-17-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), g: common_vendor.t(item.temptele_src), h: "ac9c780a-18-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), i: common_vendor.t(item.temptele_name), j: "ac9c780a-19-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), k: common_vendor.t(item.select_icon_color), l: "ac9c780a-20-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), m: common_vendor.t(item.icon_color), n: "ac9c780a-21-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), o: common_vendor.t(item.user_name_color), p: "ac9c780a-22-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), q: common_vendor.t(item.btn_color), r: "ac9c780a-23-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), s: common_vendor.o(($event) => $options.navigateTo("./edit?id=" + item._id, false), index), t: common_vendor.o(($event) => $options.confirmDelete(item._id), index), v: "ac9c780a-24-" + i0 + "-" + i1 + "," + ("ac9c780a-14-" + i0 + "-" + i1), w: index, x: "ac9c780a-14-" + i0 + "-" + i1 + "," + ("ac9c780a-2-" + i0) }; }), m: common_vendor.sr("table", "ac9c780a-2-" + i0 + ",ac9c780a-1"), n: "ac9c780a-2-" + i0 + ",ac9c780a-1", o: common_vendor.p({ loading, emptyText: error.message || "没有更多数据", border: true, stripe: true, type: "selection" }), p: "ac9c780a-25-" + i0 + ",ac9c780a-1", q: common_vendor.o(($event) => pagination.current = $event), r: common_vendor.p({ ["show-icon"]: true, ["page-size"]: pagination.size, total: pagination.count, modelValue: pagination.current }), s: i0, t: s0 }; }, { name: "d", path: "i", vueId: "ac9c780a-1" }), j: common_vendor.o(($event) => $options.filterChange($event, "font_color")), k: common_vendor.o(($event) => $options.sortChange($event, "font_color")), l: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), m: common_vendor.o(($event) => $options.filterChange($event, "backgrond_color")), n: common_vendor.o(($event) => $options.sortChange($event, "backgrond_color")), o: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), p: common_vendor.o(($event) => $options.filterChange($event, "select_src")), q: common_vendor.o(($event) => $options.sortChange($event, "select_src")), r: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), s: common_vendor.o(($event) => $options.filterChange($event, "temptele_src")), t: common_vendor.o(($event) => $options.sortChange($event, "temptele_src")), v: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), w: common_vendor.o(($event) => $options.filterChange($event, "temptele_name")), x: common_vendor.o(($event) => $options.sortChange($event, "temptele_name")), y: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), z: common_vendor.o(($event) => $options.filterChange($event, "select_icon_color")), A: common_vendor.o(($event) => $options.sortChange($event, "select_icon_color")), B: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), C: common_vendor.o(($event) => $options.filterChange($event, "icon_color")), D: common_vendor.o(($event) => $options.sortChange($event, "icon_color")), E: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), F: common_vendor.o(($event) => $options.filterChange($event, "user_name_color")), G: common_vendor.o(($event) => $options.sortChange($event, "user_name_color")), H: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), I: common_vendor.o(($event) => $options.filterChange($event, "btn_color")), J: common_vendor.o(($event) => $options.sortChange($event, "btn_color")), K: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), L: common_vendor.p({ align: "center" }), M: common_vendor.p({ align: "center" }), N: common_vendor.p({ align: "center" }), O: common_vendor.p({ align: "center" }), P: common_vendor.p({ align: "center" }), Q: common_vendor.p({ align: "center" }), R: common_vendor.p({ align: "center" }), S: common_vendor.p({ align: "center" }), T: common_vendor.p({ align: "center" }), U: common_vendor.p({ align: "center" }), V: common_vendor.p({ align: "center" }), W: common_vendor.o($options.selectionChange), X: common_vendor.o($options.onPageChanged), Y: common_vendor.sr("udb", "ac9c780a-1"), Z: common_vendor.o($options.onqueryload), aa: common_vendor.p({ collection: $data.collectionList, field: "font_color,backgrond_color,select_src,temptele_src,temptele_name,select_icon_color,icon_color,user_name_color,btn_color", where: $data.where, ["page-data"]: "replace", orderby: $data.orderby, getcount: true, ["page-size"]: $data.options.pageSize, ["page-current"]: $data.options.pageCurrent, options: $data.options, loadtime: "manual" }) }; } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cms-temp/list.js.map