Commit a5776103 authored by renjintao's avatar renjintao

page

parents 24ae67a5 8bbe81be
This diff is collapsed.
<template> <template>
<div class="ib" @click="showLife"> <div class="ib" @click="showLife">
<div class="ib" v-if="!isMore"> <div class="ib" v-if="!isMore">
<span v-if="type=='text'" :style="style">{{name}}</span> <span v-if="type == 'text'" :style="style">{{ name }}</span>
<Tag v-if="type=='tag'" :color="tagcolor">{{name}}</Tag> <Tag v-if="type == 'tag'" :color="tagcolor">{{ name }}</Tag>
<Badge v-if="type=='dot'" :color="tagcolor" :text="name" /> <Badge v-if="type == 'dot'" :color="tagcolor" :text="name" />
<Icon v-if="type=='icon'" :type="item.icon" :color="tagcolor" :title="name" size="24" /> <Icon
v-if="type == 'icon'"
:type="item.icon"
:color="tagcolor"
:title="name"
:size="size"
/>
</div> </div>
<div class="ib" v-else v-for="(li,i) in items" :key="i"> <div class="ib" v-else v-for="(li, i) in items" :key="i">
<span v-if="type=='text'" :style="li.style">{{li.name}}</span> <span v-if="type == 'text'" :style="li.style">{{ li.name }}</span>
<Tag v-if="type=='tag'" :color="li.tagcolor">{{li.name}}</Tag> <Tag v-if="type == 'tag'" :color="li.tagcolor">{{ li.name }}</Tag>
<Badge v-if="type=='dot'" :color="li.tagcolor" :text="li.name" />&nbsp; <Badge v-if="type == 'dot'" :color="li.tagcolor" :text="li.name" />&nbsp;
</div> </div>
<Modal v-model="modal" title="生命周期" width="800" footer-hide :mask-closable="false"> <Modal
<component :is="detail" :code="code" :value="value" :mode="mode" /> v-model="modal"
title="生命周期"
width="800"
footer-hide
:mask-closable="false"
>
<component :is="detail" :code="code" :value="value" :mode="mode" />
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -21,48 +33,52 @@ export default { ...@@ -21,48 +33,52 @@ export default {
name: "state", name: "state",
data() { data() {
return { return {
mode:'0', mode: "0",
name: "", name: "",
isMore: false, isMore: false,
modal:false, modal: false,
item: {}, item: {},
items: [], items: [],
data: [], data: [],
detail:null, detail: null,
}; };
}, },
props: { props: {
default: { default: {
type: String, type: String,
default: "" default: "",
}, },
type: { type: {
type: String, type: String,
default: "text", default: "text",
validator: function(value) { validator: function (value) {
return ["text", "tag", "dot", "icon"].indexOf(value) != -1; return ["text", "tag", "dot", "icon"].indexOf(value) != -1;
} },
}, },
code: { code: {
type: String, type: String,
required: true required: true,
}, },
value: { value: {
type: [String, Number], type: [String, Number],
required: false required: false,
}, },
color: { color: {
type: Boolean, type: Boolean,
default: true default: true,
},
size: {
type: Number,
default: 24,
}, },
icon: { icon: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
img: { img: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
created() { created() {
this.data = this.$store.getters.dictionaryByKey(this.code) || []; this.data = this.$store.getters.dictionaryByKey(this.code) || [];
...@@ -71,7 +87,7 @@ export default { ...@@ -71,7 +87,7 @@ export default {
setName(v) { setName(v) {
if ((v + "").indexOf(",") == -1) { if ((v + "").indexOf(",") == -1) {
var item; var item;
this.data.map(u => { this.data.map((u) => {
if (u.code == v) { if (u.code == v) {
item = u; item = u;
} }
...@@ -81,7 +97,7 @@ export default { ...@@ -81,7 +97,7 @@ export default {
this.item = item; this.item = item;
} else { } else {
if (this.value == "undefined") { if (this.value == "undefined") {
this.name = ' ' this.name = " ";
} else { } else {
this.name = this.value; this.name = this.value;
} }
...@@ -90,7 +106,7 @@ export default { ...@@ -90,7 +106,7 @@ export default {
this.isMore = true; this.isMore = true;
var items = []; var items = [];
var ul = (v + "").split(","); var ul = (v + "").split(",");
this.data.map(u => { this.data.map((u) => {
if (ul.indexOf(u.code) > -1) { if (ul.indexOf(u.code) > -1) {
u.tagcolor = u.color | "default"; u.tagcolor = u.color | "default";
u.style = { color: u.color | "inherit" }; u.style = { color: u.color | "inherit" };
...@@ -99,11 +115,11 @@ export default { ...@@ -99,11 +115,11 @@ export default {
}); });
this.items = items; this.items = items;
} }
} },
,showLife(){ showLife() {
this.modal= true ; this.modal = true;
this.detail=()=>import("./life"); this.detail = () => import("./life");
} },
}, },
computed: { computed: {
tagcolor() { tagcolor() {
...@@ -125,9 +141,9 @@ export default { ...@@ -125,9 +141,9 @@ export default {
color: color:
this.item && this.item.color != "" && this.item.color != null this.item && this.item.color != "" && this.item.color != null
? this.item.color ? this.item.color
: "inherit" : "inherit",
}; };
} },
}, },
watch: { watch: {
value(v) { value(v) {
...@@ -139,7 +155,7 @@ export default { ...@@ -139,7 +155,7 @@ export default {
this.setName(this.value); this.setName(this.value);
this.$forceUpdate(); this.$forceUpdate();
} }
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -259,17 +259,17 @@ export default { ...@@ -259,17 +259,17 @@ export default {
this.$Message.error("未设置结束时间"); this.$Message.error("未设置结束时间");
return return
} }
if(!row.executor){ if(row.executor.length==0){
this.$Message.error("设置执行人"); this.$Message.error("设置执行人");
return return
} }
delete row.chlidren; delete row.chlidren;
delete row.parent; delete row.parent;
console.warn(row) console.warn(row)
var data=JSON.parse(JSON.stringify(row));
data.status=1; row.status=1;
Api.sendtask(data).then(r=>{ Api.sendtask(row).then(r=>{
if(r.result){ if(r.success){
this.$Message.info("任务派发成功!"); this.$Message.info("任务派发成功!");
this.search(); this.search();
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment