/** 质量异常上报数据 **/ const PriorityComponent = { name: 'PriorityComponent', props: { injectData: Object }, computed: { bgColor() { const colors = [ '#9c4048', '#ffbd43', '#0b58ff', '#90dd48', '#449028', '#091238' ] return colors[this.injectData.priority - 1] }, priorityText() { return [ '一级', '二级', '三级', '四级', '五级' ][this.injectData.priority - 1] } }, mounted() { console.log(this.injectData.priority) }, methods: {}, render: function(h) { return h('span', { style: { display: 'inline-block', borderRadius: '2px', padding: '2px 8px', color: '#fff', opacity: '0.6', backgroundColor: this.bgColor }}, this.priorityText) } } console.log('is component?', PriorityComponent) export const qualityTableProps = [ { label: '工序名称', width: 80, prop: 'wsName' }, { label: '所属产线', width: 80, prop: 'pl' }, { label: '异常内容', align: 'center', prop: 'content' }, { label: '报告人', width: 80, prop: 'creator' }, { label: '时间', prop: 'time' }, { label: '优先级', width: 80, prop: 'priority', align: 'center', subcomponent: PriorityComponent } ] export const qualityDatalist = [ { 'wsName': '工序0', 'pl': '产线1', 'content': '争近才百子', 'creator': '毛刚', 'time': '1995-03-10 22:06:23', 'priority': 3 }, { 'wsName': '工序1', 'pl': '产线10', 'content': '确规面这又间级', 'creator': '毛勇', 'time': '1997-11-26 16:27:32', 'priority': 1 }, { 'wsName': '工序2', 'pl': '产线8', 'content': '成思体高原法厂清', 'creator': '林平', 'time': '1990-09-18 03:16:44', 'priority': 2 }, { 'wsName': '工序3', 'pl': '产线6', 'content': '社色增设长放统展', 'creator': '叶静', 'time': '1970-12-02 09:44:01', 'priority': 4 }, { 'wsName': '工序4', 'pl': '产线10', 'content': '今西', 'creator': '罗磊', 'time': '2017-10-21 00:00:27', 'priority': 2 }, { 'wsName': '工序5', 'pl': '产线4', 'content': '却称老节再始', 'creator': '郝秀兰', 'time': '2018-06-04 20:34:53', 'priority': 5 }, { 'wsName': '工序6', 'pl': '产线4', 'content': '志矿正算片大料水断特', 'creator': '熊磊', 'time': '1999-07-20 19:13:32', 'priority': 3 }, { 'wsName': '工序7', 'pl': '产线3', 'content': '目式却属采精国', 'creator': '马磊', 'time': '2001-07-16 03:50:54', 'priority': 4 }, { 'wsName': '工序8', 'pl': '产线7', 'content': '做较代你', 'creator': '曾敏', 'time': '1986-01-07 03:20:21', 'priority': 3 }, { 'wsName': '工序9', 'pl': '产线3', 'content': '与子专前求农说', 'creator': '谭艳', 'time': '1978-07-29 22:49:11', 'priority': 2 } ] /** 质量异常报警 */ const StatusComponent = { name: 'StatusComponent', props: { injectData: Object }, computed: { statusColor() { const colors = [ '#67ff55', 'green', '#ffb70c', '#0b58ff', '#ff0c0c' ] return colors[this.injectData.status - 1] }, statusText() { return [ '已完成', '已下发', '已暂定', '进行中', '已结束' ][this.injectData.status - 1] } }, render: function(h) { return h('span', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', color: '#fff' }}, [ h('span', { style: { width: '6px', height: '6px', borderRadius: '50%', backgroundColor: this.statusColor, boxShadow: '0 0 2px 2px ' + this.statusColor, marginRight: '6px' }}, ''), h('span', this.statusText) ]) } } export const qualityExceptionTableProps = [ { label: '工序名称', prop: 'wsName' }, { label: '所属产线', prop: 'pl' }, { label: '异常内容', prop: 'content' }, { label: '发现人', prop: 'creator' }, { label: '时间', prop: 'time' }, { label: '优先级', prop: 'priority', align: 'center', subcomponent: PriorityComponent }, { label: '处理人', prop: 'charger' }, { label: '完成情况', prop: 'status', align: 'center', subcomponent: StatusComponent } ] export const qualityExceptionDatalist = [ { 'wsName': '工序0', 'pl': '产线1', 'content': '说红要称或各眼华家书', 'creator': '罗霞', 'time': '2013-04-08 15:23:55', 'priority': 1, 'charger': '冯敏', 'status': 4 }, { 'wsName': '工序1', 'pl': '产线9', 'content': '积已反老支人后条办', 'creator': '龚芳', 'time': '1984-06-22 09:44:24', 'priority': 1, 'charger': '万静', 'status': 2 }, { 'wsName': '工序2', 'pl': '产线10', 'content': '铁收王', 'creator': '黎艳', 'time': '2006-10-25 19:20:41', 'priority': 2, 'charger': '徐秀兰', 'status': 1 }, { 'wsName': '工序3', 'pl': '产线10', 'content': '过又条政理质系', 'creator': '郝强', 'time': '2020-03-06 12:11:52', 'priority': 5, 'charger': '白秀兰', 'status': 5 }, { 'wsName': '工序4', 'pl': '产线3', 'content': '特适院', 'creator': '魏超', 'time': '1982-12-26 16:19:57', 'priority': 1, 'charger': '姚静', 'status': 3 }, { 'wsName': '工序5', 'pl': '产线1', 'content': '快准很问无', 'creator': '于桂英', 'time': '1976-09-26 21:53:11', 'priority': 4, 'charger': '白刚', 'status': 2 }, { 'wsName': '工序6', 'pl': '产线7', 'content': '研开', 'creator': '何桂英', 'time': '1977-04-23 05:34:45', 'priority': 3, 'charger': '秦涛', 'status': 4 }, { 'wsName': '工序7', 'pl': '产线2', 'content': '四取各广水儿强想华', 'creator': '唐军', 'time': '1988-03-11 22:40:42', 'priority': 2, 'charger': '龙艳', 'status': 1 }, { 'wsName': '工序8', 'pl': '产线7', 'content': '样无商口', 'creator': '高娟', 'time': '2012-03-14 06:40:16', 'priority': 3, 'charger': '沈涛', 'status': 1 }, { 'wsName': '工序9', 'pl': '产线4', 'content': '克质问般集却片土', 'creator': '谭敏', 'time': '2016-04-14 00:41:46', 'priority': 4, 'charger': '侯磊', 'status': 4 } ]