{ "name": "Users", "locked": false, "inject": [], "state": { "keyword": { "type": "JSExpression", "value": "''" } }, "lifeCycles": {}, "methods": { "loader": { "type": "JSFunction", "value": "(data) => {\n return this.getData(data)\n}" }, "search": { "type": "JSFunction", "value": "() => {\n this.$refs.gridRef.search()\n}" }, "rowAction": { "type": "JSFunction", "value": "(row) => {\n this.$message.info('click row id: ' + row.id)\n}" } }, "computed": { "columns": { "type": "JSFunction", "value": "() => {\n return [\n {\n type: 'checkbox',\n width: 40\n },\n {\n type: 'seq',\n width: 60,\n title: '序号'\n },\n {\n field: 'name',\n title: '名称',\n minWidth: 100\n },\n {\n field: 'label',\n title: '描述',\n minWidth: 100\n },\n {\n field: 'isDefault',\n title: '默认角色',\n minWidth: 100,\n slots: {\n default: 'isDefault'\n }\n },\n {\n field: 'order',\n title: '排序',\n minWidth: 100,\n sortable: true\n },\n {\n field: 'desc',\n title: '备注',\n minWidth: 100\n },\n {\n field: 'createdAt',\n title: '创建时间',\n minWidth: 140\n },\n {\n field: 'actions',\n title: '操作',\n width: 160,\n slots: {\n default: 'actions'\n }\n }\n ]\n}" } }, "watch": [], "css": "", "props": [], "emits": [], "slots": [], "dataSources": { "getData": { "name": "getData", "test": { "type": "JSFunction", "value": "() => this.runApi({\n /* 在这里可输入接口参数 */\n})" }, "type": "mock", "label": "模拟数据", "mockTemplate": { "type": "JSFunction", "value": "(params) => {\n const { page = 1, pageSize = 50 } = params || {};\n const total = 1000;\n return {\n [`list|${pageSize}`]: [{\n id: '@guid',\n name: '@cname',\n label: '@ctitle',\n 'isDefault|1': '@boolean',\n 'order|+1': 1,\n desc: '@cparagraph',\n createdAt: '@date(yyyy-MM-dd hh:mm:ss)'\n }],\n total,\n page,\n limit: pageSize\n };\n}" } } }, "__VTJ_BLOCK__": true, "__VERSION__": "1736401534792", "id": "7pdk4mxyf", "nodes": [ { "id": "1kqd4haeckr", "name": "XGrid", "from": "@vtj/ui", "invisible": false, "locked": false, "children": [ { "id": "1mp9b7mk9wj", "name": "ElInput", "from": "element-plus", "invisible": false, "locked": false, "slot": { "name": "toolbar__buttons", "params": [] }, "children": [ { "id": "2ax97lz9cox", "name": "ElButton", "from": "element-plus", "invisible": false, "locked": false, "slot": { "name": "append", "params": [] }, "children": "查询", "props": { "type": "primary" }, "directives": [], "events": { "click": { "name": "click", "handler": { "type": "JSFunction", "value": "this.search" }, "modifiers": {} } } } ], "props": { "style": { "width": "300px", "margin-right": "10px" }, "placeholder": "请输入查询关键字" }, "directives": [ { "id": "l36jhkywal", "name": "vModel", "arg": "modelValue", "value": { "type": "JSExpression", "value": "this.state.keyword" } } ], "events": {} }, { "id": "2ammdsu07o6", "name": "ElButton", "from": "element-plus", "invisible": false, "locked": false, "slot": { "name": "toolbar__buttons", "params": [] }, "children": "新增", "props": { "icon": "Plus", "type": "primary" }, "directives": [], "events": { "click": { "name": "click", "handler": { "type": "JSFunction", "value": "() => {\n this.$message.info('click add button')\n}" }, "modifiers": {} } } }, { "id": "257nvaelda4", "name": "ElButton", "from": "element-plus", "invisible": false, "locked": false, "slot": { "name": "toolbar__buttons", "params": [] }, "children": "批量删除", "props": { "icon": "Delete", "type": "danger" }, "directives": [], "events": { "click": { "name": "click", "handler": { "type": "JSFunction", "value": "() => {\n const rows = this.$refs.gridRef.getSelected();\n if (rows.length) {\n this.$message.info('delete data rows: ' + rows.length);\n } else {\n this.$message.warning('请选择需要删除的数据项');\n }\n}" }, "modifiers": {} } } }, { "id": "o52fisb3kt", "name": "ElTag", "from": "element-plus", "invisible": false, "locked": false, "slot": { "name": "isDefault", "params": [] }, "children": { "type": "JSExpression", "value": "this.context.scope_1kqd4haeckr.row.isDefault ? '是' : '否'" }, "props": { "type": { "type": "JSExpression", "value": "this.context.scope_1kqd4haeckr.row.isDefault ? 'success' : 'info'" } }, "directives": [], "events": {} }, { "id": "1ft4np8i6i1", "name": "XAction", "from": "@vtj/ui", "invisible": false, "locked": false, "slot": { "name": "actions", "params": [] }, "children": [], "props": { "mode": "icon", "size": "default", "type": "primary", "label": "编辑" }, "directives": [], "events": { "click": { "name": "click", "handler": { "type": "JSFunction", "value": "() => {\n this.rowAction(this.context.scope_1kqd4haeckr.row)\n}" }, "modifiers": {} } } }, { "id": "1e8ewprm6ts", "name": "XAction", "from": "@vtj/ui", "invisible": false, "locked": false, "slot": { "name": "actions", "params": [] }, "children": [], "props": { "mode": "icon", "size": "default", "type": "primary", "label": "设置" }, "directives": [], "events": { "click": { "name": "click", "handler": { "type": "JSFunction", "value": "() => {\n this.rowAction(this.context.scope_1kqd4haeckr.row)\n}" }, "modifiers": {} } } }, { "id": "2a1cq8bhwej", "name": "XAction", "from": "@vtj/ui", "invisible": false, "locked": false, "slot": { "name": "actions", "params": [] }, "children": [], "props": { "mode": "icon", "size": "default", "type": "danger", "label": "删除" }, "directives": [], "events": { "click": { "name": "click", "handler": { "type": "JSFunction", "value": "async () => {\n const ret = await this.$confirm('确定删除?', '提示', { type: 'warning' }).catch(() => false);\n if (ret) {\n this.rowAction(this.context.scope_1kqd4haeckr.row)\n }\n}" }, "modifiers": {} } } } ], "props": { "ref": "gridRef", "pager": true, "height": "auto", "loader": { "type": "JSExpression", "value": "this.loader" }, "columns": { "type": "JSExpression", "value": "this.columns.value" }, "resizable": true, "customable": true, "style": { "background-color": "#FFFFFF", "padding-top": "10px", "padding-left": "10px", "padding-right": "10px", "padding-bottom": "10px", "border-radius": "4px 4px 4px 4px" } }, "directives": [], "events": {} } ] }