diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index eaa8220c..35dd29e4 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -13,8 +13,8 @@ "NODE_ENV": "development" }, "args": [ - "-p 14000", - "-f http://localhost:14000", + "-p 4000", + "-f http://localhost:4000", "-g postgres://postgres:123@10.8.30.32:5432/highways4good", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", diff --git a/api/app/lib/controllers/data/project.js b/api/app/lib/controllers/data/project.js index 7fb0b2a6..b1dec293 100644 --- a/api/app/lib/controllers/data/project.js +++ b/api/app/lib/controllers/data/project.js @@ -3,14 +3,24 @@ async function projectGet (ctx) { try { const models = ctx.fs.dc.models; - const { type } = ctx.query; + const { type, entryName } = ctx.query; - const projectRes = await models.Project.findAll({ + let findOption = { where: { - type + }, order: [['id', 'DESC']] - }) + } + if (type) { + findOption.where.type = type + } + if (entryName) { + findOption.where.entryName = { + $like: `%${entryName}%` + } + } + + const projectRes = await models.Project.findAll(findOption) ctx.status = 200; ctx.body = projectRes diff --git a/api/app/lib/controllers/file/index.js b/api/app/lib/controllers/file/index.js new file mode 100644 index 00000000..8870da3e --- /dev/null +++ b/api/app/lib/controllers/file/index.js @@ -0,0 +1,237 @@ +'use strict'; + +const request = require('superagent'); +const moment = require('moment'); + +async function createProjectDir(ctx, next) { + let error = { message: '新增项目目录失败' }, rs = null; + const { roadName } = ctx.query; + + try { + const models = ctx.fs.dc.models; + + rs = await models.FileRoad.create({ + roadName + }) + error = null; + } catch (err) { + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = { message: '新增项目目录成功!', result: rs }; + } +} + +async function getFileDirs(ctx, next) { + let error = { message: '查询项目目录失败' }, rslt = null; + + try { + const models = ctx.fs.dc.models; + + rslt = await models.FileRoad.findAll({ + // include: [{ + // model: models.FileType + // }] + }) + error = null; + } catch (err) { + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = rslt; + } +} + +async function delFileDir(ctx, next) { + let error = { message: '文件夹删除失败' }; + let rslt = [], fileDirIds = []; + + try { + const { id } = ctx.query, // type == parent / child + models = ctx.fs.dc.models; + const transaction = await ctx.fs.dc.orm.transaction(); + + await models.FileRoad.destroy({ where: { rId: id }, transaction }) + await models.Files.destroy({ where: { roadId: id }, transaction }) + + await transaction.commit(); + + error = null; + } catch (err) { + await transaction.rollback(); + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = { message: '文件夹删除成功' }; + } +} + +async function uploadFile(ctx, next) { + let error = { message: '文件上传失败' }, rslt = null; + const { typeId, userId, userName, fileSize, fileName, fileUrl, fileExt, roadId } = ctx.request.body + try { + const models = ctx.fs.dc.models; + + rslt = await models.Files.create({ + fId: typeId, + uploaderId: userId, + roadId, + createDate: moment().format('YYYY-MM-DD HH:mm:ss'), + fileSize, + fileName, + fileUrl, + fileExt, + uploaderName: userName, + isDelete: false + }) + error = null; + } catch (err) { + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = { message: '文件上传成功', rslt }; + } +} + +async function deleteFile(ctx, next) { + let error = { message: '文件删除失败' }, rslt = null; + const { id } = ctx.query; + try { + const models = ctx.fs.dc.models; + + rslt = await models.Files.update({ + isDelete: true + }, { + where: { id: id } + }) + error = null; + } catch (err) { + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = { message: '文件删除成功', rslt }; + } +} + +async function getFileList(ctx, next) { + let error = { message: '文件上传失败' }, rslt = { list: [], counter: 0, type: '' }; + const { fId, limit, offset, searchTxt, roadId } = ctx.query; + let limit_ = limit, offset_ = offset; + if (limit == null || limit < 0) { + limit_ = 10; + } + if (offset == null || offset < 0) { + offset_ = 0; + } + try { + const models = ctx.fs.dc.models; + let queryOptions = { isDelete: false } + if (searchTxt && searchTxt.trim() != '') { + queryOptions.fileName = { $like: `%${searchTxt}%` } + } + if (fId) { + queryOptions.fId = fId + } + + if (roadId) { + queryOptions.roadId = roadId + } + + rslt.type = await models.FileType.findOne({ + where: { fId } + }) + + rslt.list = await models.Files.findAll({ + where: queryOptions, + offset: offset_, + limit: limit_, + order: [ + ['id', 'DESC'] + ] + }) + rslt.counter = await models.Files.count({ + where: queryOptions + }) + error = null; + } catch (err) { + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = rslt; + } +} + +function updateStructDir(opts) { + + return async function (ctx, next) { + let error = { message: '文件夹名称更新失败' }; + const models = ctx.fs.dc.models; + const { id, name } = ctx.query; + try { + await models.FileRoad.update({ roadName: name }, { + where: { + id: id + }, + }) + + error = null; + } catch (err) { + ctx.status = 500; + ctx.body = { detail: err, ...error }; + } + + if (error) { + ctx.status = 400; + ctx.body = { ...error }; + } else { + ctx.status = 200; + ctx.body = { message: '文件夹名称更新成功' }; + } + } +} + +module.exports = { + uploadFile, + deleteFile, + getFileList, + createProjectDir, + delFileDir, + getFileDirs, + updateStructDir, +} \ No newline at end of file diff --git a/api/app/lib/controllers/overview/conserve.js b/api/app/lib/controllers/overview/conserve.js index 506c8a61..3e98400b 100644 --- a/api/app/lib/controllers/overview/conserve.js +++ b/api/app/lib/controllers/overview/conserve.js @@ -18,7 +18,9 @@ async function statistic (ctx) { } if (projectType) { + findOption.where.projectType = projectType; + } const reportRes = await await models.Report.findAll(findOption) diff --git a/api/app/lib/index.js b/api/app/lib/index.js index ba30ac57..c4715290 100644 --- a/api/app/lib/index.js +++ b/api/app/lib/index.js @@ -26,7 +26,7 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq require(`./models/${filename}`)(dc) }); - const { User, Department, Report } = dc.models; + const { User, Department, Report, FileType, Road, Files, FileRoad } = dc.models; // 定义外键 User.belongsTo(Department, { foreignKey: 'departmentId', targetKey: 'id' }); Department.hasMany(User, { foreignKey: 'departmentId', sourceKey: 'id' }); @@ -34,4 +34,10 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq // 定义外键 Report.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); User.hasMany(Report, { foreignKey: 'userId', sourceKey: 'id' }); + + Files.belongsTo(FileType, { foreignKey: 'fId', targetKey: 'fId' }); + FileType.hasMany(Files, { foreignKey: 'fId', targetKey: 'fId' }); + + // Files.belongsTo(Road, { foreignKey: 'roadId', targetKey: 'id' }); + // Road.hasMany(Files, { foreignKey: 'roadId', targetKey: 'id' }); }; diff --git a/api/app/lib/models/file-road.js b/api/app/lib/models/file-road.js new file mode 100644 index 00000000..b7f35592 --- /dev/null +++ b/api/app/lib/models/file-road.js @@ -0,0 +1,31 @@ +'use strict'; + +module.exports = function (dc) { + const FileRoad = dc.orm.define( + 'fileRoad', + { + rId: { + field: 'id', + type: dc.ORM.INTEGER, + primaryKey: true, + autoIncrement: true, + allowNull: false + }, + roadName: { + field: 'road_name', + type: dc.ORM.STRING, + }, + originalData: { + field: 'original_data', + type: dc.ORM.STRING, + }, + }, + { + tableName: 'file_road' + } + ); + + dc.models.FileRoad = FileRoad; + + return FileRoad; +}; diff --git a/api/app/lib/models/file-type.js b/api/app/lib/models/file-type.js new file mode 100644 index 00000000..2f8e7dbd --- /dev/null +++ b/api/app/lib/models/file-type.js @@ -0,0 +1,32 @@ +'use strict'; + +module.exports = function (dc) { + const FileType = dc.orm.define( + 'fileType', + { + fId: { + field: 'id', + type: dc.ORM.INTEGER, + primaryKey: true, + autoIncrement: true, + allowNull: false + }, + fileType: { + field: 'file_type', + type: dc.ORM.STRING, + }, + rId: { + field: 'file_road', + type: dc.ORM.INTEGER, + allowNull: false + }, + }, + { + tableName: 'file_type' + } + ); + + dc.models.FileType = FileType; + + return FileType; +}; diff --git a/api/app/lib/models/files.js b/api/app/lib/models/files.js new file mode 100644 index 00000000..387fd681 --- /dev/null +++ b/api/app/lib/models/files.js @@ -0,0 +1,73 @@ +'use strict'; + +module.exports = function (dc) { + const Files = dc.orm.define( + 'files', + { + id: { + field: 'id', + type: dc.ORM.INTEGER, + primaryKey: true, + autoIncrement: true, + allowNull: false + }, + fId: { + field: 'file_type', + type: dc.ORM.INTEGER + }, + roadId: { + field: 'road_id', + type: dc.ORM.INTEGER + }, + uploaderId: { + field: 'uploader_id', + type: dc.ORM.INTEGER + }, + uploaderName: { + field: 'uploader_name', + type: dc.ORM.INTEGER + }, + startDate: { + field: 'start_date', + type: dc.ORM.DATE, + }, + endDate: { + field: 'end_date', + type: dc.ORM.DATE, + }, + createDate: { + field: 'create_date', + type: dc.ORM.DATE, + }, + fileSize: { + field: 'file_size', + type: dc.ORM.INTEGER, + }, + fileName: { + field: 'file_name', + type: dc.ORM.STRING, + }, + + fileUrl: { + field: 'file_url', + type: dc.ORM.STRING, + }, + fileExt: { + field: 'file_ext', + type: dc.ORM.STRING, + }, + isDelete: { + field: 'is_delete', + type: dc.ORM.BOOLEAN, + }, + + }, + { + tableName: 'files' + } + ); + + dc.models.Files = Files; + + return Files; +}; diff --git a/api/app/lib/routes/file/index.js b/api/app/lib/routes/file/index.js new file mode 100644 index 00000000..7998ed5f --- /dev/null +++ b/api/app/lib/routes/file/index.js @@ -0,0 +1,21 @@ +'use strict'; + +const pan = require('../../controllers/file'); + +module.exports = function (app, router, opts, panCode) { + + router.get('/create/struct/dir', pan.createProjectDir); + + router.get('/get/file/dirs', pan.getFileDirs); + + router.get('/netdisk-files/dir/delete', pan.delFileDir); + + router.get('/netdisk-files/struct/dir/update', pan.updateStructDir(opts)) + + router.post('/netdisk-files/upload', pan.uploadFile); + + router.get('/netdisk-files/delete', pan.deleteFile); + + router.get('/netdisk-files/query', pan.getFileList); + +}; \ No newline at end of file diff --git a/api/log/development.log b/api/log/development.log index 2542724b..58b473fe 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -10656,3 +10656,6 @@ headers: {} 2022-07-28 18:34:55.231 - error: path: /publicity, error: TypeError: values.map is not a function 2022-07-28 18:35:45.669 - error: path: /publicity, error: TypeError: values.map is not a function 2022-07-28 18:37:40.324 - error: path: /publicity, error: TypeError: values.map is not a function +2022-07-28 21:48:22.652 - debug: [FS-LOGGER] Init. +2022-07-28 21:48:22.760 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-28 21:48:22.760 - info: [FS-AUTH] Inject auth and api mv into router. diff --git a/api/package.json b/api/package.json index 4dab3cf4..45bde8c4 100644 --- a/api/package.json +++ b/api/package.json @@ -5,7 +5,7 @@ "main": "server.js", "scripts": { "test": "set DEBUG=true&&\"node_modules/.bin/mocha\" --harmony --reporter spec app/test/*.test.js", - "start": "set NODE_ENV=development&&node server -p 14000 -g postgres://postgres:123@10.8.30.32:5432/yinjiguanli -f http://localhost:14000", + "start": "set NODE_ENV=development&&node server -p 4000 -g postgres://postgres:123@10.8.30.32:5432/highways4good -f http://localhost:14000", "start:linux": "export NODE_ENV=development&&node server -p 4000 -g postgres://FashionAdmin:123456@10.8.30.39:5432/pm1", "automate": "sequelize-automate -c sequelize-automate.config.js" }, diff --git a/web/Dockerfile b/web/Dockerfile index 9e05d4b0..e5ae3ee8 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -10,6 +10,7 @@ RUN npm config set registry=http://10.8.30.22:7000 RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f RUN npm install --registry http://10.8.30.22:7000 +RUN rm -rf package-lock.json RUN npm run build RUN rm -rf client/src RUN rm -rf node_modules diff --git a/web/client/assets/color.less b/web/client/assets/color.less index 2899426f..c70c4f25 100644 --- a/web/client/assets/color.less +++ b/web/client/assets/color.less @@ -555,18 +555,6 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled], .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active {color: @disabled-color;border-color: @border-color-base;background: @disabled-bg;box-shadow: none;} .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled] > a:only-child, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover > a:only-child, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus > a:only-child, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active > a:only-child {color: currentcolor;} .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled] > a:only-child::after, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover > a:only-child::after, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus > a:only-child::after, .ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active > a:only-child::after {background: transparent;} -a.ant-btn-disabled, -a.ant-btn-disabled:hover, -a.ant-btn-disabled:focus, -a.ant-btn-disabled:active {color: @disabled-color;border-color: transparent;background: transparent;box-shadow: none;} -a.ant-btn-disabled > a:only-child, -a.ant-btn-disabled:hover > a:only-child, -a.ant-btn-disabled:focus > a:only-child, -a.ant-btn-disabled:active > a:only-child {color: currentcolor;} -a.ant-btn-disabled > a:only-child::after, -a.ant-btn-disabled:hover > a:only-child::after, -a.ant-btn-disabled:focus > a:only-child::after, -a.ant-btn-disabled:active > a:only-child::after {background: transparent;} .ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child), .ant-btn-group-rtl.ant-btn-group .ant-btn-primary + .ant-btn-primary {border-right-color: color(~`colorPalette("@{primary-color}", 5)`);border-left-color: @border-color-base;} .ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled], .ant-btn-group-rtl.ant-btn-group .ant-btn-primary + .ant-btn-primary[disabled] {border-right-color: @border-color-base;border-left-color: color(~`colorPalette("@{primary-color}", 5)`);} .ant-picker-calendar {color: @text-color;background: @calendar-full-bg;} @@ -601,6 +589,7 @@ a.ant-btn-disabled:active > a:only-child::after {background: transparent;} .ant-card-type-inner .ant-card-head {background: @background-color-light;} .ant-card-meta-title {color: @heading-color;} .ant-card-meta-description {color: @text-color-secondary;} +.ant-card-loading-block {background: linear-gradient(90deg, fade(@card-skeleton-bg, 20%), fade(@card-skeleton-bg, 40%), fade(@card-skeleton-bg, 20%));background-size: 600% 600%;border-radius: 2px;} .ant-carousel {color: @text-color;} .ant-carousel .slick-slider {-webkit-tap-highlight-color: transparent;} .ant-carousel .slick-prev, .ant-carousel .slick-next {color: transparent;background: transparent;border: 0;} @@ -674,10 +663,8 @@ a.ant-btn-disabled:active > a:only-child::after {background: transparent;} .ant-comment-actions > li > span:hover {color: @comment-action-hover-color;} .ant-picker-status-error.ant-picker, .ant-picker-status-error.ant-picker:not([disabled]):hover {background-color: @input-bg;border-color: #ff4d4f;} .ant-picker-status-error.ant-picker-focused, .ant-picker-status-error.ant-picker:focus {border-color: #ff7875;box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);border-right-width: 1px;} -.ant-picker-status-error.ant-picker .ant-picker-active-bar {background: #ff7875;} .ant-picker-status-warning.ant-picker, .ant-picker-status-warning.ant-picker:not([disabled]):hover {background-color: @input-bg;border-color: #faad14;} .ant-picker-status-warning.ant-picker-focused, .ant-picker-status-warning.ant-picker:focus {border-color: #ffc53d;box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2);border-right-width: 1px;} -.ant-picker-status-warning.ant-picker .ant-picker-active-bar {background: #ffc53d;} .ant-picker {color: @text-color;background: @picker-bg;border: 1px solid @border-color-base;border-radius: 2px;} .ant-picker:hover, .ant-picker-focused {border-color: color(~`colorPalette("@{primary-color}", 5)`);border-right-width: 1px;} .ant-input-rtl .ant-picker:hover, .ant-input-rtl .ant-picker-focused {border-right-width: 0;border-left-width: 1px !important;} @@ -708,7 +695,7 @@ a.ant-btn-disabled:active > a:only-child::after {background: transparent;} .ant-picker-range .ant-picker-active-bar {background: @primary-color;} .ant-picker-dropdown {color: @text-color;} .ant-picker-ranges .ant-picker-preset > .ant-tag-blue {color: @primary-color;background: color(~`colorPalette("@{primary-color}", 1)`);border-color: color(~`colorPalette("@{primary-color}", 3)`);} -.ant-picker-range-arrow {box-shadow: 2px 2px 6px -2px rgba(0, 0, 0, 0.1);border-radius: 0 0 2px;} +.ant-picker-range-arrow {background: linear-gradient(135deg, transparent 40%, @calendar-bg 40%);box-shadow: 2px 2px 6px -2px rgba(0, 0, 0, 0.1);border-radius: 0 0 2px;} .ant-picker-range-arrow::before {background: @calendar-bg;background-repeat: no-repeat;background-position: -10px -10px;} .ant-picker-panel-container {background: @calendar-bg;border-radius: 2px;box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);} .ant-picker-panel-container .ant-picker-panel {background: transparent;border-width: 0 0 1px 0;border-radius: 0;} @@ -814,7 +801,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-dropdown-menu-item.ant-dropdown-menu-item-danger {color: #ff4d4f;} .ant-dropdown-menu-item.ant-dropdown-menu-item-danger:hover {color: #fff;background-color: #ff4d4f;} .ant-dropdown {color: @text-color;} -.ant-dropdown-arrow {border-radius: 0 0 2px;} +.ant-dropdown-arrow {background: linear-gradient(135deg, transparent 40%, @popover-bg 40%);border-radius: 0 0 2px;} .ant-dropdown-arrow::before {background: @popover-bg;background-repeat: no-repeat;background-position: -10px -10px;} .ant-dropdown-placement-top > .ant-dropdown-arrow, .ant-dropdown-placement-topLeft > .ant-dropdown-arrow, .ant-dropdown-placement-topRight > .ant-dropdown-arrow {box-shadow: 3px 3px 7px -3px rgba(0, 0, 0, 0.1);} .ant-dropdown-placement-bottom > .ant-dropdown-arrow, .ant-dropdown-placement-bottomLeft > .ant-dropdown-arrow, .ant-dropdown-placement-bottomRight > .ant-dropdown-arrow {box-shadow: 2px 2px 5px -2px rgba(0, 0, 0, 0.1);} @@ -949,7 +936,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 2px 0 0 2px;} .ant-input-group > .ant-input-rtl:first-child, .ant-input-group-rtl .ant-input-group-addon:first-child {border-radius: 0 2px 2px 0;} .ant-input-group-rtl .ant-input-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;} -.ant-input-group-rtl .ant-input-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} +.ant-input-group-rtl .ant-input-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;} .ant-input-group-rtl.ant-input-group > .ant-input:last-child, .ant-input-group-rtl.ant-input-group-addon:last-child {border-radius: 2px 0 0 2px;} .ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:first-child) {border-radius: 2px 0 0 2px;} .ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:last-child) {border-radius: 0 2px 2px 0;} @@ -957,10 +944,6 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-group-rtl.ant-input-group.ant-input-group-compact > *:first-child, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select:first-child > .ant-select-selector, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select-auto-complete:first-child .ant-input, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-cascader-picker:first-child .ant-input {border-radius: 0 2px 2px 0;} .ant-input-group-rtl.ant-input-group.ant-input-group-compact > *:last-child, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select:last-child > .ant-select-selector, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-select-auto-complete:last-child .ant-input, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-cascader-picker:last-child .ant-input, .ant-input-group-rtl.ant-input-group.ant-input-group-compact > .ant-cascader-picker-focused:last-child .ant-input {border-left-width: 1px;border-radius: 2px 0 0 2px;} .ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 0 2px 2px 0;} -.ant-input-group > .ant-input-rtl:first-child {border-radius: 0 2px 2px 0;} -.ant-input-group > .ant-input-rtl:last-child {border-radius: 2px 0 0 2px;} -.ant-input-group-rtl .ant-input-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;border-radius: 0 2px 2px 0;} -.ant-input-group-rtl .ant-input-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} .ant-input-password-icon.anticon {color: @text-color-secondary;} .ant-input-password-icon.anticon:hover {color: @input-icon-hover-color;} .ant-input-textarea-show-count::after {color: @text-color-secondary;} @@ -1046,7 +1029,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 2px 0 0 2px;} .ant-input-number-group > .ant-input-number-rtl:first-child, .ant-input-number-group-rtl .ant-input-number-group-addon:first-child {border-radius: 0 2px 2px 0;} .ant-input-number-group-rtl .ant-input-number-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;} -.ant-input-number-group-rtl .ant-input-number-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} +.ant-input-number-group-rtl .ant-input-number-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;} .ant-input-number-group-rtl.ant-input-number-group > .ant-input-number:last-child, .ant-input-number-group-rtl.ant-input-number-group-addon:last-child {border-radius: 2px 0 0 2px;} .ant-input-number-group-rtl.ant-input-number-group .ant-input-number-affix-wrapper:not(:first-child) {border-radius: 2px 0 0 2px;} .ant-input-number-group-rtl.ant-input-number-group .ant-input-number-affix-wrapper:not(:last-child) {border-radius: 0 2px 2px 0;} @@ -1054,10 +1037,6 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > *:first-child, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select:first-child > .ant-select-selector, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select-auto-complete:first-child .ant-input, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-cascader-picker:first-child .ant-input {border-radius: 0 2px 2px 0;} .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > *:last-child, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select:last-child > .ant-select-selector, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-select-auto-complete:last-child .ant-input, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-cascader-picker:last-child .ant-input, .ant-input-number-group-rtl.ant-input-number-group.ant-input-number-group-compact > .ant-cascader-picker-focused:last-child .ant-input {border-left-width: 1px;border-radius: 2px 0 0 2px;} .ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search > .ant-input-group > .ant-input {border-radius: 0 2px 2px 0;} -.ant-input-number-group > .ant-input-number-rtl:first-child {border-radius: 0 2px 2px 0;} -.ant-input-number-group > .ant-input-number-rtl:last-child {border-radius: 2px 0 0 2px;} -.ant-input-number-group-rtl .ant-input-number-group-addon:first-child {border-right: 1px solid @border-color-base;border-left: 0;border-radius: 0 2px 2px 0;} -.ant-input-number-group-rtl .ant-input-number-group-addon:last-child {border-right: 0;border-left: 1px solid @border-color-base;border-radius: 2px 0 0 2px;} .ant-input-number-handler {color: @text-color-secondary;border-left: 1px solid @border-color-base;} .ant-input-number-handler:active {background: @input-number-handler-active-bg;} .ant-input-number-handler:hover .ant-input-number-handler-up-inner, .ant-input-number-handler:hover .ant-input-number-handler-down-inner {color: color(~`colorPalette("@{primary-color}", 5)`);} @@ -1313,8 +1292,8 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-pagination-simple .ant-pagination-simple-pager input:hover {border-color: @primary-color;} .ant-pagination-simple .ant-pagination-simple-pager input:focus {border-color: color(~`colorPalette("@{primary-color}", 5)`);box-shadow: 0 0 0 2px fade(@primary-color, 20%);} .ant-pagination-simple .ant-pagination-simple-pager input[disabled] {color: @disabled-color;background: @disabled-bg;border-color: @border-color-base;} -.ant-pagination.ant-pagination-mini .ant-pagination-item:not(.ant-pagination-item-active) {background: transparent;border-color: transparent;} -.ant-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link, .ant-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link {background: transparent;border-color: transparent;} +.ant-pagination.mini .ant-pagination-item:not(.ant-pagination-item-active) {background: transparent;border-color: transparent;} +.ant-pagination.mini .ant-pagination-prev .ant-pagination-item-link, .ant-pagination.mini .ant-pagination-next .ant-pagination-item-link {background: transparent;border-color: transparent;} .ant-pagination.ant-pagination-disabled .ant-pagination-item {background: @disabled-bg;border-color: @border-color-base;} .ant-pagination.ant-pagination-disabled .ant-pagination-item a {color: @disabled-color;background: transparent;border: none;} .ant-pagination.ant-pagination-disabled .ant-pagination-item-active {background: @pagination-item-disabled-bg-active;} @@ -1330,8 +1309,8 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-popover-message {color: @text-color;} .ant-popover-message > .anticon {color: #faad14;} .ant-popover-arrow {background: transparent;} -.ant-popover-arrow-content {--antd-arrow-background-color: @popover-bg;border-radius: 0 0 2px;} -.ant-popover-arrow-content::before {background: var(--antd-arrow-background-color);background-repeat: no-repeat;background-position: -10px -10px;} +.ant-popover-arrow-content {background-color: @popover-bg;border-radius: 0 0 2px;} +.ant-popover-arrow-content::before {background: @popover-bg;background-repeat: no-repeat;background-position: -10px -10px;} .ant-popover-placement-top .ant-popover-arrow-content, .ant-popover-placement-topLeft .ant-popover-arrow-content, .ant-popover-placement-topRight .ant-popover-arrow-content {box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);} .ant-popover-placement-right .ant-popover-arrow-content, .ant-popover-placement-rightTop .ant-popover-arrow-content, .ant-popover-placement-rightBottom .ant-popover-arrow-content {box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);} .ant-popover-placement-bottom .ant-popover-arrow-content, .ant-popover-placement-bottomLeft .ant-popover-arrow-content, .ant-popover-placement-bottomRight .ant-popover-arrow-content {box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.06);} @@ -1387,13 +1366,12 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-radio-wrapper {color: @text-color;} .ant-radio {color: @text-color;} .ant-radio-wrapper:hover .ant-radio, .ant-radio:hover .ant-radio-inner, .ant-radio-input:focus + .ant-radio-inner {border-color: @primary-color;} -.ant-radio-input:focus + .ant-radio-inner {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} +.ant-radio-input:focus + .ant-radio-inner {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} .ant-radio-checked::after {border: 1px solid @primary-color;border-radius: 50%;animation-fill-mode: both;} .ant-radio-inner {background-color: @btn-default-bg;border-color: @border-color-base;border-style: solid;border-width: 1px;border-radius: 50%;} .ant-radio-inner::after {background-color: @primary-color;border-top: 0;border-left: 0;border-radius: 16px;} -.ant-radio.ant-radio-disabled .ant-radio-inner {border-color: @border-color-base;} .ant-radio-checked .ant-radio-inner {border-color: @primary-color;} -.ant-radio-disabled .ant-radio-inner {background-color: @disabled-bg;} +.ant-radio-disabled .ant-radio-inner {background-color: @disabled-bg;border-color: @border-color-base !important;} .ant-radio-disabled .ant-radio-inner::after {background-color: @radio-dot-disabled-color;} .ant-radio-disabled + span {color: @disabled-color;} .ant-radio-button-wrapper {color: @text-color;background: @btn-default-bg;border: 1px solid @border-color-base;border-top-width: 1.02px;border-left-width: 0;} @@ -1403,7 +1381,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-radio-button-wrapper:last-child {border-radius: 0 2px 2px 0;} .ant-radio-button-wrapper:first-child:last-child {border-radius: 2px;} .ant-radio-button-wrapper:hover {color: @primary-color;} -.ant-radio-button-wrapper:focus-within {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} +.ant-radio-button-wrapper:focus-within {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {color: @primary-color;background: @btn-default-bg;border-color: @primary-color;} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before {background-color: @primary-color;} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child {border-color: @primary-color;} @@ -1411,11 +1389,11 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover::before {background-color: color(~`colorPalette("@{primary-color}", 5)`);} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {color: color(~`colorPalette("@{primary-color}", 7)`);border-color: color(~`colorPalette("@{primary-color}", 7)`);} .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active::before {background-color: color(~`colorPalette("@{primary-color}", 7)`);} -.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} +.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {color: @radio-solid-checked-color;background: @primary-color;border-color: @primary-color;} .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {color: @radio-solid-checked-color;background: color(~`colorPalette("@{primary-color}", 5)`);border-color: color(~`colorPalette("@{primary-color}", 5)`);} .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {color: @radio-solid-checked-color;background: color(~`colorPalette("@{primary-color}", 7)`);border-color: color(~`colorPalette("@{primary-color}", 7)`);} -.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px fade(@primary-color, 12%);} +.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {box-shadow: 0 0 0 3px color(~`colorPalette("@{primary-color}", 1)`);} .ant-radio-button-wrapper-disabled {color: @disabled-color;background-color: @disabled-bg;border-color: @border-color-base;} .ant-radio-button-wrapper-disabled:first-child, .ant-radio-button-wrapper-disabled:hover {color: @disabled-color;background-color: @disabled-bg;border-color: @border-color-base;} .ant-radio-button-wrapper-disabled:first-child {border-left-color: @border-color-base;} @@ -1482,11 +1460,14 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle {border-radius: 50%;} .ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle {border-radius: 50%;} .ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle {border-radius: 50%;} -.ant-skeleton-content .ant-skeleton-title {background: @skeleton-color;border-radius: 2px;} -.ant-skeleton-content .ant-skeleton-paragraph > li {background: @skeleton-color;border-radius: 2px;} +.ant-skeleton-content .ant-skeleton-title {background: @skeleton-color;border-radius: 4px;} +.ant-skeleton-content .ant-skeleton-paragraph > li {background: @skeleton-color;border-radius: 4px;} .ant-skeleton-round .ant-skeleton-content .ant-skeleton-title, .ant-skeleton-round .ant-skeleton-content .ant-skeleton-paragraph > li {border-radius: 100px;} -.ant-skeleton-active .ant-skeleton-title, .ant-skeleton-active .ant-skeleton-paragraph > li, .ant-skeleton-active .ant-skeleton-avatar, .ant-skeleton-active .ant-skeleton-button, .ant-skeleton-active .ant-skeleton-input, .ant-skeleton-active .ant-skeleton-image {background: transparent;} -.ant-skeleton-active .ant-skeleton-title::after, .ant-skeleton-active .ant-skeleton-paragraph > li::after, .ant-skeleton-active .ant-skeleton-avatar::after, .ant-skeleton-active .ant-skeleton-button::after, .ant-skeleton-active .ant-skeleton-input::after, .ant-skeleton-active .ant-skeleton-image::after {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);} +.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title, .ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph > li {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} +.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} +.ant-skeleton.ant-skeleton-active .ant-skeleton-button {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} +.ant-skeleton.ant-skeleton-active .ant-skeleton-input {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} +.ant-skeleton.ant-skeleton-active .ant-skeleton-image {background: linear-gradient(90deg, @skeleton-color 25%, @skeleton-to-color 37%, @skeleton-color 63%);background-size: 400% 100%;} .ant-skeleton-element .ant-skeleton-button {background: @skeleton-color;border-radius: 2px;} .ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-circle {border-radius: 50%;} .ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-round {border-radius: 32px;} @@ -1603,7 +1584,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-table.ant-table-bordered.ant-table-scroll-horizontal > .ant-table-container > .ant-table-body > table > tbody > tr.ant-table-expanded-row > td, .ant-table.ant-table-bordered.ant-table-scroll-horizontal > .ant-table-container > .ant-table-body > table > tbody > tr.ant-table-placeholder > td {border-right: 0;} .ant-table.ant-table-bordered > .ant-table-footer {border: 1px solid @border-color-split;border-top: 0;} .ant-table-cell .ant-table-container:first-child {border-top: 0;} -.ant-table-cell-scrollbar:not([rowspan]) {box-shadow: 0 1px 0 1px @table-header-bg;} +.ant-table-cell-scrollbar {box-shadow: 0 1px 0 1px @table-header-bg;} .ant-table {color: @text-color;background: @component-background;border-radius: 2px;} .ant-table table {border-radius: 2px 2px 0 0;border-collapse: separate;border-spacing: 0;} .ant-table-footer {color: @heading-color;background: @background-color-light;} @@ -1654,10 +1635,10 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-table-empty .ant-table-tbody > tr.ant-table-placeholder {color: @disabled-color;} .ant-table-tbody > tr.ant-table-placeholder:hover > td {background: @component-background;} .ant-table-cell-fix-left, .ant-table-cell-fix-right {background: @component-background;} -.ant-table-ping-left:not(.ant-table-has-fix-left) > .ant-table-container::before {box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%);} +.ant-table-ping-left:not(.ant-table-has-fix-left) .ant-table-container::before {box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-ping-left .ant-table-cell-fix-left-first::after, .ant-table-ping-left .ant-table-cell-fix-left-last::after {box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-ping-left .ant-table-cell-fix-left-last::before {background-color: transparent !important;} -.ant-table-ping-right:not(.ant-table-has-fix-right) > .ant-table-container::after {box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%);} +.ant-table-ping-right:not(.ant-table-has-fix-right) .ant-table-container::after {box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-ping-right .ant-table-cell-fix-right-first::after, .ant-table-ping-right .ant-table-cell-fix-right-last::after {box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%);} .ant-table-sticky-holder {background: @component-background;} .ant-table-sticky-scroll {background: lighten(@table-border-color, 80%);border-top: 1px solid @border-color-split;} @@ -1666,7 +1647,6 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-table-sticky-scroll-bar-active {background-color: fade(@table-sticky-scroll-bar-bg, 80%);} .ant-table-title {border-radius: 2px 2px 0 0;} .ant-table-title + .ant-table-container {border-top-left-radius: 0;border-top-right-radius: 0;} -.ant-table-title + .ant-table-container table {border-radius: 0;} .ant-table-title + .ant-table-container table > thead > tr:first-child th:first-child {border-radius: 0;} .ant-table-title + .ant-table-container table > thead > tr:first-child th:last-child {border-radius: 0;} .ant-table-container {border-top-left-radius: 2px;border-top-right-radius: 2px;} @@ -1769,7 +1749,7 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;} .ant-tooltip {color: @text-color;} .ant-tooltip-inner {color: #fff;background-color: @tooltip-bg;border-radius: 2px;box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);} .ant-tooltip-arrow {background: transparent;} -.ant-tooltip-arrow-content {--antd-arrow-background-color: linear-gradient(to right bottom, fadeout(@tooltip-bg, 10%), @tooltip-bg);border-radius: 0 0 2px;} +.ant-tooltip-arrow-content {--antd-arrow-background-color: linear-gradient(to right bottom, fadeout(@tooltip-bg, 10%), @tooltip-bg);background-color: transparent;border-radius: 0 0 2px;} .ant-tooltip-arrow-content::before {background: var(--antd-arrow-background-color);background-repeat: no-repeat;background-position: -10px -10px;} .ant-tooltip-placement-top .ant-tooltip-arrow-content, .ant-tooltip-placement-topLeft .ant-tooltip-arrow-content, .ant-tooltip-placement-topRight .ant-tooltip-arrow-content {box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);} .ant-tooltip-placement-right .ant-tooltip-arrow-content, .ant-tooltip-placement-rightTop .ant-tooltip-arrow-content, .ant-tooltip-placement-rightBottom .ant-tooltip-arrow-content {box-shadow: -3px 3px 7px rgba(0, 0, 0, 0.07);} @@ -1959,7 +1939,6 @@ a.ant-typography.ant-typography-disabled:hover, .ant-typography a.ant-typography .ant-typography pre code {background: transparent;border: 0;} .ant-typography blockquote {border-left: 4px solid rgba(100, 100, 100, 0.2);} .ant-upload {color: @text-color;} -.ant-upload.ant-upload-disabled {color: @disabled-color;} .ant-upload.ant-upload-select-picture-card {background-color: @background-color-light;border: 1px dashed @border-color-base;border-radius: 2px;} .ant-upload.ant-upload-select-picture-card:hover {border-color: @primary-color;} .ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover {border-color: @border-color-base;} @@ -1990,6 +1969,7 @@ a.ant-typography.ant-typography-disabled:hover, .ant-typography a.ant-typography .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete {color: rgba(255, 255, 255, 0.85);} .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover {color: #fff;} .ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item {background-color: @background-color-light;} +.ant-upload-list .ant-upload-animate-inline-appear, .ant-upload-list .ant-upload-animate-inline-enter, .ant-upload-list .ant-upload-animate-inline-leave {animation-fill-mode: cubic-bezier(0.78, 0.14, 0.15, 0.86);} .ant-pro-table-search {background-color: @component-background !important;} .bezierEasingMixin() { @functions: ~`(function() {var NEWTON_ITERATIONS = 4;var NEWTON_MIN_SLOPE = 0.001;var SUBDIVISION_PRECISION = 0.0000001;var SUBDIVISION_MAX_ITERATIONS = 10;var kSplineTableSize = 11;var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);var float32ArraySupported = typeof Float32Array === 'function';function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } @@ -2439,8 +2419,7 @@ this.tinycolor = tinycolor;})()`;} .colorPaletteMixin() { @functions: ~`(function() {var hueStep = 2;var saturationStep = 0.16;var saturationStep2 = 0.05;var brightnessStep1 = 0.05;var brightnessStep2 = 0.15;var lightColorCount = 5;var darkColorCount = 4;var getHue = function(hsv, i, isLight) {var hue;if (hsv.h >= 60 && hsv.h <= 240) {hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;} else {hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;} if (hue < 0) {hue += 360;} else if (hue >= 360) {hue -= 360;} - return Math.round(hue);};var getSaturation = function(hsv, i, isLight) {if (hsv.h === 0 && hsv.s === 0) {return hsv.s;} - var saturation;if (isLight) {saturation = hsv.s - saturationStep * i;} else if (i === darkColorCount) {saturation = hsv.s + saturationStep;} else {saturation = hsv.s + saturationStep2 * i;} + return Math.round(hue);};var getSaturation = function(hsv, i, isLight) {var saturation;if (isLight) {saturation = hsv.s - saturationStep * i;} else if (i === darkColorCount) {saturation = hsv.s + saturationStep;} else {saturation = hsv.s + saturationStep2 * i;} if (saturation > 1) {saturation = 1;} if (isLight && i === lightColorCount && saturation > 0.1) {saturation = 0.1;} if (saturation < 0.06) {saturation = 0.06;} @@ -2897,7 +2876,7 @@ this.tinycolor = tinycolor;})()`;} @cascader-dropdown-line-height: @dropdown-line-height; @anchor-bg: transparent; @anchor-border-color: @border-color-split; -@anchor-link-top: 4px; +@anchor-link-top: 7px; @anchor-link-left: 16px; @anchor-link-padding: @anchor-link-top 0 @anchor-link-top @anchor-link-left; @tooltip-max-width: 250px; @@ -2922,7 +2901,7 @@ this.tinycolor = tinycolor;})()`;} @modal-header-border-style: @border-style-base; @modal-header-title-line-height: 22px; @modal-header-title-font-size: @font-size-lg; -@modal-header-close-size: @modal-header-title-line-height + 2 * @modal-header-padding-vertical; +@modal-header-close-size: 56px; @modal-heading-color: @heading-color; @modal-close-color: @text-color-secondary; @modal-footer-bg: transparent; @@ -2933,7 +2912,6 @@ this.tinycolor = tinycolor;})()`;} @modal-mask-bg: fade(@black, 45%); @modal-confirm-body-padding: 32px 32px 24px; @modal-confirm-title-font-size: @font-size-lg; -@modal-border-radius: @border-radius-base; @progress-default-color: @processing-color; @progress-remaining-color: @background-color-base; @progress-info-text-color: @progress-text-color; diff --git a/web/client/src/components/Upload/index.js b/web/client/src/components/Upload/index.js index eac0a27a..0bd3af10 100644 --- a/web/client/src/components/Upload/index.js +++ b/web/client/src/components/Upload/index.js @@ -54,7 +54,7 @@ class Uploads extends Component { componentWillReceiveProps(np) { const { dispatch, value: thisEditData, onChange } = this.props; - const { value: nextEditData } = np; + const { value: nextEditData, clearFileList } = np; const setFileList = () => { let defaultFileList = []; @@ -92,6 +92,12 @@ class Uploads extends Component { } } } + + if (clearFileList) { + this.setState({ + fileList: [] + }); + } // else{ // this.setState({ // fileList:[], diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js index d4ea9730..f8a6685f 100644 --- a/web/client/src/sections/auth/containers/login.js +++ b/web/client/src/sections/auth/containers/login.js @@ -25,7 +25,7 @@ const Login = props => { }, [error]) useEffect(() => { - user && user.authorized ? dispatch(push('/quanju')) : null + user && user.authorized ? dispatch(push('/screen/cockpit')) : null }, [user]) const enterHandler = e => { diff --git a/web/client/src/sections/fillion/actions/file.js b/web/client/src/sections/fillion/actions/file.js new file mode 100644 index 00000000..2b6adc7f --- /dev/null +++ b/web/client/src/sections/fillion/actions/file.js @@ -0,0 +1,89 @@ +import { basicAction } from '@peace/utils' +import { ApiTable } from '$utils' + + +export function createFileDir(query) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'CREATE_FILE_DIR', + url: ApiTable.createFileDir, + query, + msg: { error: '创建文件夹失败' }, + // reducer: { name: 'uploadFile' } + }); +} + +export function delFileDir(query) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'DEL_FILE_DIR', + url: ApiTable.delFileDir, + query, + msg: { error: '删除文件夹失败' }, + // reducer: { name: 'uploadFile' } + }); +} + +export function queryFileDir(query) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'QUERY_FILE_DIR', + url: ApiTable.queryFileDIr, + query, + msg: { error: '查询文件夹失败' }, + reducer: { name: 'fileDirs' } + }); +} + +export function updateFileDir(query) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'UPDATE_FILE_DIR', + url: ApiTable.updateFileDir, + query, + msg: { error: '更新文件夹名称失败' }, + // reducer: { name: 'fileDirs' } + }); +} + + +// data : {typeId, userId, userName, startDate, endDate, fileSize, fileName, fileUrl, fileExt} +export function uploadFile(data) { + return dispatch => basicAction({ + type: 'post', + dispatch: dispatch, + actionType: 'UPLOAD_FILE', + url: ApiTable.uploadFile, + data, + msg: { error: '上传文件失败' }, + reducer: { name: 'uploadFile' } + }); +} + +export function deleteFile(id) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'DELETE_FILE', + url: ApiTable.deleteFile, + msg: { error: '删除文件数据失败' }, + query: { id }, + reducer: { name: 'fileDel' } + }); +} + +export function getFileList(query) { // fId, limit, offset, searchTxt + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_FILE_LIST', + url: ApiTable.getFileList, + query, + msg: { error: '获取档案数据失败' }, + reducer: { name: 'fileList' } + }); +} \ No newline at end of file diff --git a/web/client/src/sections/fillion/actions/index.js b/web/client/src/sections/fillion/actions/index.js index 2b041438..e807a408 100644 --- a/web/client/src/sections/fillion/actions/index.js +++ b/web/client/src/sections/fillion/actions/index.js @@ -2,7 +2,9 @@ import * as infor from './infor' import * as patrol from './patrol' +import * as file from './file' export default { ...infor, ...patrol, + ...file, } \ No newline at end of file diff --git a/web/client/src/sections/fillion/actions/infor.js b/web/client/src/sections/fillion/actions/infor.js index 2fcc0841..faa48253 100644 --- a/web/client/src/sections/fillion/actions/infor.js +++ b/web/client/src/sections/fillion/actions/infor.js @@ -63,7 +63,7 @@ export function putSpecificVehicle(query) { data: query, actionType: 'put_SPECIFIC_VEHICLE', url: ApiTable.putSpecificVehicle, - msg: { error: '编辑车辆信息失败' }, + msg: { option: '编辑车辆信息' }, }); } @@ -74,7 +74,7 @@ export function putHouseholds(query) { data: query, actionType: 'put_HOUSEHOLDS', url: ApiTable.putHouseholds, - msg: { error: '编辑业户信息失败' }, + msg: { option: '编辑业户信息' }, }); } @@ -107,7 +107,7 @@ export function putRoadway(query) { data: query, actionType: 'PUT_ROADWAY', url: ApiTable.putRoadway, - msg: { error: '编辑道路信息失败' }, + msg: { option: '编辑道路信息' }, }); } @@ -129,7 +129,7 @@ export function putBridge(query) { data: query, actionType: 'PUT_BRIDGE', url: ApiTable.putBridge, - msg: { error: '编辑桥梁信息失败' }, + msg: { option: '编辑桥梁信息' }, }); } @@ -151,7 +151,7 @@ export function putProject(query) { data: query, actionType: 'GET_PROJECT', url: ApiTable.putProject, - msg: { error: '编辑工程信息失败' }, + msg: { option: '编辑工程信息' }, }); } @@ -173,7 +173,7 @@ export function putHighways(query) { data: query, actionType: 'GET_HIGHWAYS', url: ApiTable.putHighways, - msg: { error: '编辑路政信息失败' }, + msg: { option: '编辑路政信息' }, }); } @@ -195,7 +195,7 @@ export function putCircuit(query) { data: query, actionType: 'PUT_CIRCUIT', url: ApiTable.putCircuit, - msg: { error: '编辑线路信息失败' }, + msg: { option: '编辑线路信息' }, }); } @@ -217,7 +217,7 @@ export function putVehicle(query) { data: query, actionType: 'PUT_VEHICLE', url: ApiTable.putVehicle, - msg: { error: '编辑车辆信息失败' }, + msg: { option: '编辑车辆信息' }, }); } @@ -227,7 +227,7 @@ export function delRoadway(query) { dispatch: dispatch, actionType: 'DEL_ROADWAY', url: ApiTable.delRoadway.replace("{roadId}", query?.roadId), - msg: { error: '删除车辆信息失败' }, + msg: { option: '删除车辆信息' }, }); } @@ -237,7 +237,7 @@ export function delProject(query) { dispatch: dispatch, actionType: 'DEL_PROJECT', url: ApiTable.delProject.replace("{projectId}", query?.projectId), - msg: { error: '删除工程信息失败' }, + msg: { option: '删除工程信息' }, }); } @@ -247,7 +247,7 @@ export function delBridge(query) { dispatch: dispatch, actionType: 'DEL_BRIDGE', url: ApiTable.delBridge.replace("{bridgeId}", query?.bridgeId), - msg: { error: '删除桥梁信息失败' }, + msg: { option: '删除桥梁信息' }, }); } @@ -257,7 +257,7 @@ export function delSpecificVehicle(query) { dispatch: dispatch, actionType: 'DEL_SPECIFICVENICLE', url: ApiTable.delSpecificVehicle.replace("{vehicleId}", query?.vehicleId), - msg: { error: '删除车辆信息失败' }, + msg: { option: '删除车辆信息' }, }); } @@ -267,7 +267,7 @@ export function delHouseholds(query) { dispatch: dispatch, actionType: 'DEL_HOUSEHOLDS', url: ApiTable.delHouseholds.replace("{businessId}", query?.businessId), - msg: { error: '删除业户信息失败' }, + msg: { option: '删除业户信息' }, }); } @@ -277,7 +277,7 @@ export function delCircuit(query) { dispatch: dispatch, actionType: 'DEL_CIRCUIT', url: ApiTable.delCircuit.replace("{lineId}", query?.lineId), - msg: { error: '删除运营线路信息失败' }, + msg: { option: '删除运营线路信息' }, }); } @@ -287,7 +287,7 @@ export function delVehicle(query) { dispatch: dispatch, actionType: 'DEL_VEHICLE', url: ApiTable.delVehicle.replace("{carId}", query?.carId), - msg: { error: '删除车辆信息失败' }, + msg: { option: '删除车辆信息' }, }); } @@ -310,7 +310,7 @@ export function putPurchase(query) { data: query, actionType: 'PUT_PURCHASE', url: ApiTable.putPurchase, - msg: { error: '获取治超信息失败' }, + msg: { option: '编辑治超信息' }, }); } @@ -320,7 +320,7 @@ export function delPurchase(query) { dispatch: dispatch, actionType: 'DEL_PURCHASE', url: ApiTable.delPurchase.replace("{overspeedId}", query?.overspeedId), - msg: { error: '删除车辆信息失败' }, + msg: { option: '删除车辆信息' }, }); } \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index 2f46b175..c6761572 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -24,6 +24,7 @@ const BrideTable = (props) => { const [recortd, setRecortd] = useState() const [whichofits, setWhichofits] = useState('qiaoliang') const [delet, setDelet] = useState() + const [differentiate, setDifferentiate] = useState('bridge') const ref = useRef() useEffect(() => { ref.current.reload() }, [whichofits, delet]) @@ -1506,7 +1507,7 @@ const BrideTable = (props) => { return
@@ -1690,7 +1691,7 @@ const BrideTable = (props) => { return
{ deldatas(record.id) }}> @@ -1750,22 +1751,6 @@ const BrideTable = (props) => { setModalRecord(null); } } - //批量导出 - const exports = (ids, counts) => { - // console.log(user); - let reportIds = []; - if (ids.length) - reportIds = ids - else - reportIds = (counts || {}).ids || []; - superagent.post('/_report/http') - .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => { - const resTextIs = res.text.split('/').pop() - window.open( - '/_api/' + - `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) - }) - } return (
@@ -1782,12 +1767,14 @@ const BrideTable = (props) => { key: 'tab1', label: { setWhichofits('qiaoliang') + setDifferentiate('bridge') }}>桥梁{activeKey === 'tab1'}, }, { key: 'tab2', label: { setWhichofits('gongcheng') + setDifferentiate('project') }}>工程一览{activeKey === 'tab2'}, }, @@ -1844,7 +1831,7 @@ const BrideTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - { props.exports(rowSelected, counts) }}> + { props.exports(rowSelected,differentiate) }}>
diff --git a/web/client/src/sections/fillion/components/file/functionMenu.js b/web/client/src/sections/fillion/components/file/functionMenu.js new file mode 100644 index 00000000..b4211d18 --- /dev/null +++ b/web/client/src/sections/fillion/components/file/functionMenu.js @@ -0,0 +1,94 @@ +import React, { useEffect } from 'react'; +import PropTypes from 'prop-types'; +import { delFileDir, queryFileDir, updateFileDir, } from '../../actions/file'; +import './menu.less' +import { message, Modal } from 'antd'; +import { ExclamationCircleOutlined } from '@ant-design/icons' + +const { confirm } = Modal; + +const FunctionMenu = props => { + const { dispatch, onDelDir, selectRoad } = props; + + useEffect(() => { + const box = document.getElementById('tree-box'); + if (box) + box.oncontextmenu = function (e) { + //取消默认的浏览器自带右键 很重要!! + e.preventDefault(); + + //获取我们自定义的右键菜单 + var menu = document.querySelector("#rihgt-click-menu"); + + //根据事件对象中鼠标点击的位置,进行定位 + menu.style.left = e.clientX + 'px'; + menu.style.top = e.clientY + 'px'; + + //改变自定义菜单的高宽,让它显示出来 + menu.style.display = 'block'; + } + + //关闭右键菜单,很简单 + window.onclick = function (e) { + //用户触发click事件就可以关闭了,因为绑定在window上,按事件冒泡处理,不会影响菜单的功能 + document.querySelector('#rihgt-click-menu') ? document.querySelector('#rihgt-click-menu').style.display = 'none' : '' + } + }, [true]) + + const onDeleteDir = () => { + + if (selectRoad) { + const id = selectRoad + dispatch(delFileDir({ id })).then(res => { + const { type } = res; + if (type == 'DEL_FILE_DIR_SUCCESS') { + dispatch(queryFileDir()); + message.success('删除成功') + } else { + message.error('删除失败') + } + }); + } + } + + const showDeleteConfirm = () => { + + confirm({ + title: `是否确认删除该道路?`, + icon: , + // content: 'Some descriptions', + okText: '是', + okType: 'danger', + cancelText: '否', + onOk() { + onDeleteDir(); + }, + onCancel() { + }, + }); + } + + const refreshFileDir = () => { + dispatch(queryFileDir()); + } + + return ( +
+
+
+ 删除 +
+
+
+
+ 刷新 +
+
+
+ + ) +} + +FunctionMenu.propTypes = {} + +export default FunctionMenu \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/file/menu.less b/web/client/src/sections/fillion/components/file/menu.less new file mode 100644 index 00000000..c143c3b8 --- /dev/null +++ b/web/client/src/sections/fillion/components/file/menu.less @@ -0,0 +1,43 @@ +#rihgt-click-menu { + display: none; + font-size: 1.1em; + position: fixed; + width: 200px; + height: auto; + padding: 5px 0px; + border-radius: 5px; + top: 10; + left: 10; + background-color: #fff; + box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24); + color: #333; + z-index: 999; +} + +#rihgt-click-menu .context_item { + height: 32px; + line-height: 32px; + cursor: pointer; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +#rihgt-click-menu .context_item:hover { + background-color: #ddd; +} + +#rihgt-click-menu .context_item .inner_item { + margin: 0px 10px; +} + +#rihgt-click-menu .context_item .inner_item i { + margin: 0 5px 0 0; + font-weight: bold; +} + +#rihgt-click-menu .context_hr { + height: 1px; + border-top: 1px solid #bbb; + margin: 3px 10px; +} \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/file/roadModal.js b/web/client/src/sections/fillion/components/file/roadModal.js new file mode 100644 index 00000000..994b5224 --- /dev/null +++ b/web/client/src/sections/fillion/components/file/roadModal.js @@ -0,0 +1,73 @@ +import React, { useState, useEffect } from 'react' +import PropTypes from 'prop-types'; +import { Modal, Input, Row, Col } from 'antd'; +const { Search } = Input; +const RoadModal = props => { + const { isVisible, onSubmit, onCancel, roads } = props; + const [roadName, setRoadName] = useState(''); + const [isRepeated, setIsRepeated] = useState(true); + + let timer = null; + useEffect(() => { + if (timer) + clearTimeout(timer) + else { + timer = setTimeout(() => { + if (roads.some(item => item.roadName == roadName)) { + setIsRepeated(true) + } else { + setIsRepeated(false); + } + }, 500); + } + + }, [roadName]); + + + useEffect(() => { + if (!isVisible) { + setRoadName('') + setIsRepeated(false) + } + return () => { + setRoadName('') + } + }, [isVisible]) + + + const onInputText = (e) => { + const value = e.target.value; + setRoadName(value); + } + + const onConfirm = () => { + if (!isRepeated) + if (roadName && roadName.trim() != '') { + onSubmit(roadName) + } + } + + + return ( + + + + 请输入道路名称: + + + + + + { + isRepeated ? 道路名称重复 + : '' + } + + + + ) +} + +RoadModal.propTypes = {} + +export default RoadModal \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/file/uploadModal.js b/web/client/src/sections/fillion/components/file/uploadModal.js new file mode 100644 index 00000000..b14b5b49 --- /dev/null +++ b/web/client/src/sections/fillion/components/file/uploadModal.js @@ -0,0 +1,46 @@ +import React, { useState, useEffect } from 'react' +import { Modal, Input, Row, Col } from 'antd'; +import Upload from '../../../../components/Upload'; +const UploadModal = props => { + const { isVisible, onSubmit, onCancel, } = props; + const [files, setFiles] = useState() + + + useEffect(() => { + if (!isVisible) { + } + return () => { + } + }, [isVisible]) + + + + const onConfirm = () => { + onSubmit(files); + } + + const onFileUploaded = (fileList) => { + console.log('fileList: ', fileList); + setFiles(fileList); + } + + return ( + + + + + + ) +} + +UploadModal.propTypes = {} + +export default UploadModal \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/fileTable.js b/web/client/src/sections/fillion/components/fileTable.js new file mode 100644 index 00000000..77fc8cce --- /dev/null +++ b/web/client/src/sections/fillion/components/fileTable.js @@ -0,0 +1,442 @@ +import { connect } from 'react-redux'; +import './protable.less' +import { Card, Button, Row, DatePicker, Input, Modal, message, Image } from 'antd'; +import ProTable from '@ant-design/pro-table'; +import { getFileList, createFileDir, queryFileDir, uploadFile, deleteFile } from '../actions/file'; +import { ExclamationCircleOutlined } from '@ant-design/icons'; +import React, { useEffect, useState } from 'react'; +import { httpDel } from '@peace/utils' +import { PinyinHelper } from '@peace/utils'; +import RoadModal from './file/roadModal'; +// import Pdfh5 from "pdfh5"; +// import "pdfh5/css/pdfh5.css"; +import FunctionMenu from './file/functionMenu'; +const { confirm } = Modal; + +// @ts-ignore +import UploadModal from './file/uploadModal'; + +// var pdfh5 = null; +const DetailList = (props) => { + const { fileList, loading, dispatch, handelRefresh, onPageChange } = props; + const [imgSrc, setImgSrc] = useState({ imageView: false, imgSrc: '' }) + const [pdfView, setPdfView] = useState({ showPDF: false, pdfName: '', pdfurl: '' }) + var tyApiRoot = localStorage.getItem('tyApiRoot') + + // useEffect(() => { + // if (pdfView.showPDF) { + // pdfh5 = new Pdfh5("#pdf-loader", { + // pdfurl: pdfView.pdfurl + // }) + // } + // }, [pdfView]) + + const handleRemove = (record, filePath) => { + if (record) { + dispatch(deleteFile(record.id)).then(res => { + if (res.type == 'DELETE_FILE_SUCCESS') { + message.success("文件删除成功"); + handelRefresh() + } else { + message.error("文件删除失败") + } + }) + } + let url = `${tyApiRoot}/attachments`, msg = {}; + const actionType = "DEL_FILE_RECORD"; + if (filePath) { + httpDel(dispatch, { url, actionType, msg, query: { src: filePath } }) + } + } + const overviewPDF = (record, filePath) => { + setPdfView({ showPDF: true, pdfName: record.fileName, pdfurl: filePath }) + } + + const showDeleteConfirm = (record, filePath) => { + confirm({ + title: '是否确认删除该文件?', + icon: , + // content: 'Some descriptions', + okText: '是', + okType: 'danger', + cancelText: '否', + onOk() { + handleRemove(record, filePath); + }, + onCancel() { + }, + }); + } + + const columns = [ + { + title: '资料名称', + key: 'fileName', + dataIndex: 'fileName', + align: 'center', + }, { + title: '所属道路', + key: 'road', + dataIndex: 'road', + align: 'center', + render: (text, record) => { + return ''; + } + }, { + title: '资料类型', + key: 'address', + dataIndex: 'address', + align: 'center', + render: (text, record) => { + return ''; + } + }, + { + title: '文件类型', + key: 'fileExt', + dataIndex: 'fileExt', + align: 'center' + }, + { + title: '文件大小', + width: 100, + key: 'fileSize', + dataIndex: 'fileSize', + align: 'center', + render: (text, record) => { + let size = 0; + if (record.fileSize < 1024 * 1024) { + size = (record.fileSize / 1024).toFixed(2) + 'KB' + } else { + size = (record.fileSize / 1024 / 1024).toFixed(2) + 'MB' + } + return {size} + } + }, { + title: '创建时间', + key: 'createDate', + dataIndex: 'createDate', + valueType: 'dateTime', + align: 'center' + }, { + title: '操作', + width: 200, + key: 'option', + valueType: 'option', + align: 'center', + render: (text, record) => { + const regEx = /\bhttps?:\/\/[^:\/]+/ig; + const path = record.fileUrl; + const filename = path.substr(path.lastIndexOf("/") + 1); + const filePath = path.replace(regEx, ""); + const filePath_ = `${tyApiRoot}/attachments?src=${filePath}&filename=${filename}`; + + return + {/* {下载} */} + { { + window.open(filePath_); + }} >下载} + + { showDeleteConfirm(record, filePath) }}>删除 + { + ['.png', '.jpg'].some(item => item == record.fileExt) ? + [, + { setImgSrc({ imageView: true, imgSrc: path }) }}>预览] + : '' + } + {/* { + ['.pdf'].some(item => item == record.fileExt) ? + [, + overviewPDF(record, path)}>预览] + : '' + } */} + + }, + }, + ]; + return [ + { + onPageChange(page, pageSize) + } + }} + rowKey="key" + toolBarRender={false} + search={false} + />, + { + setImgSrc({ imageView: value, imgSrc: '' }); + }, + }} + />, + // { + // pdfh5 = null; + // setPdfView({ showPDF: false, pdfName: '', pdfurl: '' }); + // }} + // > + //
+ // + + ]; +}; + + + +const RoadNameList = (props) => { + const [filterRoad, setFilterRoad] = useState([]); + const [addVisible, setAddVisible] = useState(false); + const [selectRoad, setSelectRoad] = useState(); + const { onChange, roads, loading, queryData, dispatch } = props; + const columns = [ + { + title: '道路名称', + key: 'roadName', + dataIndex: 'roadName', + align: 'center', + }, + + ]; + + useEffect(() => { + if (roads && roads instanceof Array) { + setSelectRoad(roads[0].rId) + onChange(roads[0]); + } + }, [roads]) + + useEffect(() => { + if (roads) { + setFilterRoad(roads) + } + }, [roads]) + + var timer = null; + const doRoadNameSearch = (e) => { + const name = e.target.value; + if (timer) { + clearTimeout(timer) + } else { + setTimeout(() => { + let _roads = roads.filter(road => PinyinHelper.isSearchMatched(road.roadName, name)); + setFilterRoad(_roads); + }, 500); + } + } + + const createRoadDir = (roadName) => { + dispatch(createFileDir({ roadName })).then(res => { + if (res.type == 'CREATE_FILE_DIR_SUCCESS') { + setAddVisible(false) + message.success('新增道路文件夹成功'); + dispatch(queryFileDir()) + } + }); + + } + + const onDelDir = () => { + + } + + return ( +
+ { + return record.rId == selectRoad ? 'list-row-actived' : ''; + }} + toolBarRender={() => [ +
+ + +
+ ]} + options={false} + pagination={false} + search={false} + onRow={(record) => { + return { + onClick: () => { + if (record) { + setSelectRoad(record.rId); + onChange(record); + } + }, + }; + }} + /> + { setAddVisible(false) }} + /> + + +
+ + ); +}; + + + +const FileTable = (props) => { + const { roads, fileList, dispatch, fileListLoading, roadsLoading, user } = props; + const [record, setRecord] = useState(); + const [activeTabKey1, setActiveTabKey1] = useState('1'); + const [uploadVisible, setUploadVisible] = useState(false); + const { RangePicker } = DatePicker; + + useEffect(() => { + if (roads && roads instanceof Array) { + setRecord(roads[0]); + } + }, [roads]) + + useEffect(() => { + if (record) { + queryData(); + } + }, [record]) + + const queryData = () => { + const { rId } = record; + dispatch(getFileList({ fId: activeTabKey1, limit: 10, offset: 0, roadId: rId })) + } + + const onPageChange = (page, pageSize) => { + dispatch(getFileList({ fId: activeTabKey1, limit: pageSize, offset: (page - 1) * pageSize, roadId: rId })) + } + + useEffect(() => { + if (record && activeTabKey1) { + queryData(); + } + + }, [activeTabKey1, record]) + + const handelRefresh = () => { + queryData() + } + + const tabList = [ + { + key: '1', + tab: '前期资料', + }, { + key: '2', + tab: '施工资料', + }, { + key: '3', + tab: '竣工资料', + }, { + key: '4', + tab: '维修资料', + }, { + key: '5', + tab: '道路资料', + }, + ]; + const onTab1Change = (key) => { + setActiveTabKey1(key); + }; + + const handleChangeRecord = (newRecord) => { + let target = null; + if (!record || newRecord.rId != record.rId) { + target = newRecord; + } + setRecord(target); + } + const hanleUpload = (fileList) => { + let fileUrl, fileExt, fileName, fileSize; + if (fileList && fileList instanceof Array) { + const file = fileList[0]; + fileName = file.name; + fileExt = fileName.substr(fileName.lastIndexOf('.')); + fileUrl = file.url; + fileSize = file.size; + dispatch(uploadFile({ typeId: activeTabKey1, userId: user.id, fileSize, fileName, fileUrl, fileExt, roadId: record.rId })).then(res => { + if (res.type == 'UPLOAD_FILE_SUCCESS') { + message.success('文件新增成功'); + setUploadVisible(false); + queryData(); + } + }); + } + } + + return ( +
+ + handleChangeRecord(record)} + record={record} + roads={roads} + loading={roadsLoading} /> + + { + onTab1Change(key); + }} + > + + + + + + + + { setUploadVisible(false) }} + onSubmit={hanleUpload} + /> +
+ + ); +}; + +function mapStateToProps(state) { + const { fileDirs, fileList, auth } = state; + return { + roads: fileDirs.data, + roadsLoading: fileDirs.isRequesting, + fileList: fileList.data, + fileListLoading: fileList.isRequesting, + user: auth.user, + }; +} +export default connect(mapStateToProps)(FileTable); \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/highways/highwaysdata.js b/web/client/src/sections/fillion/components/highways/highwaysdata.js index 854781da..c5bc3851 100644 --- a/web/client/src/sections/fillion/components/highways/highwaysdata.js +++ b/web/client/src/sections/fillion/components/highways/highwaysdata.js @@ -47,7 +47,7 @@ const HightModal = (props) => { }} initialValues={recortd} > - {typecard == '111' ? + {typecard == 'compile' ? { } else { setModalRecord(null); } -} - //批量导出 -const exports = (ids, counts) => { - // console.log(user); - let reportIds = []; - if (ids.length) - reportIds = ids - else - reportIds = (counts || {}).ids || []; - superagent.post('/_report/http') - .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => { - const resTextIs = res.text.split('/').pop() - window.open( - '/_api/' + - `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) - }) -} +} const columns = [ { @@ -91,7 +75,7 @@ const exports = (ids, counts) => { return
diff --git a/web/client/src/sections/fillion/components/infor/details.js b/web/client/src/sections/fillion/components/infor/details.js index 73b24c7d..4df3a38c 100644 --- a/web/client/src/sections/fillion/components/infor/details.js +++ b/web/client/src/sections/fillion/components/infor/details.js @@ -1,12 +1,12 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { Form, Spin, Table } from 'antd'; -import { DrawerForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form'; +import { DrawerForm, ProForm, ProFormText, ProFormSelect,ProFormDatePicker } from '@ant-design/pro-form'; import { putRoadway, putSpecificVehicle, putHouseholds, putCircuit, putVehicle, putPurchase } from "../../actions/infor" import { putBridge } from "../../actions/infor" -import _ from 'lodash' +import _ from 'lodash' const UserModal = (props) => { - const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, setRecortd, setMonitor,setDelet,whichofits } = props + const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, setRecortd, setMonitor, setDelet, whichofits } = props const [newlys, setNewlys] = useState() //必填数据 const [newlysay, setNewlysay] = useState() //处理hou const [records, setRecords] = useState()//处理 @@ -70,6 +70,7 @@ const UserModal = (props) => { array.push({ name: value, type: key }) }); setNewlys(array?.splice(0, 2)) + array?.splice(6, 1) setNewlysay(array) } }, []) @@ -150,122 +151,142 @@ const UserModal = (props) => { onFinish={(values) => { if (Object.values(values).length > 0) { if (rewkeys === 'transportation') { - - if (typecard == '111') { + + if (typecard == 'compile') { setDelet(values) const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' } dispatch(putRoadway(query)).then((res) => { - - }) - return true + }) + return true } else { setDelet(values) const query = { ...values, level: whichofits } dispatch(putRoadway(query)).then((res) => { - - }) + return true } + } if (rewkeys === 'bridge') { - if (typecard == '111') { - setDelet(values) - const query = { ...values, roadId: records?.[0]?.value || '' } + if (typecard == 'compile') { + setDelet(values) + const query = { ...values, bridgeId: records?.[0]?.value || '' } dispatch(putBridge(query)).then((res) => { - + }) return true } else { - setDelet(values) + setDelet(values) const query = { ...values } dispatch(putBridge(query)).then((res) => { - + + }) + return true + } + } + if (rewkeys === 'weihuo') { + if (typecard == 'compile') { + + setDelet(values) + const query = { ...values, vehicleId: records?.[0]?.value || '', type: '危货' } + dispatch(putSpecificVehicle(query)).then((res) => { + + }) + return true + } else { + + setDelet(values) + const query = { ...values, type: '危货' } + dispatch(putSpecificVehicle(query)).then((res) => { + }) return true } } - if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { - if (typecard == '111') { + if (rewkeys === 'chuzu') { + if (typecard == 'compile') { + setDelet(values) - const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys == 'chuzu' ? '出租车' : '危货' } + const query = { ...values, vehicleId: records?.[0]?.value || '', type: '出租车' } dispatch(putSpecificVehicle(query)).then((res) => { - + }) return true } else { - setDelet(values) - const query = { ...values, type: rewkeys == 'chuzu' ? '出租车' : '危货' } + + setDelet(values) + const query = { ...values, type: '出租车' } dispatch(putSpecificVehicle(query)).then((res) => { - + }) return true } } if (rewkeys === 'yehu') { - if (typecard == '111') { + if (typecard == 'compile') { setDelet(values) - const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } + const query = { ...values, businessId: records?.[0]?.value, type: values.type } dispatch(putHouseholds(query)).then((res) => { - + }) return true } else { - setDelet(values) - const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } + setDelet(values) + const query = { ...values, type: values.type } dispatch(putHouseholds(query)).then((res) => { - + }) return true } } if (rewkeys === 'xianlu') { - if (typecard == '111') { + if (typecard == 'compile') { setDelet(values) const query = { ...values, lineId: records?.[0]?.value || '' } dispatch(putCircuit(query)).then((res) => { - + }) return true } else { - setDelet(values) + setDelet(values) const query = { ...values } dispatch(putCircuit(query)).then((res) => { - + }) return true } } if (rewkeys === 'cheliang') { - if (typecard == '111') { + if (typecard == 'compile') { setDelet(values) const query = { ...values, carId: records?.[0]?.value || '' } dispatch(putVehicle(query)).then((res) => { - + }) return true } else { - setDelet(values) + setDelet(values) const query = { ...values } dispatch(putVehicle(query)).then((res) => { - + }) return true } } if (rewkeys === 'zhichao') { - if (typecard == '111') { + if (typecard == 'compile') { setDelet(values) const query = { ...values, overspeedId: records?.[0]?.value || '' } dispatch(putPurchase(query)).then((res) => { - + setMonitor(res) }) return true } else { - setDelet(values) + setDelet(values) const query = { ...values } dispatch(putPurchase(query)).then((res) => { - + setMonitor(res) }) return true @@ -276,14 +297,13 @@ const UserModal = (props) => { }} initialValues={recortd} > - {typecard == '111' ? + {typecard == 'compile' ? { name={newlys?.[1]?.type} width="md" label={newlys?.[1]?.name} - + placeholder="请输入名称" value={recordsay?.[1]?.value} // rules={[{ required: true, message: "必填" }]} @@ -312,6 +332,7 @@ const UserModal = (props) => { label='类型' /> : null } + {rewkeys === 'zhichao'?:''} {newlysay?.map((item, index) => { return { name={newlys?.[0]?.type} width="md" label={newlys?.[0]?.name} - + placeholder="请输入名称" // value={recordssy?.[0]?.value} // rules={[{ required: true, message: "必填" }]} @@ -333,7 +354,7 @@ const UserModal = (props) => { name={newlys?.[1]?.type} width="md" label={newlys?.[1]?.name} - + placeholder="请输入名称" // value={recordssy?.[1]?.value} // rules={[{ required: true, message: "必填" }]} @@ -354,10 +375,11 @@ const UserModal = (props) => { label='类型' /> : null } + {rewkeys === 'zhichao'?:''} {newlysay?.map((item, index) => { return })} diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index 11b05946..44b26b61 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -35,22 +35,6 @@ const InForTable = (props) => { setModalRecord(null); } } - //批量导出 - const exports = (ids, counts) => { - // console.log(user); - let reportIds = []; - if (ids.length) - reportIds = ids - else - reportIds = (counts || {}).ids || []; - superagent.post('/_report/http') - .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => { - const resTextIs = res.text.split('/').pop() - window.open( - '/_api/' + - `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) - }) - } const deldata = (id) => { // 治超删除 const query = { overspeedId: id @@ -213,7 +197,7 @@ const InForTable = (props) => { dataIndex: 'createdAt', valueType: 'date', render: (dom, record) => { - return record.testTime + return record.testTime.slice(0,10) }, fieldProps: { onChange: (value, cs) => { @@ -369,7 +353,7 @@ const InForTable = (props) => { return
@@ -463,7 +447,10 @@ const InForTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - { props.exports(rowSelected, counts) }}> + { + console.log(rowSelected) + + props.exports(rowSelected, counts) }}>
@@ -710,7 +697,7 @@ const OperaTionalTable = (props) => { return
{ deldata(record.id) }}> @@ -1343,7 +1330,7 @@ const OperaTionalTable = (props) => { return
{ deldata(record.id) }}> @@ -1813,7 +1800,7 @@ const OperaTionalTable = (props) => { return
{ deldatas(record.id) }}> @@ -1880,6 +1867,8 @@ const OperaTionalTable = (props) => { label: { { setRewkeys('chuzu') + setDifferentiate('vehicle') + setGenre('出租车') } }}>出租车{activeKey === 'tab2'}, @@ -1889,13 +1878,17 @@ const OperaTionalTable = (props) => { label: { { setRewkeys('weihuo') + setDifferentiate('vehicle') + setGenre('危货') + } }}>危险货运{activeKey === 'tab3'}, }, { key: 'tab4', label: { - setRewkeys('yehu') + setDifferentiate('business') + setRewkeys('yehu') }}>业户{activeKey === 'tab4'}, }, @@ -1973,7 +1966,7 @@ const OperaTionalTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - ['tab2', 'tab3', 'tab4'].includes(activeKey) ? { props.exports(rowSelected, counts) }}> + ['tab2', 'tab3', 'tab4'].includes(activeKey) ? { props.exports(rowSelected,differentiate,genre) }}> { deldata(record.id) }}> @@ -1119,7 +1103,7 @@ const PublicTable = (props) => { return
{ deldatas(record.id) }}> diff --git a/web/client/src/sections/fillion/components/transportationTable.js b/web/client/src/sections/fillion/components/transportationTable.js index 7992b4e7..53cba191 100644 --- a/web/client/src/sections/fillion/components/transportationTable.js +++ b/web/client/src/sections/fillion/components/transportationTable.js @@ -21,6 +21,8 @@ const TransporTationTable = (props) => { const [recortd, setRecortd] = useState() const [whichofits, setWhichofits] = useState('县') const [delet, setDelet] = useState() + const [differentiate, setDifferentiate] = useState('road') + const [grade, setGrade] = useState('县') const ref = useRef() useEffect(() => { ref.current.reload() }, [whichofits, delet]) //打开弹窗 @@ -60,22 +62,6 @@ const TransporTationTable = (props) => { setDelet(res) }) } - //批量导出 - const exports = (ids, counts) => { - // console.log(user); - let reportIds = []; - if (ids.length) - reportIds = ids - else - reportIds = (counts || {}).ids || []; - superagent.post('/_report/http') - .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => { - const resTextIs = res.text.split('/').pop() - window.open( - '/_api/' + - `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) - }) - } const columns = { tab1: [ { @@ -1192,7 +1178,7 @@ const TransporTationTable = (props) => { onClick={() => { setRecortd(record) openModal('edit', record) - setTypecard('111') + setTypecard('compile') }} >编辑 { deldata(record.id) }}> @@ -3750,23 +3736,33 @@ const TransporTationTable = (props) => { key: 'tab1', label: { setWhichofits('县') + setDifferentiate('road') + setGrade('县') }}>县道{activeKey === 'tab1'}, }, { key: 'tab2', label: { setWhichofits('乡') + setGrade('乡') + setDifferentiate('road') + }}>乡道{activeKey === 'tab2'}, }, { key: 'tab3', label: { setWhichofits('村') + setDifferentiate('road') + setGrade('村') + }}>村道{activeKey === 'tab3'}, }, { key: 'tab4', label: { setWhichofits('gongcheng') + setDifferentiate('project') + }}>工程一览{activeKey === 'tab4'}, }, ], @@ -3846,7 +3842,7 @@ const TransporTationTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - { props.exports(rowSelected, counts) }}> + { props.exports(rowSelected,grade,differentiate) }}>