yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
59 lines (58 loc) • 2.67 kB
JavaScript
"use strict";
const vue = require("vue");
const iconsVue = require("@element-plus/icons-vue");
const UserDialog = require("./components/user-dialog");
const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
const frameworkBaseDialogHooks = require("yuang-framework-ui-common/lib/hooks/framework/frameworkBaseDialogHooks");
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...{ name: "YuUimsUserDialog" },
__name: "index",
props: {
modelValue: { default: "" },
param: { default: {} }
},
emits: ["change"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emit = __emit;
const { inputValue, isShowDialog, componentParam, showDialog, handleChange } = frameworkBaseDialogHooks.useFrameworkBaseDialog(props, emit, {
defaultParam: {
// 是否禁止选择已存在角色的用户
isDisableSelectUserOfExistsRole: true
},
selectInfo: async (id) => {
const res = await httpConfig.http.get(`/uims-api/admin/uims-user/selectInfo`, { params: { id } });
return res.data.data;
},
selectInfoList: async (idList) => {
const res = await httpConfig.http.post(`/uims-api/admin/uims-user/selectInfoList`, idList);
return res.data.data;
}
});
__expose({
showDialog
});
return (_ctx, _cache) => {
const _component_el_input = vue.resolveComponent("el-input");
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
vue.unref(componentParam).isShowInput ? (vue.openBlock(), vue.createBlock(_component_el_input, {
key: 0,
modelValue: vue.unref(inputValue),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(inputValue) ? inputValue.value = $event : null),
"suffix-icon": vue.unref(iconsVue.Select),
disabled: vue.unref(componentParam).isDisabled,
readonly: vue.unref(componentParam).isReadonly,
onClick: vue.unref(showDialog)
}, null, 8, ["modelValue", "suffix-icon", "disabled", "readonly", "onClick"])) : vue.createCommentVNode("", true),
vue.unref(isShowDialog) ? (vue.openBlock(), vue.createBlock(UserDialog, {
key: 1,
modelValue: vue.unref(isShowDialog),
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(isShowDialog) ? isShowDialog.value = $event : null),
param: vue.unref(componentParam),
onChange: vue.unref(handleChange)
}, null, 8, ["modelValue", "param", "onChange"])) : vue.createCommentVNode("", true)
], 64);
};
}
});
module.exports = _sfc_main;