提交 2b481d5a 编写于 作者: WodahsOrez's avatar WodahsOrez

update:样式

上级 38fe9861
......@@ -46,32 +46,5 @@ const extraClass = {
</template>
<style lang="scss" scoped>
// 基线对齐
.ibiz-icon-text__icon,.ibiz-icon-text__icon-img{
vertical-align: bottom;
}
// 默认大小
.ibiz-icon-text--default{
font-size: 16px;
.ibiz-icon-text__icon,.ibiz-icon-text__icon-img{
width: 16px;
height: 16px;
}
}
.ibiz-icon-text--large{
font-size: 24px;
.ibiz-icon-text__icon,.ibiz-icon-text__icon-img{
width: 24px;
height: 24px;
}
}
// 位置
.ibiz-icon-text--left .ibiz-icon-text__text{
margin-left: 5px;
}
.ibiz-icon-text--right .ibiz-icon-text__text{
margin-right: 5px;
}
</style>
\ No newline at end of file
......@@ -115,7 +115,7 @@ export class FormControl extends MainControl {
}
/**
* @description 使用保存功能模块
* @description 使用加载功能模块
* @param {FormControlProps} props 传入的props
* @return {*}
* @memberof FormControl
......@@ -169,62 +169,6 @@ export class FormControl extends MainControl {
}
};
/**
* @description 使用删除功能模块
* @param {FormControlProps} props 传入的props
* @return {*}
* @memberof FormControl
*/
public useRemove(props: FormControlProps) {
const { viewSubject, controlName } = this.controlState;
/**
* 删除行为
*
* @param [opt={}]
* @return {*}
*/
const save = async (opt: any = {}) => {
try {
// 获取需要的状态变量
const { controlService, context, viewParams, showBusyIndicator, data } = this.controlState;
// TODO 值规则校验处理
// 判断实体行为存在
const { updateAction, createAction } = this.controlState.controlAction;
const saveAction: any = data.srfuf == '1' ? updateAction : createAction;
if (!saveAction) {
return;
}
// 处理请求参数
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
// TODO 关系界面保存通知处理,做成异步。
// TODO 拷贝相关。
// 发起请求处理与解析请求
const response = await controlService.get(saveAction, _context, { viewParams: _viewParams }, showBusyIndicator);
if (!response.status || response.status !== 200) {
// TODO 统一Error格式
return;
}
// 请求后处理
this.controlState.data = response.data;
// TODO 表单onFormLoad
} catch (error) {
// TODO 错误异常处理
}
};
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
......
......@@ -18,6 +18,7 @@ export class ControlServiceBase {
* @param [opts={}]
*/
public handleResponse(response: any, opts: any = {}) {
// todo srfuf判断
return response;
}
}
import { hasValue } from '@ibiz-core';
import { isExist } from '@ibiz-core';
import axios from 'axios';
import qs from 'qs';
import { Subject } from 'rxjs';
......@@ -258,7 +258,7 @@ export class Http {
if (params && (Object.keys(params).length > 0)) {
let tempParam: any = {};
Object.keys(params).forEach((item: string) => {
if (item.startsWith('srf') && hasValue(params[item])) {
if (item.startsWith('srf') && isExist(params[item])) {
tempParam[item] = params[item];
}
});
......
......@@ -16,10 +16,20 @@ export function deepCopy(data: Record<any, any>): Record<any, any>{
* @param {*} arg
* @return {*} {boolean}
*/
export function hasValue(arg: any): boolean{
export function isExist(arg: any): boolean{
return arg !== undefined && arg !== null && arg === arg;
}
/**
* @description 是否拥有某个方法
* @param {*} arg 校验对象
* @param fnName 方法名
* @return {*}
*/
export function hasFunction(arg: any, fnName: string): boolean{
return arg[fnName] && arg[fnName] instanceof Function;
}
/**
* @description 获取当前数据值类型
* @export
......@@ -245,4 +255,4 @@ function contains(value: any, value2: any): boolean {
return reg.test(S + arr.join(S) + S);
}
return false;
}
\ No newline at end of file
}
import 'font-awesome/css/font-awesome.min.css'
import '@/style/index.scss'
import Router from '@/router';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import '@/style/index.scss'
import App from './App.vue'
createApp(App).use(Router).use(Antd).mount('#app')
// 基础通用样式,重置网站基础样式。
html,body{
width: 100%;
height: 100%;
}
body{
margin: 0;
}
// 滚动条样式
\ No newline at end of file
// 基线对齐
.ibiz-icon-text__icon,.ibiz-icon-text__icon-img{
vertical-align: bottom;
}
// 默认样式
.ibiz-icon-text--default{
font-size: var(--ibiz-icon-text-font-size-md);
.ibiz-icon-text__icon,.ibiz-icon-text__icon-img{
width: var(--ibiz-icon-text-icon-width-md);
height: var(--ibiz-icon-text-icon-height-md);
}
}
// large的样式
.ibiz-icon-text--large{
font-size: var(--ibiz-icon-text-font-size-lg);
.ibiz-icon-text__icon,.ibiz-icon-text__icon-img{
width: var(--ibiz-icon-text-icon-width-lg);
height: var(--ibiz-icon-text-icon-height-lg);
}
}
// 位置变化的样式
.ibiz-icon-text--left .ibiz-icon-text__text{
margin-left: 5px;
}
.ibiz-icon-text--right .ibiz-icon-text__text{
margin-right: 5px;
}
\ No newline at end of file
// 通用样式
html,body{
height: 100%;
}
body{
margin: 0;
}
// 视图样式
.ibiz-view__caption{
font-weight: 600;
}
\ No newline at end of file
@use './base';
@use './components';
@use './widgets';
@use './views';
@use './var';
@use './theme';
@use '../custom/style'
// 清除浮动
@mixin clearfix {
&::before,
&::after {
display: table;
content: '';
}
&::after {
clear: both;
}
}
// Placeholder文本颜色修改,兼容各种浏览器
@mixin placeholder($color: var(--ibiz-text-color-placeholder)) {
// Firefox
&::-moz-placeholder {
color: $color;
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
}
// Internet Explorer 10+
&:-ms-input-placeholder {
color: $color;
}
// Safari and Chrome
&::-webkit-input-placeholder {
color: $color;
}
&:placeholder-shown {
text-overflow: ellipsis;
}
}
\ No newline at end of file
// 主题样式覆盖
.ibiz-theme-dark:root{
}
\ No newline at end of file
// 基础通用变量
:root{
// 字体
--ibiz-font-family: -apple-system, BlinkMacSystemFont, Tahoma, Arial, "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
--ibiz-font-weight-primary: 500;
--ibiz-font-weight-bold: 600;
--ibiz-font-line-height: 24px;
// 字体大小
--ibiz-font-size-xs: 12px;
--ibiz-font-size-sm: 14px;
--ibiz-font-size-md: 16px;
--ibiz-font-size-lg: 20px;
--ibiz-font-size-xl: 22px;
// 字体颜色
--ibiz-text-color-primary: #303133;
--ibiz-text-color-regular: #606266;
--ibiz-text-color-secondary: #909399;
--ibiz-text-color-placeholder: #c0c4cc;
--ibiz-text-color-disabled: #bbb;
--ibiz-text-color-inverse: #fff; // 反转色,深色背景下使用
// 颜色
--ibiz-color-white: #fff;
--ibiz-color-black: #000;
--ibiz-color-primary: #409eff; //重要的,常用于激活色
--ibiz-color-success: #67c23a;
--ibiz-color-warning: #e6a23c;
--ibiz-color-danger: #f56c6c;
--ibiz-color-error: #f56c6c;
--ibiz-color-info: #909399;
--ibiz-bg-color: #f5f7fa; //默认背景色
--ibiz-bg-color-disabled: #f5f7fa; //禁用背景色
// 边框
--ibiz-border-color: #dcdfe6;
--ibiz-border-width: 1;
--ibiz-border-style: solid;
--ibiz-border-color-hover: #c0c4cc;
--ibiz-border-color-disabled: #e4e7ed;
--ibiz-border-base: var(--ibiz-border-width-base) var(--ibiz-border-style-base)
var(--ibiz-border-color-base);
}
// render 绘制组件样式
// icon-text
.ibiz-icon-text{
--ibiz-icon-text-font-size-md: var(--ibiz-font-size-md);
--ibiz-icon-text-icon-width-md: var(--ibiz-font-size-md);
--ibiz-icon-text-icon-height-md: var(--ibiz-font-size-md);
--ibiz-icon-text-font-size-lg: var(--ibiz-font-size-lg);
--ibiz-icon-text-icon-width-lg: var(--ibiz-font-size-lg);
--ibiz-icon-text-icon-height-lg: var(--ibiz-font-size-lg);
}
@use './base' ;
@use './component' ;
@use './widget' ;
@use './view' ;
\ No newline at end of file
// EditForm
:root{
--ibiz-form-font-size: var(--ibiz-font-size-base, 12px);
}
\ No newline at end of file
.ibiz-view-container {
height: 100%;
width: 100%;
}
\ No newline at end of file
import { ControlServiceBase } from '@ibiz-core';
import { ControlServiceBase, hasFunction } from '@ibiz-core';
import { createUUID } from 'qx-util';
import { {{pascalCase ctrl.psAppDataEntity.codeName}}Service } from '@service/{{spinalCase ctrl.psAppDataEntity.codeName}}/{{spinalCase ctrl.psAppDataEntity.codeName}}-service';
import { ControlVO } from './{{lowerCase ctrl.codeName}}-form-config';
......@@ -9,6 +10,24 @@ export class ControlService extends ControlServiceBase {
*/
public entityService: {{pascalCase ctrl.psAppDataEntity.codeName}}Service = new {{pascalCase ctrl.psAppDataEntity.codeName}}Service();
/**
* 加载草稿数据
*
* @param [context={}] 上下文参数
* @param [data={}] 视图参数
* @param opts
* @return {*}
*/
public async loadDraft(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
// todo主键
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'GetDraft';
const response = await this.entityService[opts.action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
* 加载数据
*
......@@ -19,16 +38,59 @@ export class ControlService extends ControlServiceBase {
*/
public async get(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
let response: any;
const _entityService: any = this.entityService;
if (_entityService[opts.action] && _entityService[opts.action] instanceof Function) {
response = await _entityService[opts.action](Context, Data, opts.isLoading);
} else {
response = await this.entityService.Get(Context, Data, opts.isLoading);
}
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'GET';
const response = await this.entityService[opts.action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
* 创建数据
*
* @param [context={}] 上下文参数
* @param [data={}] 视图参数
* @param opts
* @return {*}
*/
public async create(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'Create';
const response = await this.entityService[opts.action](Context, Data, opts.isLoading);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
* 删除数据
*
* @param [context={}] 上下文参数
* @param [data={}] 视图参数
* @param opts
* @return {*}
*/
public async delete(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'Remove';
const response = await this.entityService[opts.action](Context, Data, opts.isLoading);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
}
/**
* 更新数据
*
* @param [context={}] 上下文参数
* @param [data={}] 视图参数
* @param opts
* @return {*}
*/
public async update(context: any, data: any, opts: { action: string; isLoading?: boolean }): Promise<any> {
const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(this.entityService, opts.action) ? opts.action : 'Update';
const response = await this.entityService[opts.action](Context, Data, opts.isLoading);
response.data = new ControlVO(response.data);
return this.handleResponse(response, opts);
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册