Commit 43bdde66 authored by 仇晓婷's avatar 仇晓婷

文档管理

parent 12ff8d6b
......@@ -1758,5 +1758,34 @@ export default {
refName:'引用的文档名称',
refId:'引用的文档id',
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:'',
}
}
......@@ -328,7 +328,6 @@ export default {
// this.entity.filePath = "";
this.entity.templateId = "";
}
if (this.row.id) {
this.entity.upId = this.row.id;
this.entity.level = this.row.level;
......@@ -338,7 +337,6 @@ export default {
this.entity.level = 1;
this.entity.inheritCategoryId = 0;
}
alert(55);
let data = {
cat: this.entity,
pros: this.checkList,
......
......@@ -35,7 +35,7 @@
</FormItem>
</Col>
<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> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
......@@ -342,7 +342,7 @@ export default {
if (this.inherit == 0) {
this.entity.inheritCategoryId = 0;
} else {
this.entity.inheritCategoryId = this.entity.id;
this.entity.inheritCategoryId = this.entity.upId;
}
let data = {
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<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('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </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>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input v-if="li.dataType==0" v-model="entity[li.field]" :disabled="li.field=='code'"></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-model="entity[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<DatePicker
v-if="li.dataType==4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
</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>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
documentId: "",
refName: "",
refId: "",
name: ""},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
fileds: [], //扩展属性
entity: {
creatorUserId: this.$store.state.userInfo.userId,
status: "0",
categoryId: this.treeId,
// title: "",
// field: "",
// dataType: null,
// dataLength: null,
// dictionaryId: null,
// note: "",
// unitName: "",
// 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;
}
},
props: {
v: Object,
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
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);
}
delete item["id"];
// return item.fieldType != 1;
return item;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
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 {
index:`${material}documentref/paged`,
index:`${material}/document/paged`,
paged(params){
return Api.post(`${material}documentref/paged`,params);
return Api.post(`${material}/document/paged`,params);
},
get(params){
return Api.get(`${material}documentref/get`,params);
return Api.get(`${material}/document/get`,params);
},
create(params){
return Api.post(`${material}documentref/create`,params);
return Api.post(`${material}/document/createnew`,params);
},
update(params){
return Api.post(`${material}documentref/update`,params);
return Api.post(`${material}/document/updatenew`,params);
},
delete(id) {
return Api.delete(`${material}documentref/delete`,{params:{id:id}});
return Api.delete(`${material}/document/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${material}documentref/batchdelete`,params);
}
}
\ No newline at end of file
return Api.post(`${material}/document/batchdelete`,params);
},
//文档分类列表
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 @@
<div class="detail">
<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('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
......@@ -9,10 +21,8 @@
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('documentId')">{{entity.documentId}}</Filed>
<Filed :span="12" :name="l('refName')">{{entity.refName}}</Filed>
<Filed :span="12" :name="l('refId')">{{entity.refId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('dictionaryCode')">{{entity.dictionaryCode}}</Filed>
<Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</Filed>
</Row>
</div>
......@@ -49,7 +59,7 @@
this.$emit('on-close')
},
l(key) {
key = "document_ref" + "." + key;
key = "document_property_definition" + "." + key;
return this.$t(key)
}
},
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<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>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
......@@ -15,13 +39,9 @@
</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('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </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>
<Col :span="12"><FormItem :label="l('dictionaryCode')" prop="dictionaryCode"> <Input v-model="entity.dictionaryCode"> </Input>
</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>
</Row>
<FormItem>
......@@ -82,7 +102,7 @@
this.$emit('on-close')
},
l(key) {
key = "document_ref" + "." + key;
key = "document_property_definition" + "." + key;
return this.$t(key)
}
},
......
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<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>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
<div class="product-mix">
<Layout>
<Sider width="300" v-if="showMenu">
<div class="flex fd tree-menu">
<h3>
<span>文档分类</span>
<div class="fr mr10 mt10">
<ButtonGroup class="fr ddi" size="small">
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree()"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</h3>
<div class="search">
<Input search placeholder="关键字" v-model="keys" clearable />
</div>
<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>
</template>
<script>
import Api from "./api";
import Search from "./search";
import Word from "./word";
export default {
name: "list",
components: {
Search,
Word,
},
head: {
title: "文档引用",
......@@ -38,195 +53,189 @@ export default {
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "refName,name", value: null },
},
modal: false,
title: "新增",
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) },
},
"删除"
),
]);
},
},
],
list: [],
showMenu: true,
model8: "",
keys: "",
expand: false,
treeId:0,
};
},
mounted() {
console.log(this);
this.loadTree();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
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;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
methods: {
loadTree() {
let data = {
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) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
toggle() {
if (this.model8) {
this.expand = !this.expand;
} else {
this.$Message.error("请先选择类型");
}
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
hide() {
this.showMenu = false;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
change(a, b) {
// console.log(a)
console.log(b);
if (b.children.length == 0) {
this.treeId = b.id;
this.$refs.dataTable.$refs.grid.reload(this.easySearch);
} else {
this.treeId = 0;
}
alert(this.treeId )
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
renderContent(h, { root, node, data }) {
return h(
"span",
{
on: {
click: () => {
this.handleSelect(root, data); //手动选择树节点
},
},
},
data.title
);
},
cancel() {
this.curId = 0;
this.modal = false;
handleSelect(root, data) {
// let pid = -1; //定义最顶级id
// 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) {
/*
document_ref:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
documentId:'文档id',
refName:'引用的文档名称',
refId:'引用的文档id',
name:'文档名称',
}
*/
let vkey = "document_ref" + "." + key;
return this.$t(vkey) || key;
showMenuFn() {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
},
};
</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>
\ 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