Browse Source

dd

shibei_master
13176889840 3 years ago
parent
commit
71b59a9191
  1. 8
      src/assets/scss/main-shuju.scss
  2. 44
      src/router/index.js
  3. 142
      src/views/main-shuju/main-content.vue
  4. 18
      src/views/modules/base/community/communityTable.vue
  5. 244
      src/views/modules/communityService/dqfwzx/index.vue
  6. 6
      src/views/modules/secretaryLog/difficulty/difficultyForm.vue
  7. 6
      src/views/modules/secretaryLog/humanisticCare/careForm.vue
  8. 7
      src/views/modules/secretaryLog/workLog/form.vue

8
src/assets/scss/main-shuju.scss

@ -5,6 +5,14 @@
body { body {
} }
.m-iframe {
position: relative;
width: 100vw;
height: calc(100vh - 55px);
margin: -10px;
z-index: 100;
}
/* Reset element-ui /* Reset element-ui
------------------------------ */ ------------------------------ */
.g-bd { .g-bd {

44
src/router/index.js

@ -319,11 +319,13 @@ router.beforeEach((to, from, next) => {
// url: "visual/basicinfo/basicInfoMain", // url: "visual/basicinfo/basicInfoMain",
children: [ children: [
{ {
url: "/visual/ai/index", url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/monitor-panel",
name: "AI安防", // url: "/visual/ai/index",
name: "视频监控",
id: "5feawfwa111111efwa57", id: "5feawfwa111111efwa57",
}, },
{ /*{
// url: "http://www.baidu.com",
url: "/visual/ai/renliu", url: "/visual/ai/renliu",
name: "人流数据", name: "人流数据",
id: "5fwaefwae222112fawef58", id: "5fwaefwae222112fawef58",
@ -342,10 +344,11 @@ router.beforeEach((to, from, next) => {
url: "/visual/ai/gongdan", url: "/visual/ai/gongdan",
name: "工单数据", name: "工单数据",
id: "fewafwafewaefddd", id: "fewafwafewaefddd",
}, },*/
{ {
url: "/visual/ai/yujing", // url: "/visual/ai/yujing",
name: "预警事件", url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/data-analysis",
name: "预警分析",
id: "545345fdsfs", id: "545345fdsfs",
}, },
], ],
@ -500,12 +503,33 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
eval(s2) eval(s2)
); // URL支持{{ window.xxx }}占位符变量 ); // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) { if (isURL(URL)) {
route["path"] = route["name"] = `i-${menuList[i].id}`; if (menuList[i].children && menuList[i].children.length >= 1) {
route["meta"]["iframeURL"] = URL; let item = menuList[i].children.find(
(subMenu) => subMenu.url == menuList[i].url
);
if (item) {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["redirect"] = `i-${item.id}`;
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else {
route["path"] = route["name"] = `i-${menuList[i].id}`;
route["meta"]["iframeURL"] = URL;
}
} else { } else {
URL = URL.replace(/^\//, "").replace(/_/g, "-"); URL = URL.replace(/^\//, "").replace(/_/g, "-");
route["path"] = route["name"] = URL.replace(/\//g, "-"); if (URL.startsWith("unopen")) {
route["component"] = () => import(`@/views/modules/${URL}`); route["path"] = route["name"] = URL.replace(/\//g, "-");
route["component"] = () => import(`@/views/modules/unopen`);
} else if (menuList[i].children && menuList[i].children.length >= 1) {
route["path"] = route["name"] = URL;
route["redirect"] = URL.replace(/\//g, "-");
} else {
route["path"] = route["name"] = URL.replace(/\//g, "-");
route["component"] = () => import(`@/views/modules/${URL}`);
}
} }
routes.push(route); routes.push(route);
} }

142
src/views/main-shuju/main-content.vue

@ -1,98 +1,126 @@
<template> <template>
<main :class="['aui-content']"> <main :class="['aui-content']">
<!-- 其他方式, 展示内容 --> <!-- tab展示内容 -->
<template> <template>
<keep-alive> <template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view /> <iframe
:src="
$router.currentRoute.meta.iframeURL +
'?token=' +
token +
'&customerId=' +
customerId
"
ref="iframe"
class="m-iframe"
id="iframe"
width="100%"
height="100%"
frameborder="0"
scrolling="yes"
/>
</template>
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view @changeCustomerName="changeCustomerName" />
</keep-alive> </keep-alive>
</template> </template>
</main> </main>
</template> </template>
<script> <script>
import { isURL } from '@/utils/validate' import { isURL } from "@/utils/validate";
import Cookie from 'js-cookie' import Cookie from "js-cookie";
export default { export default {
data () { data() {
return { return {
iframeUrl: '', iframeUrl: "",
token: '', token: "",
customerId: '' customerId: "",
} };
}, },
created () { watch: {
// this.$nextTick(() => { // "$router.currentRoute.name": function () {
// this.sendMessage() // console.log($router.currentRoute);
// }) // },
this.token = localStorage.getItem('token') },
this.customerId = localStorage.getItem('customerId') created() {
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
}, },
methods: { methods: {
changeCustomerName (customerName) { changeCustomerName(customerName) {
this.$emit('changeCustomerName', customerName) this.$emit("changeCustomerName", customerName);
}, },
// tabs, iframe // tabs, iframe
tabIsIframe (url) { tabIsIframe(url) {
// this.appendIframe(url) // this.appendIframe(url)
this.iframeUrl = url + '?token=' + localStorage.getItem('token') + '&customerId=' + localStorage.getItem('customerId') // this.iframeUrl =
return isURL(url) // url +
// "?token=" +
// localStorage.getItem("token") +
// "&customerId=" +
// localStorage.getItem("customerId");
return isURL(url);
}, },
// tabs, tab // tabs, tab
tabSelectedHandle (tab) { tabSelectedHandle(tab) {
tab = this.$store.state.contentTabs.filter(item => item.name === tab.name)[0] tab = this.$store.state.contentTabs.filter(
(item) => item.name === tab.name
)[0];
if (tab) { if (tab) {
this.$router.push({ this.$router.push({
'name': tab.name, name: tab.name,
'params': { ...tab.params }, params: { ...tab.params },
'query': { ...tab.query } query: { ...tab.query },
}) });
} }
}, },
// tabs, tab // tabs, tab
tabRemoveHandle (tabName) { tabRemoveHandle(tabName) {
if (tabName === 'home') { if (tabName === "home") {
return false return false;
} }
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName) this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
);
if (this.$store.state.contentTabs.length <= 0) { if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home' this.$store.state.sidebarMenuActiveName =
return false this.$store.state.contentTabsActiveName = "home";
return false;
} }
// tab // tab
if (tabName === this.$store.state.contentTabsActiveName) { if (tabName === this.$store.state.contentTabsActiveName) {
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1] let tab =
this.$store.state.contentTabs[
this.$store.state.contentTabs.length - 1
];
this.$router.push({ this.$router.push({
name: tab.name, name: tab.name,
params: { ...tab.params }, params: { ...tab.params },
query: { ...tab.query } query: { ...tab.query },
}) });
} }
}, },
// tabs, // tabs,
tabsCloseOtherHandle () { tabsCloseOtherHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => { this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
return item.name === 'home' || item.name === this.$store.state.contentTabsActiveName (item) => {
}) return (
item.name === "home" ||
item.name === this.$store.state.contentTabsActiveName
);
}
);
}, },
// tabs, // tabs,
tabsCloseAllHandle () { tabsCloseAllHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home') this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
this.$router.push({ name: 'home' }) (item) => item.name === "home"
);
this.$router.push({ name: "home" });
}, },
sendMessage () { },
// const iframe = this.$refs.iframes.contentWindow };
const iframe = document.getElementsByClassName('iframes')[0].contentWindow
console.log('iframe', iframe)
// iframe.postMessage({
// token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId')
// }, '*')
iframe.postMessage({ name: 'lalalal' }, '*')
},
}
}
</script> </script>
<style lang="scss" src="@/assets/scss/main-shuju.scss" scoped></style> <style lang="scss" src="@/assets/scss/main-shuju.scss" scoped></style>

18
src/views/modules/base/community/communityTable.vue

@ -103,7 +103,8 @@
class="diy-button--reset" class="diy-button--reset"
size="small" size="small"
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
<el-button v-if="agencyObj.level == 'community'" style="margin-left:10px" <el-button v-if="agencyObj.level == 'community'"
style="margin-left:10px"
class="diy-button--qrcode" class="diy-button--qrcode"
size="small" size="small"
@click="handleDownQr(agencyObj, 'community')">社区二维码</el-button> @click="handleDownQr(agencyObj, 'community')">社区二维码</el-button>
@ -173,8 +174,7 @@
class="div-table-button--qr" class="div-table-button--qr"
size="small" size="small"
@click="handleDownQr(scope.row, 'neighborHood')">二维码</el-button> --> @click="handleDownQr(scope.row, 'neighborHood')">二维码</el-button> -->
<el-button <el-button type="text"
type="text"
class="div-table-button--detail" class="div-table-button--detail"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
@ -547,7 +547,7 @@ export default {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
async handleDownQr(row, type) { async handleDownQr (row, type) {
// const url = window.SITE_CONFIG['apiURL'] + `/gov/org/icneighborhood/createQrCode/${row.neighborHoodId}` // const url = window.SITE_CONFIG['apiURL'] + `/gov/org/icneighborhood/createQrCode/${row.neighborHoodId}`
const url = '/gov/org/agency/create-qrcode' const url = '/gov/org/agency/create-qrcode'
const _id = type == 'community' ? row.id : row.neighborHoodId const _id = type == 'community' ? row.id : row.neighborHoodId
@ -563,11 +563,11 @@ export default {
}).then(res => { }).then(res => {
console.log('res----1r', res) console.log('res----1r', res)
if (res.headers["content-disposition"]) { if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName) console.log('filename', fileName)
this.download(res.data, fileName) //blob this.download(res.data, fileName) //blob
} else this.$message.error('下载失败') } else this.$message.error('下载失败')
// this.download(res.data, '1.png') // this.download(res.data, '1.png')
}) })
}, },
// //

244
src/views/modules/communityService/dqfwzx/index.vue

@ -2,26 +2,25 @@
<div> <div>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button class="diy-button--add" size="small" @click="handleAdd" <el-button class="diy-button--add"
>新增</el-button size="small"
> @click="handleAdd">新增</el-button>
</div> </div>
<div class="m-center" v-if="tableData.length > 0"> <div class="m-center"
v-if="tableData.length > 0">
<div class="center-left"> <div class="center-left">
<div class="list"> <div class="list">
<div <div @click="currentIndex = index"
@click="currentIndex = index" class="item"
class="item" :class="{ 'z-on': currentIndex == index }"
:class="{ 'z-on': currentIndex == index }" :key="'ct' + index"
:key="'ct' + index" v-for="(item, index) in tableData">
v-for="(item, index) in tableData" <div class="item-btn"
> v-if="currentIndex == index"
<div class="item-btns"> @click="handleEdit">
<a v-if="currentIndex == index" @click="handleEdit">修改</a> 修改
<a v-if="currentIndex == index" @click="handleDel">删除</a>
</div> </div>
<div class="item-name">{{ item.centerName }}</div> <div class="item-name">{{ item.centerName }}</div>
<div class="item-prop"> <div class="item-prop">
<div class="prop-field">社区地址</div> <div class="prop-field">社区地址</div>
@ -49,114 +48,95 @@
> >
</div> --> </div> -->
<div id="centerIndexApp" class="div_map"></div> <div id="centerIndexApp"
class="div_map"></div>
<el-table
:data="tableData[currentIndex].matterList" <el-table :data="tableData[currentIndex].matterList"
border border
style="width: 100%" style="width: 100%"
class="resi-table" class="resi-table"
:max-height="maxTableHeight" :max-height="maxTableHeight">
> <el-table-column label="序号"
<el-table-column type="index"
label="序号" align="center"
type="index" width="50" />
align="center" <el-table-column prop="matterName"
width="50" label="事项名称">
/>
<el-table-column prop="matterName" label="事项名称">
</el-table-column> </el-table-column>
<el-table-column prop="allowTime" label="可预约时间 "> <el-table-column prop="allowTime"
label="可预约时间 ">
</el-table-column> </el-table-column>
<el-table-column <el-table-column fixed="right"
fixed="right" label="操作"
label="操作" align="center"
align="center" width="120">
width="120"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button @click="handleOrder(scope.$index)"
@click="handleOrder(scope.$index)" type="text"
type="text" size="small"
size="small" style="color: #1c6afd">预约</el-button>
style="color: #1c6afd"
>预约</el-button <el-button @click="handleOrderList(scope.$index)"
> type="text"
size="small"
<el-button style="margin-right: 10px; color: #1c6afd">预约记录</el-button>
@click="handleOrderList(scope.$index)"
type="text"
size="small"
style="margin-right: 10px; color: #1c6afd"
>预约记录</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<div class="m-hint" v-else> <div class="m-hint"
<el-empty description="暂无内容" :image-size="200"></el-empty> v-else>
<el-empty description="暂无内容"
:image-size="200"></el-empty>
</div> </div>
</el-card> </el-card>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog <el-dialog :visible.sync="formShow"
:visible.sync="formShow" :close-on-click-modal="false"
:close-on-click-modal="false" :close-on-press-escape="false"
:close-on-press-escape="false" :title="formTitle"
:title="formTitle" width="850px"
width="850px" top="5vh"
top="5vh" class="dialog-h"
class="dialog-h" @closed="handleClose">
@closed="handleClose" <edit-form ref="eleEditForm"
> @dialogCancle="handleClose"
<edit-form @dialogOk="handleEditSuccess"></edit-form>
ref="eleEditForm"
@dialogCancle="handleClose"
@dialogOk="handleEditSuccess"
></edit-form>
</el-dialog> </el-dialog>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog <el-dialog :visible.sync="form2Show"
:visible.sync="form2Show" :close-on-click-modal="false"
:close-on-click-modal="false" :close-on-press-escape="false"
:close-on-press-escape="false" title="预约"
title="预约" width="850px"
width="850px" top="5vh"
top="5vh" class="dialog-h"
class="dialog-h" @closed="handleCloseForm2">
@closed="handleCloseForm2" <order-form ref="eleOrderForm"
> @dialogCancle="handleCloseForm2"
<order-form @dialogOk="handleOrderSuccess"></order-form>
ref="eleOrderForm"
@dialogCancle="handleCloseForm2"
@dialogOk="handleOrderSuccess"
></order-form>
</el-dialog> </el-dialog>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog <el-dialog :visible.sync="orderListShow"
:visible.sync="orderListShow" :close-on-click-modal="false"
:close-on-click-modal="false" :close-on-press-escape="false"
:close-on-press-escape="false" title="预约记录"
title="预约记录" width="850px"
width="850px" top="5vh"
top="5vh" class="dialog-h"
class="dialog-h" @closed="handleCloseOrderList">
@closed="handleCloseOrderList" <order-list ref="eleOrderList"
> @dialogCancle="handleCloseOrderList"></order-list>
<order-list
ref="eleOrderList"
@dialogCancle="handleCloseOrderList"
></order-list>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { requestPost } from "@/js/dai/request2"; import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import editForm from "./cpts/edit"; import editForm from "./cpts/edit";
@ -171,7 +151,7 @@ let loading; // 加载动画
export default { export default {
components: { editForm, orderForm, orderList }, components: { editForm, orderForm, orderList },
data() { data () {
return { return {
openSearch: false, openSearch: false,
@ -188,23 +168,23 @@ export default {
}; };
}, },
computed: { computed: {
maxTableHeight() { maxTableHeight () {
return this.clientHeight - 520; return this.clientHeight - 520;
}, },
...mapGetters(["clientHeight"]), ...mapGetters(["clientHeight"]),
}, },
watch: { watch: {
currentIndex() { currentIndex () {
this.setMap(); this.setMap();
}, },
}, },
async mounted() { async mounted () {
await this.loadAgency(); await this.loadAgency();
await this.getTableData(); await this.getTableData();
}, },
methods: { methods: {
// init // init
initMap() { initMap () {
// //
var center = new window.TMap.LatLng(36.0722275, 120.38945519); var center = new window.TMap.LatLng(36.0722275, 120.38945519);
// map TMap.Map() // map TMap.Map()
@ -224,7 +204,7 @@ export default {
infoWindowList = Array(10); infoWindowList = Array(10);
}, },
setMarker(lat, lng, centerName) { setMarker (lat, lng, centerName) {
markers.setGeometries([]); markers.setGeometries([]);
markers.add([ markers.add([
{ {
@ -238,11 +218,11 @@ export default {
]); ]);
}, },
setCenter(lat, lng) { setCenter (lat, lng) {
map.setCenter(new window.TMap.LatLng(lat, lng)); map.setCenter(new window.TMap.LatLng(lat, lng));
}, },
setMap() { setMap () {
const { tableData, currentIndex } = this; const { tableData, currentIndex } = this;
let item = tableData[currentIndex]; let item = tableData[currentIndex];
if (item) { if (item) {
@ -251,24 +231,24 @@ export default {
} }
}, },
handleClose() { handleClose () {
this.formShow = false; this.formShow = false;
}, },
handleCloseForm2() { handleCloseForm2 () {
this.form2Show = false; this.form2Show = false;
}, },
handleCloseOrderList() { handleCloseOrderList () {
this.orderListShow = false; this.orderListShow = false;
}, },
async handleAdd() { async handleAdd () {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
console.log(this.$refs); console.log(this.$refs);
this.$refs.eleEditForm.initForm("add"); this.$refs.eleEditForm.initForm("add");
}, },
async handleWatch() { async handleWatch () {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm( this.$refs.eleEditForm.initForm(
@ -277,7 +257,7 @@ export default {
); );
}, },
async handleEdit() { async handleEdit () {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm( this.$refs.eleEditForm.initForm(
@ -286,12 +266,12 @@ export default {
); );
}, },
handleEditSuccess() { handleEditSuccess () {
this.handleClose(); this.handleClose();
this.getTableData(); this.getTableData();
}, },
async handleOrder(index) { async handleOrder (index) {
this.form2Show = true; this.form2Show = true;
await nextTick(); await nextTick();
this.$refs.eleOrderForm.initForm( this.$refs.eleOrderForm.initForm(
@ -301,34 +281,36 @@ export default {
); );
}, },
handleOrderSuccess() { handleOrderSuccess () {
this.handleCloseForm2(); this.handleCloseForm2();
}, },
async handleOrderList(index) { async handleOrderList (index) {
this.orderListShow = true; this.orderListShow = true;
await nextTick(0); await nextTick(0);
console.log(this.$refs); console.log(this.$refs);
this.$refs.eleOrderList.init(this.tableData[this.currentIndex], index); this.$refs.eleOrderList.init(this.tableData[this.currentIndex], index);
}, },
async handleDel() { async handleDel (rowData, rowIndex) {
if (!confirm("删除后不可恢复,确定删除?")) return; console.log(rowData, rowIndex);
const url =
"/heart/iccommunityselforganization/delcommunityselforganization";
const { tableData } = this;
const item = this.tableData[this.currentIndex]; const { data, code, msg } = await requestPost(url, {
const url = "/gov/org/icpartyservicecenter/del"; orgId: tableData[rowIndex].orgId,
});
const { data, code, msg } = await requestPost(url, [
item.partyServiceCenterId,
]);
if (code === 0) { if (code === 0) {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.getTableData(); this.getTableData();
} else {
this.$message.success("操作失败!");
} }
}, },
async getTableData() { async getTableData () {
const oldLen = this.tableData.length; const oldLen = this.tableData.length;
const url = "/gov/org/icpartyservicecenter/partyservicecenterlist"; const url = "/gov/org/icpartyservicecenter/partyservicecenterlist";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -349,7 +331,7 @@ export default {
}, },
// //
async loadAgency() { async loadAgency () {
const url = "/epmetuser/customerstaff/staffbasicinfo"; const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {}; let params = {};
@ -357,6 +339,8 @@ export default {
if (code === 0) { if (code === 0) {
this.agencyId = data.agencyId; this.agencyId = data.agencyId;
} else {
this.$message.error(msg);
} }
}, },
}, },
@ -410,8 +394,7 @@ export default {
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0 0 10px #6aa; box-shadow: 0 0 10px #6aa;
} }
.item-btn {
.item-btns {
position: absolute; position: absolute;
top: 5px; top: 5px;
right: 5px; right: 5px;
@ -440,7 +423,6 @@ export default {
} }
} }
} }
.item-name { .item-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;

6
src/views/modules/secretaryLog/difficulty/difficultyForm.vue

@ -276,7 +276,7 @@ export default {
beforeUpload (file) { beforeUpload (file) {
const array = file.name.split('.') const array = file.name.split('.')
const extension = array[array.length - 1] const extension = array[array.length - 1]
const isLt1M = (file.size / 1024 / 1024) < 5
if (extension !== 'xls' if (extension !== 'xls'
&& extension !== 'xlsx' && extension !== 'xlsx'
&& extension !== 'doc' && extension !== 'doc'
@ -285,6 +285,10 @@ export default {
this.$message.error('只能上传word、excel、pdf文件!') this.$message.error('只能上传word、excel、pdf文件!')
return false return false
} }
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 5MB!')
}
return isLt1M
}, },

6
src/views/modules/secretaryLog/humanisticCare/careForm.vue

@ -331,7 +331,7 @@ export default {
beforeUpload (file) { beforeUpload (file) {
const array = file.name.split('.') const array = file.name.split('.')
const extension = array[array.length - 1] const extension = array[array.length - 1]
const isLt1M = (file.size / 1024 / 1024) < 5
if (extension !== 'xls' if (extension !== 'xls'
&& extension !== 'xlsx' && extension !== 'xlsx'
&& extension !== 'doc' && extension !== 'doc'
@ -340,6 +340,10 @@ export default {
this.$message.error('只能上传word、excel、pdf文件!') this.$message.error('只能上传word、excel、pdf文件!')
return false return false
} }
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 5MB!')
}
return isLt1M
}, },

7
src/views/modules/secretaryLog/workLog/form.vue

@ -252,7 +252,7 @@ export default {
beforeUpload (file) { beforeUpload (file) {
const array = file.name.split('.') const array = file.name.split('.')
const extension = array[array.length - 1] const extension = array[array.length - 1]
const isLt1M = (file.size / 1024 / 1024) < 5
if (extension !== 'xls' if (extension !== 'xls'
&& extension !== 'xlsx' && extension !== 'xlsx'
&& extension !== 'doc' && extension !== 'doc'
@ -261,7 +261,10 @@ export default {
this.$message.error('只能上传word、excel、pdf文件!') this.$message.error('只能上传word、excel、pdf文件!')
return false return false
} }
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 5MB!')
}
return isLt1M
}, },
handleFileRemove (file) { handleFileRemove (file) {

Loading…
Cancel
Save