Browse Source

四性检测

master
xuhuajiao 1 year ago
parent
commit
77d1080bfc
  1. 29
      src/api/system/fourTests.js
  2. 44
      src/views/system/fourCharacterDetection/data.json
  3. 97
      src/views/system/fourCharacterDetection/index.vue
  4. 79
      src/views/system/fourCharacterDetection/module/form.vue

29
src/api/system/fourTests.js

@ -0,0 +1,29 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/fourTests/editFourTests',
method: 'post',
data
})
}
export function edit(data) {
return request({
url: 'api/fourTests/editFourTests',
method: 'post',
data
})
}
export function verifyMaintenance(code) {
const params = {
code
}
return request({
url: 'api/dictionary/maintenanceVerification',
method: 'get',
params
})
}
export default { add, edit, verifyMaintenance }

44
src/views/system/fourCharacterDetection/data.json

@ -1,96 +1,96 @@
[
{
"id": 1,
"id": 0,
"name": "四性检测",
"children": [
{
"id": 2,
"id": 1,
"name": "真实性检测",
"children": [
{
"id": 6,
"id": 5,
"name": "电子文件来源真实性"
},
{
"id": 7,
"id": 6,
"name": "电子文件元数据准确性"
},
{
"id": 8,
"id": 7,
"name": "电子文件内容真实性"
},
{
"id": 9,
"id": 8,
"name": "元数据与内容关联一致性"
},
{
"id": 10,
"id": 9,
"name": "归档信息包真实性"
}
]
},
{
"id": 3,
"id": 2,
"name": "完整性检测",
"children": [
{
"id": 11,
"id": 10,
"name": "电子文件数据总量"
},
{
"id": 12,
"id": 11,
"name": "元数据完整性"
},
{
"id": 13,
"id": 12,
"name": "电子文件内容完整性"
},
{
"id": 14,
"id": 13,
"name": "归档信息包完整性"
}
]
},
{
"id": 4,
"id": 3,
"name": "可用性检测",
"children": [
{
"id": 15,
"id": 14,
"name": "元数据可用性"
},
{
"id": 16,
"id": 15,
"name": "电子文件内容可用性"
},
{
"id": 17,
"id": 16,
"name": "电子文件软硬件环境"
},
{
"id": 18,
"id": 17,
"name": "归档信息包可用性"
}
]
},
{
"id": 5,
"id": 4,
"name": "安全性检测",
"children": [
{
"id": 19,
"id": 18,
"name": "归档信息包病毒"
},
{
"id": 20,
"id": 19,
"name": "病毒感染检测"
},
{
"id": 21,
"id": 20,
"name": "归档载体安全性"
},
{
"id": 22,
"id": 21,
"name": "归档过程安全性"
}
]

97
src/views/system/fourCharacterDetection/index.vue

@ -6,7 +6,7 @@
<div class="container-left">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-tree :data="fourDatas" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current :default-expanded-keys="[1]" :default-checked-keys="[1]" @node-click="handleNodeClick" />
<el-tree ref="tree" :data="fourDatas" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current :default-expanded-keys="defaultExpandedKeys" @node-click="handleNodeClick" />
</div>
</div>
<!--用户数据-->
@ -15,14 +15,21 @@
<div class="head-container">
<div class="head-search">
<!-- 搜索 -->
<el-input v-model="query.blurry" clearable size="small" placeholder="输入用检测编号或检测项目" prefix-icon="el-icon-search" style="width: 225px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery">
<el-input v-model="query.search" clearable size="small" placeholder="输入用检测编号或检测项目" prefix-icon="el-icon-search" style="width: 225px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<el-select v-model="query.isOpen" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery">
<i slot="prefix" class="iconfont icon-zhuangtai" />
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<rrOperation />
</div>
<crudOperation :permission="permission" />
<crudOperation :permission="permission">
<template v-slot:right>
<el-button :loading="crud.downloadLoading" size="mini" :disabled="crud.selections.length === 0" @click="doExport(crud.selections)">
<i class="iconfont icon-daochu" />
导出
</el-button>
</template>
</crudOperation>
<div class="hide-bar">
<el-checkbox v-model="fixedStatus" @change="statusBarChecked">隐藏状态栏</el-checkbox>
</div>
@ -33,22 +40,22 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" class="fixed-table" :data="crud.data" style="width: 100%;" @row-click="clickRowHandler" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" align="center" width="55" />
<el-table-column :show-overflow-tooltip="true" prop="oneLevel" label="一级分类" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="twoLevel" label="二级分类" width="200" />
<el-table-column :show-overflow-tooltip="true" prop="number" label="检测编号" width="100" />
<el-table-column :show-overflow-tooltip="true" prop="item" label="检测项目" width="340" />
<el-table-column :show-overflow-tooltip="true" prop="object" label="检测目的" width="340" />
<el-table-column :show-overflow-tooltip="true" prop="basis" label="检测对象" width="160" />
<el-table-column :show-overflow-tooltip="true" prop="method" label="依据和方法" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="type" label="检测类" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="primaryClassId" label="一级分类" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="secondaryClassId" label="二级分类" width="200" />
<el-table-column :show-overflow-tooltip="true" prop="detectionCode" label="检测编号" width="100" />
<el-table-column :show-overflow-tooltip="true" prop="detectionProject" label="检测项目" width="340" />
<el-table-column :show-overflow-tooltip="true" prop="detectionObjective" label="检测目的" width="340" />
<el-table-column :show-overflow-tooltip="true" prop="detectionObject" label="检测对象" width="160" />
<el-table-column :show-overflow-tooltip="true" prop="detectionAccording" label="依据和方法" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="detectionMethod" label="检测类" width="140" />
<el-table-column class="state-right" label="状态" align="center" width="108" prop="enabled" :fixed="fixedStatus ? false : 'right' ">
<template slot-scope="scope">
<span :class="['row-state', scope.row.enabled ? 'active-state': 'disabled-state']">{{ scope.row.enabled ? '启用中': '停用中' }}</span>
<span :class="['row-state', scope.row.isOpen ? 'active-state': 'disabled-state']">{{ scope.row.isOpen ? '启用中': '停用中' }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<pagination v-if="crud.data.length!==0" />
</div>
</div>
</div>
@ -75,8 +82,8 @@
</template>
<script>
import crudUser from '@/api/system/user'
import { verifyMaintenance } from '@/api/archivesConfig/field'
import crudFourTests from '@/api/system/fourTests'
import { verifyMaintenance } from '@/api/system/fourTests'
import { encrypt } from '@/utils/rsaEncrypt'
import CRUD, { presenter, header, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
@ -84,21 +91,26 @@ import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import dataJson from './data.json'
import eForm from './module/form'
import Vue from 'vue'
import { exportFile } from '@/utils/index'
import qs from 'qs'
import { mapGetters } from 'vuex'
export default {
name: 'FourCharacterDetection',
components: { crudOperation, rrOperation, pagination, eForm },
cruds() {
return CRUD({ title: '四性检测项目', url: 'api/users', crudMethod: { ...crudUser }, optShow: {
return CRUD({ title: '四性检测项目', url: 'api/fourTests/initFourTests', crudMethod: { ...crudFourTests }, optShow: {
add: true,
edit: true,
del: false,
download: true,
download: false,
group: false
}})
},
mixins: [presenter(), header(), crud()],
data() {
return {
defaultExpandedKeys: [],
fixedStatus: true,
verifyDialogVisible: false,
form: {
@ -108,26 +120,33 @@ export default {
btn: '',
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
permission: {
add: ['admin', 'user:add'],
edit: ['admin', 'user:edit'],
del: ['admin', 'user:del']
add: ['admin', 'fourTests:add'],
edit: ['admin', 'fourTests:edit'],
del: ['admin', 'fourTests:del']
},
enabledTypeOptions: [
{ key: 'true', display_name: '启用中' },
{ key: 'false', display_name: '停用中' }
{ key: '1', display_name: '启用中' },
{ key: '0', display_name: '停用中' }
]
}
},
computed: {
...mapGetters([
'baseApi'
])
},
created() {
this.fourDatas = dataJson
},
mounted: function() {
this.fixedStatus = JSON.parse(localStorage.getItem('statusFourFixed')) === true
this.$nextTick(() => {
Vue.set(this.defaultExpandedKeys, 0, this.fourDatas[0].children[0].id)
this.$refs.tree.setCurrentKey(this.fourDatas[0].children[0].id)
this.handleNodeClick(this.fourDatas[0].children[0])
})
},
methods: {
[CRUD.HOOK.beforeToCU](crud, form, btn) {
if (this.showVerifyDialog) {
//
@ -148,8 +167,17 @@ export default {
//
[CRUD.HOOK.afterValidateCU](crud) {
},
[CRUD.HOOK.beforeRefresh]() {
this.handleNodeClick()
},
// tree
handleNodeClick(data) {
handleNodeClick(val) {
if (val) {
if (val.id !== 0) {
this.crud.query.secondaryClassId = val.name
this.crud.toQuery()
}
}
},
handleConfirm() {
verifyMaintenance(encrypt(this.form.verifyCode)).then((res) => {
@ -179,6 +207,25 @@ export default {
},
statusBarChecked(val) {
localStorage.setItem('statusFourFixed', val)
},
doExport(data) {
crud.downloadLoading = true
this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const ids = []
data.forEach(val => {
ids.push(val.id)
})
const params = {
'ids': ids
}
exportFile(this.baseApi + '/api/fourTests/download?' + qs.stringify(params, { indices: false }))
}).catch(() => {
})
}
}
}

79
src/views/system/fourCharacterDetection/module/form.vue

@ -1,12 +1,10 @@
<template>
<!--表单渲染-->
<el-dialog :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title">
<!-- <span class="dialog-right-top" />
<span class="dialog-left-bottom" /> -->
<div class="setting-dialog">
<el-form ref="form" :inline="true" :model="form" :rules="rules" label-width="100px">
<el-form-item label="一级分类" prop="oneLevel">
<el-select v-model="form.oneLevel" placeholder="请选择" style="width:225px;">
<el-form-item label="一级分类" prop="primaryClassId">
<el-select v-model="form.primaryClassId" placeholder="请选择" style="width:225px;" @change="handleLeftSelectChange">
<el-option
v-for="item in options"
:key="item.value"
@ -15,46 +13,46 @@
/>
</el-select>
</el-form-item>
<el-form-item label="二级分类" prop="twoLevel">
<el-select v-model="form.twoLevel" placeholder="请选择" style="width:225px;">
<el-form-item label="二级分类" prop="secondaryClassId">
<el-select v-model="form.secondaryClassId" placeholder="请选择" style="width:225px;">
<el-option
v-for="item in options"
v-for="item in secondOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="检测编号" prop="number">
<el-input v-model="form.number" />
<el-form-item label="检测编号" prop="detectionCode">
<el-input v-model="form.detectionCode" />
</el-form-item>
<el-form-item label="检测项目" prop="item">
<el-input v-model="form.item" />
<el-form-item label="检测项目" prop="detectionProject">
<el-input v-model="form.detectionProject" />
</el-form-item>
<el-row>
<el-form-item label="检测目的" prop="purpose">
<el-input v-model="form.purpose" style="width: 580px;" />
<el-form-item label="检测目的" prop="detectionObjective">
<el-input v-model="form.detectionObjective" style="width: 580px;" />
</el-form-item>
</el-row>
<el-row>
<el-form-item label="检测对象" prop="object">
<el-input v-model="form.object" style="width: 580px;" />
<el-form-item label="检测对象" prop="detectionObject">
<el-input v-model="form.detectionObject" style="width: 580px;" />
</el-form-item>
</el-row>
<el-row>
<el-form-item label="依据和方法" prop="basis">
<el-input v-model="form.basis" type="textarea" style="width: 580px;" />
<el-form-item label="依据和方法" prop="detectionAccording">
<el-input v-model="form.detectionAccording" type="textarea" style="width: 580px;" />
</el-form-item>
</el-row>
<el-row>
<el-form-item label="检测方法" prop="method">
<el-input v-model="form.method" style="width: 580px;" />
<el-form-item label="检测方法" prop="detectionMethod">
<el-input v-model="form.detectionMethod" style="width: 580px;" />
</el-form-item>
</el-row>
<el-form-item label="是否开启" prop="isOpen">
<el-radio-group v-model="form.isOpen">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
@ -68,44 +66,45 @@
<script>
import { form } from '@crud/crud'
const defaultForm = { id: null, oneLevel: null, twoLevel: null, number: null, item: null, purpose: null, object: null, basis: null, method: null, isOpen: '1' }
const defaultForm = { id: null, primaryClassId: null, secondaryClassId: null, detectionCode: null, detectionProject: null, detectionObjective: null, detectionObject: null, detectionAccording: null, detectionMethod: null, isOpen: true }
export default {
mixins: [form(defaultForm)],
data() {
return {
options: [{
value: '选项1',
value: '真实性检测',
label: '真实性检测'
}, {
value: '选项2',
value: '完整性检测',
label: '完整性检测'
}, {
value: '选项3',
value: '可用性检测',
label: '可用性检测'
}, {
value: '选项4',
value: '安全性检测',
label: '安全性检测'
}],
secondOptions: [],
rules: {
oneLevel: [
primaryClassId: [
{ required: true, message: '请选择一级分类', trigger: 'change' }
],
twoLevel: [
secondaryClassId: [
{ required: true, message: '请选择二级分类', trigger: 'change' }
],
number: [
detectionCode: [
{ required: true, message: '检测编号不可为空', trigger: 'blur' }
],
item: [
detectionProject: [
{ required: true, message: '检测项目不可为空', trigger: 'blur' }
],
purpose: [
detectionObjective: [
{ required: true, message: '检测目的不可为空', trigger: 'blur' }
],
object: [
detectionObject: [
{ required: true, message: '检测对象不可为空', trigger: 'blur' }
],
basis: [
detectionAccording: [
{ required: true, message: '依据和方法不可为空', trigger: 'blur' }
],
isOpen: [
@ -118,9 +117,21 @@ export default {
},
created() {
},
mounted: function() {
mounted() {
},
methods: {
handleLeftSelectChange() {
if (this.form.primaryClassId === '真实性检测') {
this.secondOptions = [{ value: '电子文件来源真实性', label: '电子文件来源真实性' }, { value: '电子文件元数据准确性', label: '电子文件元数据准确性' }, { value: '电子文件内容真实性', label: '电子文件内容真实性' }, { value: '元数据与内容关联一致性', label: '元数据与内容关联一致性' }, { value: '归档信息包真实性', label: '归档信息包真实性' }]
} else if (this.form.primaryClassId === '完整性检测') {
this.secondOptions = [{ value: '电子文件数据总量', label: '电子文件数据总量' }, { value: '元数据完整性', label: '元数据完整性' }, { value: '电子文件内容完整性', label: '电子文件内容完整性' }, { value: '归档信息包完整性', label: '归档信息包完整性' }]
} else if (this.form.primaryClassId === '可用性检测') {
this.secondOptions = [{ value: '元数据可用性', label: '元数据可用性' }, { value: '电子文件内容可用性', label: '电子文件内容可用性' }, { value: '电子文件软硬件环境', label: '电子文件软硬件环境' }, { value: '归档信息包可用性', label: '归档信息包可用性' }]
} else if (this.form.primaryClassId === '安全性检测') {
this.secondOptions = [{ value: '归档信息包病毒', label: '归档信息包病毒' }, { value: '病毒感染检测', label: '病毒感染检测' }, { value: '归档载体安全性', label: '归档载体安全性' }, { value: '归档过程安全性', label: '归档过程安全性' }]
}
this.form.secondaryClassId = null
}
}
}
</script>

Loading…
Cancel
Save