"use strict"; const common_vendor = require("../../common/vendor.js"); const js_sdk_validator_uniIdLog = require("../../js_sdk/validator/uni-id-log.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: "uni-id-log", query: "", where: "", orderby: dbOrderBy, orderByFieldName: "", selectedIndexs: [], options: { pageSize, pageCurrent, filterData: { "type_localdata": [ { "value": "logout", "text": "logout" }, { "value": "login", "text": "login" }, { "value": "register", "text": "register" }, { "value": "reset-pwd", "text": "reset-pwd" }, { "value": "bind-mobile", "text": "bind-mobile" }, { "value": "bind-weixin", "text": "bind-weixin" }, { "value": "bind-qq", "text": "bind-qq" }, { "value": "bind-apple", "text": "bind-apple" }, { "value": "bind-alipay", "text": "bind-alipay" } ] }, ...js_sdk_validator_uniIdLog.enumConverter }, imageStyles: { width: 64, height: 64 }, exportExcel: { "filename": "uni-id-log.xls", "type": "xls", "fields": { "create_date": "create_date", "device_uuid": "device_uuid", "ip": "ip", "state": "state", "type": "type", "ua": "ua", "user_id": "user_id", "username": "username", "email": "email", "mobile": "mobile", "appid": "appid" } }, 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_uniIdLog.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_dateformat2 = common_vendor.resolveComponent("uni-dateformat"); 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_dateformat2 + _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_dateformat = () => "../../uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.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_dateformat + _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: "61cdfdb8-4-" + i0 + "," + ("61cdfdb8-3-" + i0), b: "61cdfdb8-5-" + i0 + "," + ("61cdfdb8-3-" + i0), c: "61cdfdb8-6-" + i0 + "," + ("61cdfdb8-3-" + i0), d: "61cdfdb8-7-" + i0 + "," + ("61cdfdb8-3-" + i0), e: "61cdfdb8-8-" + i0 + "," + ("61cdfdb8-3-" + i0), f: common_vendor.p({ align: "center", ["filter-type"]: "select", ["filter-data"]: options.filterData.type_localdata }), g: "61cdfdb8-9-" + i0 + "," + ("61cdfdb8-3-" + i0), h: "61cdfdb8-10-" + i0 + "," + ("61cdfdb8-3-" + i0), i: "61cdfdb8-11-" + i0 + "," + ("61cdfdb8-3-" + i0), j: "61cdfdb8-12-" + i0 + "," + ("61cdfdb8-3-" + i0), k: "61cdfdb8-13-" + i0 + "," + ("61cdfdb8-3-" + i0), l: "61cdfdb8-14-" + i0 + "," + ("61cdfdb8-3-" + i0), m: "61cdfdb8-15-" + i0 + "," + ("61cdfdb8-3-" + i0), n: "61cdfdb8-3-" + i0 + "," + ("61cdfdb8-2-" + i0), o: common_vendor.f(data, (item, index, i1) => { return { a: "61cdfdb8-18-" + i0 + "-" + i1 + "," + ("61cdfdb8-17-" + i0 + "-" + i1), b: common_vendor.p({ threshold: [0, 0], date: item.create_date }), c: "61cdfdb8-17-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), d: common_vendor.t(item.device_uuid), e: "61cdfdb8-19-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), f: common_vendor.t(item.ip), g: "61cdfdb8-20-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), h: common_vendor.t(item.state), i: "61cdfdb8-21-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), j: common_vendor.t(options.type_valuetotext[item.type]), k: "61cdfdb8-22-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), l: common_vendor.t(item.ua), m: "61cdfdb8-23-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), n: common_vendor.t(item.user_id), o: "61cdfdb8-24-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), p: common_vendor.t(item.username), q: "61cdfdb8-25-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), r: common_vendor.t(item.email), s: "61cdfdb8-26-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), t: common_vendor.t(item.mobile), v: "61cdfdb8-27-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), w: common_vendor.t(item.appid), x: "61cdfdb8-28-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), y: common_vendor.o(($event) => $options.navigateTo("./edit?id=" + item._id, false), index), z: common_vendor.o(($event) => $options.confirmDelete(item._id), index), A: "61cdfdb8-29-" + i0 + "-" + i1 + "," + ("61cdfdb8-16-" + i0 + "-" + i1), B: index, C: "61cdfdb8-16-" + i0 + "-" + i1 + "," + ("61cdfdb8-2-" + i0) }; }), p: common_vendor.sr("table", "61cdfdb8-2-" + i0 + ",61cdfdb8-1"), q: "61cdfdb8-2-" + i0 + ",61cdfdb8-1", r: common_vendor.p({ loading, emptyText: error.message || "没有更多数据", border: true, stripe: true, type: "selection" }), s: "61cdfdb8-30-" + i0 + ",61cdfdb8-1", t: common_vendor.o(($event) => pagination.current = $event), v: common_vendor.p({ ["show-icon"]: true, ["page-size"]: pagination.size, total: pagination.count, modelValue: pagination.current }), w: i0, x: s0 }; }, { name: "d", path: "i", vueId: "61cdfdb8-1" }), j: common_vendor.o(($event) => $options.filterChange($event, "create_date")), k: common_vendor.o(($event) => $options.sortChange($event, "create_date")), l: common_vendor.p({ align: "center", ["filter-type"]: "timestamp", sortable: true }), m: common_vendor.o(($event) => $options.filterChange($event, "device_uuid")), n: common_vendor.o(($event) => $options.sortChange($event, "device_uuid")), o: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), p: common_vendor.o(($event) => $options.filterChange($event, "ip")), q: common_vendor.o(($event) => $options.sortChange($event, "ip")), r: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), s: common_vendor.o(($event) => $options.filterChange($event, "state")), t: common_vendor.o(($event) => $options.sortChange($event, "state")), v: common_vendor.p({ align: "center", ["filter-type"]: "range", sortable: true }), w: common_vendor.o(($event) => $options.filterChange($event, "type")), x: common_vendor.o(($event) => $options.filterChange($event, "ua")), y: common_vendor.o(($event) => $options.sortChange($event, "ua")), z: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), A: common_vendor.o(($event) => $options.sortChange($event, "user_id")), B: common_vendor.p({ align: "center", sortable: true }), C: common_vendor.o(($event) => $options.filterChange($event, "username")), D: common_vendor.o(($event) => $options.sortChange($event, "username")), E: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), F: common_vendor.o(($event) => $options.filterChange($event, "email")), G: common_vendor.o(($event) => $options.sortChange($event, "email")), H: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), I: common_vendor.o(($event) => $options.filterChange($event, "mobile")), J: common_vendor.o(($event) => $options.sortChange($event, "mobile")), K: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), L: common_vendor.o(($event) => $options.filterChange($event, "appid")), M: common_vendor.o(($event) => $options.sortChange($event, "appid")), N: common_vendor.p({ align: "center", ["filter-type"]: "search", sortable: true }), 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.p({ align: "center" }), X: common_vendor.p({ align: "center" }), Y: common_vendor.p({ align: "center" }), Z: common_vendor.p({ align: "center" }), aa: common_vendor.p({ align: "center" }), ab: common_vendor.o($options.selectionChange), ac: common_vendor.o($options.onPageChanged), ad: common_vendor.sr("udb", "61cdfdb8-1"), ae: common_vendor.o($options.onqueryload), af: common_vendor.p({ collection: $data.collectionList, field: "create_date,device_uuid,ip,state,type,ua,user_id,username,email,mobile,appid", 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/uni-id-log/list.js.map