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

Merge branch 'master' into vue2-sy-ui

......@@ -7,4 +7,5 @@ casLoginUrl:CAS_LOGIN_URL
previewFileUrl:PREVIEW_FILE_URL
loginViewName:LOGIN_VIEW_NAME
favicon:FAVICON
logLevel:LOGLEVEL
\ No newline at end of file
logLevel:LOGLEVEL
enableSM3:ENABLE_SM3
\ No newline at end of file
{
"name": "vite-project",
"private": true,
"version": "0.0.8",
"version": "0.0.12",
"type": "module",
"scripts": {
"dev": "vite",
......@@ -13,13 +13,13 @@
"dependencies": {
"@floating-ui/dom": "^1.5.3",
"@ibiz-template/command": "0.0.1-beta.50",
"@ibiz-template/controller": "0.0.1-beta.159",
"@ibiz-template/core": "0.0.1-beta.159",
"@ibiz-template/model": "0.0.1-beta.159",
"@ibiz-template/runtime": "0.0.1-beta.159",
"@ibiz-template/service": "0.0.1-beta.159",
"@ibiz-template/theme": "0.0.1-beta.158",
"@ibiz-template/vue-util": "0.0.1-beta.159",
"@ibiz-template/controller": "0.0.1-beta.163",
"@ibiz-template/core": "0.0.1-beta.163",
"@ibiz-template/model": "0.0.1-beta.160",
"@ibiz-template/runtime": "0.0.1-beta.163",
"@ibiz-template/service": "0.0.1-beta.163",
"@ibiz-template/theme": "0.0.1-beta.163",
"@ibiz-template/vue-util": "0.0.1-beta.163",
"@ibiz/dynamic-model-api": "^2.1.28",
"@riophae/vue-treeselect": "^0.4.0",
"dayjs": "^1.11.10",
......@@ -35,7 +35,8 @@
"vite-plugin-style-import": "1.4.1",
"vue": "^2.7.15",
"vue-router": "^3.6.5",
"vue-text-format": "^3.1.2"
"vue-text-format": "^3.1.2",
"xss": "^1.0.15"
},
"devDependencies": {
"@commitlint/cli": "^17.3.0",
......
此差异已折叠。
......@@ -22,4 +22,6 @@ window.Environment = {
favicon: './favicon.ico',
// 当前版本
version: '0.0.1',
// 启用sm3加密
enableSM3: true,
};
......@@ -6,6 +6,7 @@ import {
useNamespace,
} from '@ibiz-template/vue-util';
import '@ibiz-template/theme/style/components/editor/ibiz-input/ibiz-input.scss';
import xss from 'xss';
const fomatFloat = function (value: number, n: number) {
const f = value;
......@@ -74,6 +75,19 @@ export const IBizInput = defineComponent({
}
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(
() => props.value,
(newVal, oldVal) => {
......@@ -96,7 +110,7 @@ export const IBizInput = defineComponent({
(e: IData) => {
// 拦截掉blur触发后change
if (blurCacheValue !== e.target.value) {
emit('change', e.target.value);
emit('change', getInputValue(e.target.value));
}
blurCacheValue = undefined;
isDebounce = false;
......@@ -156,7 +170,7 @@ export const IBizInput = defineComponent({
inputRef.value?.setCurrentValue?.(number);
emit('change', number);
} else {
emit('change', blurCacheValue);
emit('change', getInputValue(blurCacheValue as string));
}
};
......
......@@ -74,10 +74,11 @@ export default defineComponent({
try {
loading.value = true;
clearCookie(CoreConst.TOKEN, true);
const res = await ibiz.auth.v7login(
loginData.username,
loginData.password,
);
let password = loginData.password;
if ((ibiz.env as IData).enableSM3) {
password = ibiz.util.text.sm3(password).toUpperCase();
}
const res = await ibiz.auth.v7login(loginData.username, password);
if (res.ok) {
const { data } = res;
if (data && data.token) {
......
......@@ -47,6 +47,7 @@
@include e(route-content) {
height: calc(100% - 39px);
background-color: getCssVar(view-layout-route-bg-color);
> .#{bem('view-layout')} {
.#{bem('view-layout-header')} {
position: absolute;
......@@ -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 { computed, defineComponent } from 'vue';
import '@ibiz-template/theme/style/components/widgets/form/form-item-container.scss';
import './form-item-container.scss';
export default defineComponent({
props: {
......@@ -22,6 +23,9 @@ export default defineComponent({
type: Number,
required: true,
},
inputTip: {
type: String,
},
},
setup(props) {
const ns = useNamespace('form-item-container');
......@@ -47,15 +51,37 @@ export default defineComponent({
>
<div class={[this.ns.b('content')]}>
{this.labelPos === 'LEFT' || this.labelPos === 'TOP' ? (
<div class={[this.ns.e('label')]} title={this.label}>
{this.label}
<div class={[this.ns.e('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>
) : null}
<div class={[this.ns.e('editor')]}>{this.$slots.default}</div>
{this.labelPos === 'RIGHT' || this.labelPos === 'BOTTOM' ? (
<div class={[this.ns.e('label')]} title={this.label}>
{this.label}
<div class={[this.ns.e('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>
) : null}
</div>
......
......@@ -57,6 +57,7 @@ export const FormItem = defineComponent({
class={[this.ns.b(), this.ns.m(this.modelData.modelClass)]}
required={this.c.required}
error={this.c.error}
input-tip={this.controller.editor?.editorParams?.inputTip}
label={this.modelData.source.caption}
label-pos={this.c.model.labelPos}
label-width={this.c.model.labelWidth}
......
......@@ -266,6 +266,7 @@ export const GridControl = defineComponent({
on-on-selection-change={this.onSelectionChange}
on-on-sort-change={this.onSortChange}
row-class-name={(row: IData) => (row.hiddenRow ? 'hidden-row' : '')}
span-method={this.c.spanMethod.bind(this.c)}
scopedSlots={columnSlots}
></i-table>
{this.c.model.source.enablePagingBar && (
......
......@@ -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> {
const url = `${ibiz.env.remoteModelUrl}${modelPath}`;
const res = await ibiz.net.get(url);
if (res.ok) {
const userParam = res.data.getUserParam || {};
await initConfig(userParam);
return res.data as IModel;
}
return {};
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册