WXL (wul)
昨天 e06cd3953ba8a6e0eee11c235bce9ced419a2800
src/views/knowledge/questionnaire/compilequer/index.vue
@@ -117,27 +117,6 @@
              </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-row :gutter="20">
            <el-col :span="10">
              <el-form-item label="长期任务" prop="longTemp">
                <el-radio-group v-model="ruleForm.longTemp">
                  <el-radio
                    v-for="(item, index) in longtype"
                    :label="item.value"
                    >{{ item.label }}</el-radio
                  >
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="8" v-if="ruleForm.longTemp">
              <el-form-item label="任务周期(几天后)" prop="name">
                <el-input
                  v-model="ruleForm.sendDay"
                  placeholder="默认5天后"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row> -->
          <el-row>
            <el-form-item prop="dynamicTags">
@@ -396,6 +375,20 @@
                    <dict-tag
                      :options="askvaluetype"
                      :value="scope.row.scriptType"
                    />
                  </template>
                </el-table-column>
                <el-table-column
                  label="维度"
                  align="center"
                  key="dimension"
                  prop="dimension"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <dict-tag
                      :options="dict.type.dimensionality_type"
                      :value="scope.row.dimension"
                    />
                  </template>
                </el-table-column>
@@ -672,33 +665,43 @@
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-form-item label="关联服务">
                        <div
                          v-if="item.sendTaskname"
                          class="service-tag-container"
                        >
                          <el-tag
                            type="success"
                            closable
                            @close="removeService(item)"
                            class="service-tag"
                      <el-col :span="12">
                        <el-form-item label="关联服务">
                          <div
                            v-if="item.sendTaskname"
                            class="service-tag-container"
                          >
                            <i class="el-icon-connection service-icon"></i>
                            {{ item.sendTaskname }}
                          </el-tag>
                        </div>
                        <div v-else class="service-add-btn">
                          <el-button
                            type="success"
                            size="small"
                            icon="el-icon-plus"
                            @click="openServiceDialog(item)"
                            class="add-service-btn"
                          >
                            选择任务
                          </el-button>
                        </div>
                      </el-form-item>
                            <el-tag
                              type="success"
                              closable
                              @close="removeService(item)"
                              class="service-tag"
                            >
                              <i class="el-icon-connection service-icon"></i>
                              {{ item.sendTaskname }}
                            </el-tag>
                          </div>
                          <div v-else class="service-add-btn">
                            <el-button
                              type="success"
                              size="small"
                              icon="el-icon-plus"
                              @click="openServiceDialog(item)"
                              class="add-service-btn"
                            >
                              选择任务
                            </el-button>
                          </div>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="默认选项">
                          <el-radio-group v-model="item.defaultValue">
                            <el-radio :label="2">是</el-radio>
                            <el-radio :label="1">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="11">
@@ -715,19 +718,20 @@
                            >
                              <span style="color: #67c23a">● 正常</span>
                            </el-option>
                            <el-option
                              :value="1"
                              label="异常"
                              :style="{ color: '#E6A23C' }"
                            >
                              <span style="color: #e6a23c">● 异常</span>
                            </el-option>
                            <el-option
                              :value="2"
                              label="警告"
                              :style="{ color: '#F56C6C' }"
                              :style="{ color: '#FFBA00' }"
                            >
                              <span style="color: #f56c6c">● 警告</span>
                              <span style="color: #ffba00">● 警告</span>
                            </el-option>
                            <el-option
                              :value="1"
                              label="异常"
                              :style="{ color: '#f75c5c' }"
                            >
                              <span style="color: #f75c5c">● 异常</span>
                            </el-option>
                          </el-select>
                        </el-form-item>
@@ -786,6 +790,14 @@
                </div>
                <div v-else>
                  <div class="topicxq">
                    <el-row>
                      <el-form-item label="是否作为意见收集题目">
                        <el-radio-group v-model="topicobj.isMydException">
                          <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
@@ -846,7 +858,7 @@
              v-if="item.scriptType == 1"
            >
              <div class="dev-text">
                {{ item.sort }}、[单选]<span>{{ item.scriptContent }}</span>
                {{ item.sort }}. [单选]<span>{{ item.scriptContent }}</span>
              </div>
              <div class="dev-xx">
                <el-radio-group v-model="item.remark">
@@ -866,7 +878,7 @@
              v-if="item.scriptType == 2"
            >
              <div class="dev-text">
                {{ item.sort }}、[多选]<span>{{ item.scriptContent }}</span>
                {{ item.sort }}. [多选]<span>{{ item.scriptContent }}</span>
              </div>
              <div class="dev-xx">
                <el-checkbox-group v-model="qremark">
@@ -1186,15 +1198,15 @@
                    <div class="basics">
                      选项设置
                      <span style="margin-left: 30px"
                        ><el-button type="primary" round @click="addoption"
                          >+新增</el-button
                        ><el-button class="addoption-btn" @click="addoption"
                          >+新增选项</el-button
                        ></span
                      >
                    </div>
                  </div>
                  <el-divider></el-divider>
                  <div
                    class="topicxq"
                    class="topic-card"
                    v-for="item in indexform.svyLibTemplateTargetoptions"
                    v-if="item.isoperation != 3"
                  >
@@ -1204,7 +1216,7 @@
                          <el-input
                            style="width: 400px"
                            type="text"
                            placeholder="请输入选项分值"
                            placeholder="请输入选项名称"
                            v-model="item.optioncontent"
                            show-word-limit
                          >
@@ -1482,8 +1494,12 @@
import { deptTreeSelect } from "@/api/system/user";
export default {
  name: "Questionnaireinfo",
  dicts: ["sys_normal_disable", "sys_user_sex", "task_status"],
  dicts: [
    "sys_normal_disable",
    "dimensionality_type",
    "sys_user_sex",
    "task_status",
  ],
  components: { OptionalForm },
  data() {
@@ -2149,14 +2165,19 @@
          '是否确认新增名称为"' + this.indexform.scriptTopic + '"的问题数据?'
        )
        .then(() => {
          // ✅ 强制初始化
          if (!Array.isArray(this.indexform.svyLibTemplateTargetoptions)) {
            this.$set(this.indexform, "svyLibTemplateTargetoptions", []);
          }
          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("问题新增成功,保存模板失效");
        });
@@ -2548,14 +2569,22 @@
    // ---------------------------------------------------------
    // 新问题新增
    addoption() {
      if (!this.indexform.svyLibTemplateTargetoptions) {
        this.indexform.svyLibTemplateTargetoptions = [];
      if (!Array.isArray(this.indexform.svyLibTemplateTargetoptions)) {
        this.$set(this.indexform, "svyLibTemplateTargetoptions", []);
      }
      this.indexform.svyLibTemplateTargetoptions.push({
        tempId: Date.now() + Math.random(),
        optioncontent: "",
        score: "",
        isoperation: 1,
      });
      console.log(this.indexform.svyLibTemplateTargetoptions);
    },
    deletexuanx(item) {
      this.indexform.svyLibTemplateTargetoptions =
        this.indexform.svyLibTemplateTargetoptions.filter(
          (opt) => opt.tempId !== item.tempId
        );
    },
    // 选项文件上传
    handleChange(item, response, file, fileList) {
@@ -2586,9 +2615,16 @@
</script>
<style lang="scss" scoped>
$radius: 8px;
$border: #e4e7ed;
$bg-light: #f7f9fb;
$primary: #409eff;
$text-main: #303133;
$text-sub: #606266;
.Questionnairemanagement {
  // display: flex;
}
.sidecolumn {
  margin: 10px 20px 0 20px;
  padding: 20px;
@@ -2597,6 +2633,7 @@
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
}
.leftvlue {
  // //   display: flex;
  // //   flex: 1;
@@ -2610,20 +2647,25 @@
  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);
  .mulsz {
    font-size: 20px;
  }
  .leftvlue-jbxx {
    display: flex; /* 使用 Flexbox 布局 */
    display: flex;
    /* 使用 Flexbox 布局 */
    justify-content: space-between;
    font-size: 24px;
    border-left: 5px solid #41a1be;
    padding-left: 5px;
    margin: 15px 0;
  }
  .demo-cascader {
    margin-right: 20px;
  }
  .PreviewTemplate {
    color: #02a7f0;
    cursor: pointer;
@@ -2631,6 +2673,7 @@
    margin: 0 20px;
  }
}
.preview-left {
  margin: 20px;
  //   margin: 20px;
@@ -2639,14 +2682,17 @@
  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);
  .scriptTopic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.headline {
  display: flex;
  justify-content: space-between;
@@ -2655,6 +2701,7 @@
  padding-left: 5px;
  margin: 15px 0;
}
.xinz-inf {
  font-size: 18px;
  white-space: nowrap;
@@ -2666,6 +2713,7 @@
  .el-tag + .el-tag {
    margin-left: 10px;
  }
  .button-new-tag {
    margin-left: 10px;
    height: 32px;
@@ -2673,12 +2721,14 @@
    padding-top: 0;
    padding-bottom: 0;
  }
  .input-new-tag {
    width: 90px;
    margin-left: 10px;
    vertical-align: bottom;
  }
}
.xinz-infs {
  font-size: 18px;
  line-height: 48px;
@@ -2687,54 +2737,123 @@
    margin-left: 10px;
  }
}
.addtopic {
  margin-top: 30px;
}
.presentation {
  margin: 20px 0;
  display: flex;
  .presentation-left {
    width: 45%;
    max-height: 80vh;
    padding: 0 20px;
    font-size: 18px;
    overflow: auto;
    .button-textxg {
      color: #024df0;
    }
    .button-textsc {
      color: #f52727;
    }
  }
  .spresentation-left {
    width: 100%;
    // height: 500px;
    .button-textxg {
      color: #024df0;
    }
    .button-textsc {
      color: #f52727;
    }
  }
  .presentation-right {
    width: 55%;
    flex: 6;
    min-width: 360px;
    max-height: 80vh;
    padding: 0 20px;
    font-size: 18px;
    overflow: auto;
    padding: 20px;
    .headline {
      font-size: 20px;
      border-left: 3px solid #41a1be;
      padding-left: 5px;
      margin: 15px 0;
    }
    .topicxq {
      background-color: #e2f5fc;
      border-radius: 4px;
      margin-top: 10px;
      font-size: 18px;
      font-weight: 600;
      color: $text-main;
      padding-left: 10px;
      padding-top: 15px;
      border-left: 4px solid $primary;
      margin-bottom: 16px;
    }
    .topic-card {
      background: #fff;
      border: 1px solid $border;
      border-radius: $radius;
      padding: 20px;
      margin-bottom: 16px;
      transition: box-shadow 0.2s;
      &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
      }
      .el-form-item {
        margin-bottom: 16px;
      }
      .el-form-item__label {
        font-size: 14px;
        color: $text-sub;
      }
    }
  }
}
.demo-drawer {
  .preview-left {
    padding: 20px;
    .headline {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 12px;
    }
    .topic-card {
      background: #fff;
      border: 1px solid $border;
      border-radius: $radius;
      padding: 16px;
      margin-bottom: 12px;
      .el-form-item {
        margin-bottom: 14px;
      }
      .el-button--primary {
        background: $primary;
        border-radius: 20px;
        padding: 8px 16px;
      }
    }
  }
}
.addoption-btn {
  width: 100%;
  border: 1px dashed $border;
  color: $text-sub;
  background: $bg-light;
  border-radius: $radius;
  height: 40px;
  &:hover {
    border-color: $primary;
    color: $primary;
  }
}
.topicxq {
@@ -2748,6 +2867,7 @@
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
}
.service-tag-container {
  display: inline-block;
@@ -2850,6 +2970,7 @@
    opacity: 0;
    transform: scale(0.8) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
@@ -2877,9 +2998,12 @@
    }
  }
}
.custom-width {
  width: 100px; /* 设置宽度样式 */
  width: 100px;
  /* 设置宽度样式 */
}
.el-select {
  width: 280px;
}
@@ -2887,6 +3011,7 @@
.el-cascader {
  width: 40%;
}
::v-deep .addtopic-input {
  input {
    background: #02a7f0;
@@ -2894,25 +3019,31 @@
    width: 150px;
  }
}
::v-deep.el-step.is-vertical .el-step__title {
  font-size: 25px;
}
::v-deep.el-input--medium {
  font-size: 18px !important;
}
::v-deep.ruleFormaa.el-select {
  display: inline-block;
  position: relative;
  width: 700px;
}
.el-select__tags {
  font-size: 20px;
  max-width: 888px !important;
}
::v-deep.el-radio__inner {
  width: 22px;
  height: 22px;
}
// ::v-deep.scriptTopic-dev.el-radio__label {
//   font-size: 24px;
// }
@@ -2921,11 +3052,13 @@
    font-size: 24px;
  }
}
::v-deep.el-checkbox-group {
  span {
    font-size: 24px;
  }
}
// ::v-deep.el-form-item--medium .el-form-item__content {
//   line-height: 36px;
//   display: flex;