From 8b50c0466a9453472871da617abc647c39b903dc Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 24 三月 2023 20:33:49 +0800
Subject: [PATCH] yxh

---
 ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue |  185 ++++++++++++++++++++++++++++------------------
 1 files changed, 113 insertions(+), 72 deletions(-)

diff --git a/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue b/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
index 7bed3ad..88ad3b1 100644
--- a/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
+++ b/ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
@@ -1,78 +1,119 @@
 <template>
-    <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="submitForm">鎻愪氦</el-button>
-          <el-button @click="resetForm">閲嶇疆</el-button>
-        </el-form-item>
-      </el-form>
+  <div>
+    <!-- 娣诲姞鎴栦慨鏀归棶鍗烽鐩璇濇 -->
+    <el-form ref="form" :model="form" size="small" :rules="rules" label-width="120px">
+      <el-row>
+        <el-col :span="6"><el-form-item label=" 涓婚缂栧彿 " prop="topiccode">
+            <el-input v-model="form.topiccode" placeholder="璇疯緭鍏� 涓婚缂栧彿 " />
+          </el-form-item></el-col>
+        <el-col :span="6"><el-form-item label=" 鎺掑簭缂栧彿 " prop="sort">
+            <el-input v-model="form.sort" placeholder="璇疯緭鍏� 鎺掑簭缂栧彿 " />
+          </el-form-item></el-col>
+        <el-col :span="6"><el-form-item label=" 鏄惁蹇呭~ " prop="ismandatory">
+            <el-select v-model="form.ismandatory" placeholder="璇烽�夋嫨 鏄惁蹇呭~ ">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="parseInt(dict.value)"></el-option>
+            </el-select>
+          </el-form-item></el-col>
+        <el-col :span="6"><el-form-item label=" 鏄惁闅愯棌 " prop="ishide">
+            <el-select v-model="form.ishide" placeholder="璇烽�夋嫨 鏄惁闅愯棌 ">
+              <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
+                :value="parseInt(dict.value)"></el-option>
+            </el-select>
+          </el-form-item></el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="12"><el-form-item label=" 涓婚鍐呭 " prop="topic">
+            <el-input v-model="form.topic" placeholder="璇疯緭鍏ヤ富棰樺唴瀹�" />
+          </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label=" 鎵�灞為櫌鍖� " prop="orgid">
+            <el-input v-model="form.orgid" placeholder="璇疯緭鍏� 鎵�灞為櫌鍖� " />
+          </el-form-item></el-col>
+      </el-row>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitForm">淇� 瀛�</el-button>
     </div>
-  </template>
-  <script>
-  export default {
-    components: {},
-    props: [],
-    data() {
-      return {
-        formData: { 
-          field101: undefined,
-        },
-        rules: {
-          field101: [{
-            required: true,
-            message: '璇烽�夋嫨涓嬫媺閫夋嫨',
-            trigger: 'change'
-          }],
-        },
-        field101Options: [{
-          "label": "鍗曢�夐」",
-          "value": 1
-        },
-        {
-          "label": "澶氶�夐」",
-          "value": 2
-        },
-        {
-          "label": "鐩存帴濉啓",
-          "value": 3
-        },
-        {
-          "label": "鏃ユ湡鑼冨洿",
-          "value": 4
-        },
-        {
-          "label": "鏁板�艰寖鍥�",
-          "value": 5
-        }
+  </div>
+</template>
+<script>
+import { listSvytopic, getSvytopic, delSvytopic, addSvytopic, updateSvytopic } from "@/api/smartor/svytopic";
+
+export default {
+  name: "SvytopicBase",
+  dicts: ['sys_yes_no'],
+  data() {
+    return {
+      total: 0,
+      // 寮瑰嚭灞傛爣棰�
+      title: "",
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      // 琛ㄥ崟鏍¢獙
+      rules: {
+        delFlag: [
+          { required: true, message: " 鍒犻櫎鏍囪 涓嶈兘涓虹┖", trigger: "change" }
+        ],
+        isupload: [
+          { required: true, message: " 涓婁紶鏍囪 涓嶈兘涓虹┖", trigger: "change" }
         ],
       }
+    };
+  },
+  created() {
+  },
+  methods: {
+    // 琛ㄥ崟閲嶇疆
+    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");
     },
-    computed: {},
-    watch: {},
-    created() {},
-    mounted() {},
-    methods: {
-      submitForm() {
-        this.$refs['elForm'].validate(valid => {
-          if (!valid) return
-          // TODO 鎻愪氦琛ㄥ崟
-        })
-      },
-      resetForm() {
-        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
+};
+</script>

--
Gitblit v1.9.3