Browse Source

修改ai6上传

11wqe1 2 months ago
parent
commit
0e0a8f54d4
3 changed files with 60 additions and 29 deletions
  1. 4 0
      src/api/user.js
  2. 48 27
      src/components/instupdata.vue
  3. 8 2
      src/store/modules/user.js

+ 4 - 0
src/api/user.js

@@ -18,6 +18,10 @@ export function loginOut(data) {
 export function getUser(data) {
 export function getUser(data) {
   return axios.get(`${baseApi}/selectUser`, data)
   return axios.get(`${baseApi}/selectUser`, data)
 }
 }
+// 获取探究中心课程
+export function selectAiExp(data) {
+  return axios.get(`${baseApi}/selectAiExp`, data)
+}
 
 
 // 修改密码
 // 修改密码
 export function iniPassword(data) {
 export function iniPassword(data) {

+ 48 - 27
src/components/instupdata.vue

@@ -1,26 +1,21 @@
 <template>
 <template>
-	<div style="width: 100%; height: 100%; padding: 10px; box-sizing: border-box">
+	<div style="width: 100%; height: 100%; padding: 10px; box-sizing: border-box" v-loading="loading">
 		<div class="intPage">
 		<div class="intPage">
 			<div class="tit">H5页面说明上传后台</div>
 			<div class="tit">H5页面说明上传后台</div>
 			<div>
 			<div>
-				<div>请输入H5页面id</div>
-				<el-input v-model.trim="id" placeholder="请输入内容"></el-input>
+				<div>请选择ai探究中心课程</div>
+				<el-select v-model="id" @change="cutCourse" placeholder="请选择">
+					<el-option
+					v-for="item in courseList"
+					:key="item.id"
+					:label="item.name"
+					:value="item.id">
+					</el-option>
+				</el-select>
+				<!-- <el-input v-model.trim="id" placeholder="请输入内容"></el-input> -->
 			</div>
 			</div>
 			<div>
 			<div>
 				<div>请输入使用说明</div>
 				<div>请输入使用说明</div>
-				<!-- <div
-					class="avatar-uploader"
-					@click.stop="addImg($event)"
-					style="cursor: pointer"
-				>
-					+
-					<input
-						type="file"
-						accept="image/*"
-						style="display: none"
-						@change="beforeUpload($event)"
-					/>
-				</div> -->
 				<editor-bar
 				<editor-bar
 					class="addEditor"
 					class="addEditor"
 					style="margin: 0"
 					style="margin: 0"
@@ -28,15 +23,6 @@
 					v-model="inData.content"
 					v-model="inData.content"
 					@change="change"
 					@change="change"
 				></editor-bar>
 				></editor-bar>
-
-				<!-- <quill-editor
-					v-model="inData.content"
-					ref="myQuillEditor"
-					class="editer"
-					:options="editorOption"
-					@change="onEditorChange($event)"
-				>
-				</quill-editor> -->
 			</div>
 			</div>
 			<div>
 			<div>
 				<div>请上传附件(只能上传pdf)</div>
 				<div>请上传附件(只能上传pdf)</div>
@@ -67,14 +53,13 @@
 
 
 <script>
 <script>
 import EditorBar from "./wangEnduit";
 import EditorBar from "./wangEnduit";
-import { addOp, updateinst } from "@/api/user";
+import { addOp, updateinst,selectAiExp } from "@/api/user";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 
 
 export default {
 export default {
 	name: "instUpdata",
 	name: "instUpdata",
 	computed: {
 	computed: {
 		...mapGetters(["userid"])
 		...mapGetters(["userid"])
-		
 	},
 	},
 	components:{
 	components:{
 		EditorBar
 		EditorBar
@@ -87,11 +72,46 @@ export default {
 				content: "",
 				content: "",
 				file: [],
 				file: [],
 			},
 			},
+			loading:false,
+			courseList:[],
 			progress: 0,
 			progress: 0,
 			proVisible: false,
 			proVisible: false,
 		};
 		};
 	},
 	},
+	mounted(){
+		this.getData()
+	},
 	methods: {
 	methods: {
+		cutCourse(val){
+			console.log('val',val);
+			this.inData = {
+				userid: this.userid,
+				content: "",
+				file: [],
+			}
+			let data = this.courseList.filter(e=> e.id == val)[0]
+			console.log('data',data);
+			if (data.inst) {				
+				this.inData.content = JSON.parse(data.inst).content
+				this.inData.file = JSON.parse(data.inst).file
+			}
+		},
+		getData(){
+			this.loading = true;
+			let params = {
+				cl:1
+			};
+			selectAiExp(params)
+				.then(async (res) => {
+					console.log(res);
+                    this.courseList = res.data[1]
+                    this.loading = false;
+				})
+				.catch((error) => {
+                    this.loading = false;
+					console.error("请求失败,错误信息:", error);
+				});
+		},
 		change(val) {
 		change(val) {
 			
 			
 			// this.$forceUpdate();
 			// this.$forceUpdate();
@@ -130,6 +150,7 @@ export default {
 							type: "success",
 							type: "success",
 							message: "修改成功",
 							message: "修改成功",
 						});
 						});
+						this.getData()
 						this.id = "";
 						this.id = "";
 						this.inData = {
 						this.inData = {
 							userid: this.userid,
 							userid: this.userid,

+ 8 - 2
src/store/modules/user.js

@@ -60,9 +60,15 @@ const actions = {
             "b7ccc834-aae5-11ea-a8d4-52540005ab01",
             "b7ccc834-aae5-11ea-a8d4-52540005ab01",
             "a77e9404-efec-11e9-96f9-028edca3b798",
             "a77e9404-efec-11e9-96f9-028edca3b798",
             "0e8d50c3-50b5-2f1c-9f1a-bd346a0bf817",
             "0e8d50c3-50b5-2f1c-9f1a-bd346a0bf817",
-            "5943e08c-b7d4-11ed-8d51-005056b86db5",
+            "5943e08c-b7d4-11ed-8d51-005056b86db5", //cs1111
 						"6c56ec0e-2c74-11ef-bee5-005056b86db5",
 						"6c56ec0e-2c74-11ef-bee5-005056b86db5",
-            "3efa8590-1719-11ef-ade9-005056b86db5"
+            "3efa8590-1719-11ef-ade9-005056b86db5",
+            "d248c21c-50fc-11ed-8c78-005056b86db5", //李毓竹
+            "d248c8cf-50fc-11ed-8c78-005056b86db5", //程鹏
+            "d248cbe2-50fc-11ed-8c78-005056b86db5", //兰薇
+            "b7bd1863-2f87-11ef-bf55-005056b86db5", //黄丽惠
+            "bfbe1913-2f87-11ef-bf55-005056b86db5",//彭晓彬
+            "c52be2c7-9819-11ef-9b30-005056b86db5", //陈惠雯
           ];
           ];
           if (allowedIds.includes(_user.userid)) {
           if (allowedIds.includes(_user.userid)) {
             commit("SET_ID", _user.userid);
             commit("SET_ID", _user.userid);