Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@byzanteam/slp-fields
Advanced tools
- `npm i @byzanteam/slp-fields` ## 需要引入的样式文件 ```JS import '@byzanteam/slp-fields/index.css' ```
npm i @byzanteam/slp-fields
import '@byzanteam/slp-fields/index.css'
import { Fields } from '@byzanteam/slp-fields'
<Fields
ref="fields"
:fields="data.fields"
:entries="entries"
/>
// ref 为了使用组件内方法
// fields 传递需要渲染的表单表项
// entries 传入缓存值 or 自定义的值
fields:[
{
id: 10181,
title: '姓名',
description:
'测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试',
type: 'Field::TextField',
position: 0,
validations: ['presence'],
other_option: null,
visibility: 'public_visibility',
marked: false,
settings: {
layout: 'block',
char_size_limit_settings: {},
other_option_settings: { limit: {} },
length_limit: {},
limit_settings: {},
enable_wechat_scan: false,
},
detail_id: null,
identity_key: 'flow_username',
data: {},
},
...
]
entries:[
{
field_id: 10741,
value: '成都短发',
},
...
]
Vue.set(field, 'customClass', ['disabled'])
const value = this.$refs.fields.getValue()
value {
valid: Boolean,
entries: Array
}
USERID,URL,Authorization
字段
USERID,URL,Authorization
附件需要发送的空间信息cacheUrl,cacheAuthorization
可选字段,附件来源空间信息accept,count,size
用于控制附件的格式,数量,大小 {
id: 10785,
title: '文件上传',
description:
'测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试',
type: 'Field::File',
position: 4,
validations: [],
other_option: null,
visibility: 'public_visibility',
marked: false,
settings: {
layout: 'block',
other_option_settings: { limit: {} },
length_limit: {},
limit_settings: {},
char_size_limit_settings: {},
},
detail_id: null,
identity_key: 'file',
data: {},
USERID: 1,
URL: 'https://beta.skylarkly.com',
Authorization:
'b01110629541b3eb51697db5a05dd2388aed11a58c81a75e9c08347bc30a09e6:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjF9.wj9V0ZVOOzSPuRYztizJL_5w0u8aJKb05Z73tEV_HuY',
},
async requestForm() {
const { data } = await this.api.getRequestForm(FORM_ID)
this.fields = common.processAttachmentField(data.fields)
},
// 处理附件字段
processAttachmentField(fields) {
fields.forEach((field) => {
if (field.type === 'Field::File') {
field.USERID = basis.USERID
field.URL = basis.Url
field.Authorization = basis.Authorization
}
})
},
submit() {
const valueObj = this.$refs.fields.getValue()
if (valueObj.valid) {
// 提交表单数据
common.postSubmitForm(valueObj.entries, FORM_ID)
} else {
this.$toast.fail('必填值未输入')
}
},
// 提交数据
async postSubmitForm(entries, FORM_ID) {
const formData = {
user_id: 26071,
response: {
entries_attributes: entries,
},
}
const data = await api.postSubmitForm(FORM_ID, formData)
if (data.status === 201) {
Toast.success('填写成功!')
location.reload()
}
},
FAQs
- `npm i @byzanteam/slp-fields` ## 需要引入的样式文件 ```JS import '@byzanteam/slp-fields/index.css' ```
The npm package @byzanteam/slp-fields receives a total of 6 weekly downloads. As such, @byzanteam/slp-fields popularity was classified as not popular.
We found that @byzanteam/slp-fields demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.