Commit 159fc919 authored by jiaxu.yan's avatar jiaxu.yan

feat: 定制检验计划

parent 55e109ee
# 告诉EditorConfig插件,这是根文件,不用继续往上查找
root = true
# 匹配全部文件
[*]
# 设置字符集
charset = utf-8
# 缩进风格,可选space、tab
indent_style = space
# 缩进的空格数
indent_size = 2
# 结尾换行符,可选lf、cr、crlf
end_of_line = lf
# 在文件结尾插入新行
insert_final_newline = true
# 删除一行中的前后空格
trim_trailing_whitespace = true
# 匹配md结尾的文件
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
# 页面标题
VUE_APP_TITLE = 标准应用数据库
# 开发环境配置
ENV = 'development'
# 中汽研安全检测平台管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 图片服务器地址
# VUE_APP_IMAGE_API ='http://106.3.99.64:22013'
VUE_APP_IMAGE_API ='https://10.12.48.78'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi'
# 页面标题
VUE_APP_TITLE = 标准应用数据库
# 生产环境配置
ENV = 'production'
# 中汽研安全检测平台管理系统/生产环境
VUE_APP_BASE_API = '/prod-api'
# 图片服务器地址
VUE_APP_IMAGE_API ='https://10.12.48.78'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi'
# 页面标题
VUE_APP_TITLE = 标准应用数据库
# 开发环境配置
ENV = 'staging'
# 中汽研安全检测平台管理系统/开发环境
VUE_APP_BASE_API = 'http://106.3.99.64:22016'
# 图片服务器地址
VUE_APP_IMAGE_API ='http://106.3.99.64:22013'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi'
# 忽略build目录下类型为js的文件的语法检查
build/*.js
# 忽略src/assets目录下文件的语法检查
src/assets
# 忽略public目录下文件的语法检查
public/*
# 忽略当前目录下为js的文件的语法检查
*.js
# 忽略当前目录下为vue的文件的语法检查
# *.vue
node_modules/*
src/api/monitor
src/views/tool/*
src/utils
src/components
src/layout/*
src/views/system/role/index.vue
packages/*
// ESlint 检查配置
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended',
'plugin:prettier/recommended'],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"prettier/prettier": ["error", {"endOfLine" : "auto"}],
"vue/no-mutating-props": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
"vue/no-v-for-template-key": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-unused-labels': ['error'],
// 'no-labels': [2, {
// 'allowLoop': false,
// 'allowSwitch': false
// }],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
"vue/no-unused-vars": 0,
"no-unused-vars": 0,
// 'no-unused-vars': [2, {
// 'vars': 'all',
// 'args': 'none'
// }],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
// 'space-before-function-paren': [2, 'always'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
}
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
.history
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
*.history
package-lock.json
yarn.lock
dist/*
node_modules/*
packages/*
public/*
\ No newline at end of file
module.exports = {
// 超过80就换行
printWidth: 80,
// tab缩进大小,默认为2
tabWidth: 2,
// 使用tab缩进,默认false
useTabs: false,
// 使用分号,默认true
semi: false,
// 使用单引号, 默认false,(在jsx中配置无效, 默认都是双引号)
singleQuote: true,
// 行尾逗号,默认none,可选(none|es5|all),es5 包括es5中的数组、对象,all 包括函数对象等所有可选
trailingComma: 'none',
// 对象中的空格 默认true,true: { foo: bar },false: {foo: bar}
bracketSpacing: true,
// JSX标签闭合位置 默认false
jsxBracketSameLine: false,
// 箭头函数参数括号 默认avoid 可选(avoid|always),avoid 能省略括号的时候就省略 例如x => x ,always 总是有括号
arrowParens: 'avoid',
// 不使用prettier格式化的文件填写在项目的.prettierignore文件中
ignorePath: '.prettierignore',
// 在jsx中把'>' 是否单独放一行
jsxBracketSameLine: false
}
dist/*
node_modules/*
packages/*
public/*
*.js
*.jpg
*.png
*.eot
*.ttf
*.woff
*.json
......@@ -9,7 +9,7 @@
"lint": "eslint src/**/* --ext .js,.vue",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"dev": "vue-cli-service serve",
"dev": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"preview": "node build/index.js --preview",
"lint:stage": "lint-staged",
"spellcheck": "cspell lint --dot --gitignore --color --cache --show-suggestions \"src/**/*.@(html|js|cjs|mjs|ts|tsx|css|scss|md|vue)\"",
......
import request from '@/utils/request'
// 获取路由
export const getObjectList = () => {
return request({
url: '/Object/Data/getList',
method: 'post'
})
}
\ No newline at end of file
......@@ -395,3 +395,39 @@ aside {
.el-tabs__item {
font-size: 16px;
}
.test-scenario-container {
display: flex;
flex-wrap: wrap;
.test-scenario {
width: 228px;
height: 32px;
border: 1px solid #dcdfe6;
background-color: #ffffff;
margin: 0 10px 10px 0;
border-radius: 30px;
div {
text-align: center;
position: relative;
}
}
.check-test-scenario {
width: 228px;
height: 32px;
border: 1px solid #1a6fd7;
background-color: #e3eefc;
margin: 0 10px 10px 0;
border-radius: 30px;
div {
color: #1a6fd7;
text-align: center;
position: relative;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
}
}
\ No newline at end of file
<template>
<div>
<div v-for="(i, k) in items.options" class="checkbox-item" :key="k">
<el-checkbox
:disabled="status"
v-model="value"
:value="i.check"
@change="input"
label=""
>
</el-checkbox>
<el-input
v-bind="items"
placeholder="请输入"
:disabled="!list[k].check"
style="width: 10rem; margin: 0 10px"
v-model="list[k].value"
@input="input"
>
</el-input>
<div style="width: 20rem; display: inline-block; vertical-align: middle">
{{ i.object }}
</div>
</div>
</div>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: '',
list: []
}
},
created() {
this.value = this.defaultValue
this.reset()
},
watch: {
defaultValue(newVal) {
// this.list = newVal
},
status(newVal) {
this.reset()
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
methods: {
input(val) {
let arr = []
this.list.map(i => {
if (i.check) {
arr.push(i.useCaseNo)
}
})
console.log(arr)
this.$emit('changeVal', { name: this.prop, val: arr })
},
reset() {
this.list = []
this.items.options.map(i => {
this.list.push({
value: '',
check: false,
useCaseNo: i.useCaseNo,
key: i.value
})
})
}
}
}
</script>
<style lang="scss" scoped>
.checkbox-item {
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 10px;
}
</style>
<template>
<div class="checkbox-input-box">
<div>
<div v-for="(i, k) in items.options" class="checkbox-item" :key="k">
<el-checkbox
:disabled="status"
v-model="list[k].check"
:value="i.id"
@change="input"
label=""
>
</el-checkbox>
<el-input
v-bind="items"
placeholder="请输入"
:disabled="!list[k].check"
style="width: 10rem; margin: 0 10px"
v-model="list[k].value"
@input="input"
>
</el-input>
<div
style="width: 20rem; display: inline-block; vertical-align: middle"
>
{{ i.object }}
</div>
</div>
</div>
<el-upload
class="upload-demo"
:action="uploadImgUrl"
:on-preview="handlePreview"
v-model="file"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
:on-success="handleSuccess"
:on-exceed="handleExceed"
>
<el-button size="small" :disabled="status" type="primary"
>上传文件</el-button
>
<div slot="tip" class="el-upload__tip"></div>
</el-upload>
</div>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: '',
list: [],
file: '',
path: '',
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
}
},
created() {
this.value = this.defaultValue
this.reset()
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.reset()
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
methods: {
input(val) {
let arr = []
this.list.map(i => {
if (i.check) {
arr.push(i.useCaseNo)
}
})
console.log(arr)
this.$emit('changeVal', { name: this.prop, val: this.list })
},
reset() {
this.list = []
this.items.options.map(i => {
this.list.push({
value: '',
check: false,
useCaseNo: i.useCaseNo,
key: i.value
})
})
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleSuccess(res, file) {
if (res === 200) {
console.log(res)
this.$message.success('上传成功')
} else {
this.$message.error('error')
console.log(res, file)
}
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`)
}
}
}
</script>
<style lang="scss" scoped>
.checkbox-item {
// display: flex;
// align-items: center;
// justify-content: flex-start;
margin-bottom: 10px;
}
.checkbox-input-box {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<template>
<el-checkbox-group v-model="value" :disabled="status" @change="input">
<el-checkbox v-for="(i, k) in items.options" :label="i.id" :key="k">
{{ i.object }}
</el-checkbox>
</el-checkbox-group>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: []
}
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.value = []
this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: []})
}
},
mounted() {
// this.value = this.defaultValue
},
methods: {
input(val) {
let arr = []
this.items.options.map(i => {
if (this.value.includes(i.id)) {
arr.push(i.useCaseNo)
}
})
console.log(arr)
this.$emit('changeVal', { name: this.prop, val: arr })
this.$emit('makeRecord', { name: this.prop, record: this.value })
},
reset() {
this.value = ''
},
setDefaultValue(val) {
this.value = val
}
}
}
</script>
<template>
<div class="checkbox-upload">
<el-checkbox-group :disabled="status" v-model="model.value" @change="input">
<el-checkbox
v-for="(i, k) in items.options"
:label="i.object"
:value="i.useCaseNo"
:key="k"
>
</el-checkbox>
</el-checkbox-group>
<el-upload
class="upload-demo"
:action="uploadImgUrl"
:on-preview="handlePreview"
v-model="model.file"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
:on-success="handleSuccess"
:on-exceed="handleExceed"
>
<el-button size="small" :disabled="status" type="primary"
>上传文件</el-button
>
<div slot="tip" class="el-upload__tip"></div>
</el-upload>
</div>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
model: {
value: [],
file: '',
path: ''
},
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
}
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.reset()
this.$emit('changeVal', { name: this.prop, val: [] })
this.$emit('makeRecord', { name: this.prop, record: {} })
}
},
mounted() {
this.reset()
},
methods: {
input() {
let arr = []
this.item.options.map(i => {
if (this.model.value.includes(i.id)) {
arr.push(i.useCaseNo)
}
})
console.log(arr)
this.$emit('changeVal', {
name: this.prop,
val: arr
})
this.$emit('makeRecord', { name: this.prop, record: this.model })
},
reset() {
this.model = {
value: [],
file: '',
path: ''
}
},
setDefaultValue(val) {
this.value = val
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleSuccess(res, file) {
if (res === 200) {
this.model.path = res.url
this.$message.success('上传成功')
} else {
this.$message.error('error')
console.log(res, file)
}
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`)
}
}
}
</script>
<style lang="scss" scoped>
.checkbox-upload {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
import Vue from 'vue'
import radio from './radio.vue'
import radioUpload from './radioUpload.vue'
import checkbox from './checkbox.vue'
import checkboxUpload from './checkboxUpload.vue'
import input from './input.vue'
import checkInput from './checkInput.vue'
import radioInput from './radioInput.vue'
import inputUpload from './inputUpload.vue'
import checkInputUpload from './checkInputUpload.vue'
Vue.component('FormRadio', radio)
Vue.component('FormRadioUpload', radioUpload)
Vue.component('FormCheckboxUpload', checkboxUpload)
Vue.component('FormCheckInputUpload', checkInputUpload)
Vue.component('FormInputUpload', inputUpload)
Vue.component('FormInput', input)
Vue.component('FormCheckbox', checkbox)
Vue.component('FormCheckInput', checkInput)
Vue.component('FormRadioCheck', radioInput)
<template>
<el-input
:disabled="status"
v-bind="items"
v-model="value"
style="width: 100%"
placeholder="请输入"
@input="input"
/>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: ''
}
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.value = ''
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
mounted() {
this.value = this.defaultValue
},
methods: {
input(val) {
let arr = []
if (val) {
this.items.options.map(i => {
arr.push(i.useCaseNo)
})
}
this.$emit('changeVal', { name: this.prop, val: arr })
},
reset() {
this.value = ''
},
setDefaultValue(val) {
this.value = val
}
}
}
</script>
<template>
<div class="input-upload">
<el-input
v-bind="items"
:disabled="status"
v-model="value"
style="width: 50%"
placeholder="请输入"
@input="input"
/>
<el-upload
class="upload-demo"
:action="uploadImgUrl"
:on-preview="handlePreview"
v-model="file"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
:on-success="handleSuccess"
:on-exceed="handleExceed"
>
<el-button size="small" :disabled="status" type="primary"
>上传文件</el-button
>
<div slot="tip" class="el-upload__tip"></div>
</el-upload>
</div>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: '',
file: '',
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
}
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.value = ''
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
mounted() {
this.value = this.defaultValue
},
methods: {
input(val) {
let arr = []
if (val) {
this.items.options.map(i => {
arr.push(i.useCaseNo)
})
}
this.$emit('changeVal', { name: this.prop, val: arr })
},
reset() {
this.value = ''
},
setDefaultValue(val) {
this.value = val
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleSuccess(res, file) {
if (res === 200) {
this.$message.success('上传成功')
} else {
this.$message.error('error')
console.log(res, file)
}
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`)
}
}
}
</script>
<style>
.input-upload {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<template>
<el-radio-group :disabled="status" v-model="value" @change="input">
<el-radio v-for="(i, k) in items.options" :label="i.id" :key="k"
>{{ i.object }}
</el-radio>
</el-radio-group>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: ''
}
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.value = ''
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
mounted() {
this.value = this.defaultValue
},
methods: {
input(val) {
let arr = []
this.items.options.map(i => {
if (i.id == this.value) {
arr.push(i.useCaseNo)
}
})
console.log(arr)
this.$emit('changeVal', { name: this.prop, val: arr })
},
reset() {
this.value = ''
},
setDefaultValue(val) {
this.value = val
}
}
}
</script>
<template>
<div>
<el-radio-group :disabled="status" v-model="value" @change="input">
<div v-for="(i, k) in items.options" class="checkbox-item" :key="k">
<el-radio @change="input" :label="i.id">
<div class="checkbox-radio">
<el-input
v-model="list[k].value"
placeholder="请输入"
:disabled="value !== i.value"
style="width: 50%; margin: 0 10px"
@input="input"
>
</el-input>
<div style="flex: 1">
{{ i.object }}
</div>
</div>
</el-radio>
</div>
</el-radio-group>
</div>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: '',
list: []
}
},
created() {
this.list = []
this.reset()
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.reset()
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
methods: {
input(val) {
let arr = []
if (val) {
this.list.options.map(i => {
if (i.key == this.value) {
arr.push(i.useCaseNo)
}
})
}
this.$emit('changeVal', { name: this.prop, val: arr })
},
reset() {
this.items.options.map(i => {
this.list.push({
value: '',
useCaseNo:i.useCaseNo,
key: i.id
})
})
}
}
}
</script>
<style lang="scss" scoped>
.checkbox-item {
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 10px;
width: 100%;
}
.checkbox-radio {
display: flex;
align-items: center;
justify-content: flex-start;
}
::v-deep {
.el-radio {
display: flex;
align-items: center;
}
.el-radio-group {
width: 100%;
}
}
</style>
<template>
<div class="checkbox-upload">
<el-radio-group :disabled="status" v-model="value" @change="input">
<el-radio v-for="(i, k) in items.options" :label="i.id" :key="k"
>{{ i.object }}
</el-radio>
</el-radio-group>
<el-upload
class="upload-demo"
:action="uploadImgUrl"
:on-preview="handlePreview"
v-model="file"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:show-file-list="false"
:limit="1"
:on-success="handleSuccess"
:on-exceed="handleExceed"
>
<el-button size="small" :disabled="status" type="primary"
>上传文件</el-button
>
<div slot="tip" class="el-upload__tip"></div>
</el-upload>
</div>
</template>
<script>
export default {
props: {
items: {
type: Object,
default: () => {}
},
prop: {
type: String,
default: ''
},
status: {
type: Boolean,
default: false
},
defaultValue: {
type: [String, Number],
default: ''
}
},
data() {
return {
value: '',
file: '',
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio' // 上传的图片服务器地址
}
},
watch: {
defaultValue(newVal) {
this.value = newVal
},
status(newVal) {
this.reset()
this.$emit('changeVal', { name: this.prop, val: [] })
}
},
mounted() {
this.value = this.defaultValue
},
methods: {
input(val) {
let arr = []
this.items.options.map(i => {
if (i.id == this.value) {
arr.push(i.useCaseNo)
}
})
this.$emit('changeVal', { name: this.prop, val: arr })
},
reset() {
this.value = ''
},
setDefaultValue(val) {
this.value = val
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleSuccess(res, file) {
if (res === 200) {
this.$message.success('上传成功')
} else {
this.$message.error('error')
console.log(res, file)
}
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`)
}
}
}
</script>
<style lang="scss" scoped>
.checkbox-upload {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<template>
<el-form ref="queryForm" :model="form" class="formClass">
<el-row :gutter="30">
<el-col v-for="(item, index) in schemas" :key="index" :span="12">
<div class="check-card">
<div class="check-item">
<div class="check-item-name">
{{ item.describe }}
</div>
<div class="check-item-check">
<el-checkbox
@change="handleCilck(item.key)"
v-model="item.status"
>
不适用
</el-checkbox>
</div>
</div>
<div class="check-body">
<el-form-item
:prop="item.key"
style="width: 100%"
:rules="[
{
required: !item.status,
message: `${item.describe}不能为空`,
trigger: ['blur']
}
]"
>
<component
:is="item.type"
:status="item.status"
:prop="item.key"
:items="item.componentProps"
:defaultValue="form[item.prop]"
@changeVal="changeVal"
@makeRecord="makeRecord"
ref="formItem"
></component>
</el-form-item>
</div>
</div>
</el-col>
</el-row>
</el-form>
</template>
<script>
import '@/components/CheckCoiumns'
import { isFunction } from 'lodash'
export default {
name: 'FormBuilder',
props: {
schemas: {
type: Array,
default: () => []
},
value: {
type: Object,
default: () => {}
}
},
data() {
return {
form: {},
record: []
}
},
computed: {
formSchemas() {
const schemas = this.schemas.map(item => {
const { componentProps } = item
if (typeof componentProps === 'object') {
return item
} else {
if (isFunction(componentProps)) {
const res = componentProps({
fromSchemas: this.schemas,
fromValue: this.value
})
console.log('componentProps', res)
item.componentProps = res
return item
}
}
return {
...item
}
})
console.log('schemas', schemas)
return schemas
}
},
mǒunted() {
this.$nextTick(() => {
this.from = this.value
})
},
methods: {
handleCilck(key) {
this.$refs.queryForm.clearValidate(key)
},
changeVal(data) {
const { name, val } = data
this.form[name] = val
this.$refs.queryForm.clearValidate(name)
this.$emit('input', this.form)
},
makeRecord(data) {
const { name, record } = data
if (this.record[name]) {
this.record[name] = {
defaultValue: ''
}
}
this.record[name].defaultValue = record
},
getValidate() {
this.$refs.queryForm.validate(res => {
if (res) {
return true
} else {
console.log(3333)
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.check-card {
min-height: 11rem;
}
.check-item {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
background-color: rgba(240, 247, 255, 1);
position: relative;
padding: 5px 25px;
&-name {
color: rgb(64, 158, 255);
font-size: 14px;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&::before {
content: '';
display: inline-block;
width: 4px;
height: 14px;
background-color: rgb(64, 158, 255);
margin-right: 10px;
}
}
&-check {
// flex: 1;
}
}
.check-body {
padding: 10px 20px;
}
::v-deep {
.el-form-item {
margin-bottom: 0;
}
}
</style>
......@@ -9,7 +9,7 @@
<div class="container">
<img :src="logoImg" />
</div>
<h3 class="title">汽车信息安全周期性检测平台</h3>
<h3 class="title">标准应用数据库</h3>
<el-form-item prop="username">
<el-input
v-model.trim="loginForm.username"
......
This diff is collapsed.
......@@ -1326,42 +1326,7 @@ export default {
cursor: move;
}
.test-scenario-container {
display: flex;
flex-wrap: wrap;
.test-scenario {
width: 228px;
height: 32px;
border: 1px solid #dcdfe6;
background-color: #ffffff;
margin: 0 10px 10px 0;
border-radius: 30px;
div {
text-align: center;
position: relative;
}
}
.check-test-scenario {
width: 228px;
height: 32px;
border: 1px solid #1a6fd7;
background-color: #e3eefc;
margin: 0 10px 10px 0;
border-radius: 30px;
div {
color: #1a6fd7;
text-align: center;
position: relative;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
}
}
.actions-container {
display: flex;
......
......@@ -38,8 +38,8 @@ module.exports = {
// target: `http://106.3.99.64:22016`,
// target: `http://192.168.10.171:22032`,
// target: `http://192.168.10.170:22032`,
target: `https://10.12.48.78/prod-api`,
target: `http://10.11.79.113:22008`,
// target: `http://10.11.79.113/prod-api`,
// target: `http://10.11.77.182:22016`,
changeOrigin: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment