提交 f8060f7d 编写于 作者: zhangpingchuan's avatar zhangpingchuan

Merge branch 'master' into vue2-sy-ui

...@@ -7,4 +7,5 @@ casLoginUrl:CAS_LOGIN_URL ...@@ -7,4 +7,5 @@ casLoginUrl:CAS_LOGIN_URL
previewFileUrl:PREVIEW_FILE_URL previewFileUrl:PREVIEW_FILE_URL
loginViewName:LOGIN_VIEW_NAME loginViewName:LOGIN_VIEW_NAME
favicon:FAVICON favicon:FAVICON
logLevel:LOGLEVEL logLevel:LOGLEVEL
\ No newline at end of file enableSM3:ENABLE_SM3
\ No newline at end of file
{ {
"name": "vite-project", "name": "vite-project",
"private": true, "private": true,
"version": "0.0.8", "version": "0.0.12",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
"dependencies": { "dependencies": {
"@floating-ui/dom": "^1.5.3", "@floating-ui/dom": "^1.5.3",
"@ibiz-template/command": "0.0.1-beta.50", "@ibiz-template/command": "0.0.1-beta.50",
"@ibiz-template/controller": "0.0.1-beta.159", "@ibiz-template/controller": "0.0.1-beta.163",
"@ibiz-template/core": "0.0.1-beta.159", "@ibiz-template/core": "0.0.1-beta.163",
"@ibiz-template/model": "0.0.1-beta.159", "@ibiz-template/model": "0.0.1-beta.160",
"@ibiz-template/runtime": "0.0.1-beta.159", "@ibiz-template/runtime": "0.0.1-beta.163",
"@ibiz-template/service": "0.0.1-beta.159", "@ibiz-template/service": "0.0.1-beta.163",
"@ibiz-template/theme": "0.0.1-beta.158", "@ibiz-template/theme": "0.0.1-beta.163",
"@ibiz-template/vue-util": "0.0.1-beta.159", "@ibiz-template/vue-util": "0.0.1-beta.163",
"@ibiz/dynamic-model-api": "^2.1.28", "@ibiz/dynamic-model-api": "^2.1.28",
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
"vite-plugin-style-import": "1.4.1", "vite-plugin-style-import": "1.4.1",
"vue": "^2.7.15", "vue": "^2.7.15",
"vue-router": "^3.6.5", "vue-router": "^3.6.5",
"vue-text-format": "^3.1.2" "vue-text-format": "^3.1.2",
"xss": "^1.0.15"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.3.0", "@commitlint/cli": "^17.3.0",
......
此差异已折叠。
...@@ -22,4 +22,6 @@ window.Environment = { ...@@ -22,4 +22,6 @@ window.Environment = {
favicon: './favicon.ico', favicon: './favicon.ico',
// 当前版本 // 当前版本
version: '0.0.1', version: '0.0.1',
// 启用sm3加密
enableSM3: true,
}; };
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
useNamespace, useNamespace,
} from '@ibiz-template/vue-util'; } from '@ibiz-template/vue-util';
import '@ibiz-template/theme/style/components/editor/ibiz-input/ibiz-input.scss'; import '@ibiz-template/theme/style/components/editor/ibiz-input/ibiz-input.scss';
import xss from 'xss';
const fomatFloat = function (value: number, n: number) { const fomatFloat = function (value: number, n: number) {
const f = value; const f = value;
...@@ -74,6 +75,19 @@ export const IBizInput = defineComponent({ ...@@ -74,6 +75,19 @@ export const IBizInput = defineComponent({
} }
const currentVal = ref<string>(''); const currentVal = ref<string>('');
const getInputValue = (value: string | number) => {
if (type.value === 'number' || !ibiz.config.enableXSS) {
return value;
}
const result = xss(value as string);
if (result !== value) {
currentVal.value = result;
inputRef.value?.setCurrentValue?.(result);
ibiz.message.warning('输入值存在不规范格式,已自动调整!');
}
return result;
};
watch( watch(
() => props.value, () => props.value,
(newVal, oldVal) => { (newVal, oldVal) => {
...@@ -96,7 +110,7 @@ export const IBizInput = defineComponent({ ...@@ -96,7 +110,7 @@ export const IBizInput = defineComponent({
(e: IData) => { (e: IData) => {
// 拦截掉blur触发后change // 拦截掉blur触发后change
if (blurCacheValue !== e.target.value) { if (blurCacheValue !== e.target.value) {
emit('change', e.target.value); emit('change', getInputValue(e.target.value));
} }
blurCacheValue = undefined; blurCacheValue = undefined;
isDebounce = false; isDebounce = false;
...@@ -156,7 +170,7 @@ export const IBizInput = defineComponent({ ...@@ -156,7 +170,7 @@ export const IBizInput = defineComponent({
inputRef.value?.setCurrentValue?.(number); inputRef.value?.setCurrentValue?.(number);
emit('change', number); emit('change', number);
} else { } else {
emit('change', blurCacheValue); emit('change', getInputValue(blurCacheValue as string));
} }
}; };
......
...@@ -74,10 +74,11 @@ export default defineComponent({ ...@@ -74,10 +74,11 @@ export default defineComponent({
try { try {
loading.value = true; loading.value = true;
clearCookie(CoreConst.TOKEN, true); clearCookie(CoreConst.TOKEN, true);
const res = await ibiz.auth.v7login( let password = loginData.password;
loginData.username, if ((ibiz.env as IData).enableSM3) {
loginData.password, password = ibiz.util.text.sm3(password).toUpperCase();
); }
const res = await ibiz.auth.v7login(loginData.username, password);
if (res.ok) { if (res.ok) {
const { data } = res; const { data } = res;
if (data && data.token) { if (data && data.token) {
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
@include e(route-content) { @include e(route-content) {
height: calc(100% - 39px); height: calc(100% - 39px);
background-color: getCssVar(view-layout-route-bg-color);
> .#{bem('view-layout')} { > .#{bem('view-layout')} {
.#{bem('view-layout-header')} { .#{bem('view-layout-header')} {
position: absolute; position: absolute;
...@@ -61,6 +62,18 @@ ...@@ -61,6 +62,18 @@
} }
} }
} }
> .#{bem(exp-view)} {
display: flex;
padding: getCssVar(padding) 0;
.#{bem(exp-view-right)} {
> .#{bem('view-layout')} {
.#{bem('view-layout-header')} {
width: auto;
margin-right: getCssVar(margin);
}
}
}
}
} }
} }
} }
@include b(form-item-container-inputtip) {
width: 13px;
height: 13px;
margin-right: 4px;
font-size: 13px;
vertical-align: text-top;
cursor: pointer;
}
\ No newline at end of file
import { useNamespace } from '@ibiz-template/vue-util'; import { useNamespace } from '@ibiz-template/vue-util';
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import '@ibiz-template/theme/style/components/widgets/form/form-item-container.scss'; import '@ibiz-template/theme/style/components/widgets/form/form-item-container.scss';
import './form-item-container.scss';
export default defineComponent({ export default defineComponent({
props: { props: {
...@@ -22,6 +23,9 @@ export default defineComponent({ ...@@ -22,6 +23,9 @@ export default defineComponent({
type: Number, type: Number,
required: true, required: true,
}, },
inputTip: {
type: String,
},
}, },
setup(props) { setup(props) {
const ns = useNamespace('form-item-container'); const ns = useNamespace('form-item-container');
...@@ -47,15 +51,37 @@ export default defineComponent({ ...@@ -47,15 +51,37 @@ export default defineComponent({
> >
<div class={[this.ns.b('content')]}> <div class={[this.ns.b('content')]}>
{this.labelPos === 'LEFT' || this.labelPos === 'TOP' ? ( {this.labelPos === 'LEFT' || this.labelPos === 'TOP' ? (
<div class={[this.ns.e('label')]} title={this.label}> <div class={[this.ns.e('label')]}>
{this.label} {this.inputTip && (
<i-tooltip
content={this.inputTip}
transfer-class-name={this.ns.b('input-tip-popper')}
class={[this.ns.b('inputtip')]}
>
<i-icon type='ios-help-circle-outline' />
</i-tooltip>
)}
<span class={[this.ns.em('label', 'text')]} title={this.label}>
{this.label}
</span>
</div> </div>
) : null} ) : null}
<div class={[this.ns.e('editor')]}>{this.$slots.default}</div> <div class={[this.ns.e('editor')]}>{this.$slots.default}</div>
{this.labelPos === 'RIGHT' || this.labelPos === 'BOTTOM' ? ( {this.labelPos === 'RIGHT' || this.labelPos === 'BOTTOM' ? (
<div class={[this.ns.e('label')]} title={this.label}> <div class={[this.ns.e('label')]}>
{this.label} {this.inputTip && (
<i-tooltip
content={this.inputTip}
class={[this.ns.b('inputtip')]}
transfer-class-name={this.ns.b('input-tip-popper')}
>
<i-icon type='ios-help-circle-outline' />
</i-tooltip>
)}
<span class={[this.ns.em('label', 'text')]} title={this.label}>
{this.label}
</span>
</div> </div>
) : null} ) : null}
</div> </div>
......
...@@ -57,6 +57,7 @@ export const FormItem = defineComponent({ ...@@ -57,6 +57,7 @@ export const FormItem = defineComponent({
class={[this.ns.b(), this.ns.m(this.modelData.modelClass)]} class={[this.ns.b(), this.ns.m(this.modelData.modelClass)]}
required={this.c.required} required={this.c.required}
error={this.c.error} error={this.c.error}
input-tip={this.controller.editor?.editorParams?.inputTip}
label={this.modelData.source.caption} label={this.modelData.source.caption}
label-pos={this.c.model.labelPos} label-pos={this.c.model.labelPos}
label-width={this.c.model.labelWidth} label-width={this.c.model.labelWidth}
......
...@@ -266,6 +266,7 @@ export const GridControl = defineComponent({ ...@@ -266,6 +266,7 @@ export const GridControl = defineComponent({
on-on-selection-change={this.onSelectionChange} on-on-selection-change={this.onSelectionChange}
on-on-sort-change={this.onSortChange} on-on-sort-change={this.onSortChange}
row-class-name={(row: IData) => (row.hiddenRow ? 'hidden-row' : '')} row-class-name={(row: IData) => (row.hiddenRow ? 'hidden-row' : '')}
span-method={this.c.spanMethod.bind(this.c)}
scopedSlots={columnSlots} scopedSlots={columnSlots}
></i-table> ></i-table>
{this.c.model.source.enablePagingBar && ( {this.c.model.source.enablePagingBar && (
......
...@@ -48,6 +48,32 @@ async function loadAppPlugins(): Promise<void> { ...@@ -48,6 +48,32 @@ async function loadAppPlugins(): Promise<void> {
} }
} }
/**
* 初始化应用配置参数
*
* @export
* @param {IData} userParam
* @return {*} {Promise<void>}
*/
export async function initConfig(userParam: IData): Promise<void> {
if (userParam) {
Object.keys(userParam).forEach(key => {
const value = ibiz.util.rawValue.format(userParam[key]);
const keys = key.split('.');
let currentObj = ibiz.config as IData;
for (let i = 0; i < keys.length; i++) {
const k = keys[i];
if (i === keys.length - 1) {
currentObj[k] = value;
} else {
currentObj[k] = currentObj[k] || {};
currentObj = currentObj[k];
}
}
});
}
}
/** /**
* 初始化模型 * 初始化模型
* *
...@@ -60,6 +86,8 @@ async function loadModel(): Promise<void> { ...@@ -60,6 +86,8 @@ async function loadModel(): Promise<void> {
const url = `${ibiz.env.remoteModelUrl}${modelPath}`; const url = `${ibiz.env.remoteModelUrl}${modelPath}`;
const res = await ibiz.net.get(url); const res = await ibiz.net.get(url);
if (res.ok) { if (res.ok) {
const userParam = res.data.getUserParam || {};
await initConfig(userParam);
return res.data as IModel; return res.data as IModel;
} }
return {}; return {};
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册