yxh
2023-03-21 acd7802beaa570c6811ed7227e441e39e8c5e37e
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue
@@ -1,46 +1,45 @@
<template>
    <div class="app-container">
       <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
            v-hasPermi="['smartor:svytopicoption:add']">新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['smartor:svytopicoption:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['smartor:svytopicoption:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['smartor:svytopicoption:remove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['smartor:svytopicoption:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="svytopicoptionList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label=" 选项类型 " width="150" align="center" prop="topictype" />
      <el-table-column label=" 选项内容 " width="200" align="center" prop="optioncontent" />
      <el-table-column label=" 提示 " width="200" align="center" prop="prompt" />
      <el-table-column label=" 分数 " width="55" align="center" prop="score" />
      <el-table-column label=" 明细 " width="100" align="center" prop="isexistdetail" />
      <el-table-column label=" 归属机构 " width="200" align="center" prop="orgid" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['smartor:svytopicoption:edit']">修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['smartor:svytopicoption:remove']">删除</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
            v-hasPermi="['smartor:svytopicoption:export']">导出</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
      <el-table v-loading="loading" :data="svytopicoptionList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label=" 题目类型 " width="150" align="center" prop="topictype" />
        <el-table-column label=" 选项内容 " width="200" align="center" prop="optioncontent" />
        <el-table-column label=" 提示 " width="200" align="center" prop="prompt" />
        <el-table-column label=" 分数 " width="55" align="center" prop="score" />
        <el-table-column label=" 验证规则 " width="250" align="center" prop="verifyrule" />
        <el-table-column label=" 是否存在明细 " width="150" align="center" prop="isexistdetail" />
        <el-table-column label=" 归属机构 " width="200" align="center" prop="orgid" />
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
              v-hasPermi="['smartor:svytopicoption:edit']">修改</el-button>
            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
              v-hasPermi="['smartor:svytopicoption:remove']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <maintdlg ref="maint"/>
    </div>
  </template>
        </template>
      </el-table-column>
    </el-table>
    <maintdlg ref="maint" />
  </div>
</template>
  
  <script>
  import { listSvytopicoption, getSvytopicoption, delSvytopicoption, addSvytopicoption, updateSvytopicoption } from "@/api/smartor/svytopicoption";
@@ -50,6 +49,7 @@
    name: "Svytopicoption",
    data() {
      return {
        topicId: null,
        single: true,
        // 非多个禁用
        multiple: true,
@@ -79,6 +79,7 @@
    methods: {
      /** 查询问卷问题选项列表 */
      getList(topicId) {
        this.topicId = topicId;
        this.loading = true;
        this.queryParams.topicid = topicId;
        listSvytopicoption(this.queryParams).then(response => {
@@ -96,13 +97,13 @@
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.$refs["maint"].handleUpdate(null)
        this.$refs["maint"].handleUpdate2(null,this.topicId)
        return
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        const optionid = row.optionid || this.ids
        this.$refs["maint"].handleUpdate(optionid)
        this.$refs["maint"].handleUpdate2(optionid,this.topicId)
        return 
      },