|
@@ -3,7 +3,11 @@ import { CaSendParams, sendBatchByCode, sendByCode } from "@/api/ca/ca-api";
|
|
|
import { isDev } from "@/utils/public";
|
|
|
import { useUserStore } from "@/pinia/user-store";
|
|
|
import XEUtils from "xe-utils";
|
|
|
-import { useDialog } from "@/components/cy/CyDialog/index";
|
|
|
+import {
|
|
|
+ CloseValue,
|
|
|
+ DialogState,
|
|
|
+ useDialog,
|
|
|
+} from "@/components/cy/CyDialog/index";
|
|
|
import {
|
|
|
EmrStore,
|
|
|
rightCompIndex,
|
|
@@ -36,6 +40,103 @@ export type SignComp = {
|
|
|
signOpinion: string;
|
|
|
};
|
|
|
|
|
|
+export const authorizedSignatureDataElement = () => {
|
|
|
+ return {
|
|
|
+ required: false,
|
|
|
+ readonly: false,
|
|
|
+ deletable: true,
|
|
|
+ privacy: false,
|
|
|
+ script: {
|
|
|
+ content: null,
|
|
|
+ dynamicScript: "2154eae0167611ef8717efceee160e36",
|
|
|
+ },
|
|
|
+ format: {
|
|
|
+ dataType: null,
|
|
|
+ showType: null,
|
|
|
+ minLength: null,
|
|
|
+ maxLength: null,
|
|
|
+ minRows: null,
|
|
|
+ maxRows: null,
|
|
|
+ scale: null,
|
|
|
+ enums: null,
|
|
|
+ dictionary: null,
|
|
|
+ },
|
|
|
+ element: {
|
|
|
+ id: "ff105fe08f7a11ef865875b608250cef",
|
|
|
+ type: "element",
|
|
|
+ name: "授权CA签名",
|
|
|
+ code: {
|
|
|
+ business: "",
|
|
|
+ internal: "授权CA签名",
|
|
|
+ dataElement: "",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tips: "授权CA签名",
|
|
|
+ borderStyle: "none",
|
|
|
+ style: {
|
|
|
+ id: "e6aRxaE7OLt",
|
|
|
+ },
|
|
|
+ picker: {
|
|
|
+ type: null,
|
|
|
+ propertiesConfig: {
|
|
|
+ signCount: {
|
|
|
+ name: "签名数量",
|
|
|
+ code: "signCount",
|
|
|
+ category: "extend",
|
|
|
+ categoryName: "扩展",
|
|
|
+ value: 1,
|
|
|
+ editor: {
|
|
|
+ type: "numberfield",
|
|
|
+ minvalue: 1,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ maxHeight: {
|
|
|
+ name: "最大高度",
|
|
|
+ code: "maxHeight",
|
|
|
+ category: "extend",
|
|
|
+ categoryName: "扩展",
|
|
|
+ editor: {
|
|
|
+ type: "numberfield",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ valign: {
|
|
|
+ name: "对齐方式",
|
|
|
+ code: "valign",
|
|
|
+ category: "extend",
|
|
|
+ categoryName: "扩展",
|
|
|
+ editor: {
|
|
|
+ type: "select",
|
|
|
+ valueField: "code",
|
|
|
+ displayField: "name",
|
|
|
+ store: {
|
|
|
+ type: "store",
|
|
|
+ fields: ["code", "name"],
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ code: "top",
|
|
|
+ name: "上对齐",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: "middle",
|
|
|
+ name: "中对齐",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: "bottom",
|
|
|
+ name: "下对齐",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ editable: false,
|
|
|
+ contentWrap: true,
|
|
|
+ signCount: 1,
|
|
|
+ type: "smarttext",
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
export const selectData = [
|
|
|
{
|
|
|
code: 1,
|
|
@@ -66,6 +167,17 @@ type saveType =
|
|
|
}
|
|
|
| any;
|
|
|
|
|
|
+const GenerateSignatureDialog = defineComponent({
|
|
|
+ setup() {},
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <div style={{ padding: "20px", textAlign: "center" }}>
|
|
|
+ 正在生成您的签名请稍后 ...
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
const us = useUserStore().userInfo;
|
|
|
|
|
|
export function getInternalByCode(
|
|
@@ -77,7 +189,7 @@ export function getInternalByCode(
|
|
|
const signatureControl = editor.getDataElements(code, false, true);
|
|
|
let data = signatureControl[name] as DataElementItem[];
|
|
|
if (!data) {
|
|
|
- return null;
|
|
|
+ return [];
|
|
|
}
|
|
|
if (!XEUtils.isArray(data)) {
|
|
|
data = [data];
|
|
@@ -100,14 +212,17 @@ function getViewById(editor: EditType, id: string) {
|
|
|
}
|
|
|
|
|
|
function dialog() {
|
|
|
- let tmpClose = (_value, _data) => {};
|
|
|
+ let tmpClose = (_value: CloseValue, _data) => {};
|
|
|
+ let value: DialogState;
|
|
|
|
|
|
- useDialog(<div>正在生成您的签名请稍后。。。</div>, {
|
|
|
+ useDialog(GenerateSignatureDialog, {
|
|
|
dialogProps: {
|
|
|
title: "生成签名中",
|
|
|
+ alignCenter: false,
|
|
|
},
|
|
|
- manuallyClose: cb => {
|
|
|
+ manuallyClose: (cb, v) => {
|
|
|
tmpClose = cb;
|
|
|
+ value = v;
|
|
|
},
|
|
|
}).then(XEUtils.noop);
|
|
|
|
|
@@ -115,6 +230,7 @@ function dialog() {
|
|
|
closed() {
|
|
|
tmpClose("confirm", null);
|
|
|
},
|
|
|
+ value,
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -237,19 +353,16 @@ export function emrCa() {
|
|
|
|
|
|
const oldSign = () => {
|
|
|
const signatureControl = getInternalByCode(editor, "自动签名", "business");
|
|
|
- if (signatureControl) {
|
|
|
- signatureControl.forEach(item => {
|
|
|
- const element = getViewById(editor, item.id);
|
|
|
- element.view.sign([
|
|
|
- {
|
|
|
- name: us.name,
|
|
|
- code: us.code,
|
|
|
- signature: `/doctorSignatureImage/${us.code}.png`,
|
|
|
- },
|
|
|
- ]);
|
|
|
- });
|
|
|
- console.log(signatureControl);
|
|
|
- }
|
|
|
+ signatureControl.forEach(item => {
|
|
|
+ const element = getViewById(editor, item.id);
|
|
|
+ element.view.sign([
|
|
|
+ {
|
|
|
+ name: us.name,
|
|
|
+ code: us.code,
|
|
|
+ signature: `/doctorSignatureImage/${us.code}.png`,
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
return {
|