update code
parent
398bf1f8c8
commit
41227985d8
|
@ -9,6 +9,15 @@ export function listPrjphotography(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询项目全景列表
|
||||
export function queryPrjphotography(query) {
|
||||
return request({
|
||||
url: '/video/prjphotography/query',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询项目全景详细
|
||||
export function getPrjphotography(id) {
|
||||
return request({
|
||||
|
|
|
@ -1,31 +1,19 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form v-if="1==2" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="图片路径" prop="imageUrl">
|
||||
<el-input v-model="queryParams.imageUrl" placeholder="请输入图片路径" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频路径" prop="videoUrl">
|
||||
<el-input v-model="queryParams.videoUrl" placeholder="请输入视频路径" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目" prop="projectId">
|
||||
<el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable>
|
||||
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频日期" prop="videoDate">
|
||||
<el-date-picker clearable v-model="queryParams.videoDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择视频日期">
|
||||
<el-date-picker clearable v-model="queryParams.videoDate" :picker-options="dtOptStart" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input v-model="queryParams.state" placeholder="请输入状态" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="queryParams.isDel" placeholder="请输入${comment}" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="createDate">
|
||||
<el-date-picker clearable v-model="queryParams.createDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择${comment}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="updateDate">
|
||||
<el-date-picker clearable v-model="queryParams.updateDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择${comment}">
|
||||
-
|
||||
<el-date-picker clearable v-model="queryParams.updateDate" :picker-options="dtOptEnd" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
@ -35,27 +23,16 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['video:prjphotography:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['video:prjphotography:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['video:prjphotography:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="1==2">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['video:prjphotography:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :search="false" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="prjphotographyList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目" align="left" prop="remark"/>
|
||||
<el-table-column label="月份" align="center" prop="videoDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.videoDate, '{y}-{m}') }}</span>
|
||||
|
@ -78,8 +55,6 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['video:prjphotography:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['video:prjphotography:remove']">删除</el-button>
|
||||
</template>
|
||||
|
@ -89,21 +64,40 @@
|
|||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改项目全景对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="720px" custom-class="prj-photography-drawer-dlg"
|
||||
append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<!-- 添加或修改项目延时摄影对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="视频" prop="videoUrl" required>
|
||||
<file-upload ref="fu1" v-model="form.videoUrl" @input="clearForm" :limit="1" :fileSize="100" :fileType="['mp4']"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频月份" prop="videoDate" required>
|
||||
<el-date-picker clearable v-model="form.videoDate" type="month" value-format="yyyy-MM-dd" placeholder="请选择视频月份">
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图片路径" prop="imageUrl">
|
||||
<el-input v-model="form.imageUrl" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频路径" prop="videoUrl">
|
||||
<el-input v-model="form.videoUrl" placeholder="请输入视频路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频日期" prop="videoDate">
|
||||
<el-date-picker clearable v-model="form.videoDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择视频日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片" prop="imageUrls" required>
|
||||
<phontographyUpload :videoDate="form.videoDate" ref="phUp1" v-model="form.imageUrls" @input="clearForm" ></phontographyUpload>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="createDate">
|
||||
<el-date-picker clearable v-model="form.createDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="updateDate">
|
||||
<el-date-picker clearable v-model="form.updateDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -114,18 +108,12 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import phontographyUpload from './phontographyUpload.vue'
|
||||
import { listPrjphotography, getPrjphotography, delPrjphotography, addPrjphotography, updatePrjphotography } from "@/api/video/prjphotography";
|
||||
import { queryPrjphotography, getPrjphotography, delPrjphotography, addPrjphotography, updatePrjphotography } from "@/api/video/prjphotography";
|
||||
|
||||
export default {
|
||||
components:{
|
||||
phontographyUpload
|
||||
},
|
||||
name: "Prjphotography",
|
||||
data() {
|
||||
let checkImages=this.checkImages;
|
||||
let checkVideo=this.checkVideo;
|
||||
return {
|
||||
prj:null,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -138,18 +126,19 @@ export default {
|
|||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 项目全景表格数据
|
||||
// 项目延时摄影表格数据
|
||||
prjphotographyList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
projectOptions:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
imageUrl: null,
|
||||
imageUrls:[],
|
||||
videoUrl: null,
|
||||
videoDate: null,
|
||||
state: null,
|
||||
|
@ -157,62 +146,48 @@ export default {
|
|||
createDate: null,
|
||||
updateDate: null
|
||||
},
|
||||
dtOptStart:{
|
||||
disabledDate:d=>{
|
||||
return this.disabledDate(d,1)
|
||||
}
|
||||
},
|
||||
dtOptEnd:{
|
||||
disabledDate:d=>{
|
||||
return this.disabledDate(d,2)
|
||||
}
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
videoUrl:[{ required: true, validator: checkVideo }],
|
||||
videoDate:[{ required: true, message: '视频月份不能为空' }],
|
||||
imageUrls:[{ required: true, validator: checkImages }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
window.app99=this
|
||||
this.getList();
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
clearForm(){
|
||||
this.$refs["form"].clearValidate();
|
||||
},
|
||||
checkVideo(rule, value, callback){
|
||||
if(!value || value.length==0){
|
||||
callback(new Error('视频不能为空'));
|
||||
return;
|
||||
disabledDate(d,t){
|
||||
if(t==1){
|
||||
if(!this.queryParams.updateDate){
|
||||
return false;
|
||||
}
|
||||
return +this.$dt(this.queryParams.updateDate).$d<+d;
|
||||
}else{
|
||||
if(!this.queryParams.videoDate){
|
||||
return false;
|
||||
}
|
||||
return +this.$dt(this.queryParams.videoDate).$d>+d;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
checkImages(rule, value, callback){
|
||||
if(!value){
|
||||
callback(new Error('照片不能为空'));
|
||||
return;
|
||||
}
|
||||
if(value.filter(d=>!d.date).length>0){
|
||||
callback(new Error("照片日期不能为空"));
|
||||
return;
|
||||
}
|
||||
if(value.filter(d=>!d.url).length>0){
|
||||
callback(new Error("照片不能为空"));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
init(prj) {
|
||||
this.prj=prj;
|
||||
this.getList();
|
||||
},
|
||||
/** 查询项目全景列表 */
|
||||
/** 查询项目延时摄影列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.projectId=this.prj.id;
|
||||
listPrjphotography(this.queryParams).then(response => {
|
||||
this.prjphotographyList = (response.rows||[]).map(it=>{
|
||||
let tmps=it.imageUrl?this.$tryToJson(it.imageUrl,[]):[];
|
||||
it.imageUrls=tmps;
|
||||
it.images=tmps.map(item=>item.url);
|
||||
it.image=it.images.length>0?it.images[0]:'';
|
||||
return it;
|
||||
});
|
||||
queryPrjphotography(this.queryParams).then(response => {
|
||||
this.prjphotographyList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
@ -226,6 +201,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
projectId: null,
|
||||
imageUrl: null,
|
||||
videoUrl: null,
|
||||
videoDate: null,
|
||||
|
@ -259,7 +235,7 @@ export default {
|
|||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "项目全景 - 新增";
|
||||
this.title = "添加项目延时摄影";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
@ -267,36 +243,22 @@ export default {
|
|||
const id = row.id || this.ids
|
||||
getPrjphotography(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.imageUrls=(this.$tryToJson(this.form.imageUrl,[]));
|
||||
this.open = true;
|
||||
this.title = "项目全景 - 修改";
|
||||
this.title = "修改项目延时摄影";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.imageUrls.forEach(it=>{
|
||||
it.date=this.$dt(it.date).format("YYYY-MM-DD HH:mm:ss");
|
||||
})
|
||||
let postData={
|
||||
imageUrl:JSON.stringify(this.form.imageUrls),
|
||||
isDel:0,
|
||||
remark:'',
|
||||
projectId:this.prj.id,
|
||||
id:this.form.id,
|
||||
state:0,
|
||||
videoDate:this.form.videoDate,
|
||||
videoUrl:this.form.videoUrl[0].url
|
||||
}
|
||||
if (this.form.id) {
|
||||
updatePrjphotography(postData).then(response => {
|
||||
if (this.form.id != null) {
|
||||
updatePrjphotography(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPrjphotography(postData).then(response => {
|
||||
addPrjphotography(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
@ -308,7 +270,7 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除项目全景编号为"' + ids + '"的数据项?').then(function () {
|
||||
this.$modal.confirm('是否确认删除项目延时摄影编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delPrjphotography(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
|
@ -324,20 +286,3 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.prj-photography-drawer-dlg{
|
||||
.el-dialog__body{
|
||||
padding:12px 20px;
|
||||
.ele-upload-list__item-content-action{
|
||||
min-width: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
.upload-file.up-file-cnt-1{
|
||||
.upload-file-uploader{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
|
@ -12,7 +12,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import mainIndex from './index.vue'
|
||||
import mainIndex from './prjphotographyIndex.vue'
|
||||
export default {
|
||||
components:{
|
||||
mainIndex
|
||||
|
|
|
@ -46,6 +46,15 @@ public class SurProjectPhotographyController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('video:prjphotography:list')")
|
||||
@GetMapping("/query")
|
||||
public TableDataInfo query(SurProjectPhotography surProjectPhotography)
|
||||
{
|
||||
startPage();
|
||||
List<SurProjectPhotography> list = surProjectPhotographyService.querySurProjectPhotographyList(surProjectPhotography);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目项目全景列表
|
||||
*/
|
||||
|
|
|
@ -60,4 +60,6 @@ public interface SurProjectPhotographyMapper
|
|||
public int deleteSurProjectPhotographyByIds(Long[] ids);
|
||||
|
||||
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where);
|
||||
|
||||
List<SurProjectPhotography> querySurProjectPhotographyList(SurProjectPhotography where);
|
||||
}
|
||||
|
|
|
@ -60,4 +60,6 @@ public interface ISurProjectPhotographyService
|
|||
public int deleteSurProjectPhotographyById(Long id);
|
||||
|
||||
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where);
|
||||
|
||||
List<SurProjectPhotography> querySurProjectPhotographyList(SurProjectPhotography surProjectPhotography);
|
||||
}
|
||||
|
|
|
@ -97,4 +97,9 @@ public class SurProjectPhotographyServiceImpl implements ISurProjectPhotographyS
|
|||
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where) {
|
||||
return surProjectPhotographyMapper.selectLastPhotography(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectPhotography> querySurProjectPhotographyList(SurProjectPhotography where) {
|
||||
return surProjectPhotographyMapper.querySurProjectPhotographyList(where);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectPhotographyVo">
|
||||
select id, project_id, image_url, video_url, video_date, state, remark, is_del, create_by, create_date, update_by, update_date from sur_project_photography
|
||||
select id, project_id, image_url, video_url, video_date, state, remark, is_del, create_by, create_date, update_by, update_date
|
||||
from sur_project_photography
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectPhotographyList" parameterType="SurProjectPhotography" resultMap="SurProjectPhotographyResult">
|
||||
|
@ -38,6 +39,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by video_date
|
||||
</select>
|
||||
|
||||
<select id="querySurProjectPhotographyList" parameterType="SurProjectPhotography" resultMap="SurProjectPhotographyResult">
|
||||
SELECT a.id, a.project_id, a.image_url, a.video_url, a.video_date, a.state, a.is_del, a.create_by, a.create_date, a.update_by, a.update_date,sp.projectName remark
|
||||
FROM sur_project_photography a,sur_project sp
|
||||
WHERE a.project_id=sp.id
|
||||
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if>
|
||||
<if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
|
||||
<if test="videoDate != null "> and video_date >= #{videoDate}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||
<if test="updateDate != null "> and video_date <= #{updateDate}</if>
|
||||
order by video_date
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectPhotographyById" parameterType="Long" resultMap="SurProjectPhotographyResult">
|
||||
<include refid="selectSurProjectPhotographyVo"/>
|
||||
where id = #{id}
|
||||
|
|
Loading…
Reference in New Issue