UNPKG

yuang-framework-ui-pc

Version:

yuang-framework-ui-pc Library

60 lines (59 loc) 2.61 kB
import { defineComponent, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, unref, isRef } from "vue"; import RoleDialog from "./components/role-dialog"; import { Select } from "@element-plus/icons-vue"; import { http } from "yuang-framework-ui-common/lib/config/httpConfig"; import { useFrameworkBaseDialog } from "yuang-framework-ui-common/lib/hooks/framework/frameworkBaseDialogHooks"; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "YuUimsRoleDialog" }, __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 } = useFrameworkBaseDialog(props, emit, { defaultParam: { // 是否禁止选择已存在用户的角色 isDisableSelectRoleOfExistsUser: true }, selectInfo: async (id) => { const res = await http.get(`/uims-api/admin/uims-role/selectInfo`, { params: { id } }); return res.data.data; }, selectInfoList: async (idList) => { const res = await http.post(`/uims-api/admin/uims-role/selectInfoList`, idList); return res.data.data; } }); __expose({ showDialog }); return (_ctx, _cache) => { const _component_el_input = resolveComponent("el-input"); return openBlock(), createElementBlock(Fragment, null, [ unref(componentParam).isShowInput ? (openBlock(), createBlock(_component_el_input, { key: 0, modelValue: unref(inputValue), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(inputValue) ? inputValue.value = $event : null), "suffix-icon": unref(Select), disabled: unref(componentParam).isDisabled, readonly: unref(componentParam).isReadonly, onClick: unref(showDialog) }, null, 8, ["modelValue", "suffix-icon", "disabled", "readonly", "onClick"])) : createCommentVNode("", true), unref(isShowDialog) ? (openBlock(), createBlock(RoleDialog, { key: 1, modelValue: unref(isShowDialog), "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(isShowDialog) ? isShowDialog.value = $event : null), param: unref(componentParam), onChange: unref(handleChange) }, null, 8, ["modelValue", "param", "onChange"])) : createCommentVNode("", true) ], 64); }; } }); export { _sfc_main as default };