yxh
2023-03-21 acd7802beaa570c6811ed7227e441e39e8c5e37e
Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/smartor-web
已修改2个文件
180 ■■■■■ 文件已修改
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_maint.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue
@@ -41,87 +41,89 @@
  </div>
</template>
  
<script>
import { listSvytopicoption, getSvytopicoption, delSvytopicoption, addSvytopicoption, updateSvytopicoption } from "@/api/smartor/svytopicoption";
import maintdlg from "@/smartor/dataobject/dw_svytopicoption_maint.vue";
export default {
  name: "Svytopicoption",
  data() {
    return {
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      loading: false,
      showSearch: true,
      // 总条数
      total: 0,
      // 问卷问题选项表格数据
      svytopicoptionList: [],
      // 查询参数
      queryParams: {
        topicid: null
  <script>
  import { listSvytopicoption, getSvytopicoption, delSvytopicoption, addSvytopicoption, updateSvytopicoption } from "@/api/smartor/svytopicoption";
  import maintdlg from  "@/smartor/dataobject/dw_svytopicoption_maint.vue";
  export default {
    name: "Svytopicoption",
    data() {
      return {
        topicId: null,
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        loading : false,
        showSearch: true,
        // 总条数
        total: 0,
        // 问卷问题选项表格数据
        svytopicoptionList: [],
         // 查询参数
        queryParams: {
          topicid: null
        },
      };
    },
    components:
    {
      maintdlg: maintdlg //()=>import("@/smartor/dataobject/dw_svytopicoption_maint")
    },
    created() {
     },
    mounted() {
    },
    methods: {
      /** 查询问卷问题选项列表 */
      getList(topicId) {
        this.topicId = topicId;
        this.loading = true;
        this.queryParams.topicid = topicId;
        listSvytopicoption(this.queryParams).then(response => {
          this.svytopicoptionList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
    };
  },
  components:
  {
    maintdlg: maintdlg //()=>import("@/smartor/dataobject/dw_svytopicoption_maint")
  },
  created() {
  },
  mounted() {
  },
  methods: {
    /** 查询问卷问题选项列表 */
    getList(topicId) {
      this.loading = true;
      this.queryParams.topicid = topicId;
      listSvytopicoption(this.queryParams).then(response => {
        this.svytopicoptionList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.optionid)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.$refs["maint"].handleUpdate(null)
      return
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const optionid = row.optionid || this.ids
      this.$refs["maint"].handleUpdate(optionid)
      return
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const optionids = row.optionid || this.ids;
      this.$modal.confirm('是否确认删除问卷问题选项编号为"' + optionids + '"的数据项?').then(function () {
        return delSvytopicoption(optionids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('smartor/svytopicoption/export', {
        ...this.queryParams
      }, `svytopicoption_${new Date().getTime()}.xlsx`)
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.optionid)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.$refs["maint"].handleUpdate2(null,this.topicId)
        return
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        const optionid = row.optionid || this.ids
        this.$refs["maint"].handleUpdate2(optionid,this.topicId)
        return
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const optionids = row.optionid || this.ids;
        this.$modal.confirm('是否确认删除问卷问题选项编号为"' + optionids + '"的数据项?').then(function () {
          return delSvytopicoption(optionids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => { });
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('smartor/svytopicoption/export', {
          ...this.queryParams
        }, `svytopicoption_${new Date().getTime()}.xlsx`)
      }
    }
  }
};
</script>
  };
  </script>
  
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_maint.vue
@@ -147,6 +147,22 @@
        this.title = "新增问卷问题选项";
      }
    },
    handleUpdate2(id,topicId) {
      this.reset();
      this.open = true;
      if (id != null) {
        const optionid = id;
        getSvytopicoption(optionid).then(response => {
          this.form = response.data;
          this.form.topicid = topicId;
          this.title = "修改问卷问题选项";
        });
      }else
      {
        this.form.topicid = topicId;
        this.title = "新增问卷问题选项";
      }
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {