Commit 3c22383d authored by Kimber's avatar Kimber
parents cffce88f 9b3acd48
import request from '@/utils/request'
export default {
deleteById: (ids) => {
return request({
url: 'api/enterprise',
method: 'delete',
data: ids
})
},
// 审核状态
auditStates: () => {
return [{
......
......@@ -191,6 +191,22 @@ export default {
method: 'get',
params: mineSearchParam
})
}
},
deleteOpencastById: (ids) => {
return request({
url: 'api/mine/opencast',
method: 'delete',
data: ids
})
},
deleteUndergroundById: (ids) => {
return request({
url: 'api/mine/underground',
method: 'delete',
data: ids
})
},
}
......@@ -36,7 +36,9 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="folderModal = false">取消</el-button>
<el-button type="primary" @click="confirmFolder" :loading="modalBtnLoad">确定</el-button>
<el-button type="primary" @click="confirmFolder" :loading="modalBtnLoad"
>确定</el-button
>
</div>
</el-dialog>
<!-- 上传文件窗口 -->
......@@ -83,7 +85,12 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="fileUploadModal = false">取消</el-button>
<el-button type="primary" @click="confirmUploadFile">确定</el-button>
<el-button
type="primary"
@click="confirmUploadFile"
:loading="modalBtnLoad"
>确定</el-button
>
</div>
</el-dialog>
<el-row :gutter="15">
......@@ -91,6 +98,7 @@
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<el-button
v-show="selectedFolderInfo.deleteWhether"
size="mini"
style="float: right; margin-left: 6px"
type="danger"
......@@ -99,6 +107,7 @@
删除</el-button
>
<el-button
v-show="selectedFolderInfo.editWhether"
size="mini"
style="float: right"
type="primary"
......@@ -121,9 +130,9 @@
:props="defaultProps"
check-strictly
accordion
show-checkbox
show-checkbox1
node-key="id"
@check="menuChange"
check="menuCheck"
@node-click="menuClick"
/>
</el-card>
......@@ -134,30 +143,32 @@
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<el-button
v-show="selectedFolderInfo.uploadWhether"
type="primary"
size="mini"
@click="fileUploadModal = true"
>上传文件</el-button
>
<el-input
v-model="query.type"
v-model="query.originallyName"
size="small"
clearable
placeholder="查询文件分类"
placeholder="查询文件名称"
style="width: 200px"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<date-range-picker v-model="query.time" class="date-item" />
<date-range-picker v-model="query.time" type="datetimerange" class="date-item" />
<el-input
v-model="query.name"
v-model="query.classification"
size="small"
clearable
placeholder="查询文件名称"
placeholder="查询文件分类"
style="width: 200px"
class="filter-item"
/>
<el-button type="primary" size="mini" @click="search">查询</el-button>
<el-button type="primary" size="mini" @click="search"
>查询</el-button
>
</div>
<el-table ref="table" style="width: 100%" :data="fileDataList">
<el-table-column type="" width="55" />
......@@ -167,16 +178,18 @@
prop="classification"
width="100"
/>
<el-table-column width="200px" prop="time" label="录入时间" />
<el-table-column width="200px" prop="createTime" label="录入时间" />
<el-table-column label="操作" width="230px" align="center">
<template slot-scope="scope">
<el-button
type="success"
v-show="scope.row.downloadWhether"
type="primary"
size="mini"
@click="downFileById(scope.row)"
>下载</el-button
>
<el-button
v-show="scope.row.deleteWhether"
type="danger"
size="mini"
@click="delFileById(scope.row)"
......@@ -205,7 +218,7 @@
import edocApi from "@/api/kd/edoc";
import DateRangePicker from "@/components/DateRangePicker";
import { getToken } from "@/utils/auth";
import axios from 'axios'
import axios from "axios";
export default {
name: "Folder",
......@@ -215,10 +228,10 @@ export default {
data() {
return {
modalBtnLoad: false,
query:{
originallyName: '',
type:'',
time: ''
query: {
originallyName: "",
classification: "",
time: "",
},
folderModal: false,
folderForm: {
......@@ -228,9 +241,9 @@ export default {
fileType: "",
fileUploadModal: false,
uploadedFiles: [],
currentFolderId: "",
currentCheckedFolderId: "",
currentCheckedFolderInfo: {},
selectedFolderId: "",
selectedFolderId: "",
selectedFolderInfo: {},
fileDataList: [],
totalElement: 0,
page: 0,
......@@ -253,10 +266,18 @@ export default {
mounted() {
this.getDataList(); // 获取所有文件夹
},
created() {
},
created() {},
methods: {
// searchParamReset() {
// this.searchParam = {
// originallyName: "",
// classification: "",
// time: "",
// }
// this.page = 0
// this.size = 10
// this.getfileByFolderId()
// },
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
......@@ -275,48 +296,50 @@ export default {
confirmFolder() {
this.$refs["folderForm"].validate((valid) => {
if (valid) {
if(this.modalBtnLoad){
return
if (this.modalBtnLoad) {
return;
}
this.modalBtnLoad = true
if(this.folderForm.id){ // 修改
this.modalBtnLoad = true;
if (this.folderForm.id) {
// 修改
edocApi
.updateFolder({
...this.folderForm,
})
.then((res) => {
this.folderModal = false
this.folderModal = false;
this.$message.success("操作成功");
this.getDataList();
});
}else{// 新增
} else {
// 新增
edocApi
.addFolder({
...this.folderForm,
pid: this.currentCheckedFolderId,
pid: this.selectedFolderId,
})
.then((res) => {
this.folderModal = false
this.folderModal = false;
this.$message.success("操作成功");
this.getDataList();
});
}
this.modalBtnLoad = false
this.modalBtnLoad = false;
}
});
},
addFolder() {
// if (!this.currentCheckedFolderId) {
// this.$message.warning("请勾选文件夹");
// if (!this.selectedFolderId) {
// this.$message.warning("请选择文件夹");
// return;
// }
this.folderModal = true;
this.folderForm = { name: "", order: "" };
},
delFolder() {
if (!this.currentCheckedFolderId) {
this.$message.warning("勾选要操作的文件夹");
if (!this.selectedFolderId) {
this.$message.warning("选择要操作的文件夹");
return;
}
this.$confirm("确定要删除吗?", "提示", {
......@@ -325,7 +348,7 @@ export default {
type: "warning",
}).then(
() => {
edocApi.delFolder([this.currentCheckedFolderId]).then((res) => {
edocApi.delFolder([this.selectedFolderId]).then((res) => {
this.$message.success("操作成功");
this.getDataList();
});
......@@ -339,29 +362,34 @@ export default {
);
},
downFileById(row) {
if(this.isExportLoading){
return
if (this.isExportLoading) {
return;
}
this.isExportLoading = true;
// 导出信息
axios.defaults.headers.common["Authorization"] = getToken();
const apiUrl = (process.env.VUE_APP_LOCAL_API + "/api/document/download").replaceAll("'", "")
axios.interceptors.response.use(function (response) {
const apiUrl = (
process.env.VUE_APP_LOCAL_API + "/api/document/download"
).replaceAll("'", "");
axios.interceptors.response.use(
function (response) {
// 对响应数据做点什么
console.log("响应头",response);
console.log("响应头", response);
return response;
}, function (error) {
},
function (error) {
// 对响应错误做点什么
return Promise.reject(error);
});
}
);
axios({
url: apiUrl,
responseType: "blob",
method: "get",
params: { id: row.id},
params: { id: row.id },
}).then((res) => {
console.log("export",res.headers["content-disposition"]);
console.log("export", res.headers["content-disposition"]);
let data = res.data;
let url = URL.createObjectURL(data);
let dis = res.headers["content-disposition"];
......@@ -389,7 +417,7 @@ export default {
() => {
edocApi.delFileById([row.id]).then((res) => {
this.$message.success("操作成功");
this.getfileByFolderId(this.currentFolderId);
this.getfileByFolderId(this.selectedFolderId);
});
},
() => {
......@@ -401,26 +429,26 @@ export default {
);
},
updateFolder() {
if (!this.currentCheckedFolderId) {
this.$message.warning("勾选文件夹");
if (!this.selectedFolderId) {
this.$message.warning("选择文件夹");
return;
}
this.folderModal = true;
this.folderForm.name = this.currentCheckedFolderInfo.name
this.folderForm.order = this.currentCheckedFolderInfo.order
this.folderForm.id = this.currentCheckedFolderInfo.id
this.folderForm.name = this.selectedFolderInfo.name;
this.folderForm.order = this.selectedFolderInfo.order;
this.folderForm.id = this.selectedFolderInfo.id;
},
search(){
this.getfileByFolderId()
search() {
this.getfileByFolderId();
},
getfileByFolderId() {
edocApi
.getfileByFolderId({
catalogueId: this.currentFolderId,
catalogueId: this.selectedFolderId,
page: this.page,
size: this.size,
...this.query,
time: this.query.time ? this.query.time.join(',') : ''
time: this.query.time ? this.query.time.join(",") : "",
})
.then((res) => {
this.fileDataList = res.body.results;
......@@ -428,7 +456,7 @@ export default {
});
},
confirmUploadFile() {
if (!this.currentFolderId) {
if (!this.selectedFolderId) {
this.$message.warning("请选择文件夹");
return;
}
......@@ -436,10 +464,14 @@ export default {
this.$message.warning("请上传文件");
return;
}
if (this.modalBtnLoad) {
return;
}
this.modalBtnLoad = true;
const formData = new FormData();
// console.log(this.formInfo.hdstatus1, "haStatus");
formData.append("fileList", this.uploadedFiles[0]);
formData.append("catalogueId", this.currentFolderId);
formData.append("catalogueId", this.selectedFolderId);
formData.append("classification", this.fileType);
edocApi.addFileByFolderId(formData).then((res) => {
......@@ -447,6 +479,7 @@ export default {
this.getfileByFolderId();
this.fileUploadModal = false;
});
this.modalBtnLoad = false;
},
addhdPicChange(event) {
// event.target 是触发事件的 input 元素
......@@ -464,17 +497,28 @@ export default {
menuClick(data, node, target) {
console.log("menuClick", data, node, target);
// 传递文件夹ID,获取对应文件夹下的文件数据
this.currentFolderId = data.id;
this.selectedFolderId = data.id;
// 下方著用于添加目录操作
this.selectedFolderInfo = data;
// this.selectedFolderId = data.id;
this.getfileByFolderId();
},
menuChange(data, node, target) {
console.log("menuChange", data, node, target);
this.currentCheckedFolderInfo = data
const menu = data;
this.currentCheckedFolderId = node.checkedKeys.length
? node.checkedKeys[0]
: "";
},
// menuCheck(data, node, target) {
// console.log("menuCheck处理前", data, node, target);
// if(node.checkedKeys.length>1){
// const tempCheckey = node.checkedKeys[node.checkedKeys.length-1]
// this.$refs.menu.setCheckedKeys([tempCheckey]);
// // node.checkedKeys.splice(0, 1)
// console.log("menuCheck处理后", data, node, target);
// }
// this.selectedFolderInfo = node.checkedKeys.length ? data : {} // 勾选上则赋值当先选中节点。否则位空对象
// const menu = data;
// this.selectedFolderId = node.checkedKeys.length
// ? node.checkedKeys[0]
// : "";
// },
},
};
</script>
......
......@@ -16,7 +16,7 @@
</el-select> -->
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="searchParamReset">重置</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="add">新增</el-button>
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="add">新增</el-button>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip>
......@@ -543,10 +543,11 @@
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200px" align="center" fixed="right">
<el-table-column label="操作" width="300px" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" round @click="showEnterpriseInfo(scope.row.id)">查看详情</el-button>
<el-button size="mini" round @click="editEnterpriseInfo(scope.row)">修改</el-button>
<el-button size="mini" round @click="deleteEnterpriseInfo(scope.row)">删除</el-button>
<!-- <el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 2)">通过</el-button>
<el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 3)">不通过</el-button> -->
......@@ -916,6 +917,26 @@ export default {
dialog2Submit() {
this.doAudit(this.dialog2Data)
},
deleteEnterpriseInfo(row){
this.$confirm("确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(
() => {
enterpriseApi.deleteById([row.id]).then((res) => {
this.$message.success("操作成功");
this.searchSubmit();
});
},
() => {
this.$message({
type: "info",
message: "已取消删除",
});
}
);
},
editEnterpriseInfo(row){
this.addCompanyShow = true
this.mainDataEditing = row
......
<template>
<div class="app-container">
<!--工具栏-->
<span style="color: red;font-size: 10px;">* 原型图菜单叫监控数据,但其他2处监控叫实时数据,此页面查询的也是最新的测点数据,为措辞统一,这里也叫实时数据了。</span>
<span style="color: red;font-size: 10px;">* 测点类型在新增时是填写的,在这里是选择的?在填过的内容里选择吗?等对接了硬件可能会更清楚这个类型是干什么用的。</span>
<!-- <span style="color: red;font-size: 10px;">* 原型图菜单叫监控数据,但其他2处监控叫实时数据,此页面查询的也是最新的测点数据,为措辞统一,这里也叫实时数据了。</span>
<span style="color: red;font-size: 10px;">* 测点类型在新增时是填写的,在这里是选择的?在填过的内容里选择吗?等对接了硬件可能会更清楚这个类型是干什么用的。</span> -->
<div class="head-container">
<div>
<el-input clearable size="small" placeholder="测点名称" style="width: 200px;" class="filter-item" />
......
<template>
<div class="app-container">
<!--工具栏-->
<span style="color: red;font-size: 10px;">* 监测类型在新增时是填写的,在这里是选择的?在填过的内容里选择吗?等对接了硬件可能会更清楚这个类型是干什么用的。</span>
<!-- <span style="color: red;font-size: 10px;">* 监测类型在新增时是填写的,在这里是选择的?在填过的内容里选择吗?等对接了硬件可能会更清楚这个类型是干什么用的。</span> -->
<div class="head-container">
<div>
<el-input clearable size="small" placeholder="设备名称" style="width: 200px;" class="filter-item" />
......@@ -13,7 +13,7 @@
</div>
</div>
<!--表格-->
<span style="color: red;font-size: 10px;">* 此处表格显示了监测类型,环境检测却不显示?</span>
<!-- <span style="color: red;font-size: 10px;">* 此处表格显示了监测类型,环境检测却不显示?</span> -->
<el-table ref="table" v-loading="searching" :data="tableData" row-key="id">
<el-table-column :show-overflow-tooltip="true" prop="id" label="编号" width="100px" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="mineName" label="设备名称" align="center" />
......
......@@ -142,7 +142,7 @@
</el-form-item>
</el-col>
</el-row>
<span style="color: red; font-size: 11px;">* 图纸点选X Y?等确认如何操作时再做。XY现在是String</span>
<!-- <span style="color: red; font-size: 11px;">* 图纸点选X Y?等确认如何操作时再做。XY现在是String</span> -->
</el-form>
<div v-show="dialog1Editing" slot="footer" class="dialog-footer">
<el-button type="text" @click="dialog1Show=false">取消</el-button>
......
......@@ -462,7 +462,9 @@
<template slot-scope="scope">
<el-button size="mini" round @click="beginLook(scope.row.id)">查看</el-button>
<el-button v-if="scope.row.hasEnable" size="mini" round @click="beginEdit(scope.row.id)">编辑</el-button>
<el-button v-if="scope.row.hasEnable" size="mini" round @click="beginStopApply(scope.row.id)">申请停产</el-button>
<el-button size="mini" round @click="beginDelete(scope.row)">删除</el-button>
<!-- <el-button v-if="scope.row.hasEnable" size="mini" round @click="beginStopApply(scope.row.id)">申请停产</el-button> -->
</template>
</el-table-column>
</el-table>
......@@ -609,6 +611,26 @@ export default {
this.$refs['dialog1Form'].clearValidate()
})
},
beginDelete(row){
this.$confirm("确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(
() => {
mineApi.deleteOpencastById([row.id]).then((res) => {
this.$message.success("操作成功");
this.searchSubmit();
});
},
() => {
this.$message({
type: "info",
message: "已取消删除",
});
}
);
},
beginEdit(id) {
this.beforeDialog1Open()
this.editState = 2
......
......@@ -418,7 +418,9 @@
<template slot-scope="scope">
<el-button size="mini" round @click="beginLook(scope.row.id)">查看</el-button>
<el-button v-if="scope.row.hasEnable" size="mini" round @click="beginEdit(scope.row.id)">编辑</el-button>
<el-button v-if="scope.row.hasEnable" size="mini" round @click="beginStopApply(scope.row.id)">申请停产</el-button>
<el-button size="mini" round @click="beginDelete(scope.row)">删除</el-button>
<!-- <el-button v-if="scope.row.hasEnable" size="mini" round @click="beginStopApply(scope.row.id)">申请停产</el-button> -->
</template>
</el-table-column>
</el-table>
......@@ -563,6 +565,26 @@ export default {
this.$refs['dialog1Form'].clearValidate()
})
},
beginDelete(row){
this.$confirm("确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(
() => {
mineApi.deleteUndergroundById([row.id]).then((res) => {
this.$message.success("操作成功");
this.searchSubmit();
});
},
() => {
this.$message({
type: "info",
message: "已取消删除",
});
}
);
},
beginEdit(id) {
if (this.editState === 1) {
this.addingData = this.dialog1Data
......
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