import { paBusinessMsgScene } from "@/services/platform";
import { doFetch } from "@/utils/doFetch";
import regValue from "@/utils/regValue";
let numReg = regValue("integer");
const addFields = {
	"businessMsgSceneId": {
		"value": null,
		"type": "select",
		"title": "推送类型",
		"name": [
			"businessMsgSceneId"
		],
		"required": true,
		"options": {
			"database": paBusinessMsgScene,
			"params": {}
		}
	},
	"sendMethodType": {
		"value": null,
		"type": "select",
		"title": "推送方式",
		"name": [
			"sendMethodType"
		],
		"required": true,
		"options": [
			{
				"label": "企业微信",
				"value": 1
			},{
				"label": "邮件",
				"value": 2
			}
		]
	},
	"fitField": {
		"value": null,
		"type": "select",
		"title": "适用类型",
		"name": [
			"fitField"
		],
		"required": true,
		"options": [
			{
				"label": "全部",
				"value": 1
			},
			{
				"label": "工厂",
				"value": 2
			},
			{
				"label": "组织",
				"value": 3
			},
			{
				"label": "仓库",
				"value": 4
			}
        ]
	},
	"fieldId": {
		"value": null,
		"type": "select",
		"title": "类型名称",
		"name": [
			"fieldId"
		],
        "required": true,
        "hides":false,
        "options":[]
	}
},
tableField={
	"sendProcess": {
		"value": null,
		"type": "select",
		"title": "推送流程",
		"name": [
			"sendProcess"
		],
		"required": true,
		options:[
			{
				label:"一级通知",
				value:1
			},
			{
				label:"二级通知",
				value:2
			},
			{
				label:"三级通知",
				value:3
			},
			{
				label:"四级通知",
				value:4
			},
			{
				label:"五级通知",
				value:5
			},
			{
				label:"六级通知",
				value:6
			},
			{
				label:"七级通知",
				value:7
			},
			{
				label:"八级通知",
				value:8
			}
		]
	},
	"sendTo": {
		"value": null,
		"type": "select",
		"title": "推送对象",
		"name": [
			"sendTo"
		],
		"required": true,
		"options": [
			{
				"label": "指定人员",
				"value": 1
			},
			{
				"label": "可指定人员",
				"value": 2
			},
			{
				"label": "创建人",
				"value": 3
			},
			{
				"label": "（指定人员）上级领导",
				"value": 4
			},
			{
				"label": "（上个通知人员）上级领导",
				"value": 5
			},
			{
				"label": "选择角色",
				"value": 6
			},
			{
				"label": "选择人员",
				"value": 7
			}
		]
	},
	"targetIdList": {
		"value": null,
		"type": "select",
		"title": "选择对象",
		"name": [
			"targetIdList"
		],
		"required": true,
		"options": [],
		hides:true,
		multiple:true
	},
	"initialTime": {
		"value": null,
		"type": "inputnumber",
		"title": "初始触发时长",
		"name": [
			"initialTime"
		],
		"required": true,
		min:0,
		...numReg
	},
	"initialUnit": {
		"value": null,
		"type": "select",
		"title": "初始触发时长单位",
		"name": [
			"initialUnit"
		],
		"required": true,
		"options": [
			{
				"label": "分钟",
				"value": 1
			},
			{
				"label": "小时",
				"value": 2
			},
			{
				"label": "天",
				"value": 3
			}
		]
	},
	"intervalTime": {
		"value": null,
		"type": "inputnumber",
		"title": "间隔时长",
		"name": [
			"intervalTime"
		],
		"required": true,
		min:1,
		...numReg
	},
	"intervalUnit": {
		"value": null,
		"type": "select",
		"title": "间隔时长单位",
		"name": [
			"intervalUnit"
		],
		"required": true,
		"options": [
			{
				"label": "分钟",
				"value": 1
			},
			{
				"label": "小时",
				"value": 2
			},
			{
				"label": "天",
				"value": 3
			}
		]
	},
	"sendNum": {
		"value": null,
		"type": "inputnumber",
		"title": "触发次数",
		"name": [
			"sendNum"
		],
		"required": true,
		min:1,
		...numReg
	}
};
export {addFields, tableField}