| | |
| | | </div> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row> |
| | | <div class="xinz-infs"> |
| | | <el-form-item label="适用疾病" prop="region"> |
| | | <div class="xinz-inf"> |
| | | <el-tag |
| | | :key="item.icd10name" |
| | | type="warning" |
| | | v-for="item in illnesslist" |
| | | closable |
| | | :disable-transitions="false" |
| | | @close="handleCloseillness(item)" |
| | | > |
| | | {{ item.icd10name }} |
| | | </el-tag> |
| | | <el-select |
| | | v-model="inputValueillness" |
| | | v-if="inputVisibleillness" |
| | | @change="illnessConfirm" |
| | | :remote-method="remoteMethod" |
| | | filterable |
| | | remote |
| | | allow-create |
| | | default-first-option |
| | | placeholder="请选择/查询" |
| | | :loading="loading" |
| | | > |
| | | <el-option |
| | | v-for="item in optionsillness" |
| | | :key="item.icdid" |
| | | :label="item.icdname" |
| | | :value="item.icdid" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <el-button |
| | | v-else |
| | | class="button-new-tag" |
| | | size="small" |
| | | @click="inputVisibleillness = true" |
| | | >+ 新增疾病</el-button |
| | | > |
| | | </div> |
| | | <el-tag |
| | | v-for="tag in displayedTags" |
| | | :key="tag.icdid" |
| | | type="warning" |
| | | :disable-transitions="false" |
| | | > |
| | | {{ tag.icdname }} |
| | | </el-tag> |
| | | <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> |
| | | </el-form-item> |
| | | </el-row> |
| | | </div> |
| | | <div style="margin-left: 120px; margin-bottom: 10px"> |
| | | <el-button type="warning" @click="$refs.child.handleAddpatient()" |
| | | >疾病详情</el-button |
| | | > |
| | | </div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="版本号" prop="name"> |
| | | <el-input v-model="ruleForm.version"></el-input> </el-form-item |
| | | <el-input |
| | | v-model="ruleForm.version" |
| | | placeholder="默认1.0" |
| | | ></el-input> </el-form-item |
| | | ></el-col> |
| | | <el-col :span="9"> |
| | | <el-form-item label="可用状态" prop="region"> |
| | | <el-select |
| | | v-model="ruleForm.isenable" |
| | | size="medium" |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | class="ruleFormaa" |
| | | v-for="item in usable" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | <el-radio-group v-model="ruleForm.isAvailable"> |
| | | <el-radio |
| | | v-for="(item, index) in usable" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-option> |
| | | </el-select> </el-form-item |
| | | ></el-col> |
| | | </el-radio-group> |
| | | </el-form-item></el-col |
| | | > |
| | | </el-row> |
| | | <el-form-item label="问卷方式" prop="region"> |
| | | <el-select |
| | |
| | | </div> |
| | | <!-- 问卷设置 --> |
| | | <div v-if="Editprogress == 2"> |
| | | <div class="leftvlue-jbxx">问卷题目设置</div> |
| | | <div class="leftvlue-jbxx"> |
| | | 问卷题目设置 |
| | | <span style="" |
| | | ><el-button |
| | | type="warning" |
| | | icon="el-icon-finished" |
| | | round |
| | | @click="test" |
| | | >题目规则效验</el-button |
| | | ></span |
| | | > |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div style="display: flex; justify-content: space-between"> |
| | | <div> |
| | |
| | | round |
| | | @click="getaddtopiclist" |
| | | >添加题目</el-button |
| | | > |
| | | <el-button |
| | | type="success" |
| | | icon="el-icon-edit-outline" |
| | | round |
| | | @click="Operateit = !Operateit" |
| | | >{{ !Operateit ? "编辑题目" : "完整信息展示" }}</el-button |
| | | > |
| | | </div> |
| | | <div style="display: flex"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="presentation"> |
| | | <div class="presentation-left"> |
| | | <div :class="Operateit ? 'presentation-left' : 'spresentation-left'"> |
| | | <el-card class="box-card" style="min-height: 688px"> |
| | | <el-table |
| | | v-loading="loading" |
| | |
| | | align="center" |
| | | key="sort" |
| | | prop="sort" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | label="题目标题" |
| | |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="题型" |
| | | align="center" |
| | | key="scriptType" |
| | | prop="scriptType" |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="askvaluetype" |
| | | :value="scope.row.scriptType" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="!Operateit" |
| | | label="题目内容" |
| | | align="center" |
| | | key="scriptContent" |
| | | prop="scriptContent" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | v-if="!Operateit" |
| | | label="指标名称" |
| | | align="center" |
| | | key="targetname" |
| | | prop="targetname" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | v-if="!Operateit" |
| | | label="是否必填" |
| | | align="center" |
| | | key="ismandatory" |
| | | prop="ismandatory" |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="required" |
| | | :value="scope.row.ismandatory" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="下题跳转" |
| | | align="center" |
| | | key="nextScriptno" |
| | | prop="nextScriptno" |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ |
| | | scope.row.nextScriptno == 0 |
| | | ? "已是最后一题" |
| | | : scope.row.nextScriptno |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | v-if="Operateit" |
| | | label="操作" |
| | | align="center" |
| | | width="250" |
| | |
| | | </el-table> |
| | | </el-card> |
| | | </div> |
| | | <div class="presentation-right"> |
| | | <div class="presentation-right" v-if="Operateit"> |
| | | <el-card class="box-card"> |
| | | <el-form |
| | | :inline="true" |
| | | :model="topicobj" |
| | | class="demo-form-inline" |
| | | > |
| | | <div class="headline"> |
| | | 题目设置详情 |
| | | <span style="margin-left: 30px" |
| | | ><el-button type="primary" @click="Submittopicobj" |
| | | >保存</el-button |
| | | ></span |
| | | > |
| | | </div> |
| | | <el-form-item label="题目标题"> |
| | | <el-input |
| | | v-model="topicobj.scriptTopic" |
| | | placeholder="请输入标题" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <div class="headline">题目设置详情</div> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="题目标题"> |
| | | <el-input |
| | | v-model="topicobj.scriptTopic" |
| | | placeholder="请输入标题" |
| | | ></el-input> </el-form-item |
| | | ></el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="下题跳转"> |
| | | <el-input |
| | | v-model="topicobj.nextScriptno" |
| | | placeholder="请输入题号" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="12" |
| | | ><el-form-item label="题目类型"> |
| | | <el-select |
| | | v-model="topicobj.scriptType" |
| | | disabled |
| | | size="medium" |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | class="topicobjaa" |
| | | v-for="item in askvaluetype" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> </el-select></el-form-item |
| | | ></el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="题目分值" |
| | | v-if="topicobj.scoretype == 1" |
| | | > |
| | | <el-input |
| | | v-model="topicobj.score" |
| | | placeholder="请输入题号" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="10"> |
| | | <el-col :span="12" |
| | | ><el-form-item label="是否必填"> |
| | | <el-select |
| | | v-model="topicobj.ismandatory" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in required" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | <el-radio-group v-model="topicobj.ismandatory"> |
| | | <el-radio |
| | | v-for="(item, index) in required" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-option> |
| | | </el-select> </el-form-item |
| | | ></el-col> |
| | | </el-radio-group> |
| | | </el-form-item></el-col |
| | | > |
| | | <el-col :span="12" |
| | | ><el-form-item label="是否可用"> |
| | | <el-select |
| | | v-model="topicobj.isavailable" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in usable" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | <el-radio-group v-model="topicobj.isavailable"> |
| | | <el-radio |
| | | v-for="(item, index) in usable" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-option> |
| | | </el-select> </el-form-item |
| | | ></el-col> |
| | | </el-radio-group> |
| | | </el-form-item></el-col |
| | | > |
| | | </el-row> |
| | | <div v-if="topicobj.scriptType != 3"> |
| | | <el-form-item |
| | | label="是否由选项配置跳转" |
| | | v-if="topicobj.scriptType == 1" |
| | | > |
| | | <el-radio-group v-model="topicobj.branchFlag"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <div |
| | | v-if="topicobj.scriptType == 1 || topicobj.scriptType == 2" |
| | | > |
| | | <div class="headline">选项设置</div> |
| | | <div |
| | | class="topicxq" |
| | |
| | | <el-col :span="8"> |
| | | <el-form-item |
| | | v-if="topicobj.scoretype == 1" |
| | | label="分值" |
| | | label="选项分值" |
| | | > |
| | | <el-input |
| | | class="custom-width" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-row :gutter="10" v-if="topicobj.branchFlag == 1"> |
| | | <el-col :span="20" |
| | | ><el-form-item label="下题跳转(序号)"> |
| | | <el-input |
| | | type="text" |
| | | @blur="branchFlagfn" |
| | | placeholder="请输入题号" |
| | | v-model="item.nextQuestion" |
| | | show-word-limit |
| | |
| | | <el-input |
| | | style="width: 20vw" |
| | | type="textarea" |
| | | autosize |
| | | :rows="2" |
| | | placeholder="此处放置患者回答" |
| | | v-model="topicobj.reply" |
| | | > |
| | |
| | | ></el-form-item> |
| | | </el-row> |
| | | <el-form-item label="分值"> |
| | | <template #label> |
| | | 分值 |
| | | <el-tooltip |
| | | class="item" |
| | | effect="light" |
| | | content="填空题分数值由负责人员在问卷手机后手动评价。" |
| | | placement="top-start" |
| | | > |
| | | <i class="el-icon-warning-outline"></i> |
| | | </el-tooltip> |
| | | <!-- 在标签后插入红色星号 --> |
| | | </template> |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | |
| | | <div class="leftvlue-jbxx">问卷预览</div> |
| | | <el-divider></el-divider> |
| | | <div class="preview-left"> |
| | | <!-- 单选 --> |
| | | <div |
| | | class="scriptTopic-dev" |
| | | v-for="item in ruleForm.svyTemplateLibScripts" |
| | | :key="item.sort" |
| | | v-if="item.scriptType == 1" |
| | | > |
| | | <div class="dev-text"> |
| | | {{ item.sort }}、[单选]<span>{{ item.scriptContent }}</span> |
| | | <div v-for="item in ruleForm.svyTemplateLibScripts"> |
| | | <!-- 单选 --> |
| | | <div |
| | | class="scriptTopic-dev" |
| | | :key="item.sort" |
| | | v-if="item.scriptType == 1" |
| | | > |
| | | <div class="dev-text"> |
| | | {{ item.sort }}、[单选]<span>{{ item.scriptContent }}</span> |
| | | </div> |
| | | <div class="dev-xx"> |
| | | <el-radio-group v-model="item.remark"> |
| | | <el-radio |
| | | v-for="(items, index) in item.svyLibTemplateTargetoptions" |
| | | :key="index" |
| | | :label="index" |
| | | >{{ items.optioncontent }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </div> |
| | | </div> |
| | | <div class="dev-xx"> |
| | | <el-radio-group v-model="item.remark"> |
| | | <el-radio |
| | | v-for="(items, index) in item.svyLibTemplateTargetoptions" |
| | | :key="index" |
| | | :label="index" |
| | | >{{ items.optioncontent }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | <!-- 多选 --> |
| | | <div |
| | | class="scriptTopic-dev" |
| | | :key="item.sort" |
| | | v-if="item.scriptType == 2" |
| | | > |
| | | <div class="dev-text"> |
| | | {{ item.sort }}、[多选]<span>{{ item.scriptContent }}</span> |
| | | </div> |
| | | <div class="dev-xx"> |
| | | <el-checkbox-group v-model="qremark"> |
| | | <el-checkbox |
| | | v-for="(items, index) in item.svyLibTemplateTargetoptions" |
| | | :key="index" |
| | | :label="index" |
| | | > |
| | | {{ items.optioncontent }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 多选 --> |
| | | <div |
| | | class="scriptTopic-dev" |
| | | v-for="item in ruleForm.svyTemplateLibScripts" |
| | | :key="item.sort" |
| | | v-if="item.scriptType == 2" |
| | | > |
| | | <div class="dev-text"> |
| | | {{ item.sort }}、[多选]<span>{{ item.scriptContent }}</span> |
| | | </div> |
| | | <div class="dev-xx"> |
| | | <el-checkbox-group v-model="qremark"> |
| | | <el-checkbox |
| | | v-for="(items, index) in item.svyLibTemplateTargetoptions" |
| | | :key="index" |
| | | :label="index" |
| | | > |
| | | {{ items.optioncontent }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | </div> |
| | | <!-- 填空 --> |
| | | <div |
| | | class="scriptTopic-dev" |
| | | v-for="item in ruleForm.svyTemplateLibScripts" |
| | | :key="item.sort" |
| | | v-if="item.scriptType == 3" |
| | | > |
| | | <div class="dev-text"> |
| | | {{ item.sort }}、[填空]<span>{{ item.scriptContent }}</span> |
| | | </div> |
| | | <div class="dev-xx"> |
| | | <el-input placeholder="请输入答案" v-model="radioas" clearable> |
| | | </el-input> |
| | | <!-- 填空 --> |
| | | <div |
| | | class="scriptTopic-dev" |
| | | :key="item.sort" |
| | | v-if="item.scriptType == 3" |
| | | > |
| | | <div class="dev-text"> |
| | | {{ item.sort }}、[填空]<span>{{ item.scriptContent }}</span> |
| | | </div> |
| | | <div class="dev-xx"> |
| | | <el-input placeholder="请输入答案" v-model="radioas" clearable> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <el-button type="primary" @click="laststep()">上一步</el-button> |
| | | </div> |
| | | </div> |
| | | <!-- 预览模版弹窗 --> |
| | | <!-- 添加题目弹窗 --> |
| | | <el-drawer |
| | | title="添加题目" |
| | | :visible.sync="drawer" |
| | | custom-class="demo-drawer" |
| | | size="50%" |
| | | > |
| | | <div class="preview-left"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | label-width="98px" |
| | | > |
| | | <el-form-item label="问题标题" prop="scriptTopic"> |
| | | <el-input |
| | | v-model="queryParams.scriptTopic" |
| | | placeholder="请输入" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="getaddtopiclist" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="medium" |
| | | @click="getaddtopiclist" |
| | | >搜索</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="medium" @click="resetQuery" |
| | | >重置</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="loading" :data="userList"> |
| | | <el-table-column |
| | | label="标题" |
| | | align="center" |
| | | key="scriptTopic" |
| | | prop="scriptTopic" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | label="问题内容" |
| | | align="center" |
| | | key="scriptContent" |
| | | prop="scriptContent" |
| | | width="200" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="选项内容" |
| | | align="center" |
| | | key="targetoptions" |
| | | prop="targetoptions" |
| | | width="200" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="medium" type="text" @click="addtopic(scope.row)" |
| | | ><span class="button-textxg" |
| | | ><i class="el-icon-circle-plus-outline"></i>添加</span |
| | | ></el-button |
| | | <div style="margin: 0 25px"> |
| | | <el-tabs v-model="activeName"> |
| | | <el-tab-pane label="题库选取" name="first"> |
| | | <div class="preview-left"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | label-width="98px" |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getaddtopiclist" |
| | | /> |
| | | <el-form-item label="问题标题" prop="scriptTopic"> |
| | | <el-input |
| | | v-model="queryParams.scriptTopic" |
| | | placeholder="请输入" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="getaddtopiclist" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="题目类型" prop="scriptTopic"> |
| | | <el-select |
| | | v-model="queryParams.scriptType" |
| | | size="medium" |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | class="topicobjaa" |
| | | v-for="item in askvaluetype" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="medium" |
| | | @click="getaddtopiclist" |
| | | >搜索</el-button |
| | | > |
| | | <el-button |
| | | icon="el-icon-refresh" |
| | | size="medium" |
| | | @click="resetQuery" |
| | | >重置</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="loading" :data="userList"> |
| | | <el-table-column |
| | | label="标题" |
| | | align="center" |
| | | key="scriptTopic" |
| | | prop="scriptTopic" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | label="问题内容" |
| | | align="center" |
| | | key="scriptContent" |
| | | prop="scriptContent" |
| | | width="200" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="选项内容" |
| | | align="center" |
| | | key="targetoptions" |
| | | prop="targetoptions" |
| | | width="200" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="addtopic(scope.row)" |
| | | ><span class="button-textxg" |
| | | ><i class="el-icon-circle-plus-outline"></i>添加</span |
| | | ></el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getaddtopiclist" |
| | | /> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="手动配置" name="second"> |
| | | <div class="preview-left"> |
| | | <el-form |
| | | :inline="true" |
| | | :model="indexform" |
| | | class="demo-form-inline" |
| | | > |
| | | <div class="headline"> |
| | | 题目设置详情 |
| | | <span style="margin-left: 30px" |
| | | ><el-button type="primary" @click="Submittopicobj" |
| | | >保存新增</el-button |
| | | ></span |
| | | > |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="题目标题"> |
| | | <el-input |
| | | v-model="indexform.scriptTopic" |
| | | placeholder="请输入题目标题" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="题目得分"> |
| | | <el-input |
| | | v-model="indexform.score" |
| | | placeholder="请输入分数" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="评价类型"> |
| | | <el-select |
| | | v-model="indexform.scoretype" |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | v-for="group in appraiselist" |
| | | :key="group.value" |
| | | :label="group.label" |
| | | :value="group.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="语言"> |
| | | <el-select |
| | | v-model="indexform.language" |
| | | size="medium" |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | | class="topicobjaa" |
| | | v-for="item in languagelist" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否可用"> |
| | | <el-radio-group v-model="indexform.isAvailable"> |
| | | <el-radio |
| | | v-for="(item, index) in usable" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否必填"> |
| | | <el-radio-group v-model="indexform.ismandatory"> |
| | | <el-radio |
| | | v-for="(item, index) in required" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="18" |
| | | ><el-form-item label="题目内容"> |
| | | <el-input |
| | | style="width: 400px" |
| | | type="textarea" |
| | | v-model="indexform.scriptContent" |
| | | placeholder="请从左侧列表选择" |
| | | ></el-input> </el-form-item |
| | | ></el-col> |
| | | </el-row> |
| | | </div> |
| | | <div> |
| | | <el-form-item label="指标名称" prop="deptId"> |
| | | <el-input |
| | | v-model="indexform.targetname" |
| | | placeholder="请输入指标名称" |
| | | maxlength="20" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="指标描述" prop="deptId"> |
| | | <el-input |
| | | v-model="indexform.targetdesc" |
| | | placeholder="请输入指标描述" |
| | | maxlength="60" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="值类型"> |
| | | <el-radio-group v-model="indexform.valueType"> |
| | | <el-radio :label="1">选项</el-radio> |
| | | <el-radio :label="2">文本</el-radio> |
| | | <el-radio :label="3">数值</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="题目类型"> |
| | | <el-radio-group v-model="indexform.scriptType"> |
| | | <el-radio :label="1">单选</el-radio> |
| | | <el-radio :label="2">多选</el-radio> |
| | | <el-radio :label="4">问答</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="topicxq" v-if="indexform.scriptType == 4"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="收集内容"> |
| | | <el-input |
| | | style="width: 400px" |
| | | type="textarea" |
| | | v-model="indexform.value" |
| | | placeholder="问题收集内容" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | |
| | | <div v-else> |
| | | <div class="headline"> |
| | | <div class="basics"> |
| | | 选项设置 |
| | | <span style="margin-left: 30px" |
| | | ><el-button type="primary" round @click="addoption" |
| | | >+新增</el-button |
| | | ></span |
| | | > |
| | | </div> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div |
| | | class="topicxq" |
| | | v-for="item in indexform.svyLibTemplateTargetoptions" |
| | | v-if="item.isoperation != 3" |
| | | > |
| | | <el-row :gutter="10"> |
| | | <el-col :span="11" |
| | | ><el-form-item label="选项名称"> |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | | v-model="item.optioncontent" |
| | | show-word-limit |
| | | > |
| | | </el-input> </el-form-item |
| | | ></el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item |
| | | v-if="indexform.scoretype == 1" |
| | | label="分值" |
| | | > |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | | v-model="item.score" |
| | | show-word-limit |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="indexform.scoretype == 2" |
| | | label="ABC等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="A">A</el-radio> |
| | | <el-radio label="B">B</el-radio> |
| | | <el-radio label="C">C</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="indexform.scoretype == 3" |
| | | label="优良等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="优">优</el-radio> |
| | | <el-radio label="良">良</el-radio> |
| | | <el-radio label="差">差</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col |
| | | :span="2" |
| | | :offsset="indexform.scoretype == 4 ? 11 : 0" |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | circle |
| | | @click="deletexuanx(item)" |
| | | ></el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-form-item label="预警提醒"> |
| | | <el-radio-group v-model="item.isabnormal"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-form-item label="选中提示"> |
| | | <el-input |
| | | style="width: 400px" |
| | | type="textarea" |
| | | autosize |
| | | placeholder="请输入内容" |
| | | v-model="item.prompt" |
| | | > |
| | | </el-input |
| | | ></el-form-item> |
| | | </el-row> |
| | | <el-form-item label="选项文件" prop="sickness"> |
| | | <div style="width: 40vw"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | :action="uploadImgUrl" |
| | | :headers="headers" |
| | | accept=".jpg,.png,image/*" |
| | | :on-success="handleChange.bind(this, item)" |
| | | > |
| | | <el-button size="small" type="primary" |
| | | >点击上传</el-button |
| | | > |
| | | </el-upload> |
| | | <div style="margin: 20px"> |
| | | <el-image |
| | | style="width: 100px; height: 100px" |
| | | :src="item.picturePath" |
| | | :preview-src-list="[...item.picturePath]" |
| | | > |
| | | </el-image> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </el-drawer> |
| | | <!-- 添加适用疾病窗口 --> |
| | | <Optional-Form |
| | | ref="child" |
| | | :dialogVisiblepatient="dialogVisiblepatient" |
| | | :overallCase="illnesslist" |
| | | @addoption="dialogVisiblepatient = false" |
| | | @kkoption="dialogVisiblepatient = true" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | getQtemplateclassify, |
| | | delQtemplateclassify, |
| | | addQtemplateclassify, |
| | | getQtemplatelist, |
| | | getQtemplateobj, |
| | | compileQtemplate, |
| | | Qtemplateinfo, |
| | | compileissue, |
| | |
| | | illnesslistget, |
| | | getillness, |
| | | } from "@/api/AiCentre/index"; |
| | | import OptionalForm from "@/components/OptionalForm"; //正则组件 |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | export default { |
| | | name: "Qcompilequer", |
| | | |
| | | components: { OptionalForm }, |
| | | |
| | | data() { |
| | | return { |
| | | headers: { |
| | |
| | | radio: "false", //单选题选中 |
| | | radios: [], //多选题选中 |
| | | radioas: "", //填空题答案 |
| | | activeName: "first", |
| | | dynamicTags: [], |
| | | inputVisible: false, |
| | | dialogVisiblepatient: false, //适用疾病窗口 |
| | | inputValue: "", |
| | | topicobj: {}, |
| | | // 总条数 |
| | |
| | | tempDetpRelevances: [], |
| | | svyLibTemplateTagList: [], |
| | | }, |
| | | indexform: { |
| | | svyLibTemplateTargetoptions: [], |
| | | }, |
| | | rules: {}, |
| | | rulesa: {}, |
| | | optionsclass: [], //分类列表 |
| | |
| | | { value: "scriptTopic", table: "scriptTopic" }, |
| | | ], |
| | | |
| | | appraiselist: [ |
| | | { label: "分数", value: "1" }, |
| | | { label: "ABC等级", value: "2" }, |
| | | { label: "优良等级", value: "3" }, |
| | | ], |
| | | appraiselist: [], |
| | | |
| | | fileList: [ |
| | | { |
| | |
| | | themelist: [], |
| | | languagelist: [], |
| | | courtyardlist: [], |
| | | askvaluetype: [], |
| | | precedencetype: [], |
| | | inputValueillness: "", |
| | | inputVisible: false, |
| | | inputVisibleillness: false, |
| | | illnessVisible: false, //指标疾病弹框 |
| | | Operateit: true, |
| | | deptOptions: [], |
| | | optionsillness: [], |
| | | delScriptVOList: [], |
| | |
| | | this.required = store.getters.required; |
| | | this.valuetype = store.getters.valuetype; |
| | | this.courtyardlist = store.getters.courtyardlist; |
| | | this.askvaluetype = store.getters.askvaluetype; |
| | | this.appraiselist = store.getters.appraiselist; |
| | | |
| | | // this.test(); |
| | | }, |
| | | computed: { |
| | | displayedTags() { |
| | | // 返回前10个tag |
| | | return this.illnesslist.slice(0, 10); |
| | | }, |
| | | hasMore() { |
| | | // 判断是否有更多的tag |
| | | return this.illnesslist.length > 10; |
| | | }, |
| | | remaining() { |
| | | // 计算剩余的tag数量 |
| | | return this.illnesslist.length - 10; |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | getissueinfo() { |
| | | this.id = this.$route.query.id; |
| | | if (this.id) { |
| | | getQtemplatelist({ svyid: this.id }).then((res) => { |
| | | getQtemplateobj({ svyid: this.id }).then((res) => { |
| | | this.ruleForm = res.rows[0]; |
| | | this.dynamicTags = this.ruleForm.svyLibTemplateTagList.map( |
| | | this.processElement |
| | | ); |
| | | this.tempDetpRelevanceslist = JSON.parse(this.ruleForm.deptNames); |
| | | this.ruleForm.suitway = this.ruleForm.suitway.split(","); |
| | | console.log(this.tempDetpRelevanceslist); |
| | | }); |
| | | getillness({ outid: this.id, type: 5 }).then((res) => { |
| | | this.illnesslist = res.rows; |
| | | this.illnesslist.forEach((item) => { |
| | | item.icdname = item.icd10name; |
| | | }); |
| | | }); |
| | | } else { |
| | | this.ruleForm.isenable = "1"; |
| | | } |
| | | getillnesslist({ |
| | | pageNum: 1, |
| | | pageSize: 100, |
| | | }).then((response) => { |
| | | this.optionsillness = response.rows; |
| | | }); |
| | | |
| | | listDept(this.queryParams).then((response) => { |
| | | this.deptList = this.handleTree(response.data, "deptId"); |
| | | }); |
| | | // 分类 |
| | | getQtemplateclassify({}).then((res) => { |
| | | // this.optionsclass = this.flattenArray(res.rows); |
| | | this.optionsclass = res.rows; |
| | | }); |
| | | }, |
| | | submitForm(formName) { |
| | | this.$modal.loading("正在上传数据,请稍候..."); |
| | | |
| | | this.ruleForm.suitway = this.ruleForm.suitway.join(","); |
| | | |
| | | if (this.id) { |
| | |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.confirmillness(); |
| | | this.$modal.closeLoading(); |
| | | |
| | | this.$router.go(-1); |
| | | }); |
| | | } else { |
| | | this.ruleForm.isoperation = 1; |
| | | this.ruleForm.version = this.ruleForm.version |
| | | ? this.ruleForm.version |
| | | : "1.0"; |
| | | compileQtemplate(this.ruleForm).then((res) => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.confirmillness(res.data); |
| | | |
| | | this.$modal.closeLoading(); |
| | | |
| | | this.$router.go(-1); |
| | | }); |
| | | } |
| | |
| | | // 科室处理 |
| | | Departmenttreatment() { |
| | | this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist); |
| | | console.log(this.tempDetpRelevanceslist); |
| | | this.ruleForm.svyTemplateLibScripts = |
| | | this.ruleForm.svyTemplateLibScripts.concat(this.delScriptVOList); |
| | | console.log(this.tempDetpRelevanceslist, "this.tempDetpRelevanceslist"); |
| | | const result = this.tempDetpRelevanceslist.map( |
| | | (subArr) => subArr[subArr.length - 1] |
| | | ); |
| | |
| | | this.ruleForm.tempDetpRelevances.forEach((item) => { |
| | | const condition = result.some((obj) => obj === item.deptId); |
| | | if (!condition) { |
| | | console.log(condition); |
| | | const index = this.ruleForm.tempDetpRelevances.indexOf(item); |
| | | this.ruleForm.tempDetpRelevances[index].delFlag = 1; |
| | | } |
| | |
| | | this.sortFn(); |
| | | }, |
| | | sortFn() { |
| | | console.log(this.ruleForm.svyTemplateLibScripts, "序前值"); |
| | | this.ruleForm.svyTemplateLibScripts.forEach((item, index) => { |
| | | item.sort = Number(index) + 1; |
| | | if (item.sort == this.ruleForm.svyTemplateLibScripts.length) { |
| | | item.nextScriptno = 0; |
| | | } else { |
| | | item.nextScriptno = item.sort + 1; |
| | | } |
| | | if (item.svyLibTemplateTargetoptions) { |
| | | item.svyLibTemplateTargetoptions.forEach((items) => { |
| | | items.nextQuestion = Number(item.sort) + 1; |
| | |
| | | }, |
| | | |
| | | // 修改题目信息 |
| | | Submittopicobj() {}, |
| | | Submittopicobj() { |
| | | this.$modal |
| | | .confirm( |
| | | '是否确认新增名称为"' + this.indexform.scriptTopic + '"的问题数据?' |
| | | ) |
| | | .then(() => { |
| | | this.indexform.isoperation = 1; |
| | | this.indexform.svyLibTemplateTargetoptions.forEach((item) => { |
| | | item.isoperation = 1; |
| | | }); |
| | | this.ruleForm.svyTemplateLibScripts.push(this.indexform); |
| | | this.indexform = { svyTemplateLibScripts: [] }; |
| | | this.drawer = false; |
| | | |
| | | this.sortFn(); |
| | | this.$modal.msgSuccess("题目新增成功,保存模版失效"); |
| | | }); |
| | | }, |
| | | // 新增变量 |
| | | addvariable() { |
| | | this.variablelist.push({ |
| | |
| | | showInput() { |
| | | this.inputVisible = true; |
| | | }, |
| | | // 疾病----------------------- |
| | | |
| | | handleCloseillness(tag) { |
| | | this.illnesslist.splice(this.illnesslist.indexOf(tag), 1); |
| | | if (tag.id) { |
| | | this.illnesslistapi.push(tag.id); |
| | | } |
| | | }, |
| | | remoteMethod(value) { |
| | | console.log(value); |
| | | const illnessqueryParams = { |
| | | pageNum: 1, |
| | | pageSize: 100, |
| | | icdname: value, |
| | | }; |
| | | this.loading = true; |
| | | setTimeout(() => { |
| | | this.loading = false; |
| | | getillnesslist(illnessqueryParams).then((response) => { |
| | | this.optionsillness = response.rows; |
| | | }); |
| | | }, 200); |
| | | }, |
| | | illnessConfirm(item) { |
| | | let opeavalue = {}; |
| | | let tagname = this.inputValueillness; |
| | | illnesslistget(item).then((res) => { |
| | | opeavalue = res.data; |
| | | opeavalue.outid = this.id; |
| | | opeavalue.type = 5; |
| | | opeavalue.icd10id = opeavalue.icdid; |
| | | opeavalue.icd10name = opeavalue.icdname; |
| | | opeavalue.icd10code = opeavalue.icdcode; |
| | | if (tagname) { |
| | | this.illnesslist.push(opeavalue); |
| | | } |
| | | }); |
| | | console.log(this.illnesslist); |
| | | this.inputVisibleillness = false; |
| | | this.inputValueillness = ""; |
| | | }, |
| | | // 保存 |
| | | // 保存疾病 |
| | | confirmillness(guid) { |
| | | this.illnesslist.forEach((item, index) => { |
| | | if (guid) { |
| | | item.outid = guid; |
| | | } else { |
| | | console.log(this.ruleForm); |
| | | item.outid = this.ruleForm.svyid; |
| | | } |
| | | item.icd10name = item.icdname; |
| | | item.icd10code = item.icdcode; |
| | | item.type = 5; |
| | | if (!item.id) { |
| | | addtargetillness(item).then((res) => {}); |
| | | } |
| | | }); |
| | | if (this.illnesslistapi.length) { |
| | | deltargetillness(this.illnesslistapi.join(",")).then((res) => {}); |
| | | } |
| | | this.illnessVisible = false; |
| | | this.$modal.msgSuccess("编辑成功"); |
| | | }, |
| | | // -------------------------- |
| | | resetQuery() { |
| | | this.queryParams = { pageNum: 1, pageSize: 10 }; |
| | | this.getaddtopiclist(); |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | |
| | | // -------------------------- |
| | | // 问卷分数限制算法 |
| | | // 混合路线 |
| | | generateCombinations(arrays, currentIndex = 0, currentCombination = []) { |
| | |
| | | }, |
| | | // 执行 |
| | | test() { |
| | | const arrays = [ |
| | | ["2", "3", "4", "5"], |
| | | ["1", "2", "5", "6"], |
| | | ["3", "4", "5", "3"], |
| | | ["3", "2", "5", "7"], |
| | | ]; |
| | | console.log(this.ruleForm.svyTemplateLibScripts); |
| | | |
| | | const arraysa = [ |
| | | { |
| | | id: 1, |
| | | grade: "5", |
| | | Topicjump: "2", |
| | | branchFlag: "0", |
| | | arr: [ |
| | | { name: "不错", skip: 2 }, |
| | | { name: "一般", skip: 2 }, |
| | |
| | | |
| | | { |
| | | id: 2, |
| | | grade: "5", |
| | | Topicjump: "4", |
| | | branchFlag: "1", |
| | | arr: [ |
| | | { name: "优秀", skip: 3 }, |
| | | { name: "优秀", skip: 4 }, |
| | | { name: "良好", skip: 3 }, |
| | | { name: "一般", skip: 3 }, |
| | | { name: "较差", skip: 4 }, |
| | | { name: "较差", skip: 3 }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 3, |
| | | grade: "5", |
| | | Topicjump: "4", |
| | | branchFlag: "1", |
| | | arr: [ |
| | | { name: "是的", skip: 4 }, |
| | | { name: "不清楚", skip: 4 }, |
| | | { name: "不清楚", skip: 5 }, |
| | | { name: "还可", skip: 4 }, |
| | | { name: "一般", skip: 4 }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 4, |
| | | grade: "5", |
| | | Topicjump: "5", |
| | | branchFlag: "0", |
| | | bac: null, |
| | | }, |
| | | { |
| | | id: 5, |
| | | Topicjump: "0", |
| | | branchFlag: "0", |
| | | arr: [ |
| | | { name: "真不错", skip: null }, |
| | | { name: "还可以", skip: null }, |
| | | { name: "一般般", skip: null }, |
| | | { name: "不清楚", skip: null }, |
| | | { name: "真不错", skip: 0 }, |
| | | { name: "还可以", skip: 0 }, |
| | | { name: "一般般", skip: 0 }, |
| | | { name: "不清楚", skip: 0 }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | // const newMixArray = this.generateCombinations(arrays); |
| | | const newMixArray = this.getExecutionOrders(arraysa); |
| | | |
| | | const csnewMixArray = this.csgetExecutionOrders(arraysa); |
| | | console.log(csnewMixArray, "测试全部路线"); |
| | | const newMixArray = this.getExecutionOrders( |
| | | this.ruleForm.svyTemplateLibScripts |
| | | ); |
| | | console.log(newMixArray, "全部路线"); |
| | | this.screen(newMixArray); |
| | | this.sumArray(newMixArray); |
| | | }, |
| | | getExecutionOrders(data) { |
| | | let orders = []; |
| | | // 遍历方法 |
| | | csgetExecutionOrders(arrays) { |
| | | const allPaths = []; |
| | | const findPath = (currentId, path) => { |
| | | const current = arrays.find((item) => item.id.toString() === currentId); |
| | | if (!current) return; |
| | | path.push(current); |
| | | |
| | | const explore = (currentOrder, id) => { |
| | | console.log(currentOrder, "currentOrder", id); |
| | | const currentQuestion = data[currentOrder[currentOrder.length - 1]]; |
| | | if ( |
| | | currentQuestion.arr.some( |
| | | (option) => |
| | | option.skip !== null && !currentOrder.includes(option.skip) |
| | | ) |
| | | ) { |
| | | currentQuestion.arr.forEach((option) => { |
| | | if (option.skip !== null && !currentOrder.includes(option.skip)) { |
| | | explore([...currentOrder, option.skip]); |
| | | } |
| | | if (current.branchFlag === "1") { |
| | | current.arr.forEach((option) => { |
| | | findPath(option.skip.toString(), path.slice()); |
| | | }); |
| | | } else { |
| | | orders.push( |
| | | currentOrder.map((id) => ({ |
| | | id: data[id].id, |
| | | grade: data[id].grade, |
| | | })) |
| | | ); |
| | | const nextId = parseInt(current.Topicjump); |
| | | if (nextId !== 0) { |
| | | findPath(nextId.toString(), path.slice()); |
| | | } else { |
| | | allPaths.push(path.slice()); |
| | | } |
| | | } |
| | | }; |
| | | console.log(data, "data"); |
| | | data.forEach((entry) => { |
| | | explore([entry.id], entry.id); |
| | | }); |
| | | |
| | | return orders; |
| | | findPath("1", []); |
| | | return allPaths; |
| | | }, |
| | | // 遍历方法 |
| | | getExecutionOrders(arrays) { |
| | | const allPaths = []; |
| | | const findPath = (currentId, path) => { |
| | | const current = arrays.find( |
| | | (item) => item.sort.toString() === currentId |
| | | ); |
| | | if (!current) return; |
| | | path.push(current); |
| | | |
| | | if (current.branchFlag == "1") { |
| | | current.svyLibTemplateTargetoptions.forEach((option) => { |
| | | findPath(option.nextQuestion.toString(), path.slice()); |
| | | }); |
| | | } else { |
| | | const nextId = parseInt(current.nextScriptno); |
| | | if (nextId !== 0) { |
| | | findPath(nextId.toString(), path.slice()); |
| | | } else { |
| | | allPaths.push(path.slice()); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | findPath("1", []); |
| | | return allPaths; |
| | | }, |
| | | |
| | | // 数组求和 |
| | | sumArray(arr) { |
| | | return arr.reduce((acc, curr) => acc + parseInt(curr), 0); |
| | | }, |
| | | // 筛选错误路线 |
| | | screen(data) { |
| | | const arraysGreaterThan10 = data.filter((arr) => this.sumArray(arr) > 21); |
| | | // const arrsum = arr; |
| | | // arrsum.forEach((item) => { |
| | | // // 判断题目和模版层级 |
| | | // console.log(item, "一条链路"); |
| | | |
| | | console.log(arraysGreaterThan10, "筛选错误路线大于13分"); |
| | | // const totalScore = item.reduce((accumulator, current) => { |
| | | // return accumulator + Number(current.score); |
| | | // }, 0); |
| | | // console.log(totalScore); |
| | | // console.log(this.ruleForm.scriptScore); |
| | | |
| | | // if (totalScore == this.ruleForm.scriptScore) { |
| | | // this.ClaimNofn(arr); |
| | | // this.$modal.msgSuccess("分数核验成功"); |
| | | // } |
| | | // }); |
| | | |
| | | const allGreaterThanTen = arr.every((array) => { |
| | | const totalScore = array.reduce((accumulator, current) => { |
| | | return accumulator + current.score; |
| | | }, 0); |
| | | return totalScore == this.ruleForm.scriptScore; |
| | | }); |
| | | if (allGreaterThanTen) { |
| | | this.$modal.msgSuccess("题目分值累加和模版总分相符"); |
| | | } else { |
| | | this.$modal.msgError("题目分值累加和模版分值不符"); |
| | | } |
| | | }, |
| | | |
| | | // 遍历是否重复是否都用上 |
| | | ClaimNofn(arr) { |
| | | arr.forEach((item) => { |
| | | const Aarr = item; |
| | | const Barr = this.ruleForm.svyTemplateLibScripts; |
| | | const notInB = A.filter( |
| | | (itemA) => !B.some((itemB) => itemB.id === itemA.id) |
| | | ); |
| | | |
| | | if (notInB.length) { |
| | | this.$modal.msgError("题目未全部使用"); |
| | | } else { |
| | | this.$modal.msgSuccess("题目全部使用"); |
| | | } |
| | | }); |
| | | arr.forEach((item) => { |
| | | const idCount = arr.reduce((acc, item) => { |
| | | acc[item.id] = (acc[item.id] || 0) + 1; |
| | | return acc; |
| | | }, {}); |
| | | const whether = item.values(idCount).some((count) => count > 1); // 如果有任何 id 的计数大于 1 就返回 true |
| | | if (!whether) this.$modal.msgError("配置项有题目重复"); |
| | | }); |
| | | }, |
| | | // 题目和选项间的分值判断 |
| | | Scorejudgment() { |
| | | let scorearr = this.topicobj.svyLibScriptOptions; |
| | | let isValid = scorearr.every((score, index) => { |
| | | if (this.topicobj.scriptType == 1) { |
| | | if (score.score) { |
| | | if ( |
| | | Number(score.score) < 0 || |
| | | Number(score.score) > Number(this.topicobj.score) |
| | | ) { |
| | | console.log(score, "错误分值"); |
| | | this.$message({ |
| | | message: "选项分值必须在0到" + this.topicobj.score + "分之间", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | return true; |
| | | } else { |
| | | this.$message({ |
| | | message: "选项分值未设置", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | } else if (this.topicobj.scriptType == 2) { |
| | | // 累加分值 |
| | | const totalScore = scorearr.reduce((acc, score) => { |
| | | if (score.score) { |
| | | return acc + Number(score.score); |
| | | } |
| | | return acc; // 如果 score.score 不存在,不累加 |
| | | }, 0); |
| | | |
| | | // 检查累加的分值是否等于 this.topicobj.score |
| | | if (totalScore !== Number(this.topicobj.score)) { |
| | | this.$message({ |
| | | message: |
| | | "多选题选项分值总和必须等于 " + this.topicobj.score + " 分", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | return true; // 如果总分正确,返回 true |
| | | } else if (this.topicobj.scriptType == 4) { |
| | | return true; |
| | | } |
| | | }); |
| | | |
| | | if (isValid) { |
| | | this.compileissue(); |
| | | } |
| | | }, |
| | | |
| | | // --------------------------------------------------------- |
| | | // 新问题新增 |
| | | addoption() { |
| | | if (!this.indexform.svyLibTemplateTargetoptions) { |
| | | this.indexform.svyLibTemplateTargetoptions = []; |
| | | } |
| | | this.indexform.svyLibTemplateTargetoptions.push({ |
| | | score: "", |
| | | isoperation: 1, |
| | | }); |
| | | console.log(this.indexform.svyLibTemplateTargetoptions); |
| | | }, |
| | | // 选项文件上传 |
| | | handleChange(item, response, file, fileList) { |
| | | console.log(response); |
| | | if (response.code == 200) { |
| | | console.log(item); |
| | | let index = this.indexform.svyLibTemplateTargetoptions.findIndex( |
| | | (obj) => obj.optioncontent == item.optioncontent |
| | | ); |
| | | console.log(index); |
| | | this.indexform.svyLibTemplateTargetoptions[index].picturePath = |
| | | response.url; |
| | | console.log(this.indexform.svyLibTemplateTargetoptions[index]); |
| | | this.$forceUpdate(); |
| | | } else { |
| | | this.$message.error("图片插入失败"); |
| | | } |
| | | }, |
| | | branchFlagfn(row) { |
| | | console.log(row); |
| | | if (this.topicobj.branchFlag == 1 && this.topicobj.nextScriptno != 0) { |
| | | this.topicobj.nextScriptno = |
| | | this.topicobj.svyLibTemplateTargetoptions[0].nextQuestion; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | // display: flex; |
| | | } |
| | | .sidecolumn { |
| | | margin: 20px; |
| | | margin-bottom: 0; |
| | | margin: 10px 20px 0 20px; |
| | | padding: 20px; |
| | | background: #edf1f7; |
| | | border: 1px solid #dcdfe6; |
| | |
| | | // margin-top: 20px; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | padding-top: 5px; |
| | | margin-top: 10px; |
| | | background: #ffff; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | |
| | | font-size: 20px; |
| | | } |
| | | .leftvlue-jbxx { |
| | | display: flex; /* 使用 Flexbox 布局 */ |
| | | justify-content: space-between; |
| | | font-size: 24px; |
| | | border-left: 5px solid #41a1be; |
| | | padding-left: 5px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .headline { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | font-size: 20px; |
| | | border-left: 3px solid #41a1be; |
| | | padding-left: 5px; |
| | | margin: 15px 0; |
| | | } |
| | | .xinz-inf { |
| | | font-size: 18px; |
| | | white-space: nowrap; |
| | |
| | | vertical-align: bottom; |
| | | } |
| | | } |
| | | .xinz-infs { |
| | | font-size: 18px; |
| | | line-height: 48px; |
| | | |
| | | .el-tag + .el-tag { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | .addtopic { |
| | | margin-top: 30px; |
| | | } |
| | |
| | | margin: 20px 0; |
| | | display: flex; |
| | | .presentation-left { |
| | | width: 50%; |
| | | width: 45%; |
| | | // height: 500px; |
| | | .button-textxg { |
| | | color: #024df0; |
| | | } |
| | | .button-textsc { |
| | | color: #f52727; |
| | | } |
| | | } |
| | | .spresentation-left { |
| | | width: 100%; |
| | | // height: 500px; |
| | | .button-textxg { |
| | | color: #024df0; |
| | |
| | | } |
| | | } |
| | | .presentation-right { |
| | | width: 50%; |
| | | width: 55%; |
| | | max-height: 688px; |
| | | padding: 0 20px; |
| | | font-size: 18px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .topicxq { |
| | | background-color: #e2f5fc; |
| | | border-radius: 4px; |
| | | margin-top: 15px; |
| | | margin-left: 10%; |
| | | padding-left: 20px; |
| | | padding-top: 15px; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | } |
| | | .custom-width { |
| | | width: 100px; /* 设置宽度样式 */ |
| | | } |
| | | .el-select { |
| | | width: 280px; |
| | | } |
| | | |
| | | .el-cascader { |
| | | width: 40%; |
| | | } |
| | | ::v-deep .addtopic-input { |
| | | input { |
| | | background: #02a7f0; |