[fix]项目文件夹+ 任务文件夹

This commit is contained in:
sdaduanbilei-d1581 2025-04-18 14:48:19 +08:00
parent c44239fa1e
commit aa6179c3f1
45 changed files with 724 additions and 397 deletions

View File

@ -24,5 +24,9 @@ export default {
all(params) { all(params) {
return fetch('/base/customer/all', params) return fetch('/base/customer/all', params)
},
findList(params) {
return fetch('/base/customer/list', params)
} }
} }

View File

@ -6,10 +6,15 @@ export default {
* @param params * @param params
* @returns {Promise | Promise<unknown>} * @returns {Promise | Promise<unknown>}
*/ */
info(fileId) { info(params) {
return fetch('/file/info/' + fileId) return fetch('/file/info',params)
}, },
history(params) {
return fetch('/project/attach/history',params)
},
download(params) { download(params) {
return fetch('/file/download', params, 'get', 'form', {}, 'blob') return fetch('/file/download', params, 'get', 'form', {}, 'blob')
} }

View File

@ -7,15 +7,15 @@ export default {
* @returns {Promise | Promise<unknown>} * @returns {Promise | Promise<unknown>}
*/ */
list(params) { list(params) {
return fetch('/sys/dept/list/children', params) return fetch('/dept/list', params)
}, },
submit(params) { submit(params) {
return fetch('/sys/dept/submit', params, 'post', 'json') return fetch('/dept/submit', params, 'post', 'json')
}, },
info(params) { info(params) {
return fetch('/sys/dept/info/org', params) return fetch('/dept/info/org', params)
}, },
// ================== // ==================
@ -32,7 +32,7 @@ export default {
// =========== // ===========
areaTree(params) { areaTree(params) {
return fetch('/sys/region/tree', params) return fetch('/region/tree', params)
}, },
areaDetail(params) { areaDetail(params) {

View File

@ -6,8 +6,8 @@ axios.interceptors.request.use(
config => { config => {
config.headers.Platform = 'pc' config.headers.Platform = 'pc'
config.headers.type = 'web' config.headers.type = 'web'
config.headers.appId = 'E191C42B' config.headers.appid = 'E191C42B'
config.headers.Authorization = 'Bearer' + localStorage.getItem('token') config.headers.Authorization = 'Bearer ' + localStorage.getItem('token')
return config return config
}, },
err => { err => {

View File

@ -2,18 +2,18 @@ import fetch from '../fetch.js'
export default { export default {
initFolder(params) { initFolder(params) {
return fetch('/project/file/folder/init', params, 'post') return fetch('/project/attach/folder/init', params, 'post')
}, },
page(params) { page(params) {
return fetch('/project/file/page', params) return fetch('/project/attach/page', params)
}, },
submit(params) { submit(params) {
return fetch('/project/file/submit', params, 'post', 'json') return fetch('/project/attach/submit', params, 'post', 'json')
}, },
remove(params) { remove(params) {
return fetch('/project/file/remove', params, 'post') return fetch('/project/attach/remove', params, 'post')
} }
} }

View File

@ -9,7 +9,9 @@ export default {
return fetch('/project/page', params) return fetch('/project/page', params)
}, },
findByCity(params) { info(params) {
return fetch('/project/list/customer', params) return fetch('/project/info', params)
} },
} }

View File

@ -20,6 +20,15 @@ export default {
return fetch('/sys/client/list', params) return fetch('/sys/client/list', params)
}, },
/**
* 保存或者更新
* @param params
* @returns {Promise<unknown>}
*/
clientsSave(params) {
return fetch('/sys/client/submit', params,'post','json')
},
/** /**
* 获取全部客户端列表 * 获取全部客户端列表
* @param params * @param params
@ -29,6 +38,15 @@ export default {
return fetch('/sys/client/list') return fetch('/sys/client/list')
}, },
/**
* 客户端详情
* @param params
* @returns {Promise<unknown>}
*/
clientInfo(params) {
return fetch('/sys/client/info',params)
},
// ++++++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++++++
/** /**
* 根据aapId 获取菜单 * 根据aapId 获取菜单
@ -60,8 +78,9 @@ export default {
roleList(params) { roleList(params) {
return fetch('/sys/role/list', params) return fetch('/sys/role/list', params)
}, },
roleChange(params) { roleChange(params) {
return fetch('/sys/role/update', params, 'post') return fetch('/user/update', params, 'post','json')
}, },
/** /**

View File

@ -14,8 +14,8 @@ export default {
return fetch('/user/info', params) return fetch('/user/info', params)
}, },
retPwd(params) { update(params) {
return fetch('/user/restPwd', params, 'post') return fetch('/user/update', params, 'post','json')
}, },
changeStatus(params) { changeStatus(params) {
return fetch('/user/changeStatus', params, 'post') return fetch('/user/changeStatus', params, 'post')

View File

@ -273,7 +273,8 @@ img {
} }
.wrapper { .wrapper {
width: 1340px; min-width: 1340px;
width: 70%;
margin: 0 auto; margin: 0 auto;
} }

View File

@ -0,0 +1,125 @@
<template>
<div>
<a-button type="primary" @click="show = true">历史文件</a-button>
<a-drawer
:mask-closable="false"
:header="false"
width="80%"
v-model:visible="show"
>
<div>
<h2>提交历史</h2>
</div>
<a-divider/>
<div>
<a-table :data="list" :columns="columns">
<template #user ={record}>
<div>
<a-avatar v-if="record.user.avatar" :style="{ backgroundColor: '#7BC616' }">
<img alt="avatar" :src="record.user.avatar" />
</a-avatar>
<a-avatar v-else :style="{ backgroundColor: '#7BC616' }">{{record.user.name.substring(0,1)}}</a-avatar>
{{record.user.name}}
</div>
</template>
<template #md5="{record}">
<div>
{{record.file.md5}}
</div>
</template>
<template #menu="{record}">
<a-button type="primary" @click="download(record)">下载</a-button>
</template>
</a-table>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
props: {
attachId: {
type: String,
default: ""
},
},
components: {
},
watch: {
show: {
handler: function (val) {
if (val) {
this.fetchHistory()
}
}
}
},
data() {
return {
show: false,
list: [],
columns:[
{
title:"作者",
slotName:"user"
},
{
title:"文件校验",
slotName:"md5"
},
{
title:"备注",
dataIndex:"comment"
},
{
title:"日期",
dataIndex:"createdAt"
},
{
title:"操作",
slotName: "menu"
}
]
}
},
methods: {
fetchHistory() {
if (this.attachId !== "") {
this.$api.file.history({id: this.attachId}).then(res => {
if (res.code === 200) {
this.list = res.data
}
})
}
},
download(record){
this.$api.file.download({ fileId: record.fileId }).then(res => {
if (res.hasOwnProperty('code')) {
this.$message.error(res.msg)
return
}
this.downloadFile(res,record)
})
},
downloadFile(res,record) {
console.log(record)
const url = window.URL.createObjectURL(new Blob([res]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const excelName = record.file.fileName
link.setAttribute('download', excelName)
document.body.appendChild(link)
link.click()
link.remove()
this.$notification.success('下载成功')
}
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -14,22 +14,22 @@
<iframe <iframe
v-if="file.suffix === '.pdf'" v-if="file.suffix === '.pdf'"
style="width: 100%; height: 100vh" style="width: 100%; height: 100vh"
:src="`/api/file/` + file.id" :src="`/api/file/view?id=` + file.id"
> >
</iframe> </iframe>
<vue-office-docx <vue-office-docx
v-else-if="['.docx'].includes(file.suffix)" v-else-if="['.docx'].includes(file.suffix)"
:src="`/api/file/` + file.id" :src="`/api/file/view?id=` + file.id"
style="width: 100%; height: 100vh" style="width: 100%; height: 100vh"
/> />
<vue-office-excel <vue-office-excel
v-else-if="['.xlsx', '.xls'].includes(file.suffix)" v-else-if="['.xlsx', '.xls'].includes(file.suffix)"
:src="`/api/file/` + file.id" :src="`/api/file/view?id=` + file.id"
style="width: 100%; height: 100vh" style="width: 100%; height: 100vh"
/> />
<div v-else-if="file.fileType.indexOf('image') > -1"> <div v-else-if="file.fileType.indexOf('image') > -1">
<a-image <a-image
:src="`/api/file/` + file.id" :src="`/api/file/view?id=` + file.id"
:fit="'contain'" :fit="'contain'"
height="960px" height="960px"
width="100%" width="100%"
@ -62,7 +62,8 @@
<div class="mt-20">加载中请稍后</div> <div class="mt-20">加载中请稍后</div>
</div> </div>
<template #footer> <template #footer>
<div> <div class="flex flex-center flex-justify-end">
<history :attach-id="attachId" class="mr-20"></history>
<a-button type="primary" @click="download">下载</a-button> <a-button type="primary" @click="download">下载</a-button>
</div> </div>
</template> </template>
@ -79,13 +80,19 @@ import '@vue-office/docx/lib/index.css'
import VueOfficeExcel from '@vue-office/excel' import VueOfficeExcel from '@vue-office/excel'
// //
import '@vue-office/excel/lib/index.css' import '@vue-office/excel/lib/index.css'
import history from "@/components/history/index.vue";
export default { export default {
components: { components: {
VueOfficeDocx, VueOfficeDocx,
VueOfficeExcel VueOfficeExcel,
history
}, },
props: { props: {
attachId: {
type:String,
default: ""
},
fileId: { fileId: {
required: true, required: true,
type: String, type: String,
@ -109,7 +116,7 @@ export default {
}, },
methods: { methods: {
fetchFile() { fetchFile() {
this.$api.file.info(this.fileId).then(res => { this.$api.file.info({id:this.fileId}).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.file = res.data this.file = res.data
} }

View File

@ -36,7 +36,6 @@ export default {
}, },
methods: { methods: {
progress(e, progress) { progress(e, progress) {
console.log(e, progress)
if (progress.loaded > 0) { if (progress.loaded > 0) {
this.loading = true this.loading = true
} }

View File

@ -63,7 +63,6 @@ export default {
} }
}, },
fetchNotice() { fetchNotice() {
console.log('unread')
this.$api.notice.unReadAll().then(res => { this.$api.notice.unReadAll().then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data this.list = res.data
@ -71,8 +70,10 @@ export default {
}) })
}, },
logout() { logout() {
this.$cookies.remove('wt') localStorage.clear()
sessionStorage.clear()
this.$router.push('/login') this.$router.push('/login')
} }
} }
} }

View File

@ -54,24 +54,11 @@
:rules="[{ required: true, message: '请选择类型' }]" :rules="[{ required: true, message: '请选择类型' }]"
> >
<a-select placeholder="请选择类型" v-model="form.type"> <a-select placeholder="请选择类型" v-model="form.type">
<a-option label="业主单位" value="0"></a-option> <a-option label="业主单位" :value="0"></a-option>
<a-option label="实施单位" value="1"></a-option> <a-option label="实施单位" :value="1"></a-option>
<a-option label="其他" value="2"></a-option> <a-option label="其他" :value="2"></a-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item
label="业务员"
field="saleManId"
:rules="[{ required: true, message: '请选择业务员' }]"
>
<a-select
:options="userOptions"
allow-search
@search="handleSearch"
v-model="form.saleManId"
placeholder="请选择业务员"
/>
</a-form-item>
<a-form-item label="备注" field="remark"> <a-form-item label="备注" field="remark">
<a-textarea <a-textarea
placeholder="请输入备注" placeholder="请输入备注"
@ -97,8 +84,7 @@ export default {
cityName: '', cityName: '',
address: '', address: '',
remark: '', remark: '',
saleManId: '', type: 0
type: ''
} }
} }
}, },
@ -107,25 +93,16 @@ export default {
}, },
methods: { methods: {
fetchCity() { fetchCity() {
this.$api.base.areaTree().then(res => { this.$api.base.areaTree({code:53}).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.options = res.data this.options = res.data
} }
}) })
}, },
handleSearch(value) {
this.$api.user.list({ name: value }).then(res => {
if (res.code === 200) {
this.userOptions = res.data.map(e => {
return { label: e.name, value: e.id }
})
}
})
},
submit(done) { submit(done) {
this.$refs.form.validate(errors => { this.$refs.form.validate(errors => {
if (errors === undefined) { if (errors === undefined) {
console.log(this.form)
this.$api.customer.submit(this.form).then(res => { this.$api.customer.submit(this.form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)

View File

@ -32,8 +32,8 @@
export default { export default {
props: { props: {
pid: { pid: {
type: String, type: Number,
default: '' default: 0
} }
}, },
watch: { watch: {
@ -51,7 +51,7 @@ export default {
show: false, show: false,
form: { form: {
name: '', name: '',
pid: '', pid: 0,
sort: '' sort: ''
} }
} }
@ -66,6 +66,7 @@ export default {
this.$emit('ok') this.$emit('ok')
done() done()
} else { } else {
done(false)
this.$notification.error(res.msg) this.$notification.error(res.msg)
} }
}) })

View File

@ -56,11 +56,10 @@ export default {
e.checked = false e.checked = false
return e return e
}) })
console.log(index)
this.roleList[index].checked = true this.roleList[index].checked = true
}, },
fetchRole() { fetchRole() {
this.$api.sys.roleList({ appId: '7XAp5LZk' }).then(res => { this.$api.sys.roleList({ appid: 'E191C42B' }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.roleList = res.data this.roleList = res.data
.filter(e => e.code !== 'super_admin') .filter(e => e.code !== 'super_admin')
@ -73,8 +72,8 @@ export default {
}, },
submit() { submit() {
const role = this.roleList.find(e => e.checked) const role = this.roleList.find(e => e.checked)
const data = { userId: this.userId, roleId: role.id } const data = { id: this.userId, roleId: role.id }
this.$api.sys.roleChange(data).then(res => { this.$api.user.update(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)
this.$emit('ok') this.$emit('ok')

View File

@ -79,6 +79,7 @@
<a-col span="12"> <a-col span="12">
<a-form-item label="所属部门" required field="deptId"> <a-form-item label="所属部门" required field="deptId">
<a-select <a-select
placeholder="请选择所属部门"
v-model="form.deptId" v-model="form.deptId"
:options="deptOptions" :options="deptOptions"
> >
@ -99,6 +100,7 @@
<a-col span="12"> <a-col span="12">
<a-form-item label="员工角色" required field="roleId"> <a-form-item label="员工角色" required field="roleId">
<a-select <a-select
placeholder="请选择员工角色"
:options="roleOptions" :options="roleOptions"
v-model="form.roleId" v-model="form.roleId"
></a-select> ></a-select>
@ -111,7 +113,6 @@
</template> </template>
<script> <script>
import { md5 } from 'js-md5'
export default { export default {
props: { props: {
@ -162,12 +163,11 @@ export default {
deptOptions: [], deptOptions: [],
form: { form: {
sex: '0', sex: '0',
appId: '7XAp5LZk',
phone: '', phone: '',
roleId: '', roleId: '',
account: '', account: '',
name: '', name: '',
deptId: '', deptId: 0,
pwd: '', pwd: '',
orgId: '', orgId: '',
post: '' post: ''
@ -185,7 +185,7 @@ export default {
this.orgPost = res.data this.orgPost = res.data
} }
}) })
this.$api.sys.roleList({ appId: '7XAp5LZk' }).then(res => { this.$api.sys.roleList({ appid: 'E191C42B' }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.roleOptions = res.data.map(e => { this.roleOptions = res.data.map(e => {
return { label: e.name, value: e.id } return { label: e.name, value: e.id }
@ -207,9 +207,7 @@ export default {
submit(done) { submit(done) {
this.$refs.form.validate(errors => { this.$refs.form.validate(errors => {
if (errors === undefined) { if (errors === undefined) {
const data = { ...this.form } this.$api.base.userSave(this.form).then(res => {
data.pwd = md5(data.pwd)
this.$api.base.userSave(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)
this.$emit('ok') this.$emit('ok')

View File

@ -6,7 +6,7 @@
{{ deptName }} {{ deptName }}
</h2> </h2>
<div class="grey-6 ml-10 bold"> <div class="grey-6 ml-10 bold">
共有员工{{ this.page.total }} 共有员工{{ this.list.length }}
</div> </div>
</div> </div>
<add-user :dept-id="deptId" @ok="fetchList" /> <add-user :dept-id="deptId" @ok="fetchList" />
@ -62,7 +62,7 @@ export default {
watch: { watch: {
deptId: { deptId: {
handler(val) { handler(val) {
this.fetchAll() this.fetchList()
}, },
immediate: true immediate: true
} }
@ -76,7 +76,7 @@ export default {
{ title: '姓名', dataIndex: 'name' }, { title: '姓名', dataIndex: 'name' },
{ title: '性别', slotName: 'sex' }, { title: '性别', slotName: 'sex' },
{ title: '状态', slotName: 'status' }, { title: '状态', slotName: 'status' },
{ title: '添加时间', dataIndex: 'createTime' }, { title: '添加时间', dataIndex: 'createdAt' },
{ title: '操作', slotName: 'menu' } { title: '操作', slotName: 'menu' }
] ]
} }
@ -88,11 +88,11 @@ export default {
fetchList() { fetchList() {
this.$api.base this.$api.base
.userList({ deptId: this.deptId, ...this.page }) .userList({ deptId: this.deptId})
.then(res => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data.records this.list = res.data
this.page.total = res.data.total this.page.total = res.data.length
} }
}) })
}, },

View File

@ -154,7 +154,7 @@ export default {
}, },
methods: { methods: {
fetchInfo() { fetchInfo() {
this.$api.user.info({ userId: this.userId }).then(res => { this.$api.user.info({ id: this.userId }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.user = res.data this.user = res.data
this.fetchData(res.data) this.fetchData(res.data)
@ -171,7 +171,7 @@ export default {
if (tmp) { if (tmp) {
info.postName = tmp.label info.postName = tmp.label
} }
this.$api.sys.roleList({ appId: '7XAp5LZk' }).then(res => { this.$api.sys.roleList({ appid: 'E191C42B' }).then(res => {
var tmp = res.data.find(e => e.id === info.roleId) var tmp = res.data.find(e => e.id === info.roleId)
if (tmp) { if (tmp) {
info.roleName = tmp.name info.roleName = tmp.name
@ -189,7 +189,8 @@ export default {
}) })
}, },
restPwd() { restPwd() {
this.$api.user.retPwd({ userId: this.user.id }).then(res => { const data = {id: this.user.id, pwd: '000000'}
this.$api.user.update(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)
} else { } else {
@ -199,10 +200,10 @@ export default {
}, },
changeStatus() { changeStatus() {
const data = { const data = {
userId: this.user.id, id: this.user.id,
status: this.user.status === 1 ? 2 : 1 status: this.user.status === 1 ? 2 : 1
} }
this.$api.user.changeStatus(data).then(res => { this.$api.user.update(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)
this.user.status = data.status this.user.status = data.status

View File

@ -6,10 +6,10 @@
>{{ record.sex === '0' ? '男' : '女' }} >{{ record.sex === '0' ? '男' : '女' }}
</a-tag> </a-tag>
</template> </template>
<template #policy="{ record }"> <template #isPolicy="{ record }">
<div> <div>
<a-tag :color="record.policy === '0' ? 'red' : 'green'" <a-tag :color="record.isPolicy === false ? 'red' : 'green'"
>{{ record.policy === '0' ? '否' : '是' }} >{{ record.isPolicy === false ? '否' : '是' }}
</a-tag> </a-tag>
</div> </div>
</template> </template>
@ -74,7 +74,7 @@ export default {
}, },
{ {
title: '关键决策人', title: '关键决策人',
slotName: 'policy' slotName: 'isPolicy'
}, },
{ {
title: '备注', title: '备注',

View File

@ -6,14 +6,12 @@
<div class="flex flex-center flex-justify-start"> <div class="flex flex-center flex-justify-start">
<h1>{{ info.name }}</h1> <h1>{{ info.name }}</h1>
<a-tag size="large" color="red" class="ml-20" <a-tag size="large" color="red" class="ml-20"
>业务员{{ info.saleMan.name }} >业务员{{ info.user.name }}</a-tag>
</a-tag>
</div> </div>
<div class="flex flex-center flex-justify-start"> <div class="flex flex-center flex-justify-start">
<a-tag color="blue" v-if="city" size="large"> <a-tag color="blue" size="large">
{{ city.provinceName }}{{ city.cityName {{ info.region.province_name }}{{ info.region.city_name }}{{ info.region.name }}
}}{{ city.name }}
</a-tag> </a-tag>
<div class="ml-10"> <div class="ml-10">
<a-input <a-input
@ -122,10 +120,9 @@ export default {
this.tabIndex = res this.tabIndex = res
}, },
fetchInfo() { fetchInfo() {
this.$api.customer.info({ customerId: this.id }).then(res => { this.$api.customer.info({ id: this.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.info = res.data this.info = res.data
this.fetchCity(this.info.cityCode)
} }
}) })
}, },

View File

@ -65,18 +65,18 @@
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="是否关键决策人" label="是否关键决策人"
field="policy" field="isPolicy"
:rules="[ :rules="[
{ required: true, message: '请选择是否关键决策人' } { required: true, message: '请选择是否关键决策人' }
]" ]"
> >
<a-select <a-select
placeolder="请选择" placeolder="请选择"
v-model="form.policy" v-model="form.isPolicy"
placeholder="请选择是否关键决策人" placeholder="请选择是否关键决策人"
> >
<a-option label="否" value="0"></a-option> <a-option label="否" :value="false"></a-option>
<a-option label="是" value="1"></a-option> <a-option label="是" :value="true"></a-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="备注" field="remark"> <a-form-item label="备注" field="remark">
@ -121,7 +121,7 @@ export default {
phone: '', phone: '',
post: '', post: '',
sex: '0', sex: '0',
policy: '', isPolicy: false,
remark: '', remark: '',
customerId: '' customerId: ''
} }

View File

@ -10,10 +10,11 @@
:columns="columns" :columns="columns"
:data="list" :data="list"
:pagination="page" :pagination="page"
@pageChange="pageChange"
> >
<template #saleMan="{ record }"> <template #region="{ record }">
<div> <div>
{{ record.saleMan.name }} {{ record.region.province_name }}{{ record.region.city_name }}{{ record.region.name }}
</div> </div>
</template> </template>
<template #menu="{ record }"> <template #menu="{ record }">
@ -48,28 +49,27 @@ export default {
columns: [ columns: [
{ {
title: '单位名称', title: '单位名称',
dataIndex: 'name' dataIndex: 'name',
width:200
}, },
{ {
title: '类型', title: '类型',
dataIndex: 'typeName' dataIndex: 'typeName',
width:120
}, },
{ {
title: '地区', title: '地区',
dataIndex: 'cityName' slotName: 'region',
width:280
}, },
{ {
title: '详细地址', title: '详细地址',
dataIndex: 'address' dataIndex: 'address'
}, },
{
title: '业务员',
slotName: 'saleMan'
},
{ {
title: '操作', title: '操作',
slotName: 'menu' slotName: 'menu',
width:200
} }
] ]
} }
@ -78,19 +78,23 @@ export default {
this.fetchList() this.fetchList()
}, },
methods: { methods: {
pageChange(page){
this.page.page = page
this.fetchList()
},
fetchList() { fetchList() {
this.$api.customer.page(this.page).then(res => { this.$api.customer.page(this.page).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data.records.map(e => { this.list = res.data.records.map(e => {
e.typeName = '业主单位' e.typeName = '业主单位'
if (e.type === '1') { if (e.type === 1) {
e.typeName = '实施单位' e.typeName = '实施单位'
} else if (e.type === '2') { } else if (e.type === 2) {
e.typeName = '其他' e.typeName = '其他'
} }
return e return e
}) })
this.page.tatal = res.data.total this.page.total = res.data.total
} }
}) })
} }

View File

@ -33,7 +33,7 @@
<div class="container" style="flex: 3" v-if="dept"> <div class="container" style="flex: 3" v-if="dept">
<user <user
:dept-name="subDept ? subDept.name : dept.name" :dept-name="subDept ? subDept.name : dept.name"
:dept-id="subDept ? subDept.id : null" :dept-id="subDept ? subDept.id : ''"
/> />
</div> </div>
</div> </div>
@ -53,7 +53,7 @@ export default {
}, },
data() { data() {
return { return {
dept: null, dept: "",
subDept: null, subDept: null,
list: [] list: []
} }
@ -64,15 +64,15 @@ export default {
methods: { methods: {
fetchDeptInfo() { fetchDeptInfo() {
const user = JSON.parse(localStorage.getItem('user')) const user = JSON.parse(localStorage.getItem('user'))
this.$api.base.info({ orgId: user.deptId }).then(res => { this.$api.base.info({ orgId: user.orgId }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.dept = res.data this.dept = res.data
this.fetchList(this.dept.id) this.fetchList()
} }
}) })
}, },
fetchList(pid) { fetchList() {
this.$api.base.list({ pid: pid }).then(res => { this.$api.base.list({ pid: this.dept.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data this.list = res.data
// //
@ -84,7 +84,6 @@ export default {
}, },
checkDept(item) { checkDept(item) {
this.subDept = item this.subDept = item
console.log(this.subDept)
} }
} }
} }

View File

@ -60,7 +60,7 @@ layout: 'empty',
</route> </route>
<script> <script>
import {md5} from "js-md5";
export default { export default {
data() { data() {
return { return {
@ -78,6 +78,7 @@ export default {
login() { login() {
if (this.form.account && this.form.pwd) { if (this.form.account && this.form.pwd) {
const data = { ...this.form } const data = { ...this.form }
console.log(md5(this.form.pwd))
this.$api.user.login(data).then(res => { this.$api.user.login(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
const user = res.data const user = res.data

View File

@ -14,12 +14,12 @@
<a-form ref="form" :model="form"> <a-form ref="form" :model="form">
<a-form-item <a-form-item
label="文件夹名称" label="文件夹名称"
field="fileName" field="name"
:rules="[{ required: true, message: '请输入文件夹名称' }]" :rules="[{ required: true, message: '请输入文件夹名称' }]"
> >
<a-input <a-input
placeholder="请输入文件夹名称" placeholder="请输入文件夹名称"
v-model="form.fileName" v-model="form.name"
></a-input> ></a-input>
</a-form-item> </a-form-item>
</a-form> </a-form>
@ -35,6 +35,16 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
queryId: {
required: true,
type: String,
default: ''
},
type:{
required: true,
type:Number,
default:0
},
pid: { pid: {
required: true, required: true,
type: String, type: String,
@ -45,9 +55,11 @@ export default {
return { return {
show: false, show: false,
form: { form: {
fileName: '', name: '',
pid: '', pid: '',
type: '1', type: 0,
isFolder:1,
queryId: '',
projectId: '' projectId: ''
} }
} }
@ -66,11 +78,15 @@ export default {
if (errors === undefined) { if (errors === undefined) {
this.form.pid = this.pid this.form.pid = this.pid
this.form.projectId = this.projectId this.form.projectId = this.projectId
this.form.type = this.type
this.form.queryId = this.queryId
this.$api.projectFile.submit(this.form).then(res => { this.$api.projectFile.submit(this.form).then(res => {
if (res.code === 200) { if (res.code === 200) {
done() done()
this.$emit('ok') this.$emit('ok')
this.$notificaiton.success(res.msg) this.$notificaiton.success(res.msg)
} else{
done(false)
} }
}) })
} else { } else {

View File

@ -0,0 +1,72 @@
<template>
<div>
<a-button type="text" size="small" @click="show = true">重命名</a-button>
<a-modal v-model:visible="show" @ok="update">
<a-input placeholder="请输入名称" v-model="from.name" @input="input"></a-input>
</a-modal>
</div>
</template>
<script>
export default {
props: {
id: {
required: true,
type: String,
default: ""
},
name:{
required: true,
type: String,
default: ""
}
},
watch: {
show: {
handler(val) {
if (val){
if (this.name.indexOf(".") > -1){
this.from.extension = "."+this.name.split('.').pop()
this.from.name = this.name.substring(0, this.name.lastIndexOf('.'))
} else {
this.from.name = this.name
this.from.extension = ""
}
this.from.id = this.id
}
}
}
},
data() {
return {
show: false,
from: {
id:'',
name:'',
extension:''
}
}
},
methods: {
input(res) {
this.from.name = res
},
update(done){
const data ={id: this.id, name: this.from.name+ this.from.extension};
this.$api.projectFile.submit(data).then(res =>{
if (res.code === 200){
this.$emit("ok")
done()
} else {
this.$message.error(res.msg);
}
})
}
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -31,9 +31,11 @@
</template> </template>
<template #default> 上一级</template> <template #default> 上一级</template>
</a-button> </a-button>
<upload @ok="upload" /> <upload @ok="upload" v-if="pid !== '0'" />
<add-folder <add-folder
:project-id="this.projectId" :project-id="this.projectId"
:query-id="queryId"
:type="type"
:pid="this.pid" :pid="this.pid"
@ok="fetchList" @ok="fetchList"
/> />
@ -48,10 +50,10 @@
size="small" size="small"
@page-change="pageChange" @page-change="pageChange"
> >
<template #name="{ record }"> <template #fileName="{ record }">
<div class="flex flex-center flex-justify-start"> <div class="flex flex-center flex-justify-start">
<img <img
v-if="record.type === 1" v-if="record.isFolder === 1"
src="https://res.wutongshucloud.com/res/2024/12/04/202412041635423.svg" src="https://res.wutongshucloud.com/res/2024/12/04/202412041635423.svg"
style="width: 30px; height: 30px" style="width: 30px; height: 30px"
/> />
@ -63,20 +65,28 @@
<div class="ml-10">{{ record.name }}</div> <div class="ml-10">{{ record.name }}</div>
</div> </div>
</template> </template>
<template #user="{record}">
<div>
{{record.user.name}}
</div>
</template>
<template #menu="{ record }"> <template #menu="{ record }">
<div class="flex flex-center"> <div class="flex flex-center">
<preview
v-if="record.type === 0"
:file-id="record.fileId"
/>
<a-button <a-button
v-else v-if="record.isFolder === 1"
type="text" type="text"
size="small" size="small"
@click="fetchFolder(record.id)" @click="fetchFolder(record.id)"
>查看 >查看
</a-button> </a-button>
<preview
v-else
:file-id="record.fileId"
:attach-id="record.id"
/>
<file-rename :id="record.id" :name="record.name" @ok="fetchList"></file-rename>
<a-button type="text" size="small" @click="remove(record)" <a-button type="text" size="small" @click="remove(record)"
>删除 >删除
</a-button> </a-button>
@ -89,19 +99,38 @@
<script> <script>
import upload from '@/components/upload/index.vue' import upload from '@/components/upload/index.vue'
import preview from '@/components/preview/index.vue' import preview from '@/components/preview/index.vue'
import addFolder from '@/views/project/index/components/add-folder.vue' import addFolder from '@/views/project/components/attach/add-folder.vue'
import fileRename from "@/views/project/components/attach/file-rename.vue";
export default { export default {
props: { props: {
projectId: { projectId: {
required: true,
type: String, type: String,
default: '' default: ''
},
queryId:{
required: true,
type: String,
default: ''
},
type :{
required:true,
type:Number,
default: 0
},
folder:{
required:true,
type:String,
default:''
} }
}, },
components: { components: {
upload, upload,
preview, preview,
addFolder addFolder,
fileRename
}, },
data() { data() {
return { return {
@ -118,15 +147,15 @@ export default {
columns: [ columns: [
{ {
title: '名称', title: '名称',
slotName: 'name' slotName: 'fileName'
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime' dataIndex: 'createdAt'
}, },
{ {
title: '创建人', title: '创建人',
dataIndex: 'createUserName' slotName: 'user'
}, },
{ {
title: '操作', title: '操作',
@ -160,17 +189,19 @@ export default {
this.fetchList() this.fetchList()
}, },
pageChange(page) { pageChange(page) {
this.page.page = page - 1 this.page.page = page
this.fetchList() this.fetchList()
}, },
fetchInit() { fetchInit() {
this.$api.sys.dict({ code: 'project_folder_init' }).then(res => { this.$api.sys.dict({ code: this.folder }).then(res => {
if (res.code === 200) { if (res.code === 200) {
var folder = res.data.map(e => e.label) var folder = res.data.map(e => e.label)
this.$api.projectFile this.$api.projectFile
.initFolder({ .initFolder({
projectId: this.projectId, projectId: this.projectId,
folders: folder.join(',') folders: folder.join(','),
type: this.type,
queryId: this.queryId
}) })
.then(() => { .then(() => {
this.fetchList() this.fetchList()
@ -184,6 +215,8 @@ export default {
name: this.name, name: this.name,
projectId: this.projectId, projectId: this.projectId,
pid: this.pid, pid: this.pid,
type: this.type,
queryId: this.queryId,
...this.page ...this.page
} }
this.$api.projectFile.page(data).then(res => { this.$api.projectFile.page(data).then(res => {
@ -194,7 +227,7 @@ export default {
}) })
}, },
upload(file) { upload(file) {
const data = { projectId: this.projectId, pid: this.pid, ...file } const data = { projectId: this.projectId, pid: this.pid, name: file.fileName, type: this.type, fileId: file.id,queryId: this.queryId }
this.$api.projectFile.submit(data).then(res => { this.$api.projectFile.submit(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.fetchList() this.fetchList()

View File

@ -67,7 +67,7 @@ export default {
}, },
methods: { methods: {
fetchCustomerByCity(code) { fetchCustomerByCity(code) {
this.$api.project.findByCity({ code: code }).then(res => { this.$api.customer.findList({ code: code }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.customerList = res.data this.customerList = res.data
this.$emit('ok', this.customerList[0]) this.$emit('ok', this.customerList[0])

View File

@ -131,7 +131,7 @@ export default {
}, },
methods: { methods: {
fetchCity() { fetchCity() {
this.$api.base.areaTree().then(res => { this.$api.base.areaTree({code:"53"}).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.options = res.data this.options = res.data
} }
@ -145,7 +145,7 @@ export default {
}) })
}, },
fetchCustomer(res) { fetchCustomer(res) {
this.$api.customer.all({ name: res }).then(res => { this.$api.customer.findList({ name: res }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.customerList = res.data.map(e => { this.customerList = res.data.map(e => {
return { label: e.name, value: e.id } return { label: e.name, value: e.id }

View File

@ -14,20 +14,6 @@
> >
<a-form auto-label-width :model="form" ref="form"> <a-form auto-label-width :model="form" ref="form">
<a-row gutter="16"> <a-row gutter="16">
<a-col :span="12">
<a-form-item
label="任务标题"
:rules="[
{ required: true, message: '请输入任务标题' }
]"
field="name"
>
<a-input
placeholder="请输入任务标题"
v-model="form.name"
></a-input>
</a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
label="优先级" label="优先级"
@ -127,13 +113,11 @@ export default {
show: false, show: false,
form: { form: {
projectId: '', projectId: '',
name: '',
level: '2', level: '2',
time: '', time: '',
tag: '', tag: '',
executors: '', executors: null,
remark: '', remark: '',
files: null
} }
} }
}, },
@ -174,7 +158,8 @@ export default {
const data = { ...this.form } const data = { ...this.form }
data.startDate = data.time[0] data.startDate = data.time[0]
data.endDate = data.time[1] data.endDate = data.time[1]
data.executorIds = data.executors.join(',') data.executorIds = data.executors
delete data.executors
this.$api.task.submit(data).then(res => { this.$api.task.submit(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)

View File

@ -67,7 +67,7 @@
<task :project-id="info.id" ref="task" /> <task :project-id="info.id" ref="task" />
</div> </div>
<div v-else-if="tabIndex === 1"> <div v-else-if="tabIndex === 1">
<files :project-id="info.id" /> <attach :project-id="info.id" :query-id="info.id" :type="0" folder="project_folder_init"/>
</div> </div>
<div v-else-if="tabIndex === 4"> <div v-else-if="tabIndex === 4">
<base-info :info="info" /> <base-info :info="info" />
@ -90,47 +90,42 @@
<script> <script>
import task from '@/views/project/index/components/task.vue' import task from '@/views/project/index/components/task.vue'
import editTask from '@/views/project/index/components/edit-task.vue' import editTask from '@/views/project/index/components/edit-task.vue'
import files from '@/views/project/index/components/files.vue'
import baseInfo from '@/views/project/index/components/base-info.vue' import baseInfo from '@/views/project/index/components/base-info.vue'
import attach from "@/views/project/components/attach/index.vue";
export default { export default {
components: { components: {
task, task,
editTask, editTask,
files, attach,
baseInfo baseInfo
}, },
props: { props: {
info: { id: {
required: true, required: true,
type: Object, type: String,
default: null default: ""
} }
}, },
watch: { watch: {
show: { show: {
handler(val) { handler(val) {
if (val) { if (val) {
this.fetchInfo()
this.tabIndex = 0 this.tabIndex = 0
if (this.$refs.task) {
this.$refs.task.fetchList()
}
} else { } else {
this.tabIndex = 0 this.tabIndex = 0
} }
}, },
immediate: true immediate: true
}, },
info: {
handler(val) {
this.name = val.name
this.fetchData()
},
immediate: true
}
}, },
data() { data() {
return { return {
info:null,
name: '', name: '',
edit: false, edit: false,
show: false, show: false,
@ -165,6 +160,15 @@ export default {
} }
}, },
methods: { methods: {
fetchInfo(){
this.$api.project.info({id:this.id}).then(res => {
if (res.code === 200){
this.info = res.data
this.name = this.info.name
this.fetchData()
}
})
},
fetchData() { fetchData() {
this.data = this.data.map(item => { this.data = this.data.map(item => {
const res = { const res = {
@ -174,7 +178,7 @@ export default {
span: item.span ?? 1 span: item.span ?? 1
} }
if (item.prop === 'createUser') { if (item.prop === 'createUser') {
res.value = this.info.createUser.name res.value = this.info.user.name
} }
if (item.prop === 'customer') { if (item.prop === 'customer') {
res.value = this.info.customer res.value = this.info.customer
@ -182,8 +186,8 @@ export default {
: '' : ''
} }
if (item.prop === 'cityName') { if (item.prop === 'cityName') {
res.value = this.info.customer res.value = this.info.region
? this.info.customer.cityName ? this.info.region.province_name + this.info.region.city_name + this.info.region.name
: '' : ''
} }
if (item.prop === 'industry') { if (item.prop === 'industry') {
@ -198,7 +202,7 @@ export default {
this.tabIndex = Number.parseInt(index) this.tabIndex = Number.parseInt(index)
}, },
updateName() { updateName() {
const data = { id: this.info.id, name: this.name } const data = { id: this.id, name: this.name }
this.edit = false this.edit = false
this.$api.project.submit(data).then(res => { this.$api.project.submit(data).then(res => {
if (res.code === 200) { if (res.code === 200) {

View File

@ -1,16 +1,31 @@
<template> <template>
<div> <div>
<a-table :columns="columns" :data="list"> <a-table :columns="columns" :data="list">
<template #createUser="{ record }"> <template #level="{ record }">
<div> <div>
{{ record.createUser.name }} {{ record.level.label }}
</div>
</template>
<template #user="{ record }">
<div>
{{ record.user.name }}
</div>
</template>
<template #executors="{ record }">
<div>
<a-avatar-group :size="32">
<view v-for="item in record.executors ">
<a-avatar v-if="item.avatar" :style="{ backgroundColor: '#7BC616' }">
<img alt="avatar" :src="item.avatar" />
</a-avatar>
<a-avatar v-else :style="{ backgroundColor: '#7BC616' }">{{item.name.substring(0,1)}}</a-avatar>
</view>
</a-avatar-group>
</div> </div>
</template> </template>
<template #status="{ record }"> <template #status="{ record }">
<div> <div>
<a-tag :color="record.status.remark" {{ record.status.label }}
>{{ record.status.label }}
</a-tag>
</div> </div>
</template> </template>
<template #tag="{ record }"> <template #tag="{ record }">
@ -20,7 +35,7 @@
</template> </template>
<template #menu="{ record }"> <template #menu="{ record }">
<div> <div>
<task-info :id="record.id" /> <task-info :id="record.id" :info="record"/>
</div> </div>
</template> </template>
</a-table> </a-table>
@ -28,7 +43,7 @@
</template> </template>
<script> <script>
import taskInfo from '@/views/project/index/components/task-info.vue' import taskInfo from '@/views/project/task/task-info.vue'
export default { export default {
components: { components: {
@ -49,12 +64,12 @@ export default {
level: [], level: [],
columns: [ columns: [
{ {
title: '任务标题', title: '描述',
dataIndex: 'name' dataIndex: 'remark'
}, },
{ {
title: '优先级', title: '优先级',
dataIndex: 'levelName' slotName: 'level'
}, },
{ {
title: '任务标签', title: '任务标签',
@ -66,11 +81,15 @@ export default {
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime' dataIndex: 'createdAt'
}, },
{ {
title: '创建人', title: '创建人',
slotName: 'createUser' slotName: 'user'
},
{
title: '执行人',
slotName: 'executors'
}, },
{ {
title: '操作', title: '操作',
@ -80,55 +99,16 @@ export default {
} }
}, },
mounted() { mounted() {
this.fetchDict() this.fetchList()
}, },
methods: { methods: {
fetchDict() {
const tmpStatus = sessionStorage.getItem('project_task_status')
if (tmpStatus) {
this.dict = JSON.parse(tmpStatus)
} else {
this.$api.sys
.dict({ code: 'project_task_status' })
.then(res => {
if (res.code === 200) {
this.dict = res.data
sessionStorage.setItem(
'project_task_status',
JSON.stringify(this.dict)
)
}
})
}
const tmplevel = sessionStorage.getItem('project_task_level')
if (tmplevel) {
this.level = JSON.parse(tmplevel)
} else {
this.$api.sys.dict({ code: 'project_task_level' }).then(res => {
if (res.code === 200) {
this.level = res.data
sessionStorage.setItem(
'project_task_level',
JSON.stringify(this.level)
)
this.fetchList()
}
})
}
},
fetchList() { fetchList() {
const data = { projectId: this.projectId, ...this.page } const data = { projectId: this.projectId, ...this.page }
this.$api.task.page(data).then(res => { this.$api.task.page(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data.records.map(e => { this.list = res.data.records.map(e => {
var item = { ...e } e.status.remark = JSON.parse(e.status.remark)
item.status = this.dict.find( return e
e => e.value === item.status.toString()
)
item.levelName = this.level.find(
e => e.value === item.level
).label
return item
}) })
} }
}) })

View File

@ -6,23 +6,28 @@
<city-tree @ok="changeCustomer" /> <city-tree @ok="changeCustomer" />
</div> </div>
<div class="container full-width"> <div class="container full-width">
<div v-if="city"> <div class="flex flex-center flex-justify-between full-width">
<div class="flex flex-center flex-justify-start full-width"> <div class="flex flex-center flex-justify-between full-width">
<div v-if="city" >
<div class="flex flex-center flex-justify-start full-width">
<h2>{{ city.name }}</h2> <h2>{{ city.name }}</h2>
</div> </div>
<div <div
class="mt-10 flex flex-center flex-justify-start full-width" class="mt-10 flex flex-center flex-justify-start full-width"
> >
<a-tag color="blue" <a-tag color="blue"
>共计项目 {{ city.projectCount }} 待办任务 >共计项目 {{ city.projectCount }} 待办任务
{{ city.taskCount }} {{ city.taskCount }}
</a-tag> </a-tag>
</div>
</div> </div>
</div>
<div v-else> </div>
<div class="flex flex-center flex-justify-start full-width"> <div class="flex flex-center flex-justify-between">
<h2>共计项目{{ page.total }} </h2> <div>
<edit-project @ok="fetchList"/>
</div> </div>
</div>
</div> </div>
<a-table <a-table
:columns="columns" :columns="columns"
@ -33,17 +38,12 @@
> >
<template #user="{ record }"> <template #user="{ record }">
<div> <div>
{{ record.createUser.name }} {{ record.user.name }}
</div> </div>
</template> </template>
<template #menu="{ record }"> <template #menu="{ record }">
<div> <div>
<more-info :info="record" /> <more-info :id="record.id" />
</div>
</template>
<template #customer="{ record }">
<div>
{{ record.customer ? record.customer.name : '' }}
</div> </div>
</template> </template>
</a-table> </a-table>
@ -62,12 +62,14 @@ path: '/project/index',
import navbar from '@/components/navbar/index.vue' import navbar from '@/components/navbar/index.vue'
import moreInfo from './components/more-info.vue' import moreInfo from './components/more-info.vue'
import cityTree from '@/views/project/index/components/city-tree.vue' import cityTree from '@/views/project/index/components/city-tree.vue'
import editProject from "@/views/project/index/components/edit-project.vue";
export default { export default {
components: { components: {
cityTree, cityTree,
navbar, navbar,
moreInfo moreInfo,
editProject
}, },
data() { data() {
return { return {
@ -91,7 +93,7 @@ export default {
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime' dataIndex: 'createdAt'
}, },
{ {
title: '创建人', title: '创建人',

View File

@ -8,16 +8,16 @@
:footer="false" :footer="false"
> >
<div v-if="task"> <div v-if="task">
<div>{{ task.createUser.name }}创建于{{ task.createTime }}</div> <div>{{ task.user.name }}创建于{{ task.createdAt }}</div>
<div class="flex flex-align-baseline"> <div class="flex flex-align-baseline">
<div class="font-24 bold">{{ task.name }}</div> <h2 >{{ task.name }}</h2>
<div class="ml-20"> <div class="mt-20">
<a-dropdown @select="changeStatus"> <a-dropdown @select="changeStatus">
<a-button <a-button
type="primary" type="primary"
size="small" size="small"
:style=" :style="
`background-color:` + task.status.remark `background-color:` + task.status.remark.color
" "
>{{ task.status.label }} >{{ task.status.label }}
</a-button> </a-button>
@ -35,86 +35,29 @@
<a-divider /> <a-divider />
<div class="flex flex-align-start flex-justify-between"> <div class="flex flex-align-start flex-justify-between">
<div style="flex: 3"> <div style="flex: 3">
<div> <div>
<div <div
style="white-space: pre" style="white-space: pre;min-height: 180px; border-radius: 8px"
class="grey-6-bg padding" class="grey-6-bg padding "
> >
{{ task.remark }} {{ task.remark }}
</div>
</div>
<a-divider />
<div class="flex flex-center flex-justify-start">
<div class="font-18 bold">关联附件</div>
<file-picker
class="ml-20"
:project-id="task.projectId"
@ok="success"
/>
</div>
<div class="mt-20">
<a-list size="small">
<a-list-item
v-for="item in fileList"
:key="item.id"
>
<div
class="flex flex-center flex-justify-between"
>
<div>{{ item.name }}</div>
<div class="flex flex-center">
<preview :file-id="item.fileId" />
<a-popconfirm
content="确定取消该关联附件"
@ok="remove(item)"
>
<a-button type="text"
>取消关联
</a-button>
</a-popconfirm>
</div>
</div>
</a-list-item>
</a-list>
</div>
<a-divider />
<div class="flex flex-center flex-justify-start mt-20">
<div class="font-18 bold">任务日志</div>
</div>
<div class="mt-20">
<div
class="flex flex-center flex-justify-start mb-20"
v-for="item in log"
:key="item.id"
>
<a-avatar v-if="item.avatar">
<img alt="avatar" :src="item.avatar" />
</a-avatar>
<a-avatar v-else style="background-color: blue">
<div>{{ item.user.name }}</div>
</a-avatar>
<div class="ml-10">
<div>
{{ item.user.name }}
{{ item.createTime }}
</div>
<div>
{{ item.content }}
</div>
</div>
</div>
</div> </div>
</div>
<div>
<a-tabs class="mt-10" @change="tabChange" :active-key="tabIndex">
<a-tab-pane title="相关文件" key="0"></a-tab-pane>
<a-tab-pane title="相关合同" key="1"></a-tab-pane>
</a-tabs>
</div>
<div v-if="tabIndex === 0">
<attach :project-id="task.projectId" :query-id="task.id" :type="1" folder="project_task_folder_init"/>
</div>
</div> </div>
<div style="flex: 1" class="ml-20"> <div style="flex: 1" class="ml-20">
<a-card> <a-card>
<div class="font-18 bold">基础信息</div> <div class="font-18 bold">基础信息</div>
<a-divider /> <a-divider />
<a-form auto-label-width> <a-form auto-label-width>
<a-form-item label="任务标题:">
<div class="black bold">
{{ task.name }}
</div>
</a-form-item>
<a-form-item label="优先级:"> <a-form-item label="优先级:">
<a-tag class="black bold" color="green" <a-tag class="black bold" color="green"
> >
@ -122,7 +65,7 @@
</a-form-item> </a-form-item>
<a-form-item label="创建人:"> <a-form-item label="创建人:">
<div class="black bold"> <div class="black bold">
{{ task.createUser.name }} {{ task.user.name }}
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="任务标签:"> <a-form-item label="任务标签:">
@ -159,23 +102,34 @@
<script> <script>
import filePicker from '@/views/project/components/file-picker/index.vue' import filePicker from '@/views/project/components/file-picker/index.vue'
import preview from '@/components/preview/index.vue' import preview from '@/components/preview/index.vue'
import attach from "@/views/project/components/attach/index.vue";
export default { export default {
components: { components: {
filePicker, filePicker,
preview preview,
attach
}, },
props: { props: {
id: { id: {
type: String, type: String,
default: '' default: ''
},
info:{
required:true,
type: Object,
default: null
} }
}, },
watch: { watch: {
show: { show: {
handler(val) { handler(val) {
if (val) { if (val) {
this.fetchDict() if (this.info){
this.fetchDict()
this.task = this.info
console.log(this.task)
}
} }
} }
} }
@ -186,22 +140,15 @@ export default {
task: null, task: null,
fileList: [], fileList: [],
dict: [], dict: [],
log: [] log: [],
tabIndex:0,
} }
}, },
methods: { methods: {
fetchInfo() { tabChange(index){
this.$api.task.info({ id: this.id }).then(res => { console.log(index)
if (res.code === 200) { this.tabIndex = Number.parseInt(index )
this.task = res.data },
this.task.status = this.dict.find(
sub => sub.value === this.task.status + ''
)
this.fileList = this.task.files
this.fetchLog()
}
})
},
fetchDict() { fetchDict() {
this.$api.sys.dict({ code: 'project_task_status' }).then(res => { this.$api.sys.dict({ code: 'project_task_status' }).then(res => {
if (res.code === 200) { if (res.code === 200) {
@ -249,13 +196,7 @@ export default {
} }
}) })
}, },
fetchLog() {
this.$api.task.allLog({ id: this.task.id }).then(res => {
if (res.code === 200) {
this.log = res.data
}
})
}
} }
} }
</script> </script>

View File

@ -3,7 +3,9 @@
<navbar title="应用管理"></navbar> <navbar title="应用管理"></navbar>
<div class="container"> <div class="container">
<div class="flex flex-center flex-justify-between"> <div class="flex flex-center flex-justify-between">
<a-button type="text">新增</a-button> <div>
<add-client @ok="fetchList"/>
</div>
<div> <div>
<a-button type="outline" shape="circle" @click="fetchList"> <a-button type="outline" shape="circle" @click="fetchList">
<icon-refresh /> <icon-refresh />
@ -13,7 +15,7 @@
<a-table :columns="columns" :data="list" size="small" class="mt-20"> <a-table :columns="columns" :data="list" size="small" class="mt-20">
<template #menu="{ record }"> <template #menu="{ record }">
<div> <div>
<a-button type="text" size="small">查看</a-button> <edit-client :id="record.id" @ok="fetchList"/>
</div> </div>
</template> </template>
</a-table> </a-table>
@ -23,10 +25,15 @@
<script> <script>
import navbar from '@/components/navbar/index.vue' import navbar from '@/components/navbar/index.vue'
import editClient from "@/views/system/components/edit-client.vue";
import addClient from "@/views/system/components/add-client.vue";
export default { export default {
components: { components: {
navbar navbar,
addClient,
editClient
}, },
data() { data() {
return { return {
@ -49,7 +56,7 @@ export default {
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime' dataIndex: 'createdAt'
}, },
{ {
title: '操作', title: '操作',
@ -67,7 +74,6 @@ export default {
console.log(res) console.log(res)
if (res.code === 200) { if (res.code === 200) {
this.list = res.data this.list = res.data
this.$notification.success(res.msg)
} }
}) })
} }

View File

@ -0,0 +1,51 @@
<template>
<div>
<a-button type="text" size="small" @click="show = true">新增</a-button>
<a-modal v-model:visible="show" @before-close="submit">
<a-form ref="form" :model="form" auto-label-width>
<a-form-item label="名称" field="name" :rules="[{required:true,message:'请填写应用名称'}]">
<a-input v-model="form.name" placeholder="请填写应用名称"></a-input>
</a-form-item>
<a-form-item label="配置" field="name" >
<a-textarea :auto-size="{minRows: 5}" placeholder="请填写应用配置" v-model="form.config"></a-textarea>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
export default {
data() {
return {
show: false,
form: {
name:'',
config:''
}
}
},
methods: {
submit(done) {
this.$refs.form.validate(error => {
if (error === undefined){
this.$api.sys.clientsSave(this.form).then(res=>{
if (res.code === 200){
this.$emit('ok')
done()
} else {
this.$notification.error(res.msg)
}
})
} else {
done(false)
}
})
}
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -52,7 +52,7 @@
<a-form-item label="code" field="code" required> <a-form-item label="code" field="code" required>
<a-input <a-input
v-model="form.code" v-model="form.code"
:disabled="form.pid !== undefined" :disabled="form.pid !== '0'"
></a-input> ></a-input>
</a-form-item> </a-form-item>
<a-form-item label="值" field="value"> <a-form-item label="值" field="value">
@ -108,7 +108,8 @@ export default {
label: '', label: '',
code: '', code: '',
remark: '', remark: '',
sort: '' sort: '',
pid:'0'
} }
} }
}, },
@ -118,11 +119,8 @@ export default {
if (errors === undefined) { if (errors === undefined) {
this.$api.sys.dictSave(this.form).then(res => { this.$api.sys.dictSave(this.form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg)
this.form = res.data this.form = res.data
setTimeout(() => { this.$emit('ok')
this.$emit('ok')
}, 500)
done() done()
} else { } else {
this.$notification.error(res.msg) this.$notification.error(res.msg)

View File

@ -20,12 +20,6 @@
v-model="form.code" v-model="form.code"
></a-input> ></a-input>
</a-form-item> </a-form-item>
<a-form-item label="排序" field="sort" required>
<a-input-number
placeholder="请输入排序"
v-model="form.sort"
></a-input-number>
</a-form-item>
<a-form-item label="备注" field="remark" required> <a-form-item label="备注" field="remark" required>
<a-input <a-input
placeholder="请输入备注" placeholder="请输入备注"
@ -60,7 +54,6 @@ export default {
appId: '', appId: '',
name: '', name: '',
code: '', code: '',
sort: '',
remark: '' remark: ''
} }
} }

View File

@ -0,0 +1,93 @@
<template>
<div>
<a-button type="text" size="small" @click="show = true">查看</a-button>
<a-drawer v-model:visible="show" width="760px" :footer="false" @before-close="update">
<a-form v-if="form" :model="form" auto-label-width >
<a-form-item label="logo">
<upload @ok="uploadSucc"/>
</a-form-item>
<div>
<a-image :src="pic"></a-image>
</div>
<a-form-item field="name" label="客户端名称">
<a-input v-model="form.name" ></a-input>
</a-form-item>
<a-form-item field="config" label="配置">
<a-textarea v-model="form.config" :auto-size="{minRows: 5}" ></a-textarea>
</a-form-item>
</a-form>
</a-drawer>
</div>
</template>
<script>
import upload from "@/components/upload/index.vue";
export default {
components: {
upload,
},
props: {
id: {
type: Number,
default: 0
},
},
watch: {
show:{
handler(newVal, oldVal) {
if (newVal){
this.fetchInfo()
}
},
immediate: true
}
},
data() {
return {
show: false,
pic:'',
form:null
}
},
methods: {
uploadSucc(res){
this.pic = "/api/file/info?id=" + res.id
},
fetchInfo() {
this.$api.sys.clientInfo({id:this.id}).then(res => {
if (res.code === 200) {
this.form = res.data
}
})
},
update(done){
// config json
if (this.form.config.length > 0){
try {
const parsedConfig = JSON.parse(this.form.config);
if (typeof parsedConfig === 'object' && parsedConfig !== null) {
this.$api.sys.clientsSave(this.form).then(res => {
if (res.code === 200){
this.$emit('ok')
done()
} else {
this.$notification.error(res.msg)
done(false)
}
})
} else {
this.$notification.error("配置必须为JSON 结构")
}
} catch (error) {
this.$notification.error("配置必须为JSON 结构")
}
}
}
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -55,8 +55,8 @@
:required="[{ message: '请选择类型', required: true }]" :required="[{ message: '请选择类型', required: true }]"
> >
<a-radio-group v-model="form.type"> <a-radio-group v-model="form.type">
<a-radio :value="1">菜单</a-radio> <a-radio :value="0">菜单</a-radio>
<a-radio :value="2">按钮</a-radio> <a-radio :value="1">按钮</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
@ -95,10 +95,10 @@ export default {
if (this.type === 'edit') { if (this.type === 'edit') {
this.form = val this.form = val
} else if (this.type === 'addSub') { } else if (this.type === 'addSub') {
this.form.appId = val.appId this.form.appid = val.appid
this.form.pid = val.id this.form.pid = val.id
} else { } else {
this.form.appId = val.appId this.form.appid = val.appid
this.form.pid = val.pid this.form.pid = val.pid
} }
} }
@ -110,13 +110,14 @@ export default {
return { return {
show: false, show: false,
form: { form: {
appId: '', appid: '',
id: '', id: '',
name: '', name: '',
value: '', value: '',
sort: '', sort: '',
type: 1, type: 0,
pid: '0' pid: '',
remark:''
} }
} }
}, },
@ -124,7 +125,6 @@ export default {
ok(done) { ok(done) {
this.$refs.form.validate(errors => { this.$refs.form.validate(errors => {
if (errors === undefined) { if (errors === undefined) {
console.log(this.form)
this.$api.sys.menuSave(this.form).then(res => { this.$api.sys.menuSave(this.form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$notification.success(res.msg) this.$notification.success(res.msg)

View File

@ -51,7 +51,7 @@ export default {
}, },
methods: { methods: {
fetchMenu() { fetchMenu() {
this.$api.sys.menuTree({ appId: this.appId }).then(res => { this.$api.sys.menuTree({ appid: this.appId }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data.map(e => { this.list = res.data.map(e => {
e.key = e.id e.key = e.id

View File

@ -23,7 +23,7 @@
<div class="flex flex-center flex-justify-between"> <div class="flex flex-center flex-justify-between">
<div class="flex flex-center"> <div class="flex flex-center">
<h2>{{ dict.label }}</h2> <h2>{{ dict.label }}</h2>
<add-dict class="ml-20" :info="dict" type="edit" /> <add-dict class="ml-20" :info="dict" type="edit" @click="fetchDetail" />
</div> </div>
<add-dict :info="dict" type="add" @ok="fetchDetail" /> <add-dict :info="dict" type="add" @ok="fetchDetail" />
</div> </div>
@ -63,7 +63,7 @@ export default {
}, },
data() { data() {
return { return {
page: { page: 0, size: 10, total: 0 }, page: { page: 1, size: 10, total: 0 },
list: [], list: [],
list2: [], list2: [],
@ -84,7 +84,7 @@ export default {
}, },
methods: { methods: {
pageChange(page) { pageChange(page) {
this.page.page = page - 1 this.page.page = page
this.fetchList() this.fetchList()
}, },
fetchList() { fetchList() {
@ -110,7 +110,7 @@ export default {
this.fetchDetail() this.fetchDetail()
}, },
remove(id) { remove(id) {
this.$api.sys.dictRemove({ ids: id }).then(res => { this.$api.sys.dictRemove({ id: id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.fetchList() this.fetchList()
this.$notification.success(res.msg) this.$notification.success(res.msg)

View File

@ -7,9 +7,10 @@
style="width: 360px" style="width: 360px"
:options="options" :options="options"
:model-value="client" :model-value="client"
@change="change"
></a-select> ></a-select>
<edit-menu <edit-menu
:info="{ appId: client, pid: '0' }" :info="{ appid: client, pid: '0' }"
type="add" type="add"
@ok="fetchClientList" @ok="fetchClientList"
/> />
@ -18,10 +19,10 @@
<a-table :columns="columns" :data="list"> <a-table :columns="columns" :data="list">
<template #type="{ record }"> <template #type="{ record }">
<div> <div>
<a-tag color="blue" v-if="record.type === 1" <a-tag color="blue" v-if="record.type === 0"
>菜单 >菜单
</a-tag> </a-tag>
<a-tag color="red" v-if="record.type === 2" <a-tag color="red" v-if="record.type === 1"
>按钮 >按钮
</a-tag> </a-tag>
</div> </div>
@ -79,6 +80,7 @@ export default {
client: '', client: '',
list: [], list: [],
options: [], options: [],
index:0,
columns: [ columns: [
{ title: '名称', dataIndex: 'name' }, { title: '名称', dataIndex: 'name' },
{ title: '路径', dataIndex: 'value' }, { title: '路径', dataIndex: 'value' },
@ -92,6 +94,11 @@ export default {
this.fetchClientList() this.fetchClientList()
}, },
methods: { methods: {
change(e){
this.client = e
this.index = this.options.findIndex(sub => sub.value === e)
this.fetchMenus()
},
fetchClientList() { fetchClientList() {
this.$api.sys.clientList().then(res => { this.$api.sys.clientList().then(res => {
if (res.code === 200) { if (res.code === 200) {
@ -100,7 +107,7 @@ export default {
e.value = e.appid e.value = e.appid
return e return e
}) })
this.client = this.options[0].appid this.client = this.options[this.index].appid
this.fetchMenus() this.fetchMenus()
} }
}) })

View File

@ -7,6 +7,7 @@
:options="options" :options="options"
:model-value="client" :model-value="client"
style="width: 360px" style="width: 360px"
@change="change"
></a-select> ></a-select>
<add-role :app-id="client" @ok="fetchClientList" /> <add-role :app-id="client" @ok="fetchClientList" />
</div> </div>
@ -43,11 +44,11 @@ export default {
return { return {
client: '', client: '',
options: [], options: [],
index:0,
list: [], list: [],
columns: [ columns: [
{ title: '名称', dataIndex: 'name' }, { title: '名称', dataIndex: 'name' },
{ title: 'code', dataIndex: 'code' }, { title: 'code', dataIndex: 'code' },
{ title: '排序', dataIndex: 'sort' },
{ title: '备注', dataIndex: 'remark' }, { title: '备注', dataIndex: 'remark' },
{ title: '操作', slotName: 'menu' } { title: '操作', slotName: 'menu' }
] ]
@ -57,21 +58,26 @@ export default {
this.fetchClientList() this.fetchClientList()
}, },
methods: { methods: {
change(e){
this.client = e
this.index = this.options.findIndex(sub => sub.value === e)
this.fetchClientList()
},
fetchClientList() { fetchClientList() {
this.$api.sys.clientList().then(res => { this.$api.sys.clientList().then(res => {
if (res.code === 200) { if (res.code === 200) {
this.options = res.data.map(e => { this.options = res.data.map(e => {
e.label = e.name e.label = e.name
e.value = e.appId e.value = e.appid
return e return e
}) })
this.client = this.options[0].appId this.client = this.options[this.index].appid
this.fetchRole() this.fetchRole()
} }
}) })
}, },
fetchRole() { fetchRole() {
this.$api.sys.roleList({ appId: this.client }).then(res => { this.$api.sys.roleList({ appid: this.client }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.list = res.data this.list = res.data
} }