2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
/* empty css */import{n as l}from"./vueComponentNormalizer.9ef17bb1.js";import{F as o}from"./FormLayout.c7820bdd.js";import{T as c}from"./TableLayout.05a39499.js";import{D as p}from"./DialogLayout.e3af3567.js";import{S as u}from"./SearchTreeMenu.cf3d6165.js";import{e as d,b as f,c as _,p as h,a as g,d as m,f as y,g as w,h as v,i as b}from"./paper.f38f6971.js";import{g as C}from"./exam.b89e27c3.js";import{Q as P}from"./QueryInput.7afa399e.js";import{P as x}from"./PaperClassifySelector.496f2459.js";import{E as $}from"./ExercisePerviewPaper.d6f9cd34.js";/* empty css *//* empty css */import"./ActionBar.1725b1a3.js";/* empty css *//* empty css */import"./index.51e15757.js";import"./QuestionsList.4ae2bac5.js";import"./QuestionItem.1944680c.js";/* empty css */import"./questionInfoMapJsonTrans.58e126b5.js";var S=function(){var t,e=this,s=e.$createElement,i=e._self._c||s;return i("div",{staticClass:"v-page classify_page"},[i("SearchTreeMenu",{directives:[{name:"loading",rawName:"v-loading",value:e.classify_loading,expression:"classify_loading"}],ref:"treeMenuRef",attrs:{title:"\u8BD5\u5377\u5206\u7C7B\u5217\u8868","tree-data":e.paper_classify_list},on:{"current-change":e.change,onCreate:e.toCreateClassify,onDelete:e.toDeleteclassify,onEdit:e.toEditClassify}}),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.paper_list_loading,expression:"paper_list_loading"}],staticClass:"v-ctx"},[i("FormLayout",{ref:"formLayoutRef",attrs:{items:e.formItems,model:e.form,rules:e.rules,"label-width":"70px","label-position":"right",inline:!0},scopedSlots:e._u([{key:"title",fn:function(){return[i("QueryInput",{on:{query:e.pagingFindList},model:{value:e.form.title,callback:function(a){e.$set(e.form,"title",a)},expression:"form.title"}})]},proxy:!0},{key:"btns",fn:function(){return[i("el-button",{attrs:{type:"danger",round:""},on:{click:e.deletePapers}},[e._v("\u5220\u9664\u9009\u4E2D")]),i("el-button",{attrs:{type:"primary",round:"",plain:""},on:{click:e.batchMoveToClassify}},[e._v("\u79FB\u52A8\u5230\u5206\u7C7B")]),i("el-button",{attrs:{type:"primary",round:""},on:{click:e.addPaperHandler}},[e._v("\u6DFB\u52A0\u8BD5\u5377")])]},proxy:!0}])}),i("TableLayout",{attrs:{column:e.column,data:e.table_data,pageInfo:e.page_info,selection:""},on:{"current-change":function(a){return e.pagingChange({currentPage:a})},"size-change":function(a){return e.pagingChange({pageSize:a})},"selection-change":e.handleSelectionChange},scopedSlots:e._u([{key:"action",fn:function(a){return[a.row.share===1||e.$store.user.baseRole===1||e.$store.user.id===a.row.creatorId?i("el-button",{attrs:{type:"text",icon:"i-j-ksap-bianji2"},on:{click:function(n){return e.editPaper(a.row)}}},[e._v("\u7F16\u8F91")]):e._e(),i("el-button",{attrs:{type:"text",icon:"i-j-ksap-fuzhi"},on:{click:function(n){return e.copyPaper(a.row)}}},[e._v("\u590D\u5236")]),i("el-button",{attrs:{type:"text",icon:"i-j-fbks-yulan"},on:{click:function(n){return e.previewPaper(a.row)}}},[e._v("\u9884\u89C8")]),a.row.share===1||e.$store.user.baseRole===1||e.$store.user.id===a.row.creatorId?i("el-button",{staticStyle:{color:"#f04343 !important"},attrs:{type:"text",icon:"i-j-ksap-shanchu"},on:{click:function(n){return e.deletePapers(n,a.row)}}},[e._v("\u5220\u9664")]):e._e()]}},{key:"isOpen",fn:function(a){return[i("el-switch",{staticStyle:{"margin-left":"10px"},attrs:{"active-value":1,"inactive-value":0},on:{change:function(n){return e.changeItemStatus(n,a.row)}},model:{value:a.row.status,callback:function(n){e.$set(a.row,"status",n)},expression:"props.row.status"}})]}}])})],1),i("DialogLayout",{attrs:{title:"\u9009\u62E9\u5206\u7C7B",width:"280px",visible:e.select_classify_dialog_is_show},on:{onCancel:function(a){e.current_selected_classify_id=null,e.select_classify_dialog_is_show=!1},onConfirm:e.onMoveConfirm}},[i("PaperClassifySelector",{attrs:{mountedLoad:!0},model:{value:e.current_selected_classify_id,callback:function(a){e.current_selected_classify_id=a},expression:"current_selected_classify_id"}})],1),i("DialogLayout",{attrs:{title:"\u9884\u89C8",width:"600px",visible:e.preview_paper_dialog_show,actionBarOption:{confirmTxt:"\u6253\u5370"}},on:{onCancel:function(a){e.preview_paper_dialog_show=!1},onConfirm:e.printx}},[i("ExercisePerviewPaper",{ref:"printRef",attrs:{questions:e.preview_current_questions_list,title:(t=e.current_select_paper)===null||t===void 0?void 0:t.title,mode:2}})],1)],1)},k=[];const E={components:{SearchTreeMenu:u,TableLayout:c,FormLayout:o,QueryInput:P,DialogLayout:p,PaperClassifySelector:x,ExercisePerviewPaper:$},data:()=>({paper_classify_list:[],table_data:[],page_info:{currentPage:1,pageSize:10,total:0},current_classify_id:null,classify_loading:!1,paper_list_loading:!1,form:{title:""},table_selections_list:[],current_selected_classify_id:null,select_classify_dialog_is_show:!1,preview_current_questions_list:[],preview_paper_dialog_show:!1,current_select_paper:null}),created(){this.formItems=[{prop:"title"},{prop:"btns",model:{class:"gy-btns"}}],this.rules={},this.column=[{prop:"title",label:"\u8BD5\u5377\u540D",align:"center","show-overflow-tooltip":!0},{prop:"classify",label:"\u8BD5\u5377\u5206\u7C7B",align:"center","show-overflow-tooltip":!0},{prop:"totalScore",label:"\u603B\u5206",align:"center","show-overflow-tooltip":!0},{prop:"questionCount",label:"\u8BD5\u9898\u603B\u6570",align:"center","show-overflow-tooltip":!0},{prop:"creator",label:"\u521B\u5EFA\u4EBA",align:"center","show-overflow-tooltip":!0},{prop:"createTime",label:"\u521B\u5EFA\u65F6\u95F4",width:150,align:"center","show-overflow-tooltip":!0},{prop:"action",label:"\u64CD\u4F5C",width:290,align:"center"},{prop:"isOpen",label:"\u662F\u5426\u5F00\u542F",width:80,align:"center","show-overflow-tooltip":!0}],this.findAllQuestionsClassify()},activated(){this.pagingFindList()},methods:{printx(){window.printElement&&window.printElement.remove(),window.printElement=document.createElement("iframe"),window.printElement.style="display:none;",window.printElement.onload=()=>{const t=window.printElement.contentWindow.document.body;t.appendChild(document.head.cloneNode(1)),t.style="-webkit-print-color-adjust:exact;background:#fff;",t.appendChild(this.$refs.printRef.$el.cloneNode(1)),window.printElement.contentWindow.print()},document.body.appendChild(window.printElement)},previewPaper(t){this.current_select_paper=t,this.page_is_loading=!0,C(t.id).then(e=>{this.preview_current_questions_list=e.data,this.preview_paper_dialog_show=!0}).finally(e=>{this.page_is_loading=!1})},toEditClassify(t){if(t.id==="system")return this.$message.error("\u6839\u5206\u7C7B\u4E0D\u80FD\u4FEE\u6539");this.$prompt("\u8BF7\u8F93\u5165\u65B0\u5206\u7C7B\u540D\uFF1A","\u7F16\u8F91",{inputPattern:/.{1,}/,inputErrorMessage:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D"}).then(({value:e})=>{this.classify_loading=!0,d({...t,name:e}).then(s=>{this.$message.success("\u4FEE\u6539\u6210\u529F"),this.findAllQuestionsClassify()}).finally(s=>{this.classify_loading=!1})}).catch(()=>{})},onMoveConfirm(){const t=this.table_selections_list.map(s=>s.id),e=this.current_selected_classify_id;this.paper_list_loading=!0,f({ids:t,classifyId:e}).then(s=>{this.pagingFindList(),this.select_classify_dialog_is_show=!1}).finally(s=>{this.paper_list_loading=!1})},batchMoveToClassify(){if(this.table_selections_list.length===0)return this.$message.error("\u8BF7\u5148\u9009\u62E9\u8981\u79FB\u52A8\u7684\u8BD5\u5377");this.select_classify_dialog_is_show=!0},copyPaper(t){this.$prompt(`\u590D\u5236\u8BD5\u5377\u3010${t.title}\u3011\u5E76\u91CD\u547D\u540D\u4E3A\uFF1A`,"\u91CD\u547D\u540D",{inputPattern:/.{1,}/,inputErrorMessage:"\u8BF7\u586B\u5199\u65B0\u8BD5\u5377\u540D"}).then(({value:e})=>{this.paper_list_loading=!0,_({id:t.id,title:e}).then(s=>{this.pagingFindList()}).finally(s=>{this.paper_list_loading=!1})}).catch(e=>{})},changeItemStatus(t,e){const s={id:e.id,status:t};h(s).then(i=>{i.code!==0&&(e.status=t===1?0:1,this.$message.error("\u4FEE\u6539\u5931\u8D25"))})},async editPaper(t){const{data:e}=await g(t.id);if(e.length>0){const s=e.map(i=>i.title);this.$confirm(`\u5F53\u524D\u8BD5\u5377\u6709\u8003\u8BD5\uFF08${s.join("\uFF0C")}\uFF09\u5DF2\u7ECF\u5F15\u7528, \u60A8\u786E\u5B9A\u8981\u4FEE\u6539\u5185\u5BB9\u5417?`,"\u8B66\u544A",{type:"warning"}).then(i=>{this.$router.push({path:"/assessment-evaluation/examination-paper-manage/add-modify-paper/"+t.id})}).catch(i=>{})}else this.$router.push({path:"/assessment-evaluation/examination-paper-manage/add-modify-paper/"+t.id})},addPaperHandler(){this.$router.push({path:"/assessment-evaluation/examination-paper-manage/add-modify-paper"})},handleSelectionChange(t){this.table_selections_list=t},pagingChange(t){typeof t.currentPage!="number"&&typeof t.pageSize!="number"||(this.page_info={...this.page_info,...t},this.pagingFindList())},initPageInfo(){this.page_info={currentPage:1,pageSize:this.page_info.pageSize,total:0}},pagingFindList(t){t instanceof PointerEvent&&this.initPageInfo();let e=this.current_classify_id;e==="system"&&(e=null),this.paper_list_loading=!0,m({...this.page_info,classifyId:e,...this.form}).then(s=>{const{currentPage:i,pageSize:a,total:n}=s.data;this.table_data=s.data.data,this.table_data.length===0&&this.page_info.currentPage!=1&&(this.initPageInfo(),this.pagingFindList()),this.page_info={currentPage:i,pageSize:a,total:n}}).finally(s=>{this.paper_list_loading=!1})},async findAllQuestionsClassify(){const{data:t}=await y(),e=[{id:"system",name:"\u8BD5\u5377\u5206\u7C7B",disabled:!0,children:[]}];this.questionClassifyMap={},this.questionClassifyMap=t.toTree(),e[0].children=this.questionClassifyMap.tree,this.paper_classify_list=e},change(t){this.current_classify_id=t.id,this.pagingFindList()},toCreateClassify(t){(t==null?void 0:t.id)==="system"&&(t=null),this.$prompt("\u8BF7\u8F93\u5165\u5206\u7C7B\u540D","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88"}).then(async({value:e})=>{const s={name:e,pid:t==null?0:t.id,level:t==null?1:t.level+1};await w(s),this.findAllQuestionsClassify()}).catch(e=>{})},deletePapers(t,e){if(this.table_selections_list.length===0&&e==null)this.$message.error("\u8BF7\u5148\u9009\u62E9\u8981\u5220\u9664\u7684\u9879\u76EE");else{let s=this.table_selections_list;e&&(s=[e]),this.$confirm("\u786E\u8BA4\u5220\u9664\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(i=>{this.paper_list_loading=!0,v(s.map(a=>a.id)).then(a=>{this.pagingFindList(),this.paper_list_loading=!1})}).catch(i=>{})}},toDeleteclassify(t){t.id!=="system"&&new Promise((e,s)=>{this.$confirm("\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u6B64\u5206\u7C7B\uFF0C\u53CA\u5176\u5B50\u7EA7\u5206\u7C7B\uFF0C\u8BF7\u786E\u8BA4\u540E\u5220\u9664?","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(i=>e()).catch(i=>s(i))}).then(e=>{this.classify_loading=!0,b(t.id).finally(()=>{this.findAllQuestionsClassify(),this.$refs.treeMenuRef.setCurrentKey(),this.classify_loading=!1})}).catch(e=>{})}}},r={};var L=l(E,S,k,!1,A,null,null,null);function A(t){for(let e in r)this[e]=r[e]}const Y=function(){return L.exports}();export{Y as default};
|