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

tui

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