From acd7802beaa570c6811ed7227e441e39e8c5e37e Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期二, 21 三月 2023 16:07:23 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/smartor-web
---
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_maint.vue | 16 +++++
ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue | 164 +++++++++++++++++++++++++++---------------------------
2 files changed, 99 insertions(+), 81 deletions(-)
diff --git a/ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue b/ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue
index 81e4238..b243d96 100644
--- a/ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_list.vue
+++ b/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>
\ No newline at end of file
diff --git a/ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_maint.vue b/ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_maint.vue
index 3457a7a..4ce4538 100644
--- a/ruoyi-ui/src/smartor/dataobject/dw_svytopicoption_maint.vue
+++ b/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 => {
--
Gitblit v1.9.3