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

---
 ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue |  134 +++++++++++++++++++++++---------------------
 1 files changed, 71 insertions(+), 63 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..35e84d2 100644
--- a/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
+++ b/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- 娣诲姞鎴栦慨鏀归棶鍗烽鐩璇濇 -->
-    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-form ref="form" :model="form" size="small" :inline="true" :rules="rules" label-width="80px">
       <el-form-item label=" 鑰佺増鏈琁D " prop="oldid">
         <el-input v-model="form.oldid" placeholder="璇疯緭鍏� 鑰佺増鏈琁D " />
       </el-form-item>
@@ -50,80 +50,88 @@
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer">
-      <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
-      <el-button @click="cancel">鍙� 娑�</el-button>
+      <el-button type="primary" @click="submitForm">淇� 瀛�</el-button>
     </div>
-    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
-      <el-form-item label="涓嬫媺閫夋嫨" prop="field101">
-        <el-select v-model="formData.field101" placeholder="璇烽�夋嫨涓嬫媺閫夋嫨" clearable :style="{ width: '100%' }">
-          <el-option v-for="(item, index) in field101Options" :key="index" :label="item.label" :value="item.value"
-            :disabled="item.disabled"></el-option>
-        </el-select>
-        <el-input placeholder="閫夐」鍐呭"></el-input>
-      </el-form-item>
-      <el-form-item size="large">
-        <el-button type="primary" @click="submitForm1">鎻愪氦</el-button>
-        <el-button @click="resetForm1">閲嶇疆</el-button>
-      </el-form-item>
-    </el-form>
   </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