diff --git a/work/src/api/UpdateWorkApi.js b/work/src/api/UpdateWorkApi.js
new file mode 100644
index 0000000..d86cc0e
--- /dev/null
+++ b/work/src/api/UpdateWorkApi.js
@@ -0,0 +1,20 @@
+import service from ".";
+const UpdateWorkApi={
+ //查询分部
+ getdeptinfo(){
+ return service.post("/api/homework_manage/getdeptinfo")
+ },
+ //查询分部门店
+ getshopinfo(deptId){
+ return service.post("/api/homework_manage/getshopinfo",{deptId})
+ },
+ //查询功能
+ getrecordbycondition(data){
+ return service.post("/api/homework_manage/getrecordbycondition",data)
+ },
+ //数据导出
+ excelexport(data){
+ return service.post("/api/homework_manage/excelexport",data)
+ }
+}
+export default UpdateWorkApi;
\ No newline at end of file
diff --git a/work/src/views/AddWork.vue b/work/src/views/AddWork.vue
index 25a3e40..458c4a8 100644
--- a/work/src/views/AddWork.vue
+++ b/work/src/views/AddWork.vue
@@ -30,10 +30,10 @@
+ @select="handleSelectArticle" clearable @change="handleArticleChange"/>
-
+
@@ -91,6 +91,7 @@ import { ref, onMounted, computed } from 'vue'
import AddWorkApi from '../api/AddWorkApi';
import _ from 'lodash';
import dayjs from 'dayjs';
+import { ElMessage } from 'element-plus'
const options = ref([
{ id: 1, name: '牧民俱乐部' },
@@ -141,6 +142,12 @@ const back = () => {
const articleSearchResults = ref([]);
// 根据文章输入内容查询关联文章的函数
const queryArticleList = async (queryString: string) => {
+ if (form.value.LiveId) {
+ ElMessage.warning('您已关联直播,暂无法关联文章');
+ articleTitle.value = ''; // 清空文章标题输入框
+ form.value.LiveId = '';
+ return [];
+ }
try {
const response = await AddWorkApi.getArticleList(queryString);
const formattedResults = response.data.map(article => ({
@@ -164,6 +171,14 @@ const handleSelectArticle = (article: { label: string }) => {
articleTitle.value = selectedArticle.value; // 更新显示的文章题目
}
};
+const handleLiveChange = () => {
+ if (form.value.ArticleId) {
+ ElMessage.warning('您已关联文章,暂无法关联直播');
+ form.value.LiveId = ''; // 清空关联直播选择框的值
+ form.value.ArticleId = '';
+ articleTitle.value = '';
+ }
+};
//获取直播列表
const live = ref([]);
@@ -192,10 +207,7 @@ const getQuestionTypeText = (type) => {
return '未知类型题目';
}
};
-// 从content字符串中解析出选项数组
-// const getOptionsFromContent = (content) => {
-// return JSON.parse(content);
-// };
+
const addSingleChoice = () => {
questions.value.push({
type: 1, // 假设1代表单选,和后端格式对应起来
@@ -259,7 +271,6 @@ const handleMouseLeave = (index) => {
onMounted(() => {
isHovered.value = Array(questions.value.length).fill(false);
});
-