update code

dev_xds
haha 2024-05-06 23:20:47 +08:00
parent 398bf1f8c8
commit 41227985d8
8 changed files with 139 additions and 150 deletions

View File

@ -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) { export function getPrjphotography(id) {
return request({ return request({

View File

@ -1,31 +1,19 @@
<template> <template>
<div class="app-container"> <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 :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="图片路径" prop="imageUrl"> <el-form-item label="项目" prop="projectId">
<el-input v-model="queryParams.imageUrl" placeholder="请输入图片路径" clearable @keyup.enter.native="handleQuery" /> <el-select v-model="queryParams.projectId" filterable placeholder="请选择项目" clearable>
</el-form-item> <el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
<el-form-item label="视频路径" prop="videoUrl"> </el-option>
<el-input v-model="queryParams.videoUrl" placeholder="请输入视频路径" clearable @keyup.enter.native="handleQuery" /> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="视频日期" prop="videoDate"> <el-form-item label="视频日期" prop="videoDate">
<el-date-picker clearable v-model="queryParams.videoDate" type="date" value-format="yyyy-MM-dd" <el-date-picker clearable v-model="queryParams.videoDate" :picker-options="dtOptStart" type="date" value-format="yyyy-MM-dd"
placeholder="请选择视频日期"> placeholder="请选择开始日期">
</el-date-picker> </el-date-picker>
</el-form-item> -
<el-form-item label="状态" prop="state"> <el-date-picker clearable v-model="queryParams.updateDate" :picker-options="dtOptEnd" type="date" value-format="yyyy-MM-dd"
<el-input v-model="queryParams.state" placeholder="请输入状态" clearable @keyup.enter.native="handleQuery" /> placeholder="请选择结束日期">
</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> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -35,27 +23,16 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <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-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['video:prjphotography:remove']">删除</el-button> v-hasPermi="['video:prjphotography:remove']">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5" v-if="1==2"> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<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>
</el-row> </el-row>
<el-table v-loading="loading" :data="prjphotographyList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="prjphotographyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <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"> <el-table-column label="月份" align="center" prop="videoDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.videoDate, '{y}-{m}') }}</span> <span>{{ parseTime(scope.row.videoDate, '{y}-{m}') }}</span>
@ -78,8 +55,6 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <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)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['video:prjphotography:remove']">删除</el-button> v-hasPermi="['video:prjphotography:remove']">删除</el-button>
</template> </template>
@ -89,21 +64,40 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改项目全景对话框 --> <!-- 添加或修改项目延时摄影对话框 -->
<el-dialog :title="title" :visible.sync="open" width="720px" custom-class="prj-photography-drawer-dlg" <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="视频" prop="videoUrl" required> <el-form-item label="项目ID" prop="projectId">
<file-upload ref="fu1" v-model="form.videoUrl" @input="clearForm" :limit="1" :fileSize="100" :fileType="['mp4']"/> <el-input v-model="form.projectId" placeholder="请输入项目ID" />
</el-form-item> </el-form-item>
<el-form-item label="视频月份" prop="videoDate" required> <el-form-item label="图片路径" prop="imageUrl">
<el-date-picker clearable v-model="form.videoDate" type="month" value-format="yyyy-MM-dd" placeholder="请选择视频月份"> <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-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="照片" prop="imageUrls" required> <el-form-item label="状态" prop="state">
<phontographyUpload :videoDate="form.videoDate" ref="phUp1" v-model="form.imageUrls" @input="clearForm" ></phontographyUpload> <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-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -114,18 +108,12 @@
</template> </template>
<script> <script>
import phontographyUpload from './phontographyUpload.vue' import { queryPrjphotography, getPrjphotography, delPrjphotography, addPrjphotography, updatePrjphotography } from "@/api/video/prjphotography";
import { listPrjphotography, getPrjphotography, delPrjphotography, addPrjphotography, updatePrjphotography } from "@/api/video/prjphotography";
export default { export default {
components:{ name: "Prjphotography",
phontographyUpload
},
data() { data() {
let checkImages=this.checkImages;
let checkVideo=this.checkVideo;
return { return {
prj:null,
// //
loading: true, loading: true,
// //
@ -138,18 +126,19 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
prjphotographyList: [], prjphotographyList: [],
// //
title: "", title: "",
// //
open: false, open: false,
projectOptions:[],
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: null,
imageUrl: null, imageUrl: null,
imageUrls:[],
videoUrl: null, videoUrl: null,
videoDate: null, videoDate: null,
state: null, state: null,
@ -157,62 +146,48 @@ export default {
createDate: null, createDate: null,
updateDate: null updateDate: null
}, },
dtOptStart:{
disabledDate:d=>{
return this.disabledDate(d,1)
}
},
dtOptEnd:{
disabledDate:d=>{
return this.disabledDate(d,2)
}
},
// //
form: {}, form: {},
// //
rules: { rules: {
videoUrl:[{ required: true, validator: checkVideo }],
videoDate:[{ required: true, message: '视频月份不能为空' }],
imageUrls:[{ required: true, validator: checkImages }],
} }
}; };
}, },
created() { created() {
this.getList();
window.app99=this this.$api.publics.getMyProjectList({}).then((response) => {
this.projectOptions = response.rows;
});
}, },
methods: { methods: {
clearForm(){ disabledDate(d,t){
this.$refs["form"].clearValidate(); if(t==1){
}, if(!this.queryParams.updateDate){
checkVideo(rule, value, callback){ return false;
if(!value || value.length==0){ }
callback(new Error('视频不能为空')); return +this.$dt(this.queryParams.updateDate).$d<+d;
return; }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() { getList() {
this.loading = true; this.loading = true;
this.queryParams.projectId=this.prj.id; queryPrjphotography(this.queryParams).then(response => {
listPrjphotography(this.queryParams).then(response => { this.prjphotographyList = response.rows;
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;
});
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -226,6 +201,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
projectId: null,
imageUrl: null, imageUrl: null,
videoUrl: null, videoUrl: null,
videoDate: null, videoDate: null,
@ -259,7 +235,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "项目全景 - 新增"; this.title = "添加项目延时摄影";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -267,36 +243,22 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getPrjphotography(id).then(response => { getPrjphotography(id).then(response => {
this.form = response.data; this.form = response.data;
this.form.imageUrls=(this.$tryToJson(this.form.imageUrl,[]));
this.open = true; this.open = true;
this.title = "项目全景 - 修改"; this.title = "修改项目延时摄影";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.imageUrls.forEach(it=>{ if (this.form.id != null) {
it.date=this.$dt(it.date).format("YYYY-MM-DD HH:mm:ss"); updatePrjphotography(this.form).then(response => {
})
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 => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addPrjphotography(postData).then(response => { addPrjphotography(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -308,7 +270,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除项目全景编号为"' + ids + '"的数据项?').then(function () { this.$modal.confirm('是否确认删除项目延时摄影编号为"' + ids + '"的数据项?').then(function () {
return delPrjphotography(ids); return delPrjphotography(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
@ -324,20 +286,3 @@ export default {
} }
}; };
</script> </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>

View File

@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import mainIndex from './index.vue' import mainIndex from './prjphotographyIndex.vue'
export default { export default {
components:{ components:{
mainIndex mainIndex

View File

@ -46,6 +46,15 @@ public class SurProjectPhotographyController extends BaseController
return getDataTable(list); 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);
}
/** /**
* *
*/ */

View File

@ -60,4 +60,6 @@ public interface SurProjectPhotographyMapper
public int deleteSurProjectPhotographyByIds(Long[] ids); public int deleteSurProjectPhotographyByIds(Long[] ids);
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where); public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where);
List<SurProjectPhotography> querySurProjectPhotographyList(SurProjectPhotography where);
} }

View File

@ -60,4 +60,6 @@ public interface ISurProjectPhotographyService
public int deleteSurProjectPhotographyById(Long id); public int deleteSurProjectPhotographyById(Long id);
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where); public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where);
List<SurProjectPhotography> querySurProjectPhotographyList(SurProjectPhotography surProjectPhotography);
} }

View File

@ -97,4 +97,9 @@ public class SurProjectPhotographyServiceImpl implements ISurProjectPhotographyS
public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where) { public List<SurProjectPhotography> selectLastPhotography(SurProjectPhotography where) {
return surProjectPhotographyMapper.selectLastPhotography(where); return surProjectPhotographyMapper.selectLastPhotography(where);
} }
@Override
public List<SurProjectPhotography> querySurProjectPhotographyList(SurProjectPhotography where) {
return surProjectPhotographyMapper.querySurProjectPhotographyList(where);
}
} }

View File

@ -20,7 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSurProjectPhotographyVo"> <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> </sql>
<select id="selectSurProjectPhotographyList" parameterType="SurProjectPhotography" resultMap="SurProjectPhotographyResult"> <select id="selectSurProjectPhotographyList" parameterType="SurProjectPhotography" resultMap="SurProjectPhotographyResult">
@ -38,6 +39,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by video_date order by video_date
</select> </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 &lt;= #{updateDate}</if>
order by video_date
</select>
<select id="selectSurProjectPhotographyById" parameterType="Long" resultMap="SurProjectPhotographyResult"> <select id="selectSurProjectPhotographyById" parameterType="Long" resultMap="SurProjectPhotographyResult">
<include refid="selectSurProjectPhotographyVo"/> <include refid="selectSurProjectPhotographyVo"/>
where id = #{id} where id = #{id}