Browse Source

0425

master
xuhuajiao 2 years ago
parent
commit
8289bc82a1
  1. 5
      src/assets/styles/archives-manage.scss
  2. 11
      src/assets/styles/mixin.scss
  3. 19
      src/assets/styles/yxk-admin.scss
  4. 322
      src/views/system/archiveScopeManage/index.vue
  5. 11
      src/views/system/archivesCategory/orderingRule/index.vue
  6. 33
      src/views/system/fieldCorresManage/index.vue
  7. 96
      src/views/system/fieldCorresManage/module/form.vue
  8. 11
      src/views/system/fileLibraryManage/orderingRule/index.vue
  9. 100
      src/views/system/fourCharacterDetection/data.json
  10. 467
      src/views/system/fourCharacterDetection/index.vue
  11. 11
      src/views/system/subjectLibraryManage/orderingRule/index.vue

5
src/assets/styles/archives-manage.scss

@ -186,11 +186,6 @@
border-radius: 26px;
}
.archives-table.el-table .el-table__fixed-right{
background-color: $boxBg !important;
box-shadow: -5px 5px 10px 1px rgba(15,164,222,0.16);
}
// archives - tab
.archives-tab{
position: relative;

11
src/assets/styles/mixin.scss

@ -919,3 +919,14 @@
background-color: #F5F7FA;
}
}
@mixin table-fixed-style{
[data-theme="dark"] & {
background-color: $boxBg !important;
box-shadow: -5px 5px 10px 1px rgba(15,164,222,0.16);
}
[data-theme="light"] & {
background-color: #FFFFFF !important;
box-shadow: -3px 3px 11px 0px rgba(0,0,0,0.08);
}
}

19
src/assets/styles/yxk-admin.scss

@ -1938,7 +1938,6 @@ input[type ='number'] {
font-size: 16px;
margin-left: 6px;
background-image: none;
transition: all ease-in 0.5s;
&.arrow-up {
transform: rotate(180deg);
@ -2064,3 +2063,21 @@ input[type ='number'] {
width: 100%;
height: 630px !important;
}
.tip {
display: inline-block;
margin: 4px 0 0 14px;
padding-left: 20px;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 20px;
background: url('~@/assets/images/icon/tip-icon.png') no-repeat left center;
background-size: 14px 14px;
}
.fixed-table.el-table .el-table__fixed-right{
@include table-fixed-style;
}

322
src/views/system/archiveScopeManage/index.vue

@ -1,9 +1,327 @@
<template>
<div>归档范围管理</div>
<div class="app-container">
<!-- 门类列表 -->
<div class="container-main" style="justify-content: flex-start;">
<div class="elect-cont-left">
<div class="container-left">
<span class="right-top-line" />
<span class="left-bottom-line" />
<!--门类树状结构-->
<div class="tree-scroll">
<el-tree ref="tree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleNodeClick" />
</div>
</div>
</div>
<div class="elect-cont-right">
<!--工具栏-->
<div class="head-container">
<crudOperation :permission="permission">
<template v-slot:left>
<el-button v-permission="permission.add" size="mini" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" />
新增
</el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 4" @click="crud.toEdit(crud.selections[0])">
<i class="iconfont icon-bianji" />
编辑
</el-button>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" />
删除
</el-button>
</template>
<template v-slot:right>
<span class="tip">注意门类节点下才可新增归档范围定义</span>
</template>
</crudOperation>
</div>
<div class="container-right">
<span class="right-top-line" />
<span class="left-bottom-line" />
<!--表单渲染-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title">
<div class="setting-dialog">
<el-form ref="form" :inline="true" :model="form" :rules="rules" label-width="90px">
<el-form-item label="所属门类" prop="category">
<el-input v-model="form.category" />
</el-form-item>
<el-form-item label="档案分类" prop="classify">
<treeselect
v-model="form.classify"
:load-options="loadCategorys"
:options="scopes"
placeholder="选择档案分类"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" @keydown.native="keydown($event)" />
</el-form-item>
<el-form-item label="编码" prop="number">
<el-input v-model="form.number" />
</el-form-item>
<el-form-item label="顶级范围" prop="isTop">
<el-radio-group v-model="form.isTop">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="保管期限" prop="retentionPeriod">
<el-select v-model="form.retentionPeriod" placeholder="请选择" style="width:225px;">
<el-option v-for="item in periodOptions" :key="item.value" :label="item.label" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item
v-if="form.isTop === '0'"
label="上级分类"
prop="pid"
>
<treeselect
v-model="form.scope"
:load-options="loadCategorys"
:options="scopes"
placeholder="选择上级范围"
style="width: 584px;"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确定</el-button>
</div>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="tableData"
style="width: 100%;"
:default-expand-all="isExpand"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
@row-click="clickRowHandler"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" align="center" width="55" />
<el-table-column :show-overflow-tooltip="true" prop="number" label="编码" />
<el-table-column :show-overflow-tooltip="true" prop="name" label="名称" type="expand" />
<el-table-column :show-overflow-tooltip="true" prop="retentionPeriod" label="保管期限" />
<el-table-column :show-overflow-tooltip="true" prop="category" label="所属门类" />
<el-table-column :show-overflow-tooltip="true" prop="classify" label="所属分类" />
</el-table>
<!--分页组件-->
<pagination v-if="tableData.length !== 0" />
</div>
</div>
<!--删除对话框组件-->
<el-dialog class="tip-dialog" title="提示" :visible.sync="deleteVisible">
<div class="setting-dialog">
<div class="tip-content">
<p class="tipMsg">此操作将移除当前所选范围</p>
<span>你是否还要继续?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="deleteVisible = false">取消</el-button>
<el-button type="primary" @click.native="handleDelConfirm">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import crudCategory from '@/api/category/category'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
const defaultForm = { id: null, pid: null, name: null, category: null, classify: null, retentionPeriod: null, number: null, isTop: '0' }
export default {
name: 'ArchiveScopeManage',
components: { crudOperation, pagination, Treeselect },
cruds() {
return [
CRUD({
title: '归档范围', url: 'api/archives-type/menu',
crudMethod: { ...crudCategory },
optShow: {
add: false,
edit: false,
del: false,
download: true,
group: false
}
})
]
},
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
tableData: [],
scopes: [],
deleteVisible: false,
isExpand: false,
permission: {
add: ['admin', 'category:add'],
edit: ['admin', 'category:edit'],
del: ['admin', 'category:del'],
sort: ['admin', 'category:sort']
},
defaultProps: {
children: 'children',
label: 'cnName'
},
periodOptions: [
{
id: 1,
value: '1',
label: '永久'
},
{
id: 2,
value: '2',
label: '定期30年'
},
{
id: 3,
value: '3',
label: '定期10年'
}
],
selectedCategory: {},
rules: {
category: [{ required: true, message: '所属门类不为空', trigger: 'blur' }],
classify: [{ required: true, message: '请选择档案分类', trigger: 'change' }],
number: [{ required: true, message: '编码不可为空', trigger: 'blur' }],
name: [{ required: true, message: '名称不可为空', trigger: 'blur' }],
isTop: [{ required: true, message: '请选择是否为顶级分类', trigger: 'change' }],
pid: [{ required: true, message: '请选择上级分类', trigger: 'change' }]
}
}
},
computed: {
},
methods: {
//
findNode(tree, func) {
for (const node of tree) {
if (func(node)) return node
if (node.children) {
const res = this.findNode(node.children, func)
if (res) return res
}
}
return null
},
//
expandParents(node) {
node.expanded = true
if (node.parent) {
this.expandParents(node.parent)
}
},
[CRUD.HOOK.afterRefresh]() {
let currentKey
if (localStorage.getItem('currentCategoryKey')) {
currentKey = JSON.parse(localStorage.getItem('currentCategoryKey'))
} else {
if (this.crud.data[0].isType === 1) {
currentKey = this.findNode(this.crud.data[0].children, (node) => {
return node.isType !== 1
})
} else {
currentKey = this.crud.data[0]
}
}
//
this.$refs.tree.setCurrentKey(currentKey.id)
this.$nextTick(() => {
//
const selectedKey = this.$refs.tree.getCurrentNode()
if (this.$refs.tree.getNode(selectedKey) && this.$refs.tree.getNode(selectedKey).parent) {
this.expandParents(this.$refs.tree.getNode(selectedKey).parent)
}
//
this.handleNodeClick(selectedKey)
})
},
//
handleNodeClick(val) {
if (val) {
// this.crud.selectionChangeHandler([val])
this.selectedCategory = val
// if (val.pid !== '0') {
// Vue.set(this.selectedCategory, 'parentName', this.$refs.tree.getNode(val.pid).data.cnName)
// }
// this.changeActiveTab(0)
//
localStorage.setItem('currentCategoryKey', JSON.stringify(val))
}
},
// - /
[CRUD.HOOK.beforeToAdd](crud, form, btn) {
const isCanAddKey = JSON.parse(localStorage.getItem('currentCategoryKey'))
if (isCanAddKey.isType === 4 || isCanAddKey.isType === 5) {
this.$message({
message: '此门类下不可新建门类',
type: 'error',
duration: 2500
})
return false
}
},
// / -
[CRUD.HOOK.afterSubmit](crud, addedCategory) {
if (addedCategory) {
//
localStorage.setItem('currentCategoryKey', JSON.stringify(addedCategory))
}
},
clickRowHandler(row) {
// this.$refs.table.toggleRowSelection(row) //
},
toDelete(val) {
this.deleteVisible = true
},
handleDelConfirm() {
this.deleteVisible = false
},
//
loadCategorys({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
// crudDict.getDicts().then(res => {
// parentNode.children = res.map(function(obj) {
// if (obj.children) {
// obj.childMenus = null
// }
// return obj
// })
// setTimeout(() => {
// callback()
// }, 100)
// })
}
}
}
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
[data-theme=dark] .elect-cont-left .container-left {
min-height: calc(100vh - 160px);
}
[data-theme=dark] .elect-cont-right .container-right {
min-height: calc(100vh - 212px);
}
[data-theme=light] .elect-cont-left .container-left {
min-height: calc(100vh - 200px);
}
.tree-scroll{
font-size: 14px;
}
.tip{
line-height: 28px;
}
</style>

11
src/views/system/archivesCategory/orderingRule/index.vue

@ -188,15 +188,4 @@ export default {
::v-deep .el-table tr .el-table__cell {
height: 40px;
}
.tip {
display: inline-block;
margin: 4px 0 0 14px;
padding-left: 20px;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 20px;
background: url('~@/assets/images/icon/tip-icon.png') no-repeat left center;
background-size: 14px 14px;
}
</style>

33
src/views/system/fieldCorresManage/index.vue

@ -22,7 +22,14 @@
/>
<rrOperation />
</div>
<crudOperation :permission="permission" />
<crudOperation :permission="permission">
<template v-slot:middle>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1" @click="toEdit(crud.selections[0])">
<i class="iconfont icon-bianji" />
编辑
</el-button>
</template>
</crudOperation>
</div>
<!--表单渲染-->
<el-dialog class="dialog-middle" append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" title="新增对应">
@ -66,6 +73,7 @@
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
@cell-dblclick="tableDoubleClick"
>
<el-table-column type="selection" width="55" />
<el-table-column :show-overflow-tooltip="true" prop="name" label="规则名称" />
@ -98,7 +106,19 @@ export default {
name: 'FieldCorresManage',
components: { crudOperation, rrOperation, Treeselect, eForm },
cruds() {
return CRUD({ title: '对应关系', url: 'api/menus', crudMethod: { }})
return CRUD({
title: '对应关系',
url: 'api/menus',
crudMethod: { },
optShow: {
add: true,
edit: false,
del: true,
reset: false,
download: true,
group: false
}
})
},
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
@ -127,6 +147,15 @@ export default {
toCorresForm() {
this.$refs.corresForm.corresVisible = true
},
// table -
tableDoubleClick(row) {
this.$refs.corresForm.title = '对应关系'
this.$refs.corresForm.corresVisible = true
},
toEdit() {
this.$refs.corresForm.title = '编辑对应关系'
this.$refs.corresForm.corresVisible = true
},
loadSource({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudMenu.getMenusTree(parentNode.id).then(res => {

96
src/views/system/fieldCorresManage/module/form.vue

@ -2,16 +2,16 @@
<el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:before-close="handleClose"
:visible="corresVisible"
:title="crud.status.title"
:title="title"
>
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-form ref="form" :model="form" :rules="rules" inline size="small" label-width="90px">
<el-form-item label="规则名称" prop="name">
<el-input v-model="form.name" />
<el-form ref="cuForm" :model="cuform" :rules="rules" inline size="small" label-width="100px">
<el-form-item label="规则名称" prop="name">
<el-input v-model="cuform.name" disabled />
</el-form-item>
</el-form>
<div class="corres-field-main">
@ -22,7 +22,7 @@
</div>
<div class="field-list">
<div v-for="(i,index) in targetData.length" :key="index" class="field-item">
<el-select v-if="!isModify[index]" v-model="sourceValue[index]" placeholder="请选择字段" @change="(val)=>selectFiled(val,index)">
<el-select v-if="isShow[index]" v-model="sourceValue[index]" placeholder="请选择字段" @change="(val)=>selectFiled(val,index)">
<el-option
v-for="v in options"
:key="v.value"
@ -30,7 +30,7 @@
:value="v.value"
/>
</el-select>
<p v-if="isModify[isNum]" @click="modifyFiled(index)">{{ sourceValue[index] }}</p>
<p v-else @click="modifyFiled(index)">{{ sourceValue[index] }}</p>
<div class="field-state"><span class="is-select">显示</span></div>
</div>
</div>
@ -48,45 +48,29 @@
</div>
</div>
</div>
<div
slot="footer"
class="dialog-footer"
>
<el-button
type="text"
@click="crud.cancelCU"
>
取消
</el-button>
<el-button
:loading="crud.status.cu === 2"
type="primary"
@click="crud.submitCU"
>
确定
</el-button>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="handleClose"> 取消 </el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="doSubmit"> 确定 </el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import { form } from '@crud/crud'
import { crud } from '@crud/crud'
import fieldData from './data.json'
const defaultForm = {
id: null,
name: '',
jobSort: 999,
description: null
}
export default {
mixins: [form(defaultForm)],
mixins: [crud()],
props: {
},
data() {
return {
title: '新增对应关系',
corresVisible: false,
cuform: {
id: null,
name: 'ddddd'
},
options: [{
value: '字段A',
label: '字段A'
@ -104,9 +88,11 @@ export default {
label: '字段E'
}],
sourceValue: [],
textValue: [],
targetData: [],
isModify: [],
isNum: null,
isShow: [],
rules: {
name: [
{ required: true, message: '规则名称不可为空', trigger: 'blur' }
@ -118,24 +104,49 @@ export default {
this.targetData = fieldData
this.targetData.forEach((item, index) => {
this.isModify[index] = false
this.sourceValue[index] = ''
this.textValue[index] = ''
this.isShow[index] = true
})
console.log(this.isModify)
},
mounted() {
console.log(this.sourceValue)
},
methods: {
doSubmit() {
this.$refs['cuForm'].validate((valid) => {
console.log(this.cuform)
if (valid) {
this.loading = true
} else {
return false
}
})
},
handleClose() {
this.corresVisible = false
},
selectFiled(val, index) {
console.log(val, index)
this.sourceValue[index] = val
this.isModify[index] = true
this.textValue[index] = val
this.isShow.forEach((item, i) => {
if (this.sourceValue[i] !== '' && this.isModify[i]) {
this.isShow[i] = false
}
})
},
modifyFiled(i) {
this.isNum = i
this.isModify[i] = true
this.isModify[i] = false
this.sourceValue[i] = ''
this.isShow.forEach((item, index) => {
if (this.sourceValue[index] === '' && this.isModify[index] === false) {
this.isShow[i] = true
}
})
console.log(this.isModify)
console.log(this.sourceValue)
console.log('sourceValue', this.sourceValue)
console.log('textValue', this.textValue)
console.log(this.isModify[i])
}
}
@ -151,6 +162,13 @@ export default {
.el-form-item {
.el-form-item__content{
width: 400px !important;
.el-input.is-disabled .el-input__inner{
font-weight: bold !important;
padding-left: 0 !important;
background-color: transparent !important;
border: none !important;
color: #0c0e1e !important;
}
}
}
}

11
src/views/system/fileLibraryManage/orderingRule/index.vue

@ -188,15 +188,4 @@ export default {
::v-deep .el-table tr .el-table__cell {
height: 40px;
}
.tip {
display: inline-block;
margin: 4px 0 0 14px;
padding-left: 20px;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 20px;
background: url('~@/assets/images/icon/tip-icon.png') no-repeat left center;
background-size: 14px 14px;
}
</style>

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

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

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

@ -1,9 +1,472 @@
<template>
<div>四性检测管理</div>
<div class="app-container">
<div class="container-main" style="justify-content: flex-start;">
<!--侧边部门数据-->
<div class="elect-cont-left">
<div class="container-left">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-tree :data="fourDatas" :props="defaultProps" :expand-on-click-node="false" highlight-current :default-expanded-keys="[1]" :default-checked-keys="[1]" @node-click="handleNodeClick" />
</div>
</div>
<!--用户数据-->
<div class="elect-cont-right">
<!--工具栏-->
<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">
<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" />
<div class="hide-bar">
<el-checkbox v-model="fixedStatus" @change="statusBarChecked">隐藏状态栏</el-checkbox>
</div>
</div>
<div class="container-right">
<span class="right-top-line" />
<span class="left-bottom-line" />
<!--表单渲染-->
<el-dialog append-to-body :close-on-click-modal="false" :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="90px">
<el-form-item label="账号" prop="username">
<el-input v-model="form.username" @keydown.native="keydown($event)" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model.number="form.phone" />
</el-form-item>
<el-form-item label="用户名" prop="nickName">
<el-input v-model="form.nickName" @keydown.native="keydown($event)" />
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" />
</el-form-item>
<el-form-item label="所属全宗" prop="dept.id">
<treeselect v-model="form.dept.id" :options="depts" placeholder="选择全宗" />
</el-form-item>
<el-form-item label="所属部门" prop="dept.id">
<treeselect v-model="form.dept.id" :options="depts" :load-options="loadDepts" placeholder="选择部门" />
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-radio-group v-model="form.gender">
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态" prop="enabled">
<el-radio-group v-model="form.enabled" :disabled="form.id === user.id">
<el-radio v-for="item in dict.user_status" :key="item.id" :label="item.value">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles" class="is-required selecct-dropdown">
<el-select v-model="roleDatas" style="width: 584x" multiple placeholder="请选择" :popper-append-to-body="false" @remove-tag="deleteTag" @change="changeRole">
<el-option v-for="item in roles" :key="item.name" :disabled="level !== 1 && item.level <= level" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确定</el-button>
</div>
</div>
</el-dialog>
<!--表格渲染-->
<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 :selectable="checkboxT" type="selection" align="center" width="55" />
<el-table-column :show-overflow-tooltip="true" prop="username" label="一级分类" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="nickName" label="二级分类" width="200" />
<el-table-column :show-overflow-tooltip="true" prop="gender" label="检测编号" width="100" />
<el-table-column :show-overflow-tooltip="true" prop="phone" label="检测项目" width="340" />
<el-table-column :show-overflow-tooltip="true" prop="email" label="检测目的" width="340" />
<el-table-column :show-overflow-tooltip="true" prop="dept" label="检测对象" width="160" />
<el-table-column :show-overflow-tooltip="true" prop="dept" label="依据和方法" width="140" />
<el-table-column :show-overflow-tooltip="true" prop="dept" label="检测类" width="140" />
<!-- :fixed="fixedStatus ? false : 'right' " -->
<el-table-column class="state-right" label="状态" align="center" width="120" prop="enabled" fixed="right">
<template slot-scope="scope">
<span :class="['row-state', scope.row.enabled ? 'active-state': 'disabled-state']">{{ scope.row.enabled ? '启用中': '停用中' }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</div>
</div>
</template>
<script>
import crudUser from '@/api/system/user'
import { isvalidPhone } from '@/utils/validate'
import { getDepts, getDeptSuperior } from '@/api/system/dept'
import { getAll, getLevel } from '@/api/system/role'
import { getAllJob } from '@/api/system/job'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
// import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import Treeselect from '@riophae/vue-treeselect'
import { mapGetters } from 'vuex'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import dataJson from './data.json'
let userRoles = []
let userJobs = []
const defaultForm = { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 'true', roles: [], jobs: [], dept: { id: null }, phone: null }
export default {
name: 'FourCharacterDetection',
components: { Treeselect, crudOperation, rrOperation, pagination },
cruds() {
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }, optShow: {
add: true,
edit: true,
del: false,
download: true,
group: false
}})
},
mixins: [presenter(), header(), form(defaultForm), crud()],
//
dicts: ['user_status'],
data() {
//
const validPhone = (rule, value, callback) => {
if (!value) {
callback(new Error('请输入电话号码'))
} else if (!isvalidPhone(value)) {
callback(new Error('请输入正确的11位手机号码'))
} else {
callback()
}
}
return {
fixedStatus: true,
height: document.documentElement.clientHeight - 180 + 'px;',
deptName: '', depts: [],
fourDatas: [],
jobs: [], level: 3, roles: [],
jobDatas: [], roleDatas: [], // 使
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
permission: {
add: ['admin', 'user:add'],
edit: ['admin', 'user:edit'],
del: ['admin', 'user:del']
},
enabledTypeOptions: [
{ key: 'true', display_name: '启用中' },
{ key: 'false', display_name: '停用中' }
],
rules: {
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
],
nickName: [
{ required: true, message: '请输入用户昵称', trigger: 'blur' },
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
],
email: [
{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
],
phone: [
{ required: true, trigger: 'blur', validator: validPhone }
],
'dept.id': [
{ required: true, trigger: 'blur', message: '请选择部门' }
],
gender: [
{ required: true, trigger: 'change', message: '请选择性别' }
],
enabled: [
{ required: true, trigger: 'change', message: '请选择状态' }
]
}
}
},
computed: {
...mapGetters([
'user'
])
},
created() {
this.fourDatas = dataJson
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
this.fixedStatus = JSON.parse(localStorage.getItem('statusFourFixed')) === true
},
methods: {
statusBarChecked(val) {
localStorage.setItem('statusFourFixed', val)
},
clickRowHandler(row) {
// this.$refs.table.toggleRowSelection(row) //
},
//
keydown(e) {
if (e.keyCode === 32) {
e.returnValue = false
}
},
changeRole(value) {
userRoles = []
value.forEach(function(data, index) {
const role = { id: data }
userRoles.push(role)
})
},
changeJob(value) {
userJobs = []
value.forEach(function(data, index) {
const job = { id: data }
userJobs.push(job)
})
},
deleteTag(value) {
userRoles.forEach(function(data, index) {
if (data.id === value) {
userRoles.splice(index, value)
}
})
},
//
[CRUD.HOOK.afterToCU](crud, form) {
this.getRoles()
if (form.id == null) {
this.getDepts()
} else {
this.getSupDepts(form.dept.id)
}
this.getRoleLevel()
this.getJobs()
form.enabled = form.enabled.toString()
},
//
[CRUD.HOOK.beforeToAdd]() {
this.jobDatas = []
this.roleDatas = []
},
//
[CRUD.HOOK.beforeToEdit](crud, form) {
this.getJobs(this.form.dept.id)
this.jobDatas = []
this.roleDatas = []
userRoles = []
userJobs = []
const _this = this
form.roles.forEach(function(role, index) {
_this.roleDatas.push(role.id)
const rol = { id: role.id }
userRoles.push(rol)
})
form.jobs.forEach(function(job, index) {
_this.jobDatas.push(job.id)
const data = { id: job.id }
userJobs.push(data)
})
},
//
[CRUD.HOOK.afterValidateCU](crud) {
if (!crud.form.dept.id) {
this.$message({
message: '部门不能为空',
type: 'warning'
})
return false
} else if (this.jobDatas.length === 0) {
this.$message({
message: '岗位不能为空',
type: 'warning'
})
return false
} else if (this.roleDatas.length === 0) {
this.$message({
message: '角色不能为空',
type: 'warning'
})
return false
}
crud.form.roles = userRoles
crud.form.jobs = userJobs
return true
},
//
getDeptDatas(node, resolve) {
const sort = 'id,desc'
const params = { sort: sort }
if (typeof node !== 'object') {
if (node) {
params['name'] = node
}
} else if (node.level !== 0) {
params['pid'] = node.data.id
}
setTimeout(() => {
getDepts(params).then(res => {
if (resolve) {
resolve(res.content)
} else {
this.deptDatas = res.content
}
})
}, 100)
},
getDepts() {
getDepts({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
getSupDepts(deptId) {
getDeptSuperior(deptId).then(res => {
const date = res.content
this.buildDepts(date)
this.depts = date
})
},
buildDepts(depts) {
depts.forEach(data => {
if (data.children) {
this.buildDepts(data.children)
}
if (data.hasChildren && !data.children) {
data.children = null
}
})
},
//
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 200)
})
}
},
//
handleNodeClick(data) {
if (data.pid === 0) {
this.query.deptId = null
} else {
this.query.deptId = data.id
}
this.crud.toQuery()
},
//
changeEnabled(data, val) {
// ' "' + this.dict.label.user_status[val] + '" ' + data.username + ', ',
this.$confirm('此操作将禁用 / 启用用户 “' + data.username + '”' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
crudUser.edit(data).then(res => {
this.crud.notify(this.dict.label.user_status[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
data.enabled = !data.enabled
})
}).catch(() => {
data.enabled = !data.enabled
})
},
//
getRoles() {
getAll().then(res => {
this.roles = res
}).catch(() => { })
},
//
getJobs() {
getAllJob().then(res => {
this.jobs = res.content
}).catch(() => { })
},
//
getRoleLevel() {
getLevel().then(res => {
this.level = res.level
}).catch(() => { })
},
checkboxT(row, rowIndex) {
return row.id !== this.user.id
}
}
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
@mixin table-fixed-status-style{
[data-theme="dark"] & {
&.active-state{
color: #1aae93;
border: 1px solid #1aae93;
}
&.disabled-state{
color: #A6ADB6;
border: 1px solid #E6E8ED;
opacity: 0.6;
}
}
[data-theme="light"] & {
&.active-state{
color: #2ECAAC;
background-color: #E8F8F5;
border: 1px solid #B1EBDF;
}
&.disabled-state{
color: #A6ADB6;
background-color: #F3F5F9;
border: 1px solid #E6E8ED;
}
}
}
.head-container{
position: relative;
}
.hide-bar{
position: absolute;
right: 0;
top: 60px;
}
::v-deep .el-table__fixed-right-patch{
background-color:#02255f;
border-bottom: none;
}
.row-state{
display: inline-block;
padding: 0 4px;
height: 20px;
line-height: 20px;
text-align: center;
font-size: 12px;
border-radius: 3px;
@include table-fixed-status-style;
}
</style>

11
src/views/system/subjectLibraryManage/orderingRule/index.vue

@ -182,15 +182,4 @@ export default {
</script>
<style lang="scss" scoped>
.tip {
display: inline-block;
margin: 4px 0 0 14px;
padding-left: 20px;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 20px;
background: url('~@/assets/images/icon/tip-icon.png') no-repeat left center;
background-size: 14px 14px;
}
</style>
Loading…
Cancel
Save