提交 33a208df 编写于 作者: xignzi006's avatar xignzi006

Merge remote-tracking branch 'origin/master'

package cn.ibizlab.codegen.model;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.ibizsys.model.app.view.IPSAppView;
import org.springframework.util.StringUtils;
import net.ibizsys.model.control.toolbar.IPSDETBUIActionItem;
import net.ibizsys.model.control.toolbar.IPSDEToolbar;
import net.ibizsys.model.view.IPSUIAction;
import java.util.*;
......@@ -42,6 +46,67 @@ public class PageModel extends BaseModel{
}
});
}
// 初始化工具栏数据
if(appView.getPSControls() != null)
{
appView.getPSControls().forEach(item->{
if("TOOLBAR".equals(item.getControlType())){
JSONObject viewToolBar = new JSONObject();
viewToolBar.put("codeName",item.getCodeName());
viewToolBar.put("controlType",item.getControlType());
viewToolBar.put("logicName",item.getLogicName());
if(((IPSDEToolbar)item).getPSDEToolbarItems() != null){
JSONArray items = new JSONArray();
((IPSDEToolbar)item).getPSDEToolbarItems().forEach(singleItam ->{
JSONObject toolbarItem = new JSONObject();
toolbarItem.put("caption",singleItam.getCaption());
if(singleItam.getCapPSLanguageRes() != null && singleItam.getCapPSLanguageRes().getLanResTag() != null){
toolbarItem.put("capPSLanguageRes",singleItam.getCapPSLanguageRes().getLanResTag());
}
toolbarItem.put("tooltip",singleItam.getTooltip());
if(singleItam.getTooltipPSLanguageRes() != null && singleItam.getTooltipPSLanguageRes().getLanResTag() != null){
toolbarItem.put("tooltipPSLanguageRes",singleItam.getTooltipPSLanguageRes().getLanResTag());
}
toolbarItem.put("itemType",singleItam.getItemType());
toolbarItem.put("name",singleItam.getName());
toolbarItem.put("showCaption",singleItam.isShowCaption());
toolbarItem.put("showIcon",singleItam.isShowIcon());
if(singleItam.getPSSysImage() != null && singleItam.getPSSysImage().getCssClass() != null){
toolbarItem.put("iconClass",singleItam.getPSSysImage().getCssClass());
}
if(singleItam.getPSSysImage() != null && singleItam.getPSSysImage().getImagePath() != null){
toolbarItem.put("imgPath",singleItam.getPSSysImage().getImagePath());
}
if("DEUIACTION".equals(singleItam.getItemType())){
IPSDETBUIActionItem actionItem = (IPSDETBUIActionItem)singleItam;
toolbarItem.put("groupExtractMode",actionItem.getNoPrivDisplayMode());
toolbarItem.put("noPrivDisplayMode",actionItem.getNoPrivDisplayMode());
toolbarItem.put("id",actionItem.getPSAppViewUIAction().getId());
toolbarItem.put("xDataControlName",actionItem.getPSAppViewUIAction().getXDataControlName());
if(actionItem.getPSAppViewUIAction().getPSUIAction() != null){
IPSUIAction UIAction = actionItem.getPSAppViewUIAction().getPSUIAction();
JSONObject appUIAction = new JSONObject();
appUIAction.put("caption",UIAction.getCaption());
if(UIAction.getCapPSLanguageRes() != null && UIAction.getCapPSLanguageRes().getLanResTag() != null){
appUIAction.put("capPSLanguageRes",UIAction.getCapPSLanguageRes().getLanResTag());
}
appUIAction.put("codeName",UIAction.getCodeName());
appUIAction.put("fullCodeName",UIAction.getFullCodeName());
appUIAction.put("name",UIAction.getName());
appUIAction.put("uIActionMode",UIAction.getUIActionMode());
appUIAction.put("uIActionTag",UIAction.getUIActionTag());
appUIAction.put("uIActionType",UIAction.getUIActionType());
toolbarItem.put("uIAction",appUIAction);
}
}
items.add(toolbarItem);
});
viewToolBar.put("items",items);
}
toolBarItems.add(viewToolBar);
}
});
}
}
......@@ -69,5 +134,10 @@ public class PageModel extends BaseModel{
return ctrlsMap.values();
}
private Collection<JSONObject> toolBarItems = new ArrayList<>();
public Collection<JSONObject> getViewToolBarItems(){
return toolBarItems;
}
}
......@@ -7,8 +7,8 @@
{{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}"
{{/if}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
:context="state.context"
:viewParams="state.viewParams"
{{#if item.psEditor.psNavigateContexts}}
localContext="{{item.psEditor.psNavigateContexts}}"
{{/if}}
......
......@@ -18,8 +18,8 @@
{{#if item.psEditor.psNavigateParams}}
localParam="{{item.psEditor.psNavigateParams}}"
{{/if}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
:context="state.context"
:viewParams="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
......
......@@ -16,8 +16,8 @@
{{#if item.psEditor.psNavigateParams}}
localParam="{{item.psEditor.psNavigateParams}}"
{{/if}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
:context="state.context"
:viewParams="state.viewParams"
{{#if item.psEditor.psAppDEACMode.minorSortDir}}
sort="{{item.psEditor.psAppDEACMode.minorSortDir}}"
{{/if}}
......
......@@ -16,8 +16,8 @@
{{#if item.psEditor.psNavigateParams}}
localParam="{{item.psEditor.psNavigateParams}}"
{{/if}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
:context="state.context"
:viewParams="state.viewParams"
{{#if item.psEditor.psAppDataEntity}}
{{!-- {{#each item.psEditor.psAppDataEntity as | filed |}} --}}
{{!-- {{#if filed.majorField}} --}}
......
......@@ -24,8 +24,8 @@
{{#eq item.psEditor.editorType "MDROPDOWNLIST"}}
:multiple="true"
{{/eq}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
:context="state.context"
:viewParams="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
......
......@@ -18,8 +18,8 @@
{{#if item.psEditor.psNavigateParams}}
localParam="{{item.psEditor.psNavigateParams}}"
{{/if}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
:context="state.context"
:viewParams="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
......
......@@ -5,13 +5,11 @@
:contentType="{{item.psEditor.editorParams.contentType}}"
{{/if}}
{{#if item.psEditor.editorParams.icon}}
icon="{{item.psEditor.editorParams.icon}}"
iconClass="{{item.psEditor.editorParams.icon}}"
{{/if}}
{{#if item.psEditor.editorParams.caption}}
caption="{{item.psEditor.editorParams.caption}}"
{{/if}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"
{{#if (or (eq ctrlType 'form') (eq ctrlType 'panel'))}}
:value="state.data.{{item.psEditor.name}}"
@editorEvent="handleEditorEvent"
......
......@@ -28,5 +28,5 @@
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
{{/eq}}
:contextProp="state.context"
:viewParamsProp="state.viewParams"/>
:context="state.context"
:viewParams="state.viewParams"/>
{{#eq item.psLayoutPos 'FLEX'}}
<div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};">
<div class="ibiz-form-iframe" style="{{#if item.contentHeight}}height: {{item.contentHeight}}px;{{/if}}{{#if item.contentWidth}}width: {{item.contentWidth}}px{{/if}}">
<iframe src="{{item.iFrameUrl}}" style="height: 100%;width: 100%;border: 0"></iframe>
</div>
</div>
{{else}}
<a-col
{{> @macro/front-end/ctrl/common/layoutPos.hbs item=item.psLayoutPos}} >
<div class="ibiz-form-iframe" style="{{#if item.contentHeight}}height: {{item.contentHeight}}px;{{/if}}{{#if item.contentWidth}}width: {{item.contentWidth}}px{{/if}}">
<iframe src="{{item.iFrameUrl}}" style="height: 100%;width: 100%;border: 0"></iframe>
</div>
</a-col>
{{/eq}}
\ No newline at end of file
<a-tab-pane key="{{item.codeName}}" tab="{{item.caption}}">
{{#eq item.psLayout.layout "FLEX"}}
<div class="app-form-layout-flex" style="{{#if item.psLayout.dir}}flex-direction: {{item.psLayout.dir}};{{/if}}{{#if item.psLayout.align}}justify-content: {{item.psLayout.align}};{{/if}}{{#if item.psLayout.vAlign}}align-items: {{item.psLayout.vAlign}};{{/if}}">
......
{{#eq item.psLayoutPos 'FLEX'}}
<div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};">
<IbizRaw
{{#if item.psSysCss}}class="{{item.psSysCss.cssName}}"{{/if}}
{{#if item.psSysImage}}{{#if item.psSysImage.cssClass}}iconClass="{{item.psSysImage.cssClass}}"{{/if}}{{#if item.psSysImage.imagePath}}imgPath="{{item.psSysImage.imagePath}}"{{/if}}{{/if}}
contentType="{{item.contentType}}"
style="{{#if item.rawItemHeight}}height: {{item.rawItemHeight}}px;{{/if}}{{#if item.rawItemWidth}}width: {{item.rawItemWidth}}px{{/if}}"
{{#if (eq item.contentType 'RAW')}}value="{{item.rawContent}}"{{else if (eq item.contentType 'HTML')}}:value="`{{item.htmlContent}}`"{{/if}}/>
</div>
{{else}}
<a-col
{{> @macro/front-end/ctrl/common/layoutPos.hbs item=item.psLayoutPos}} >
<IbizRaw
{{#if item.psSysCss}}class="{{item.psSysCss.cssName}}"{{/if}}
{{#if item.psSysImage}}{{#if item.psSysImage.cssClass}}iconClass="{{item.psSysImage.cssClass}}"{{/if}}{{#if item.psSysImage.imagePath}}imgPath="{{item.psSysImage.imagePath}}"{{/if}}{{/if}}
contentType="{{item.contentType}}"
style="{{#if item.rawItemHeight}}height: {{item.rawItemHeight}}px;{{/if}}{{#if item.rawItemWidth}}width: {{item.rawItemWidth}}px{{/if}}"
{{#if (eq item.contentType 'RAW')}}value="{{item.rawContent}}"{{else if (eq item.contentType 'HTML')}}:value="`{{item.htmlContent}}`"{{/if}}/>
</a-col>
{{/eq}}
<a-tab-pane key="{{item.codeName}}" tab="{{item.caption}}">
{{#eq item.psLayout.layout "FLEX"}}
<div class="app-form-layout-flex" style="{{#if item.psLayout.dir}}flex-direction: {{item.psLayout.dir}};{{/if}}{{#if item.psLayout.align}}justify-content: {{item.psLayout.align}};{{/if}}{{#if item.psLayout.vAlign}}align-items: {{item.psLayout.vAlign}};{{/if}}">
{{#each item.psDEFormDetails as | formDetail |}}
{{>(lookup . 'formDetail.detailType') item=formDetail}}
{{/each}}
</div>
{{else}}
<a-row>
{{#each item.psDEFormDetails as | formDetail |}}
{{>(lookup . 'formDetail.detailType') item=formDetail}}
{{/each}}
</a-row>
{{/eq}}
</a-tab-pane>
{{#*inline "FORMPAGE"}}{{>@macro/form-detail/form-page.hbs}}{{/inline}}
{{#*inline "GROUPPANEL"}}{{>@macro/form-detail/form-group.hbs}}{{/inline}}
{{#*inline "GROUPPANEL"}}{{>@macro/form-detail/form-group-panel.hbs}}{{/inline}}
{{#*inline "FORMITEM"}}{{>@macro/form-detail/form-item.hbs}}{{/inline}}
{{#*inline "TABPANEL"}}{{>@macro/form-detail/form-tabpanel.hbs}}{{/inline}}
{{#*inline "BUTTON"}}{{>@macro/form-detail/form-button.hbs}}{{/inline}}
{{#*inline "RAWITEM"}}{{>@macro/form-detail/form-rawitem.hbs}}{{/inline}}
{{#*inline "IFRAME"}}{{>@macro/form-detail/form-iframe.hbs}}{{/inline}}
{{#*inline "FORMPART"}}{{>@macro/form-detail/form-formpart.hbs}}{{/inline}}
{{#*inline "TABPAGE"}}{{>@macro/form-detail/form-tabpage.hbs}}{{/inline}}
{{#*inline "DRUIPART"}}{{>@macro/form-detail/form-druipart.hbs}}{{/inline}}
{{#*inline "FORMDETAILSMODEL"}}{{>@macro/form-detail/form-details-model.hbs}}{{/inline}}
\ No newline at end of file
......@@ -11,13 +11,12 @@
viewType: '{{page.viewType}}',
viewStyle: '{{page.viewStyle}}',
showCaptionBar: '{{page.viewStyle}}',
xDataControlName:'{{page.xDataControlName}}',
viewToolbarModel: [
{{#page.ctrls}}
{{#eq controlType "TOOLBAR"}}
{{#psDEToolbarItems}}
{ name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true,{{#if psUIAction.psSysImage}}{{#if psUIAction.psSysImage.imagePath}} imgPath: "{{psUIAction.psSysImage.imagePath}}",{{/if}}{{#if psUIAction.psSysImage.cssClass}} iconClass: "{{psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/psDEToolbarItems}}
{{/eq}}
{{/page.ctrls}}
{{#page.viewToolBarItems}}
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',uIActionTag:'{{uIAction.uIActionTag}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
{{/page.viewToolBarItems}}
],
{{> @macro/front-end/view/common/controlAction.hbs}}
\ No newline at end of file
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import {App} from '@service'
onMounted(async ()=>{
await App.init();
// App.openViewService.openView({codeName: 'ExampleEditorEditView'},{context: {},viewParams:{}})
import { App } from './app';
onMounted(()=>{
(window as any).App = App.getInstance();
})
</script>
<template>
<router-view />
</template>
......
export const AppFuncConfig = [
{{#each app.allPSAppFuncs as | func |}}
{
name: "{{func.name}}",
funcTag: "{{func.codeName}}",
appFuncType: "{{func.appFuncType}}",
{{#if (eq func.appFuncType 'OPENHTMLPAGE')}}
htmlPageUrl: "{{func.htmlPageUrl}}",
{{/if}}
{{#if (eq func.appFuncType 'APPVIEW')}}
openMode: "{{func.openMode}}",
viewName: "{{func.psAppView.name}}",
viewCodeName: "{{func.psAppView.codeName}}",
{{/if}}
navParam: {
{{#if func.psNavigateParams}}
{{#each func.psNavigateParams as | param |}}
{{lowerCase param.key}}: "{{#if param.rawValue}}{{param.value}}{{else}}%{{lowerCase param.value}}%{{/if}}",
{{/each}}
{{/if}}
},
navContext: {
{{#if func.psNavigateContexts}}
{{#each func.psNavigateContexts as | context |}}
{{lowerCase context.key}}: "{{#if context.rawValue}}{{context.value}}{{else}}%{{lowerCase context.value}}%{{/if}}",
{{/each}}
{{/if}}
},
},
{{/each}}
]
\ No newline at end of file
{
{{#each app.pages as |appView|}}
import { IParam } from "@core";
export const AppViewConfig:IParam = {
{{#each app.pages as |appView|}}
"{{appView.codeName}}":{
"name": "{{appView.name}}",
"codeName": "{{appView.codeName}}",
......
import { OpenViewService } from "@/utils";
import { AppBase, IParam, ViewDetail, IApp, IOpenViewService, deepCopy } from "@core";
import { AppFuncConfig } from './app-func-config';
import { AppViewConfig } from './app-view-config';
export class App extends AppBase implements IApp {
/**
* 唯一实例
*
* @private
* @static
* @memberof App
*/
private static readonly instance = new App();
/**
* 获取唯一实例
*
* @static
* @return {*} {App}
* @memberof App
*/
public static getInstance(): App {
return App.instance;
}
/**
* 获取所有应用功能
*
* @return {*} {IParam[]}
* @memberof App
*/
public getAllFuncs(): IParam[] {
return AppFuncConfig;
}
/**
* 获取打开视图服务
*
* @return {*} {IOpenViewService}
* @memberof App
*/
public getOpenViewService(): IOpenViewService {
return OpenViewService.getInstance();
}
/**
* 获取视图信息
*
* @static
* @param codeName 视图codeName
* @return {*}
*/
public getViewInfo(codeName: string): ViewDetail | undefined {
return AppViewConfig[codeName] ? (deepCopy(AppViewConfig[codeName]) as ViewDetail) : undefined;;
}
}
\ No newline at end of file
<script setup lang="ts">
import { onBeforeMount, Ref, ref } from "vue";
import { SearchOutlined } from '@ant-design/icons-vue';
import { deepCopy, IParam, IActionParam, EditorBase } from "@ibiz-core";
import { deepCopy, IParam, IActionParam, EditorBase, IContext } from "@core";
interface AutoCompleteProps {
/**
* @description 表单数据或表格行数据
......@@ -25,12 +25,12 @@ interface AutoCompleteProps {
/**
* @description 上下文
*/
contextProp?: IParam;
context?: IContext;
/**
* @description 视图参数
*/
viewParamsProp?: IParam;
viewParams?: IParam;
/**
* @description 局部上下文
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
import { computed, Ref } from "vue";
interface CheckboxProps {
/**
......
......@@ -2,8 +2,9 @@
import {
EditorBase,
IActionParam,
IParam
} from "@ibiz-core";
IParam,
IContext
} from "@core";
import { computed, onBeforeMount, ref, Ref } from "vue";
interface CheckboxListProps {
/**
......@@ -76,7 +77,7 @@ interface CheckboxListProps {
* @type {*}
* @memberof AppCheckBox
*/
contextProp: IParam;
context: IContext;
/**
* 视图参数
......@@ -84,7 +85,7 @@ interface CheckboxListProps {
* @type {*}
* @memberof AppCheckBox
*/
viewParamsProp: IParam;
viewParams: IParam;
/**
* 局部上下文导航参数
......
<script setup lang="ts">
import { onBeforeMount, Ref, ref } from 'vue';
import { SearchOutlined, ExportOutlined } from '@ant-design/icons-vue';
import { deepCopy, IParam, IActionParam, EditorBase } from '@ibiz-core';
import { deepCopy, IParam, IActionParam, EditorBase, IContext } from '@core';
interface DataPickerProps {
/**
* @description 编辑器名称
......@@ -31,27 +31,27 @@ interface DataPickerProps {
/**
* @description 表单数据或表格行数据
*/
data?: any;
data?: IParam;
/**
* @description 上下文
*/
contextProp?: any;
context?: IContext;
/**
* @description 视图参数
*/
viewParamsProp?: any;
viewParams?: IParam;
/**
* @description 局部上下文
*/
localContext?: any;
localContext?: IParam;
/**
* @description 局部视图参数
*/
localParam?: any;
localParam?: IParam;
/**
* @description 主信息属性
......@@ -66,17 +66,17 @@ interface DataPickerProps {
/**
* @description 选择视图
*/
pickUpView?: any;
pickUpView?: IParam;
/**
* @description 链接视图
*/
linkView?: any;
linkView?: IParam;
/**
* @description ac参数
*/
acParams?: any;
acParams?: IParam;
/**
* @description 排序
......
<script setup lang="ts">
import { onBeforeMount, Ref, ref } from 'vue';
import { SearchOutlined, ExportOutlined } from '@ant-design/icons-vue';
import { deepCopy, IParam, IActionParam, EditorBase } from '@ibiz-core';
import { deepCopy, IParam, IActionParam, EditorBase, IContext } from '@core';
interface DataPickerViewProps {
/**
* @description 编辑器名称
......@@ -31,27 +31,27 @@ interface DataPickerViewProps {
/**
* @description 表单数据或表格行数据
*/
data?: any;
data?: IParam;
/**
* @description 上下文
*/
contextProp?: any;
context?: IContext;
/**
* @description 视图参数
*/
viewParamsProp?: any;
viewParams?: IParam;
/**
* @description 局部上下文
*/
localContext?: any;
localContext?: IParam;
/**
* @description 局部视图参数
*/
localParam?: any;
localParam?: IParam;
/**
* @description 主信息属性
......@@ -66,17 +66,17 @@ interface DataPickerViewProps {
/**
* @description 选择视图
*/
pickUpView?: any;
pickUpView?: IParam;
/**
* @description 链接视图
*/
linkView?: any;
linkView?: IParam;
/**
* @description ac参数
*/
acParams?: any;
acParams?: IParam;
/**
* @description 排序
......
<script setup lang="ts">
import { IActionParam } from '@ibiz-core';
import { IActionParam } from '@core';
// import dayjs from 'ant-design-vue/lib/time-picker/dayjs';
import { computed, Ref } from 'vue';
import dayjs, { Dayjs } from 'dayjs';
......
<script setup lang="ts">
import { onBeforeMount, Ref, ref } from "vue";
import { IActionParam, IParam, typeOf, EditorBase } from "@ibiz-core";
import { IActionParam, IParam, typeOf, EditorBase, IContext } from "@core";
interface DropdownListProps {
/**
......@@ -31,12 +31,12 @@ interface DropdownListProps {
/**
* @description 上下文
*/
contextProp?: IParam;
context?: IContext;
/**
* @description 视图参数
*/
viewParamsProp?: IParam;
viewParams?: IParam;
/**
* @description 局部上下文
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
interface InputProps{
/**
* @description 编辑器名称
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
import { onBeforeMount, ref, Ref } from "vue";
interface InputIpProps{
/**
......
......@@ -2,8 +2,9 @@
import {
IActionParam,
IParam,
EditorBase
} from "@ibiz-core";
EditorBase,
IContext
} from "@core";
import { onBeforeMount, ref, Ref } from "vue";
interface RadioGroupProps {
/**
......@@ -52,7 +53,7 @@ interface RadioGroupProps {
* @type {*}
* @memberof AppCheckBox
*/
contextProp: IParam;
context: IContext;
/**
* 视图参数
......@@ -60,7 +61,7 @@ interface RadioGroupProps {
* @type {*}
* @memberof AppCheckBox
*/
viewParamsProp: IParam;
viewParams: IParam;
/**
* 局部上下文导航参数
......
<script setup lang="ts">
import { IActionParam, IParam } from "@ibiz-core";
import { IActionParam, IParam } from "@core";
interface RatingProps {
/**
* 传入值
......
<script setup lang="ts">
import { EditorBase, IActionParam } from "@ibiz-core";
import { onBeforeMount, ref, Ref } from "vue";
import { IActionParam } from "@core";
interface RawProps {
/**
* @description 编辑器名称
......@@ -18,28 +17,17 @@ interface RawProps {
contentType: "RAW" | "HTML" | "IMAGE" | "MARKDOWN";
/**
* @description 上下文
*/
contextProp?: any;
/**
* @description 视图参数
* @description 输入框类型
*/
viewParamsProp?: any;
iconClass?: string;
/**
* 图标
*
* @type {string}
* @memberof AppRawItem
* @description 输入框类型
*/
icon?: string;
imgPath?: string;
/**
* 标题
*
* @type {string}
* @memberof AppRawItem
* @description 标题
*/
caption?: string;
}
......@@ -52,51 +40,22 @@ const props = withDefaults(defineProps<RawProps>(), {
contentType: "RAW",
});
const emit = defineEmits<EditorEmit>();
const { handleEditorNavParams } = new EditorBase();
const content: Ref<string> = ref("");
const { navContext, navViewParam } = handleEditorNavParams(props);
const initContent = () => {
const data = navContext;
if (props.value) {
const items = props.value.match(/\{{(.+?)\}}/g);
if (items) {
items.forEach((item: string) => {
content.value = props.value.replace(
/\{{(.+?)\}}/,
eval(item.substring(2, item.length - 2))
);
});
}
content.value = props.value.replaceAll("&lt;", "<");
content.value = props.value.replaceAll("&gt;", ">");
content.value = props.value.replaceAll("&amp;nbsp;", " ");
content.value = props.value.replaceAll("&nbsp;", " ");
}
return content;
};
onBeforeMount(() => {
initContent();
});
</script>
<template>
<div :class="['app-editor-container', `app-raw-${name}`]">
<div :class="['ibiz-raw-item', `ibiz-raw-item--${contentType.toLowerCase()}`]">
<div class="raw-caption" v-if="caption">\{{ caption }}</div>
<div v-if="Object.is(contentType, 'RAW')">
\{{ content }}
\{{ value }}
</div>
<div v-else-if="Object.is(contentType, 'HTML')" v-html="content" />
<div v-else-if="Object.is(contentType, 'HTML')" v-html="value" />
<div v-else-if="Object.is(contentType, 'IMAGE')">
<img v-if="value" :src="value" />
<a-icon v-else :type="icon || ''" />
<IbizIconText :iconClass="iconClass" :imgPath="imgPath"/>
</div>
</div>
</template>
<style scoped>
.app-editor-container {
text-align: left;
}
</style>
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
interface sliderProps {
/**
* 传入值
......
<script setup lang="ts">
import { IParam, EditorBase } from "@ibiz-core";
import { IParam, EditorBase, IContext } from "@core";
import { onBeforeMount, ref, Ref } from "vue";
interface SpanProps {
/**
......@@ -71,12 +71,12 @@ interface SpanProps {
/**
* @description 上下文
*/
contextProp?: IParam;
context?: IContext;
/**
* @description 视图参数
*/
viewParamsProp?: IParam;
viewParams?: IParam;
/**
* @description 局部上下文
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
interface StepperProps {
/**
* 传入值
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
import { computed, Ref } from "vue";
interface SwitchProps {
/**
......
<script setup lang="ts">
import { EditorBase, IActionParam, IParam } from "@ibiz-core";
import { EditorBase, IActionParam, IParam } from "@core";
import { UploadOutlined, PlusOutlined } from '@ant-design/icons-vue';
import { ref, Ref } from "vue";
interface UploadProps {
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
interface FormGroupProps{
name: string;
......
<script setup lang="ts">
import { IActionParam } from "@ibiz-core";
import { IActionParam } from "@core";
interface FormGroupProps{
name: string;
......
<script setup lang="ts">
import { IParam } from "@ibiz-core";
import { IParam } from "@core";
interface Props{
width: number;
......
<script setup lang="ts">
import { IParam } from "@ibiz-core";
import { IParam } from "@core";
interface Props{
items: IParam[],
collapsed: boolean,
......
<script setup lang="ts">
import { IParam, IActionParam } from "@ibiz-core";
import { IParam, IActionParam } from "@core";
import { onBeforeMount, ref, Ref } from "vue";
interface ToolbarProps {
......
export * from './interface';
export * from './logic';
export * from './modules';
export * from './runtime';
export * from './service';
export * from './utils';
\ No newline at end of file
export * from './helper';
\ No newline at end of file
import { IParam, ViewDetail } from "../common";
import { IAppFuncService, IOpenViewService } from "../logic";
/**
* 应用接口
*
* @export
* @interface IApp
*/
export interface IApp {
/**
* 获取应用所有功能
*
* @return {*} {IParam[]}
* @memberof IApp
*/
getAllFuncs(): IParam[];
/**
* 获取应用功能服务
*
* @return {*} {AppFuncService}
* @memberof IApp
*/
getAppFuncService(): IAppFuncService;
/**
* 获取打开视图服务
*
* @return {*} {IParam}
* @memberof IApp
*/
getOpenViewService(): IOpenViewService;
/**
* 获取指定视图信息
*
* @param {string} codeName
* @return {*} {(ViewDetail | undefined)}
* @memberof IApp
*/
getViewInfo(codeName: string): ViewDetail | undefined
}
\ No newline at end of file
......@@ -7,20 +7,20 @@
export interface ViewDetail {
/**
* 视图名称
* 代码名称
*
* @type {string}
* @memberof ViewDetail
*/
name: string;
codeName: string;
/**
* 代码名称
* 视图名称
*
* @type {string}
* @memberof ViewDetail
*/
codeName: string;
name?: string;
/**
* 视图宽度
......
export * from './app';
export * from './common';
export * from './logic';
\ No newline at end of file
import { IContext, IParam } from "@core";
/**
* @description 应用功能服务
* @export
* @interface IAppFuncService
*/
export interface IAppFuncService {
/**
* @description 执行应用功能
* @param {IParam} menu 菜单项
* @param {IParam} context 上下文
* @param {IParam} viewParams 视图参数
* @return {*} {*}
* @memberof IAppFuncService
*/
executeAppFunc(menu: IParam, context: IContext, viewParams: IParam): any;
}
\ No newline at end of file
import { IParam, ViewDetail } from "@core";
/**
* @description 打开视图服务接口
* @export
* @interface IOpenViewService
*/
export interface IOpenViewService {
/**
* @description 打开视图
* @param {ViewDetail} view 视图对象参数
* @param {IParam} params 打开视图参数
* @return {*} {*}
* @memberof IOpenViewService
*/
openView(view: ViewDetail, params: IParam): any;
}
\ No newline at end of file
export * from './i-app-func-service';
export * from './i-open-view-service';
\ No newline at end of file
import { IParam, FuncConfig, IContext } from "@ibiz-core";
import { App } from "@service";
import { IAppFuncService, IParam } from "@core";
export class AppFuncService {
export class AppFuncService implements IAppFuncService{
/**
* @description 唯一实例
......@@ -28,8 +27,8 @@ export class AppFuncService {
* @param {IParam} viewParams 视图参数
* @memberof AppFuncService
*/
executeAppFunc(menu: IParam, context: IContext, viewParams: IParam) {
const appFunc = FuncConfig.find((func: IParam)=> Object.is(func.funcTag, menu.funcTag));
executeAppFunc(menu: IParam, context: IParam, viewParams: IParam) {
const appFunc = App.getAllFuncs().find((func: IParam)=> Object.is(func.funcTag, menu.funcTag));
if (appFunc) {
switch (appFunc.appFuncType) {
case 'APPVIEW':
......@@ -57,7 +56,7 @@ export class AppFuncService {
* @param {IParam} viewParams 视图参数
* @memberof AppFuncService
*/
private executeCustomFunc(appFunc: IParam, context: IContext, viewParams: IParam) {
executeCustomFunc(appFunc: IParam, context: IParam, viewParams: IParam) {
console.warn(`${appFunc.appFuncType} 类型应用功能暂未支持`);
}
......@@ -68,7 +67,7 @@ export class AppFuncService {
* @param {IParam} viewParams 视图参数
* @memberof AppFuncService
*/
private executeJavaScript(appFunc: IParam, context: IContext, viewParams: IParam) {
executeJavaScript(appFunc: IParam, context: IParam, viewParams: IParam) {
console.warn(`${appFunc.appFuncType} 类型应用功能暂未支持`);
}
......@@ -80,7 +79,7 @@ export class AppFuncService {
* @param {IParam} viewParams 视图参数
* @memberof AppFuncService
*/
private executePresetFunc(appFunc: IParam, context: IContext, viewParams: IParam) {
executePresetFunc(appFunc: IParam, context: IParam, viewParams: IParam) {
console.warn(`${appFunc.appFuncType} 类型应用功能暂未支持`);
}
......@@ -91,7 +90,7 @@ export class AppFuncService {
* @param {IParam} viewParams 视图参数
* @memberof AppFuncService
*/
private openHtmlPage(appFunc: IParam, context: IContext, viewParams: IParam) {
openHtmlPage(appFunc: IParam, context: IParam, viewParams: IParam) {
window.open(appFunc.htmlPageUrl, '_blank');
}
......@@ -102,9 +101,8 @@ export class AppFuncService {
* @param {IParam} viewParams 视图参数
* @memberof AppFuncService
*/
private openAppView(appFunc: IParam, context: IContext, viewParams: IParam) {
openAppView(appFunc: IParam, context: IParam, viewParams: IParam) {
const view = {
name: appFunc.viewName,
codeName: appFunc.viewCodeName,
openMode: appFunc.openMode,
}
......@@ -112,6 +110,6 @@ export class AppFuncService {
context: context,
viewParams: viewParams,
}
App.openViewService.openView(view, params);
App.getOpenViewService().openView(view, params);
}
}
\ No newline at end of file
import { IContext, IParam } from "@core";
/**
* 后台界面行为
*
* @export
* @class AppBackendAction
*/
export class AppBackendAction {
/**
* 执行后台界面行为
*
* @static
* @param {IParam} uiAction 界面行为对象
* @param {context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment:IParam} params { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
* @memberof AppBackendAction
*/
public static async execute(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment:IParam}) {
// TODO 执行后台界面行为
console.log(uiAction,params);
}
}
import { IContext, IParam } from "@core";
/**
* 前台界面行为
*
* @export
* @class AppFrontAction
*/
export class AppFrontAction {
/**
* 执行前台界面行为
*
* @static
* @param {IParam} uiAction 界面行为对象
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment:IParam} params { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
* @memberof AppBackendAction
*/
public static async execute(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }) {
// TODO 前台界面行为
console.log(uiAction,params);
}
}
import { IContext, IParam } from "@core";
/**
* 系统预置界面行为
*
* @export
* @class AppSysAction
*/
export class AppSysAction {
/**
* 执行预置界面行为
*
* @static
* @param {IParam} uiAction 界面行为对象
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment:IParam} params { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
* @memberof AppBackendAction
*/
public static async execute(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }) {
// TODO 预置界面行为
console.log(uiAction,params);
}
}
import { IContext, IParam } from '@core';
import { AppBackendAction } from './app-backend-action';
import { AppFrontAction } from './app-front-action';
import { IUIAction } from "@ibiz-core";
import { AppSysAction } from './app-sys-action';
/**
......@@ -14,9 +14,9 @@ export class AppUIAction {
* 执行界面行为
*
* @param uiAction 界面行为信息
* @param params 运行参数
* @param params 运行参数 { context: 上下文对象, viewParams: 视图参数, data: 当前激活数据, event: 事件源对象, actionEnvironment:操作环境}
*/
public static executeUIAction(uiAction: IUIAction, params: any){
public static execute(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }){
if(uiAction.uIActionMode == 'FRONT'){
AppFrontAction.execute(uiAction, params);
}else if(uiAction.uIActionMode == 'BACKEND'){
......@@ -24,7 +24,7 @@ export class AppUIAction {
}else if(uiAction.uIActionMode == 'SYS'){
AppSysAction.execute(uiAction, params);
}else{
// TODO 工作流界面行为
console.warn("非(前台界面行为、后台界面行为、系统预置界面行为)暂未支持");
}
}
}
export * from './app-logic';
export * from './app-ui-action';
\ No newline at end of file
import { AppFuncService, IApp, IAppFuncService, IOpenViewService, ViewDetail } from "@core";
import { IParam } from "@core/interface";
/**
* 应用基类
*
* @export
* @class AppBase
*/
export abstract class AppBase implements IApp {
/**
* 应用功能服务
*
* @private
* @type {AppFuncService}
* @memberof AppBase
*/
private appFuncService: AppFuncService = AppFuncService.getInstance();
/**
* 获取应用功能服务
*
* @return {IAppFuncService}
* @memberof AppBase
*/
public getAppFuncService(): IAppFuncService {
return this.appFuncService;
}
/**
* 获取打开视图服务
*
* @return {*} {IOpenViewService}
* @memberof AppBase
*/
public getOpenViewService(): IOpenViewService {
throw new Error("Method not implemented.");
}
/**
* 获取所有应用功能
*
* @return {*} {IParam[]}
* @memberof AppBase
*/
public getAllFuncs(): IParam[] {
return [];
}
/**
* 获取视图信息
*
* @param codeName 视图codeName
*/
public getViewInfo(codeName: string): ViewDetail | undefined {
return undefined;
}
}
\ No newline at end of file
import { Ref } from 'vue';
import { IContext, IParam } from '@core';
import { deepCopy } from '../../utils';
/**
* @description 界面基类
* @export
* @class UIBase
*/
export class UIBase {
/**
* 为源响应式对象上的某个属性新创建一个单向的Ref,类似于vue的toRef但区别在于,修改返回的Ref,不会影响源响应对象的该属性。而源响应对象上的属性值变化会响应式影响到返回的Ref
*
* @param object 源响应对象,可以是ref对象,也可以是reactive对象
* @param key 响应对象上的属性的key值
*
* ```ts
* const object = ref({foo: 1});
* // 或者 const object = reactive({foo: 1})
* const foo = toOneWayRef(object, 'foo');
* foo.value = 2;
* console.log(object.foo) // 1
* console.log(foo.value) // 2
* object.foo = 3
* console.log(object.foo) // 3
* console.log(foo.value) // 3
* ```
* ps:如果要维持props的父对于props修改的响应性,props必须是Ref
* ```ts
* const father = reactive({ props: { foo: 1 }})
* const props = toRef(father,'props');
* const foo = toOneWayRef(props, 'foo');
* const foo1 = toOneWayRef(props.value,'foo')
* father.props = {foo: 3}
* console.log(father.props.foo) // 3
* console.log(foo.value) // 3
* console.log(foo1.value) // 1
* ```
*
*/
public static toOneWayRef<T extends object, K extends keyof T>(object: Ref<T> | T, key: K): Ref<T[K]> {
// 创建空的Ref
const propertyRef: Ref<T[K]> = ref({}) as any;
// 用watch来监听源响应对象的key属性,并建立单向响应
watch(
() => isRef(object) ? (object.value as T)[key] : object[key],
(newVal: any, oldVal: any) => {
// 用immediate来初始化最初的值,用deepCopy来切断与源值的关联
propertyRef.value = deepCopy(newVal) as T[K];
},
{
immediate: true,
deep: true,
},
);
return propertyRef;
}
/**
* @description 使用上下文参数逻辑块
* @export
* @param {Record<any, any>} props
*/
public static useContextParams(props: Record<any, any>) {
const { contextProp, viewParamsProp } = toRefs(props);
// 维护上下文并监控其变化
const context: Ref<IContext> = ref({});
watch(
contextProp,
(newVal: any, oldVal: any) => {
context.value = deepCopy(newVal || {});
},
{
immediate: true,
deep: true,
}
);
// 维护视图参数并监控其变化
const viewParams: Ref<IParam> = ref({});
watch(
viewParamsProp,
(newVal: any, oldVal: any) => {
viewParams.value = deepCopy(newVal || {});
},
{
immediate: true,
deep: true,
}
);
return { context, viewParams };
}
}
\ No newline at end of file
import { computedNavData, ControlPropsBase, ControlStateBase, IParam, toOneWayRef, useContextParams } from '@ibiz-core';
import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
import { toRefs } from 'vue';
import { UIUtil, IParam, UIBase } from '@core';
/**
* @description 部件基类
* @export
......@@ -16,17 +15,17 @@ export class EditorBase {
*/
public handleEditorNavParams(props: Record<string, any>) {
const { localContext, localParam, data } = toRefs(props);
const { context, viewParams } = useContextParams(props);
const { context, viewParams } = UIBase.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);
const _context = UIUtil.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);
const _param = UIUtil.computedNavData(data, navParams.navContext, navParams.navViewParam, localParam);
Object.assign(navParams.navViewParam, _param);
}
return navParams;
......
export * from './common'
export * from './app'
export * from './views'
export * from './widgets'
export * from './editor'
export * from './app-logic'
\ No newline at end of file
import { ViewBase, MainViewProps, MainViewState, IActionParam } from '@ibiz-core';
import { ViewBase, MainViewProps, MainViewState, IActionParam, IParam, AppUIAction } from '@core';
/**
* 实体部件
......@@ -7,17 +7,25 @@ import { ViewBase, MainViewProps, MainViewState, IActionParam } from '@ibiz-core
*/
export class MainView extends ViewBase {
/**
* 部件状态
* 视图状态数据
*/
public declare viewState: MainViewState;
/**
* 当前视图具有数据能力部件
*
* @type {IParam}
* @memberof MainView
*/
public declare xDataControl: IParam;
/**
* 根据props调整设置部件state
* @param props 传入的Props
*/
public setState(props: MainViewProps) {
super.setState(props);
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
this.xDataControl = ref(null);
}
/**
......@@ -25,14 +33,14 @@ export class MainView extends ViewBase {
* @todo
* @param props
*/
public useOpenData(props: MainViewProps) {}
public useOpenData(props: MainViewProps) { }
/**
* 打开新建视图功能模块
* @todo
* @param props
*/
public useNewData(props: MainViewProps) {}
public useNewData(props: MainViewProps) { }
/**
* @description 处理工具栏事件
......@@ -41,7 +49,25 @@ export class MainView extends ViewBase {
*/
public handleToolbarEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
//todo
if (!tag || !action || !data) {
console.warn("工具栏执行参数不足");
return;
}
const { xDataControlName, uIAction } = data;
if (!xDataControlName || !uIAction) {
console.warn("工具栏执行参数不足");
return;
}
// 准备参数
const inputParam = {
context: this.viewState.context,
viewParams: this.viewState.viewParams,
data: this.xDataControl?.value?.data,
event: data.event,
actionEnvironment: this
};
// 执行行为
AppUIAction.execute(uIAction, inputParam);
}
public handleCtrlEvent(actionParam: IActionParam) {
......@@ -64,6 +90,7 @@ export class MainView extends ViewBase {
return {
...superParams,
state: this.viewState,
xDataControl: this.xDataControl,
handleToolbarEvent: this.handleToolbarEvent.bind(this),
handleCtrlEvent: this.handleCtrlEvent.bind(this),
};
......
import { Ref } from 'vue';
import { useRoute } from 'vue-router';
import { ViewPropsBase, ViewStateBase, toOneWayRef, IParam } from '@ibiz-core';
import { ViewPropsBase, ViewStateBase, UIBase, IParam } from '@core';
/**
* @description 视图基类
......@@ -74,8 +74,8 @@ export class ViewBase {
* @memberof ViewBase
*/
public useViewContextParams(props: ViewPropsBase) {
const context = toOneWayRef(props, 'context');
const viewParams = toOneWayRef(props, 'viewParams');
const context = UIBase.toOneWayRef(props, 'context');
const viewParams = UIBase.toOneWayRef(props, 'viewParams');
// 导航视图参数处理
this.handleViewContextParams(props, context, viewParams);
watch(context, (newVal: any, oldVal: any) => {
......
import { Subject } from "rxjs";
import { IActionParam, IParam, IContext } from "@ibiz-core";
import { IActionParam, IParam } from "@core";
/**
* @description 视图props的基类
......@@ -13,7 +13,7 @@ export interface ViewPropsBase {
* @type {IParam}
* @memberof ViewPropsBase
*/
context?: IContext;
context?: IParam;
/**
* @description 视图参数(外部传入)
......
import { Subject } from "rxjs";
import { IActionParam, IParam, IContext } from '@ibiz-core';
import { IActionParam, IParam } from '@core';
/**
* @description 视图基类状态
......@@ -24,10 +24,10 @@ export interface ViewStateBase {
/**
* @description 上下文参数
* @type {IContext}
* @type {IParam}
* @memberof ViewStateBase
*/
context: IContext;
context: IParam;
/**
* @description 视图参数
......
import { ControlPropsBase, ControlStateBase, toOneWayRef } from '@ibiz-core';
import { ControlPropsBase, ControlStateBase, UIBase } from '@core';
import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
/**
......@@ -64,8 +64,8 @@ export class ControlBase {
* @memberof ControlBase
*/
public useControlContextParams(props: ControlPropsBase) {
const context = toOneWayRef(props, 'context');
const viewParams = toOneWayRef(props, 'viewParams');
const context = UIBase.toOneWayRef(props, 'context');
const viewParams = UIBase.toOneWayRef(props, 'viewParams');
// 把Ref赋值到State上进行解包
this.controlState.context = context;
......
import { Subject } from "rxjs";
import { IActionParam, IParam, IContext } from "@ibiz-core";
import { IActionParam, IParam } from "@core";
/**
* @description 部件props的基类
......@@ -10,10 +10,10 @@ export interface ControlPropsBase {
/**
* @description 上下文参数(外部传入)
* @type {IContext}
* @type {IParam}
* @memberof ControlPropsBase
*/
context?: IContext;
context?: IParam;
/**
* @description 视图参数(外部传入)
......
import { IActionParam, IParam, IContext } from "@ibiz-core";
import { IActionParam, IParam } from "@core";
import { Subject } from "rxjs";
/**
......@@ -27,7 +27,7 @@ export interface ControlStateBase {
* @type {IParam}
* @memberof ControlStateBase
*/
context: IContext;
context: IParam;
/**
* @description 视图参数
......
import { deepCopy, FormControlProps, FormControlState, IActionParam, MainControl } from '@ibiz-core';
import { deepCopy, FormControlProps, FormControlState, IActionParam, MainControl } from '@core';
/**
* @description 表单部件
......
import { IParam, MainControlState } from '@ibiz-core';
import { IParam, MainControlState } from '@core';
/**
* @description 表格部件状态
......@@ -13,7 +13,7 @@ export interface GridControlState extends MainControlState {
* @type {IParam[]}
* @memberof GridControlState
*/
data: IParam[];
items: IParam[];
/**
* @description 表格列模型
......@@ -34,7 +34,7 @@ export interface GridControlState extends MainControlState {
* @type {IParam}
* @memberof GridControlState
*/
rules: IParam[];
rules: IParam;
/**
* @description 是否多选
......@@ -79,31 +79,93 @@ export interface GridControlState extends MainControlState {
selectFirstDefault: boolean;
/**
* @description 表格聚合
* @type {IParam}
* @description 当前页
* @type {number}
* @memberof GridControlState
*/
gridAgg: IParam;
current: number;
/**
* @description 表格分组
* @type {IParam}
* @description 分页大小
* @type {number}
* @memberof GridControlState
*/
gridGroup: IParam;
pageSize: number;
/**
* @description 表格排序
* @type {IParam}
* @description 是否启用分页
* @type {boolean}
* @memberof GridControlState
*/
gridSort: IParam;
enablePagingBar: boolean;
/**
* @description 表格分页
* @description 数据聚合
* @type {IParam}
* @memberof GridControlState
*/
gridPaging: IParam
dataAgg: string[];
/**
* @description 聚合模式
* @type {string}
* @memberof GridControlState
*/
aggMode: string;
/**
* @description 聚合实体
* @type {string}
* @memberof GridControlState
*/
aggEntity: string,
/**
* @description 聚合数据集
* @type {string}
* @memberof GridControlState
*/
aggDataSet: string,
/**
* @description 分组模式
* @type {string}
* @memberof GridControlState
*/
groupMode: string;
/**
* @description 分组属性
* @type {string}
* @memberof GridControlState
*/
groupField: string;
/**
* @description 分组代码表
* @type {*}
* @memberof GridControlState
*/
groupCodeList: any;
/**
* @description 禁用排序
* @type {boolean}
* @memberof GridControlState
*/
noSort: boolean;
/**
* @description 排序方向
* @type {string}
* @memberof GridControlState
*/
minorSortDir: string;
/**
* @description 排序属性
* @type {string}
* @memberof GridControlState
*/
minorSortPSDEF: string;
}
import { createUUID } from 'qx-util';
import { UIUtil, deepCopy, GridControlProps, GridControlState, IActionParam, IParam, MainControl } from '@core';
/**
* @description 表格部件
* @export
* @class GridControl
* @extends {MainControl}
*/
export class GridControl extends MainControl {
/**
* @description 部件状态
* @type {GridControlState}
* @memberof GridControl
*/
public declare controlState: GridControlState;
/**
* @description
* @param {GridControlProps} props
* @memberof GridControl
*/
public setState(props: GridControlProps) {
super.setState(props);
this.controlState.multiple = toRef(props, "multiple") as any;
this.controlState.rowEditState = toRef(props, "rowEditState") as any;
this.controlState.rowActiveMode = toRef(props, "rowActiveMode") as any;
this.controlState.selectedData = toRef(props, "selectedData") as any;
this.controlState.selectFirstDefault = toRef(props, "selectFirstDefault") as any;
}
/**
* @description 表格数据改变
* @param {number} rowIndex 行索引
* @param {string} name 表格列属性名称
* @param {*} value 表格列属性值
* @memberof GridControl
*/
public gridDataChange(rowIndex: number, name: string, value: any){
if (this.controlState.data[rowIndex][name] !== value) {
this.controlState.data[rowIndex][name] = value;
if (!this.controlState.data[rowIndex]["rowDataState"]) {
this.controlState.data[rowIndex]["rowDataState"] = "update";
}
}
}
/**
* @description 获取界面行为权限状态
* @param {IParam} rowData 行数据
* @return {*}
* @memberof GridControl
*/
public getActionAuthState(rowData: IParam) {
const { UIService, uAColumnModel } = this.controlState;
let tempModel: any = deepCopy(uAColumnModel);
UIUtil.calcActionItemAuthState(rowData, tempModel, UIService);
return tempModel;
}
/**
* @description 获取指定列类型模型
* @param {IParam[]} columns 表格列集合
* @param {string} columnType 表格列类型
* @return {*} {*}
* @memberof GridControl
*/
public getGridColumn(columns: IParam[], columnType: string): any {
for (const column of columns) {
if (Object.is(column.columnType, columnType)) {
return deepCopy(column);
}
if (column.children?.length > 0) {
return this.getGridColumn(column.children, columnType);
}
}
}
/**
* @description 自动分组
* @memberof GridControl
*/
public autoGroup() {
const { gridGroup } = this.controlState;
const { groupField } = gridGroup;
const dataRef = toRef(this.controlState, "data");
let autoGroup: string[] = [];
dataRef.value.forEach((item: IParam) => {
if (item.hasOwnProperty(groupField)) {
autoGroup.push(item[groupField]);
}
})
autoGroup = [...new Set(autoGroup)];
if (autoGroup.length > 0) {
const columnsModelRef = toRef(this.controlState, "columnsModel");
const groupColumn = this.getGridColumn(columnsModelRef.value, "GROUP");
const gridData: IParam[] = [];
autoGroup.forEach((group: string, index: number) => {
const children: IParam[] = [];
dataRef.value.forEach((item: IParam) => {
if (Object.is(group, item[groupField])) {
children.push(item);
}
})
gridData.push({
srfkey: createUUID(),
[groupColumn.dataIndex]: group,
children: deepCopy(children),
})
});
dataRef.value = gridData;
}
}
/**
* @description 代码表分组
* @memberof GridControl
*/
public async codeListGroup() {
const { gridGroup } = this.controlState;
const { groupField } = gridGroup;
const dataRef = toRef(this.controlState, "data");
// TODO 代码表数据
let codeListGroup: IParam[] = [];
if (codeListGroup.length > 0) {
const columnsModelRef = toRef(this.controlState, "columnsModel");
const groupColumn = this.getGridColumn(columnsModelRef.value, "GROUP");
const gridData: IParam[] = [];
const otherGroup: IParam[] = [];
codeListGroup.forEach((group: IParam) => {
const children: IParam[] = [];
dataRef.value.forEach((item: IParam) => {
if (Object.is(group.value, item[groupField])) {
children.push(item);
}
});
gridData.push({
srfkey: createUUID(),
[groupColumn.dataIndex]: group.text,
children: deepCopy(children),
})
});
dataRef.value.forEach((item: IParam) => {
const index: number = codeListGroup.findIndex((_item: IParam) => Object.is(item[groupField], _item.value));
if (index < 0) {
otherGroup.push(item);
}
});
if (otherGroup.length > 0) {
gridData.push({
srfkey: createUUID(),
[groupColumn.dataIndex]: "其它",
children: deepCopy(otherGroup),
})
}
dataRef.value = gridData;
}
}
/**
* @description 计算表格行为权限
* @memberof GridControl
*/
public calcGridAuthState() {
const dataRef = toRef(this.controlState, "data");
const columnsModelRef = toRef(this.controlState, "columnsModel");
let columnModel = this.getGridColumn(columnsModelRef.value, "UAGRIDCOLUMN");
if (columnModel) {
dataRef.value.forEach((item: IParam) => {
Object.assign(item, {
[columnModel.dataIndex]: this.getActionAuthState(item),
})
})
}
}
/**
* @description 设置表格合并列
* @memberof GridControl
*/
public setGridColSpan() {
const columnsModelRef = toRef(this.controlState, "columnsModel");
columnsModelRef.value.forEach((columnModel: IParam) => {
const customRender = ({text, record, index, column}: IParam) => {
const option = {
props: {} as IParam,
};
if (record.children) {
if (Object.is(column.columnType, "GROUP")) {
Object.assign(option.props,{
colSpan: columnsModelRef.value.length,
});
} else {
Object.assign(option.props,{
colSpan: 0
});
}
}
return option;
}
Object.assign(columnModel,{
customRender: customRender,
})
});
}
/**
* @description 处理表格分组
* @memberof GridControl
*/
public handleGridGroup() {
const { gridGroup } = this.controlState;
const { enableGroup, groupField, groupMode } = gridGroup;
if (enableGroup && groupField && !Object.is(groupMode, "NONE")) {
if (Object.is(groupMode, "AUTO")) {
this.autoGroup();
} else if (Object.is(groupMode, "CODELIST")) {
this.codeListGroup();
}
this.setGridColSpan();
}
}
/**
* @description 远程聚合
* @memberof GridControl
*/
public async remoteAgg(): Promise<IParam[]> {
const { gridAgg } = this.controlState;
const aggData: IParam[] = [];
// TODO 调用服务获取聚合数据
return aggData;
}
/**
* @description 获取聚合值
* @param {IParam[]} aggData 聚合数据
* @param {string} column 列模型
* @memberof GridControl
*/
public getAggValue(aggData: IParam[], column: IParam): string {
switch (column.aggMode) {
case "NONE":
return "";
case "SUM":
let sum: number = 0;
aggData.forEach((item: IParam) => {
sum += Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
})
return "SUM:" + sum;
case "AVG":
let sum2: number = 0;
aggData.forEach((item: IParam) => {
sum2 += Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
})
return "AVG:" + Number(sum2 / (aggData.length)).toFixed(3);
case "MAX":
let max: number = 0;
aggData.forEach((item: IParam) => {
const value: number = Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
if (value > max) {
max = value;
}
})
return "MAX:" + max;
case "MIN":
let min: number = 0;
aggData.forEach((item: IParam) => {
const value: number = Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
if (min > value) {
min = value;
}
})
return "MIN:" + min;
default:
return "";
}
}
/**
* @description 处理数据聚合
* @memberof GridControl
*/
public async handleDataAgg() {
const { gridPaging, gridGroup } = this.controlState;
const gridAggRef = toRef(this.controlState, "gridAgg");
let { aggMode, aggData } = gridAggRef.value;
const { enableGroup } = gridGroup;
if (!Object.is(aggMode, "NONE")) {
const { enablePagingBar, current, pageSize} = gridPaging;
let dataAgg: IParam[] = [];
if (Object.is(aggMode, "PAGE")) {
const dataRef = toRef(this.controlState, "data");
dataAgg = [...dataRef.value];
} else if (Object.is(aggMode, "ALL")) {
dataAgg = await this.remoteAgg();
}
if (enablePagingBar) {
const start: number = (current - 1) * pageSize > 0 ? (current - 1) * pageSize - 1 : 0;
const end: number = current * pageSize;
dataAgg = dataAgg.slice(start, end);
}
if (enableGroup) {
const _dataAgg: IParam[] = [];
dataAgg.forEach((item: IParam) => {
item.children?.forEach((child: IParam) => {
_dataAgg.push(child);
})
})
dataAgg = _dataAgg;
}
const columnsModelRef = toRef(this.controlState, "columnsModel");
const columnsModel: IParam[] = [];
columnsModelRef.value.forEach((column: IParam) => {
if (!Object.is(column.columnType, "GROUPGRIDCOLUMN")) {
columnsModel.push(column);
}
});
columnsModel.forEach((column: IParam) => {
aggData.push(this.getAggValue(dataAgg, column))
})
}
}
/**
* @description 处理默认选中
* @memberof GridControl
*/
public handleDefaultSelect() {
const { selectedData, selectFirstDefault, controlName } = this.controlState;
if (selectedData?.length > 0) {
const selectedRowKeys: string[] = [];
const selectedRowKeysRef = toRef(this.controlState, "selectedRowKeys");
selectedData.forEach((selected: IParam) => {
if (selected.srfkey) {
selectedRowKeys.push(selected.srfkey);
}
});
selectedRowKeysRef.value = selectedRowKeys;
} else if (selectFirstDefault) {
const dataRef = toRef(this.controlState, "data");
if (dataRef.value[0]) {
this.emit("ctrlEvent", {
tag: controlName,
action: "selectionChange",
data: [deepCopy(dataRef.value[0])],
});
}
}
}
/**
* @description 使用加载功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useLoad(props: GridControlProps){
const { viewSubject, controlName } = this.controlState;
const load = async (opt: any = {})=>{
try {
const {
controlService, context, viewParams, showBusyIndicator, controlAction, gridSort
} = this.controlState;
const dataRef = toRef(this.controlState, "data");
const gridPagingRef = toRef(this.controlState, "gridPaging");
if(!controlAction.loadAction){
return;
}
const { noSort, minorSortDir, minorSortPSDEF} = gridSort;
let { enablePagingBar, pagination, current, pageSize} = gridPagingRef.value;
const arg: any = { ...opt };
let _context = deepCopy(context ? context : {});
let _viewParams = deepCopy(viewParams ? context : {});
if (noSort && minorSortDir && minorSortPSDEF) {
Object.assign(_viewParams, { sort: `${minorSortPSDEF},${minorSortDir}`});
}
if (enablePagingBar) {
Object.assign(_viewParams, { page: current - 1, size: pageSize});
}
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.get(
_context,
arg,
{ action: controlAction.loadAction, isLoading: showBusyIndicator}
);
if (response.status || response.status == 200) {
dataRef.value = response.data;
if (enablePagingBar) {
pagination['total'] = response.total;
}
this.calcGridAuthState();
this.handleDefaultSelect();
this.handleGridGroup();
this.handleDataAgg();
}
} catch (error) {
// todo 错误异常处理
console.log(error);
}
}
// 订阅viewSubject,监听load行为
if(viewSubject){
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam)=>{
if(Object.is(controlName, tag) && Object.is("load", action) ){
load(data)
}
})
// 部件卸载时退订viewSubject
onUnmounted(()=>{
subscription.unsubscribe();
})
}
return {
load: load
}
}
/**
* @description 使用保存功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useSave(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const save = async (opt: any = {}) => {
try {
const { controlService, context, viewParams, showBusyIndicator, data, controlAction } = this.controlState;
// TODO 值规则校验处理
for (const item of data) {
const { updateAction, createAction } = controlAction;
const saveAction: any = item.rowDataState == "update" ? updateAction : item.rowDataState == "create" ? createAction : "";
const saveFunName = item.rowDataState;
if (!saveAction || !saveFunName) {
return;
}
const arg: any = { ...opt };
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
Object.assign(arg, item.getDo());
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService[saveFunName](
_context,
arg,
{ action: saveAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
}
}
} catch (error) {
// TODO 错误异常处理
console.log(error);
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("save", action)) {
save(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return {
save: save,
};
}
/**
* @description 使用删除功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useRemove(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const remove = async (opt: IParam[] = []) => {
try {
const { controlService, context, viewParams, showBusyIndicator, controlAction, appDeCodeName } = this.controlState;
if (!controlAction.removeAction) {
return;
}
const dataRef = toRef(this.controlState, "data");
const data: IParam[] = [];
opt.forEach((item: IParam, index: number) => {
if (Object.is(item.srfuf, "0")) {
dataRef.value.some((val: any, num: number) => {
if (JSON.stringify(val) == JSON.stringify(item)) {
dataRef.value.splice(num, 1);
return true;
}
});
} else {
data.push(opt[index]);
}
});
if (data.length > 0) {
const keys: string[] = [];
data.forEach((item: IParam) => {
keys.push(item.srfkey);
});
const _removeAction = keys.length > 1 ? "removeBatch" : controlAction.removeAction;
let _context = deepCopy(context);
Object.assign(_context, {[appDeCodeName]: keys});
let _viewParams = deepCopy(viewParams);
const arg: IParam = {
[appDeCodeName]: keys,
};
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.remove(
_context,
arg,
{ action: _removeAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
}
}
} catch (error) {
// TODO 错误异常处理
console.log(error);
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("remove", action)) {
remove(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return {
remove: remove,
};
}
/**
* @description 使用新建行功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useNewRow(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const newRow = async (opt: any = {}) => {
try {
const { controlService, context, viewParams, showBusyIndicator, controlAction } = this.controlState;
if (!controlAction.loadDraftAction) {
return;
}
const dataRef = toRef(this.controlState, "data");
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
const arg: any = {...opt};
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.loadDraft(
_context,
arg,
{ action: controlAction.loadDraftAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
dataRef.value = [...dataRef.value,[response.data]];
}
} catch (error) {
// TODO 错误异常处理
console.log(error);
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("newRow", action)) {
newRow(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return {
newRow: newRow,
};
}
/**
* @description 使用自定义模块(蚂蚁金服UI自定义)
* @param {GridControlProps} props
* @memberof GridControl
*/
public useCustom(props: GridControlProps) {
const { controlName, selectFirstDefault, rowEditState, rowActiveMode } = this.controlState;
const selectedRowKeysRef = toRef(this.controlState, "selectedRowKeys");
const gridPagingRef = toRef(this.controlState, "gridPaging");
let { current, pageSize } = gridPagingRef.value;
// 滚动条配置
const scrollOption = computed(() => {
return {
scrollToFirstRowOnChange: true,
x: '110%',
y: '690px',
}
});
// 指定表格行key
const rowKey = (record: IParam) => {
return record.srfkey;
}
// 表格行样式
const rowClassName = (record: IParam, index: number) => {
return index % 2 === 1 ? "table-striped" : null;
}
// 表格行自定义
const customRow = (record: IParam, index: number) => {
return {
onClick: () => {
if (!rowEditState) {
selectedRowKeysRef.value = [record.srfkey];
if (!record.children) {
this.emit("ctrlEvent",{ tag: controlName, action: "selectionChange", data: [deepCopy(record)] })
if (Object.is(rowActiveMode, 1)) {
this.emit("ctrlEvent",{ tag: controlName, action: "rowClick", data: [deepCopy(record)] })
}
}
}
},
onDblclick: () => {
if (!record.children && Object.is(rowActiveMode, 2)) {
this.emit("ctrlEvent",{ tag: controlName, action: "rowDbClick", data: [deepCopy(record)] })
}
}
};
}
// 表格选择功能配置
const rowSelectionOption = computed(() => {
if (selectFirstDefault) {
return false;
}
return {
columnWidth: 90,
selectedRowKeys: selectedRowKeysRef.value,
checkStrictly: props.multiple ? false : true,
onChange: (selectedRowKeys: string[], selectedRows: IParam[]) => {
selectedRowKeysRef.value = selectedRowKeys;
const selection: IParam[] = [];
selectedRows.forEach((select: IParam) => {
if (!select.children) {
selection.push(select);
}
})
this.emit("ctrlEvent",{ tag: controlName, action: "selectionChange", data: selection })
},
};
});
// 列拖动
const resizeColumn = (width: number, column: IParam) => {
column.width = width;
}
// 处理表格变化(分页,过滤,排序)
const handleGridChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => {
if (pagination) {
current = pagination.current;
pageSize = pagination.pageSize;
this.useLoad(props).load();
}
}
return {
custom: {
scrollOption,
rowKey,
rowClassName,
customRow,
rowSelectionOption,
resizeColumn,
handleGridChange,
}
}
}
/**
* @description 处理编辑器事件
* @param {IActionParam} actionParam 行为参数
* @memberof GridControl
*/
public handleEditorEvent(rowIndex: number, actionParam: IActionParam) {
const { tag, action, data } = actionParam;
switch (action) {
case "valueChange":
this.gridDataChange(rowIndex, tag, data);
break;
default:
break;
}
}
/**
* @description 处理表格操作列事件
* @param {IActionParam} actionParam 行为参数
* @param {IParam} [row] 表格行数据
* @memberof GridControl
*/
public handleToolbarEvent(actionParam: IActionParam, row?: IParam) {
const { tag, action, data } = actionParam;
console.log('触发界面行为', actionParam, row);
}
/**
* @description 安装部件所有功能模块的方法
* @param {GridControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof GridControl [emit] 事件
*/
public moduleInstall(props: GridControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
const { load } = this.useLoad(props);
const { custom } = this.useCustom(props);
return {
...superParams,
state: this.controlState,
load,
custom,
handleEditorEvent: this.handleEditorEvent.bind(this),
handleToolbarEvent: this.handleToolbarEvent.bind(this),
};
}
}
import { ControlAction, ControlStateBase, IParam } from "@ibiz-core";
import { ControlAction, ControlStateBase, IParam } from "@core";
/**
* @description 实体部件状态
......@@ -35,11 +35,4 @@ export interface MainControlState extends ControlStateBase {
* @memberof MainControlState
*/
UIService: IParam;
/**
* @description 应用实体codeName
* @type {string}
* @memberof MainControlState
*/
appDeCodeName: string;
}
\ No newline at end of file
import { Ref } from 'vue';
import { MenuControlProps, MenuControlState, IActionParam, ControlBase, IParam, AppFuncService, deepCopy } from '@ibiz-core';
import { App } from '@service';
import { MenuControlProps, MenuControlState, IActionParam, ControlBase, IParam, AppFuncService, deepCopy } from '@core';
/**
* @description 菜单部件
......@@ -165,7 +164,7 @@ export class MenuControl extends ControlBase {
*/
public menuClick(item: IParam) {
const { context, viewParams } = this.controlState;
App.appFuncService.executeAppFunc(item, deepCopy(context), deepCopy(viewParams));
App.getAppFuncService().executeAppFunc(item, deepCopy(context), deepCopy(viewParams));
}
/**
......
import { Ref, ref } from 'vue';
import { IActionParam, MainControl } from '@ibiz-core';
import { IActionParam, MainControl } from '@core';
import { PickupViewPanelControlProps } from './pickupviewpanel-control-prop';
import { PickupViewPanelControlState } from './pickupviewpanel-control-state';
......
import { ControlServiceBase, ControlVOBase, hasFunction, IParam } from '@ibiz-core';
import { ControlServiceBase, ControlVOBase, hasFunction, IParam } from '@core';
/**
* @description 表格部件服务
......@@ -13,7 +13,7 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
* @description 加载草稿
* @param {IParam} context 上下文
* @param {IParam} data 行为数据
* @param \{{ action: string; isLoading?: boolean }} opts 行为参数
* @param { action: string; isLoading?: boolean } opts 行为参数
* @return {*} {Promise<any>}
* @memberof GridService
*/
......@@ -33,14 +33,14 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
* @description 加载数据
* @param {IParam} context 上下文
* @param {IParam} data 行为数据
* @param \{{ action: string; isLoading?: boolean }} opts 行为参数
* @param { action: string; isLoading?: boolean } opts 行为参数
* @return {*} {Promise<any>}
* @memberof GridService
*/
public async get(context: IParam, data: IParam, opts: { action: string; isLoading?: boolean }): Promise<any> {
let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(_entityService, opts.action) ? opts.action : 'FetchDefault';
const action = hasFunction(_entityService, opts.action) ? opts.action : 'GET';
const response = await _entityService[action](Context, Data, opts.isLoading);
//this.setCopynativeData(response.data);
response.data?.forEach((item: IParam) =>{
......@@ -53,7 +53,7 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
* @description 新建数据
* @param {IParam} context 上下文
* @param {IParam} data 行为数据
* @param \{{ action: string; isLoading?: boolean }} opts 行为参数
* @param { action: string; isLoading?: boolean } opts 行为参数
* @return {*} {Promise<any>}
* @memberof GridService
*/
......@@ -70,7 +70,7 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
* @description 删除数据
* @param {IParam} context 上下文
* @param {IParam} data 行为数据
* @param \{{ action: string; isLoading?: boolean }} opts 行为参数
* @param { action: string; isLoading?: boolean } opts 行为参数
* @return {*} {Promise<any>}
* @memberof GridService
*/
......@@ -87,7 +87,7 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
* @description 更新
* @param {*} context 上下文
* @param {*} data 行为数据
* @param \{{ action: string; isLoading?: boolean }} opts 行为参数
* @param { action: string; isLoading?: boolean } opts 行为参数
* @return {*} {Promise<any>}
* @memberof GridService
*/
......
import { Http, RouteTool } from '@ibiz-core';
import { Http, RouteUtil } from '@core';
/**
* 实体服务基类
* @export
......@@ -30,7 +30,7 @@ export class EntityService{
* @param isSelfAppend 是否拼接实体自身的主键值。
*/
protected buildDeResPath(context: any, isSelfAppend: boolean){
let deResPath = RouteTool.buildDeResRequestPath(context,this.deResPaths);
let deResPath = RouteUtil.buildDeResRequestPath(context,this.deResPaths);
// 不需要自身的主键值的删除末尾/xxxx
if(!isSelfAppend){
deResPath = deResPath.substring(0,deResPath.lastIndexOf("/"))
......
export * from './control-service'
export * from './entity'
export * from './ui-service/ui-service-base'
\ No newline at end of file
export * from './entity-service'
export * from './ui-service'
\ No newline at end of file
export { UIServiceBase } from './ui-service-base';
\ No newline at end of file
export * from './util';
export * from './ui';
export * from './net';
\ No newline at end of file
import { isExist } from '@ibiz-core';
import { isExist } from '@core';
import axios from 'axios';
import qs from 'qs';
import { Subject } from 'rxjs';
......
export { RouteUtil } from './route-util';
export { UIUtil } from './ui-util';
\ No newline at end of file
import { notEmpty } from '@ibiz-core';
import { notEmpty } from '@core';
import qs from 'qs';
/**
* 路由相关处理逻辑工具类
*
* @export
* @class RouteTool
* @class RouteUtil
*/
export class RouteTool {
export class RouteUtil {
/**
* 处理路由路径
......@@ -31,7 +31,7 @@ export class RouteTool {
* @static
* @param {Route} route 路由对象
* @returns {string}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static getIndexRoutePath(route: any): string {
const parameter = route.meta?.parameters?.[0] || { pathName: "apps", parameterName: "app" };
......@@ -54,7 +54,7 @@ export class RouteTool {
* @param {*} [viewParam={}] 视图上下文
* @param {any[]} deResPaths 关系实体参数对象数组
* @returns {string}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static getDeResRoutePath(context: any = {}, deResPaths: any[]): string {
let routePath: string = '';
......@@ -113,7 +113,7 @@ export class RouteTool {
* @param {*} [viewParam={}] 视图上下文
* @param {any[]} deResPaths 关系实体参数对象数组
* @returns {string}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static buildDeResRequestPath(context: any = {}, deResPaths: any[]): string {
let routePath: string = '';
......@@ -186,7 +186,7 @@ export class RouteTool {
* @static
* @param {*} params
* @returns {*}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static formatRouteParams(params: any, route: any, context: any, viewparams: any): void {
Object.keys(params).forEach((key: string, index: number) => {
......@@ -218,7 +218,7 @@ export class RouteTool {
* @private
* @static
* @type {any[]}
* @memberof RouteTool
* @memberof RouteUtil
*/
private static indexParameters: any[] = [];
......@@ -227,7 +227,7 @@ export class RouteTool {
*
* @static
* @param {any[]} parameters
* @memberof RouteTool
* @memberof RouteUtil
*/
public static setIndexParameters(parameters: any[]): void {
this.indexParameters = [...parameters];
......@@ -238,7 +238,7 @@ export class RouteTool {
*
* @static
* @returns {any[]}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static getIndexParameters(): any[] {
return this.indexParameters;
......@@ -249,7 +249,7 @@ export class RouteTool {
*
* @static
* @type {*}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static indexViewParam: any = {};
......@@ -258,7 +258,7 @@ export class RouteTool {
*
* @static
* @param {*} [viewParam={}]
* @memberof RouteTool
* @memberof RouteUtil
*/
public static setIndexViewParam(viewParam: any = {}): void {
Object.assign(this.indexViewParam, viewParam);
......@@ -269,7 +269,7 @@ export class RouteTool {
*
* @static
* @returns {*}
* @memberof RouteTool
* @memberof RouteUtil
*/
public static getIndexViewParam(): any {
return this.indexViewParam;
......@@ -282,7 +282,7 @@ export class RouteTool {
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof RouteTool
* @memberof RouteUtil
*/
public static calcActionItemAuthState(data: any, ActionModel: any, UIService: any) {
let result: any[] = [];
......@@ -334,7 +334,7 @@ export class RouteTool {
* @param {*} [data] 传入数据
* @param {*} [ActionModel] 界面行为模型
* @param {*} [UIService] 界面行为服务
* @memberof RouteTool
* @memberof RouteUtil
*/
public static calcTreeActionItemAuthState(data: any, ActionModel: any, UIService: any) {
let result: any[] = [];
......@@ -384,7 +384,7 @@ export class RouteTool {
* @param {*} [tempContext] 上下文
* @param {*} [data] 传入数据
* @param {*} [redirectAppEntity] 应用实体对象
* @memberof RouteTool
* @memberof RouteUtil
*/
public static async calcRedirectContext(tempContext: any, data: any, redirectAppEntity: any) {
if (
......
import { IParam } from "@core";
/**
* 视图相关处理逻辑工具类
*
* @export
* @class UIUtil
*/
export class UIUtil {
/**
* @description 计算界面行为项权限状态
* @export
* @param {IParam} data 传入数据
* @param {IParam} actionModel 界面行为模型
* @param {*} UIService 界面行为服务
* @return {*}
*/
public static calcActionItemAuthState(data: IParam, actionModel: IParam, UIService: any) {
const result: any[] = [];
if (!UIService) return;
for (const key in actionModel) {
if (!actionModel.hasOwnProperty(key)) {
return result;
}
const item = actionModel[key];
let dataActionResult: any;
if (item && item['dataAccessAction']) {
if (Object.is(item['actionTarget'], 'NONE') || Object.is(item['actionTarget'], '')) {
dataActionResult = UIService.getAllOPPrivs({}, item['dataAccessAction']);
} else {
if (data && Object.keys(data).length > 0) {
dataActionResult = UIService.getAllOPPrivs(data, item['dataAccessAction']);
}
}
} else {
dataActionResult = 1;
}
// 无权限:0;有权限:1
if (dataActionResult === 0) {
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if (item.getNoPrivDisplayMode === 1) {
item.disabled = true;
}
if (item.getNoPrivDisplayMode === 2 || item.getNoPrivDisplayMode === 6) {
item.visabled = false;
} else {
item.visabled = true;
}
}
if (dataActionResult === 1) {
item.visabled = true;
item.disabled = false;
}
// 返回权限验证的结果
item.dataActionResult = dataActionResult;
result.push(dataActionResult);
}
return result;
}
/**
* @description 计算导航数据
* 先从当前数据目标计算,然后再从当前上下文计算,最后从当前视图参数计算,没有则为null
* @export
* @param {*} data 当前数据目标
* @param {*} parentContext 当前上下文
* @param {*} parentParam 当前视图参数
* @param {*} params 导航参数
* @return {*}
*/
public static computedNavData(data: any, parentContext: any, parentParam: any, params: any): any {
const _data: any = {};
if (params && Object.keys(params).length > 0) {
Object.keys(params).forEach((name: string) => {
if (!name) {
return;
}
let value: string | null = params[name];
if (value && value.toString().startsWith('%') && value.toString().endsWith('%')) {
const key = value.substring(1, value.length - 1).toLowerCase();
if (data && data.hasOwnProperty(key)) {
value = data[key];
} else if (parentContext && parentContext[key]) {
value = parentContext[key];
} else if (parentParam && parentParam[key]) {
value = parentParam[key];
} else {
value = null;
}
}
Object.assign(_data, { [name.toLowerCase()]: value });
});
}
return _data;
}
/**
* @description 值规则校验
* @export
* @param {Record<any, any>} props
*/
public static async verifyRules(_rule: any, value: any, condition: any) {
//常规规则
if (Object.is(condition.Type, 'SIMPLE')) {
//todo
// 数值范围
} else if (Object.is(condition.Type, 'VALUERANGE2')) {
if (!value) {
return;
}
if (!Number.isInteger(value)) {
return Promise.reject('请输入数值!');
} else {
if (condition.includeMinValue && Object.is(value, condition.minValue)) {
return Promise.resolve();
} else if (condition.includeMaxValue && Object.is(value, condition.maxValue)) {
return Promise.resolve();
} else if (value > condition.minValue && value < condition.maxValue) {
return Promise.resolve();
}
}
// 正则式
} else if (Object.is(condition.Type, 'REGEX')) {
// 长度
} else if (Object.is(condition.Type, 'STRINGLENGTH')) {
// 系统值规则
} else if (Object.is(condition.Type, 'SYSVALUERULE')) {
}
}
}
export const FuncConfig = [
{{#each app.allPSAppFuncs as | func |}}
{
name: "{{func.name}}",
funcTag: "{{func.codeName}}",
appFuncType: "{{func.appFuncType}}",
{{#if (eq func.appFuncType 'OPENHTMLPAGE')}}
htmlPageUrl: "{{func.htmlPageUrl}}",
{{/if}}
{{#if (eq func.appFuncType 'APPVIEW')}}
openMode: "{{func.openMode}}",
viewName: "{{func.psAppView.name}}",
viewCodeName: "{{func.psAppView.codeName}}",
{{/if}}
navParam: {
{{#if func.psNavigateParams}}
{{#each func.psNavigateParams as | param |}}
{{lowerCase param.key}}: "{{#if param.rawValue}}{{param.value}}{{else}}%{{lowerCase param.value}}%{{/if}}",
{{/each}}
{{/if}}
},
navContext: {
{{#if func.psNavigateContexts}}
{{#each func.psNavigateContexts as | context |}}
{{lowerCase context.key}}: "{{#if context.rawValue}}{{context.value}}{{else}}%{{lowerCase context.value}}%{{/if}}",
{{/each}}
{{/if}}
},
},
{{/each}}
]
\ No newline at end of file
export * from './app-func-service';
export * from './app-func-config';
\ No newline at end of file
/**
* @description 界面行为对象
* @export
* @interface IUIAction
*/
export interface IUIAction {
/**
* 界面行为模式
* @description 值模式 [云实体界面行为类型] {SYS:系统预定义、 FRONT:前台调用、 BACKEND:后台调用、 WFFRONT:工作流前台调用、 WFBACKEND:工作流后台调用 }
* @type {( string | 'SYS' | 'FRONT' | 'BACKEND' | 'WFFRONT' | 'WFBACKEND')}
*/
uIActionMode: string | 'SYS' | 'FRONT' | 'BACKEND' | 'WFFRONT' | 'WFBACKEND';
/**
* 界面行为标记
* @type {string}
*/
uIActionTag: string;
}
\ No newline at end of file
export * from './common'
export * from './app-logic'
\ No newline at end of file
import { IUIAction } from '@ibiz-core';
/**
* 界面行为参数
* @interface UIActionParams
*/
interface UIActionParams{
args: any[],
context: any,
params: any,
$event?: any,
xData?: any,
actionContext?: any,
srfParentDeName?: string,
deUIService?: any,
}
export class AppBackendAction {
/**
* 执行界面行为
*
* @param args
* @param context
* @param params
* @param $event
* @param xData
* @param actionContext
* @param srfParentDeName
*
* @memberof AppBackendAction
*/
public static async execute(uiAction:IUIAction, params: any) {
// TODO 后台调用
}
}
import { IUIAction } from '@ibiz-core';
/**
* 界面行为参数
* @interface UIActionParams
*/
interface UIActionParams{
args: any[],
context: any,
params: any,
$event?: any,
xData?: any,
actionContext?: any,
srfParentDeName?: string,
deUIService?: any,
}
export class AppFrontAction {
/**
* 执行界面行为
*
* @param args
* @param context
* @param params
* @param $event
* @param xData
* @param actionContext
* @param srfParentDeName
*
* @memberof AppFrontAction
*/
public static async execute(uiAction:IUIAction, params: any) {
// TODO 前台调用
}
}
import { IUIAction } from '@ibiz-core';
/**
* 界面行为参数
* @interface UIActionParams
*/
interface UIActionParams{
args: any[],
context: any,
params: any,
$event?: any,
xData?: any,
actionContext?: any,
srfParentDeName?: string,
deUIService?: any,
}
export class AppSysAction {
/**
* 执行界面行为
*
* @param args
* @param context
* @param params
* @param $event
* @param xData
* @param actionContext
* @param srfParentDeName
*
* @memberof AppSysAction
*/
public static async execute(uiAction:IUIAction, params: any) {
// TODO 系统预置调用
}
}
import { IContext, IParam } from '@ibiz-core';
import { Ref } from 'vue';
import { deepCopy } from '../../utils';
/**
* 为源响应式对象上的某个属性新创建一个单向的Ref,类似于vue的toRef但区别在于,修改返回的Ref,不会影响源响应对象的该属性。而源响应对象上的属性值变化会响应式影响到返回的Ref
*
* @param object 源响应对象,可以是ref对象,也可以是reactive对象
* @param key 响应对象上的属性的key值
*
* ```ts
* const object = ref({foo: 1});
* // 或者 const object = reactive({foo: 1})
* const foo = toOneWayRef(object, 'foo');
* foo.value = 2;
* console.log(object.foo) // 1
* console.log(foo.value) // 2
* object.foo = 3
* console.log(object.foo) // 3
* console.log(foo.value) // 3
* ```
* ps:如果要维持props的父对于props修改的响应性,props必须是Ref
* ```ts
* const father = reactive({ props: { foo: 1 }})
* const props = toRef(father,'props');
* const foo = toOneWayRef(props, 'foo');
* const foo1 = toOneWayRef(props.value,'foo')
* father.props = {foo: 3}
* console.log(father.props.foo) // 3
* console.log(foo.value) // 3
* console.log(foo1.value) // 1
* ```
*
*/
export function toOneWayRef<T extends object, K extends keyof T>(object: Ref<T> | T, key: K): Ref<T[K]>{
// 创建空的Ref
const propertyRef: Ref<T[K]> = ref({}) as any;
// 用watch来监听源响应对象的key属性,并建立单向响应
watch(
() => isRef(object) ? (object.value as T)[key] : object[key],
(newVal: any, oldVal: any) => {
// 用immediate来初始化最初的值,用deepCopy来切断与源值的关联
propertyRef.value = deepCopy(newVal) as T[K];
},
{
immediate: true,
deep: true,
},
);
return propertyRef;
}
/**
* @description 使用上下文参数逻辑块
* @export
* @param {Record<any, any>} props
*/
export function useContextParams(props: Record<any, any>) {
const { contextProp, viewParamsProp } = toRefs(props);
// 维护上下文并监控其变化
const context: Ref<IContext> = ref({});
watch(
contextProp,
(newVal: any, oldVal: any) => {
context.value = deepCopy(newVal || {});
},
{
immediate: true,
deep: true,
}
);
// 维护视图参数并监控其变化
const viewParams: Ref<IParam> = ref({});
watch(
viewParamsProp,
(newVal: any, oldVal: any) => {
viewParams.value = deepCopy(newVal || {});
},
{
immediate: true,
deep: true,
}
);
return { context, viewParams };
}
/**
* @description 值规则校验
* @export
* @param {Record<any, any>} props
*/
export async function verifyRules(_rule: any, value: any, condition: any) {
//常规规则
if (Object.is(condition.Type, 'SIMPLE')) {
//todo
// 数值范围
} else if (Object.is(condition.Type, 'VALUERANGE2')) {
if (!value) {
return;
}
if (!Number.isInteger(value)) {
return Promise.reject('请输入数值!');
} else {
if (condition.includeMinValue && Object.is(value,condition.minValue)) {
return Promise.resolve();
} else if (condition.includeMaxValue && Object.is(value,condition.maxValue)) {
return Promise.resolve();
} else if (value > condition.minValue && value < condition.maxValue) {
return Promise.resolve();
}
}
// 正则式
} else if (Object.is(condition.Type, 'REGEX')) {
// 长度
} else if (Object.is(condition.Type, 'STRINGLENGTH')) {
// 系统值规则
} else if (Object.is(condition.Type, 'SYSVALUERULE')) {
}
}
\ No newline at end of file
import { createUUID } from 'qx-util';
import { calcActionItemAuthState, deepCopy, GridControlProps, GridControlState, IActionParam, IParam, MainControl } from '@ibiz-core';
/**
* @description 表格部件
* @export
* @class GridControl
* @extends {MainControl}
*/
export class GridControl extends MainControl {
/**
* @description 部件状态
* @type {GridControlState}
* @memberof GridControl
*/
public declare controlState: GridControlState;
/**
* @description
* @param {GridControlProps} props
* @memberof GridControl
*/
public setState(props: GridControlProps) {
super.setState(props);
this.controlState.multiple = toRef(props, "multiple") as any;
this.controlState.rowEditState = toRef(props, "rowEditState") as any;
this.controlState.rowActiveMode = toRef(props, "rowActiveMode") as any;
this.controlState.selectedData = toRef(props, "selectedData") as any;
this.controlState.selectFirstDefault = toRef(props, "selectFirstDefault") as any;
}
/**
* @description 表格数据改变
* @param {number} rowIndex 行索引
* @param {string} name 表格列属性名称
* @param {*} value 表格列属性值
* @memberof GridControl
*/
public gridDataChange(rowIndex: number, name: string, value: any){
if (this.controlState.data[rowIndex][name] !== value) {
this.controlState.data[rowIndex][name] = value;
if (!this.controlState.data[rowIndex]["rowDataState"]) {
this.controlState.data[rowIndex]["rowDataState"] = "update";
}
}
}
/**
* @description 获取界面行为权限状态
* @param {IParam} rowData 行数据
* @return {*}
* @memberof GridControl
*/
public getActionAuthState(rowData: IParam) {
const { UIService, uAColumnModel } = this.controlState;
let tempModel: any = deepCopy(uAColumnModel);
calcActionItemAuthState(rowData, tempModel, UIService);
return tempModel;
}
/**
* @description 获取指定列类型模型
* @param {IParam[]} columns 表格列集合
* @param {string} columnType 表格列类型
* @return {*} {*}
* @memberof GridControl
*/
public getGridColumn(columns: IParam[], columnType: string): any {
for (const column of columns) {
if (Object.is(column.columnType, columnType)) {
return deepCopy(column);
}
if (column.children?.length > 0) {
return this.getGridColumn(column.children, columnType);
}
}
}
/**
* @description 自动分组
* @memberof GridControl
*/
public autoGroup() {
const { gridGroup } = this.controlState;
const { groupField } = gridGroup;
const dataRef = toRef(this.controlState, "data");
let autoGroup: string[] = [];
dataRef.value.forEach((item: IParam) => {
if (item.hasOwnProperty(groupField)) {
autoGroup.push(item[groupField]);
}
})
autoGroup = [...new Set(autoGroup)];
if (autoGroup.length > 0) {
const columnsModelRef = toRef(this.controlState, "columnsModel");
const groupColumn = this.getGridColumn(columnsModelRef.value, "GROUP");
const gridData: IParam[] = [];
autoGroup.forEach((group: string, index: number) => {
const children: IParam[] = [];
dataRef.value.forEach((item: IParam) => {
if (Object.is(group, item[groupField])) {
children.push(item);
}
})
gridData.push({
srfkey: createUUID(),
[groupColumn.dataIndex]: group,
children: deepCopy(children),
})
});
dataRef.value = gridData;
}
}
/**
* @description 代码表分组
* @memberof GridControl
*/
public async codeListGroup() {
const { gridGroup } = this.controlState;
const { groupField } = gridGroup;
const dataRef = toRef(this.controlState, "data");
// TODO 代码表数据
let codeListGroup: IParam[] = [];
if (codeListGroup.length > 0) {
const columnsModelRef = toRef(this.controlState, "columnsModel");
const groupColumn = this.getGridColumn(columnsModelRef.value, "GROUP");
const gridData: IParam[] = [];
const otherGroup: IParam[] = [];
codeListGroup.forEach((group: IParam) => {
const children: IParam[] = [];
dataRef.value.forEach((item: IParam) => {
if (Object.is(group.value, item[groupField])) {
children.push(item);
}
});
gridData.push({
srfkey: createUUID(),
[groupColumn.dataIndex]: group.text,
children: deepCopy(children),
})
});
dataRef.value.forEach((item: IParam) => {
const index: number = codeListGroup.findIndex((_item: IParam) => Object.is(item[groupField], _item.value));
if (index < 0) {
otherGroup.push(item);
}
});
if (otherGroup.length > 0) {
gridData.push({
srfkey: createUUID(),
[groupColumn.dataIndex]: "其它",
children: deepCopy(otherGroup),
})
}
dataRef.value = gridData;
}
}
/**
* @description 计算表格行为权限
* @memberof GridControl
*/
public calcGridAuthState() {
const dataRef = toRef(this.controlState, "data");
const columnsModelRef = toRef(this.controlState, "columnsModel");
let columnModel = this.getGridColumn(columnsModelRef.value, "UAGRIDCOLUMN");
if (columnModel) {
dataRef.value.forEach((item: IParam) => {
Object.assign(item, {
[columnModel.dataIndex]: this.getActionAuthState(item),
})
})
}
}
/**
* @description 设置表格合并列
* @memberof GridControl
*/
public setGridColSpan() {
const columnsModelRef = toRef(this.controlState, "columnsModel");
columnsModelRef.value.forEach((columnModel: IParam) => {
const customRender = ({text, record, index, column}: IParam) => {
const option = {
props: {} as IParam,
};
if (record.children) {
if (Object.is(column.columnType, "GROUP")) {
Object.assign(option.props,{
colSpan: columnsModelRef.value.length,
});
} else {
Object.assign(option.props,{
colSpan: 0
});
}
}
return option;
}
Object.assign(columnModel,{
customRender: customRender,
})
});
}
/**
* @description 处理表格分组
* @memberof GridControl
*/
public handleGridGroup() {
const { gridGroup } = this.controlState;
const { enableGroup, groupField, groupMode } = gridGroup;
if (enableGroup && groupField && !Object.is(groupMode, "NONE")) {
if (Object.is(groupMode, "AUTO")) {
this.autoGroup();
} else if (Object.is(groupMode, "CODELIST")) {
this.codeListGroup();
}
this.setGridColSpan();
}
}
/**
* @description 远程聚合
* @memberof GridControl
*/
public async remoteAgg(): Promise<IParam[]> {
const { gridAgg } = this.controlState;
const aggData: IParam[] = [];
// TODO 调用服务获取聚合数据
return aggData;
}
/**
* @description 获取聚合值
* @param {IParam[]} aggData 聚合数据
* @param {string} column 列模型
* @memberof GridControl
*/
public getAggValue(aggData: IParam[], column: IParam): string {
switch (column.aggMode) {
case "NONE":
return "";
case "SUM":
let sum: number = 0;
aggData.forEach((item: IParam) => {
sum += Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
})
return "SUM:" + sum;
case "AVG":
let sum2: number = 0;
aggData.forEach((item: IParam) => {
sum2 += Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
})
return "AVG:" + Number(sum2 / (aggData.length)).toFixed(3);
case "MAX":
let max: number = 0;
aggData.forEach((item: IParam) => {
const value: number = Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
if (value > max) {
max = value;
}
})
return "MAX:" + max;
case "MIN":
let min: number = 0;
aggData.forEach((item: IParam) => {
const value: number = Number(item[column.dataIndex] ? item[column.dataIndex] : 0);
if (min > value) {
min = value;
}
})
return "MIN:" + min;
default:
return "";
}
}
/**
* @description 处理数据聚合
* @memberof GridControl
*/
public async handleDataAgg() {
const { gridPaging, gridGroup } = this.controlState;
const gridAggRef = toRef(this.controlState, "gridAgg");
let { aggMode, aggData } = gridAggRef.value;
const { enableGroup } = gridGroup;
if (!Object.is(aggMode, "NONE")) {
const { enablePagingBar, current, pageSize} = gridPaging;
let dataAgg: IParam[] = [];
if (Object.is(aggMode, "PAGE")) {
const dataRef = toRef(this.controlState, "data");
dataAgg = [...dataRef.value];
} else if (Object.is(aggMode, "ALL")) {
dataAgg = await this.remoteAgg();
}
if (enablePagingBar) {
const start: number = (current - 1) * pageSize > 0 ? (current - 1) * pageSize - 1 : 0;
const end: number = current * pageSize;
dataAgg = dataAgg.slice(start, end);
}
if (enableGroup) {
const _dataAgg: IParam[] = [];
dataAgg.forEach((item: IParam) => {
item.children?.forEach((child: IParam) => {
_dataAgg.push(child);
})
})
dataAgg = _dataAgg;
}
const columnsModelRef = toRef(this.controlState, "columnsModel");
const columnsModel: IParam[] = [];
columnsModelRef.value.forEach((column: IParam) => {
if (!Object.is(column.columnType, "GROUPGRIDCOLUMN")) {
columnsModel.push(column);
}
});
columnsModel.forEach((column: IParam) => {
aggData.push(this.getAggValue(dataAgg, column))
})
}
}
/**
* @description 处理默认选中
* @memberof GridControl
*/
public handleDefaultSelect() {
const { selectedData, selectFirstDefault, controlName } = this.controlState;
if (selectedData?.length > 0) {
const selectedRowKeys: string[] = [];
const selectedRowKeysRef = toRef(this.controlState, "selectedRowKeys");
selectedData.forEach((selected: IParam) => {
if (selected.srfkey) {
selectedRowKeys.push(selected.srfkey);
}
});
selectedRowKeysRef.value = selectedRowKeys;
} else if (selectFirstDefault) {
const dataRef = toRef(this.controlState, "data");
if (dataRef.value[0]) {
this.emit("ctrlEvent", {
tag: controlName,
action: "selectionChange",
data: [deepCopy(dataRef.value[0])],
});
}
}
}
/**
* @description 使用加载功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useLoad(props: GridControlProps){
const { viewSubject, controlName } = this.controlState;
const load = async (opt: any = {})=>{
try {
const {
controlService, context, viewParams, showBusyIndicator, controlAction, gridSort
} = this.controlState;
const dataRef = toRef(this.controlState, "data");
const gridPagingRef = toRef(this.controlState, "gridPaging");
if(!controlAction.loadAction){
return;
}
const { noSort, minorSortDir, minorSortPSDEF} = gridSort;
let { enablePagingBar, pagination, current, pageSize} = gridPagingRef.value;
const arg: any = { ...opt };
let _context = deepCopy(context ? context : {});
let _viewParams = deepCopy(viewParams ? context : {});
if (noSort && minorSortDir && minorSortPSDEF) {
Object.assign(_viewParams, { sort: `${minorSortPSDEF},${minorSortDir}`});
}
if (enablePagingBar) {
Object.assign(_viewParams, { page: current - 1, size: pageSize});
}
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.get(
_context,
arg,
{ action: controlAction.loadAction, isLoading: showBusyIndicator}
);
if (response.status || response.status == 200) {
dataRef.value = response.data;
if (enablePagingBar) {
pagination['total'] = response.total;
}
this.calcGridAuthState();
this.handleDefaultSelect();
this.handleGridGroup();
this.handleDataAgg();
}
} catch (error) {
// todo 错误异常处理
console.log(error);
}
}
// 订阅viewSubject,监听load行为
if(viewSubject){
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam)=>{
if(Object.is(controlName, tag) && Object.is("load", action) ){
load(data)
}
})
// 部件卸载时退订viewSubject
onUnmounted(()=>{
subscription.unsubscribe();
})
}
return {
load: load
}
}
/**
* @description 使用保存功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useSave(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const save = async (opt: any = {}) => {
try {
const { controlService, context, viewParams, showBusyIndicator, data, controlAction } = this.controlState;
// TODO 值规则校验处理
for (const item of data) {
const { updateAction, createAction } = controlAction;
const saveAction: any = item.rowDataState == "update" ? updateAction : item.rowDataState == "create" ? createAction : "";
const saveFunName = item.rowDataState;
if (!saveAction || !saveFunName) {
return;
}
const arg: any = { ...opt };
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
Object.assign(arg, item.getDo());
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService[saveFunName](
_context,
arg,
{ action: saveAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
}
}
} catch (error) {
// TODO 错误异常处理
console.log(error);
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("save", action)) {
save(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return {
save: save,
};
}
/**
* @description 使用删除功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useRemove(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const remove = async (opt: IParam[] = []) => {
try {
const { controlService, context, viewParams, showBusyIndicator, controlAction, appDeCodeName } = this.controlState;
if (!controlAction.removeAction) {
return;
}
const dataRef = toRef(this.controlState, "data");
const data: IParam[] = [];
opt.forEach((item: IParam, index: number) => {
if (Object.is(item.srfuf, "0")) {
dataRef.value.some((val: any, num: number) => {
if (JSON.stringify(val) == JSON.stringify(item)) {
dataRef.value.splice(num, 1);
return true;
}
});
} else {
data.push(opt[index]);
}
});
if (data.length > 0) {
const keys: string[] = [];
data.forEach((item: IParam) => {
keys.push(item.srfkey);
});
const _removeAction = keys.length > 1 ? "removeBatch" : controlAction.removeAction;
let _context = deepCopy(context);
Object.assign(_context, {[appDeCodeName]: keys});
let _viewParams = deepCopy(viewParams);
const arg: IParam = {
[appDeCodeName]: keys,
};
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.remove(
_context,
arg,
{ action: _removeAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
}
}
} catch (error) {
// TODO 错误异常处理
console.log(error);
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("remove", action)) {
remove(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return {
remove: remove,
};
}
/**
* @description 使用新建行功能模块
* @param {GridControlProps} props 传入的props
* @return {*}
* @memberof GridControl
*/
public useNewRow(props: GridControlProps) {
const { viewSubject, controlName } = this.controlState;
const newRow = async (opt: any = {}) => {
try {
const { controlService, context, viewParams, showBusyIndicator, controlAction } = this.controlState;
if (!controlAction.loadDraftAction) {
return;
}
const dataRef = toRef(this.controlState, "data");
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
const arg: any = {...opt};
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.loadDraft(
_context,
arg,
{ action: controlAction.loadDraftAction, isLoading: showBusyIndicator },
);
if (response.status || response.status == 200) {
dataRef.value = [...dataRef.value,[response.data]];
}
} catch (error) {
// TODO 错误异常处理
console.log(error);
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("newRow", action)) {
newRow(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return {
newRow: newRow,
};
}
/**
* @description 使用自定义模块(蚂蚁金服UI自定义)
* @param {GridControlProps} props
* @memberof GridControl
*/
public useCustom(props: GridControlProps) {
const { controlName, selectFirstDefault, rowEditState, rowActiveMode } = this.controlState;
const selectedRowKeysRef = toRef(this.controlState, "selectedRowKeys");
const gridPagingRef = toRef(this.controlState, "gridPaging");
let { current, pageSize } = gridPagingRef.value;
// 滚动条配置
const scrollOption = computed(() => {
return {
scrollToFirstRowOnChange: true,
x: '110%',
y: '690px',
}
});
// 指定表格行key
const rowKey = (record: IParam) => {
return record.srfkey;
}
// 表格行样式
const rowClassName = (record: IParam, index: number) => {
return index % 2 === 1 ? "table-striped" : null;
}
// 表格行自定义
const customRow = (record: IParam, index: number) => {
return {
onClick: () => {
if (!rowEditState) {
selectedRowKeysRef.value = [record.srfkey];
if (!record.children) {
this.emit("ctrlEvent",{ tag: controlName, action: "selectionChange", data: [deepCopy(record)] })
if (Object.is(rowActiveMode, 1)) {
this.emit("ctrlEvent",{ tag: controlName, action: "rowClick", data: [deepCopy(record)] })
}
}
}
},
onDblclick: () => {
if (!record.children && Object.is(rowActiveMode, 2)) {
this.emit("ctrlEvent",{ tag: controlName, action: "rowDbClick", data: [deepCopy(record)] })
}
}
};
}
// 表格选择功能配置
const rowSelectionOption = computed(() => {
if (selectFirstDefault) {
return false;
}
return {
columnWidth: 90,
selectedRowKeys: selectedRowKeysRef.value,
checkStrictly: props.multiple ? false : true,
onChange: (selectedRowKeys: string[], selectedRows: IParam[]) => {
selectedRowKeysRef.value = selectedRowKeys;
const selection: IParam[] = [];
selectedRows.forEach((select: IParam) => {
if (!select.children) {
selection.push(select);
}
})
this.emit("ctrlEvent",{ tag: controlName, action: "selectionChange", data: selection })
},
};
});
// 列拖动
const resizeColumn = (width: number, column: IParam) => {
column.width = width;
}
// 处理表格变化(分页,过滤,排序)
const handleGridChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => {
if (pagination) {
current = pagination.current;
pageSize = pagination.pageSize;
this.useLoad(props).load();
}
}
return {
custom: {
scrollOption,
rowKey,
rowClassName,
customRow,
rowSelectionOption,
resizeColumn,
handleGridChange,
}
}
}
/**
* @description 处理编辑器事件
* @param {IActionParam} actionParam 行为参数
* @memberof GridControl
*/
public handleEditorEvent(rowIndex: number, actionParam: IActionParam) {
const { tag, action, data } = actionParam;
switch (action) {
case "valueChange":
this.gridDataChange(rowIndex, tag, data);
break;
default:
break;
}
}
/**
* @description 处理表格操作列事件
* @param {IActionParam} actionParam 行为参数
* @param {IParam} [row] 表格行数据
* @memberof GridControl
*/
public handleToolbarEvent(actionParam: IActionParam, row?: IParam) {
const { tag, action, data } = actionParam;
console.log('触发界面行为', actionParam, row);
}
/**
* @description 安装部件所有功能模块的方法
* @param {GridControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof GridControl [emit] 事件
*/
public moduleInstall(props: GridControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
const { load } = this.useLoad(props);
const { custom } = this.useCustom(props);
return {
...superParams,
state: this.controlState,
load,
custom,
handleEditorEvent: this.handleEditorEvent.bind(this),
handleToolbarEvent: this.handleToolbarEvent.bind(this),
};
}
}
export * from './util';
export * from './view-util';
export * from './route-tool';
export { Http } from './net/http';
\ No newline at end of file
import { IParam } from "@ibiz-core";
/**
* @description 计算界面行为项权限状态
* @export
* @param {IParam} data 传入数据
* @param {IParam} actionModel 界面行为模型
* @param {*} UIService 界面行为服务
* @return {*}
*/
export function calcActionItemAuthState(data: IParam, actionModel: IParam, UIService: any) {
const result: any[] = [];
if (!UIService) return;
for (const key in actionModel) {
if (!actionModel.hasOwnProperty(key)) {
return result;
}
const item = actionModel[key];
let dataActionResult: any;
if (item && item['dataAccessAction']) {
if (Object.is(item['actionTarget'], 'NONE') || Object.is(item['actionTarget'], '')) {
dataActionResult = UIService.getAllOPPrivs({}, item['dataAccessAction']);
} else {
if (data && Object.keys(data).length > 0) {
dataActionResult = UIService.getAllOPPrivs(data, item['dataAccessAction']);
}
}
} else {
dataActionResult = 1;
}
// 无权限:0;有权限:1
if (dataActionResult === 0) {
// 禁用:1;隐藏:2;隐藏且默认隐藏:6
if (item.getNoPrivDisplayMode === 1) {
item.disabled = true;
}
if (item.getNoPrivDisplayMode === 2 || item.getNoPrivDisplayMode === 6) {
item.visabled = false;
} else {
item.visabled = true;
}
}
if (dataActionResult === 1) {
item.visabled = true;
item.disabled = false;
}
// 返回权限验证的结果
item.dataActionResult = dataActionResult;
result.push(dataActionResult);
}
return result;
}
/**
* @description 计算导航数据
* 先从当前数据目标计算,然后再从当前上下文计算,最后从当前视图参数计算,没有则为null
* @export
* @param {*} data 当前数据目标
* @param {*} parentContext 当前上下文
* @param {*} parentParam 当前视图参数
* @param {*} params 导航参数
* @return {*}
*/
export function computedNavData(data: any, parentContext: any, parentParam: any, params: any): any {
const _data: any = {};
if (params && Object.keys(params).length > 0) {
Object.keys(params).forEach((name: string) => {
if (!name) {
return;
}
let value: string | null = params[name];
if (value && value.toString().startsWith('%') && value.toString().endsWith('%')) {
const key = value.substring(1, value.length - 1).toLowerCase();
if (data && data.hasOwnProperty(key)) {
value = data[key];
} else if (parentContext && parentContext[key]) {
value = parentContext[key];
} else if (parentParam && parentParam[key]) {
value = parentParam[key];
} else {
value = null;
}
}
Object.assign(_data, { [name.toLowerCase()]: value });
});
}
return _data;
}
\ No newline at end of file
import { IApp } from "@core";
declare global {
const App:IApp
}
\ No newline at end of file
<script setup lang="ts">
import { Subject } from 'rxjs'
import { Ref } from 'vue';
import { IndexView, IActionParam, IParam } from '@ibiz-core';
import { IndexView, IActionParam, IParam, IContext } from '@core';
import { ViewConfig } from './{{spinalCase page.codeName}}-config';
{{#page.ctrls}}
{{#eq controlType "APPMENU"}}
......@@ -13,7 +13,7 @@ import {
MenuFoldOutlined
} from '@ant-design/icons-vue';
interface Props {
context: IParam;
context: IContext;
viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>;
......
<script setup lang="ts">
import { Subject } from 'rxjs';
import { EditView, IActionParam, IParam } from '@ibiz-core';
import { EditView, IActionParam, IParam, IContext } from '@core';
import { ViewConfig } from './{{spinalCase page.codeName}}-config';
{{#page.ctrls}}
{{#eq controlType "FORM"}}
......@@ -10,7 +10,7 @@ import { {{codeName}}Form } from '@widgets/{{spinalCase appEntity.codeName}}/{{s
// props声明和默认值处理
interface Props {
context: IParam;
context: IContext;
viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>;
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, handleToolbarEvent } = new EditView(ViewConfig).moduleInstall(props);
const { state, handleToolbarEvent } = new EditView(ViewConfig).moduleInstall(props, emit);
</script>
......
<script setup lang="ts">
import { Subject } from 'rxjs';
import { GridView, IActionParam, IParam } from '@ibiz-core';
import { GridView, IActionParam, IParam, IContext } from '@core';
import { ViewConfig } from './{{spinalCase page.codeName}}-config';
{{#page.ctrls}}
{{#eq controlType "GRID"}}
......@@ -10,7 +10,7 @@ import { {{codeName}}Grid } from '@widgets/{{spinalCase appEntity.codeName}}/{{s
// props声明和默认值处理
interface Props {
context: IParam;
context: IContext;
viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>;
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, handleCtrlEvent } = new GridView(ViewConfig).moduleInstall(props);
const { state, handleCtrlEvent, handleToolbarEvent } = new GridView(ViewConfig).moduleInstall(props, emit);
</script>
......
<script setup lang="ts">
import { Subject } from 'rxjs';
import { PickupGridView, IActionParam, IParam } from '@ibiz-core';
import { PickupGridView, IActionParam, IParam, IContext } from '@core';
import { ViewConfig } from './{{spinalCase page.codeName}}-config';
{{#page.ctrls}}
{{#eq controlType "GRID"}}
......@@ -10,7 +10,7 @@ import { {{codeName}}Grid } from '@widgets/{{spinalCase appEntity.codeName}}/{{s
// props声明和默认值处理
interface Props {
context: IParam;
context: IContext;
viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>;
......@@ -29,7 +29,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state } = new PickupGridView(ViewConfig).moduleInstall(props);
const { state } = new PickupGridView(ViewConfig).moduleInstall(props, emit);
</script>
<template>
......
<script setup lang="ts">
import { Subject } from 'rxjs';
import { PickupView, IActionParam, IParam } from '@ibiz-core';
import { PickupView, IActionParam, IParam, IContext } from '@core';
import { ViewConfig } from './{{spinalCase page.codeName}}-config';
// props声明和默认值处理
interface Props {
context: IParam;
context: IContext;
viewParams?: IParam;
openType?: "ROUTE" | "MODAL" | "EMBED";
viewSubject?: Subject<IActionParam>;
......@@ -24,7 +24,7 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state } = new PickupView(ViewConfig).moduleInstall(props);
const { state } = new PickupView(ViewConfig).moduleInstall(props, emit);
</script>
<template>
......
import { AppModal } from '@/utils';
import { Http, deepCopy, ViewDetail } from '@ibiz-core';
import { OpenViewService } from '@service';
import { AppFuncService } from '@ibiz-core';
export class App {
/**
* 打开视图服务
* @static
*/
public static openViewService: OpenViewService = OpenViewService.getInstance();
/**
* 应用功能服务
* @static
*/
public static appFuncService: AppFuncService = AppFuncService.getInstance();
/**
* 打开视图服务
* @static
*/
public static modalService: AppModal = AppModal.getInstance();
/**
* 所有视图信息
*
* @static
*/
public static allViewInfos: any;
/**
* 获取视图信息
*
* @static
* @param codeName 视图codeName
* @return {*}
*/
public static getViewInfo(codeName: string): ViewDetail | undefined {
return App.allViewInfos[codeName] ? (deepCopy(App.allViewInfos[codeName]) as ViewDetail) : undefined;
}
/**
* 初始化
*
* @static
*/
public static async init() {
const response = await Http.getInstance().get('./assets/json/views.json')
App.allViewInfos = response.data;
}
}
\ No newline at end of file
export * from './open-view/open-view-service';
export * from './app/app';
\ No newline at end of file
import { Http, UIServiceBase } from '@ibiz-core';
/**
* 系统UI服务对象基类
*
* @export
* @class SysUIServiceBase
* @extends {UIServiceBase}
*/
export class SysUIServiceBase extends UIServiceBase {
/**
* Creates an instance of SysUIServiceBase
*
* @param {*} [opts={}]
* @memberof SysUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化界面行为数据
*
* @memberof SysUIServiceBase
*/
protected async initActionMap(): Promise<void> {
// TODO 初始化界面行为需要的配置参数
}
}
\ No newline at end of file
import { SysUIServiceBase } from './calculator-ui-service-base';
/**
* 系统UI服务
*
* @export
* @class SysUIService
* @extends SysUIServiceBase
*/
export class SysUIService extends SysUIServiceBase {
/**
* Creates an instance of SysUIService.
* @memberof SysUIService
*/
constructor(opts?: any) {
super(opts);
}
/**
* 获取实例
*
* @static
* @param 应用上下文
* @return {*} { SysUIService }
* @memberof SysUIService
*/
static getInstance(context?: any): SysUIService {
return new SysUIService({ context: context });
}
}
export default SysUIService;
\ No newline at end of file
......@@ -4,4 +4,4 @@
@use './views';
@use './var';
@use './theme';
@use '../custom/style'
@use './user';
......@@ -2,7 +2,7 @@ import { Subject } from 'rxjs';
import Antd from 'ant-design-vue';
import AppModalComponent from "./app-modal.vue";
import IbizLoading from '@components/render/IbizLoading.vue';
import { IParam, ViewDetail } from '@ibiz-core';
import { IParam, ViewDetail } from '@core';
export class AppModal {
......
<script setup lang="ts">
import { IParam, ViewDetail } from '@ibiz-core';
import { IParam, ViewDetail } from '@core';
import { Subject } from 'rxjs';
import { Ref, ref } from 'vue';
interface AppModalProps {
......
export { AppModal } from './app-modal/app-modal';
export { OpenViewService } from './open-view/open-view-service';
import { IParam, RouteTool, ViewDetail } from '@ibiz-core';
import { App } from '@service';
import { IContext, IOpenViewService, IParam, RouteUtil, ViewDetail } from '@core';
import router from '@/router';
import { AppModal } from '@/utils';
interface Params extends IParam {
context: any;
viewParams: any;
context: IContext;
viewParams: IParam;
}
/**
......@@ -14,7 +13,7 @@ interface Params extends IParam {
* @export
* @class OpenViewService
*/
export class OpenViewService {
export class OpenViewService implements IOpenViewService{
/**
* 唯一实例
*
......@@ -73,7 +72,7 @@ export class OpenViewService {
// 路由打开视图
if (openMode == 'INDEXVIEWTAB' || openMode == 'POPUPAPP') {
// TODO 视图关系参数处理
const routePath = RouteTool.buildUpRoutePath(view, context, viewParams, router.currentRoute.value);
const routePath = RouteUtil.buildUpRoutePath(view, context, viewParams, router.currentRoute.value);
if (openMode == 'INDEXVIEWTAB') {
router.push(routePath);
} else {
......
<script setup lang="ts">
import { Subject } from "rxjs";
import { CtrlConfig } from "./{{spinalCase ctrl.codeName}}-menu-config";
import { IParam, IActionParam, MenuControl, IContext } from "@ibiz-core";
import { IParam, IActionParam, MenuControl, IContext } from "@core";
interface Props{
context: IContext;
defaultView: string;
......
{{>@macro/form-detail/include-form.hbs}}
import { ControlVOBase, verifyRules, EditFormService } from '@ibiz-core';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@service/entity/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
import { ControlVOBase, verifyRules, EditFormService } from '@core';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@api/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
/**
* 部件展示数据对象
......
......@@ -2,7 +2,7 @@
<script setup lang="ts">
import { Subject } from 'rxjs';
import { CtrlConfig } from './{{spinalCase ctrl.codeName}}-form-config';
import { FormControl, IActionParam, IParam, ControlAction, IContext } from '@ibiz-core';
import { FormControl, IActionParam, IParam, ControlAction, IContext } from '@core';
interface Props {
context: IContext;
......@@ -25,7 +25,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(props);
const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(props, emit);
</script>
<template>
......
{{>@macro/grid-detail/include-grid.hbs}}
import { ControlVOBase, IParam, GridService } from '@ibiz-core';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@service/entity/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
import { ControlVOBase, IParam, GridService } from '@core';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@api/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
export class ControlVO extends ControlVOBase {
......
......@@ -2,7 +2,7 @@
<script setup lang="ts">
import { Subject } from 'rxjs';
import { CtrlConfig } from './{{spinalCase ctrl.codeName}}-grid-config';
import { GridControl, IActionParam, IParam, IContext, ControlAction, deepCopy } from '@ibiz-core';
import { GridControl, IActionParam, IParam, IContext, ControlAction, deepCopy } from '@core';
interface Props {
context: IContext;
......
<script setup lang="ts">
import { Subject } from 'rxjs';
import { IActionParam, IParam, ControlAction, PickupViewPanelControl, IContext } from '@ibiz-core';
import { IActionParam, IParam, ControlAction, PickupViewPanelControl, IContext } from '@core';
import { CtrlConfig } from './{{ctrl.codeName.spinalCase}}-pickupviewpanel-config';
interface Props {
......@@ -31,7 +31,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力方法
const { state, inited, viewdata, viewparam } = new PickupViewPanelControl(CtrlConfig).moduleInstall(props);
const { state, inited, viewdata, viewparam } = new PickupViewPanelControl(CtrlConfig).moduleInstall(props, emit);
</script>
......
......@@ -13,10 +13,12 @@
"lib": ["esnext", "dom"],
"baseUrl": ".",
"paths": {
"@ibiz-core":["src/ibiz-core"],
"@ibiz-core/*":["src/ibiz-core/*"],
"@service":["src/service"],
"@service/*":["src/service/*"],
"@core":["src/core"],
"@core/*":["src/core/*"],
"@ui-service":["src/ui-service"],
"@ui-service/*":["src/ui-service/*"],
"@api":["src/api"],
"@api/*":["src/api/*"],
"@components":["src/components"],
"@components/*":["src/components/*"],
"@views":["src/views"],
......
......@@ -11,8 +11,9 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
resolve: {
alias: {
'@ibiz-core': path.resolve(__dirname, 'src/ibiz-core'),
'@service': path.resolve(__dirname, 'src/service'),
'@core': path.resolve(__dirname, 'src/core'),
'@ui-service': path.resolve(__dirname, 'src/ui-service'),
'@api': path.resolve(__dirname, 'src/api'),
'@components': path.resolve(__dirname, 'src/components'),
'@views': path.resolve(__dirname, 'src/views'),
'@page': path.resolve(__dirname, 'src/page'),
......
......@@ -52,7 +52,8 @@ module.exports = {
.set('@interface', resolve('src/interface'))
.set('@locale', resolve('src/locale'))
.set('@mock', resolve('src/mock'))
.set('@service', resolve('src/service'))
.set('@ui-service', resolve('src/ui-service'))
.set('@api', resolve('src/api'))
.set('@codelist', resolve('src/codelist'))
},
configureWebpack: config => {
......
......@@ -2,6 +2,35 @@
# yarn lockfile v1
"@ant-design/colors@^5.0.0":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@ant-design/colors/-/colors-5.1.1.tgz#800b2186b1e27e66432e67d03ed96af3e21d8940"
integrity sha512-Txy4KpHrp3q4XZdfgOBqLl+lkQIc3tEvHXOimRN1giX1AEC7mGtyrO9p8iRGJ3FLuVMGa2gNEzQyghVymLttKQ==
dependencies:
"@ctrl/tinycolor" "^3.3.1"
"@ant-design/colors@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@ant-design/colors/-/colors-6.0.0.tgz#9b9366257cffcc47db42b9d0203bb592c13c0298"
integrity sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==
dependencies:
"@ctrl/tinycolor" "^3.4.0"
"@ant-design/icons-svg@^4.0.0":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.2.1.tgz#8630da8eb4471a4aabdaed7d1ff6a97dcb2cf05a"
integrity sha512-EB0iwlKDGpG93hW8f85CTJTs4SvMX7tt5ceupvhALp1IF44SeUFOMhKUOYqpsoYWQKAOuTRDMqn75rEaKDp0Xw==
"@ant-design/icons-vue@^6.0.0", "@ant-design/icons-vue@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@ant-design/icons-vue/-/icons-vue-6.0.1.tgz#9d804c3c74d2cfaf97cb18e582d3b9400934f5fd"
integrity sha512-HigIgEVV6bbcrz2A92/qDzi/aKWB5EC6b6E1mxMB6aQA7ksiKY+gi4U94TpqyEIIhR23uaDrjufJ+xCZQ+vx6Q==
dependencies:
"@ant-design/colors" "^5.0.0"
"@ant-design/icons-svg" "^4.0.0"
"@types/lodash" "^4.14.165"
lodash "^4.17.15"
"@antfu/utils@^0.3.0":
version "0.3.0"
resolved "https://registry.npmmirror.com/@antfu/utils/download/@antfu/utils-0.3.0.tgz#6306c43b52a883bd8e973e3ed8dd64248418bcc4"
......@@ -19,6 +48,13 @@
resolved "https://registry.npmmirror.com/@babel/parser/download/@babel/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e"
integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==
"@babel/runtime@^7.10.5":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.7.tgz#03ff99f64106588c9c403c6ecb8c3bafbbdff1fa"
integrity sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/types@^7.6.1", "@babel/types@^7.9.6":
version "7.16.0"
resolved "https://registry.npmmirror.com/@babel/types/download/@babel/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba"
......@@ -27,6 +63,11 @@
"@babel/helper-validator-identifier" "^7.15.7"
to-fast-properties "^2.0.0"
"@ctrl/tinycolor@^3.3.1", "@ctrl/tinycolor@^3.4.0":
version "3.4.0"
resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f"
integrity sha512-JZButFdZ1+/xAfpguQHoabIXkcqRRKpMrWKBkpEZZyxfY9C1DpADFB8PEqGSTeFr135SaTRfKqGKx5xSCLI7ZQ==
"@element-plus/icons-vue@^0.2.2":
version "0.2.4"
resolved "https://registry.npmmirror.com/@element-plus/icons-vue/download/@element-plus/icons-vue-0.2.4.tgz#dadcf72f0cea53dc83b7b7db80e1418716d7b02c"
......@@ -85,6 +126,14 @@
estree-walker "^2.0.1"
picomatch "^2.2.2"
"@simonwep/pickr@~1.8.0":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@simonwep/pickr/-/pickr-1.8.2.tgz#96dc86675940d7cad63d69c22083dd1cbb9797cb"
integrity sha512-/l5w8BIkrpP6n1xsetx9MWPWlU6OblN5YgZZphxan0Tq4BByTCETL6lyIeY8lagalS2Nbt4F2W034KHLIiunKA==
dependencies:
core-js "^3.15.1"
nanopop "^2.1.0"
"@stencil/core@^2.10.0":
version "2.12.0"
resolved "https://registry.npmmirror.com/@stencil/core/download/@stencil/core-2.12.0.tgz#5b12517dd367908026692d3b00fa1aab39638ab9"
......@@ -95,6 +144,11 @@
resolved "https://registry.npmmirror.com/@stencil/store/download/@stencil/store-1.5.0.tgz#5c4e14ed078771bb8ed635867cfa8c3452f15ac4"
integrity sha1-XE4U7QeHcbuO1jWGfPqMNFLxWsQ=
"@types/lodash@^4.14.165":
version "4.14.178"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==
"@types/node@*":
version "17.0.0"
resolved "https://registry.npmmirror.com/@types/node/download/@types/node-17.0.0.tgz#62797cee3b8b497f6547503b2312254d4fe3c2bb"
......@@ -105,6 +159,11 @@
resolved "https://registry.npmmirror.com/@types/node/download/@types/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10"
integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==
"@types/qs@^6.9.7":
version "6.9.7"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==
"@types/ramda@^0.27.60":
version "0.27.60"
resolved "https://registry.npmmirror.com/@types/ramda/download/@types/ramda-0.27.60.tgz#fccfd7bb18cc074b7bcddeb7fcc36871723309a6"
......@@ -225,6 +284,11 @@
"@vue/compiler-dom" "3.2.24"
"@vue/shared" "3.2.24"
"@vue/devtools-api@^6.0.0-beta.18":
version "6.0.0-beta.21.1"
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.21.1.tgz#f1410f53c42aa67fa3b01ca7bdba891f69d7bc97"
integrity sha512-FqC4s3pm35qGVeXRGOjTsRzlkJjrBLriDS9YXbflHLsfA9FrcKzIyWnLXoNm+/7930E8rRakXuAc2QkC50swAw==
"@vue/reactivity@3.2.24", "@vue/reactivity@^3.2.20":
version "3.2.24"
resolved "https://registry.npmmirror.com/@vue/reactivity/download/@vue/reactivity-3.2.24.tgz#4b24301ff7af0607c49a1e6976a22b4f62eab1a4"
......@@ -293,6 +357,28 @@ acorn@^7.1.1:
resolved "https://registry.npmmirror.com/acorn/download/acorn-7.4.1.tgz?cache=0&sync_timestamp=1637225522161&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Facorn%2Fdownload%2Facorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=
ant-design-vue@^3.0.0-alpha.14:
version "3.0.0-beta.5"
resolved "https://registry.yarnpkg.com/ant-design-vue/-/ant-design-vue-3.0.0-beta.5.tgz#9994ecedc7ad29600d85e73a754199d948869bb1"
integrity sha512-yX+JGkPlzXav56hHCg0aa1LAB9GQEEQ8Xfy0o7tc49zFH2v0Q8ekiWVXsvsiracLZgl7GcLm5HnEPp9tAy0BZQ==
dependencies:
"@ant-design/colors" "^6.0.0"
"@ant-design/icons-vue" "^6.0.0"
"@babel/runtime" "^7.10.5"
"@simonwep/pickr" "~1.8.0"
array-tree-filter "^2.1.0"
async-validator "^4.0.0"
dayjs "^1.10.5"
dom-align "^1.12.1"
dom-scroll-into-view "^2.0.0"
lodash "^4.17.21"
lodash-es "^4.17.15"
resize-observer-polyfill "^1.5.1"
scroll-into-view-if-needed "^2.2.25"
shallow-equal "^1.0.0"
vue-types "^3.0.0"
warning "^4.0.0"
anymatch@~3.1.2:
version "3.1.2"
resolved "https://registry.npmmirror.com/anymatch/download/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
......@@ -301,6 +387,11 @@ anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"
array-tree-filter@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-tree-filter/-/array-tree-filter-2.1.0.tgz#873ac00fec83749f255ac8dd083814b4f6329190"
integrity sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==
asap@~2.0.3:
version "2.0.6"
resolved "https://registry.npmmirror.com/asap/download/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
......@@ -311,10 +402,17 @@ assert-never@^1.2.1:
resolved "https://registry.npmmirror.com/assert-never/download/assert-never-1.2.1.tgz#11f0e363bf146205fb08193b5c7b90f4d1cf44fe"
integrity sha1-EfDjY78UYgX7CBk7XHuQ9NHPRP4=
async-validator@^4.0.7:
async-validator@^4.0.0, async-validator@^4.0.7:
version "4.0.7"
resolved "https://registry.npmmirror.com/async-validator/download/async-validator-4.0.7.tgz?cache=0&sync_timestamp=1634530102628&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fasync-validator%2Fdownload%2Fasync-validator-4.0.7.tgz#034a0fd2103a6b2ebf010da75183bec299247afe"
integrity sha1-A0oP0hA6ay6/AQ2nUYO+wpkkev4=
resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-4.0.7.tgz#034a0fd2103a6b2ebf010da75183bec299247afe"
integrity sha512-Pj2IR7u8hmUEDOwB++su6baaRi+QvsgajuFB9j95foM1N2gy5HM4z60hfusIO0fBPG5uLAEl6yCJr1jNSVugEQ==
axios@^0.24.0:
version "0.24.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==
dependencies:
follow-redirects "^1.14.4"
babel-walk@3.0.0-canary-5:
version "3.0.0-canary-5"
......@@ -355,10 +453,10 @@ builtins@^4.0.0:
dependencies:
semver "^7.0.0"
call-bind@^1.0.2:
call-bind@^1.0.0, call-bind@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/call-bind/download/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
integrity sha1-sdTonmiBGcPJqQOtMKuy9qkZvjw=
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
dependencies:
function-bind "^1.1.1"
get-intrinsic "^1.0.2"
......@@ -385,6 +483,11 @@ character-parser@^2.2.0:
optionalDependencies:
fsevents "~2.3.2"
compute-scroll-into-view@^1.0.17:
version "1.0.17"
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.17.tgz#6a88f18acd9d42e9cf4baa6bec7e0522607ab7ab"
integrity sha512-j4dx+Fb0URmzbwwMUrhqWM2BEWHdFGx+qZ9qqASHRPqvTYdqvWnHg0H1hIbcyLnvgnoNAVMlwkepyqM3DaIFUg==
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.npmmirror.com/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
......@@ -398,15 +501,20 @@ constantinople@^4.0.1:
"@babel/parser" "^7.6.0"
"@babel/types" "^7.6.1"
core-js@^3.15.1:
version "3.20.2"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.20.2.tgz#46468d8601eafc8b266bd2dd6bf9dee622779581"
integrity sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw==
csstype@^2.6.8:
version "2.6.19"
resolved "https://registry.npmmirror.com/csstype/download/csstype-2.6.19.tgz?cache=0&sync_timestamp=1637224567041&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcsstype%2Fdownload%2Fcsstype-2.6.19.tgz#feeb5aae89020bb389e1f63669a5ed490e391caa"
integrity sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==
dayjs@^1.10.7:
dayjs@^1.10.5, dayjs@^1.10.7:
version "1.10.7"
resolved "https://registry.npmmirror.com/dayjs/download/dayjs-1.10.7.tgz?cache=0&sync_timestamp=1632753723926&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fdayjs%2Fdownload%2Fdayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
integrity sha1-LPX5Gt0oEWdIRAhmoKHSbzps5Gg=
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==
debug@^4.3.2:
version "4.3.3"
......@@ -420,6 +528,16 @@ doctypes@^1.1.0:
resolved "https://registry.npmmirror.com/doctypes/download/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9"
integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=
dom-align@^1.12.1:
version "1.12.2"
resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.12.2.tgz#0f8164ebd0c9c21b0c790310493cd855892acd4b"
integrity sha512-pHuazgqrsTFrGU2WLDdXxCFabkdQDx72ddkraZNih1KsMcN5qsRSTR9O4VJRlwTPCPb5COYg3LOfiMHHcPInHg==
dom-scroll-into-view@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/dom-scroll-into-view/-/dom-scroll-into-view-2.0.1.tgz#0decc8522801fd8d3f1c6ba355a74d382c5f989b"
integrity sha512-bvVTQe1lfaUr1oFzZX80ce9KLDlZ3iU+XGNE/bz9HnGdklTieqsbmsLHe+rT2XWqopvL0PckkYqN7ksmm5pe3w==
dom-serializer@^1.0.1:
version "1.3.2"
resolved "https://registry.npmmirror.com/dom-serializer/download/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91"
......@@ -625,6 +743,11 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"
follow-redirects@^1.14.4:
version "1.14.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.6.tgz#8cfb281bbc035b3c067d6cd975b0f6ade6e855cd"
integrity sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==
font-awesome@^4.7.0:
version "4.7.0"
resolved "https://registry.npmmirror.com/font-awesome/download/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133"
......@@ -736,6 +859,11 @@ is-number@^7.0.0:
resolved "https://registry.npmmirror.com/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=
is-plain-object@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b"
integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==
is-promise@^2.0.0:
version "2.2.2"
resolved "https://registry.npmmirror.com/is-promise/download/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1"
......@@ -754,6 +882,11 @@ js-stringify@^1.0.2:
resolved "https://registry.npmmirror.com/js-stringify/download/js-stringify-1.0.2.tgz#1736fddfd9724f28a3682adc6230ae7e4e9679db"
integrity sha1-Fzb939lyTyijaCrcYjCufk6Weds=
"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
jsonc-parser@^2.3.0:
version "2.3.1"
resolved "https://registry.npmmirror.com/jsonc-parser/download/jsonc-parser-2.3.1.tgz#59549150b133f2efacca48fe9ce1ec0659af2342"
......@@ -779,10 +912,22 @@ local-pkg@^0.4.0:
dependencies:
mlly "^0.2.2"
lodash@^4.17.21:
lodash-es@^4.17.15:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
lodash@^4.17.15, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash/download/lodash-4.17.21.tgz?cache=0&sync_timestamp=1632742926913&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Flodash%2Fdownload%2Flodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw=
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
loose-envify@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
lru-cache@^6.0.0:
version "6.0.0"
......@@ -840,6 +985,11 @@ nanoid@^3.1.30:
resolved "https://registry.npmmirror.com/nanoid/download/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
integrity sha1-Y/k8xUjSoRPcXfvGO/oJ4rm2Q2I=
nanopop@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/nanopop/-/nanopop-2.1.0.tgz#23476513cee2405888afd2e8a4b54066b70b9e60"
integrity sha512-jGTwpFRexSH+fxappnGQtN9dspgE2ipa1aOjtR24igG0pv6JCxImIAmrLRHX+zUF5+1wtsFVbKyfP51kIGAVNw==
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/normalize-path/download/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
......@@ -855,6 +1005,11 @@ object-assign@^4.1.1:
resolved "https://registry.npmmirror.com/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
object-inspect@^1.9.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0"
integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==
path-parse@^1.0.6:
version "1.0.7"
resolved "https://registry.npmmirror.com/path-parse/download/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
......@@ -989,6 +1144,13 @@ pug@^3.0.2:
pug-runtime "^3.0.1"
pug-strip-comments "^2.0.0"
qs@^6.10.2:
version "6.10.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.2.tgz#c1431bea37fc5b24c5bdbafa20f16bdf2a4b9ffe"
integrity sha512-mSIdjzqznWgfd4pMii7sHtaYF8rx8861hBO80SraY5GT0XQibWZWJSid0avzHGkDIZLImux2S5mXO0Hfct2QCw==
dependencies:
side-channel "^1.0.4"
queue-microtask@^1.2.2:
version "1.2.3"
resolved "https://registry.npmmirror.com/queue-microtask/download/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
......@@ -1015,11 +1177,21 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
regenerator-runtime@^0.13.4:
version "0.13.9"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==
request-light@^0.5.4:
version "0.5.5"
resolved "https://registry.npmmirror.com/request-light/download/request-light-0.5.5.tgz#254ab0b38a1db2192170b599b05181934e14932b"
integrity sha512-AvjfJuhyT6dYfhtIBF+IpTPQco+Td1QJ6PsIJ5xui110vQ5p9HxHk+m1XJqXazLQT6CxxSx9eNv6R/+fu4bZig==
resize-observer-polyfill@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
resolve@^1.15.1, resolve@^1.20.0:
version "1.20.0"
resolved "https://registry.npmmirror.com/resolve/download/resolve-1.20.0.tgz?cache=0&sync_timestamp=1632753712607&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fresolve%2Fdownload%2Fresolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
......@@ -1063,6 +1235,13 @@ sass@^1.45.0:
immutable "^4.0.0"
source-map-js ">=0.6.2 <2.0.0"
scroll-into-view-if-needed@^2.2.25:
version "2.2.28"
resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.28.tgz#5a15b2f58a52642c88c8eca584644e01703d645a"
integrity sha512-8LuxJSuFVc92+0AdNv4QOxRL4Abeo1DgLnGNkn1XlaujPH/3cCFz3QI60r2VNu4obJJROzgnIUw5TKQkZvZI1w==
dependencies:
compute-scroll-into-view "^1.0.17"
semver@^7.0.0, semver@^7.3.5:
version "7.3.5"
resolved "https://registry.npmmirror.com/semver/download/semver-7.3.5.tgz?cache=0&sync_timestamp=1632753717890&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fsemver%2Fdownload%2Fsemver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
......@@ -1070,6 +1249,20 @@ semver@^7.0.0, semver@^7.3.5:
dependencies:
lru-cache "^6.0.0"
shallow-equal@^1.0.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da"
integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==
side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
dependencies:
call-bind "^1.0.0"
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1:
version "1.0.1"
resolved "https://registry.npmmirror.com/source-map-js/download/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf"
......@@ -1316,6 +1509,13 @@ vue-global-api@^0.4.1:
eslint-config-vue-global-api "0.4.1"
vue-demi latest
vue-router@^4.0.12:
version "4.0.12"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.12.tgz#8dc792cddf5bb1abcc3908f9064136de7e13c460"
integrity sha512-CPXvfqe+mZLB1kBWssssTiWg4EQERyqJZes7USiqfW9B5N2x+nHlnsM1D3b5CaJ6qgCvMmYJnz+G0iWjNCvXrg==
dependencies:
"@vue/devtools-api" "^6.0.0-beta.18"
vue-tsc@^0.28.10:
version "0.28.10"
resolved "https://registry.npmmirror.com/vue-tsc/download/vue-tsc-0.28.10.tgz#2fc0154537bef5004e86002b117758af4b2b066c"
......@@ -1324,6 +1524,13 @@ vue-tsc@^0.28.10:
"@volar/shared" "0.28.10"
vscode-vue-languageservice "0.28.10"
vue-types@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/vue-types/-/vue-types-3.0.2.tgz#ec16e05d412c038262fc1efa4ceb9647e7fb601d"
integrity sha512-IwUC0Aq2zwaXqy74h4WCvFCUtoV0iSWr0snWnE9TnU18S66GAQyqQbRf2qfJtUuiFsBf6qp0MEwdonlwznlcrw==
dependencies:
is-plain-object "3.0.1"
vue@^3.2.23:
version "3.2.24"
resolved "https://registry.npmmirror.com/vue/download/vue-3.2.24.tgz#6de7b01e55740dc37c0a5dbd45e70eed49f95189"
......@@ -1335,6 +1542,13 @@ vue@^3.2.23:
"@vue/server-renderer" "3.2.24"
"@vue/shared" "3.2.24"
warning@^4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
dependencies:
loose-envify "^1.0.0"
webpack-virtual-modules@^0.4.3:
version "0.4.3"
resolved "https://registry.npmmirror.com/webpack-virtual-modules/download/webpack-virtual-modules-0.4.3.tgz#cd597c6d51d5a5ecb473eea1983a58fa8a17ded9"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册