Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/ide bugs #777

Merged
merged 6 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/components/u-checkboxes.vue/__tests__/fixes/ide.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

/**
* 以下测试用例根据 docs/*.md 自动生成,请勿修改和提交!!!
*/
import Vue from 'vue';
import { mount } from '@vue/test-utils';
import Checkboxs from '../../index.vue';

test('should call listener', () => {
Vue.prototype.$env.VUE_APP_DESIGNER = true;
const wrapper = mount(Checkboxs, {
propsData: {
value: '{{varaibles1}}',
},
});
expect(Array.isArray(wrapper.vm.$data.currentValue)).toBe(true);
expect(wrapper.vm.$data.currentValue.length).toBe(0);
Vue.prototype.$env.VUE_APP_DESIGNER = false;
});
5 changes: 5 additions & 0 deletions src/components/u-checkboxes.vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ export default {
},
methods: {
watchValue(value) {
// 修复bug ide环境 传进来 {{ variable1 }} 处理成 []
if (this.$env.VUE_APP_DESIGNER) {
value = [];
}

if (value) {
if (this.converter) value = this.currentConverter.set(value);
this.currentValue = value;
Expand Down
14 changes: 7 additions & 7 deletions src/components/u-date-picker.vue/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ namespace nasl.ui {
})
yearAdd: nasl.core.Decimal = 20;

@Prop({
group: '主要属性',
title: '高级格式化',
bindHide: true,
})
advancedFormat: { enable: nasl.core.Boolean, value: nasl.core.String } = { enable: false, value: '' };

@Prop<UDatePickerOptions, 'showFormatter'>({
group: '主要属性',
title: '日期展示格式',
Expand All @@ -124,13 +131,6 @@ namespace nasl.ui {
})
showFormatter: 'YYYY年M月D日' | 'YYYY-MM-DD' | 'M/D/YYYY' | 'D/M/YYYY' | 'GGGG-W周' | 'GGGG年第W周' | 'GGGG-WWWW' | 'YYYY年M月' | 'YYYY-MM' | 'M/YYYY' | 'YYYY年第Q季度' | 'YYYY年QQ' | 'YYYY-QQ' | 'YYYY年' | 'YYYY';

@Prop({
group: '主要属性',
title: '高级格式化',
bindHide: true,
})
advancedFormat: { enable: nasl.core.Boolean, value: nasl.core.String } = { enable: false, value: '' };

@Prop({
group: '主要属性',
title: '自动获取焦点',
Expand Down
20 changes: 10 additions & 10 deletions src/components/u-date-picker.vue/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@
tooltipLink: ""
dependency:
- '!range': true
- name: advanced-format
title: 高级格式化
type: "{ enable: boolean, value: string }"
default: "{ enable: false, value: '' }"
description: ""
group: 主要属性
brifeDoc: ""
docDescription: ""
tooltipLink: ""
bindHide: true
- name: show-formatter
title: 日期展示格式
type: string
Expand Down Expand Up @@ -180,16 +190,6 @@
brifeDoc: ""
docDescription: ""
tooltipLink: ""
- name: advanced-format
title: 高级格式化
type: "{ enable: boolean, value: string }"
default: "{ enable: false, value: '' }"
description: ""
group: 主要属性
brifeDoc: ""
docDescription: ""
tooltipLink: ""
bindHide: true
- name: autofocus
title: 自动获取焦点
type: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/components/u-input.vue/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace nasl.ui {
@Prop({
group: '状态属性',
title: '显示状态',
description: '显示状态分为“True(显示)/False(隐藏)”,默认为“显示”',
description: '显示状态分为“True(显示)/False(隐藏)”,默认为“隐藏”',
docDescription: '切换密码的显示/隐藏。',
setter: {
concept: 'SwitchSetter',
Expand Down
2 changes: 1 addition & 1 deletion src/components/u-input.vue/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
title: 显示状态
type: boolean
default: false
description: 显示状态分为“True(显示)/False(隐藏)”,默认为“显示
description: 显示状态分为“True(显示)/False(隐藏)”,默认为“隐藏
group: 状态属性
brifeDoc: ""
docDescription: 切换密码的显示/隐藏。
Expand Down
20 changes: 20 additions & 0 deletions src/components/u-uploader.vue/__tests__/fixes/ide.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

/**
* 以下测试用例根据 docs/*.md 自动生成,请勿修改和提交!!!
*/
import Vue from 'vue';
import { mount } from '@vue/test-utils';
import Uploader from '../../index.vue';

test('should call listener', () => {
Vue.prototype.$env.VUE_APP_DESIGNER = true;
const wrapper = mount(Uploader, {
propsData: {
value: '{{varaibles}}',
converter: 'simple',
},
});
expect(Array.isArray(wrapper.vm.$data.currentValue)).toBe(true);
expect(wrapper.vm.$data.currentValue.length).toBe(0);
Vue.prototype.$env.VUE_APP_DESIGNER = false;
});
5 changes: 5 additions & 0 deletions src/components/u-uploader.vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ export default {
return encodeURI(url);
},
fromValue(value) {
// Vue app 环境走 [];
if (this.$env.VUE_APP_DESIGNER) {
return [];
}

if (this.converter === 'json')
try {
const parsedValue = JSON.parse(value || '[]');
Expand Down
5 changes: 3 additions & 2 deletions src/components/u-validator.vue/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ namespace nasl.ui {
})
validatingProcess: Function;

// 产品要求去掉
@Prop({
group: '主要属性',
title: '表单项名称',
title: '表单项名称。已废弃',
})
name: nasl.core.String;
private name: nasl.core.String;

@Prop({
group: '主要属性',
Expand Down
2 changes: 2 additions & 0 deletions src/components/u-validator.vue/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
brifeDoc: ""
docDescription: ""
tooltipLink: ""
advanced: true
deprecated: true
- name: label
title: 标签
type: string
Expand Down