Commit 11b25d03 authored by 姬鋆屾's avatar 姬鋆屾

tui

parent 04c44aa9
#开发环境
NODE_ENV = "development"
VUE_APP_API_BASE_URL= http://112.19.80.237:11039
VUE_APP_API_ZWFW_URL= http://112.19.80.237:11031
# VUE_APP_API_BASE_URL= http://192.168.0.98:11039
\ No newline at end of file
......@@ -3,7 +3,7 @@ NODE_ENV = production
# 地址
VUE_APP_API_BASE_URL =http://112.19.80.237:11039
VUE_APP_API_ZWFW_URL= http://112.19.80.237:11031
# websocket地址
VUE_APP_WEBSOCKET_API =
......
......@@ -480,7 +480,7 @@ export default {
// }
// style="width: 100px"
// ></el-image>
<filepReview src={val}/>
<filepReview src={val} />
);
} else {
return <el-link type="primary">{val}</el-link>;
......
// 全局组件注册
import LayoutTable from '@/components/Table.vue';
import LayoutForm from '@/components/Form.vue';
import TableButtons from '@/components/tools/TableButtons';
import FormButtons from '@/components/tools/FormButtons';
import Breadcrumb from '@/components/Breadcrumb';
import MySwitch from '@/components/Switch';
import DeviceSwitch from '@/components/DeviceSwitch';
import Confirm from '@/components/Confirm';
import FormField from '@/components/FormField';
import Upload from '@/components/Upload';
import ImageUpload from '@/components/ImageUpload';
import ImagePreview from '@/components/ImagePreview';
import FileUpload from '@/components/FileUpload';
import Editor from '@/components/Editor';
import Map from '@/components/Map';
import MapDetail from '@/components/MapDetail';
import filepReview from '@/components/filepReview';
import LayoutTable from "@/components/Table.vue";
import LayoutForm from "@/components/Form.vue";
import TableButtons from "@/components/tools/TableButtons";
import FormButtons from "@/components/tools/FormButtons";
import Breadcrumb from "@/components/Breadcrumb";
import MySwitch from "@/components/Switch";
import DeviceSwitch from "@/components/DeviceSwitch";
import Confirm from "@/components/Confirm";
import FormField from "@/components/FormField";
import Upload from "@/components/Upload";
import ImageUpload from "@/components/ImageUpload";
import ImagePreview from "@/components/ImagePreview";
import FileUpload from "@/components/FileUpload";
import Editor from "@/components/Editor";
import Map from "@/components/Map";
import MapDetail from "@/components/MapDetail";
import filepReview from "@/components/filepReview";
import buttonReview from "@/components/buttonReview";
const Prototype = function() {};
Prototype.install = (Vue, options) => {
Vue.component('LayoutTable', LayoutTable) // 表格
Vue.component('LayoutForm', LayoutForm) // 表单
Vue.component('TableButtons', TableButtons) // 表格内的编辑和删除
Vue.component('FormButtons', FormButtons) // 表单内的保存和取消
Vue.component('Breadcrumb', Breadcrumb) // 面包屑导航
Vue.component('Field', FormField) // 表单字段
Vue.component('MySwitch', MySwitch) // 拨动开关
Vue.component('DeviceSwitch', DeviceSwitch) // 拨动开关
Vue.component('Confirm', Confirm) // 局部确认窗口
Vue.component('Upload', Upload) // 文件上传
Vue.component('ImageUpload', ImageUpload) // 图片上传
Vue.component('ImagePreview', ImagePreview) // 图片预览
Vue.component('FileUpload', FileUpload) // 文件上传
Vue.component('Editor', Editor) // 富文本
Vue.component('Map', Map) // 地图
Vue.component('MapDetail', MapDetail) // 地图
Vue.component('filepReview', filepReview) // 图片文件预览
}
Vue.component("LayoutTable", LayoutTable); // 表格
Vue.component("LayoutForm", LayoutForm); // 表单
Vue.component("TableButtons", TableButtons); // 表格内的编辑和删除
Vue.component("FormButtons", FormButtons); // 表单内的保存和取消
Vue.component("Breadcrumb", Breadcrumb); // 面包屑导航
Vue.component("Field", FormField); // 表单字段
Vue.component("MySwitch", MySwitch); // 拨动开关
Vue.component("DeviceSwitch", DeviceSwitch); // 拨动开关
Vue.component("Confirm", Confirm); // 局部确认窗口
Vue.component("Upload", Upload); // 文件上传
Vue.component("ImageUpload", ImageUpload); // 图片上传
Vue.component("ImagePreview", ImagePreview); // 图片预览
Vue.component("FileUpload", FileUpload); // 文件上传
Vue.component("Editor", Editor); // 富文本
Vue.component("Map", Map); // 地图
Vue.component("MapDetail", MapDetail); // 地图
Vue.component("filepReview", filepReview); // 图片文件预览
Vue.component("buttonReview", buttonReview); // 点击按钮图片文件预览
};
export default Prototype;
<template>
<div class="img-flex">
<el-image
:preview-src-list="fileList"
:src="require('../assets/images/picture.png')"
>
</el-image>
<!-- <el-image
:preview-src-list="[urlVal(item)]"
v-for="item in fileList"
:key="item"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" @click="handleClick"></i>
</div>
</el-image> -->
</div>
</template>
<script>
const baseUrl = process.env.VUE_APP_API_BASE_URL + "/";
const zwfwUrl = process.env.VUE_APP_API_ZWFW_URL + "/";
export default {
props: ["src", "row", "fileList"],
data() {
return {
// fileList: [],
};
},
created() {},
computed: {},
methods: {
// handleClick() {
// this.fileList = [];
// if (this.row.snapPath && this.row.filePaths) {
// this.src = this.row.snapPath + this.row.filePaths;
// } else {
// if (this.row.snapPath) {
// this.src = this.row.snapPath;
// } else {
// this.src = this.row.filePaths;
// }
// }
// this.fileList = this.src ? this.src.split(",") : [];
// this.fileList &&
// this.fileList.forEach((val) => {
// val.indexOf("zwfw_api_xnjc") == -1
// ? val.indexOf("http") == -1
// ? (val = baseUrl + val)
// : (val = val)
// : (val = zwfwUrl + val);
// });
// },
urlVal(val) {
return val.indexOf("zwfw_api_xnjc") == -1
? val.indexOf("http") == -1
? baseUrl + val
: val
: zwfwUrl + val;
},
},
};
</script>
<style lang="less" scoped>
.img-flex {
overflow: hidden;
display: inline-block;
vertical-align: middle;
.el-image {
width: 50px;
float: left;
border: 1px solid #ddd;
margin: 2px;
}
}
</style>
<template>
<div class="img-flex">
<el-image
:src="urlVal(item)"
:preview-src-list="[urlVal(item)]" alt="" v-for="item in fileList" :key="item"/>
</div>
<div class="img-flex">
<el-image
:src="urlVal(item)"
:preview-src-list="[urlVal(item)]"
alt=""
v-for="item in fileList"
:key="item"
/>
</div>
</template>
<script>
const baseUrl = process.env.VUE_APP_API_BASE_URL + "/";
const zwfwUrl = process.env.VUE_APP_API_ZWFW_URL + "/";
export default {
props:['src'],
data() {
return {}
props: ["src"],
data() {
return {};
},
created() {},
computed: {
fileList: function(v) {
return this.src ? this.src.split(",") : [];
},
created() {
console.log(this.src)
},
methods: {
urlVal(val) {
return val.indexOf("zwfw_api_xnjc") == -1
? val.indexOf("http") == -1
? (val = baseUrl + val)
: (val = val)
: (val = zwfwUrl + val);
},
computed: {
fileList:function(v){
return this.src?this.src.split(","):[]
}
},
methods: {
urlVal(val){
console.log(val,"2222")
return val.indexOf("http") == -1 ? baseUrl + val : val
}
},
}
},
};
</script>
<style lang="less" scoped>
.img-flex{
overflow: hidden;
display: inline-block;
vertical-align: middle;
.el-image{
width: 50px;
float: left;
border:1px solid #ddd;
margin: 2px;
}
.img-flex {
overflow: hidden;
display: inline-block;
vertical-align: middle;
.el-image {
width: 50px;
float: left;
border: 1px solid #ddd;
margin: 2px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -64,7 +64,8 @@
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
import { downloadFile } from "@/assets/utils/index";
const baseUrl = process.env.VUE_APP_API_BASE_URL + "/";
const zwfwUrl = process.env.VUE_APP_API_ZWFW_URL + "/";
export default {
name: "CheckEffectRecordList",
components: {
......@@ -240,22 +241,45 @@ export default {
label: "图片凭证",
width: 150,
formatter: (row) => {
row.snapPath && row.snapPath !== ""
? (row.filePaths =
row.filePaths && row.filePaths !== ""
? row.filePaths + "," + row.snapPath
: row.snapPath)
: (row.filePaths = row.filePaths);
return (
// <el-image
// src={val.indexOf("http") == -1 ? baseUrl + val : val}
// preview-src-list={
// val.indexOf("http") == -1 ? [baseUrl + val] : [val]
// }
// style="width: 100px"
// ></el-image>
<filepReview src={row.filePaths} />
let src = "";
if (row.snapPath && row.filePaths) {
src = row.snapPath + row.filePaths;
} else {
if (row.snapPath) {
src = row.snapPath;
} else {
src = row.filePaths;
}
}
row.fileList = src ? src.split(",") : [];
row.fileList &&
row.fileList.forEach((val) => {
val.indexOf("zwfw_api_xnjc") == -1
? val.indexOf("http") == -1
? (val = baseUrl + val)
: (val = val)
: (val = zwfwUrl + val);
});
return row.snapPath || row.filePaths ? (
<buttonReview row={row} fileList={row.fileList} />
) : (
"--"
);
// row.snapPath && row.snapPath !== ""
// ? row.filePaths && row.filePaths !== ""
// ? (row.filePaths = row.filePaths + "," + row.snapPath)
// : (row.filePaths = row.snapPath)
// : (row.filePaths = row.filePaths);
// return (
// // <el-image
// // src={val.indexOf("http") == -1 ? baseUrl + val : val}
// // preview-src-list={
// // val.indexOf("http") == -1 ? [baseUrl + val] : [val]
// // }
// // style="width: 100px"
// // ></el-image>
// <filepReview src={row.filePaths} />
// );
},
},
......
......@@ -23,6 +23,12 @@ module.exports = {
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
},
'/zwfw_api_xnjc': {
target: 'http://112.19.80.237:11031',
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
}
}
}
......
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