Commit 4e3dcdfb authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 5b62adf5 55fc7221
...@@ -1764,5 +1764,34 @@ export default { ...@@ -1764,5 +1764,34 @@ export default {
refName:'引用的文档名称', refName:'引用的文档名称',
refId:'引用的文档id', refId:'引用的文档id',
name:'文档名称', name:'文档名称',
} },
document_property_definition:{
title:'标题',
name:'编号',
revision:'版本',
description:'详细说明',
miji:"密级",
status:'状态',
filePath:'上传文件',
field:'字段',
dataType:'数据类型',
dataLength:'数据长度',
dictionaryId:'',
note:'',
unitName:'单位',
tag:'属性类别',
categoryId:'所属分类',
required:'必填',
isUnique:'是否唯一',
fieldType:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
dictionaryCode:'',
codeRuleId:'',
}
} }
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
note: "", note: "",
dataType: 0, dataType: 0,
unitName: "", unitName: "",
required: true, required: false,
isunique: false, isunique: false,
fieldType: 1, fieldType: 1,
categoryId: 0, categoryId: 0,
...@@ -328,7 +328,6 @@ export default { ...@@ -328,7 +328,6 @@ export default {
// this.entity.filePath = ""; // this.entity.filePath = "";
this.entity.templateId = ""; this.entity.templateId = "";
} }
if (this.row.id) { if (this.row.id) {
this.entity.upId = this.row.id; this.entity.upId = this.row.id;
this.entity.level = this.row.level; this.entity.level = this.row.level;
...@@ -338,7 +337,6 @@ export default { ...@@ -338,7 +337,6 @@ export default {
this.entity.level = 1; this.entity.level = 1;
this.entity.inheritCategoryId = 0; this.entity.inheritCategoryId = 0;
} }
alert(55);
let data = { let data = {
cat: this.entity, cat: this.entity,
pros: this.checkList, pros: this.checkList,
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId"> <FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if='entity.upId!=0'>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> --> <!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit"> <RadioGroup v-model="inherit">
<Radio label="1"></Radio> <Radio label="1"></Radio>
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
note: "", note: "",
dataType: 0, dataType: 0,
unitName: "", unitName: "",
required: true, required: false,
isunique: false, isunique: false,
fieldType: 1, fieldType: 1,
categoryId: 0, categoryId: 0,
...@@ -342,7 +342,7 @@ export default { ...@@ -342,7 +342,7 @@ export default {
if (this.inherit == 0) { if (this.inherit == 0) {
this.entity.inheritCategoryId = 0; this.entity.inheritCategoryId = 0;
} else { } else {
this.entity.inheritCategoryId = this.entity.id; this.entity.inheritCategoryId = this.entity.upId;
} }
let data = { let data = {
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row> <Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> <Col v-for="li in fileds" :key="li.field" :span="li.span">
</FormItem></Col> <FormItem :label="li.title" :prop="li.name">
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> <Input v-if="li.dataType==0" v-model="entity[li.field]" :disabled="li.field=='code'"></Input>
</FormItem></Col> <InputNumber
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker> v-if="li.dataType==1||li.dataType==2"
</FormItem></Col> v-model="entity[li.field]"
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber> class="w100"
</FormItem></Col> ></InputNumber>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber> <Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
</FormItem></Col> <Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker> <DatePicker
</FormItem></Col> v-if="li.dataType==4"
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> v-model="entity[li.field]"
</FormItem></Col> type="date"
<Col :span="12"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </Input> :placeholder="'选择'+li.title"
</FormItem></Col> ></DatePicker>
<Col :span="12"><FormItem :label="l('refName')" prop="refName"> <Input v-model="entity.refName"> </Input> <InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
</FormItem></Col> <!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<Col :span="12"><FormItem :label="l('refId')" prop="refId"> <Input v-model="entity.refId"> </Input> <InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
</FormItem></Col> <Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input> <state
</FormItem></Col> v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
</Row> :value="li.unitName"
<FormItem> code="material.main.unitName"
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> type="tag"
<Button @click="handleClose" class="ml20">取消</Button> ></state>
</FormItem> </FormItem>
</Form> </Col>
</template> </Row>
<!-- <div>
<Divider orientation="left">扩展属性</Divider>
</div>-->
<Row>
<!-- <Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input>
</FormItem>
</Col>-->
<!-- <Col :span="12">
<FormItem :label="l('field')" prop="field">
<Input v-model="entity.field"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dataType')" prop="dataType">
<InputNumber v-model="entity.dataType"></InputNumber>
</FormItem>
</Col>-->
<!-- <Col :span="12">
<FormItem :label="l('dataLength')" prop="dataLength">
<InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dictionaryId')" prop="dictionaryId">
<InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('unitName')" prop="unitName">
<Input v-model="entity.unitName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('tag')" prop="tag">
<Input v-model="entity.tag"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('categoryId')" prop="categoryId">
<InputNumber v-model="entity.categoryId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('required')" prop="required">
<InputNumber v-model="entity.required"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isUnique')" prop="isUnique">
<InputNumber v-model="entity.isUnique"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('fieldType')" prop="fieldType">
<Input v-model="entity.fieldType"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dictionaryCode')" prop="dictionaryCode">
<Input v-model="entity.dictionaryCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('codeRuleId')" prop="codeRuleId">
<InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<RadioGroup v-model="entity.status">
<Radio label="0">草稿</Radio>
<Radio label="1">送审</Radio>
</RadioGroup>
</FormItem>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</Col>-->
<Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false, disabled: false,
entity: {creationTime: null, fileds: [], //扩展属性
creatorUserId: null, entity: {
lastModificationTime: null, creatorUserId: this.$store.state.userInfo.userId,
lastModifierUserId: null, status: "0",
isDeleted: null, categoryId: this.treeId,
deletionTime: null, // title: "",
deleterUserId: null, // field: "",
documentId: "", // dataType: null,
refName: "", // dataLength: null,
refId: "", // dictionaryId: null,
name: ""}, // note: "",
rules: { // unitName: "",
name: [{ required: true, message: '必填', trigger: 'blur' }] // tag: "",
} // categoryId: null,
// required: null,
// isUnique: null,
// fieldType: null,
// creationTime: null,
// creatorUserId: null,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
// dictionaryCode: "",
// codeRuleId: null,
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: {
v: Object,
treeId: Number,
eid: Number,
},
mounted() {
this.initFiled();
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
initFiled() {
// let conditions = [
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: this.eid,
// },
// ];
Api.listbyid({
categoryId: this.treeId,
// sortBy: "id",
// isDesc: false,
}).then((r) => {
if (r.result) {
let result = [];
result = r.result.definie.concat(r.result.inherit);
console.log(result)
this.fileds = result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
} }
}, delete item["id"];
props: { // return item.fieldType != 1;
v: Object, return item;
eid: Number });
}, this.fileds.map((u) => {
mounted() { let v = "";
if (this.eid > 0) { if (u.dataType == 1 || u.dataType == 2) {
this.load(this.eid); v = 0;
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "document_ref" + "." + key;
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
},
eid(v) {
if (v > 0) {
this.load(v);
}
} }
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
} }
} });
</script> },
\ No newline at end of file handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePath = this.parms.eid;
} else {
this.entity.filePath = "";
}
Api.create(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
// load(v) {
// Api.get({ id: v }).then((r) => {
// this.entity = r.result;
// this.entity.id = 0;
// });
// },
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key);
},
},
watch: {
// v() {
// this.entity = this.$u.clone(this.v);
// },
// eid(v) {
// if (v > 0) {
// this.load(v);
// }
// },
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request' import Api from '@/plugins/request';
export default { export default {
index:`${material}documentref/paged`, index:`${material}/document/paged`,
paged(params){ paged(params){
return Api.post(`${material}documentref/paged`,params); return Api.post(`${material}/document/paged`,params);
}, },
get(params){ get(params){
return Api.get(`${material}documentref/get`,params); return Api.get(`${material}/document/get`,params);
}, },
create(params){ create(params){
return Api.post(`${material}documentref/create`,params); return Api.post(`${material}/document/createnew`,params);
}, },
update(params){ update(params){
return Api.post(`${material}documentref/update`,params); return Api.post(`${material}/document/updatenew`,params);
}, },
delete(id) { delete(id) {
return Api.delete(`${material}documentref/delete`,{params:{id:id}}); return Api.delete(`${material}/document/delete`,{params:{id:id}});
}, },
deletes(params) { deletes(params) {
return Api.post(`${material}documentref/batchdelete`,params); return Api.post(`${material}/document/batchdelete`,params);
} },
} //文档分类列表
\ No newline at end of file list(params){
return Api.post(`${material}/documentcategory/list`,params);
},
//自定义属性
listbyid(params){
return Api.get(`${material}/documentpropertydefinition/listbyid`,params);
},
}
\ No newline at end of file
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
<div class="detail"> <div class="detail">
<Row> <Row>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('field')">{{entity.field}}</Filed>
<Filed :span="12" :name="l('dataType')">{{entity.dataType}}</Filed>
<Filed :span="12" :name="l('dataLength')">{{entity.dataLength}}</Filed>
<Filed :span="12" :name="l('dictionaryId')">{{entity.dictionaryId}}</Filed>
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('unitName')">{{entity.unitName}}</Filed>
<Filed :span="12" :name="l('tag')">{{entity.tag}}</Filed>
<Filed :span="12" :name="l('categoryId')">{{entity.categoryId}}</Filed>
<Filed :span="12" :name="l('required')">{{entity.required}}</Filed>
<Filed :span="12" :name="l('isUnique')">{{entity.isUnique}}</Filed>
<Filed :span="12" :name="l('fieldType')">{{entity.fieldType}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed> <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed> <Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed> <Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
...@@ -9,10 +21,8 @@ ...@@ -9,10 +21,8 @@
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed> <Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed> <Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> <Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('documentId')">{{entity.documentId}}</Filed> <Filed :span="12" :name="l('dictionaryCode')">{{entity.dictionaryCode}}</Filed>
<Filed :span="12" :name="l('refName')">{{entity.refName}}</Filed> <Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</Filed>
<Filed :span="12" :name="l('refId')">{{entity.refId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
</Row> </Row>
</div> </div>
...@@ -49,7 +59,7 @@ ...@@ -49,7 +59,7 @@
this.$emit('on-close') this.$emit('on-close')
}, },
l(key) { l(key) {
key = "document_ref" + "." + key; key = "document_property_definition" + "." + key;
return this.$t(key) return this.$t(key)
} }
}, },
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('field')" prop="field"> <Input v-model="entity.field"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dataType')" prop="dataType"> <InputNumber v-model="entity.dataType"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dataLength')" prop="dataLength"> <InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dictionaryId')" prop="dictionaryId"> <InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('note')" prop="note"> <Input v-model="entity.note"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('unitName')" prop="unitName"> <Input v-model="entity.unitName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('tag')" prop="tag"> <Input v-model="entity.tag"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('categoryId')" prop="categoryId"> <InputNumber v-model="entity.categoryId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('required')" prop="required"> <InputNumber v-model="entity.required"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isUnique')" prop="isUnique"> <InputNumber v-model="entity.isUnique"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('fieldType')" prop="fieldType"> <Input v-model="entity.fieldType"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> <Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col> </FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> <Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
...@@ -15,13 +39,9 @@ ...@@ -15,13 +39,9 @@
</FormItem></Col> </FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> <Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col> </FormItem></Col>
<Col :span="12"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </Input> <Col :span="12"><FormItem :label="l('dictionaryCode')" prop="dictionaryCode"> <Input v-model="entity.dictionaryCode"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refName')" prop="refName"> <Input v-model="entity.refName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refId')" prop="refId"> <Input v-model="entity.refId"> </Input>
</FormItem></Col> </FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input> <Col :span="12"><FormItem :label="l('codeRuleId')" prop="codeRuleId"> <InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem></Col> </FormItem></Col>
</Row> </Row>
<FormItem> <FormItem>
...@@ -82,7 +102,7 @@ ...@@ -82,7 +102,7 @@
this.$emit('on-close') this.$emit('on-close')
}, },
l(key) { l(key) {
key = "document_ref" + "." + key; key = "document_property_definition" + "." + key;
return this.$t(key) return this.$t(key)
} }
}, },
......
<template> <template>
<div> <div class="product-mix">
<DataGrid :columns="columns" ref="grid" :action="action"> <Layout>
<template slot="easySearch"> <Sider width="300" v-if="showMenu">
<Form ref="formInline" :model="easySearch" inline> <div class="flex fd tree-menu">
<FormItem prop="keys"> <h3>
<Input placeholder="请输入关键字引用的文档名称/文档名称" v-model="easySearch.keys.value" /> <span>文档分类</span>
</FormItem> <div class="fr mr10 mt10">
<FormItem> <ButtonGroup class="fr ddi" size="small">
<Button type="primary" @click="search">查询</Button> <Button
</FormItem> :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
</Form> @click="toggle"
</template> title="展开/合并"
<template slot="searchForm"> ></Button>
<Search /> <Button icon="md-refresh" title="刷新" @click="loadTree()"></Button>
</template> <Button icon="md-rewind" title="收起" @click="hide"></Button>
<template slot="buttons"> </ButtonGroup>
<Button type="primary" @click="add">新增</Button> </div>
</template> </h3>
</DataGrid> <div class="search">
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Input search placeholder="关键字" v-model="keys" clearable />
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> </div>
</Modal> <div class="fg">
<div class="tree">
<Tree :data="data" ref="tree" @on-select-change="change" :render="renderContent"></Tree>
</div>
</div>
</div>
</Sider>
<div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<Word ref="dataTable" :treeId='treeId'/>
</Content>
</Layout>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Word from "./word";
export default { export default {
name: "list", name: "list",
components: { components: {
Search, Word,
}, },
head: { head: {
title: "文档引用", title: "文档引用",
...@@ -38,195 +53,189 @@ export default { ...@@ -38,195 +53,189 @@ export default {
}, },
data() { data() {
return { return {
action: Api.index, list: [],
easySearch: { showMenu: true,
keys: { op: "refName,name", value: null }, model8: "",
}, keys: "",
modal: false, expand: false,
title: "新增", treeId:0,
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{
key: "documentId",
title: this.l("documentId"),
align: "left",
high: true,
},
{
key: "refName",
title: this.l("refName"),
align: "left",
easy: true,
high: true,
},
{ key: "refId", title: this.l("refId"), align: "left", high: true },
{
key: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
}; };
}, },
mounted() { mounted() {
console.log(this); this.loadTree();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { computed: {
ok() { data() {
this.$refs.grid.load(); let items = this.$u.clone(this.list);
this.modal = false; let expand = this.expand;
this.curId = 0; let result = [];
}, search(this.keys, items);
search() { function search(keys, data) {
this.$refs.grid.reload(this.easySearch); data.map((u) => {
if (keys.length < u.title) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
}
});
}
return result;
}, },
add() { },
this.curId = 0; methods: {
this.title = "新增"; loadTree() {
this.detail = () => import("./add"); let data = {
this.modal = true; conditions: [
{
fieldName: "",
fieldValue: "",
conditionalType: "Equal",
},
],
// sortBy: "code",
// isDesc: false,
};
Api.list(data).then((r) => {
var data = this.$u.toTree(
r.result,
0,
(u) => {
u.title = u.name;
u.value = u.id;
u.expand = true;
},
"upId"
);
this.list = this.$u.clone(data);
});
}, },
copy(id) { toggle() {
this.curId = id; if (this.model8) {
this.title = "克隆"; this.expand = !this.expand;
this.detail = () => import("./add"); } else {
this.modal = true; this.$Message.error("请先选择类型");
}
}, },
view(id) { hide() {
this.curId = id; this.showMenu = false;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
}, },
edit(id) { change(a, b) {
this.curId = id; // console.log(a)
this.title = "编辑"; console.log(b);
this.detail = () => import("./edit"); if (b.children.length == 0) {
this.modal = true; this.treeId = b.id;
this.$refs.dataTable.$refs.grid.reload(this.easySearch);
} else {
this.treeId = 0;
}
alert(this.treeId )
}, },
remove(id) { renderContent(h, { root, node, data }) {
Api.delete(id).then((r) => { return h(
if (r.success) { "span",
this.$refs.grid.load(); {
this.$Message.success("删除成功"); on: {
} click: () => {
}); this.handleSelect(root, data); //手动选择树节点
},
},
},
data.title
);
}, },
cancel() { handleSelect(root, data) {
this.curId = 0; // let pid = -1; //定义最顶级id
this.modal = false; // var pname = "";
// var upId = data.upId;
// let roots = root;
// function addId(roots, upId) {
// roots.map((u) => {
// if (u.node.id == upId) {
// if (u.node.upId == 0) {
// pid = u.node.id;
// pname = u.node.name;
// } else {
// upId = u.node.upId;
// addId(roots, upId);
// }
// }
// });
// }
// addId(roots, upId);
// this.nodeInfo.categoryId = data.id;
// this.nodeInfo.rootCategoryName = data.name;
// if (pid == -1) {
// this.nodeInfo.rootCategoryId = data.id;
// this.nodeInfo.rootCategoryName = data.name;
// } else {
// this.nodeInfo.rootCategoryId = pid;
// this.nodeInfo.rootCategoryName = pname;
// }
}, },
l(key) { showMenuFn() {
/* //this.$Message.info("展开左侧树")
document_ref:{ this.showMenu = true;
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
documentId:'文档id',
refName:'引用的文档名称',
refId:'引用的文档id',
name:'文档名称',
}
*/
let vkey = "document_ref" + "." + key;
return this.$t(vkey) || key;
}, },
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less" >
@import "../../../assets/css/custom.less";
.product-mix {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh;
overflow: auto;
h4 {
height: 30px;
line-height: 30px;
background: #eee;
padding-left: 10px;
}
}
.show_menu {
width: 30px;
height: 30px;
position: fixed;
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
line-height: 34px;
font-size: 14px;
text-align: center;
color: @table-color;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.ivu-layout-content {
// margin-left: 5px;
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
height: 89vh;
}
}
</style> </style>
\ No newline at end of file
<template>
<div class="product-m">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:high="false"
:type="typeInfo"
:span="6"
:lazy="true"
exportTitle="文档管理"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字引用的文档名称/文档名称" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
<Button @click="openModalIm">导入</Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body-card">
<Row class="title-i">
<Col :span="12">
<Ellipsis :text="row.name" :length="12" tooltip />
</Col>
<Col :span="12" class="btn-click">{{row.code}}</Col>
</Row>
<Row class="row-down" :gutter="10">
<Col span="7">
<div class="img-i">
<img :src="downUrl+'/' +row.filePath" v-if="row.filePath" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
</div>
</Col>
<Col span="17" class="c">
<div>版本:{{row.version}}</div>
<div>文档详细说明:{{row.description}}</div>
<p class="a-icon">
<a @click="edit(row)">
<Icon type="md-create" />编辑
</a>&nbsp;
<a @click="remove(row)">
<Icon type="ios-trash" />删除
</a>&nbsp;
<a @click="view(row)">
<Icon type="md-document" />详情
</a>
</p>
</Col>
</Row>
</div>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :treeId="treeId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "refName,name", value: null },
categoryId: {
op: "In",
value: this.treeId,
},
},
modal: false,
title: "新增",
detail: null,
curId: 0,
downUrl: fileUrlDown,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
},
{ key: "field", title: this.l("field"), align: "left", high: true },
{
key: "dataType",
title: this.l("dataType"),
align: "left",
high: true,
},
{
key: "dataLength",
title: this.l("dataLength"),
align: "left",
high: true,
},
{
key: "dictionaryId",
title: this.l("dictionaryId"),
align: "left",
high: true,
},
{ key: "note", title: this.l("note"), align: "left", high: true },
{
key: "unitName",
title: this.l("unitName"),
align: "left",
easy: true,
high: true,
},
{ key: "tag", title: this.l("tag"), align: "left", high: true },
{
key: "categoryId",
title: this.l("categoryId"),
align: "left",
high: true,
},
{
key: "required",
title: this.l("required"),
align: "left",
high: true,
},
{
key: "isUnique",
title: this.l("isUnique"),
align: "left",
high: true,
},
{
key: "fieldType",
title: this.l("fieldType"),
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{
key: "dictionaryCode",
title: this.l("dictionaryCode"),
align: "left",
easy: true,
high: true,
},
{
key: "codeRuleId",
title: this.l("codeRuleId"),
align: "left",
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
ModalIm: false,
temTitle: "文档管理",
};
},
props: {
treeId: Number,
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {},
methods: {
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
//批量导入start
//导入功能
openModalIm() {
if (this.parent.id) {
this.ModalIm = true;
} else {
this.$Message.error("请先选择文档分类");
}
},
ok() {
this.$refs.grid.reload(this.easySearch);
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
document_ref:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
documentId:'文档id',
refName:'引用的文档名称',
refId:'引用的文档id',
name:'文档名称',
}
*/
let vkey = "document_property_definition" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
treeId(v) {
if (v != 0) {
this.easySearch.categoryId.value = v;
this.$refs.grid.reload(this.easySearch);
}
},
},
};
</script>
<style lang="less">
.product-m {
.body-card {
border: 1px solid rgba(38, 128, 235, 1);
margin: 10px;
border-radius: 4px;
.title-i {
border-bottom: 1px solid #2680eb;
padding: 0 10px;
height: 35px;
line-height: 35px;
background: rgba(38, 128, 235, 0.2);
color: #2680eb;
.btn-click {
text-align: right;
}
}
.row-down {
padding: 10px;
.img-i {
width: 90px;
background: #eee;
height: 90px;
margin-right: 15px;
// overflow: hidden;
img {
width: 90px;
height: 90px;
}
}
.c div {
margin-bottom: 14px;
margin-left: 10px;
}
.a-icon {
text-align: right;
}
}
}
}
</style>
\ No newline at end of file
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