Compare commits
No commits in common. "0999e92241aa39aa6f32595429599805caa06155" and "072cdf6fdc828ffd2afeba8d45d44886a9208bea" have entirely different histories.
0999e92241
...
072cdf6fdc
@ -57,9 +57,6 @@ const getCount = (data) => {
|
||||
const postQa = (data) => {
|
||||
return http.post("/admin/qa", data,"application/json");
|
||||
};
|
||||
const postQaList = (data) => {
|
||||
return http.post("/admin/qa/list", data,"application/json");
|
||||
};
|
||||
const putQa = (id,data) => {
|
||||
return http.put("/admin/qa/"+id ,data,"application/json");
|
||||
};
|
||||
@ -160,7 +157,6 @@ export default {
|
||||
updatePassword,
|
||||
getCount,
|
||||
postQa,
|
||||
postQaList,
|
||||
putQa,
|
||||
putRule,
|
||||
postQaitem,
|
||||
|
||||
@ -46,11 +46,8 @@
|
||||
<el-form-item label="密码" :label-width="formLabelWidth" prop="qa_password">
|
||||
<el-input v-model="FormData.qa_password" style="width: 60%;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="不允许重复" :label-width="formLabelWidth" prop="is_repeat" >
|
||||
<el-select v-model="repeat_qa_id" placeholder="请选择" multiple filterable
|
||||
remote remote-show-suffix :remote-method="remoteMethod" style="width: 60%;" >
|
||||
<el-option v-for="item in options" :key="item.qa_id" :label="item.qa_name" :value="item.qa_id" />
|
||||
</el-select>
|
||||
<el-form-item label="是否允许重复" :label-width="formLabelWidth" prop="is_repeat">
|
||||
<el-switch v-model="FormData.is_repeat" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启计时器" :label-width="formLabelWidth" prop="is_turn_timer">
|
||||
<el-switch v-model="FormData.is_turn_timer" :active-value="1" :inactive-value="0" />
|
||||
@ -229,13 +226,9 @@ const rules = reactive({
|
||||
}]
|
||||
|
||||
})
|
||||
const repeat_qa_id=ref([])
|
||||
const qaList=ref([])
|
||||
const options = ref([])
|
||||
const dialogImageUrl = ref("");
|
||||
const dialogVisiblei = ref(false);
|
||||
const feihua = ref(false);
|
||||
const suffix = ref(true);
|
||||
const question_times=ref(
|
||||
{
|
||||
type1:'',
|
||||
@ -264,9 +257,6 @@ FormData: {
|
||||
action_type:{
|
||||
type:String,
|
||||
default:"1"//0修改密码//1增加数据//2修改数据//3规则//4链接//5选择题目类型
|
||||
},
|
||||
qa_id:{
|
||||
type:String
|
||||
}
|
||||
})
|
||||
const content = ref('');
|
||||
@ -298,13 +288,13 @@ console.log(question_times.value)
|
||||
if(props.action_type=="1")
|
||||
{
|
||||
|
||||
emits("save-click",props.action_type,'',content.value,base_token_item.value,question_times.value,repeat_qa_id.value);
|
||||
emits("save-click",props.action_type,'',content.value,base_token_item.value,question_times.value);
|
||||
}
|
||||
|
||||
else if(props.action_type=='2')
|
||||
{
|
||||
// console.log(base_token_item.value)
|
||||
emits("save-click",props.action_type,action.value,content.value,base_token_item.value,question_times.value,repeat_qa_id.value);
|
||||
emits("save-click",props.action_type,action.value,content.value,base_token_item.value,question_times.value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,19 +302,8 @@ const handleCloseDialog=() => {
|
||||
base_token_item.value=[]
|
||||
question_times.value=[]
|
||||
isfirst.value=true
|
||||
repeat_qa_id.value=[]
|
||||
emits("closeDialog");
|
||||
}
|
||||
const postQaList=()=>{
|
||||
request.postQaList().then((res) => {
|
||||
const newList = res.data.data.filter(item => item.qa_id !== props.qa_id);
|
||||
qaList.value =[]
|
||||
qaList.value = [...newList]
|
||||
options.value = qaList.value
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const open = (titles, spans) => {
|
||||
|
||||
@ -467,25 +446,6 @@ watch(() => props.FormData.question_qa_timer, (newVal, oldVal) => {
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => props.FormData.repeat_qa_id, (newVal, oldVal) => {
|
||||
|
||||
|
||||
initqa()
|
||||
|
||||
})
|
||||
const initqa = () => {
|
||||
|
||||
repeat_qa_id.value=[]
|
||||
if(props.FormData.repeat_qa_id!=null&&props.FormData.repeat_qa_id.length>0)
|
||||
{
|
||||
|
||||
props.FormData.repeat_qa_id.forEach((item,index)=>{
|
||||
repeat_qa_id.value.push(item.qa_id)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
watch(() => props.FormData.base_token_item, (newVal, oldVal) => {
|
||||
|
||||
|
||||
@ -506,10 +466,7 @@ const inittoken = () => {
|
||||
const dialogVisibles=ref(false)
|
||||
watch(() => props.dialogVisible, (newVal, oldVal) => {
|
||||
dialogVisibles.value=props.dialogVisible
|
||||
if(dialogVisibles.value)
|
||||
{
|
||||
postQaList()
|
||||
}
|
||||
|
||||
})
|
||||
watch(()=> props.fileList, (newVal, oldVal) => {
|
||||
|
||||
@ -695,20 +652,6 @@ request.getOssSign({
|
||||
feihua.value=false
|
||||
}
|
||||
}
|
||||
|
||||
const remoteMethod = (query) => {
|
||||
if (query) {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
options.value = qaList.value.filter((item) => {
|
||||
return item.qa_name.toLowerCase().includes(query.toLowerCase())
|
||||
})
|
||||
}, 200)
|
||||
} else {
|
||||
options.value = qaList.value
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep input::-webkit-outer-spin-button,
|
||||
|
||||
@ -25,6 +25,11 @@
|
||||
<el-form-item label="飞花令数" :label-width="formLabelWidth" prop="token_nums" v-else >
|
||||
<el-input v-model="FormData.token_num" style="width: 60%;" type="number" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="呈现类型" :label-width="formLabelWidth" prop="qa_display_type">
|
||||
<el-select v-model="FormData.qa_display_type" placeholder="请选择" @change="changeDisplayType" >
|
||||
<el-option v-for="item in optionstype" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="飞花令类型" :label-width="formLabelWidth" prop="feihua_type" >
|
||||
<el-select v-model="base_token_item" placeholder="请选择" multiple >
|
||||
<el-option v-for="item in tokenlist" :key="item.token_id" :label="item.token_name" :value="item.token_id" />
|
||||
@ -50,14 +55,8 @@
|
||||
<el-form-item label="密码" :label-width="formLabelWidth" prop="qa_password">
|
||||
<el-input v-model="FormData.qa_password" style="width: 60%;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否允许重复" :label-width="formLabelWidth" prop="is_repeat">
|
||||
<el-form-item label="是否允许重复" :label-width="formLabelWidth" prop="is_repeat">
|
||||
<el-switch v-model="FormData.is_repeat" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="不允许重复" :label-width="formLabelWidth" prop="is_repeat" >
|
||||
<el-select v-model="repeat_qa_id" placeholder="请选择" multiple filterable
|
||||
remote remote-show-suffix :remote-method="remoteMethod" style="width: 60%;" >
|
||||
<el-option v-for="item in options" :key="item.qa_id" :label="item.qa_name" :value="item.qa_id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启计时器" :label-width="formLabelWidth" prop="is_turn_timer">
|
||||
<el-switch v-model="FormData.is_turn_timer" :active-value="1" :inactive-value="0" />
|
||||
@ -286,9 +285,6 @@ FormData: {
|
||||
feihua3:{
|
||||
type: Boolean,
|
||||
default: false //是否是知识问答3
|
||||
},
|
||||
qa_id:{
|
||||
type:String
|
||||
}
|
||||
})
|
||||
const content = ref('');
|
||||
@ -305,9 +301,6 @@ const emits = defineEmits(["save-click","closeDialog"]);
|
||||
const action=ref(1)
|
||||
const isfirst=ref(true)
|
||||
const base_token_item=ref([])
|
||||
const repeat_qa_id=ref([])
|
||||
const options = ref([])
|
||||
const qaList=ref([])
|
||||
function onSubmit() {
|
||||
if(quantitynumber.value<props.FormData.token_num)
|
||||
{
|
||||
@ -322,13 +315,13 @@ function onSubmit() {
|
||||
if(props.action_type=="1")
|
||||
{
|
||||
|
||||
emits("save-click",props.action_type,'',content.value,base_token_item.value,question_types.value,question_times.value,repeat_qa_id.value);
|
||||
emits("save-click",props.action_type,'',content.value,base_token_item.value,question_types.value,question_times.value);
|
||||
}
|
||||
|
||||
else if(props.action_type=='2')
|
||||
{
|
||||
console.log(base_token_item.value)
|
||||
emits("save-click",props.action_type,action.value,content.value,base_token_item.value,question_types.value,question_times.value,repeat_qa_id.value);
|
||||
emits("save-click",props.action_type,action.value,content.value,base_token_item.value,question_types.value,question_times.value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,7 +330,6 @@ const handleCloseDialog=() => {
|
||||
question_types.value=[]
|
||||
base_token_item.value=[]
|
||||
question_times.value=[]
|
||||
repeat_qa_id.value=[]
|
||||
emits("closeDialog");
|
||||
}
|
||||
|
||||
@ -511,27 +503,6 @@ watch(() => props.FormData.base_token_item, (newVal, oldVal) => {
|
||||
inittoken()
|
||||
|
||||
})
|
||||
|
||||
watch(() => props.FormData.repeat_qa_id, (newVal, oldVal) => {
|
||||
|
||||
|
||||
initqa()
|
||||
|
||||
})
|
||||
|
||||
const initqa = () => {
|
||||
|
||||
repeat_qa_id.value=[]
|
||||
if(props.FormData.repeat_qa_id!=null&&props.FormData.repeat_qa_id.length>0)
|
||||
{
|
||||
|
||||
props.FormData.repeat_qa_id.forEach((item,index)=>{
|
||||
repeat_qa_id.value.push(item.qa_id)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const inittoken = () => {
|
||||
|
||||
base_token_item.value=[]
|
||||
@ -546,11 +517,6 @@ const inittoken = () => {
|
||||
const dialogVisibles=ref(false)
|
||||
watch(() => props.dialogVisible, (newVal, oldVal) => {
|
||||
dialogVisibles.value=props.dialogVisible
|
||||
if(dialogVisibles.value)
|
||||
{
|
||||
postQaList()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
watch(()=> props.fileList, (newVal, oldVal) => {
|
||||
@ -588,7 +554,7 @@ const initLabel = () => {
|
||||
tokenlist.value = res.data.data
|
||||
|
||||
})
|
||||
// postQaList()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -715,28 +681,6 @@ request.getOssSign({
|
||||
})
|
||||
}
|
||||
|
||||
const postQaList=()=>{
|
||||
request.postQaList().then((res) => {
|
||||
|
||||
const newList = res.data.data.filter(item => item.qa_id !== props.qa_id);
|
||||
qaList.value =[]
|
||||
qaList.value = [...newList]
|
||||
options.value = qaList.value
|
||||
})
|
||||
}
|
||||
const remoteMethod = (query) => {
|
||||
if (query) {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
options.value = qaList.value.filter((item) => {
|
||||
return item.qa_name.toLowerCase().includes(query.toLowerCase())
|
||||
})
|
||||
}, 200)
|
||||
} else {
|
||||
options.value = qaList.value
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep input::-webkit-outer-spin-button,
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
:dialogWidth="dialogWidth" @save-click="save" @closeDialog="closeDialog" :links="links" ></DiaglogView>
|
||||
|
||||
<bank :dialogVisible="dialogVisibles" :FormData=FoData :formLabelWidth="formLabelWidth" :action_type="action_type"
|
||||
:fileList=fileList @save-click="saves" @closeDialog="closeDialogs" :qa_id="qa_id" ></bank>
|
||||
:fileList=fileList @save-click="saves" @closeDialog="closeDialogs" ></bank>
|
||||
</div>
|
||||
|
||||
<subject :dialogVisibled="dialogVisibled" :qa_id="qa_id" @closeDialog="closeDialogd" />
|
||||
@ -198,8 +198,8 @@
|
||||
|
||||
// },
|
||||
]
|
||||
,
|
||||
repeat_qa_id:[]
|
||||
,
|
||||
is_repeat:0
|
||||
})
|
||||
|
||||
|
||||
@ -261,7 +261,7 @@ const closeDialogs=() => {
|
||||
|
||||
dialogVisibles.value = false
|
||||
}
|
||||
const saves = (action_type,action,content,base_token_item,question_times,repeat_qa_id) => {
|
||||
const saves = (action_type,action,content,base_token_item,question_times) => {
|
||||
FoData.value.question_qa_timer=[]
|
||||
if(FoData.value.is_turn_timer=='1')
|
||||
{
|
||||
@ -300,21 +300,7 @@ if(question_times.type4!='')
|
||||
|
||||
}
|
||||
|
||||
if(repeat_qa_id.length>0)
|
||||
{
|
||||
FoData.value.repeat_qa_id=[]
|
||||
repeat_qa_id.forEach((item,index)=>{
|
||||
FoData.value.repeat_qa_id.push({
|
||||
qa_id:item,
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
FoData.value.repeat_qa_id=null
|
||||
}
|
||||
|
||||
|
||||
if(FoData.value.qa_display_type==2)
|
||||
@ -444,6 +430,7 @@ const ItemViewshow = (item) => {
|
||||
FoData.value.qa_password=res.data.data.qa_password
|
||||
FoData.value.image=res.data.data.image
|
||||
FoData.value.is_turn_timer=res.data.data.is_turn_timer
|
||||
FoData.value.is_repeat=res.data.data.is_repeat
|
||||
fileList.value=[]
|
||||
fileList.value.push({url:FoData.value.image})
|
||||
FoData.value.question_qa_item=[]
|
||||
@ -468,14 +455,6 @@ const ItemViewshow = (item) => {
|
||||
FoData.value.question_qa_timer=res.data.data.question_qa_timer
|
||||
}
|
||||
|
||||
if(res.data.data.repeat_qa_id==null)
|
||||
{
|
||||
FoData.value.repeat_qa_id=[]
|
||||
}
|
||||
else
|
||||
{
|
||||
FoData.value.repeat_qa_id=res.data.data.repeat_qa_id
|
||||
}
|
||||
|
||||
|
||||
dialogVisibleShows()
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
:dialogWidth="dialogWidth" @save-click="save" @closeDialog="closeDialog" :links="links" ></DiaglogView>
|
||||
|
||||
<bank :dialogVisible="dialogVisibles" :FormData=FoData :formLabelWidth="formLabelWidth" :action_type="action_type" :feihua3="true"
|
||||
:fileList=fileList @save-click="saves" @closeDialog="closeDialogs" :qa_id="qa_id" ></bank>
|
||||
:fileList=fileList @save-click="saves" @closeDialog="closeDialogs" ></bank>
|
||||
</div>
|
||||
|
||||
<subject :dialogVisibled="dialogVisibled" :qa_id="qa_id" @closeDialog="closeDialogd" />
|
||||
@ -198,7 +198,6 @@
|
||||
|
||||
// },
|
||||
]
|
||||
, repeat_qa_id:[]
|
||||
})
|
||||
|
||||
|
||||
@ -260,7 +259,7 @@ const closeDialogs=() => {
|
||||
|
||||
dialogVisibles.value = false
|
||||
}
|
||||
const saves = (action_type,action,content,base_token_item,question_types,question_times,repeat_qa_id) => {
|
||||
const saves = (action_type,action,content,base_token_item,question_types,question_times) => {
|
||||
FoData.value.question_qa_timer=[]
|
||||
if(FoData.value.is_turn_timer=='1')
|
||||
{
|
||||
@ -320,21 +319,6 @@ if(question_types.type4!='')
|
||||
}
|
||||
|
||||
|
||||
if(repeat_qa_id.length>0)
|
||||
{
|
||||
FoData.value.repeat_qa_id=[]
|
||||
repeat_qa_id.forEach((item,index)=>{
|
||||
FoData.value.repeat_qa_id.push({
|
||||
qa_id:item,
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
FoData.value.repeat_qa_id=null
|
||||
}
|
||||
if(FoData.value.qa_display_type==2)
|
||||
{
|
||||
if(base_token_item.length>0)
|
||||
@ -482,7 +466,7 @@ const ItemViewshow = (item) => {
|
||||
FoData.value.base_token_item=res.data.data.base_token_item
|
||||
}
|
||||
FoData.value.is_turn_timer=res.data.data.is_turn_timer
|
||||
// FoData.value.is_repeat=res.data.data.is_repeat
|
||||
FoData.value.is_repeat=res.data.data.is_repeat
|
||||
if(res.data.data.question_qa_timer==null)
|
||||
{
|
||||
FoData.value.question_qa_timer=[]
|
||||
@ -491,15 +475,6 @@ const ItemViewshow = (item) => {
|
||||
{
|
||||
FoData.value.question_qa_timer=res.data.data.question_qa_timer
|
||||
}
|
||||
if(res.data.data.repeat_qa_id==null)
|
||||
{
|
||||
FoData.value.repeat_qa_id=[]
|
||||
}
|
||||
else
|
||||
{
|
||||
FoData.value.repeat_qa_id=res.data.data.repeat_qa_id
|
||||
}
|
||||
|
||||
|
||||
|
||||
dialogVisibleShows()
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
:dialogWidth="dialogWidth" @save-click="save" @closeDialog="closeDialog" :links="links" ></DiaglogView>
|
||||
|
||||
<bank :dialogVisible="dialogVisibles" :FormData=FoData :formLabelWidth="formLabelWidth" :action_type="action_type"
|
||||
:fileList=fileList @save-click="saves" @closeDialog="closeDialogs" :qa_id="qa_id" ></bank>
|
||||
:fileList=fileList @save-click="saves" @closeDialog="closeDialogs" ></bank>
|
||||
</div>
|
||||
|
||||
<subject :dialogVisibled="dialogVisibled" :qa_id="qa_id" @closeDialog="closeDialogd" />
|
||||
@ -199,7 +199,7 @@
|
||||
// },
|
||||
]
|
||||
,
|
||||
repeat_qa_id:[]
|
||||
is_repeat:0
|
||||
})
|
||||
|
||||
|
||||
@ -261,7 +261,7 @@ const closeDialogs=() => {
|
||||
|
||||
dialogVisibles.value = false
|
||||
}
|
||||
const saves = (action_type,action,content,base_token_item,question_types,question_times,repeat_qa_id) => {
|
||||
const saves = (action_type,action,content,base_token_item,question_types,question_times) => {
|
||||
FoData.value.question_qa_timer=[]
|
||||
if(FoData.value.is_turn_timer=='1')
|
||||
{
|
||||
@ -315,23 +315,8 @@ if(question_types.type4!='')
|
||||
|
||||
}
|
||||
|
||||
console.log('repeat_qa_id'+repeat_qa_id)
|
||||
|
||||
if(repeat_qa_id.length>0)
|
||||
{
|
||||
FoData.value.repeat_qa_id=[]
|
||||
repeat_qa_id.forEach((item,index)=>{
|
||||
FoData.value.repeat_qa_id.push({
|
||||
qa_id:item,
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
FoData.value.repeat_qa_id=null
|
||||
}
|
||||
|
||||
if(FoData.value.qa_display_type==2)
|
||||
{
|
||||
@ -480,7 +465,7 @@ const ItemViewshow = (item) => {
|
||||
FoData.value.base_token_item=res.data.data.base_token_item
|
||||
}
|
||||
FoData.value.is_turn_timer=res.data.data.is_turn_timer
|
||||
|
||||
FoData.value.is_repeat=res.data.data.is_repeat
|
||||
if(res.data.data.question_qa_timer==null)
|
||||
{
|
||||
FoData.value.question_qa_timer=[]
|
||||
@ -489,16 +474,6 @@ const ItemViewshow = (item) => {
|
||||
{
|
||||
FoData.value.question_qa_timer=res.data.data.question_qa_timer
|
||||
}
|
||||
if(res.data.data.repeat_qa_id==null)
|
||||
{
|
||||
FoData.value.repeat_qa_id=[]
|
||||
}
|
||||
else
|
||||
{
|
||||
FoData.value.repeat_qa_id=res.data.data.repeat_qa_id
|
||||
}
|
||||
|
||||
|
||||
console.log(FoData.value.question_qa_timer)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user