diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html
index 0f755d1..1a45de2 100644
--- a/src/main/resources/static/index.html
+++ b/src/main/resources/static/index.html
@@ -26,6 +26,11 @@
margin: 0;
margin-left: 15px;
}
+ .selectd{
+ padding-top: 1%;
+ color: #FFFFFF;
+ font-size: 20px;
+ }
+
-
@@ -100,6 +128,7 @@
+
diff --git a/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js b/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js
index adf6270..72a6151 100644
--- a/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js
+++ b/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js
@@ -19,11 +19,21 @@ let files1, files2;
let proId, proName, majorId, majorName, gxId, gxName;
let formData;
-layui.use(['laydate', 'upload'], function () {
+
+let selectedProId = localStorage.getItem('selectedProId');
+let selectedProName = localStorage.getItem('selectedProName');
+
+let selectedMajor = localStorage.getItem('selectedMajor');
+let selectedMajorName = localStorage.getItem('selectedMajorName');
+
+let selectedGxId = localStorage.getItem('selectedGxId');
+let selectedGxName = localStorage.getItem('selectedGxName');
+layui.use(['laydate', 'upload', 'form'], function () {
var upload = layui.upload;
var layer = layui.layer;
var element = layui.element;
var $ = layui.$;
+ var forms = layui.form;
var violation = JSON.stringify({
uploadType: 1, // 上传类型
@@ -221,8 +231,34 @@ function setParams(params) {
processList = getProcessSelected();
if (idParam) {
getUserById();
- }
+ }else{
+ setTimeout(function () {
+ var s = parent.$('#proId').val()
+ alert(s);
+ if(selectedProId){
+ proId = selectedProId ;
+ proName = selectedProName;
+ $('#proId option[value=' + selectedProId + ']').attr('selected', true)
+ layui.form.render('select')
+ }
+ if(selectedMajor){
+ majorId = selectedMajor ;
+ majorName = selectedMajorName;
+ $('#majorId option[value=' + selectedMajor + ']').attr('selected', true)
+ layui.form.render('select')
+ }
+
+ if(selectedMajor && selectedGxId){
+ let gxs = getGxsSelect(selectedMajor);
+ setSelectValueName(gxs, 'gxId', '请选择工序');
+ gxId = selectedGxId ;
+ gxName = selectedGxName;
+ $('#gxId option[value=' + selectedGxId + ']').attr('selected', true)
+ layui.form.render('select')
+ }
+ },100)
+ }
form.on('select(proId)', function (data) {
// 获取选中的 id 和 name
const selectedId = data.value; // 获取选中项的 value 值
@@ -266,6 +302,8 @@ function setParams(params) {
formData = data;
uploadPhoto()
});
+
+
});
}
diff --git a/src/main/resources/static/js/main.js b/src/main/resources/static/js/main.js
index a046122..4b236b3 100644
--- a/src/main/resources/static/js/main.js
+++ b/src/main/resources/static/js/main.js
@@ -1,81 +1,88 @@
-let urlIds=new Array();
+let urlIds = new Array();
initMenu();
initsy();
-function initMenu(){
- $.ajax({
- url: ctxPath + "/permissions/current",
- type:"get",
- async:false,
- success:function(result){
- if (result.status === 200) {
- var data = result.data
- console.log(data);
- if(!$.isArray(data)){
- location.href=ctxPath + '/login.html';
- return;
- }
- var menu = $("#menu");
- $.each(data, function(i,item){
- var a = $("");
- var css = item.css;
- if(css!=null && css!=""){
- a.append("");
- }
- a.append(""+item.name+"");
- a.attr("lay-id", item.id);
- urlIds.push(item.id);
- var href = item.href;
- if(href != null && href != ""){
- a.attr("data-url", href);
- }
+getMajorSelected();
+getProcessSelected();
+getProSelected();
- var li = $("
");
- if (i == 0) {
- li.addClass("layui-nav-itemed");
- }
- li.append(a);
- menu.append(li);
- //多级菜单
- setChild(li, item.child)
- });
- localStorage.setItem("uelData",urlIds.join("@"));
- } else if (result.status === 500) {
- layer.alert(result.msg, {icon: 2})
- }
+function initMenu() {
+ $.ajax({
+ url: ctxPath + "/permissions/current",
+ type: "get",
+ async: false,
+ success: function (result) {
+ if (result.status === 200) {
+ var data = result.data
+ console.log(data);
+ if (!$.isArray(data)) {
+ location.href = ctxPath + '/login.html';
+ return;
+ }
+ var menu = $("#menu");
- }, error : function(xhr, textStatus, errorThrown) {
- var msg = xhr.responseText;
- var response = JSON.parse(msg);
- var status = response.status;
- var code = response.code;
- if (status == 401 || code == 401) {
- localStorage.removeItem("token");
- }
- }
- });
+ $.each(data, function (i, item) {
+ var a = $("");
+ var css = item.css;
+ if (css != null && css != "") {
+ a.append("");
+ }
+ a.append("" + item.name + "");
+ a.attr("lay-id", item.id);
+ urlIds.push(item.id);
+ var href = item.href;
+ if (href != null && href != "") {
+ a.attr("data-url", href);
+ }
+
+ var li = $("");
+ if (i == 0) {
+ li.addClass("layui-nav-itemed");
+ }
+ li.append(a);
+ menu.append(li);
+ //多级菜单
+ setChild(li, item.child)
+ });
+ localStorage.setItem("uelData", urlIds.join("@"));
+ } else if (result.status === 500) {
+ layer.alert(result.msg, {icon: 2})
+ }
+
+ }, error: function (xhr, textStatus, errorThrown) {
+ var msg = xhr.responseText;
+ var response = JSON.parse(msg);
+ var status = response.status;
+ var code = response.code;
+ if (status == 401 || code == 401) {
+ localStorage.removeItem("token");
+ }
+ }
+ });
}
+
function initsy() {
- var $tabs=$('#menu');
- var $tabsTitle = $tabs.find('.layui-nav-item a');
- $.each($tabsTitle,function(idx, ele){
- var id=$(ele).attr("lay-id");
- $("#sy").attr("src","pages/home/home.html?token="+localStorage.getItem("token"));
- })
+ var $tabs = $('#menu');
+ var $tabsTitle = $tabs.find('.layui-nav-item a');
+ $.each($tabsTitle, function (idx, ele) {
+ var id = $(ele).attr("lay-id");
+ $("#sy").attr("src", "pages/home/home.html?token=" + localStorage.getItem("token"));
+ })
}
-function setChild(parentElement, child){
- if(child != null && child.length > 0){
- $.each(child, function(j,item2){
+
+function setChild(parentElement, child) {
+ if (child != null && child.length > 0) {
+ $.each(child, function (j, item2) {
var ca = $("");
ca.attr("data-url", item2.href);
ca.attr("lay-id", item2.id);
- urlIds.push(item2.id)
+ urlIds.push(item2.id)
var css2 = item2.css;
- if(css2!=null && css2!=""){
- ca.append("");
+ if (css2 != null && css2 != "") {
+ ca.append("");
}
- ca.append(""+item2.name+"");
+ ca.append("" + item2.name + "");
var dd = $("");
dd.append(ca);
@@ -91,159 +98,174 @@ function setChild(parentElement, child){
// 登陆用户头像昵称
showLoginInfo();
-function showLoginInfo(){
- $.ajax({
- type : 'get',
- url : ctxPath + '/users/current',
- async : false,
- success : function(result) {
- if (result.status === 200) {
- let data = result.data
- $(".admin-header-user span").text(data.nickname);
- var pro = window.location.protocol;
- var host = window.location.host;
- var domain = pro + "//" + host;
+function showLoginInfo() {
+ $.ajax({
+ type: 'get',
+ url: ctxPath + '/users/current',
+ async: false,
+ success: function (result) {
+ if (result.status === 200) {
+ let data = result.data
+ $(".admin-header-user span").text(data.nickname);
- var sex = data.sex;
- var url = data.headImgUrl;
- if(url == null || url == ""){
- if(sex == 1){
- url = ctxPath + "/img/avatars/sunny.png";
- } else {
- url = ctxPath + "/img/avatars/1.png";
- }
+ var pro = window.location.protocol;
+ var host = window.location.host;
+ var domain = pro + "//" + host;
- url = domain + url;
- } else {
- url = domain + "/statics" + url;
- }
- var img = $(".admin-header-user img");
- img.attr("src", url);
- }else if (result.status === 500) {
- layer.alert(result.msg, {icon: 2})
- }
- }
- });
+ var sex = data.sex;
+ var url = data.headImgUrl;
+ if (url == null || url == "") {
+ if (sex == 1) {
+ url = ctxPath + "/img/avatars/sunny.png";
+ } else {
+ url = ctxPath + "/img/avatars/1.png";
+ }
+
+ url = domain + url;
+ } else {
+ url = domain + "/statics" + url;
+ }
+ var img = $(".admin-header-user img");
+ img.attr("src", url);
+ } else if (result.status === 500) {
+ layer.alert(result.msg, {icon: 2})
+ }
+ }
+ });
}
-
-
-function logout(){
- $.ajax({
- type : 'get',
- url : ctxPath + '/logout',
- success : function(data) {
- localStorage.removeItem("token");
- location.href= ctxPath + '/login.html';
- }
- });
+function logout() {
+ $.ajax({
+ type: 'get',
+ url: ctxPath + '/logout',
+ success: function (data) {
+ localStorage.removeItem("token");
+ location.href = ctxPath + '/login.html';
+ }
+ });
}
-function changeUserPwd(){
+function changeUserPwd() {
- let param = {
- 'id': '',
- 'type': '2'
- }
- openIframe2("addOrEditUnifyUser", '修改密码', "pages/user/changeMessage.html", '770px', '400px', param);
+ let param = {
+ 'id': '',
+ 'type': '2'
+ }
+ openIframe2("addOrEditUnifyUser", '修改密码', "pages/user/changeMessage.html", '770px', '400px', param);
}
var active;
-var element ;
+var element;
+var form;
- layui.use(['layer', 'element'], function() {
- var $ = layui.jquery,
- layer = layui.layer;
- element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
- element.on('nav(demo)', function(elem){
- //layer.msg(elem.text());
+layui.use(['form', 'layer', 'element'], function () {
+
+ form = layui.form;
+ var $ = layui.jquery,
+ layer = layui.layer;
+ element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
+ element.on('nav(demo)', function (elem) {
+ //layer.msg(elem.text());
});
-
- //触发事件
- active = {
- tabAdd: function(obj){
- var lay_id = $(this).attr("lay-id");
- var title = $(this).html() + '';
- //新增一个Tab项
- element.tabAdd('admin-tab', {
- title: title,
- content: '',
- id: lay_id
- });
- element.tabChange("admin-tab", lay_id);
- },
- tabDelete: function(lay_id){
- element.tabDelete("admin-tab", lay_id);
- },
- tabChange: function(lay_id){
- element.tabChange('admin-tab', lay_id);
- }
- };
- //添加tab
- $(document).on('click','a',function(){
- if(!$(this)[0].hasAttribute('data-url') || $(this).attr('data-url')===''){
- return;
- }
- var tabs = $(".layui-tab-title").children();
- var lay_id = $(this).attr("lay-id");
- for(var i = 0; i < tabs.length; i++) {
- if($(tabs).eq(i).attr("lay-id") == lay_id) {
- active.tabChange(lay_id);
- return;
- }
- }
- active["tabAdd"].call(this);
- resize();
- });
-
+ //触发事件
+ active = {
+ tabAdd: function (obj) {
+ var lay_id = $(this).attr("lay-id");
+ var title = $(this).html() + '';
+ //新增一个Tab项
+ element.tabAdd('admin-tab', {
+ title: title,
+ content: '',
+ id: lay_id
+ });
+ element.tabChange("admin-tab", lay_id);
+ },
+ tabDelete: function (lay_id) {
+ element.tabDelete("admin-tab", lay_id);
+ },
+ tabChange: function (lay_id) {
+ element.tabChange('admin-tab', lay_id);
+ }
+ };
+ //添加tab
+ $(document).on('click', 'a', function () {
+ if (!$(this)[0].hasAttribute('data-url') || $(this).attr('data-url') === '') {
+ return;
+ }
+ var tabs = $(".layui-tab-title").children();
+ var lay_id = $(this).attr("lay-id");
+
+ for (var i = 0; i < tabs.length; i++) {
+ if ($(tabs).eq(i).attr("lay-id") == lay_id) {
+ active.tabChange(lay_id);
+ return;
+ }
+ }
+ active["tabAdd"].call(this);
+ resize();
+ });
+
+
+ $(window).on('resize', function () {
+ var $content = $('.admin-nav-card .layui-tab-content');
+ $content.height($(this).height() - 147);
+ $content.find('iframe').each(function () {
+ $(this).height($content.height());
+ });
+ }).resize();
+
+ //toggle左侧菜单
+ $('.admin-side-toggle').on('click', function () {
+ var sideWidth = $('#admin-side').width();
+ if (sideWidth === 200) {
+ $('#admin-body').animate({
+ left: '0'
+ });
+ $('#admin-footer').animate({
+ left: '0'
+ });
+ $('#admin-side').animate({
+ width: '0'
+ });
+ } else {
+ $('#admin-body').animate({
+ left: '200px'
+ });
+ $('#admin-footer').animate({
+ left: '200px'
+ });
+ $('#admin-side').animate({
+ width: '200px'
+ });
+ }
+ });
+
+ //手机设备的简单适配
+ var treeMobile = $('.site-tree-mobile'),
+ shadeMobile = $('.site-mobile-shade');
+ treeMobile.on('click', function () {
+ $('body').addClass('site-mobile');
+ });
+ shadeMobile.on('click', function () {
+ $('body').removeClass('site-mobile');
+ });
+
+ // 监听选择事件并存储选中的值
+ document.getElementById('majorId').addEventListener('change', function () {
+ const selectElement = event.target;
+ const selectedId = selectElement.value; // 获取选中项的 value (id)
+ if (selectedId === '' || selectedId == '') {
+ setSelectValueName("", 'gxId', '请先选择专业');
+ } else {
+ let gxs = getGxsSelect(selectedId);
+ setSelectValueName(gxs, 'gxId', '请选择工序');
+ }
+ });
- $(window).on('resize', function() {
- var $content = $('.admin-nav-card .layui-tab-content');
- $content.height($(this).height() - 147);
- $content.find('iframe').each(function() {
- $(this).height($content.height());
- });
- }).resize();
-
- //toggle左侧菜单
- $('.admin-side-toggle').on('click', function() {
- var sideWidth = $('#admin-side').width();
- if(sideWidth === 200) {
- $('#admin-body').animate({
- left: '0'
- });
- $('#admin-footer').animate({
- left: '0'
- });
- $('#admin-side').animate({
- width: '0'
- });
- } else {
- $('#admin-body').animate({
- left: '200px'
- });
- $('#admin-footer').animate({
- left: '200px'
- });
- $('#admin-side').animate({
- width: '200px'
- });
- }
- });
-
- //手机设备的简单适配
- var treeMobile = $('.site-tree-mobile'),
- shadeMobile = $('.site-mobile-shade');
- treeMobile.on('click', function () {
- $('body').addClass('site-mobile');
- });
- shadeMobile.on('click', function () {
- $('body').removeClass('site-mobile');
- });
});
/**
@@ -252,33 +274,75 @@ var element ;
* @param lay_id
* @param title
*/
-function parentOpen(url,lay_id,title){
- const isContained = urlIds.includes(lay_id);
- if(!isContained){
- return;
- }
+function parentOpen(url, lay_id, title) {
+ const isContained = urlIds.includes(lay_id);
+ if (!isContained) {
+ return;
+ }
- if ($(".layui-tab-title li[lay-id='" + lay_id + "']").length > 0) {
- active.tabChange(lay_id);
- return;
- }
- element.tabAdd('admin-tab', {
- title: title,
- content: '',
- id: lay_id
- });
+ if ($(".layui-tab-title li[lay-id='" + lay_id + "']").length > 0) {
+ active.tabChange(lay_id);
+ return;
+ }
+ element.tabAdd('admin-tab', {
+ title: title,
+ content: '',
+ id: lay_id
+ });
- element.tabChange("admin-tab", lay_id);
- resize();
+ element.tabChange("admin-tab", lay_id);
+ resize();
}
//iframe自适应
-function resize(){
- var $content = $('.admin-nav-card .layui-tab-content');
- $content.height($(this).height() - 147);
- $content.find('iframe').each(function() {
- $(this).height($content.height());
- });
+function resize() {
+ var $content = $('.admin-nav-card .layui-tab-content');
+ $content.height($(this).height() - 147);
+ $content.find('iframe').each(function () {
+ $(this).height($content.height());
+ });
}
+/**
+ * 获取工程数据
+ */
+function getProSelected() {
+ let url = dataUrl + '/sys/select/getProsSelect';
+ let data = {
+ encryptedData: encryptCBC(JSON.stringify({}))
+ }
+ ajaxRequest(url, "POST", data, true, function () {
+ }, function (result) {
+ if (result.code === 200) {
+ setSelectValueName(result.data, 'proId', "请选择项目(可搜索)");
+ } else {
+ layer.alert(result.msg, {icon: 2})
+ }
+ }, function (xhr) {
+ error(xhr)
+ });
+}
+/**
+ * 获取专业数据
+ */
+function getMajorSelected() {
+ let url = dataUrl + '/sys/select/getProfessionSelect';
+ ajaxRequest(url, "GET", null, true, function () {
+ }, function (result) {
+ if (result.code === 200) {
+ setSelectValueName(result.data, 'majorId', "请选择专业");
+ } else {
+ layer.alert(result.msg, {icon: 2})
+ }
+ }, function (xhr) {
+ error(xhr)
+ });
+}
+
+/**
+ * 获取工序数据
+ */
+function getProcessSelected() {
+ setSelectValueName("", 'gxId', '请先选择专业');
+}
\ No newline at end of file
diff --git a/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html b/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html
index 4c702a2..ec9a2b1 100644
--- a/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html
+++ b/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html
@@ -71,15 +71,15 @@
-