Avuex

来自ling
跳转至: 导航搜索

常用连接

https://avuejs.com/doc/form-crud

https://element.eleme.cn/#/zh-CN/component/icon

文件上传 https://avuejs.com/doc/form/form-upload

常用代码

handleRowClick
this.crud.$emit("on-load", this.defaultPage);
tenantId: getStore({name: 'tenantId'})
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.project_delete"
                   @click="handleDelete">删 除
        </el-button>
      </template>
      <template
        slot="menu"
        slot-scope="scope">
        <el-button
          type="text"
          icon="el-icon-edit"
          size="small"
          @click="onPeriod(scope.row)">成本分期
        </el-button>
      </template>
    </avue-crud>
    <el-dialog
      title="成本分期"
      :visible.sync="isShowPeriod"
      width="80%"
      height="80%"
      append-to-body="true"
      center>
      <project_period v-if="isShowPeriod" :dupProjectId="current.dupProjectId"></project_period>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowPeriod = false">取 消</el-button>
        <!--        <el-button type="primary" @click="saveContent">确 定</el-button>-->
      </span>
    </el-dialog>

导入

https://avuejs.com/doc/form/form-upload

<el-dialog
      title="导入"
      :visible.sync="isImport"
      width="50"
      height="50"
      append-to-body="true"
      center>
      <avue-form ref="form" :option="uploadOption" v-model="uploadForm" :upload-before="uploadBefore"
                 :upload-after="uploadAfter">
        <template slot-scope="scope" slot="template">
          <div>
            <el-link type="success">下载模板</el-link>
          </div>
        </template>
      </avue-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isImport = false">取 消</el-button>
          <el-button type="primary" @click="isImport = false">确 定</el-button>
      </span>
    </el-dialog>


    onImport() {
      this.isImport = true;
    },
    uploadBefore(file, done) {
      // this.$message.success('部署开始');
      // this.file = file;
      done()
    },
    uploadAfter(res, done, loading) {
      this.$message.success('上传成功');
      // if (!this.form.flowCategory) {
      //   this.$message.warning('清先选择流程类型');
      //   loading()
      //   return false;
      // }
      // if (this.form.flowMode === 2 && !this.form.tenantId) {
      //   this.$message.warning('清先选择对应租户');
      //   loading();
      //   return false;
      // }
      // if (res.success) {
      //   deployUpload(
      //     flowCategory(this.form.flowCategory),
      //     (this.form.tenantId) ? this.form.tenantId.join(",") : "",
      //     [this.file]
      //   ).then(res => {
      //     const data = res.data;
      //     if (data.success) {
      //       done()
      //     } else {
      //       this.$message.error(data.msg);
      //       loading()
      //     }
      //   })
      // } else {
      //   this.$message.warning('请上传 bpmn20.xml 标准格式文件');
      //   loading()
      //   return false;
      // }
    },

bladex

dicUrl: "/api/blade-system/dict/dictionary?code=data_scope_type",
dicUrl: "/api/blade-system/dict/dictionary-tree?code=data_scope_type",
dicUrl: "/api/blade-system/dict-biz/dictionary?code=data_scope_type",
dicUrl: "/api/blade-system/dict-biz/dictionary-tree?code=data_scope_type",
{
              label: "接口类型",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=api_scope_type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              slot: true,
              width: 100,
              prop: "scopeType",
              rules: [{
                required: true,
                message: "请输入通知类型",
                trigger: "blur"
              }]
            },



              type: "switch",
              align: "center",
              width: 80,
              dicData: [
                {
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                }
              ],

链接

https://crud.avuejs.com/ https://form.avuejs.com/ https://avuejs.com/doc/crud/crud-doc https://avuejs.com/doc/form/form-doc

hide: true,
addDisplay: false,
editDisplay: false

 searchValue:'small',
            search:true,
            searchRules: [{
              required: true,
              message: "请输入姓名",
              trigger: "blur"
            }],
          },{
            label: '日期',
            prop: 'date',
            type:'datetime',
            searchSpan:12,
            searchRange:true,
            search:true,
          }]

以下代码无效

:before-open="beforeProjectOpen"
beforeProjectOpen(show, type) {
       if (['add'].includes(type)) {
         this.currentProject.programmeId = this.programmeId
         show();
       }
     
   }
['add','edit','view']

table 熟悉

dialogClickModal:false,
enter:false,
menu:false,
menuType: 'icon',
{
    "rowKey": "1",
    "tip": true,
    "index": true,
    "selection": true,
    "border": true,
    "expand": true,
    "headerAlign": "center",
    "align": "center",
    "menu": true,
    "menuWidth": "1",
    "menuAlign": "center",
    "menuType": "text",
    "dialogWidth": "1",
    "dialogHeight": "1",
    "dialogType": "drawer",
    "dialogTop": "1",
    "dialogFullscreen": true,
    "dialogEscape": true,
    "dialogModal": true,
    "dialogClickModal": true,
    "dialogCloseBtn": true,
    "addBtn": true,
    "editBtn": true,
    "viewBtn": true,
    "delBtn": true,
    "saveBtn": true,
    "saveBtnTitle": "1",
    "updateBtn": true,
    "updateBtnTitle": "1",
    "cancelBtn": true,
    "cancelBtnTitle": "1",
    "searchBtn": true,
    "refreshBtn": true,
    "filterBtn": true,
    "printBtn": true,
    "excelBtn": true,
    "columnBtn": true,
    "column": [
        {
            "label": "a",
            "prop": "a",
            "type": "input",
            "span": "1",
            "gutter": "1",
            "size": "1",
            "width": "1",
            "minwidth": "1",
            "align": "left",
            "fixed": true,
            "hiden": "1",
            "overHidden": true,
            "filter": true,
            "search": true,
            "dataType": "number",
            "placeholder": "1",
            "tip": "1",
            "addDisplay": true,
            "editDisplay": true,
            "addDisabled": true,
            "editDisabled": true,
            "readonly": true,
            "maxRows": "1",
            "minRows": "1",
            "multiple": true,
            "precision": "1",
            "format": "1",
            "valueFormat": "1"
        },
        {
            "label": "b",
            "prop": "b",
            "type": "input"
        }
    ]
}

动态显影

  created() {
    if (this.category === 'overall') {
      let orgCode = this.findObject(this.option.column, 'orgCode');
      orgCode.hide = true;
      let orgName = this.findObject(this.option.column, 'orgName');
      orgName.hide = true;
    } else {
      let orgCode = this.findObject(this.option.column, 'orgCode');
      orgCode.hide = false;
      let orgName = this.findObject(this.option.column, 'orgName');
      orgName.hide = false;
    }
  },