1
lzhe
2024-05-13 f5edc2904945f37b164a7874d502cf002fae024e
src/views/console/base/code-rules.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-17 17:52:50
 * @LastEditTime: 2024-05-13 11:39:54
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -69,28 +69,29 @@
            <el-button @click="closeDrawer">取消</el-button>
         </div>
      </el-drawer>
       <el-dialog title="规则分类" v-model="visible" :width="500">
       <el-dialog title="规则分类" v-model="visible" :width="600" @closed="closeVisible('closed')">
           <el-form :model="classificationForm" :rules="classificationRules" ref="dialogForm" label-width="120px"
               label-position="center">
               <el-row>
                   <el-col :span="12">
                       <el-form-item label="分类规则" prop="code">
                           <el-input v-model="classificationForm.code" placeholder="分类规则" clearable></el-input>
                       <el-form-item label="分类字段" prop="classify">
                           <el-select v-model="classificationForm.classify" style="width: 100%" placeholder="请选择">
                        <el-option v-for="item in aList" :key="item.id" :label="item.title" :value="item.id"/>
                     </el-select>
                       </el-form-item>
                   </el-col>
                   <el-col :span="12">
                       <el-form-item label="分类字典" prop="name">
                           <el-input v-model="classificationForm.name" placeholder="分类字典" clearable></el-input>
                       <el-form-item label="分类字典">
                           <el-input v-model="classificationForm.dictionary" placeholder="分类字典" clearable></el-input>
                       </el-form-item>
                   </el-col>
               </el-row>
           </el-form>
           <template #footer>
               <el-button @click="visible = false">取消</el-button>
               <el-button type="primary" :loading="isSaveing" @click="classificationSubmit()">确定</el-button>
               <el-button type="primary" :loading="isSaveing" @click="classificationSubmit">确定</el-button>
           </template>
       </el-dialog>
   </div>
</template>
<script>
@@ -98,13 +99,19 @@
      name: "apiscope",
      data(){
         return {
            classificationRules: {},
            classificationForm: {},
            classificationRules: {
               classify: [
                  { required: true, message: "请选择分类字段" }
               ]
            },
            classificationForm: {
               classify: "",
               dictionary: ""
            },
            isSaveing: false,
            visible: false,
            drawerPath: "",
            searchData: {
               menuId: "",
               size: "15",
               current: "1"
            },
@@ -138,8 +145,33 @@
       },
      methods: {
         closeVisible(flag) {
            if(flag == "closed") {
               this.classificationForm = {
                  classify: "",
                  dictionary: ""
               }
               this.$refs.dialogForm.resetFields();
            };
         },
         classificationSubmit() {
            this.$refs.dialogForm.validate(async (valid) => {
               if (valid) {
                  this.isSaveing = false;
                  // this.$HTTP.post("/api/blade-system/data-scope/submit",obj).then(res=> {
                  //    this.isSaveing = false;
                  //    if(res.code == 200) {
                  //       this.$emit('success', this.addDictForm, this.mode);
                  //       this.visible = false;
                  //       this.$message.success("操作成功");
                  //    }else {
                  //       this.$alert(res.message, "提示", {type: 'error'});
                  //    }
                  // })
               }else{
                  return false;
               }
            })
         },
         openVisible() {
            this.visible = true;
@@ -196,7 +228,7 @@
            // }else {
            //    this.parentId = '0';
            // }
            // this.$HTTP.get("/api/blade-system/menu/lazy-list",{parentId: this.parentId}).then(res=> {
            // this.$HTTP.get("/api/blade-system/dict/dictionary-tree?code=code_rule_for_biz_objects").then(res=> {
            //    if(res.code == 200) {
            //       res.data.forEach(node => {
            //          node.hasChildren = !node.hasChildren;