提交 d612298f 编写于 作者: RedPig97's avatar RedPig97

update: 更新

上级 59b4e4d1
...@@ -11,49 +11,39 @@ ...@@ -11,49 +11,39 @@
:readonly="{{item.psEditor.readOnly}}" :readonly="{{item.psEditor.readOnly}}"
{{/if}} {{/if}}
{{#eq item.psEditor.editorType "DATEPICKEREX"}} {{#eq item.psEditor.editorType "DATEPICKEREX"}}
valueFormat="yyyy-MM-dd HH:mm:ss" dateFormat="YYYY-MM-DD HH:mm:ss"
picker="date" dateType="dateTime"
mode="date"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_NOTIME"}} {{#eq item.psEditor.editorType "DATEPICKEREX_NOTIME"}}
valueFormat="yyyy-MM-dd" dateFormat="YYYY-MM-DD"
picker="date" dateType="date"
mode="date"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKER"}} {{#eq item.psEditor.editorType "DATEPICKER"}}
valueFormat="yyyy-MM-dd HH:mm:ss" dateFormat="YYYY-MM-DD HH:mm:ss"
picker="date" dateType="dateTime"
mode="time"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_HOUR"}} {{#eq item.psEditor.editorType "DATEPICKEREX_HOUR"}}
valueFormat="yyyy-MM-dd HH" dateFormat="YYYY-MM-DD HH"
picker="date" dateType="dateTime"
mode="time"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_MINUTE"}} {{#eq item.psEditor.editorType "DATEPICKEREX_MINUTE"}}
valueFormat="yyyy-MM-dd HH:mm" dateFormat="YYYY-MM-DD HH:mm"
picker="time" dateType="dateTime"
mode="date"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_SECOND"}} {{#eq item.psEditor.editorType "DATEPICKEREX_SECOND"}}
valueFormat="yyyy-MM-dd HH:mm:ss" dateFormat="YYYY-MM-DD HH:mm:ss"
picker="time" dateType="dateTime"
mode="date"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_NODAY"}} {{#eq item.psEditor.editorType "DATEPICKEREX_NODAY"}}
valueFormat="HH:mm:ss" dateFormat="HH:mm:ss"
picker="date" dateType="time"
mode="date"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_NODAY_NOSECOND"}} {{#eq item.psEditor.editorType "DATEPICKEREX_NODAY_NOSECOND"}}
valueFormat="HH:mm" dateFormat="HH:mm"
picker="date" dateType="time"
mode="date"
{{/eq}} {{/eq}}
{{#eq item.psEditor.editorType "DATEPICKEREX_NOSECOND"}} {{#eq item.psEditor.editorType "DATEPICKEREX_NOSECOND"}}
valueFormat="yyyy-MM-dd HH:mm" dateFormat="YYYY-MM-DD HH:mm"
picker="date" dateType="dateTime"
mode="date"
{{/eq}} {{/eq}}
@editorEvent="handleEditorEvent"/> @editorEvent="handleEditorEvent"/>
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, Ref, ref } from "vue"; import { onBeforeMount, Ref, ref } from "vue";
import { handleEditorNavParams, deepCopy, IParam, IActionParam } from "@ibiz-core"; import { deepCopy, IParam, IActionParam, EditorBase } from "@ibiz-core";
interface AutoCompleteProps { interface AutoCompleteProps {
/** /**
* @description 表单数据或表格行数据 * @description 表单数据或表格行数据
...@@ -84,6 +84,7 @@ interface AutoCompleteProps { ...@@ -84,6 +84,7 @@ interface AutoCompleteProps {
interface EditorEmit { interface EditorEmit {
(name: "editorEvent", value: IActionParam): void; (name: "editorEvent", value: IActionParam): void;
} }
const { handleEditorNavParams } = new EditorBase();
const props = withDefaults(defineProps<AutoCompleteProps>(), { const props = withDefaults(defineProps<AutoCompleteProps>(), {
deMajorField: "srfmajortext", deMajorField: "srfmajortext",
deKeyField: "srfkey", deKeyField: "srfkey",
......
<script setup lang="ts"> <script setup lang="ts">
import { import {
handleEditorNavParams, EditorBase,
handleLevelCodeList,
loadCodeListData,
IActionParam, IActionParam,
IParam IParam
} from "@ibiz-core"; } from "@ibiz-core";
...@@ -132,6 +130,7 @@ const props = withDefaults(defineProps<CheckboxListProps>(), { ...@@ -132,6 +130,7 @@ const props = withDefaults(defineProps<CheckboxListProps>(), {
mode: "string", mode: "string",
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const { handleEditorNavParams, handleLevelCodeList, loadCodeListData } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
let items: Ref<IParam[]> = ref([]); let items: Ref<IParam[]> = ref([]);
const selectArray: Ref<boolean> = computed(() => { const selectArray: Ref<boolean> = computed(() => {
......
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, Ref, ref } from "vue"; import { onBeforeMount, Ref, ref } from "vue";
import { handleEditorNavParams, deepCopy, openLinkView, openPickUpView, IParam, IActionParam } from "@ibiz-core"; import { deepCopy, IParam, IActionParam, EditorBase } from "@ibiz-core";
interface DataPickerProps { interface DataPickerProps {
/** /**
* @description 编辑器名称 * @description 编辑器名称
...@@ -95,6 +95,7 @@ const props = withDefaults(defineProps<DataPickerProps>(), { ...@@ -95,6 +95,7 @@ const props = withDefaults(defineProps<DataPickerProps>(), {
deKeyField: 'srfkey', deKeyField: 'srfkey',
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const { handleEditorNavParams, openLinkView, openPickUpView } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
let items: Ref<any[]> = ref([]); let items: Ref<any[]> = ref([]);
...@@ -200,7 +201,7 @@ onBeforeMount(() => { ...@@ -200,7 +201,7 @@ onBeforeMount(() => {
<select-outlined v-if="linkView" @click="openLinkView"/> <select-outlined v-if="linkView" @click="openLinkView"/>
</template> </template>
<a-select-option v-for="(item, index) in items" :key="index" :value="item[deKeyField]"> <a-select-option v-for="(item, index) in items" :key="index" :value="item[deKeyField]">
{{item[deMajorField]}} \{{item[deMajorField]}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</template> </template>
......
<script setup lang="ts"> <script setup lang="ts">
import { IActionParam } from "@ibiz-core"; import { IActionParam } from '@ibiz-core';
import { computed, Ref } from "vue"; // import dayjs from 'ant-design-vue/lib/time-picker/dayjs';
import { computed, Ref } from 'vue';
import dayjs, { Dayjs } from 'dayjs';
interface DatePickerProps { interface DatePickerProps {
/** /**
* checked选中状态 * checked选中状态
* *
* @type {number} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
value: number; value: string;
/** /**
* checked选中状态 * checked选中状态
...@@ -19,20 +21,20 @@ interface DatePickerProps { ...@@ -19,20 +21,20 @@ interface DatePickerProps {
name: string; name: string;
/** /**
* 日期面板的状态 * 设置选择器类型
* *
* @type {string} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
mode: 'time' | 'date' | 'month' | 'year' | 'decade'; dateFormat: string;
/** /**
* 设置选择器类型 * 时间类型
* *
* @type {string} * @type {string}
* @memberof DatePickerProps * @memberof DatePickerProps
*/ */
picker: 'date' | 'week' | 'month' | 'quarter' | 'year'; dateType: 'time' | 'date' | 'dateTime';
/** /**
* 提示信息 * 提示信息
...@@ -56,37 +58,71 @@ interface DatePickerProps { ...@@ -56,37 +58,71 @@ interface DatePickerProps {
* @type {boolean} * @type {boolean}
*/ */
readonly?: boolean; readonly?: boolean;
} }
interface EditorEmit { interface EditorEmit {
(name: "editorEvent", value: IActionParam): void; (name: 'editorEvent', value: IActionParam): void;
} }
const props = withDefaults(defineProps<DatePickerProps>(), { const props = withDefaults(defineProps<DatePickerProps>(), {
disabled: false, disabled: false,
readonly: false, readonly: false,
picker: 'date', picker: 'date',
dateType: 'date',
dateFormat: 'yyyy-MM-dd HH:mm:ss',
placeholder: '请选择日期',
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const onChange = (value: number) => { const curValue: Ref<any> = props.value ? ref<Dayjs>(dayjs(props.value, props.dateFormat)) : ref('');
emit("editorEvent", { const onChange = (date: string, dateString: string) => {
emit('editorEvent', {
tag: props.name, tag: props.name,
action: "valueChange", action: 'valueChange',
data: value ? 1 : 0, data: dateString,
}); });
}; };
</script> </script>
<template> <template>
<a-date-picker <template v-if="dateType === 'time'">
:class="['app-editor-container', `app-date-picker-${name}`]" <a-time-picker
:mode="mode" :class="['app-date-picker', `app-date-picker--${name}`]"
:picker="picker" v-model:value="curValue"
:placeholder="placeholder" :format="dateFormat"
:inputReadOnly="readonly" :placeholder="placeholder"
:disabled="disabled"/> :inputReadOnly="readonly"
:disabled="disabled"
@change="onChange"
/>
</template>
<template v-else-if="dateType === 'date'">
<a-date-picker
:class="['app-date-picker', `app-date-picker--${name}`]"
v-model:value="curValue"
:format="dateFormat"
picker="date"
:placeholder="placeholder"
:inputReadOnly="readonly"
:disabled="disabled"
@change="onChange"
/>
</template>
<template v-else>
<a-date-picker
showTime
:class="['app-date-picker', `app-date-picker--${name}`]"
v-model:value="curValue"
:format="dateFormat"
:placeholder="placeholder"
:inputReadOnly="readonly"
:disabled="disabled"
@change="onChange"
/>
</template>
</template> </template>
<style scoped> <style lang="scss">
.app-date-picker {
width: 100%;
}
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeMount, Ref, ref } from "vue"; import { onBeforeMount, Ref, ref } from "vue";
import { IActionParam, IParam, handleEditorNavParams, typeOf, loadCodeListData, handleLevelCodeList } from "@ibiz-core"; import { IActionParam, IParam, typeOf, EditorBase } from "@ibiz-core";
interface DropdownListProps { interface DropdownListProps {
/** /**
...@@ -79,6 +79,7 @@ const props = withDefaults(defineProps<DropdownListProps>(), { ...@@ -79,6 +79,7 @@ const props = withDefaults(defineProps<DropdownListProps>(), {
}) })
const emit = defineEmits<EditorEmit>() const emit = defineEmits<EditorEmit>()
const { handleEditorNavParams, loadCodeListData, handleLevelCodeList } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
let curValue: Ref<any> = ref( let curValue: Ref<any> = ref(
props.multiple ? props.multiple ?
......
<script setup lang="ts"> <script setup lang="ts">
import { import {
handleEditorNavParams,
handleLevelCodeList,
loadCodeListData,
IActionParam, IActionParam,
IParam IParam,
EditorBase
} from "@ibiz-core"; } from "@ibiz-core";
import { onBeforeMount, ref, Ref } from "vue"; import { onBeforeMount, ref, Ref } from "vue";
interface RadioGroupProps { interface RadioGroupProps {
...@@ -105,6 +103,7 @@ const props = withDefaults(defineProps<RadioGroupProps>(), { ...@@ -105,6 +103,7 @@ const props = withDefaults(defineProps<RadioGroupProps>(), {
readonly: false, readonly: false,
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const { handleEditorNavParams, loadCodeListData, handleLevelCodeList } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
let items: Ref<IParam[]> = ref([]); let items: Ref<IParam[]> = ref([]);
......
<script setup lang="ts"> <script setup lang="ts">
import { handleEditorNavParams, IActionParam } from "@ibiz-core"; import { EditorBase, IActionParam } from "@ibiz-core";
import { onBeforeMount, ref, Ref } from "vue"; import { onBeforeMount, ref, Ref } from "vue";
interface RawProps { interface RawProps {
/** /**
...@@ -52,6 +52,7 @@ const props = withDefaults(defineProps<RawProps>(), { ...@@ -52,6 +52,7 @@ const props = withDefaults(defineProps<RawProps>(), {
contentType: "RAW", contentType: "RAW",
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const { handleEditorNavParams } = new EditorBase();
const content: Ref<string> = ref(""); const content: Ref<string> = ref("");
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
...@@ -82,9 +83,9 @@ onBeforeMount(() => { ...@@ -82,9 +83,9 @@ onBeforeMount(() => {
<template> <template>
<div :class="['app-editor-container', `app-raw-${name}`]"> <div :class="['app-editor-container', `app-raw-${name}`]">
<div class="raw-caption" v-if="caption">{{ caption }}</div> <div class="raw-caption" v-if="caption">\{{ caption }}</div>
<div v-if="Object.is(contentType, 'RAW')"> <div v-if="Object.is(contentType, 'RAW')">
{{ content }} \{{ content }}
</div> </div>
<div v-else-if="Object.is(contentType, 'HTML')" v-html="content" /> <div v-else-if="Object.is(contentType, 'HTML')" v-html="content" />
<div v-else-if="Object.is(contentType, 'IMAGE')"> <div v-else-if="Object.is(contentType, 'IMAGE')">
......
<script setup lang="ts"> <script setup lang="ts">
import { handleEditorNavParams, loadCodeListData, IParam } from "@ibiz-core"; import { IParam, EditorBase } from "@ibiz-core";
import { onBeforeMount, ref, Ref } from "vue"; import { onBeforeMount, ref, Ref } from "vue";
interface SpanProps { interface SpanProps {
/** /**
...@@ -93,6 +93,7 @@ const props = withDefaults(defineProps<SpanProps>(), { ...@@ -93,6 +93,7 @@ const props = withDefaults(defineProps<SpanProps>(), {
unitName: "", unitName: "",
precision: 2, precision: 2,
}); });
const { handleEditorNavParams, loadCodeListData } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
let text: Ref<string> = ref(""); let text: Ref<string> = ref("");
let textFormat: Ref<string> = ref(""); let textFormat: Ref<string> = ref("");
...@@ -133,7 +134,7 @@ onBeforeMount(() => { ...@@ -133,7 +134,7 @@ onBeforeMount(() => {
<template> <template>
<div :class="['app-editor-container', `app-span-${name}`]"> <div :class="['app-editor-container', `app-span-${name}`]">
<span>{{text}}</span> <span>\{{text}}</span>
</div> </div>
</template> </template>
......
<script setup lang="ts"> <script setup lang="ts">
import { getDownloadUrl, getRequestingHeader, getUploadUrl, IActionParam, IParam } from "@ibiz-core"; import { EditorBase, IActionParam, IParam } from "@ibiz-core";
import { UploadOutlined, PlusOutlined } from '@ant-design/icons-vue'; import { UploadOutlined, PlusOutlined } from '@ant-design/icons-vue';
import { ref, Ref } from "vue"; import { ref, Ref } from "vue";
interface UploadProps { interface UploadProps {
...@@ -98,6 +98,7 @@ const props = withDefaults(defineProps<UploadProps>(), { ...@@ -98,6 +98,7 @@ const props = withDefaults(defineProps<UploadProps>(), {
listType: 'text', listType: 'text',
}); });
const emit = defineEmits<EditorEmit>(); const emit = defineEmits<EditorEmit>();
const { getDownloadUrl, getRequestingHeader, getUploadUrl } = new EditorBase();
const uploadUrl = getUploadUrl(); const uploadUrl = getUploadUrl();
const downloadUrl = getDownloadUrl(); const downloadUrl = getDownloadUrl();
const headers = getRequestingHeader(); const headers = getRequestingHeader();
......
import { toRefs } from "vue";
import { IParam } from "@ibiz-core";
import { computedNavData, useContextParams } from "@ibiz-core";
/**
* @description 处理编辑器导航数据(查询代码表)
* @export
* @param {Record<string, any>} props 编辑器输入属性
* @return {*}
*/
export function handleEditorNavParams(props: Record<string, any>) {
const { localContext, localParam, data } = toRefs(props);
const { context, viewParams } = useContextParams(props);
const navParams = {
navContext: context.value,
navViewParam: viewParams.value,
}
if (localContext && Object.keys(localContext).length > 0) {
const _context = computedNavData(data, navParams.navContext, navParams.navViewParam, localContext);
Object.assign(navParams.navContext, _context);
}
if (localParam && Object.keys(localParam).length > 0) {
const _param = computedNavData(data, navParams.navContext, navParams.navViewParam, localParam);
Object.assign(navParams.navViewParam, _param);
}
return navParams;
}
/**
* @description 加载代码表数据
* @export
* @param {string} codeListTag 代码表标识
* @param {string} codeListType 代码表类型
* @param {IParam} navContext 导航上下文
* @param {IParam} navViewParam 导航视图参数
* @param {boolean} isNumber 是否为数值类型
* @return {Promise<any[]>} {any[]}
*/
export async function loadCodeListData(codeListTag?: string, codeListType?: string, navContext?: IParam, navViewParam?: IParam): Promise<IParam[]> {
const data: IParam[] = [
{
value: '243144',
label: 'Jack',
},
{
value: '7dawda',
label: 'Lucy',
},
{
value: 'disaweqeqeqbled',
label: 'Disabled',
disabled: true,
},
{
value: 'yimirwqrqwenghe',
label: 'Yiminghe',
}
];
if (codeListTag) {
// todo 调用代码表服务获取数据
}
return data;
}
/**
* @description 处理层级代码表
* @export
* @param {IParam[]} codeListData 代码表数据
*/
export function handleLevelCodeList(codeListData: IParam[]): IParam[] {
let items: IParam[] = [...codeListData]
const hasChildren: boolean = codeListData.some((item:any) =>{
return item.pvalue;
})
if(hasChildren){
let list: IParam[] = [];
items.forEach((codeItem: IParam) =>{
if(!codeItem.pvalue){
let valueField: string = codeItem.value;
setChildCodeItems(valueField, items, codeItem);
list.push(codeItem);
}
})
items = list;
}
return items;
}
/**
* @description 设置子代码表
* @param {string} pValue 父代码项值
* @param {IParam[]} result 代码表
* @param {IParam} codeItem 代码项
*/
function setChildCodeItems(pValue: string, result: IParam[], codeItem: IParam) {
result.forEach((item: IParam) =>{
if(item.pvalue == pValue){
let valueField:string = item.value;
setChildCodeItems(valueField, result, item);
if(!codeItem.options){
codeItem.children = [];
}
codeItem.children.push(item);
}
})
}
/**
* @description 打开选择视图
* @export
*/
export function openPickUpView() {
//todo
}
/**
* @description 打开链接视图
* @export
*/
export function openLinkView() {
//todo
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
export function getUploadUrl(): string {
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().BaseUrl + AppServiceBase.getInstance().getAppEnvironment().UploadFile;
return "";
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
export function getDownloadUrl(): string {
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().ExportFile;
return "";
}
/**
* @description 获取文件请求头
* @export
* @return {*} {IParam}
*/
export function getRequestingHeader(): IParam {
//todo 请求头
// if (AppServiceBase.getInstance().getAppEnvironment().SaaSMode) {
// let activeOrgData = getSessionStorage('activeOrgData');
// this.headers['srforgid'] = activeOrgData?.orgid;
// this.headers['srfsystemid'] = activeOrgData?.systemid;
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// } else {
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// }
// if (getCookie('ibzuaa-token')) {
// this.headers['Authorization'] = `Bearer ${getCookie('ibzuaa-token')}`;
// } else {
// // 第三方应用打开免登
// if (sessionStorage.getItem("srftoken")) {
// const token = sessionStorage.getItem('srftoken');
// this.headers['Authorization'] = `Bearer ${token}`;
// }
// }
return {};
}
import { computedNavData, ControlPropsBase, ControlStateBase, IParam, toOneWayRef, useContextParams } from '@ibiz-core';
import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
/**
* @description 部件基类
* @export
* @class EditorBase
*/
export class EditorBase {
/**
* @description 处理编辑器导航数据(查询代码表)
* @export
* @param {Record<string, any>} props 编辑器输入属性
* @return {*}
*/
public handleEditorNavParams(props: Record<string, any>) {
const { localContext, localParam, data } = toRefs(props);
const { context, viewParams } = useContextParams(props);
const navParams = {
navContext: context.value,
navViewParam: viewParams.value,
}
if (localContext && Object.keys(localContext).length > 0) {
const _context = computedNavData(data, navParams.navContext, navParams.navViewParam, localContext);
Object.assign(navParams.navContext, _context);
}
if (localParam && Object.keys(localParam).length > 0) {
const _param = computedNavData(data, navParams.navContext, navParams.navViewParam, localParam);
Object.assign(navParams.navViewParam, _param);
}
return navParams;
}
/**
* @description 加载代码表数据
* @export
* @param {string} codeListTag 代码表标识
* @param {string} codeListType 代码表类型
* @param {IParam} navContext 导航上下文
* @param {IParam} navViewParam 导航视图参数
* @param {boolean} isNumber 是否为数值类型
* @return {Promise<any[]>} {any[]}
*/
public async loadCodeListData(codeListTag?: string, codeListType?: string, navContext?: IParam, navViewParam?: IParam): Promise<IParam[]> {
const data: IParam[] = [
{
value: '243144',
label: 'Jack',
},
{
value: '7dawda',
label: 'Lucy',
},
{
value: 'disaweqeqeqbled',
label: 'Disabled',
disabled: true,
},
{
value: 'yimirwqrqwenghe',
label: 'Yiminghe',
}
];
if (codeListTag) {
// todo 调用代码表服务获取数据
}
return data;
}
/**
* @description 处理层级代码表
* @export
* @param {IParam[]} codeListData 代码表数据
*/
public handleLevelCodeList(codeListData: IParam[]): IParam[] {
let items: IParam[] = [...codeListData]
const hasChildren: boolean = codeListData.some((item:any) =>{
return item.pvalue;
})
if(hasChildren){
let list: IParam[] = [];
items.forEach((codeItem: IParam) =>{
if(!codeItem.pvalue){
let valueField: string = codeItem.value;
this.setChildCodeItems(valueField, items, codeItem);
list.push(codeItem);
}
})
items = list;
}
return items;
}
/**
* @description 设置子代码表
* @param {string} pValue 父代码项值
* @param {IParam[]} result 代码表
* @param {IParam} codeItem 代码项
*/
public setChildCodeItems(pValue: string, result: IParam[], codeItem: IParam) {
result.forEach((item: IParam) =>{
if(item.pvalue == pValue){
let valueField:string = item.value;
this.setChildCodeItems(valueField, result, item);
if(!codeItem.options){
codeItem.children = [];
}
codeItem.children.push(item);
}
})
}
/**
* @description 打开选择视图
* @export
*/
public openPickUpView() {
//todo
}
/**
* @description 打开链接视图
* @export
*/
public openLinkView() {
//todo
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
public getUploadUrl(): string {
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().BaseUrl + AppServiceBase.getInstance().getAppEnvironment().UploadFile;
return "";
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
public getDownloadUrl(): string {
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().ExportFile;
return "";
}
/**
* @description 获取文件请求头
* @export
* @return {*} {IParam}
*/
public getRequestingHeader(): IParam {
//todo 请求头
// if (AppServiceBase.getInstance().getAppEnvironment().SaaSMode) {
// let activeOrgData = getSessionStorage('activeOrgData');
// this.headers['srforgid'] = activeOrgData?.orgid;
// this.headers['srfsystemid'] = activeOrgData?.systemid;
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// } else {
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// }
// if (getCookie('ibzuaa-token')) {
// this.headers['Authorization'] = `Bearer ${getCookie('ibzuaa-token')}`;
// } else {
// // 第三方应用打开免登
// if (sessionStorage.getItem("srftoken")) {
// const token = sessionStorage.getItem('srftoken');
// this.headers['Authorization'] = `Bearer ${token}`;
// }
// }
return {};
}
}
export * from './editor-base-help'; export * from './editor-base';
\ No newline at end of file \ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册