whx 1 неделя назад
Родитель
Сommit
d5c9e08b82

+ 0 - 3
virgo.wzfrontend/workark/public/reset.css

@@ -50,9 +50,6 @@ section {
 
 /* 图片自适应 */
 img {
-	/*max-width: 100%;*/
-	height: auto;
-	width: auto\9;
 	/* ie8 */
 	-ms-interpolation-mode: bicubic;
 	/*为了照顾ie图片缩放失真*/

+ 40 - 5
virgo.wzfrontend/workark/src/api/ai.js

@@ -21,7 +21,7 @@ export function createAIData(difyTypeId, data) {
 		method: 'post',
 		data: data
 	})
-}
+}
 /* 
  * 获取dify文本数据状态
  * 
@@ -32,7 +32,7 @@ export function getAIDataStatus(simpleUUID) {
 		url: `/api/ai/completion/${simpleUUID}`,
 		method: 'get'
 	})
-}
+}
 /* 
  * 获取dify文本数据列表
  * 
@@ -44,7 +44,7 @@ export function getAIDataList(data) {
 		method: 'post',
 		data: data
 	})
-}
+}
 /* 
  * 保存html代码
  * 
@@ -56,7 +56,7 @@ export function saveHtmlData(data) {
 		method: 'post',
 		data: data
 	})
-}
+}
 /* 
  * 获取保存html代码
  * 
@@ -68,7 +68,7 @@ export function getHtmlData(data) {
 		method: 'post',
 		data: data
 	})
-}
+}
 /* 
  * 更新html代码
  * 
@@ -80,4 +80,39 @@ export function updateHtmlData(data) {
 		method: 'put',
 		data: data
 	})
+}
+/* 
+ * 获取dify工作流数据列表
+ * 
+ * 
+ */
+export function getAIFlowDataList(data) {
+	return request({
+		url: `/api/ai/workflow`,
+		method: 'post',
+		data: data
+	})
+}
+/* 
+ * 生成dify工作流数据
+ * 
+ * 
+ */
+export function createAIFlowData(difyTypeId, data) {
+	return request({
+		url: `/api/ai/workflow/run/${difyTypeId}`,
+		method: 'post',
+		data: data
+	})
+}
+/* 
+ * 获取dify工作流数据状态
+ * 
+ * 
+ */
+export function getAIFlowDataStatus(simpleUUID) {
+	return request({
+		url: `/api/ai/workflow/${simpleUUID}`,
+		method: 'get'
+	})
 }

+ 1 - 1
virgo.wzfrontend/workark/src/components/flow/flowForm.vue

@@ -12,7 +12,7 @@
 					<device-flow-form ref="flowData" v-if="flowType === 5" :flowForm="flowForm"></device-flow-form>
 					<el-form :model="flowForm" label-position="top">
 						<el-form-item label="流程附件" class="hui-textarea">
-							<upload ref="upload" :list="responsibility" type="insert"></upload>
+							<upload ref="upload" :list="responsibility" type="insert" accept="*" text="上传附件"></upload>
 						</el-form-item>
 						<el-form-item label="抄送人" class="hui-textarea">
 							<cc ref="cc" type="insert" :ccList="ccList"></cc>

+ 500 - 0
virgo.wzfrontend/workark/src/components/work/common/aiFlowChat.vue

@@ -0,0 +1,500 @@
+<template>
+	<div class="ai-chat-container">
+		<div class="chat-body" ref="chatBody">
+			<div class="message ai-message">
+				<div class="message-header">
+					<div class="message-header-img">
+						<avatar :user="{
+							portrait:'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/f9617c7f80da485cb3cc72b6accc62ed'
+						}"></avatar>
+					</div>
+					<div class="message-header-label">AI网站生成助手</div>
+				</div>
+				<div class="message-content">
+					<p>您好!我是AI网站生成助手,请点击按钮生成企业官网。</p>
+					<el-button size="mini" @click="visible = true" style="margin-top: 10px;">
+						点击生成企业官网
+					</el-button>
+				</div>
+				<div class="message-time">
+					{{ formatTime(messageList.length === 0? new Date():messageList[0].date) }}
+				</div>
+			</div>
+			<div v-for="(message, index) in messageList" :key="index">
+				<div class="message user-message">
+					<div class="message-header">
+						<div class="message-header-img">
+							<avatar :user="user"></avatar>
+						</div>
+						<div class="message-header-label">{{user.userName}}</div>
+					</div>
+					<div class="message-content" v-html="message.userInput"></div>
+					<div class="message-time">
+						{{ formatTime(message.date) }}
+					</div>
+				</div>
+				<div class="message ai-message" v-if="!loading || message.status !== 'running'"
+					style="margin-top: 15px;">
+					<div class="message-header">
+						<div class="message-header-img">
+							<avatar :user="{
+								portrait:'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/f9617c7f80da485cb3cc72b6accc62ed'
+							}"></avatar>
+						</div>
+						<div class="message-header-label">AI网站生成助手</div>
+					</div>
+					<div class="message-content">
+						<div v-if="message.status === 'failed'">
+							<p>服务器繁忙,请稍后重试</p>
+							<el-button size="mini" @click="reload(message)" :disabled="index !== messageList.length - 1"
+								style="margin-top: 10px;">
+								点击重试
+							</el-button>
+						</div>
+						<div class="ai-website-boxs" v-else>
+							<div class="ai-website-box" v-html="message.AIInput"></div>
+							<div class="ai-website-mask">
+								<el-button size="mini" type="primary"
+									@click="$emit('previewWebSite', message.AIInput,message.simpleUUID)">
+									预览
+								</el-button>
+							</div>
+						</div>
+					</div>
+					<div class="message-time">
+						{{ formatTime(message.endDate) }}
+					</div>
+				</div>
+			</div>
+			<div v-if="loading" class="typing-indicator">
+				<div class="typing-dot"></div>
+				<div class="typing-dot"></div>
+				<div class="typing-dot"></div>
+				<span style="margin-left: 10px;">思考中...</span>
+			</div>
+		</div>
+		<div class="input-container">
+			<el-input type="textarea" v-model="newMessage" placeholder="给AI发送消息" resize="none" rows="2"
+				:autosize="{ minRows: 2, maxRows: 6 }" :disabled="!htmlCode">
+			</el-input>
+			<div class="input-button">
+				<el-button size="mini" @click="selectProduct" :disabled="loading || !htmlCode">
+					添加商品
+				</el-button>
+				<el-button type="primary" size="mini" @click="sendMessage"
+					:disabled="!newMessage.trim() || loading || !htmlCode">
+					发送
+				</el-button>
+			</div>
+		</div>
+		<el-dialog :close-on-click-modal="false" title="生成网站" :visible.sync="visible" width="900px"
+			:append-to-body="true">
+			<website-form v-if="visible" @callback="callback"></website-form>
+		</el-dialog>
+		<el-dialog :close-on-click-modal="false" title="选择商品" :visible.sync="visibles" width="900px"
+			:append-to-body="true">
+			<div class="hui-flex hui-content hui-dialog">
+				<select-product ref="selectProduct" v-if="visibles"></select-product>
+				<div class="hui-dialog-submit">
+					<el-button size="small" @click="visibles = false">取 消</el-button>
+					<el-button size="small" type="primary" @click="sureProduct" :loading="productLoading">
+						确定
+					</el-button>
+				</div>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import websiteForm from '@/components/work/common/websiteForm.vue'
+	const selectProduct = () => import('@/components/work/common/selectProduct');
+	import {
+		getAIFlowDataStatus,
+		getAIFlowDataList,
+		createAIFlowData
+	} from '@/api/ai'
+	import Crypto from '@/uitls/crypto'
+	export default {
+		components: {
+			websiteForm,
+			selectProduct
+		},
+		data() {
+			return {
+				messageList: [],
+				newMessage: '',
+				loading: false,
+				darkMode: false,
+				visible: false,
+				timer: null,
+				formData: {
+					company_name: '企业名称',
+					logo_url: '企业logo',
+					company_sub_name: '企业简称',
+					business_scope: '核心业务',
+					key_features: '核心优势',
+					contact_info: '联系方式',
+					industry_sector: '行业领域',
+					create_time: '成立时间',
+					create_place: '成立地点',
+					all_style: '整体风格',
+					model: '主要模块',
+					color_scheme: '主色调',
+					websites_url: '参考网站'
+				},
+				user: {},
+				htmlCode: '',
+				simpleUUID: '',
+				visibles: false,
+				productLoading: false
+			}
+		},
+		mounted() {
+			this.user = this.$store.getters.user;
+			this.scrollToBottom();
+			this.init()
+		},
+		watch: {
+			messageList: {
+				deep: true,
+				handler() {
+					this.$nextTick(() => {
+						this.scrollToBottom();
+					});
+				}
+			}
+		},
+		beforeDestroy() {
+			this.clearTimer();
+		},
+		methods: {
+			init() {
+				getAIFlowDataList({
+					userId: this.$store.getters.user.userId
+				}).then(res => {
+					if (res.state) {
+						this.messageList = res.data.map(node => {
+							node['userInput'] = this.returnUserInputs(node);
+							let AIInput = ''
+							if (node.outputs) AIInput = this.extractContentBetween(JSON.parse(node.outputs)
+								.text,
+								node.simpleUUID)
+							node['AIInput'] = AIInput;
+							return node;
+						});
+						if (this.messageList.length > 0) {
+							let data = this.messageList[this.messageList.length - 1];
+							if (data.status === 'running') this.initStaus(data.simpleUUID);
+							if (data.status === 'succeeded') this.$emit('previewWebSite', this.htmlCode, this
+								.simpleUUID);
+						}
+					}
+				})
+			},
+			initStaus(simpleUUlD) {
+				this.loading = true;
+				this.timer = setInterval(() => {
+					getAIFlowDataStatus(simpleUUlD).then(res => {
+						if (res.state) {
+							let data = res.data;
+							if (!data) return;
+							if (data.status === 'succeeded' || data.status === 'failed') {
+								this.clearTimer();
+								this.loading = false;
+								data['userInput'] = this.returnUserInputs(data);
+								let AIInput = ''
+								if (data.outputs) AIInput = this.extractContentBetween(JSON.parse(data
+									.outputs).text, data.simpleUUID)
+								node['AIInput'] = AIInput;
+								this.messageList[this.messageList.length - 1] = data;
+								if (data.status === 'succeeded') this.$emit('previewWebSite', this
+									.htmlCode, this.simpleUUID);
+							}
+						} else {
+							this.clearTimer();
+						}
+					})
+				}, 20000)
+			},
+			returnUserInputs(data) {
+				let obj = data.inputs;
+				if (!obj) return '';
+				let html = '';
+				let objs = JSON.parse(obj);
+				return objs.query;
+			},
+			clearTimer() {
+				if (!this.timer) return;
+				clearInterval(this.timer);
+				this.timer = null;
+			},
+			formatTime(date) {
+				return new Date(date).toLocaleTimeString([], {
+					hour: '2-digit',
+					minute: '2-digit'
+				});
+			},
+			scrollToBottom() {
+				const container = this.$refs.chatBody;
+				if (container) {
+					container.scrollTop = container.scrollHeight;
+				}
+			},
+			callback(type) {
+				this.visible = false;
+				if (type === 'init') this.init();
+			},
+			sendMessage() {
+				createAIFlowData(5, {
+					type: 1,
+					query: this.newMessage,
+					html_code: this.htmlCode
+				}).then(this.successFunc);
+			},
+			reload(message) {
+				let data = JSON.parse(message.inputs);
+				createAIFlowData(message.difyTypeId, {
+					type: data.type,
+					query: data.query,
+					html_code: data.html_code
+				}).then(this.successFunc);
+			},
+			successFunc(res) {
+				if (res.state) {
+					this.visibles = false;
+					this.newMessage = '';
+					this.$message.success('操作成功');
+					this.init();
+				}
+			},
+			extractContentBetween(html, simpleUUID) {
+				if (!html) return '';
+				// 使用正则表达式匹配 ```html 和 ``` 之间的内容
+				let regex = /```html([\s\S]*?)```/;
+				let match = html.match(regex);
+				let htmls = match && match[1] ? match[1].trim() : '';
+				this.htmlCode = htmls;
+				this.simpleUUID = simpleUUID;
+				return htmls;
+			},
+			selectProduct() {
+				this.visibles = true;
+			},
+			sureProduct() {
+				let form = this.$refs.selectProduct.form;
+				let currentRow = this.$refs.selectProduct.currentRow.map(node => {
+					let id = Crypto.AES.encrypt(String(node.id), 'bosshand');
+					return {
+						id: encodeURIComponent(id),
+						name: node.name,
+						subtitme: node.subtitle,
+						img: this.imageUrl(node.listDisplayImage),
+						unit: '次'
+					}
+				});
+				if (currentRow.length === 0) return this.$message.warning('请至少选择一个商品');
+				createAIData(4, {
+					detailed_html: this.htmlCode,
+					model_name: form.modelName,
+					json_data: JSON.stringify(currentRow)
+				}).then(this.successFunc);
+			},
+			imageUrl(data) {
+				if (data && JSON.parse(data)[0]) return JSON.parse(data)[0].url;
+				return 'https://assets.api.uizard.io/api/cdn/stream/c05650d2-192b-4a56-ae97-05638f53804c.png';
+			},
+		}
+	}
+</script>
+
+<style>
+	.message-image {
+		width: 30px;
+	}
+</style>
+<style scoped lang="scss">
+	.ai-chat-container {
+		width: 100%;
+		height: 100%;
+		background: white;
+		border-radius: 16px;
+		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.ai-website-boxs {
+		width: 185px;
+		height: 108px;
+		overflow: hidden;
+		cursor: pointer;
+		position: relative;
+
+		&:hover .ai-website-mask {
+			display: flex;
+		}
+
+		img {
+			height: revert-layer;
+		}
+	}
+
+	.ai-website-mask {
+		background: rgba(0, 0, 0, 0.1);
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		display: none;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.ai-website-box {
+		width: 1850px;
+		height: 1080px;
+		overflow: hidden;
+		transform: scale(0.1);
+		transform-origin: 0 0;
+	}
+
+	/* 聊天内容区域 */
+	.chat-body {
+		flex: 1;
+		padding: 20px;
+		overflow-y: auto;
+		background: #f8fafc;
+		display: flex;
+		flex-direction: column;
+		gap: 15px;
+		overflow-x: hidden;
+	}
+
+	.message {
+		max-width: 90%;
+		padding: 12px 16px;
+		border-radius: 18px;
+		position: relative;
+		animation: fadeIn 0.3s ease;
+		line-height: 1.5;
+	}
+
+	.user-message {
+		background: #7a72cf;
+		color: white;
+		margin-left: auto;
+		border-bottom-right-radius: 4px;
+	}
+
+	.ai-message {
+		background: #ffffff;
+		border: 1px solid #e9ecef;
+		margin-right: auto;
+		border-bottom-left-radius: 4px;
+	}
+
+	.message-header {
+		display: flex;
+		align-items: center;
+		margin-bottom: 5px;
+		font-weight: 500;
+	}
+
+	.message-header-img {
+		width: 30px;
+		height: 30px;
+		border-radius: 30px;
+		overflow: hidden;
+		margin-right: 5px;
+		background-color: #fff;
+		border: 2px solid #fff;
+	}
+
+	.message-header-label {
+		flex: 1;
+		width: 0;
+		overflow: hidden;
+	}
+
+	.message-time {
+		font-size: 0.7rem;
+		opacity: 0.7;
+		margin-top: 5px;
+		text-align: right;
+	}
+
+	/* 加载指示器 */
+	.typing-indicator {
+		display: flex;
+		align-items: center;
+		padding: 12px 16px;
+		background: white;
+		border: 1px solid #e9ecef;
+		border-radius: 18px;
+		width: fit-content;
+		margin-bottom: 15px;
+		border-bottom-left-radius: 4px;
+	}
+
+	.typing-dot {
+		width: 8px;
+		height: 8px;
+		background: #6c757d;
+		border-radius: 50%;
+		margin: 0 3px;
+		animation: typing 1.4s infinite;
+	}
+
+	.typing-dot:nth-child(1) {
+		animation-delay: 0s;
+	}
+
+	.typing-dot:nth-child(2) {
+		animation-delay: 0.2s;
+	}
+
+	.typing-dot:nth-child(3) {
+		animation-delay: 0.4s;
+	}
+
+	/* 输入区域 */
+	.input-container {
+		padding: 10px;
+		background: #f8f9fa;
+		border-top: 1px solid #e9ecef;
+	}
+
+	.input-button {
+		margin-top: 10px;
+		text-align: right;
+	}
+
+	/* 动画 */
+	@keyframes fadeIn {
+		from {
+			opacity: 0;
+			transform: translateY(10px);
+		}
+
+		to {
+			opacity: 1;
+			transform: translateY(0);
+		}
+	}
+
+	@keyframes typing {
+
+		0%,
+		60%,
+		100% {
+			transform: translateY(0);
+		}
+
+		30% {
+			transform: translateY(-5px);
+		}
+	}
+</style>

+ 33 - 8
virgo.wzfrontend/workark/src/components/work/common/websiteForm.vue

@@ -40,9 +40,9 @@
 						<el-option :label="item" :value="item" v-for="(item,index) in style" :key="index">
 						</el-option>
 					</el-select>
-				</el-form-item>
-				<el-form-item label="参考网站">
-					<el-input type="text" v-model="form.websites_url" placeholder="请输入参考网站"></el-input>
+				</el-form-item>
+				<el-form-item label="参考网站">
+					<el-input type="text" v-model="form.websites_url" placeholder="请输入参考网站"></el-input>
 				</el-form-item>
 				<el-form-item label="LOGO" class="hui-textarea">
 					<upload ref="listDisplayImage" :list="listDisplayImage" type="insert" :maxLen="1"></upload>
@@ -68,7 +68,8 @@
 
 <script>
 	import {
-		createAIData
+		createAIData,
+		createAIFlowData
 	} from '@/api/ai'
 	const upload = () => import('@/components/common/upload');
 	export default {
@@ -84,8 +85,8 @@
 					color_scheme: '#006AFF',
 					key_features: '',
 					contact_info: '',
-					all_style: '',
-					websites_url:''
+					all_style: '',
+					websites_url: ''
 				},
 				loading: false,
 				listDisplayImage: [],
@@ -93,7 +94,22 @@
 				style: ['专业严谨', '现代简约', '高端奢华', '科技智能', '创新活力', '温馨亲和', '环保自然'],
 				all_style: [],
 				modelList: ['首页', '产品介绍', '解决方案', '成功案例', '关于我们', '联系我们'],
-				model: []
+				model: [],
+				formData: {
+					company_name: '企业名称',
+					logo_url: '企业logo',
+					company_sub_name: '企业简称',
+					business_scope: '核心业务',
+					key_features: '核心优势',
+					contact_info: '联系方式',
+					industry_sector: '行业领域',
+					create_time: '成立时间',
+					create_place: '成立地点',
+					all_style: '整体风格',
+					model: '主要模块',
+					color_scheme: '主色调',
+					websites_url: '参考网站'
+				}
 			}
 		},
 		components: {
@@ -107,7 +123,16 @@
 				if (fileBox && fileBox.length > 0) postData['logo_url'] = fileBox[0].url;
 				postData['all_style'] = this.all_style.join('、');
 				postData['model'] = this.model.join('、');
-				createAIData(2, postData).then(this.successFunc)
+				// createAIData(2, postData).then(this.successFunc)
+				let query = '企业名称:有极数据科技有限公司,企业简称:有极,行业领域:医疗,核心业务:健康管理,成立地点:,成立时间:2023,主色调:#006AFF,核心优势:,联系方式:,整体风格:专业严谨、现代简约、创新活力,参考网站:,企业logo:https://file-node.oss-cn-shanghai.aliyuncs.com/youji/de308b124ef54502b68a9fc047283525,主要模块:首页、产品介绍、解决方案、成功案例、关于我们、联系我们';
+				// for (let key in postData) {
+				// 	if (postData[key]) query += this.formData[key] + ':' + postData[key] + ",";
+				// }
+				console.log(query);
+				createAIFlowData(5, {
+					type: 1,
+					query: query
+				}).then(this.successFunc)
 			},
 			successFunc(res) {
 				this.loading = false;

+ 10 - 3
virgo.wzfrontend/workark/src/router/modules/work/oa.js

@@ -5,26 +5,33 @@ const oa = [{
 	meta: {
 		title: '会议纪要'
 	}
-},{
+}, {
 	path: 'oa/meeting/set',
 	component: () => import('@/views/work/oa/meeting/set'),
 	name: '会议设置',
 	meta: {
 		title: '会议设置'
 	}
-},{
+}, {
 	path: 'oa/order',
 	component: () => import('@/views/work/oa/order/list'),
 	name: '工单管理',
 	meta: {
 		title: '工单管理'
 	}
-},{
+}, {
 	path: 'oa/website',
 	component: () => import('@/views/work/oa/ai/website'),
 	name: 'AI官网',
 	meta: {
 		title: 'AI官网'
 	}
+}, {
+	path: 'oa/app',
+	component: () => import('@/views/work/oa/ai/app'),
+	name: 'AI软件',
+	meta: {
+		title: 'AI软件'
+	}
 }]
 export default oa;

+ 237 - 0
virgo.wzfrontend/workark/src/views/work/oa/ai/app.vue

@@ -0,0 +1,237 @@
+<template>
+	<div class="hui-flex border-box ai-website">
+		<div class="website-form hui-flex">
+			<div class="website-form-title">
+				网站信息
+			</div>
+			<div class="hui-flex-box">
+				<ai-flow-chat @previewWebSite="previewWebSite"></ai-flow-chat>
+			</div>
+		</div>
+		<div class="website-show hui-flex">
+			<div class="website-form-title">
+				<span>网站展示</span>
+				<website-upload ref="upload" v-show="false" @reload="successFunc">
+				</website-upload>
+				{{websiteUrl}}
+			</div>
+			<div class="hui-flex-box">
+				<div class="no-empty" v-if="!websiteUrl">
+					<el-empty description="请先预览网站"></el-empty>
+				</div>
+				<div class="html-box" v-else v-loading="loading">
+					<iframe ref="iframeDom" :src="websiteUrl" width="100%" height="100%" frameborder="0"
+						@load="onloadIframe">
+					</iframe>
+				</div>
+			</div>
+			<div class="hui-drawer-submit">
+				<el-button size="mini" :disabled="!websiteUrl" @click="cancelIframe" v-if="iframeEdit">取消</el-button>
+				<el-button type="primary" size="mini" :disabled="!websiteUrl" @click="saveIframe" v-if="iframeEdit">
+					保存
+				</el-button>
+				<el-button type="primary" size="mini" :disabled="!websiteUrl" @click="editIframe" v-if="!iframeEdit">
+					编辑
+				</el-button>
+				<el-button type="primary" size="mini" :disabled="!websiteUrl" @click="submit" v-if="!iframeEdit">
+					发布
+				</el-button>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		getAIData,
+		saveHtmlData,
+		getHtmlData,
+		updateHtmlData
+	} from '@/api/ai'
+	import aiFlowChat from '@/components/work/common/aiFlowChat.vue'
+	import websiteUpload from '@/components/work/common/websiteUpload.vue'
+	import config from '@/config'
+	export default {
+		components: {
+			aiFlowChat,
+			websiteUpload
+		},
+		data() {
+			return {
+				websiteUrl: '',
+				loading: false,
+				simpleUUID: '',
+				iframeEdit: false,
+				imageELement: null,
+				htmlData: {}
+			}
+		},
+		mounted() {},
+		methods: {
+			async previewWebSite(html, simpleUUID) {
+				if (this.simpleUUID === simpleUUID) return;
+				this.iframeEdit = false;
+				this.loading = true;
+				this.simpleUUID = simpleUUID;
+				let htmlData = await getHtmlData({
+					simpleUUID: simpleUUID
+				})
+				if (!htmlData.state) return this.websiteUrl = '';
+				if (htmlData.data.length > 0) {
+					this.htmlData = htmlData.data[0];
+					return this.websiteUrl = `${config.baseURL}/api/enterprise/${simpleUUID}`
+				}
+				let saveData = await saveHtmlData({
+					data: html,
+					simpleUUID: simpleUUID
+				})
+				if (!saveData.state) return this.websiteUrl = '';
+				this.htmlData = saveData.data;
+				return this.websiteUrl = `${config.baseURL}/api/enterprise/${simpleUUID}`
+			},
+			submit() {
+				this.$confirm('是否发布该官网?', () => {
+					this.$prompt('发布连接', 'WorkArk提示', {
+						confirmButtonText: '打开链接',
+						cancelButtonText: '取消',
+						inputValue: `https://workark.com/api/enterprise/${this.simpleUUID}`
+					}).then(() => {
+						window.open(`https://workark.com/api/enterprise/${this.simpleUUID}`, "_blank");
+					}).catch(() => {});
+				})
+			},
+			onloadIframe() {
+				this.loading = false;
+			},
+			cancelIframe() {
+				const iframe = this.$refs.iframeDom;
+				iframe.contentWindow.location.reload();
+				this.iframeEdit = false;
+			},
+			saveIframe() {
+				const iframe = this.$refs.iframeDom;
+				const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
+				const a = iframeDoc.querySelectorAll('a');
+				a.forEach(element => {
+					element.href = element.oldHref;
+					element.removeAttribute('oldHref');
+				});
+				const allElements = iframeDoc.querySelectorAll('*');
+				allElements.forEach(element => {
+					element.removeAttribute('contentEditable');
+				});
+				const img = iframeDoc.querySelectorAll('img');
+				img.forEach(element => {
+					element.style.cursor = 'pointer';
+					element.onclick = null;
+				});
+				const iframeDocs = iframe.contentDocument || iframe.contentWindow.document;
+				const htmlContent = iframeDocs.documentElement.outerHTML;
+				updateHtmlData({
+					data: htmlContent,
+					id: this.htmlData.id
+				}).then(res => {
+					if (res.state) {
+						this.$message.success('操作成功');
+						this.iframeEdit = false;
+					}
+				})
+			},
+			editIframe() {
+				let _self = this;
+				const iframe = _self.$refs.iframeDom;
+				if (iframe.contentDocument) {
+					const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
+					//编辑时a标签不要跳转
+					const a = iframeDoc.querySelectorAll('a');
+					a.forEach(element => {
+						element.oldHref = element.href;
+						element.href = 'javascript:void(0);'
+					});
+					// 获取页面所有元素
+					const allElements = iframeDoc.querySelectorAll('*');
+					// 为每个元素设置contenteditable=true
+					allElements.forEach(element => {
+						if (element.nodeName !== 'IMG') element.contentEditable = 'true';
+					});
+					// 获取页面所有元素
+					const img = iframeDoc.querySelectorAll('img');
+					// 为每个元素设置contenteditable=true
+					img.forEach(element => {
+						element.style.cursor = 'pointer';
+						element.onclick = function() {
+							_self.imageELement = this;
+							_self.$refs.upload.reloadUpload();
+						}
+					});
+					_self.iframeEdit = true;
+				}
+			},
+			successFunc(url) {
+				if (this.imageELement) this.imageELement.src = url;
+			},
+			handleSend() {
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.ai-website {
+		flex-direction: row;
+
+		.html-box {
+			width: 100%;
+			overflow: hidden;
+			height: 100%;
+		}
+
+		.iframe-class {
+			width: 100%;
+			height: 100%;
+			border: none;
+			overflow: hidden;
+		}
+
+		.website-form-title {
+			height: 44px;
+			line-height: 44px;
+			border-bottom: 1px solid $--border-color-light;
+			padding: 0 10px;
+			font-weight: bold;
+		}
+
+		.website-form {
+			width: 300px;
+			border-right: 1px solid $--border-color-light;
+		}
+
+		.no-empty {
+			width: 100%;
+			height: 100%;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+		}
+
+		.website-show {
+			flex: 1;
+			width: 0;
+		}
+
+		.website-form-content {
+			padding: 10px;
+
+			.el-form {
+				display: block;
+
+				.el-form-item {
+					width: 100%;
+					padding: 0 !important;
+					margin-bottom: 15px;
+				}
+			}
+		}
+	}
+</style>