UNPKG

@fmdevui/fm-dev

Version:

Page level components developed based on Element Plus.

212 lines (207 loc) 8.47 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); require('../../../stores/index.js'); var pinia = require('pinia'); var index = require('../../../utils/emit/index.js'); var userInfo = require('../../../stores/userInfo.js'); const _hoisted_1 = { class: "sendMessage-container" }; const _hoisted_2 = { style: { "color": "#fff" } }; const _hoisted_3 = { class: "dialog-footer" }; var _sfc_main = /* @__PURE__ */ vue.defineComponent({ __name: "sendMessage", props: { title: String }, setup(__props, { expose: __expose }) { const stores = userInfo.useUserInfo(); const { userInfos } = pinia.storeToRefs(stores); const props = __props; const ruleFormRef = vue.ref(); const state = vue.reactive({ isShowDialog: false, ruleForm: {} }); const openDialog = (row) => { ruleFormRef.value?.resetFields(); var receiveUser = JSON.parse(JSON.stringify(row)); state.ruleForm.receiveUserId = receiveUser.userId; state.ruleForm.receiveUserName = receiveUser.realName + "/" + receiveUser.userName; state.ruleForm.connectionId = receiveUser.connectionId; state.ruleForm.sendUserId = userInfos.value.loginId; state.isShowDialog = true; }; const submit = () => { ruleFormRef.value.validate(async (valid) => { if (!valid) return; index.default.emit("singarClientsSendMessage", state.ruleForm); }); }; __expose({ openDialog }); return (_ctx, _cache) => { const _component_ele_Edit = vue.resolveComponent("ele-Edit"); const _component_el_icon = vue.resolveComponent("el-icon"); const _component_el_input = vue.resolveComponent("el-input"); const _component_el_form_item = vue.resolveComponent("el-form-item"); const _component_el_col = vue.resolveComponent("el-col"); const _component_el_row = vue.resolveComponent("el-row"); const _component_el_form = vue.resolveComponent("el-form"); const _component_el_button = vue.resolveComponent("el-button"); const _component_el_dialog = vue.resolveComponent("el-dialog"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createVNode(_component_el_dialog, { modelValue: state.isShowDialog, "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.isShowDialog = $event), draggable: "", "close-on-click-modal": false, width: "900px" }, { header: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_2, [ vue.createVNode(_component_el_icon, { size: "16", style: { "margin-right": "3px", "display": "inline", "vertical-align": "middle" } }, { default: vue.withCtx(() => [ vue.createVNode(_component_ele_Edit) ]), _: 1 /* STABLE */ }), vue.createElementVNode( "span", null, vue.toDisplayString(props.title), 1 /* TEXT */ ) ]) ]), footer: vue.withCtx(() => [ vue.createElementVNode("span", _hoisted_3, [ vue.createVNode(_component_el_button, { type: "primary", icon: "ele-Position", onClick: submit }, { default: vue.withCtx(() => [ vue.createTextVNode( vue.toDisplayString(_ctx.$t("message.list.send")), 1 /* TEXT */ ) ]), _: 1 /* STABLE */ }) ]) ]), default: vue.withCtx(() => [ vue.createVNode(_component_el_form, { model: state.ruleForm, ref_key: "ruleFormRef", ref: ruleFormRef, "label-width": "auto" }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_row, { gutter: 10 }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_col, { xs: 24, sm: 12, md: 12, lg: 12, xl: 12, class: "mb20" }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_form_item, { label: _ctx.$t("message.list.recipient"), prop: "receiveUserName", rules: [{ required: true, message: _ctx.$t("message.list.recipientRequired"), trigger: "blur" }] }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_input, { modelValue: state.ruleForm.receiveUserName, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.ruleForm.receiveUserName = $event), placeholder: _ctx.$t("message.list.recipient"), disabled: "" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 /* STABLE */ }, 8, ["label", "rules"]) ]), _: 1 /* STABLE */ }), vue.createVNode(_component_el_col, { xs: 24, sm: 12, md: 12, lg: 12, xl: 12, class: "mb20" }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_form_item, { label: _ctx.$t("message.list.title"), prop: "title", rules: [{ required: true, message: _ctx.$t("message.list.titleRequired"), trigger: "blur" }] }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_input, { modelValue: state.ruleForm.title, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.ruleForm.title = $event), placeholder: _ctx.$t("message.list.title"), clearable: "" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 /* STABLE */ }, 8, ["label", "rules"]) ]), _: 1 /* STABLE */ }), vue.createVNode(_component_el_col, { xs: 24, sm: 24, md: 24, lg: 24, xl: 24, class: "mb20" }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_form_item, { label: _ctx.$t("message.list.content"), prop: "message", rules: [{ required: true, message: _ctx.$t("message.list.contentRequired"), trigger: "blur" }] }, { default: vue.withCtx(() => [ vue.createCommentVNode(' <Editor v-model:get-html="state.ruleForm.message" /> ') ]), _: 1 /* STABLE */ }, 8, ["label", "rules"]) ]), _: 1 /* STABLE */ }) ]), _: 1 /* STABLE */ }) ]), _: 1 /* STABLE */ }, 8, ["model"]) ]), _: 1 /* STABLE */ }, 8, ["modelValue"]) ]); }; } }); exports.default = _sfc_main;