Commit b3518870 authored by mzx's avatar mzx

Merge branch 'develop' of http://gitlab.91isoft.com:90/car-test/web into mengzixuan

parents 5104a1ef d8d9204b
......@@ -2,18 +2,18 @@ import request from '@/utils/request'
// 体系审查、车型审查检验内容列表
export function listInspection(data) {
return request({
url: '/review/standard/getInspectionContent',
method: 'post',
data: data
})
return request({
url: '/review/standard/getInspectionContent',
method: 'post',
data: data
})
}
// 文档审查检验内容列表
export function listDocumentReview(data) {
return request({
url: '/review/standard/test/getInspectionContent',
method: 'post',
data: data
})
return request({
url: '/review/standard/test/getInspectionContent',
method: 'post',
data: data
})
}
import request from '@/utils/request'
export function listMatrix(data) {
return request({
url: '/usecase/matrix/getInfo',
method: 'post',
data: data
})
return request({
url: '/usecase/matrix/getInfo',
method: 'post',
data: data
})
}
import request from '@/utils/request'
//获取任务详情
export function taskDetail(data) {
return request({
......
......@@ -115,4 +115,3 @@
top: 20px;
transform: translateX(100%);
}
......@@ -490,7 +490,7 @@
.img {
border: 1px solid #ebebeb;
width: 100%;
height:348px
height: 348px;
}
}
}
......
......@@ -17,25 +17,23 @@
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
<!-- 上传提示 -->
<!-- <div class="el-upload__tip" slot="tip" v-if="showTip">-->
<!-- 请上传-->
<!-- <template v-if="fileSize">-->
<!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>-->
<!-- </template>-->
<!-- <template v-if="fileType">-->
<!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>-->
<!-- </template>-->
<!-- 的文件-->
<!-- </div>-->
<!-- <div class="el-upload__tip" slot="tip" v-if="showTip">-->
<!-- 请上传-->
<!-- <template v-if="fileSize">-->
<!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>-->
<!-- </template>-->
<!-- <template v-if="fileType">-->
<!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>-->
<!-- </template>-->
<!-- 的文件-->
<!-- </div>-->
<div class="el-upload__tip" slot="tip" v-if="showTip">
只能上传
<template v-if="fileType">
{{ fileType.join('/') }}
</template>
文件,
<template v-if="fileSize">
且不得超过{{ fileSize }}MB
</template>
<template v-if="fileSize"> 且不得超过{{ fileSize }}MB </template>
</div>
</el-upload>
......
......@@ -22,16 +22,16 @@
</el-upload>
<!-- 上传提示 -->
<!-- <div class="el-upload__tip" slot="tip" v-if="showTip">-->
<!-- 请上传-->
<!-- <template v-if="fileSize">-->
<!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>-->
<!-- </template>-->
<!-- <template v-if="fileType">-->
<!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>-->
<!-- </template>-->
<!-- 的文件-->
<!-- </div>-->
<!-- <div class="el-upload__tip" slot="tip" v-if="showTip">-->
<!-- 请上传-->
<!-- <template v-if="fileSize">-->
<!-- 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>-->
<!-- </template>-->
<!-- <template v-if="fileType">-->
<!-- 格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>-->
<!-- </template>-->
<!-- 的文件-->
<!-- </div>-->
<div class="el-upload__tip" slot="tip" v-if="showTip">
只能上传
......@@ -39,16 +39,10 @@
{{ fileType.join('/') }}
</template>
文件,
<template v-if="fileSize">
且不得超过{{ fileSize }}MB
</template>
<template v-if="fileSize"> 且不得超过{{ fileSize }}MB </template>
</div>
<el-dialog
:visible.sync="dialogVisible"
width="800"
append-to-body
>
<el-dialog :visible.sync="dialogVisible" width="800" append-to-body>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
......
......@@ -220,5 +220,4 @@ export default {
border: 1px solid #1764c1;
color: #1764c1;
}
</style>
......@@ -219,5 +219,4 @@ export default {
border: 1px solid #1764c1;
color: #1764c1;
}
</style>
......@@ -117,7 +117,7 @@ export default {
list-style-type: none;
margin-top: 5px;
padding: 0;
width:100%;
width: 100%;
li {
margin: 10px 0;
cursor: pointer;
......
......@@ -94,7 +94,7 @@ Vue.component('FooterButton', FooterButton)
Vue.use(directive)
Vue.use(plugins)
Vue.use(VueMeta)
import ModelDataSource from './utils/ModelDataSource';
import ModelDataSource from './utils/ModelDataSource'
Vue.use(ModelDataSource)
DictData.install()
......
......@@ -2,97 +2,55 @@
* Model 数据源
* 用于 单条记录的增删查改
*/
import _ from "lodash"
import request from "@/utils/request"
function ModelDataSource(vm, settings) {
this.vm = vm
this.settings = settings
this.errors = {}
this.debug = true
// this.dataKey = settings.
// this.defaultAttributes = settings.attributes;
this.init()
}
ModelDataSource.prototype = {
vm: null,
settings: null,
uuid: 0,
init: function () {
let self = this
_.assign(self, self.settings.attributes)
_.assignInWith(self.errors, self.settings.attributes, () => {
return ''
})
},
/**
* Fetch
*
* @param id
* @param successCallback
* @param failedCallback
*/
fetch: function (
uuid = 0,
params = {},
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
let url = self.settings.url
self.uuid = uuid
if (uuid == 0 || uuid == null) {
self.reset()
} else {
params.id = uuid
request({
url: url + '/getById',
method: 'post',
data: params
})
.then(function (response) {
console.log(response)
if (response.data) {
for (let key in response.data) {
self[key] = response.data[key]
}
} else {
for (let key in response.data) {
self[key] = response.data[key]
}
}
successCallback()
})
.catch(function (error) {
failedCallback()
})
}
},
/**
* 保存model
* @param successCallback
* @param failedCallback
*/
save: function (
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
let url = ''
if (self.uuid == 0) {
url = self.settings.url + '/add'
delete self.id
} else {
url = self.settings.url + '/edit'
}
import _ from 'lodash'
import request from '@/utils/request'
function ModelDataSource(vm, settings) {
this.vm = vm
this.settings = settings
this.errors = {}
this.debug = true
// this.dataKey = settings.
// this.defaultAttributes = settings.attributes;
this.init()
}
ModelDataSource.prototype = {
vm: null,
settings: null,
uuid: 0,
init: function () {
let self = this
_.assign(self, self.settings.attributes)
_.assignInWith(self.errors, self.settings.attributes, () => {
return ''
})
},
/**
* Fetch
*
* @param id
* @param successCallback
* @param failedCallback
*/
fetch: function (
uuid = 0,
params = {},
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
let url = self.settings.url
self.uuid = uuid
if (uuid == 0 || uuid == null) {
self.reset()
} else {
params.id = uuid
request({
url,
url: url + '/getById',
method: 'post',
data: _.omit(self, ['vm', 'settings', 'errors', 'debug'])
data: params
})
.then(function (response) {
console.log(response)
if (response.data) {
for (let key in response.data) {
self[key] = response.data[key]
......@@ -102,75 +60,117 @@
self[key] = response.data[key]
}
}
successCallback()
})
.catch(function (error) {
// console.log(error.response)
// if (error.response) {
// _.forEach(error.response.data, function (value, key) {
// typeof value === 'object' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value[0]);
// typeof value === 'string' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value);
// });
// } else {
// // Something happened in setting up the request that triggered an Error
// self.debug && console.log(error);
// }
failedCallback(error)
failedCallback()
})
},
/**
* 删除model
* @param id
*/
}
},
/**
*
* @param successCallback
* @param failedCallback
*/
destroy: function (
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
request({
url: self.settings.url + '/remove',
method: 'post',
data: {
ids: [self.uuid]
/**
* 保存model
* @param successCallback
* @param failedCallback
*/
save: function (
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
let url = ''
if (self.uuid == 0) {
url = self.settings.url + '/add'
delete self.id
} else {
url = self.settings.url + '/edit'
}
request({
url,
method: 'post',
data: _.omit(self, ['vm', 'settings', 'errors', 'debug'])
})
.then(function (response) {
if (response.data) {
for (let key in response.data) {
self[key] = response.data[key]
}
} else {
for (let key in response.data) {
self[key] = response.data[key]
}
}
successCallback()
})
.then(function (response) {
successCallback()
})
.catch(function (error) {
// Something happened in setting up the request that triggered an Error
self.debug && console.log('Error', error.message)
failedCallback(error)
})
},
.catch(function (error) {
// console.log(error.response)
// if (error.response) {
// _.forEach(error.response.data, function (value, key) {
// typeof value === 'object' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value[0]);
// typeof value === 'string' && self.vm.$set(self.vm[self.settings.dataKey].errors, key, value);
// });
// } else {
// // Something happened in setting up the request that triggered an Error
// self.debug && console.log(error);
// }
failedCallback(error)
})
},
/**
* 删除model
* @param id
*/
/**
* 重置model 为默认值
* @param id
*/
reset: function () {
let self = this
_.assign(self, self.settings.attributes)
_.assignInWith(self.errors, self.settings.attributes, () => {
return ''
/**
*
* @param successCallback
* @param failedCallback
*/
destroy: function (
successCallback = function () {},
failedCallback = function () {}
) {
let self = this
request({
url: self.settings.url + '/remove',
method: 'post',
data: {
ids: [self.uuid]
}
})
.then(function (response) {
successCallback()
})
}
}
.catch(function (error) {
// Something happened in setting up the request that triggered an Error
self.debug && console.log('Error', error.message)
failedCallback(error)
})
},
/**
* Vue Plugin
* 重置model 为默认值
* @param id
*/
ModelDataSource.install = function (Vue) {
Vue.prototype.$modelDataSource = function (options) {
console.log(this, options);
return new ModelDataSource(this, options)
}
reset: function () {
let self = this
_.assign(self, self.settings.attributes)
_.assignInWith(self.errors, self.settings.attributes, () => {
return ''
})
}
}
/**
* Vue Plugin
*/
ModelDataSource.install = function (Vue) {
Vue.prototype.$modelDataSource = function (options) {
console.log(this, options)
return new ModelDataSource(this, options)
}
}
export default ModelDataSource
export default ModelDataSource
......@@ -64,10 +64,10 @@
>新建</el-button
>
</el-col>
<right-toolbar
:show-search.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<!-- <right-toolbar-->
<!-- :show-search.sync="showSearch"-->
<!-- @queryTable="getList"-->
<!-- ></right-toolbar>-->
</el-row>
<el-table
......
......@@ -7,8 +7,8 @@
:before-close="handleClose"
>
<el-table
class="el-table"
v-loading="loading"
class="el-table"
style="min-height: 88px; margin: 20px"
border
:scroll-x="'1500px'"
......@@ -27,12 +27,7 @@
prop="testScenario"
>
</el-table-column>
<el-table-column
label="测试类型"
align="left"
sortable
prop="testType"
>
<el-table-column label="测试类型" align="left" sortable prop="testType">
</el-table-column>
<el-table-column
label="用例编号"
......
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