

### 系统常量
|  变量   | 变量名  |
|  :----  | :----  |
| 当前用户  | __CURRENT_USER__ |
| 当前用户的所属部门  | __CURRENT_USER_DEPARTMENT__ |
| 当前用户的所属部门s  | __CURRENT_USER_DEPARTMENTS__ |
| 当前用户的部门成员  | __CURRENT_DEPT_USERS__ |
待完善...

### 列表配置操作按钮
#### JSON结构
```
[{
		"key": "search",
		"method": "handleSearch",
		"label": "高级筛选",
		"type": "operation",
		"url": "",
		"openMode": 1,
		"pageType": 1,
        "needSelected": false,
        "needAlert": false,
		"show": true,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "default",
				"icon": ""
			}
		}
	},{
		"key": "create",
		"method": "handleCreate",
		"label": "新增",
		"type": "link",
		"url": "\/business-form\/edit\/PrtRz8AY\/IBH1Spvq\/0\/1",
		"openMode": 3,
		"pageType": 2,
        "needSelected": false,
        "needAlert": false,
		"show": true,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "primary",
				"icon": "plus"
			}
		}
	}, {
		"key": "import",
		"method": "handleImport",
		"label": "导入",
		"type": "operation",
		"url": "",
		"openMode": 1,
		"pageType": 1,
        "needSelected": false,
        "needAlert": false,
		"show": false,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "default",
				"icon": "vertical-align-top"
			}
		}
	}, {
		"key": "export",
		"method": "handleExport",
		"label": "导出",
		"type": "operation",
		"url": "",
		"openMode": 1,
		"pageType": 1,
        "needSelected": false,
        "needAlert": false,
		"show": true,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "default",
				"icon": "vertical-align-bottom"
			}
		}
	}, {
		"key": "downTemplate",
		"method": "handleDownloadTemplate",
		"label": "下载导入模板",
		"type": "operation",
		"url": "",
		"openMode": 1,
		"pageType": 1,
        "needSelected": false,
        "needAlert": false,
		"show": false,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "default",
				"icon": "file-excel"
			}
		}
	}, {
		"key": "print",
		"method": "handlePrint",
		"label": "打印",
		"type": "operation",
		"url": "",
		"openMode": 1,
		"pageType": 1,
        "needSelected": true,
        "needAlert": false,
		"show": true,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "default",
				"icon": "printer"
			}
		}
	}, {
		"key": "delete",
		"method": "handleDelete",
		"label": "删除",
		"type": "operation",
		"url": "",
		"openMode": 1,
		"pageType": 1,
        "needSelected": true,
        "needAlert": true,
		"show": true,
		"event": [],
		"render": {
			"basic": {
				"width": "100%",
				"size": "default",
				"type": "default",
				"icon": "close"
			}
		}
	}]
```

### 配置链接
#### JSON结构 [linkage]
```
{
    "label": "商品",
    "component": "Information",
    "entity": "demo.catalog_id",
    "render": {
        "basic": {
            "mode": "object",
            "layout": "between",
            "display": {
                "mode": "text",
                "field": "name"
            },
            "linkage": {
                "componentName": "CustomerDetail",
                "params": "{\"dataId\":\"{{demo.customer_id}}\"}",
                "icon": "deployment-unit",
                "openMode": 1
            },
            "linkage": {
                "businessId": "PrtRz8AY",
                "pageId": "IBH1Spvq",
                "params": "{\"dataId\":\"{{demo.project_id}}\"}",
                "icon": "deployment-unit",
                "type": 1,
                "openMode": 1
            }
        }
    },
    "key": "Information_1626315138820"
}
```
* 兼容旧版本的详情组件;
* openMode:打开方式，1.默认（右滑出来），2.弹窗;
* type(名称跟其它地址的兼容)：页面类型：1、详情，2、编辑、3、列表;
* params：参数
```
{
  "dataId": "{{demo.id}}",
  "condition": [
    [{
    "field": "demo_name",
    "operator": "eq",
    "value": "{{demo.name}}"
    }]
  ],
  "pagination": {
    "current": 1,
    "pageSize": 30
  },
  "module":{
    "add":false,
    "export":false,
    "remove":false,
    "print":false,
    "invalid":false,
    "search":false,
    "select":false
  }
}
              
详情、编辑需要参数：dataId
列表可配置：condition、pagination、module
可取固定、对象、分录的值：{"dataId":2} {{demo.id}} {{demo_item[].project_id}}
当前用户：{"demo_created_by":"__CURRENT_USER__"}
```

### 执行自定义事件
```
1、先调试好自定义事件；
2、在页面设计-全局事件-增加事件，贴上调好的代码，类似于：

console.log('xxxxxxxxxx1');     
var fields = that.form.getFieldsValue();
fields.demo.amount = (fields.qty || 2) * (fields.price || 100);
that.form.setFieldsValue(fields);
console.log('fields:', fields);

3、在页面设计-控件属性设置-绑定事件，选择对应的事件即可；
```

### 自定义组件
自动加载指定位置（solution/项目名/主实体名/组件名称）的组件；如：
```
solution/doms/project/DemoPrice.vue

1、先在指定目录创建组件；
2、在页面设计中拖自定义组件,并命名，不要以.vue结尾，如DemoPrice；
```

## 版本说明
* 2021.04.21:更新新版实体设计，**与之前代码不兼容**；页面设计v0.0.1;
* 2023.03.01:
* 1、PC分录组件支持合计 在详情设计页配置;
* 2、PC分录组件支持两种方式展示 **表格、折叠列表** 在详情设计页配置;
* 3、标准列表增加自定义组件渲染方式 **在页面列表设计页中选择列渲染方式为自定义组件** 并命名,如DemoPrice;

## 项目运行说明
```
1、进入项目目录，安装依赖
cd /data/www/thincent-cloud/web/pc
npm install
或 cnpm install

2、开发调试运行
npm run serve
结果如下：
  App running at:
  - Local:   http://localhost:8201/ 
  - Network: http://10.0.0.151:8201/

3、打包
npm run build

4、设置配置文件，文件需要自己创建
    4.1、开发模式的配置文件位置：public/config.json
    4.2、打包后运行的配置文件位置：dist/config.json
    4.3、配置文件内容参考，注意：VUE_APP_ID、VUE_APP_NAME 要与数据库表system_app中的记录一致（VUE_APP_ID目前的项目都是1），否则接口会报错；
	4.4、附件上传平台标志 默认本地 可选 ['local','cos']；"VUE_UPLOAD_PLATFORM": "local"；

config.json
{
  "VUE_APP_SERVICE_URL": "http://203.195.198.23/thincent-cloud/v3-doms/",
  "VUE_APP_SERVICE_URL": "http://localhost/thincent-cloud/",
  "VUE_APP_ID": 1,
  "VUE_APP_NAME": "doms",
  "VUE_APP_CLIENT_ID": 1,
  "VUE_APP_CLIENT_NAME": "信晨 DOMS",
  "VUE_APP_CLIENT_SECRET": "",
  "VUE_APP_LICENSE_COMPANY": "信晨科技",
  "VUE_UPLOAD_PLATFORM": "local",
  "AXIOS_TIMEOUT": 90000
}

```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
