From a8c0f417a9cc2e7d683947b270114ba88b2213af Mon Sep 17 00:00:00 2001
From: qianxj <qianxj15@sina.com>
Date: 星期二, 21 三月 2023 09:25:59 +0800
Subject: [PATCH] update svytopic

---
 ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue |  116 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 69 insertions(+), 47 deletions(-)

diff --git a/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue b/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
index ffdbb41..59aa1a9 100644
--- a/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
+++ b/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
@@ -69,61 +69,83 @@
   </div>
 </template>
 <script>
+import { listSvytopic, getSvytopic, delSvytopic, addSvytopic, updateSvytopic } from "@/api/smartor/svytopic";
+
 export default {
-  components: {},
-  props: [],
+  name: "SvytopicBase",
+  dicts: ['sys_yes_no'],
   data() {
     return {
-      formData: {
-        field101: undefined,
-      },
+      total: 0,
+      // 寮瑰嚭灞傛爣棰�
+      title: "",
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      // 琛ㄥ崟鏍¢獙
       rules: {
-        field101: [{
-          required: true,
-          message: '璇烽�夋嫨涓嬫媺閫夋嫨',
-          trigger: 'change'
-        }],
-      },
-      field101Options: [{
-        "label": "鍗曢�夐」",
-        "value": 1
-      },
-      {
-        "label": "澶氶�夐」",
-        "value": 2
-      },
-      {
-        "label": "鐩存帴濉啓",
-        "value": 3
-      },
-      {
-        "label": "鏃ユ湡鑼冨洿",
-        "value": 4
-      },
-      {
-        "label": "鏁板�艰寖鍥�",
-        "value": 5
+        delFlag: [
+          { required: true, message: " 鍒犻櫎鏍囪 涓嶈兘涓虹┖", trigger: "change" }
+        ],
+        isupload: [
+          { required: true, message: " 涓婁紶鏍囪 涓嶈兘涓虹┖", trigger: "change" }
+        ],
       }
-      ],
-    }
+    };
   },
-  computed: {},
-  watch: {},
-  created() { },
-  mounted() { },
+  created() {
+  },
   methods: {
-    submitForm1() {
-      this.$refs['elForm'].validate(valid => {
-        if (!valid) return
-        // TODO 鎻愪氦琛ㄥ崟
-      })
+    // 琛ㄥ崟閲嶇疆
+    reset() {
+      this.form = {
+        topicid: null,
+        oldid: null,
+        svyid: null,
+        topictype: null,
+        topiccode: null,
+        topic: null,
+        sort: null,
+        ismandatory: null,
+        ishide: null,
+        delFlag: null,
+        orgid: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        isupload: null,
+        uploadTime: null
+      };
+      this.resetForm("form");
     },
-    resetForm1() {
-      this.$refs['elForm'].resetFields()
+     /** 淇敼鎸夐挳鎿嶄綔 */
+    Retrieve(topicid) {
+      this.reset();
+      getSvytopic(topicid).then(response => {
+        this.form = response.data;
+        this.title = "淇敼闂嵎棰樼洰";
+      });
+    },
+    /** 鎻愪氦鎸夐挳 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.topicid != null) {
+            updateSvytopic(this.form).then(response => {
+              this.$modal.msgSuccess("淇敼鎴愬姛");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addSvytopic(this.form).then(response => {
+              this.$modal.msgSuccess("鏂板鎴愬姛");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
     },
   }
-}
-
+};
 </script>
-<style></style>
-  
\ No newline at end of file

--
Gitblit v1.9.3