2025-04-14 10:57:27 +08:00

59 lines
1.9 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
const _easycom_uni_data_select2 = common_vendor.resolveComponent("uni-data-select");
_easycom_uni_data_select2();
}
const _easycom_uni_data_select = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-data-select/uni-data-select.js";
if (!Math) {
_easycom_uni_data_select();
}
const _sfc_main = {
__name: "selectOperation",
props: /* @__PURE__ */ common_vendor.mergeModels(["placeholder", "disabled"], {
"modelValue": {
type: String
},
"modelModifiers": {}
}),
emits: ["update:modelValue"],
setup(__props) {
const selVaule = common_vendor.useModel(__props, "modelValue");
const range = common_vendor.ref([]);
const userZone = common_vendor.index.getStorageSync("userZone");
const userOperation = common_vendor.index.getStorageSync("userOperation");
for (let i = 0, len = userZone.length; i < len; i++) {
const item = userZone[i];
for (let j = 0, len2 = userOperation.length; j < len2; j++) {
const oitem = userOperation[j];
if (oitem.zoneId != item.id)
continue;
const sitem = {
value: oitem.regionId,
text: item.name + "-" + oitem.regionName
};
range.value.push(sitem);
}
}
const onchange = (value) => {
if (value == "")
return;
selVaule.value = value;
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(onchange),
b: common_vendor.o(($event) => selVaule.value = $event),
c: common_vendor.p({
localdata: range.value,
placeholder: __props.placeholder,
disabled: __props.disabled,
modelValue: selVaule.value
})
};
};
}
};
wx.createComponent(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/selectOperation/selectOperation.js.map