Parcourir la source

问题管理

master
huxinglu il y a 4 ans
Parent
révision
477a7e7787
7 fichiers modifiés avec 445 ajouts et 3 suppressions
  1. +19
    -1
      src/api/file/inspectfile.js
  2. BIN
      src/assets/img/test.tiff
  3. +1
    -1
      src/components/dVideo.vue
  4. +1
    -0
      src/views/business/realVideo.vue
  5. +258
    -0
      src/views/file/photo/index.vue
  6. +165
    -0
      src/views/file/photo/photoForm.vue
  7. +1
    -1
      src/views/main/index.vue

+ 19
- 1
src/api/file/inspectfile.js Voir le fichier

@@ -105,7 +105,25 @@ export default {
method: 'GET',
url: '/api/inspectfile/download?ids=' + params.id
})
}
},

getPhotoList(params) {
return axios({
method: "GET",
url: '/api/admin/photo/list',
params: {
...params
}
})
},

editPhoto(params) {
return axios({
method: "GET",
url: '/api/admin/photo/edit',
data: params
})
},
}



BIN
src/assets/img/test.tiff Voir le fichier


+ 1
- 1
src/components/dVideo.vue Voir le fichier

@@ -29,7 +29,7 @@
techOrder: ['flash'], // 兼容顺序
flash: {
hls: {withCredentials: false},
// swf: 'static/video-js.swf' // 引入静态文件swf
// swf: SWF_URL // 引入静态文件swf
},
html5: {hls: {withCredentials: false}},
sources: [],

+ 1
- 0
src/views/business/realVideo.vue Voir le fichier

@@ -12,6 +12,7 @@
</el-table-column>
</el-table>
<div>
<!-- <iframe width="100%" height="100%" src="http://mudu.tv/?c=activity&a=live&id=230645" frameborder="0"/> -->
<dVideo style="width: 100%" v-if="liveUrl" :liveUrl="liveUrl"></dVideo>
</div>
</div>

+ 258
- 0
src/views/file/photo/index.vue Voir le fichier

@@ -0,0 +1,258 @@
<template>
<div class="photo-list">
<el-form :inline="true" :model="searchParam" class="demo-form-inline">
<el-form-item label="任务单号">
<el-input
clearable
v-model="searchParam.inspectNo"
size="small"
placeholder="请输入任务单号"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="区划">
<driverAreaSelect v-model="searchParam.driverArea"></driverAreaSelect>
</el-form-item>
<el-form-item label="河道名称">
<el-input
clearable
v-model="searchParam.driverName"
size="small"
placeholder="请输入河道名称"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="巡检时间">
<el-date-picker
style="width: 200px"
placeholder="巡检时间"
clearable
size="small"
value-format="yyyy-MM-dd"
v-model="searchParam.time"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
:loading="tableLoading"
icon="el-icon-search"
@click="search"
size="small"
type="primary"
>搜索</el-button>
<el-button
icon="el-icon-refresh-right"
@click="initSearchParam();search()"
type="primary"
size="small"
style="background-color: #fff; border: 1px solid #ccc ; color: #666"
>清空</el-button>
</el-form-item>
</el-form>
<el-table
stripe
ref="table"
:height="tableHeight"
v-loading="tableLoading"
:data="dataList"
border
size="medium"
row-key="id"
>
<el-table-column :index="indexMethod" label="序号" type="index" width="80" align="center" />
<el-table-column
min-width="130"
show-overflow-tooltip
prop="inspectNo"
label="任务单号"
align="center"
></el-table-column>
<el-table-column show-overflow-tooltip prop="areaName" label="区划" align="center" />
<el-table-column show-overflow-tooltip prop="driverName" label="河湖名称" align="center" />
<el-table-column
min-width="120"
show-overflow-tooltip
prop="inspectTime"
label="巡检日期"
align="center"
/>
<el-table-column show-overflow-tooltip label="正射图" align="center" min-width="80">
<template slot-scope="{row}">
<img v-if="row.photoUrl" style="width:20px;height:20px" :src="row.photoUrl" />
</template>
</el-table-column>
<el-table-column
min-width="80"
show-overflow-tooltip
prop="uploadUserName"
label="上传人"
align="center"
/>
<el-table-column
min-width="120"
show-overflow-tooltip
prop="uploadTime"
label="上传时间"
align="center"
/>
<el-table-column label="操作" align="left" width="150">
<template slot-scope="{row}">
<el-button
v-if="isAdmin||btnRule.some(btn=>btn=='edit')"
@click="uploadItem(row)"
type="primary"
size="mini"
icon="el-icon-upload2"
>导入</el-button>
<el-button
v-if="isAdmin||btnRule.some(btn=>btn=='edit')"
type="danger"
size="mini"
class="el-icon-delete"
@click="handleDelete(row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-current">
<el-pagination
:current-page="currentPage"
:page-size="pageSize"
prev-text="上一页"
next-text="下一页"
background
layout="total, prev, pager, next, jumper"
style="display: inline-block;"
:total="count"
@current-change="handleCurrentChange"
/>
</div>
<photoForm @handleClose="visible=false" v-if="visible" :visible="visible" />
</div>
</template>

<script>
import api from "@/api/file/inspectfile";
import driverAreaSelect from "@/components/driverAreaSelect";
import photoForm from './photoForm'
import { mapGetters } from "vuex";

export default {
name: "photo-list",
data() {
return {
visible: false,
dataList: [],
currentPage: 1,
count: 0,
pageSize: parseInt((document.body.clientHeight - 250 - 43) / 47),
tableHeight: document.body.clientHeight - 250,
tableLoading: false,
searchParam: {
inspectNo: "",
driverName: "",
driverArea: "",
time: ""
},
driverAreaTypeList: {
1: "区划所有",
2: "本级河湖"
}
};
},
computed: {
...mapGetters(["btnRule", "isAdmin"])
},
components: { driverAreaSelect,photoForm },
created() {},
mounted() {
this.tableLoading = true;
this.getAllList();
},
methods: {
uploadItem(){
this.visible=true
},
indexMethod(index) {
return index + 1 + (this.currentPage - 1) * this.pageSize;
},
handleDelete(row) {
this.$confirm("确定要删除吗", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.delLoading = true;
inspectfileApi
.drop({ id: row.id })
.then(res => {
this.delLoading = false;
this.$message({
type: "success",
message: "删除成功!"
});
this.tableLoading = true;
this.getAllList();
})
.catch(e => {
this.delLoading = false;
});
});
},
initSearchParam() {
this.searchParam = {
inspectNo: "",
driverName: "",
driverArea: "",
time: ""
};
},
search() {
this.currentPage = 1;
this.tableLoading = true;
this.$refs.table.bodyWrapper.scrollTop = 0;
this.getAllList();
},
handleCurrentChange(val) {
this.tableLoading = true;
this.currentPage = val;
this.$refs.table.bodyWrapper.scrollTop = 0;
this.getAllList();
},
getAllList() {
let searchParam = JSON.parse(JSON.stringify(this.searchParam));
if (searchParam.time && searchParam.time.length > 0) {
searchParam.startTime = searchParam.time[0];
searchParam.endTime = searchParam.time[1];
delete searchParam.time;
}
searchParam.page = this.currentPage;
searchParam.pageSize = this.pageSize;
api
.getPhotoList(searchParam)
.then(res => {
this.dataList = res.data.records ? res.data.records : [];
this.count = res.data.total;
this.tableLoading = false;
})
.catch(e => {
this.dataList = [];
this.tableLoading = false;
});
}
}
};
</script>

<style lang="less">
.photo-list {
height: fit-content;
background-color: #fff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
padding: 15px;
}
</style>

+ 165
- 0
src/views/file/photo/photoForm.vue Voir le fichier

@@ -0,0 +1,165 @@
<template>
<el-drawer
title="正射图"
:visible.sync="visible"
direction="rtl"
size="500px"
:before-close="handleClose"
>
<div class="photo-form">
<el-form ref="ruleForm" :model="ruleForm" size="small" label-width="180px">
<el-form-item label="正射图" prop="photoUrl">
<uploadImage
:isCompress="false"
ref="uploadImage"
v-model="ruleForm.photoUrl"
:img="ruleForm.photoUrl"
v-on:addImage="addImage"
:limit="1"
v-on:removeImage="removeImage"
></uploadImage>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button
v-if="!ruleForm.disabled"
icon="el-icon-document-add"
:loading="addBtnLoading"
type="primary"
size="medium"
@click="submitForm('ruleForm')"
>提交</el-button>
<el-button
icon="el-icon-back"
v-if="ruleForm.id"
style="margin-left: 15px"
size="medium"
@click="handleClose"
>返回</el-button>
</div>
</div>
</el-drawer>
</template>

<script>
import driverApi from "@/api/basicData/driver";
import uploadImage from "@/components/uploadImage";

export default {
name: "photorForm",
data() {
var patrn = /^\d+(\.\d+)?$/;
var lengthP = /^(\d+)(.\d{0,4})?$/;
var validateNum = (rule, value, callback) => {
if (!value) {
callback();
} else {
if (rule.field == "length") {
if (!lengthP.test(value)) {
callback(new Error("小数点最多4位"));
} else if (parseInt(value) > 9999) {
callback(new Error("最大10000"));
} else {
callback();
}
} else {
if (!patrn.test(value)) {
callback(new Error("请输入数字"));
} else {
callback();
}
}
}
};
return {
ruleForm: {},
validateNum: validateNum,
addBtnLoading: false,
categoryList: [
{ id: "categoryOne", name: "Ⅰ类" },
{ id: "categoryTwo", name: "Ⅱ类" },
{ id: "categoryThree", name: "Ⅲ类" },
{ id: "categoryFour", name: "Ⅳ类" },
{ id: "categoryFive", name: "Ⅴ类" }
]
};
},
props: {
visible: {
type: Boolean,
default() {
false;
}
},
userList: {
type: Array,
default() {
return [];
}
},
typeList: {
type: Object,
default() {
return {};
}
},
levelList: {
type: Object,
default() {
return {};
}
}
},
components: {uploadImage },
created() {},
mounted() {},
methods: {
handleClose(){
this.$emit('handleClose')
},
removeImage() {
this.ruleForm.photoUrl = "";
},
addImage(...data) {
this.ruleForm.photoUrl = data[0];
},
clearValidate() {
this.$refs.ruleForm.clearValidate("driverArea");
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let method = "addDriver";
if (this.ruleForm.id) {
method = "editDriver";
}
let ruleForm = JSON.parse(JSON.stringify(this.ruleForm));
this.addBtnLoading = true;
driverApi[method](ruleForm)
.then(res => {
this.addBtnLoading = false;
this.$refs[formName].resetFields();
this.$message({
type: "success",
message: this.ruleForm.id ? "修改成功" : "添加成功"
});
if (this.ruleForm.id) {
this.$emit("submit", 2);
this.$emit("onBack");
} else {
this.$emit("submit", 1);
}
})
.catch(e => {
this.addBtnLoading = false;
});
}
});
},
onBack() {
this.$refs["ruleForm"].resetFields();
this.$emit("onBack");
}
}
};
</script>

+ 1
- 1
src/views/main/index.vue Voir le fichier

@@ -1,6 +1,6 @@
<template>
<div class="main-index" style="position: relative">
<img style="cursor: auto" src="../../assets/img/home.jpg">
<img style="cursor: auto" src="http://imagesnanjing.taauav.net/temp/2020/5/21/26c2b41f66.tiff">
</div>
</template>


Chargement…
Annuler
Enregistrer