8 changed files with 543 additions and 1 deletions
-
1README.md
-
10src/api/storeManage/tagManage/bindTagList.js
-
4src/views/components/BindingTagDlg.vue
-
177src/views/storeManage/deviceManage/dictDetail.vue
-
171src/views/storeManage/deviceManage/index.vue
-
74src/views/storeManage/tagManage/bindTagList/index.vue
-
54src/views/storeManage/tagManage/index.vue
-
53src/views/storeManage/tagManage/tagLog/index.vue
@ -0,0 +1,10 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function initTagList(parameter) { |
|||
return request({ |
|||
url: 'api/tag/initTagList', |
|||
method: 'get', |
|||
params: parameter |
|||
}) |
|||
} |
|||
export default { initTagList } |
@ -0,0 +1,177 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<crudOperation :permission="permission"> |
|||
<template v-slot:left> |
|||
<el-button v-permission="permission.add" size="mini" type="primary" icon="el-icon-plus" :disabled="!activeAddBtn" @click="crud.toAdd">新增</el-button> |
|||
</template> |
|||
<template v-slot:right> |
|||
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button> |
|||
</template> |
|||
</crudOperation> |
|||
</div> |
|||
<!--表单组件--> |
|||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="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" :model="form" :rules="rules" size="small" label-width="80px"> |
|||
<el-form-item label="字典名称" prop="dicName"> |
|||
<el-input v-model="form.dicName" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="字典代码" prop="dicCode"> |
|||
<el-input v-model="form.dicCode" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="内容说明" prop="dicExplain"> |
|||
<el-input v-model="form.dicExplain" style="width: 370px;" type="textarea" :rows="4" /> |
|||
</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-dialog title="删除字典内容" :visible.sync="deleteVisible" :before-close="handleClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<div class="dialog-delt"> |
|||
<p><span>确定删除当前字典内容吗?</span></p> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click.native="handleConfirm">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="selectionChangeHandler" @row-click="clickRowHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="dicName" label="字典名称" /> |
|||
<el-table-column prop="dicCode" label="字典代码" /> |
|||
<el-table-column prop="dicExplain" label="内容说明" /> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudDictDetail from '@/api/archivesConfig/dictDetail' |
|||
import CRUD, { presenter, header, form } from '@crud/crud' |
|||
import crudOperation from '@crud/CRUD.operation' |
|||
import pagination from '@crud/Pagination' |
|||
|
|||
const defaultForm = { id: null, dicName: null, dicCode: null, dicExplain: null, dicType: false } |
|||
|
|||
export default { |
|||
components: { crudOperation, pagination }, |
|||
cruds() { |
|||
return [ |
|||
CRUD({ |
|||
title: '字典内容', url: 'api/dictrionary/findSubsetById', query: { id: '' }, |
|||
crudMethod: { ...crudDictDetail }, |
|||
optShow: { |
|||
add: false, |
|||
edit: true, |
|||
del: false, |
|||
reset: false, |
|||
download: false, |
|||
group: false |
|||
}, |
|||
queryOnPresenterCreated: false, |
|||
confirmDeleteMsg: '确认删除当前字典内容么?', |
|||
sort: ['dicSequence,asc'] |
|||
}) |
|||
] |
|||
}, |
|||
mixins: [ |
|||
presenter(), |
|||
header(), |
|||
form(function() { |
|||
return Object.assign({ dicPid: this.dicPid }, defaultForm) |
|||
}) |
|||
], |
|||
props: { |
|||
activeAddBtn: { |
|||
type: Boolean |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dicPid: null, |
|||
needRefreshTree: false, |
|||
rules: { |
|||
dicName: [ |
|||
{ required: true, message: '请输入字典名称', trigger: 'blur' } |
|||
], |
|||
dicCode: [ |
|||
{ required: true, message: '请输入字典代码', trigger: 'blur' } |
|||
] |
|||
}, |
|||
permission: { |
|||
add: ['admin', 'dict:add'], |
|||
edit: ['admin', 'dict:edit'], |
|||
del: ['admin', 'dict:del'] |
|||
}, |
|||
deleteVisible: false, |
|||
deleteData: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
[CRUD.HOOK.afterSubmit]() { |
|||
this.needRefreshTree = true |
|||
}, |
|||
[CRUD.HOOK.afterDelete]() { |
|||
this.needRefreshTree = true |
|||
}, |
|||
// 获取数据前设置默认参数 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
this.crud.query.id = this.dicPid |
|||
}, |
|||
[CRUD.HOOK.afterRefresh](crud) { |
|||
if (this.needRefreshTree) { |
|||
this.needRefreshTree = false |
|||
this.$emit('treeRefresh', crud.data) |
|||
} |
|||
}, |
|||
clickRowHandler(row) { |
|||
this.$refs.table.clearSelection() |
|||
this.$refs.table.toggleRowSelection(row) |
|||
}, |
|||
selectionChangeHandler(val) { |
|||
if (val.length > 1) { |
|||
// 取出最后val的最后一个返回出来 |
|||
const finalVal = val.pop() |
|||
// 清除所有选中 |
|||
this.$refs.table.clearSelection() |
|||
// 给最后一个加上选中 |
|||
this.$refs.table.toggleRowSelection(finalVal) |
|||
this.crud.selectionChangeHandler([finalVal]) |
|||
} else { |
|||
this.crud.selectionChangeHandler(val) |
|||
} |
|||
}, |
|||
toDelete(data) { |
|||
this.deleteData = data |
|||
this.deleteVisible = true |
|||
}, |
|||
handleConfirm() { |
|||
this.deleteVisible = false |
|||
this.crud.delAllLoading = true |
|||
this.crud.doDelete(this.deleteData) |
|||
}, |
|||
handleClose(done) { |
|||
this.deleteData = {} |
|||
done() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
::v-deep thead .el-table-column--selection .cell { |
|||
display: none; |
|||
} |
|||
</style> |
@ -0,0 +1,171 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!--表单组件--> |
|||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="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" :model="form" :rules="rules" size="small" label-width="80px"> |
|||
<el-form-item label="字典名称" prop="dicName"> |
|||
<el-input v-model="form.dicName" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="字典代码" prop="dicCode"> |
|||
<el-input v-model="form.dicCode" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="内容说明"> |
|||
<el-input v-model="form.dicExplain" style="width: 370px;" type="textarea" :rows="4" /> |
|||
</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-dialog title="删除字典" :visible.sync="deleteVisible" :before-close="handleClose"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<div class="dialog-delt"> |
|||
<p><span>确定要删除当前字典吗?</span></p> |
|||
<p class="delt-tip"><span>提示:如果删除当前字典,此字典内所属内容会一并删除</span></p> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click.native="handleConfirm">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
<!-- 字典列表 --> |
|||
<el-row class="container-main" :gutter="20"> |
|||
<el-col class="container-left curd-in-out" :xs="10" :sm="8" :md="5" :lg="6" :xl="4"> |
|||
<span class="right-top-line" /> |
|||
<span class="left-bottom-line" /> |
|||
<crudOperation :permission="permission"> |
|||
<template v-slot:right> |
|||
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button> |
|||
</template> |
|||
</crudOperation> |
|||
<!--字典树状结构--> |
|||
<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" /> |
|||
</el-col> |
|||
<!-- 字典详情列表 --> |
|||
<el-col class="container-right" :xs="14" :sm="16" :md="19" :lg="18" :xl="20"> |
|||
<span class="right-top-line" /> |
|||
<span class="left-bottom-line" /> |
|||
<dictDetail ref="dictDetail" :permission="permission" :active-add-btn="activeAddBtn" @treeRefresh="updateKeyChildren" /> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import dictDetail from './dictDetail' |
|||
import crudDict from '@/api/archivesConfig/dict' |
|||
import CRUD, { presenter, header, form } from '@crud/crud' |
|||
import crudOperation from '@crud/CRUD.operation' |
|||
|
|||
const defaultForm = { id: null, dicName: null, dicCode: null, dicExplain: null, dicType: true } |
|||
|
|||
export default { |
|||
name: 'Dict', |
|||
components: { crudOperation, dictDetail }, |
|||
cruds() { |
|||
return [ |
|||
CRUD({ |
|||
title: '字典', url: 'api/dictrionary/menu', |
|||
crudMethod: { ...crudDict }, |
|||
optShow: { |
|||
add: true, |
|||
edit: true, |
|||
del: false, |
|||
download: false, |
|||
group: false |
|||
}, |
|||
confirmDeleteMsg: '确定要删除当前字典吗', |
|||
sort: ['dicSequence,asc'] |
|||
}) |
|||
] |
|||
}, |
|||
mixins: [presenter(), header(), form(defaultForm)], |
|||
data() { |
|||
return { |
|||
rules: { |
|||
dicName: [ |
|||
{ required: true, message: '请输入字典名称', trigger: 'blur' } |
|||
], |
|||
dicCode: [ |
|||
{ required: true, message: '请输入字典代码', trigger: 'blur' } |
|||
] |
|||
}, |
|||
permission: { |
|||
add: ['admin', 'dict:add'], |
|||
edit: ['admin', 'dict:edit'], |
|||
del: ['admin', 'dict:del'] |
|||
}, |
|||
defaultProps: { |
|||
children: 'childMenus', |
|||
label: 'dicName' |
|||
}, |
|||
activeAddBtn: false, |
|||
deleteVisible: false, |
|||
deleteData: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 获取数据前设置好接口地址 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
if (this.$refs.dictDetail) { |
|||
this.$refs.dictDetail.query.id = '' |
|||
} |
|||
return true |
|||
}, |
|||
// 选中字典后,设置字典详情数据 |
|||
handleNodeClick(val) { |
|||
if (val) { |
|||
if (val.dicType === 'true') { |
|||
this.crud.selectionChangeHandler([val]) |
|||
} else { |
|||
this.crud.selectionChangeHandler([]) |
|||
} |
|||
this.$refs.dictDetail.query.id = val.id |
|||
this.$refs.dictDetail.dicPid = val.id |
|||
this.$refs.dictDetail.crud.toQuery() |
|||
this.activeAddBtn = true |
|||
} |
|||
}, |
|||
// 编辑前将字典明细临时清空,避免日志入库数据过长 |
|||
[CRUD.HOOK.beforeToEdit](crud, form) { |
|||
// 将角色的菜单清空,避免日志入库数据过长 |
|||
form.dictDetails = null |
|||
}, |
|||
updateKeyChildren(data) { |
|||
const oldDatas = this.$refs.tree.getCurrentNode().childMenus |
|||
if (oldDatas) { |
|||
for (let i = 0; i < data.length; i++) { |
|||
const oldData = oldDatas.find((d) => { return d.id === data[i].id }) |
|||
if (oldData) { |
|||
data[i].childMenus = oldData.childMenus |
|||
} |
|||
} |
|||
} |
|||
this.$refs.tree.updateKeyChildren(this.$refs.tree.getCurrentKey(), data) |
|||
}, |
|||
toDelete(data) { |
|||
this.deleteData = data |
|||
this.deleteVisible = true |
|||
}, |
|||
handleConfirm() { |
|||
this.deleteVisible = false |
|||
this.crud.delAllLoading = true |
|||
this.crud.doDelete(this.deleteData) |
|||
}, |
|||
handleClose(done) { |
|||
this.deleteData = {} |
|||
done() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
</style> |
@ -0,0 +1,74 @@ |
|||
<template> |
|||
<div> |
|||
<div class="head-container"> |
|||
<div class="archives-handler-btn"> |
|||
<!-- iconfont icon-weibiaoti-2 --> |
|||
<el-button class="lending-btn" type="primary" @click="unbind()">解除绑定</el-button> |
|||
</div> |
|||
</div> |
|||
<el-table ref="table" v-loading="loading" :data="bindTagList" style="width: 100%;" height="calc(100vh - 463px)" @row-click="clickRowHandler"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column type="index" label="序号" width="55" align="center" /> |
|||
<el-table-column prop="tid" label="TID" align="center" /> |
|||
<el-table-column prop="depositNum" label="绑定对象" align="center" /> |
|||
<el-table-column prop="caseName" label="标签名称" align="center" /> |
|||
<el-table-column prop="update_time" width="175" label="操作时间" align="center"> |
|||
<template slot-scope="scope"> |
|||
<div>{{ scope.row.update_time | parseTime }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination :page-size.sync="page.size" :total="page.total" :current-page.sync="page.page" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChangeHandler($event)" @current-change="pageChangeHandler" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { initTagList } from '@/api/storeManage/tagManage/bindTagList' |
|||
export default { |
|||
data() { |
|||
return { |
|||
bindTagList: [{}], |
|||
loading: false, |
|||
page: { |
|||
total: 0, |
|||
size: 10, |
|||
page: 1 |
|||
}, |
|||
query: {} |
|||
} |
|||
}, |
|||
created() { |
|||
this.initData() |
|||
}, |
|||
methods: { |
|||
initData() { |
|||
initTagList(this.getQueryParams()).then((res) => { |
|||
console.log(res) |
|||
}) |
|||
}, |
|||
getQueryParams() { |
|||
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => { |
|||
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined |
|||
}) |
|||
return { |
|||
page: this.page.page - 1, |
|||
size: this.page.size, |
|||
...this.query |
|||
} |
|||
}, |
|||
clickRowHandler(row) { |
|||
this.$refs.table.toggleRowSelection(row) |
|||
}, |
|||
unbind() { |
|||
}, |
|||
sizeChangeHandler() { |
|||
}, |
|||
pageChangeHandler() { |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
</style> |
@ -0,0 +1,54 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-row> |
|||
<div class="tab-content"> |
|||
<span class="right-top-line" /> |
|||
<span class="left-bottom-line" /> |
|||
<ul class="tab-nav"> |
|||
<li :class="{ 'active-tab-nav': activeIndex == 0 }" @click="changeActiveTab(0)">绑定标签列表<i /></li> |
|||
<li :class="{ 'active-tab-nav': activeIndex == 1 }" @click="changeActiveTab(1)">标签使用记录<i /></li> |
|||
<!-- 最右侧装饰img --> |
|||
<span class="tab-right-img" /> |
|||
</ul> |
|||
<!-- <component :is="comName" :record-form-visible="recordFormVisible" /> --> |
|||
<component :is="comName" /> |
|||
</div> |
|||
</el-row> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import bindTagList from './bindTagList/index.vue' |
|||
import tagLog from './tagLog/index.vue' |
|||
|
|||
export default { |
|||
name: 'TagManage', |
|||
components: { |
|||
bindTagList, |
|||
tagLog |
|||
}, |
|||
data() { |
|||
return { |
|||
activeIndex: 0 |
|||
} |
|||
}, |
|||
computed: { |
|||
comName: function() { |
|||
if (this.activeIndex === 0) { |
|||
return 'bindTagList' |
|||
} else if (this.activeIndex === 1) { |
|||
return 'tagLog' |
|||
} |
|||
return 'bindTagList' |
|||
} |
|||
}, |
|||
methods: { |
|||
changeActiveTab(data) { |
|||
this.activeIndex = data |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
</style> |
@ -0,0 +1,53 @@ |
|||
<template> |
|||
<div> |
|||
<div class="content-container"> |
|||
<div class="state-radio"> |
|||
<p> |
|||
<label> |
|||
<input v-model="lineStateVal" type="radio" name="lineState" value="在线"><span>在线(直接完成借阅操作)</span> |
|||
</label> |
|||
</p> |
|||
<p> |
|||
<label> |
|||
<input v-model="lineStateVal" type="radio" name="lineState" value="离线"><span>离线(发起借阅操作后,将借阅的档案放在读写器上进行识别,将带有电子标签的档案的报警位进行解绑或绑定)</span> |
|||
</label> |
|||
</p> |
|||
<!-- <button @click="btn">测试按钮</button> --> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
lineStateVal: '' |
|||
} |
|||
}, |
|||
methods: { |
|||
// btn() { |
|||
// console.log(this.lineStateVal) |
|||
// } |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
h2{ |
|||
color: #fff; |
|||
} |
|||
p{ |
|||
height: 32px; |
|||
line-height: 32px; |
|||
input{ |
|||
margin-right: 10px; |
|||
} |
|||
} |
|||
.content-container{ |
|||
height:636px; |
|||
color: #fff; |
|||
padding: 0 20px; |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue