Commit bb311e6e authored by xinzhedeai's avatar xinzhedeai

档案馆

parent 2cd028f4
import request from '@/utils/request'
export default {
// ID查询
getfileByFolderId: (catalogueId) => {
return request({
url: 'api/document',
method: 'get',
params: { catalogueId }
})
},
// page查询
getDataList: (pageParam) => {
return request({
url: 'api/document-catalogue/all',
method: 'get',
params: pageParam
})
},
// 新增
addFileByFolderId: (data) => {
return request({
url: 'api/video-mine',
method: 'post',
data
})
},
// 修改
set: (iotNormalMachine) => {
return request({
url: 'api/video-mine',
method: 'put',
data: iotNormalMachine
})
},
// 删除
delfileById: (id) => {
return request({
url: 'api/document',
method: 'delete',
data: {
id
}
})
},
// 根据企业查询所属矿山(含停产)enterpriseId
getAllMineByEnterpriseId: (mineSearchParam) => {
return request({
url: 'api/mine/all-mine/list',
method: 'get',
params: mineSearchParam
})
}
}
...@@ -28,6 +28,46 @@ ...@@ -28,6 +28,46 @@
<el-button type="text" @click="crud.cancelCU">取消</el-button> <el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</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="fileUploadModal"
:close-on-click-modal="false"
>
<el-form ref="formInfo" label-width="120px">
<el-form-item>
<el-input v-model="fileType" size="small" clearable placeholder="请输入文件分类" style="width: 200px;" class="filter-item" />
</el-form-item>
<el-form-item>
<label
class="import-file-dg"
style="
color: #1890ff;
display: inline-block;
border: 1px solid #1890ff;
"
>
上传文件
<input
:ref="`addhdpic`"
class="helloworld"
type="file"
hidden
@change="addhdPicChange"
/>
</label>
</el-form-item>
<el-form-item label="">
<div v-for="(item, index) in addEnterhdPics" :key="item.name + index">
{{ item.name }}
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="adddialogform = false">取消</el-button>
<el-button type="primary" @click="confirmUploadFile">确定</el-button>
</div>
</el-dialog> </el-dialog>
<el-row :gutter="15"> <el-row :gutter="15">
<!-- 菜单授权 --> <!-- 菜单授权 -->
...@@ -35,13 +75,20 @@ ...@@ -35,13 +75,20 @@
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-button <el-button
v-permission="['admin','roles:edit']" icon="el-icon-minus"
size="mini"
style="float: right; margin-left:6px;"
type="danger"
@click="saveMenu">
删除</el-button>
<el-button
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
style="float: right; padding: 6px 9px" style="float: right;"
type="primary" type="primary"
@click="saveMenu"> @click="saveMenu">
新建文件夹</el-button> 新建</el-button>
</div> </div>
<el-tree <el-tree
ref="menu" ref="menu"
...@@ -55,6 +102,7 @@ ...@@ -55,6 +102,7 @@
show-checkbox show-checkbox
node-key="id" node-key="id"
@check="menuChange" @check="menuChange"
@node-click="menuClick"
/> />
</el-card> </el-card>
</el-col> </el-col>
...@@ -63,7 +111,7 @@ ...@@ -63,7 +111,7 @@
<el-col :span="16"> <el-col :span="16">
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-button type="primary" size="mini">上传文件</el-button> <el-button type="primary" size="mini" @click="fileUploadModal=true">上传文件</el-button>
<el-input v-model="query.blurry" size="small" clearable placeholder="查询文件分类" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.blurry" size="small" clearable placeholder="查询文件分类" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<date-range-picker v-model="query.createTime" class="date-item" /> <date-range-picker v-model="query.createTime" class="date-item" />
<el-input v-model="query.blurry" size="small" clearable placeholder="查询文件名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.blurry" size="small" clearable placeholder="查询文件名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
...@@ -82,7 +130,15 @@ ...@@ -82,7 +130,15 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <el-pagination
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="currenetPageDegree"
layout="total, sizes, prev, pager, next, jumper"
:total="totalElement"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
...@@ -91,7 +147,7 @@ ...@@ -91,7 +147,7 @@
<script> <script>
import crudRoles from '@/api/system/role' import crudRoles from '@/api/system/role'
import { getDepts, getDeptSuperior } from '@/api/system/dept' import { getfileByFolderId, getFolderList, addFileByFolderId, delfileById } from '@/api/kd/edoc'
import { getMenusTree, getChild } from '@/api/system/menu' import { getMenusTree, getChild } from '@/api/system/menu'
import CRUD, { presenter, header, form, crud } from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
...@@ -114,6 +170,14 @@ ...@@ -114,6 +170,14 @@
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
data() { data() {
return { return {
fileType: '',
fileUploadModal: false,
addEnterhdPics: [],
currentFolderId: '',
fileDataList: [],
totalElement: 0,
currentPage: 0,
currenetPageDegree: 10,
dateScopes: ["全部", "本级及以下", "自定义",], dateScopes: ["全部", "本级及以下", "自定义",],
defaultProps: { children: 'children', label: 'label', isLeaf: 'leaf' }, defaultProps: { children: 'children', label: 'label', isLeaf: 'leaf' },
level: 3, level: 3,
...@@ -135,9 +199,6 @@ ...@@ -135,9 +199,6 @@
} }
}, },
computed: { computed: {
...mapGetters([
'user'
])
}, },
created() { created() {
crudRoles.getLevel().then(data => { crudRoles.getLevel().then(data => {
...@@ -145,6 +206,49 @@ ...@@ -145,6 +206,49 @@
}) })
}, },
methods: { methods: {
// 当前页的条数变化
handleSizeChange(val) {
this.currenetPageDegree = val;
this.getfileByFolderId();
},
// 当前第几页
handleCurrentChange(val) {
this.currentPage = val;
this.getfileByFolderId();
},
getfileByFolderId(){
getfileByFolderId({
catalogueId: this.currentFolderId,
page: this.currentPage,
size: currenetPageDegree
}).then((res)=>{
this.fileDataList = res.body.results
this.totalElement = res.body.total
})
},
confirmUploadFile(){
addFileByFolderId({
fileList: this.addEnterhdPics,
catalogueId: this.currentFolderId,
classification: this.fileType
}).then((res)=>{
this.$message.success('操作成功')
this.getfileByFolderId()
})
},
addhdPicChange(event) {
// event.target 是触发事件的 input 元素
const files = event.target.files; // 获取用户选择的文件列表
// 检查是否有文件选择
if (files.length > 0) {
const file = files[0]; // 选择第一个文件
console.log(`文件名: ${file.name}`);
console.log(`文件大小: ${file.size} bytes`);
console.log(`文件类型: ${file.type}`);
}
this.addEnterhdPics = this.$refs["addhdpic"].files;
},
getMenuDatas(node, resolve) { getMenuDatas(node, resolve) {
setTimeout(() => { setTimeout(() => {
getMenusTree(node.data.id ? node.data.id : 0).then(res => { getMenusTree(node.data.id ? node.data.id : 0).then(res => {
...@@ -157,30 +261,6 @@ ...@@ -157,30 +261,6 @@
}) })
}, 100) }, 100)
}, },
[CRUD.HOOK.afterRefresh]() {
this.$refs.menu.setCheckedKeys([])
},
// 新增前初始化部门信息
[CRUD.HOOK.beforeToAdd](crud, form) {
this.deptDatas = []
form.menus = null
},
// 编辑前初始化自定义数据权限的部门信息
[CRUD.HOOK.beforeToEdit](crud, form) {
this.deptDatas = []
const _this = this
form.depts.forEach(function(dept) {
_this.deptDatas.push(dept.id)
})
// 将角色的菜单清空,避免日志入库数据过长
form.menus = null
},
// 提交前做的操作
[CRUD.HOOK.afterValidateCU](crud) {
// crud.form.dataScope = '全部'
// crud.form.depts = []
return true
},
// 触发单选 // 触发单选
handleCurrentChange(val) { handleCurrentChange(val) {
if (val) { if (val) {
...@@ -198,6 +278,12 @@ ...@@ -198,6 +278,12 @@
this.showButton = true this.showButton = true
} }
}, },
menuClick(data, node, target){
console.log('menuClick', data, node, target)
// 传递文件夹ID,获取对应文件夹下的文件数据
this.currentFolderId = data.id
},
menuChange(menu) { menuChange(menu) {
// 获取该节点的所有子节点,id 包含自身 // 获取该节点的所有子节点,id 包含自身
getChild(menu.id).then(childIds => { getChild(menu.id).then(childIds => {
...@@ -218,6 +304,12 @@ ...@@ -218,6 +304,12 @@
} }
} }
this.$refs.menu.setCheckedKeys(this.menuIds) this.$refs.menu.setCheckedKeys(this.menuIds)
/**
* 1 勾选菜单后
*
*/
}) })
}, },
// 保存菜单 // 保存菜单
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
append-to-body append-to-body
:close-on-click-modal="true" :close-on-click-modal="true"
:visible.sync="dialog1Show" :visible.sync="dialog1Show"
title="矿山-摄像头资料" title="监控配置"
width="960px" width="960px"
> >
<el-form <el-form
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
placeholder="请选择" placeholder="请选择"
@change="enterpriseChange" @change="enterpriseChange"
style="width: 400px" style="width: 400px"
:disabled="editState == 3"
> >
<el-option <el-option
v-for="item in options4enterpriseIdList" v-for="item in options4enterpriseIdList"
...@@ -85,6 +86,7 @@ ...@@ -85,6 +86,7 @@
size="small" size="small"
class="filter-item" class="filter-item"
style="width: 400px" style="width: 400px"
:disabled="editState == 3"
> >
<el-option <el-option
v-for="(mine, key) in mineList" v-for="(mine, key) in mineList"
...@@ -329,7 +331,7 @@ export default { ...@@ -329,7 +331,7 @@ export default {
methods: { methods: {
getMineTypeByMineId(mineId){ getMineTypeByMineId(mineId){
return this.mineList.find((item)=>{ return this.mineList.find((item)=>{
return item.id = mineId return item.id === mineId
}) })
}, },
validData(data){ validData(data){
...@@ -347,6 +349,10 @@ export default { ...@@ -347,6 +349,10 @@ export default {
enterpriseId enterpriseId
}).then(response => { }).then(response => {
this.mineList = response.body this.mineList = response.body
// this.mineList = response.body.map((item)=>{
// item.id = item.id+''
// return item
// })
// this.dialog1Data.mineId = '' // this.dialog1Data.mineId = ''
}) })
}, },
...@@ -399,6 +405,10 @@ export default { ...@@ -399,6 +405,10 @@ export default {
const mineInfo = this.getMineTypeByMineId(this.dialog1Data.mineId) const mineInfo = this.getMineTypeByMineId(this.dialog1Data.mineId)
this.dialog1Data.mineType = mineInfo.type this.dialog1Data.mineType = mineInfo.type
this.dialog1Data.mineName = mineInfo.name this.dialog1Data.mineName = mineInfo.name
if(mineInfo.enterpriseId !== this.dialog1Data.enterpriseId){
this.$message.warning('所属矿山与所属企业不匹配,请重新选择')
return
}
// this.dialog1Data.mineId = "1"; // 地下矿山 // this.dialog1Data.mineId = "1"; // 地下矿山
if (this.editState === 1) { if (this.editState === 1) {
videoConfigApi videoConfigApi
......
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