[fix]项目文件夹+ 任务文件夹
This commit is contained in:
parent
c44239fa1e
commit
aa6179c3f1
@ -24,5 +24,9 @@ export default {
|
||||
|
||||
all(params) {
|
||||
return fetch('/base/customer/all', params)
|
||||
},
|
||||
|
||||
findList(params) {
|
||||
return fetch('/base/customer/list', params)
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,10 +6,15 @@ export default {
|
||||
* @param params
|
||||
* @returns {Promise | Promise<unknown>}
|
||||
*/
|
||||
info(fileId) {
|
||||
return fetch('/file/info/' + fileId)
|
||||
info(params) {
|
||||
return fetch('/file/info',params)
|
||||
},
|
||||
|
||||
history(params) {
|
||||
return fetch('/project/attach/history',params)
|
||||
},
|
||||
|
||||
|
||||
download(params) {
|
||||
return fetch('/file/download', params, 'get', 'form', {}, 'blob')
|
||||
}
|
||||
|
||||
@ -7,15 +7,15 @@ export default {
|
||||
* @returns {Promise | Promise<unknown>}
|
||||
*/
|
||||
list(params) {
|
||||
return fetch('/sys/dept/list/children', params)
|
||||
return fetch('/dept/list', params)
|
||||
},
|
||||
|
||||
submit(params) {
|
||||
return fetch('/sys/dept/submit', params, 'post', 'json')
|
||||
return fetch('/dept/submit', params, 'post', 'json')
|
||||
},
|
||||
|
||||
info(params) {
|
||||
return fetch('/sys/dept/info/org', params)
|
||||
return fetch('/dept/info/org', params)
|
||||
},
|
||||
|
||||
// ==================
|
||||
@ -32,7 +32,7 @@ export default {
|
||||
|
||||
// ===========
|
||||
areaTree(params) {
|
||||
return fetch('/sys/region/tree', params)
|
||||
return fetch('/region/tree', params)
|
||||
},
|
||||
|
||||
areaDetail(params) {
|
||||
|
||||
@ -6,8 +6,8 @@ axios.interceptors.request.use(
|
||||
config => {
|
||||
config.headers.Platform = 'pc'
|
||||
config.headers.type = 'web'
|
||||
config.headers.appId = 'E191C42B'
|
||||
config.headers.Authorization = 'Bearer' + localStorage.getItem('token')
|
||||
config.headers.appid = 'E191C42B'
|
||||
config.headers.Authorization = 'Bearer ' + localStorage.getItem('token')
|
||||
return config
|
||||
},
|
||||
err => {
|
||||
|
||||
@ -2,18 +2,18 @@ import fetch from '../fetch.js'
|
||||
|
||||
export default {
|
||||
initFolder(params) {
|
||||
return fetch('/project/file/folder/init', params, 'post')
|
||||
return fetch('/project/attach/folder/init', params, 'post')
|
||||
},
|
||||
|
||||
page(params) {
|
||||
return fetch('/project/file/page', params)
|
||||
return fetch('/project/attach/page', params)
|
||||
},
|
||||
|
||||
submit(params) {
|
||||
return fetch('/project/file/submit', params, 'post', 'json')
|
||||
return fetch('/project/attach/submit', params, 'post', 'json')
|
||||
},
|
||||
|
||||
remove(params) {
|
||||
return fetch('/project/file/remove', params, 'post')
|
||||
return fetch('/project/attach/remove', params, 'post')
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,9 @@ export default {
|
||||
return fetch('/project/page', params)
|
||||
},
|
||||
|
||||
findByCity(params) {
|
||||
return fetch('/project/list/customer', params)
|
||||
}
|
||||
info(params) {
|
||||
return fetch('/project/info', params)
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -20,6 +20,15 @@ export default {
|
||||
return fetch('/sys/client/list', params)
|
||||
},
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
clientsSave(params) {
|
||||
return fetch('/sys/client/submit', params,'post','json')
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取全部客户端列表
|
||||
* @param params
|
||||
@ -29,6 +38,15 @@ export default {
|
||||
return fetch('/sys/client/list')
|
||||
},
|
||||
|
||||
/**
|
||||
* 客户端详情
|
||||
* @param params
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
clientInfo(params) {
|
||||
return fetch('/sys/client/info',params)
|
||||
},
|
||||
|
||||
// ++++++++++++++++++++++++++++++++
|
||||
/**
|
||||
* 根据aapId 获取菜单
|
||||
@ -60,8 +78,9 @@ export default {
|
||||
roleList(params) {
|
||||
return fetch('/sys/role/list', params)
|
||||
},
|
||||
|
||||
roleChange(params) {
|
||||
return fetch('/sys/role/update', params, 'post')
|
||||
return fetch('/user/update', params, 'post','json')
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -14,8 +14,8 @@ export default {
|
||||
return fetch('/user/info', params)
|
||||
},
|
||||
|
||||
retPwd(params) {
|
||||
return fetch('/user/restPwd', params, 'post')
|
||||
update(params) {
|
||||
return fetch('/user/update', params, 'post','json')
|
||||
},
|
||||
changeStatus(params) {
|
||||
return fetch('/user/changeStatus', params, 'post')
|
||||
|
||||
@ -273,7 +273,8 @@ img {
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
width: 1340px;
|
||||
min-width: 1340px;
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
125
src/components/history/index.vue
Normal file
125
src/components/history/index.vue
Normal 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>
|
||||
@ -14,22 +14,22 @@
|
||||
<iframe
|
||||
v-if="file.suffix === '.pdf'"
|
||||
style="width: 100%; height: 100vh"
|
||||
:src="`/api/file/` + file.id"
|
||||
:src="`/api/file/view?id=` + file.id"
|
||||
>
|
||||
</iframe>
|
||||
<vue-office-docx
|
||||
v-else-if="['.docx'].includes(file.suffix)"
|
||||
:src="`/api/file/` + file.id"
|
||||
:src="`/api/file/view?id=` + file.id"
|
||||
style="width: 100%; height: 100vh"
|
||||
/>
|
||||
<vue-office-excel
|
||||
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"
|
||||
/>
|
||||
<div v-else-if="file.fileType.indexOf('image') > -1">
|
||||
<a-image
|
||||
:src="`/api/file/` + file.id"
|
||||
:src="`/api/file/view?id=` + file.id"
|
||||
:fit="'contain'"
|
||||
height="960px"
|
||||
width="100%"
|
||||
@ -62,7 +62,8 @@
|
||||
<div class="mt-20">加载中,请稍后</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
@ -79,13 +80,19 @@ import '@vue-office/docx/lib/index.css'
|
||||
import VueOfficeExcel from '@vue-office/excel'
|
||||
//引入相关样式
|
||||
import '@vue-office/excel/lib/index.css'
|
||||
import history from "@/components/history/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VueOfficeDocx,
|
||||
VueOfficeExcel
|
||||
VueOfficeExcel,
|
||||
history
|
||||
},
|
||||
props: {
|
||||
attachId: {
|
||||
type:String,
|
||||
default: ""
|
||||
},
|
||||
fileId: {
|
||||
required: true,
|
||||
type: String,
|
||||
@ -109,7 +116,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchFile() {
|
||||
this.$api.file.info(this.fileId).then(res => {
|
||||
this.$api.file.info({id:this.fileId}).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.file = res.data
|
||||
}
|
||||
|
||||
@ -36,7 +36,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
progress(e, progress) {
|
||||
console.log(e, progress)
|
||||
if (progress.loaded > 0) {
|
||||
this.loading = true
|
||||
}
|
||||
|
||||
@ -63,7 +63,6 @@ export default {
|
||||
}
|
||||
},
|
||||
fetchNotice() {
|
||||
console.log('unread')
|
||||
this.$api.notice.unReadAll().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data
|
||||
@ -71,8 +70,10 @@ export default {
|
||||
})
|
||||
},
|
||||
logout() {
|
||||
this.$cookies.remove('wt')
|
||||
localStorage.clear()
|
||||
sessionStorage.clear()
|
||||
this.$router.push('/login')
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,24 +54,11 @@
|
||||
:rules="[{ required: true, message: '请选择类型' }]"
|
||||
>
|
||||
<a-select placeholder="请选择类型" v-model="form.type">
|
||||
<a-option label="业主单位" value="0"></a-option>
|
||||
<a-option label="实施单位" value="1"></a-option>
|
||||
<a-option label="其他" value="2"></a-option>
|
||||
<a-option label="业主单位" :value="0"></a-option>
|
||||
<a-option label="实施单位" :value="1"></a-option>
|
||||
<a-option label="其他" :value="2"></a-option>
|
||||
</a-select>
|
||||
</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-textarea
|
||||
placeholder="请输入备注"
|
||||
@ -97,8 +84,7 @@ export default {
|
||||
cityName: '',
|
||||
address: '',
|
||||
remark: '',
|
||||
saleManId: '',
|
||||
type: ''
|
||||
type: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -107,25 +93,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchCity() {
|
||||
this.$api.base.areaTree().then(res => {
|
||||
this.$api.base.areaTree({code:53}).then(res => {
|
||||
if (res.code === 200) {
|
||||
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) {
|
||||
this.$refs.form.validate(errors => {
|
||||
if (errors === undefined) {
|
||||
console.log(this.form)
|
||||
this.$api.customer.submit(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success(res.msg)
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
export default {
|
||||
props: {
|
||||
pid: {
|
||||
type: String,
|
||||
default: ''
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -51,7 +51,7 @@ export default {
|
||||
show: false,
|
||||
form: {
|
||||
name: '',
|
||||
pid: '',
|
||||
pid: 0,
|
||||
sort: ''
|
||||
}
|
||||
}
|
||||
@ -66,6 +66,7 @@ export default {
|
||||
this.$emit('ok')
|
||||
done()
|
||||
} else {
|
||||
done(false)
|
||||
this.$notification.error(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
@ -56,11 +56,10 @@ export default {
|
||||
e.checked = false
|
||||
return e
|
||||
})
|
||||
console.log(index)
|
||||
this.roleList[index].checked = true
|
||||
},
|
||||
fetchRole() {
|
||||
this.$api.sys.roleList({ appId: '7XAp5LZk' }).then(res => {
|
||||
this.$api.sys.roleList({ appid: 'E191C42B' }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.roleList = res.data
|
||||
.filter(e => e.code !== 'super_admin')
|
||||
@ -73,8 +72,8 @@ export default {
|
||||
},
|
||||
submit() {
|
||||
const role = this.roleList.find(e => e.checked)
|
||||
const data = { userId: this.userId, roleId: role.id }
|
||||
this.$api.sys.roleChange(data).then(res => {
|
||||
const data = { id: this.userId, roleId: role.id }
|
||||
this.$api.user.update(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success(res.msg)
|
||||
this.$emit('ok')
|
||||
|
||||
@ -79,6 +79,7 @@
|
||||
<a-col span="12">
|
||||
<a-form-item label="所属部门" required field="deptId">
|
||||
<a-select
|
||||
placeholder="请选择所属部门"
|
||||
v-model="form.deptId"
|
||||
:options="deptOptions"
|
||||
>
|
||||
@ -99,6 +100,7 @@
|
||||
<a-col span="12">
|
||||
<a-form-item label="员工角色" required field="roleId">
|
||||
<a-select
|
||||
placeholder="请选择员工角色"
|
||||
:options="roleOptions"
|
||||
v-model="form.roleId"
|
||||
></a-select>
|
||||
@ -111,7 +113,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { md5 } from 'js-md5'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -162,12 +163,11 @@ export default {
|
||||
deptOptions: [],
|
||||
form: {
|
||||
sex: '0',
|
||||
appId: '7XAp5LZk',
|
||||
phone: '',
|
||||
roleId: '',
|
||||
account: '',
|
||||
name: '',
|
||||
deptId: '',
|
||||
deptId: 0,
|
||||
pwd: '',
|
||||
orgId: '',
|
||||
post: ''
|
||||
@ -185,7 +185,7 @@ export default {
|
||||
this.orgPost = res.data
|
||||
}
|
||||
})
|
||||
this.$api.sys.roleList({ appId: '7XAp5LZk' }).then(res => {
|
||||
this.$api.sys.roleList({ appid: 'E191C42B' }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.roleOptions = res.data.map(e => {
|
||||
return { label: e.name, value: e.id }
|
||||
@ -207,9 +207,7 @@ export default {
|
||||
submit(done) {
|
||||
this.$refs.form.validate(errors => {
|
||||
if (errors === undefined) {
|
||||
const data = { ...this.form }
|
||||
data.pwd = md5(data.pwd)
|
||||
this.$api.base.userSave(data).then(res => {
|
||||
this.$api.base.userSave(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success(res.msg)
|
||||
this.$emit('ok')
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
{{ deptName }}
|
||||
</h2>
|
||||
<div class="grey-6 ml-10 bold">
|
||||
共有员工{{ this.page.total }}人
|
||||
共有员工{{ this.list.length }}人
|
||||
</div>
|
||||
</div>
|
||||
<add-user :dept-id="deptId" @ok="fetchList" />
|
||||
@ -62,7 +62,7 @@ export default {
|
||||
watch: {
|
||||
deptId: {
|
||||
handler(val) {
|
||||
this.fetchAll()
|
||||
this.fetchList()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
@ -76,7 +76,7 @@ export default {
|
||||
{ title: '姓名', dataIndex: 'name' },
|
||||
{ title: '性别', slotName: 'sex' },
|
||||
{ title: '状态', slotName: 'status' },
|
||||
{ title: '添加时间', dataIndex: 'createTime' },
|
||||
{ title: '添加时间', dataIndex: 'createdAt' },
|
||||
{ title: '操作', slotName: 'menu' }
|
||||
]
|
||||
}
|
||||
@ -88,11 +88,11 @@ export default {
|
||||
|
||||
fetchList() {
|
||||
this.$api.base
|
||||
.userList({ deptId: this.deptId, ...this.page })
|
||||
.userList({ deptId: this.deptId})
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data.records
|
||||
this.page.total = res.data.total
|
||||
this.list = res.data
|
||||
this.page.total = res.data.length
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -154,7 +154,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchInfo() {
|
||||
this.$api.user.info({ userId: this.userId }).then(res => {
|
||||
this.$api.user.info({ id: this.userId }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.user = res.data
|
||||
this.fetchData(res.data)
|
||||
@ -171,7 +171,7 @@ export default {
|
||||
if (tmp) {
|
||||
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)
|
||||
if (tmp) {
|
||||
info.roleName = tmp.name
|
||||
@ -189,7 +189,8 @@ export default {
|
||||
})
|
||||
},
|
||||
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) {
|
||||
this.$notification.success(res.msg)
|
||||
} else {
|
||||
@ -199,10 +200,10 @@ export default {
|
||||
},
|
||||
changeStatus() {
|
||||
const data = {
|
||||
userId: this.user.id,
|
||||
id: this.user.id,
|
||||
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) {
|
||||
this.$notification.success(res.msg)
|
||||
this.user.status = data.status
|
||||
|
||||
@ -6,10 +6,10 @@
|
||||
>{{ record.sex === '0' ? '男' : '女' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #policy="{ record }">
|
||||
<template #isPolicy="{ record }">
|
||||
<div>
|
||||
<a-tag :color="record.policy === '0' ? 'red' : 'green'"
|
||||
>{{ record.policy === '0' ? '否' : '是' }}
|
||||
<a-tag :color="record.isPolicy === false ? 'red' : 'green'"
|
||||
>{{ record.isPolicy === false ? '否' : '是' }}
|
||||
</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '关键决策人',
|
||||
slotName: 'policy'
|
||||
slotName: 'isPolicy'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
|
||||
@ -6,14 +6,12 @@
|
||||
<div class="flex flex-center flex-justify-start">
|
||||
<h1>{{ info.name }}</h1>
|
||||
<a-tag size="large" color="red" class="ml-20"
|
||||
>业务员:{{ info.saleMan.name }}
|
||||
</a-tag>
|
||||
>业务员:{{ info.user.name }}</a-tag>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-center flex-justify-start">
|
||||
<a-tag color="blue" v-if="city" size="large">
|
||||
{{ city.provinceName }}{{ city.cityName
|
||||
}}{{ city.name }}
|
||||
<a-tag color="blue" size="large">
|
||||
{{ info.region.province_name }}{{ info.region.city_name }}{{ info.region.name }}
|
||||
</a-tag>
|
||||
<div class="ml-10">
|
||||
<a-input
|
||||
@ -122,10 +120,9 @@ export default {
|
||||
this.tabIndex = res
|
||||
},
|
||||
fetchInfo() {
|
||||
this.$api.customer.info({ customerId: this.id }).then(res => {
|
||||
this.$api.customer.info({ id: this.id }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.info = res.data
|
||||
this.fetchCity(this.info.cityCode)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -65,18 +65,18 @@
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="是否关键决策人"
|
||||
field="policy"
|
||||
field="isPolicy"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择是否关键决策人' }
|
||||
]"
|
||||
>
|
||||
<a-select
|
||||
placeolder="请选择"
|
||||
v-model="form.policy"
|
||||
v-model="form.isPolicy"
|
||||
placeholder="请选择是否关键决策人"
|
||||
>
|
||||
<a-option label="否" value="0"></a-option>
|
||||
<a-option label="是" value="1"></a-option>
|
||||
<a-option label="否" :value="false"></a-option>
|
||||
<a-option label="是" :value="true"></a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" field="remark">
|
||||
@ -121,7 +121,7 @@ export default {
|
||||
phone: '',
|
||||
post: '',
|
||||
sex: '0',
|
||||
policy: '',
|
||||
isPolicy: false,
|
||||
remark: '',
|
||||
customerId: ''
|
||||
}
|
||||
|
||||
@ -10,10 +10,11 @@
|
||||
:columns="columns"
|
||||
:data="list"
|
||||
:pagination="page"
|
||||
@pageChange="pageChange"
|
||||
>
|
||||
<template #saleMan="{ record }">
|
||||
<template #region="{ record }">
|
||||
<div>
|
||||
{{ record.saleMan.name }}
|
||||
{{ record.region.province_name }}{{ record.region.city_name }}{{ record.region.name }}
|
||||
</div>
|
||||
</template>
|
||||
<template #menu="{ record }">
|
||||
@ -48,28 +49,27 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
title: '单位名称',
|
||||
dataIndex: 'name'
|
||||
dataIndex: 'name',
|
||||
width:200
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'typeName'
|
||||
dataIndex: 'typeName',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '地区',
|
||||
dataIndex: 'cityName'
|
||||
slotName: 'region',
|
||||
width:280
|
||||
},
|
||||
{
|
||||
title: '详细地址',
|
||||
dataIndex: 'address'
|
||||
},
|
||||
{
|
||||
title: '业务员',
|
||||
slotName: 'saleMan'
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
slotName: 'menu'
|
||||
slotName: 'menu',
|
||||
width:200
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -78,19 +78,23 @@ export default {
|
||||
this.fetchList()
|
||||
},
|
||||
methods: {
|
||||
pageChange(page){
|
||||
this.page.page = page
|
||||
this.fetchList()
|
||||
},
|
||||
fetchList() {
|
||||
this.$api.customer.page(this.page).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data.records.map(e => {
|
||||
e.typeName = '业主单位'
|
||||
if (e.type === '1') {
|
||||
if (e.type === 1) {
|
||||
e.typeName = '实施单位'
|
||||
} else if (e.type === '2') {
|
||||
} else if (e.type === 2) {
|
||||
e.typeName = '其他'
|
||||
}
|
||||
return e
|
||||
})
|
||||
this.page.tatal = res.data.total
|
||||
this.page.total = res.data.total
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<div class="container" style="flex: 3" v-if="dept">
|
||||
<user
|
||||
:dept-name="subDept ? subDept.name : dept.name"
|
||||
:dept-id="subDept ? subDept.id : null"
|
||||
:dept-id="subDept ? subDept.id : ''"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -53,7 +53,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dept: null,
|
||||
dept: "",
|
||||
subDept: null,
|
||||
list: []
|
||||
}
|
||||
@ -64,15 +64,15 @@ export default {
|
||||
methods: {
|
||||
fetchDeptInfo() {
|
||||
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) {
|
||||
this.dept = res.data
|
||||
this.fetchList(this.dept.id)
|
||||
this.fetchList()
|
||||
}
|
||||
})
|
||||
},
|
||||
fetchList(pid) {
|
||||
this.$api.base.list({ pid: pid }).then(res => {
|
||||
fetchList() {
|
||||
this.$api.base.list({ pid: this.dept.id }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data
|
||||
//写入缓存, 用于添加用户的时候选
|
||||
@ -84,7 +84,6 @@ export default {
|
||||
},
|
||||
checkDept(item) {
|
||||
this.subDept = item
|
||||
console.log(this.subDept)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ layout: 'empty',
|
||||
</route>
|
||||
|
||||
<script>
|
||||
|
||||
import {md5} from "js-md5";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -78,6 +78,7 @@ export default {
|
||||
login() {
|
||||
if (this.form.account && this.form.pwd) {
|
||||
const data = { ...this.form }
|
||||
console.log(md5(this.form.pwd))
|
||||
this.$api.user.login(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
const user = res.data
|
||||
|
||||
@ -14,12 +14,12 @@
|
||||
<a-form ref="form" :model="form">
|
||||
<a-form-item
|
||||
label="文件夹名称"
|
||||
field="fileName"
|
||||
field="name"
|
||||
:rules="[{ required: true, message: '请输入文件夹名称' }]"
|
||||
>
|
||||
<a-input
|
||||
placeholder="请输入文件夹名称"
|
||||
v-model="form.fileName"
|
||||
v-model="form.name"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@ -35,6 +35,16 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
queryId: {
|
||||
required: true,
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type:{
|
||||
required: true,
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
pid: {
|
||||
required: true,
|
||||
type: String,
|
||||
@ -45,9 +55,11 @@ export default {
|
||||
return {
|
||||
show: false,
|
||||
form: {
|
||||
fileName: '',
|
||||
name: '',
|
||||
pid: '',
|
||||
type: '1',
|
||||
type: 0,
|
||||
isFolder:1,
|
||||
queryId: '',
|
||||
projectId: ''
|
||||
}
|
||||
}
|
||||
@ -66,11 +78,15 @@ export default {
|
||||
if (errors === undefined) {
|
||||
this.form.pid = this.pid
|
||||
this.form.projectId = this.projectId
|
||||
this.form.type = this.type
|
||||
this.form.queryId = this.queryId
|
||||
this.$api.projectFile.submit(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
done()
|
||||
this.$emit('ok')
|
||||
this.$notificaiton.success(res.msg)
|
||||
} else{
|
||||
done(false)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
72
src/views/project/components/attach/file-rename.vue
Normal file
72
src/views/project/components/attach/file-rename.vue
Normal 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>
|
||||
@ -31,9 +31,11 @@
|
||||
</template>
|
||||
<template #default> 上一级</template>
|
||||
</a-button>
|
||||
<upload @ok="upload" />
|
||||
<upload @ok="upload" v-if="pid !== '0'" />
|
||||
<add-folder
|
||||
:project-id="this.projectId"
|
||||
:query-id="queryId"
|
||||
:type="type"
|
||||
:pid="this.pid"
|
||||
@ok="fetchList"
|
||||
/>
|
||||
@ -48,10 +50,10 @@
|
||||
size="small"
|
||||
@page-change="pageChange"
|
||||
>
|
||||
<template #name="{ record }">
|
||||
<template #fileName="{ record }">
|
||||
<div class="flex flex-center flex-justify-start">
|
||||
<img
|
||||
v-if="record.type === 1"
|
||||
v-if="record.isFolder === 1"
|
||||
src="https://res.wutongshucloud.com/res/2024/12/04/202412041635423.svg"
|
||||
style="width: 30px; height: 30px"
|
||||
/>
|
||||
@ -63,20 +65,28 @@
|
||||
<div class="ml-10">{{ record.name }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #user="{record}">
|
||||
<div>
|
||||
{{record.user.name}}
|
||||
</div>
|
||||
</template>
|
||||
<template #menu="{ record }">
|
||||
<div class="flex flex-center">
|
||||
<preview
|
||||
v-if="record.type === 0"
|
||||
:file-id="record.fileId"
|
||||
/>
|
||||
|
||||
<a-button
|
||||
v-else
|
||||
v-if="record.isFolder === 1"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="fetchFolder(record.id)"
|
||||
>查看
|
||||
</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>
|
||||
@ -89,19 +99,38 @@
|
||||
<script>
|
||||
import upload from '@/components/upload/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 {
|
||||
props: {
|
||||
projectId: {
|
||||
required: true,
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
queryId:{
|
||||
required: true,
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type :{
|
||||
required:true,
|
||||
type:Number,
|
||||
default: 0
|
||||
},
|
||||
folder:{
|
||||
required:true,
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
|
||||
},
|
||||
components: {
|
||||
upload,
|
||||
preview,
|
||||
addFolder
|
||||
addFolder,
|
||||
fileRename
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -118,15 +147,15 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
slotName: 'name'
|
||||
slotName: 'fileName'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime'
|
||||
dataIndex: 'createdAt'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
dataIndex: 'createUserName'
|
||||
slotName: 'user'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@ -160,17 +189,19 @@ export default {
|
||||
this.fetchList()
|
||||
},
|
||||
pageChange(page) {
|
||||
this.page.page = page - 1
|
||||
this.page.page = page
|
||||
this.fetchList()
|
||||
},
|
||||
fetchInit() {
|
||||
this.$api.sys.dict({ code: 'project_folder_init' }).then(res => {
|
||||
this.$api.sys.dict({ code: this.folder }).then(res => {
|
||||
if (res.code === 200) {
|
||||
var folder = res.data.map(e => e.label)
|
||||
this.$api.projectFile
|
||||
.initFolder({
|
||||
projectId: this.projectId,
|
||||
folders: folder.join(',')
|
||||
folders: folder.join(','),
|
||||
type: this.type,
|
||||
queryId: this.queryId
|
||||
})
|
||||
.then(() => {
|
||||
this.fetchList()
|
||||
@ -184,6 +215,8 @@ export default {
|
||||
name: this.name,
|
||||
projectId: this.projectId,
|
||||
pid: this.pid,
|
||||
type: this.type,
|
||||
queryId: this.queryId,
|
||||
...this.page
|
||||
}
|
||||
this.$api.projectFile.page(data).then(res => {
|
||||
@ -194,7 +227,7 @@ export default {
|
||||
})
|
||||
},
|
||||
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 => {
|
||||
if (res.code === 200) {
|
||||
this.fetchList()
|
||||
@ -67,7 +67,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchCustomerByCity(code) {
|
||||
this.$api.project.findByCity({ code: code }).then(res => {
|
||||
this.$api.customer.findList({ code: code }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.customerList = res.data
|
||||
this.$emit('ok', this.customerList[0])
|
||||
|
||||
@ -131,7 +131,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchCity() {
|
||||
this.$api.base.areaTree().then(res => {
|
||||
this.$api.base.areaTree({code:"53"}).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.options = res.data
|
||||
}
|
||||
@ -145,7 +145,7 @@ export default {
|
||||
})
|
||||
},
|
||||
fetchCustomer(res) {
|
||||
this.$api.customer.all({ name: res }).then(res => {
|
||||
this.$api.customer.findList({ name: res }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.customerList = res.data.map(e => {
|
||||
return { label: e.name, value: e.id }
|
||||
|
||||
@ -14,20 +14,6 @@
|
||||
>
|
||||
<a-form auto-label-width :model="form" ref="form">
|
||||
<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-form-item
|
||||
label="优先级"
|
||||
@ -127,13 +113,11 @@ export default {
|
||||
show: false,
|
||||
form: {
|
||||
projectId: '',
|
||||
name: '',
|
||||
level: '2',
|
||||
time: '',
|
||||
tag: '',
|
||||
executors: '',
|
||||
executors: null,
|
||||
remark: '',
|
||||
files: null
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -174,7 +158,8 @@ export default {
|
||||
const data = { ...this.form }
|
||||
data.startDate = data.time[0]
|
||||
data.endDate = data.time[1]
|
||||
data.executorIds = data.executors.join(',')
|
||||
data.executorIds = data.executors
|
||||
delete data.executors
|
||||
this.$api.task.submit(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success(res.msg)
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<task :project-id="info.id" ref="task" />
|
||||
</div>
|
||||
<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 v-else-if="tabIndex === 4">
|
||||
<base-info :info="info" />
|
||||
@ -90,47 +90,42 @@
|
||||
<script>
|
||||
import task from '@/views/project/index/components/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 attach from "@/views/project/components/attach/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
task,
|
||||
editTask,
|
||||
files,
|
||||
attach,
|
||||
baseInfo
|
||||
},
|
||||
props: {
|
||||
info: {
|
||||
id: {
|
||||
required: true,
|
||||
type: Object,
|
||||
default: null
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.fetchInfo()
|
||||
this.tabIndex = 0
|
||||
if (this.$refs.task) {
|
||||
this.$refs.task.fetchList()
|
||||
}
|
||||
} else {
|
||||
this.tabIndex = 0
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
info: {
|
||||
handler(val) {
|
||||
this.name = val.name
|
||||
this.fetchData()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
info:null,
|
||||
name: '',
|
||||
edit: false,
|
||||
show: false,
|
||||
@ -165,6 +160,15 @@ export default {
|
||||
}
|
||||
},
|
||||
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() {
|
||||
this.data = this.data.map(item => {
|
||||
const res = {
|
||||
@ -174,7 +178,7 @@ export default {
|
||||
span: item.span ?? 1
|
||||
}
|
||||
if (item.prop === 'createUser') {
|
||||
res.value = this.info.createUser.name
|
||||
res.value = this.info.user.name
|
||||
}
|
||||
if (item.prop === 'customer') {
|
||||
res.value = this.info.customer
|
||||
@ -182,8 +186,8 @@ export default {
|
||||
: ''
|
||||
}
|
||||
if (item.prop === 'cityName') {
|
||||
res.value = this.info.customer
|
||||
? this.info.customer.cityName
|
||||
res.value = this.info.region
|
||||
? this.info.region.province_name + this.info.region.city_name + this.info.region.name
|
||||
: ''
|
||||
}
|
||||
if (item.prop === 'industry') {
|
||||
@ -198,7 +202,7 @@ export default {
|
||||
this.tabIndex = Number.parseInt(index)
|
||||
},
|
||||
updateName() {
|
||||
const data = { id: this.info.id, name: this.name }
|
||||
const data = { id: this.id, name: this.name }
|
||||
this.edit = false
|
||||
this.$api.project.submit(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
|
||||
@ -1,16 +1,31 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-table :columns="columns" :data="list">
|
||||
<template #createUser="{ record }">
|
||||
<template #level="{ record }">
|
||||
<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>
|
||||
</template>
|
||||
<template #status="{ record }">
|
||||
<div>
|
||||
<a-tag :color="record.status.remark"
|
||||
>{{ record.status.label }}
|
||||
</a-tag>
|
||||
{{ record.status.label }}
|
||||
</div>
|
||||
</template>
|
||||
<template #tag="{ record }">
|
||||
@ -20,7 +35,7 @@
|
||||
</template>
|
||||
<template #menu="{ record }">
|
||||
<div>
|
||||
<task-info :id="record.id" />
|
||||
<task-info :id="record.id" :info="record"/>
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -28,7 +43,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import taskInfo from '@/views/project/index/components/task-info.vue'
|
||||
import taskInfo from '@/views/project/task/task-info.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -49,12 +64,12 @@ export default {
|
||||
level: [],
|
||||
columns: [
|
||||
{
|
||||
title: '任务标题',
|
||||
dataIndex: 'name'
|
||||
title: '描述',
|
||||
dataIndex: 'remark'
|
||||
},
|
||||
{
|
||||
title: '优先级',
|
||||
dataIndex: 'levelName'
|
||||
slotName: 'level'
|
||||
},
|
||||
{
|
||||
title: '任务标签',
|
||||
@ -66,11 +81,15 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime'
|
||||
dataIndex: 'createdAt'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
slotName: 'createUser'
|
||||
slotName: 'user'
|
||||
},
|
||||
{
|
||||
title: '执行人',
|
||||
slotName: 'executors'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@ -80,55 +99,16 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchDict()
|
||||
this.fetchList()
|
||||
},
|
||||
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() {
|
||||
const data = { projectId: this.projectId, ...this.page }
|
||||
this.$api.task.page(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data.records.map(e => {
|
||||
var item = { ...e }
|
||||
item.status = this.dict.find(
|
||||
e => e.value === item.status.toString()
|
||||
)
|
||||
item.levelName = this.level.find(
|
||||
e => e.value === item.level
|
||||
).label
|
||||
return item
|
||||
e.status.remark = JSON.parse(e.status.remark)
|
||||
return e
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@ -6,23 +6,28 @@
|
||||
<city-tree @ok="changeCustomer" />
|
||||
</div>
|
||||
<div class="container full-width">
|
||||
<div v-if="city">
|
||||
<div class="flex flex-center flex-justify-start full-width">
|
||||
<div class="flex flex-center flex-justify-between 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>
|
||||
</div>
|
||||
<div
|
||||
class="mt-10 flex flex-center flex-justify-start full-width"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="mt-10 flex flex-center flex-justify-start full-width"
|
||||
>
|
||||
<a-tag color="blue"
|
||||
>共计项目 {{ city.projectCount }} 个,待办任务
|
||||
{{ city.taskCount }} 个
|
||||
>共计项目 {{ city.projectCount }} 个,待办任务
|
||||
{{ city.taskCount }} 个
|
||||
</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="flex flex-center flex-justify-start full-width">
|
||||
<h2>共计项目{{ page.total }} 个</h2>
|
||||
|
||||
</div>
|
||||
<div class="flex flex-center flex-justify-between">
|
||||
<div>
|
||||
<edit-project @ok="fetchList"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
@ -33,17 +38,12 @@
|
||||
>
|
||||
<template #user="{ record }">
|
||||
<div>
|
||||
{{ record.createUser.name }}
|
||||
{{ record.user.name }}
|
||||
</div>
|
||||
</template>
|
||||
<template #menu="{ record }">
|
||||
<div>
|
||||
<more-info :info="record" />
|
||||
</div>
|
||||
</template>
|
||||
<template #customer="{ record }">
|
||||
<div>
|
||||
{{ record.customer ? record.customer.name : '' }}
|
||||
<more-info :id="record.id" />
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -62,12 +62,14 @@ path: '/project/index',
|
||||
import navbar from '@/components/navbar/index.vue'
|
||||
import moreInfo from './components/more-info.vue'
|
||||
import cityTree from '@/views/project/index/components/city-tree.vue'
|
||||
import editProject from "@/views/project/index/components/edit-project.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
cityTree,
|
||||
navbar,
|
||||
moreInfo
|
||||
moreInfo,
|
||||
editProject
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -91,7 +93,7 @@ export default {
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime'
|
||||
dataIndex: 'createdAt'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
|
||||
@ -8,16 +8,16 @@
|
||||
:footer="false"
|
||||
>
|
||||
<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="font-24 bold">{{ task.name }}</div>
|
||||
<div class="ml-20">
|
||||
<h2 >{{ task.name }}</h2>
|
||||
<div class="mt-20">
|
||||
<a-dropdown @select="changeStatus">
|
||||
<a-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:style="
|
||||
`background-color:` + task.status.remark
|
||||
`background-color:` + task.status.remark.color
|
||||
"
|
||||
>{{ task.status.label }}
|
||||
</a-button>
|
||||
@ -35,86 +35,29 @@
|
||||
<a-divider />
|
||||
<div class="flex flex-align-start flex-justify-between">
|
||||
<div style="flex: 3">
|
||||
<div>
|
||||
<div
|
||||
style="white-space: pre"
|
||||
class="grey-6-bg padding"
|
||||
>
|
||||
{{ 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
|
||||
style="white-space: pre;min-height: 180px; border-radius: 8px"
|
||||
class="grey-6-bg padding "
|
||||
>
|
||||
{{ task.remark }}
|
||||
</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 style="flex: 1" class="ml-20">
|
||||
<a-card>
|
||||
<div class="font-18 bold">基础信息</div>
|
||||
<a-divider />
|
||||
<a-form auto-label-width>
|
||||
<a-form-item label="任务标题:">
|
||||
<div class="black bold">
|
||||
{{ task.name }}
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="优先级:">
|
||||
<a-tag class="black bold" color="green"
|
||||
>中
|
||||
@ -122,7 +65,7 @@
|
||||
</a-form-item>
|
||||
<a-form-item label="创建人:">
|
||||
<div class="black bold">
|
||||
{{ task.createUser.name }}
|
||||
{{ task.user.name }}
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="任务标签:">
|
||||
@ -159,23 +102,34 @@
|
||||
<script>
|
||||
import filePicker from '@/views/project/components/file-picker/index.vue'
|
||||
import preview from '@/components/preview/index.vue'
|
||||
import attach from "@/views/project/components/attach/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
filePicker,
|
||||
preview
|
||||
preview,
|
||||
attach
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
info:{
|
||||
required:true,
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(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,
|
||||
fileList: [],
|
||||
dict: [],
|
||||
log: []
|
||||
log: [],
|
||||
tabIndex:0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchInfo() {
|
||||
this.$api.task.info({ id: this.id }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.task = res.data
|
||||
this.task.status = this.dict.find(
|
||||
sub => sub.value === this.task.status + ''
|
||||
)
|
||||
this.fileList = this.task.files
|
||||
this.fetchLog()
|
||||
}
|
||||
})
|
||||
},
|
||||
tabChange(index){
|
||||
console.log(index)
|
||||
this.tabIndex = Number.parseInt(index )
|
||||
},
|
||||
fetchDict() {
|
||||
this.$api.sys.dict({ code: 'project_task_status' }).then(res => {
|
||||
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>
|
||||
@ -3,7 +3,9 @@
|
||||
<navbar title="应用管理"></navbar>
|
||||
<div class="container">
|
||||
<div class="flex flex-center flex-justify-between">
|
||||
<a-button type="text">新增</a-button>
|
||||
<div>
|
||||
<add-client @ok="fetchList"/>
|
||||
</div>
|
||||
<div>
|
||||
<a-button type="outline" shape="circle" @click="fetchList">
|
||||
<icon-refresh />
|
||||
@ -13,7 +15,7 @@
|
||||
<a-table :columns="columns" :data="list" size="small" class="mt-20">
|
||||
<template #menu="{ record }">
|
||||
<div>
|
||||
<a-button type="text" size="small">查看</a-button>
|
||||
<edit-client :id="record.id" @ok="fetchList"/>
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -23,10 +25,15 @@
|
||||
|
||||
<script>
|
||||
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 {
|
||||
components: {
|
||||
navbar
|
||||
navbar,
|
||||
addClient,
|
||||
editClient
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -49,7 +56,7 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime'
|
||||
dataIndex: 'createdAt'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@ -67,7 +74,6 @@ export default {
|
||||
console.log(res)
|
||||
if (res.code === 200) {
|
||||
this.list = res.data
|
||||
this.$notification.success(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
51
src/views/system/components/add-client.vue
Normal file
51
src/views/system/components/add-client.vue
Normal 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>
|
||||
@ -52,7 +52,7 @@
|
||||
<a-form-item label="code" field="code" required>
|
||||
<a-input
|
||||
v-model="form.code"
|
||||
:disabled="form.pid !== undefined"
|
||||
:disabled="form.pid !== '0'"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="值" field="value">
|
||||
@ -108,7 +108,8 @@ export default {
|
||||
label: '',
|
||||
code: '',
|
||||
remark: '',
|
||||
sort: ''
|
||||
sort: '',
|
||||
pid:'0'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -118,11 +119,8 @@ export default {
|
||||
if (errors === undefined) {
|
||||
this.$api.sys.dictSave(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success(res.msg)
|
||||
this.form = res.data
|
||||
setTimeout(() => {
|
||||
this.$emit('ok')
|
||||
}, 500)
|
||||
this.$emit('ok')
|
||||
done()
|
||||
} else {
|
||||
this.$notification.error(res.msg)
|
||||
|
||||
@ -20,12 +20,6 @@
|
||||
v-model="form.code"
|
||||
></a-input>
|
||||
</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-input
|
||||
placeholder="请输入备注"
|
||||
@ -60,7 +54,6 @@ export default {
|
||||
appId: '',
|
||||
name: '',
|
||||
code: '',
|
||||
sort: '',
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
|
||||
93
src/views/system/components/edit-client.vue
Normal file
93
src/views/system/components/edit-client.vue
Normal 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>
|
||||
@ -55,8 +55,8 @@
|
||||
:required="[{ message: '请选择类型', required: true }]"
|
||||
>
|
||||
<a-radio-group v-model="form.type">
|
||||
<a-radio :value="1">菜单</a-radio>
|
||||
<a-radio :value="2">按钮</a-radio>
|
||||
<a-radio :value="0">菜单</a-radio>
|
||||
<a-radio :value="1">按钮</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
@ -95,10 +95,10 @@ export default {
|
||||
if (this.type === 'edit') {
|
||||
this.form = val
|
||||
} else if (this.type === 'addSub') {
|
||||
this.form.appId = val.appId
|
||||
this.form.appid = val.appid
|
||||
this.form.pid = val.id
|
||||
} else {
|
||||
this.form.appId = val.appId
|
||||
this.form.appid = val.appid
|
||||
this.form.pid = val.pid
|
||||
}
|
||||
}
|
||||
@ -110,13 +110,14 @@ export default {
|
||||
return {
|
||||
show: false,
|
||||
form: {
|
||||
appId: '',
|
||||
appid: '',
|
||||
id: '',
|
||||
name: '',
|
||||
value: '',
|
||||
sort: '',
|
||||
type: 1,
|
||||
pid: '0'
|
||||
type: 0,
|
||||
pid: '',
|
||||
remark:''
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -124,7 +125,6 @@ export default {
|
||||
ok(done) {
|
||||
this.$refs.form.validate(errors => {
|
||||
if (errors === undefined) {
|
||||
console.log(this.form)
|
||||
this.$api.sys.menuSave(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$notification.success(res.msg)
|
||||
|
||||
@ -51,7 +51,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchMenu() {
|
||||
this.$api.sys.menuTree({ appId: this.appId }).then(res => {
|
||||
this.$api.sys.menuTree({ appid: this.appId }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data.map(e => {
|
||||
e.key = e.id
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<div class="flex flex-center flex-justify-between">
|
||||
<div class="flex flex-center">
|
||||
<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>
|
||||
<add-dict :info="dict" type="add" @ok="fetchDetail" />
|
||||
</div>
|
||||
@ -63,7 +63,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: { page: 0, size: 10, total: 0 },
|
||||
page: { page: 1, size: 10, total: 0 },
|
||||
list: [],
|
||||
list2: [],
|
||||
|
||||
@ -84,7 +84,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
pageChange(page) {
|
||||
this.page.page = page - 1
|
||||
this.page.page = page
|
||||
this.fetchList()
|
||||
},
|
||||
fetchList() {
|
||||
@ -110,7 +110,7 @@ export default {
|
||||
this.fetchDetail()
|
||||
},
|
||||
remove(id) {
|
||||
this.$api.sys.dictRemove({ ids: id }).then(res => {
|
||||
this.$api.sys.dictRemove({ id: id }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.fetchList()
|
||||
this.$notification.success(res.msg)
|
||||
|
||||
@ -7,9 +7,10 @@
|
||||
style="width: 360px"
|
||||
:options="options"
|
||||
:model-value="client"
|
||||
@change="change"
|
||||
></a-select>
|
||||
<edit-menu
|
||||
:info="{ appId: client, pid: '0' }"
|
||||
:info="{ appid: client, pid: '0' }"
|
||||
type="add"
|
||||
@ok="fetchClientList"
|
||||
/>
|
||||
@ -18,10 +19,10 @@
|
||||
<a-table :columns="columns" :data="list">
|
||||
<template #type="{ record }">
|
||||
<div>
|
||||
<a-tag color="blue" v-if="record.type === 1"
|
||||
<a-tag color="blue" v-if="record.type === 0"
|
||||
>菜单
|
||||
</a-tag>
|
||||
<a-tag color="red" v-if="record.type === 2"
|
||||
<a-tag color="red" v-if="record.type === 1"
|
||||
>按钮
|
||||
</a-tag>
|
||||
</div>
|
||||
@ -79,6 +80,7 @@ export default {
|
||||
client: '',
|
||||
list: [],
|
||||
options: [],
|
||||
index:0,
|
||||
columns: [
|
||||
{ title: '名称', dataIndex: 'name' },
|
||||
{ title: '路径', dataIndex: 'value' },
|
||||
@ -92,6 +94,11 @@ export default {
|
||||
this.fetchClientList()
|
||||
},
|
||||
methods: {
|
||||
change(e){
|
||||
this.client = e
|
||||
this.index = this.options.findIndex(sub => sub.value === e)
|
||||
this.fetchMenus()
|
||||
},
|
||||
fetchClientList() {
|
||||
this.$api.sys.clientList().then(res => {
|
||||
if (res.code === 200) {
|
||||
@ -100,7 +107,7 @@ export default {
|
||||
e.value = e.appid
|
||||
return e
|
||||
})
|
||||
this.client = this.options[0].appid
|
||||
this.client = this.options[this.index].appid
|
||||
this.fetchMenus()
|
||||
}
|
||||
})
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
:options="options"
|
||||
:model-value="client"
|
||||
style="width: 360px"
|
||||
@change="change"
|
||||
></a-select>
|
||||
<add-role :app-id="client" @ok="fetchClientList" />
|
||||
</div>
|
||||
@ -43,11 +44,11 @@ export default {
|
||||
return {
|
||||
client: '',
|
||||
options: [],
|
||||
index:0,
|
||||
list: [],
|
||||
columns: [
|
||||
{ title: '名称', dataIndex: 'name' },
|
||||
{ title: 'code', dataIndex: 'code' },
|
||||
{ title: '排序', dataIndex: 'sort' },
|
||||
{ title: '备注', dataIndex: 'remark' },
|
||||
{ title: '操作', slotName: 'menu' }
|
||||
]
|
||||
@ -57,21 +58,26 @@ export default {
|
||||
this.fetchClientList()
|
||||
},
|
||||
methods: {
|
||||
change(e){
|
||||
this.client = e
|
||||
this.index = this.options.findIndex(sub => sub.value === e)
|
||||
this.fetchClientList()
|
||||
},
|
||||
fetchClientList() {
|
||||
this.$api.sys.clientList().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.options = res.data.map(e => {
|
||||
e.label = e.name
|
||||
e.value = e.appId
|
||||
e.value = e.appid
|
||||
return e
|
||||
})
|
||||
this.client = this.options[0].appId
|
||||
this.client = this.options[this.index].appid
|
||||
this.fetchRole()
|
||||
}
|
||||
})
|
||||
},
|
||||
fetchRole() {
|
||||
this.$api.sys.roleList({ appId: this.client }).then(res => {
|
||||
this.$api.sys.roleList({ appid: this.client }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = res.data
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user