whx 3 ヶ月 前
コミット
44139ea931

+ 12 - 5
virgo.wzfrontend/console/src/components/flow/batchForm.vue

@@ -9,8 +9,8 @@
 					</div>
 				</div>
 				<div class="hui-flex-box">
-					<batch-template :flowForm="item" v-for="(item,index) in templateList" :key="index"
-						v-show="titleIndex == index">
+					<batch-template ref="batchTemplate" :flowForm="item" v-for="(item,index) in templateList"
+						:key="index" v-show="titleIndex == index" :flowType="flowType">
 					</batch-template>
 				</div>
 			</div>
@@ -30,6 +30,9 @@
 <script>
 	import importTemplate from '@/components/flow/importTemplate'
 	import batchTemplate from '@/components/flow/batchTemplate'
+	import {
+		insertFlowBatch
+	} from '@/httpApi/property'
 	export default {
 		props: ['flowType'],
 		data() {
@@ -45,12 +48,16 @@
 		methods: {
 			changeFile(data) {
 				this.$loading.close();
-				console.log(this.templateList);
 				this.templateList = data;
 			},
 			submit() {
-				// this.loading = true;
-				this.$message.success('功能开发中');
+				this.loading = true;
+				let dom = this.$refs.batchTemplate,
+					list = [];
+				for (let i = 0; i < dom.length; i++) {
+					list.push(dom[i].getFormData());
+				}
+				insertFlowBatch(list).then(this.successFunc);
 			},
 			successFunc(res) {
 				this.loading = false;

+ 18 - 2
virgo.wzfrontend/console/src/components/flow/batchTemplate.vue

@@ -27,7 +27,7 @@
 	import upload from '@/components/common/upload'
 	import propertyFlowForm from '@/components/work/property/propertyFlowForm'
 	export default {
-		props: ['flowForm'],
+		props: ['flowForm', 'flowType'],
 		data() {
 			return {
 				responsibility: [],
@@ -36,7 +36,23 @@
 			}
 		},
 		mounted() {},
-		methods: {},
+		methods: {
+			getFormData() {
+				let data = this.$refs.flowData.returnForm();
+				let formData = data.formData;
+				let commonForm = data.commonForm;
+				let commonData = {
+					flowUserList: JSON.stringify(this.$refs.flow.list),
+					receiver: JSON.stringify(this.$refs.cc.list),
+					attachment: JSON.stringify(this.$refs.upload.fileList),
+					flowType: this.flowType
+				}
+				let postData = Object.assign(commonForm, commonData, {
+					flowData: JSON.stringify(formData)
+				})
+				return postData;
+			}
+		},
 		components: {
 			flow,
 			upload,

+ 1 - 1
virgo.wzfrontend/console/src/components/work/bim/operationModels.vue

@@ -247,7 +247,7 @@
 							this.setFloor();
 						},
 						click: (data) => {
-							console.log(data);
+							// console.log(data);
 						}
 					})
 				} else {

+ 12 - 0
virgo.wzfrontend/console/src/httpApi/property.js

@@ -96,6 +96,18 @@ export function getFlowById(id) {
  * 
  * 
  */
+export function insertFlowBatch(data) {
+	return request({
+		url: `/api/operateFlowData/batch`,
+		method: 'post',
+		data: data
+	})
+}
+/* 
+ * 批量新增审核
+ * 
+ * 
+ */
 export function insertFlow(data) {
 	return request({
 		url: `/api/operateFlowData`,

+ 12 - 1
virgo.wzfrontend/console/src/loading/loading.vue

@@ -18,12 +18,23 @@
 		data() {
 			return {
 				show: false,
-				percent: ''
+				percent: '',
+				showTimer: null
 			}
 		},
 		watch: {
 			show(value) {
 				this.show = value;
+				if (value) {
+					this.showTimer = setTimeout(() => {
+						this.show = false;
+					}, 5000)
+				} else {
+					if (this.showTimer) {
+						clearTimeout(this.showTimer);
+						this.showTimer = null
+					}
+				}
 			},
 			percent(val) {
 				this.percent = val;

+ 4 - 1
virgo.wzfrontend/console/src/views/common/ui.vue

@@ -39,9 +39,12 @@
 				let boxHeight = box.offsetHeight;
 				if (!this.canvas) {
 					this.canvas = new fabric.Canvas('myCanvas', {
+						fireRightClick: true, // 启用右键,button的数字为3
+						stopContextMenu: true, // 禁止默认右键菜单
+						controlsAboveOverlay: true, // 超出clipPath后仍然展示控制条
+						preserveObjectStacking: true, // 当选择画布中的对象时,让对象不在顶层。
 						width: boxWidth, // 设置画布宽度
 						height: boxHeight, // 设置画布高度
-						backgroundColor: '#fff' // 可选:设置背景颜色
 					});
 					// this.clickFunction()
 					this.initBackgroundImage();

+ 11 - 1
virgo.wzfrontend/console/src/views/work/property/register.vue

@@ -43,7 +43,13 @@
 							</el-button>
 							<el-button type="info" size="medium" @click="downloadFile">标准模板下载</el-button>
 							<el-button v-permission="'/work/property/register/add'" type="info" size="medium"
-								@click="insert(2)">批量登记</el-button>
+								@click="insert(2)">
+								批量登记
+							</el-button>
+							<el-button v-permission="'/work/property/register/add'" type="info" size="medium"
+								@click="outputFile">
+								导出数据
+							</el-button>
 						</div>
 						<div class="hui-flex-box">
 							<el-table :data="tableData" row-key="id" border height="100%">
@@ -225,6 +231,9 @@
 				this.currPage = 1;
 				this.init();
 			},
+			outputFile() {
+				window.location.href = `${config.baseURL}/api/operateDevice/export/${this.$store.getters.project.id}/0`;
+			},
 			downloadFile() {
 				window.location.href = config.baseURL + '/api/operateDevice/exportTemplate';
 			},
@@ -282,6 +291,7 @@
 				});
 			},
 			callback(type) {
+				this.insertType = 1;
 				this.visible = false;
 				if (type === 'init') this.init();
 			}

+ 9 - 0
virgo.wzfrontend/console/vue.config.js

@@ -43,6 +43,7 @@ module.exports = {
 		}
 	},
 	configureWebpack: {
+		devtool: process.env.NODE_ENV === 'development' ? 'eval' : false,
 		plugins: [
 			new Happypack({
 				loaders: ['babel-loader', 'vue-loader'],
@@ -55,6 +56,14 @@ module.exports = {
 		port: 8080, // 端口
 		open: false, // 自动开启浏览器
 		compress: false, // 开启压缩
+		hot: true, //  模块热替换
+		client: {
+			overlay: { // 当出现编译错误或警告时,在浏览器中显示全屏覆盖。
+				warnings: true,
+				errors: true
+			},
+			progress: true, // 在浏览器中以百分比形式打印编译进度。
+		},
 		proxy: {
 			'/v1': {
 				target: dev_baseURL,